package com.vungle.ads.internal.network; import kotlin.jvm.internal.DefaultConstructorMarker; import kotlin.jvm.internal.Intrinsics; import okhttp3.Headers; import okhttp3.ResponseBody; /* loaded from: classes4.dex */ public final class Response { public static final Companion Companion = new Companion(null); private final T body; private final ResponseBody errorBody; private final okhttp3.Response rawResponse; public /* synthetic */ Response(okhttp3.Response response, Object obj, ResponseBody responseBody, DefaultConstructorMarker defaultConstructorMarker) { this(response, obj, responseBody); } public final T body() { return this.body; } public final ResponseBody errorBody() { return this.errorBody; } public final okhttp3.Response raw() { return this.rawResponse; } private Response(okhttp3.Response response, T t, ResponseBody responseBody) { this.rawResponse = response; this.body = t; this.errorBody = responseBody; } public final int code() { return this.rawResponse.code(); } public final String message() { return this.rawResponse.message(); } public final Headers headers() { return this.rawResponse.headers(); } public final boolean isSuccessful() { return this.rawResponse.isSuccessful(); } public String toString() { return this.rawResponse.toString(); } public static final class Companion { public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) { this(); } private Companion() { } /* JADX WARN: Multi-variable type inference failed */ public final Response success(T t, okhttp3.Response rawResponse) { Intrinsics.checkNotNullParameter(rawResponse, "rawResponse"); if (!rawResponse.isSuccessful()) { throw new IllegalArgumentException("rawResponse must be successful response".toString()); } return new Response<>(rawResponse, t, null, 0 == true ? 1 : 0); } public final Response error(ResponseBody responseBody, okhttp3.Response rawResponse) { Intrinsics.checkNotNullParameter(rawResponse, "rawResponse"); if (!(!rawResponse.isSuccessful())) { throw new IllegalArgumentException("rawResponse should not be successful response".toString()); } DefaultConstructorMarker defaultConstructorMarker = null; return new Response<>(rawResponse, defaultConstructorMarker, responseBody, defaultConstructorMarker); } } }