package n9; import java.io.Closeable; import n9.x; /* loaded from: classes2.dex */ public final class g0 implements Closeable { /* renamed from: a, reason: collision with root package name */ final e0 f12360a; /* renamed from: b, reason: collision with root package name */ final c0 f12361b; /* renamed from: c, reason: collision with root package name */ final int f12362c; /* renamed from: d, reason: collision with root package name */ final String f12363d; /* renamed from: e, reason: collision with root package name */ final w f12364e; /* renamed from: f, reason: collision with root package name */ final x f12365f; /* renamed from: g, reason: collision with root package name */ final h0 f12366g; /* renamed from: h, reason: collision with root package name */ final g0 f12367h; /* renamed from: i, reason: collision with root package name */ final g0 f12368i; /* renamed from: j, reason: collision with root package name */ final g0 f12369j; /* renamed from: k, reason: collision with root package name */ final long f12370k; /* renamed from: l, reason: collision with root package name */ final long f12371l; /* renamed from: m, reason: collision with root package name */ final q9.c f12372m; /* renamed from: n, reason: collision with root package name */ private volatile f f12373n; g0(a aVar) { this.f12360a = aVar.f12374a; this.f12361b = aVar.f12375b; this.f12362c = aVar.f12376c; this.f12363d = aVar.f12377d; this.f12364e = aVar.f12378e; this.f12365f = aVar.f12379f.d(); this.f12366g = aVar.f12380g; this.f12367h = aVar.f12381h; this.f12368i = aVar.f12382i; this.f12369j = aVar.f12383j; this.f12370k = aVar.f12384k; this.f12371l = aVar.f12385l; this.f12372m = aVar.f12386m; } public int G() { return this.f12362c; } public w I() { return this.f12364e; } public String O(String str) { return P(str, null); } public String P(String str, String str2) { String c10 = this.f12365f.c(str); return c10 != null ? c10 : str2; } public x R() { return this.f12365f; } public boolean S() { int i10 = this.f12362c; return i10 >= 200 && i10 < 300; } public String Y() { return this.f12363d; } public a a0() { return new a(this); } public h0 c() { return this.f12366g; } @Override // java.io.Closeable, java.lang.AutoCloseable public void close() { h0 h0Var = this.f12366g; if (h0Var == null) { throw new IllegalStateException("response is not eligible for a body and must not be closed"); } h0Var.close(); } public g0 d0() { return this.f12369j; } public long f0() { return this.f12371l; } public e0 j0() { return this.f12360a; } public long m0() { return this.f12370k; } public String toString() { return "Response{protocol=" + this.f12361b + ", code=" + this.f12362c + ", message=" + this.f12363d + ", url=" + this.f12360a.h() + '}'; } public f z() { f fVar = this.f12373n; if (fVar != null) { return fVar; } f k10 = f.k(this.f12365f); this.f12373n = k10; return k10; } public static class a { /* renamed from: a, reason: collision with root package name */ e0 f12374a; /* renamed from: b, reason: collision with root package name */ c0 f12375b; /* renamed from: c, reason: collision with root package name */ int f12376c; /* renamed from: d, reason: collision with root package name */ String f12377d; /* renamed from: e, reason: collision with root package name */ w f12378e; /* renamed from: f, reason: collision with root package name */ x.a f12379f; /* renamed from: g, reason: collision with root package name */ h0 f12380g; /* renamed from: h, reason: collision with root package name */ g0 f12381h; /* renamed from: i, reason: collision with root package name */ g0 f12382i; /* renamed from: j, reason: collision with root package name */ g0 f12383j; /* renamed from: k, reason: collision with root package name */ long f12384k; /* renamed from: l, reason: collision with root package name */ long f12385l; /* renamed from: m, reason: collision with root package name */ q9.c f12386m; public a() { this.f12376c = -1; this.f12379f = new x.a(); } private void e(g0 g0Var) { if (g0Var.f12366g != null) { throw new IllegalArgumentException("priorResponse.body != null"); } } private void f(String str, g0 g0Var) { if (g0Var.f12366g != null) { throw new IllegalArgumentException(str + ".body != null"); } if (g0Var.f12367h != null) { throw new IllegalArgumentException(str + ".networkResponse != null"); } if (g0Var.f12368i != null) { throw new IllegalArgumentException(str + ".cacheResponse != null"); } if (g0Var.f12369j == null) { return; } throw new IllegalArgumentException(str + ".priorResponse != null"); } public a a(String str, String str2) { this.f12379f.a(str, str2); return this; } public a b(h0 h0Var) { this.f12380g = h0Var; return this; } public g0 c() { if (this.f12374a == null) { throw new IllegalStateException("request == null"); } if (this.f12375b == null) { throw new IllegalStateException("protocol == null"); } if (this.f12376c >= 0) { if (this.f12377d != null) { return new g0(this); } throw new IllegalStateException("message == null"); } throw new IllegalStateException("code < 0: " + this.f12376c); } public a d(g0 g0Var) { if (g0Var != null) { f("cacheResponse", g0Var); } this.f12382i = g0Var; return this; } public a g(int i10) { this.f12376c = i10; return this; } public a h(w wVar) { this.f12378e = wVar; return this; } public a i(String str, String str2) { this.f12379f.f(str, str2); return this; } public a j(x xVar) { this.f12379f = xVar.f(); return this; } void k(q9.c cVar) { this.f12386m = cVar; } public a l(String str) { this.f12377d = str; return this; } public a m(g0 g0Var) { if (g0Var != null) { f("networkResponse", g0Var); } this.f12381h = g0Var; return this; } public a n(g0 g0Var) { if (g0Var != null) { e(g0Var); } this.f12383j = g0Var; return this; } public a o(c0 c0Var) { this.f12375b = c0Var; return this; } public a p(long j10) { this.f12385l = j10; return this; } public a q(e0 e0Var) { this.f12374a = e0Var; return this; } public a r(long j10) { this.f12384k = j10; return this; } a(g0 g0Var) { this.f12376c = -1; this.f12374a = g0Var.f12360a; this.f12375b = g0Var.f12361b; this.f12376c = g0Var.f12362c; this.f12377d = g0Var.f12363d; this.f12378e = g0Var.f12364e; this.f12379f = g0Var.f12365f.f(); this.f12380g = g0Var.f12366g; this.f12381h = g0Var.f12367h; this.f12382i = g0Var.f12368i; this.f12383j = g0Var.f12369j; this.f12384k = g0Var.f12370k; this.f12385l = g0Var.f12371l; this.f12386m = g0Var.f12372m; } } }