package i0; import java.io.IOException; import java.lang.reflect.Method; import java.util.Map; import java.util.Objects; import okhttp3.Headers; import okhttp3.MultipartBody; import okhttp3.RequestBody; /* compiled from: ParameterHandler.java */ /* loaded from: classes3.dex */ public abstract class t { /* compiled from: ParameterHandler.java */ /* loaded from: classes3.dex */ public static final class a extends t { public final Method a; /* renamed from: b reason: collision with root package name */ public final int f3727b; public final h c; public a(Method method, int i, h hVar) { this.a = method; this.f3727b = i; this.c = hVar; } @Override // i0.t public void a(v vVar, T t) { if (t != null) { try { vVar.m = this.c.convert(t); } catch (IOException e) { Method method = this.a; int i = this.f3727b; throw c0.m(method, e, i, "Unable to convert " + t + " to RequestBody", new Object[0]); } } else { throw c0.l(this.a, this.f3727b, "Body parameter value must not be null.", new Object[0]); } } } /* compiled from: ParameterHandler.java */ /* loaded from: classes3.dex */ public static final class b extends t { public final String a; /* renamed from: b reason: collision with root package name */ public final h f3728b; public final boolean c; public b(String str, h hVar, boolean z2) { Objects.requireNonNull(str, "name == null"); this.a = str; this.f3728b = hVar; this.c = z2; } @Override // i0.t public void a(v vVar, T t) throws IOException { String convert; if (t != null && (convert = this.f3728b.convert(t)) != null) { vVar.a(this.a, convert, this.c); } } } /* compiled from: ParameterHandler.java */ /* loaded from: classes3.dex */ public static final class c extends t> { public final Method a; /* renamed from: b reason: collision with root package name */ public final int f3729b; public final h c; public final boolean d; public c(Method method, int i, h hVar, boolean z2) { this.a = method; this.f3729b = i; this.c = hVar; this.d = z2; } /* JADX WARN: Multi-variable type inference failed */ @Override // i0.t public void a(v vVar, Object obj) throws IOException { Map map = (Map) obj; if (map != null) { for (Map.Entry entry : map.entrySet()) { String str = (String) entry.getKey(); if (str != null) { Object value = entry.getValue(); if (value != null) { String str2 = (String) this.c.convert(value); if (str2 != null) { vVar.a(str, str2, this.d); } else { Method method = this.a; int i = this.f3729b; throw c0.l(method, i, "Field map value '" + value + "' converted to null by " + this.c.getClass().getName() + " for key '" + str + "'.", new Object[0]); } } else { throw c0.l(this.a, this.f3729b, b.d.b.a.a.w("Field map contained null value for key '", str, "'."), new Object[0]); } } else { throw c0.l(this.a, this.f3729b, "Field map contained null key.", new Object[0]); } } return; } throw c0.l(this.a, this.f3729b, "Field map was null.", new Object[0]); } } /* compiled from: ParameterHandler.java */ /* loaded from: classes3.dex */ public static final class d extends t { public final String a; /* renamed from: b reason: collision with root package name */ public final h f3730b; public d(String str, h hVar) { Objects.requireNonNull(str, "name == null"); this.a = str; this.f3730b = hVar; } @Override // i0.t public void a(v vVar, T t) throws IOException { String convert; if (t != null && (convert = this.f3730b.convert(t)) != null) { vVar.b(this.a, convert); } } } /* compiled from: ParameterHandler.java */ /* loaded from: classes3.dex */ public static final class e extends t> { public final Method a; /* renamed from: b reason: collision with root package name */ public final int f3731b; public final h c; public e(Method method, int i, h hVar) { this.a = method; this.f3731b = i; this.c = hVar; } /* JADX WARN: Multi-variable type inference failed */ @Override // i0.t public void a(v vVar, Object obj) throws IOException { Map map = (Map) obj; if (map != null) { for (Map.Entry entry : map.entrySet()) { String str = (String) entry.getKey(); if (str != null) { Object value = entry.getValue(); if (value != null) { vVar.b(str, (String) this.c.convert(value)); } else { throw c0.l(this.a, this.f3731b, b.d.b.a.a.w("Header map contained null value for key '", str, "'."), new Object[0]); } } else { throw c0.l(this.a, this.f3731b, "Header map contained null key.", new Object[0]); } } return; } throw c0.l(this.a, this.f3731b, "Header map was null.", new Object[0]); } } /* compiled from: ParameterHandler.java */ /* loaded from: classes3.dex */ public static final class f extends t { public final Method a; /* renamed from: b reason: collision with root package name */ public final int f3732b; public f(Method method, int i) { this.a = method; this.f3732b = i; } @Override // i0.t public void a(v vVar, Headers headers) throws IOException { Headers headers2 = headers; if (headers2 != null) { Headers.a aVar = vVar.h; Objects.requireNonNull(aVar); d0.z.d.m.checkParameterIsNotNull(headers2, "headers"); int size = headers2.size(); for (int i = 0; i < size; i++) { aVar.b(headers2.d(i), headers2.g(i)); } return; } throw c0.l(this.a, this.f3732b, "Headers parameter must not be null.", new Object[0]); } } /* compiled from: ParameterHandler.java */ /* loaded from: classes3.dex */ public static final class g extends t { public final Method a; /* renamed from: b reason: collision with root package name */ public final int f3733b; public final Headers c; public final h d; public g(Method method, int i, Headers headers, h hVar) { this.a = method; this.f3733b = i; this.c = headers; this.d = hVar; } @Override // i0.t public void a(v vVar, T t) { if (t != null) { try { vVar.c(this.c, this.d.convert(t)); } catch (IOException e) { Method method = this.a; int i = this.f3733b; throw c0.l(method, i, "Unable to convert " + t + " to RequestBody", e); } } } } /* compiled from: ParameterHandler.java */ /* loaded from: classes3.dex */ public static final class h extends t> { public final Method a; /* renamed from: b reason: collision with root package name */ public final int f3734b; public final h c; public final String d; public h(Method method, int i, h hVar, String str) { this.a = method; this.f3734b = i; this.c = hVar; this.d = str; } /* JADX WARN: Multi-variable type inference failed */ @Override // i0.t public void a(v vVar, Object obj) throws IOException { Map map = (Map) obj; if (map != null) { for (Map.Entry entry : map.entrySet()) { String str = (String) entry.getKey(); if (str != null) { Object value = entry.getValue(); if (value != null) { vVar.c(Headers.j.c("Content-Disposition", b.d.b.a.a.w("form-data; name=\"", str, "\""), "Content-Transfer-Encoding", this.d), (RequestBody) this.c.convert(value)); } else { throw c0.l(this.a, this.f3734b, b.d.b.a.a.w("Part map contained null value for key '", str, "'."), new Object[0]); } } else { throw c0.l(this.a, this.f3734b, "Part map contained null key.", new Object[0]); } } return; } throw c0.l(this.a, this.f3734b, "Part map was null.", new Object[0]); } } /* compiled from: ParameterHandler.java */ /* loaded from: classes3.dex */ public static final class i extends t { public final Method a; /* renamed from: b reason: collision with root package name */ public final int f3735b; public final String c; public final h d; public final boolean e; public i(Method method, int i, String str, h hVar, boolean z2) { this.a = method; this.f3735b = i; Objects.requireNonNull(str, "name == null"); this.c = str; this.d = hVar; this.e = z2; } /* JADX WARN: Removed duplicated region for block: B:49:0x00e5 */ /* JADX WARN: Removed duplicated region for block: B:51:0x00e8 */ @Override // i0.t /* Code decompiled incorrectly, please refer to instructions dump. */ public void a(v vVar, T t) throws IOException { String str; String replace; if (t != null) { String str2 = this.c; String convert = this.d.convert(t); boolean z2 = this.e; if (vVar.e != null) { int length = convert.length(); int i = 0; while (i < length) { int codePointAt = convert.codePointAt(i); int i2 = 47; int i3 = -1; if (codePointAt < 32 || codePointAt >= 127 || " \"<>^`{}|\\?#".indexOf(codePointAt) != -1 || (!z2 && (codePointAt == 47 || codePointAt == 37))) { g0.e eVar = new g0.e(); eVar.c0(convert, 0, i); g0.e eVar2 = null; while (i < length) { int codePointAt2 = convert.codePointAt(i); if (!z2 || !(codePointAt2 == 9 || codePointAt2 == 10 || codePointAt2 == 12 || codePointAt2 == 13)) { if (codePointAt2 < 32 || codePointAt2 >= 127 || " \"<>^`{}|\\?#".indexOf(codePointAt2) != i3 || (!z2 && (codePointAt2 == i2 || codePointAt2 == 37))) { if (eVar2 == null) { eVar2 = new g0.e(); } eVar2.d0(codePointAt2); while (!eVar2.w()) { int readByte = eVar2.readByte() & 255; eVar.T(37); char[] cArr = v.a; eVar.T(cArr[(readByte >> 4) & 15]); eVar.T(cArr[readByte & 15]); } } else { eVar.d0(codePointAt2); } } i += Character.charCount(codePointAt2); i2 = 47; i3 = -1; } str = eVar.D(); String str3 = vVar.e; replace = str3.replace("{" + str2 + "}", str); if (v.f3741b.matcher(replace).matches()) { vVar.e = replace; return; } throw new IllegalArgumentException(b.d.b.a.a.v("@Path parameters shouldn't perform path traversal ('.' or '..'): ", convert)); } i += Character.charCount(codePointAt); } str = convert; String str32 = vVar.e; replace = str32.replace("{" + str2 + "}", str); if (v.f3741b.matcher(replace).matches()) { } } else { throw new AssertionError(); } } else { throw c0.l(this.a, this.f3735b, b.d.b.a.a.H(b.d.b.a.a.R("Path parameter \""), this.c, "\" value must not be null."), new Object[0]); } } } /* compiled from: ParameterHandler.java */ /* loaded from: classes3.dex */ public static final class j extends t { public final String a; /* renamed from: b reason: collision with root package name */ public final h f3736b; public final boolean c; public j(String str, h hVar, boolean z2) { Objects.requireNonNull(str, "name == null"); this.a = str; this.f3736b = hVar; this.c = z2; } @Override // i0.t public void a(v vVar, T t) throws IOException { String convert; if (t != null && (convert = this.f3736b.convert(t)) != null) { vVar.d(this.a, convert, this.c); } } } /* compiled from: ParameterHandler.java */ /* loaded from: classes3.dex */ public static final class k extends t> { public final Method a; /* renamed from: b reason: collision with root package name */ public final int f3737b; public final h c; public final boolean d; public k(Method method, int i, h hVar, boolean z2) { this.a = method; this.f3737b = i; this.c = hVar; this.d = z2; } /* JADX WARN: Multi-variable type inference failed */ @Override // i0.t public void a(v vVar, Object obj) throws IOException { Map map = (Map) obj; if (map != null) { for (Map.Entry entry : map.entrySet()) { String str = (String) entry.getKey(); if (str != null) { Object value = entry.getValue(); if (value != null) { String str2 = (String) this.c.convert(value); if (str2 != null) { vVar.d(str, str2, this.d); } else { Method method = this.a; int i = this.f3737b; throw c0.l(method, i, "Query map value '" + value + "' converted to null by " + this.c.getClass().getName() + " for key '" + str + "'.", new Object[0]); } } else { throw c0.l(this.a, this.f3737b, b.d.b.a.a.w("Query map contained null value for key '", str, "'."), new Object[0]); } } else { throw c0.l(this.a, this.f3737b, "Query map contained null key.", new Object[0]); } } return; } throw c0.l(this.a, this.f3737b, "Query map was null", new Object[0]); } } /* compiled from: ParameterHandler.java */ /* loaded from: classes3.dex */ public static final class l extends t { public final h a; /* renamed from: b reason: collision with root package name */ public final boolean f3738b; public l(h hVar, boolean z2) { this.a = hVar; this.f3738b = z2; } @Override // i0.t public void a(v vVar, T t) throws IOException { if (t != null) { vVar.d(this.a.convert(t), null, this.f3738b); } } } /* compiled from: ParameterHandler.java */ /* loaded from: classes3.dex */ public static final class m extends t { public static final m a = new m(); @Override // i0.t public void a(v vVar, MultipartBody.Part part) throws IOException { MultipartBody.Part part2 = part; if (part2 != null) { vVar.k.a(part2); } } } /* compiled from: ParameterHandler.java */ /* loaded from: classes3.dex */ public static final class n extends t { public final Method a; /* renamed from: b reason: collision with root package name */ public final int f3739b; public n(Method method, int i) { this.a = method; this.f3739b = i; } @Override // i0.t public void a(v vVar, Object obj) { if (obj != null) { Objects.requireNonNull(vVar); vVar.e = obj.toString(); return; } throw c0.l(this.a, this.f3739b, "@Url parameter is null.", new Object[0]); } } /* compiled from: ParameterHandler.java */ /* loaded from: classes3.dex */ public static final class o extends t { public final Class a; public o(Class cls) { this.a = cls; } @Override // i0.t public void a(v vVar, T t) { vVar.g.e(this.a, t); } } public abstract void a(v vVar, T t) throws IOException; }