2021-06-27 20:44:35 +00:00
|
|
|
package okhttp3;
|
|
|
|
|
2021-08-09 22:50:01 +00:00
|
|
|
import com.discord.models.domain.ModelAuditLogEntry;
|
2021-11-08 18:25:28 +00:00
|
|
|
import d0.z.d.m;
|
|
|
|
import f0.e0.g.c;
|
|
|
|
import f0.v;
|
|
|
|
import f0.y;
|
2021-06-27 20:44:35 +00:00
|
|
|
import java.io.Closeable;
|
|
|
|
import java.util.Objects;
|
|
|
|
import okhttp3.Headers;
|
|
|
|
/* compiled from: Response.kt */
|
|
|
|
public final class Response implements Closeable {
|
2021-12-17 22:03:14 +00:00
|
|
|
public final Request j;
|
|
|
|
public final y k;
|
|
|
|
public final String l;
|
|
|
|
public final int m;
|
|
|
|
public final v n;
|
|
|
|
public final Headers o;
|
|
|
|
public final ResponseBody p;
|
2021-06-27 20:44:35 +00:00
|
|
|
public final Response q;
|
2021-11-08 18:25:28 +00:00
|
|
|
public final Response r;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
2021-11-08 18:25:28 +00:00
|
|
|
/* renamed from: s reason: collision with root package name */
|
2021-12-17 22:03:14 +00:00
|
|
|
public final Response f3044s;
|
2021-06-27 20:44:35 +00:00
|
|
|
public final long t;
|
2021-12-17 22:03:14 +00:00
|
|
|
public final long u;
|
|
|
|
public final c v;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
|
|
|
/* compiled from: Response.kt */
|
|
|
|
public static class a {
|
2021-08-24 17:45:16 +00:00
|
|
|
public Request a;
|
2021-06-27 20:44:35 +00:00
|
|
|
public y b;
|
|
|
|
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
2021-12-17 22:03:14 +00:00
|
|
|
public int f3045c;
|
2021-06-27 20:44:35 +00:00
|
|
|
public String d;
|
|
|
|
public v e;
|
|
|
|
public Headers.a f;
|
|
|
|
public ResponseBody g;
|
|
|
|
public Response h;
|
|
|
|
public Response i;
|
|
|
|
public Response j;
|
|
|
|
public long k;
|
|
|
|
public long l;
|
|
|
|
public c m;
|
|
|
|
|
|
|
|
public a() {
|
2021-12-17 22:03:14 +00:00
|
|
|
this.f3045c = -1;
|
2021-06-27 20:44:35 +00:00
|
|
|
this.f = new Headers.a();
|
|
|
|
}
|
|
|
|
|
|
|
|
public a(Response response) {
|
|
|
|
m.checkParameterIsNotNull(response, "response");
|
2021-12-17 22:03:14 +00:00
|
|
|
this.f3045c = -1;
|
|
|
|
this.a = response.j;
|
|
|
|
this.b = response.k;
|
|
|
|
this.f3045c = response.m;
|
|
|
|
this.d = response.l;
|
|
|
|
this.e = response.n;
|
|
|
|
this.f = response.o.e();
|
|
|
|
this.g = response.p;
|
|
|
|
this.h = response.q;
|
|
|
|
this.i = response.r;
|
|
|
|
this.j = response.f3044s;
|
|
|
|
this.k = response.t;
|
|
|
|
this.l = response.u;
|
|
|
|
this.m = response.v;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public Response a() {
|
2021-12-17 22:03:14 +00:00
|
|
|
int i = this.f3045c;
|
2021-06-27 20:44:35 +00:00
|
|
|
if (i >= 0) {
|
2021-08-24 17:45:16 +00:00
|
|
|
Request request = this.a;
|
|
|
|
if (request != null) {
|
2021-06-27 20:44:35 +00:00
|
|
|
y yVar = this.b;
|
|
|
|
if (yVar != null) {
|
|
|
|
String str = this.d;
|
|
|
|
if (str != null) {
|
2021-08-24 17:45:16 +00:00
|
|
|
return new Response(request, yVar, str, i, this.e, this.f.c(), this.g, this.h, this.i, this.j, this.k, this.l, this.m);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
throw new IllegalStateException("message == null".toString());
|
|
|
|
}
|
|
|
|
throw new IllegalStateException("protocol == null".toString());
|
|
|
|
}
|
|
|
|
throw new IllegalStateException("request == null".toString());
|
|
|
|
}
|
2021-11-08 18:25:28 +00:00
|
|
|
StringBuilder R = c.d.b.a.a.R("code < 0: ");
|
2021-12-17 22:03:14 +00:00
|
|
|
R.append(this.f3045c);
|
2021-11-08 18:25:28 +00:00
|
|
|
throw new IllegalStateException(R.toString().toString());
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public a b(Response response) {
|
|
|
|
c("cacheResponse", response);
|
|
|
|
this.i = response;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void c(String str, Response response) {
|
|
|
|
if (response != null) {
|
|
|
|
boolean z2 = false;
|
2021-12-17 22:03:14 +00:00
|
|
|
if (response.p == null) {
|
|
|
|
if (response.q == null) {
|
|
|
|
if (response.r == null) {
|
|
|
|
if (response.f3044s == null) {
|
2021-06-27 20:44:35 +00:00
|
|
|
z2 = true;
|
|
|
|
}
|
|
|
|
if (!z2) {
|
2021-11-08 18:25:28 +00:00
|
|
|
throw new IllegalArgumentException(c.d.b.a.a.v(str, ".priorResponse != null").toString());
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
2021-11-08 18:25:28 +00:00
|
|
|
throw new IllegalArgumentException(c.d.b.a.a.v(str, ".cacheResponse != null").toString());
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
2021-11-08 18:25:28 +00:00
|
|
|
throw new IllegalArgumentException(c.d.b.a.a.v(str, ".networkResponse != null").toString());
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
2021-11-08 18:25:28 +00:00
|
|
|
throw new IllegalArgumentException(c.d.b.a.a.v(str, ".body != null").toString());
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public a d(Headers headers) {
|
|
|
|
m.checkParameterIsNotNull(headers, "headers");
|
|
|
|
this.f = headers.e();
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public a e(String str) {
|
|
|
|
m.checkParameterIsNotNull(str, "message");
|
|
|
|
this.d = str;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public a f(y yVar) {
|
|
|
|
m.checkParameterIsNotNull(yVar, "protocol");
|
|
|
|
this.b = yVar;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2021-08-24 17:45:16 +00:00
|
|
|
public a g(Request request) {
|
|
|
|
m.checkParameterIsNotNull(request, "request");
|
|
|
|
this.a = request;
|
2021-06-27 20:44:35 +00:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-24 17:45:16 +00:00
|
|
|
public Response(Request request, y yVar, String str, int i, v vVar, Headers headers, ResponseBody responseBody, Response response, Response response2, Response response3, long j, long j2, c cVar) {
|
|
|
|
m.checkParameterIsNotNull(request, "request");
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkParameterIsNotNull(yVar, "protocol");
|
|
|
|
m.checkParameterIsNotNull(str, "message");
|
|
|
|
m.checkParameterIsNotNull(headers, "headers");
|
2021-12-17 22:03:14 +00:00
|
|
|
this.j = request;
|
|
|
|
this.k = yVar;
|
|
|
|
this.l = str;
|
|
|
|
this.m = i;
|
|
|
|
this.n = vVar;
|
|
|
|
this.o = headers;
|
|
|
|
this.p = responseBody;
|
|
|
|
this.q = response;
|
|
|
|
this.r = response2;
|
|
|
|
this.f3044s = response3;
|
|
|
|
this.t = j;
|
|
|
|
this.u = j2;
|
|
|
|
this.v = cVar;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static String a(Response response, String str, String str2, int i) {
|
|
|
|
int i2 = i & 2;
|
|
|
|
Objects.requireNonNull(response);
|
2021-08-09 22:50:01 +00:00
|
|
|
m.checkParameterIsNotNull(str, ModelAuditLogEntry.CHANGE_KEY_NAME);
|
2021-12-17 22:03:14 +00:00
|
|
|
String c2 = response.o.c(str);
|
2021-06-27 20:44:35 +00:00
|
|
|
if (c2 != null) {
|
|
|
|
return c2;
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean b() {
|
2021-12-17 22:03:14 +00:00
|
|
|
int i = this.m;
|
2021-06-27 20:44:35 +00:00
|
|
|
return 200 <= i && 299 >= i;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.io.Closeable, java.lang.AutoCloseable
|
|
|
|
public void close() {
|
2021-12-17 22:03:14 +00:00
|
|
|
ResponseBody responseBody = this.p;
|
2021-06-27 20:44:35 +00:00
|
|
|
if (responseBody != null) {
|
|
|
|
responseBody.close();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
throw new IllegalStateException("response is not eligible for a body and must not be closed".toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Object
|
|
|
|
public String toString() {
|
2021-11-08 18:25:28 +00:00
|
|
|
StringBuilder R = c.d.b.a.a.R("Response{protocol=");
|
2021-12-17 22:03:14 +00:00
|
|
|
R.append(this.k);
|
2021-11-08 18:25:28 +00:00
|
|
|
R.append(", code=");
|
2021-12-17 22:03:14 +00:00
|
|
|
R.append(this.m);
|
2021-11-08 18:25:28 +00:00
|
|
|
R.append(", message=");
|
2021-12-17 22:03:14 +00:00
|
|
|
R.append(this.l);
|
2021-11-08 18:25:28 +00:00
|
|
|
R.append(", url=");
|
2021-12-17 22:03:14 +00:00
|
|
|
R.append(this.j.b);
|
2021-11-08 18:25:28 +00:00
|
|
|
R.append('}');
|
|
|
|
return R.toString();
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|