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 */ public abstract class t { /* compiled from: ParameterHandler */ public static final class a extends t { public final Method a; public final int b; /* renamed from: c reason: collision with root package name */ public final h f2833c; public a(Method method, int i, h hVar) { this.a = method; this.b = i; this.f2833c = hVar; } @Override // i0.t public void a(v vVar, T t) { if (t != null) { try { vVar.m = this.f2833c.convert(t); } catch (IOException e) { Method method = this.a; int i = this.b; throw c0.m(method, e, i, "Unable to convert " + ((Object) t) + " to RequestBody", new Object[0]); } } else { throw c0.l(this.a, this.b, "Body parameter value must not be null.", new Object[0]); } } } /* compiled from: ParameterHandler */ public static final class b extends t { public final String a; public final h b; /* renamed from: c reason: collision with root package name */ public final boolean f2834c; public b(String str, h hVar, boolean z2) { Objects.requireNonNull(str, "name == null"); this.a = str; this.b = hVar; this.f2834c = z2; } @Override // i0.t public void a(v vVar, T t) throws IOException { String convert; if (t != null && (convert = this.b.convert(t)) != null) { vVar.a(this.a, convert, this.f2834c); } } } /* compiled from: ParameterHandler */ public static final class c extends t> { public final Method a; public final int b; /* renamed from: c reason: collision with root package name */ public final h f2835c; public final boolean d; public c(Method method, int i, h hVar, boolean z2) { this.a = method; this.b = i; this.f2835c = hVar; this.d = z2; } /* JADX DEBUG: Multi-variable search result rejected for r4v0, resolved type: i0.h */ /* 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.f2835c.convert(value); if (str2 != null) { vVar.a(str, str2, this.d); } else { Method method = this.a; int i = this.b; throw c0.l(method, i, "Field map value '" + value + "' converted to null by " + this.f2835c.getClass().getName() + " for key '" + str + "'.", new Object[0]); } } else { throw c0.l(this.a, this.b, c.d.b.a.a.t("Field map contained null value for key '", str, "'."), new Object[0]); } } else { throw c0.l(this.a, this.b, "Field map contained null key.", new Object[0]); } } return; } throw c0.l(this.a, this.b, "Field map was null.", new Object[0]); } } /* compiled from: ParameterHandler */ public static final class d extends t { public final String a; public final h b; public d(String str, h hVar) { Objects.requireNonNull(str, "name == null"); this.a = str; this.b = hVar; } @Override // i0.t public void a(v vVar, T t) throws IOException { String convert; if (t != null && (convert = this.b.convert(t)) != null) { vVar.b(this.a, convert); } } } /* compiled from: ParameterHandler */ public static final class e extends t> { public final Method a; public final int b; /* renamed from: c reason: collision with root package name */ public final h f2836c; public e(Method method, int i, h hVar) { this.a = method; this.b = i; this.f2836c = hVar; } /* JADX DEBUG: Multi-variable search result rejected for r3v1, resolved type: i0.h */ /* 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.f2836c.convert(value)); } else { throw c0.l(this.a, this.b, c.d.b.a.a.t("Header map contained null value for key '", str, "'."), new Object[0]); } } else { throw c0.l(this.a, this.b, "Header map contained null key.", new Object[0]); } } return; } throw c0.l(this.a, this.b, "Header map was null.", new Object[0]); } } /* compiled from: ParameterHandler */ public static final class f extends t { public final Method a; public final int b; public f(Method method, int i) { this.a = method; this.b = i; } /* JADX DEBUG: Method arguments types fixed to match base method, original types: [i0.v, java.lang.Object] */ @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.b, "Headers parameter must not be null.", new Object[0]); } } /* compiled from: ParameterHandler */ public static final class g extends t { public final Method a; public final int b; /* renamed from: c reason: collision with root package name */ public final Headers f2837c; public final h d; public g(Method method, int i, Headers headers, h hVar) { this.a = method; this.b = i; this.f2837c = headers; this.d = hVar; } @Override // i0.t public void a(v vVar, T t) { if (t != null) { try { vVar.c(this.f2837c, this.d.convert(t)); } catch (IOException e) { Method method = this.a; int i = this.b; throw c0.l(method, i, "Unable to convert " + ((Object) t) + " to RequestBody", e); } } } } /* compiled from: ParameterHandler */ public static final class h extends t> { public final Method a; public final int b; /* renamed from: c reason: collision with root package name */ public final h f2838c; public final String d; public h(Method method, int i, h hVar, String str) { this.a = method; this.b = i; this.f2838c = hVar; this.d = str; } /* JADX DEBUG: Multi-variable search result rejected for r3v3, resolved type: i0.h */ /* 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.i.c("Content-Disposition", c.d.b.a.a.t("form-data; name=\"", str, "\""), "Content-Transfer-Encoding", this.d), (RequestBody) this.f2838c.convert(value)); } else { throw c0.l(this.a, this.b, c.d.b.a.a.t("Part map contained null value for key '", str, "'."), new Object[0]); } } else { throw c0.l(this.a, this.b, "Part map contained null key.", new Object[0]); } } return; } throw c0.l(this.a, this.b, "Part map was null.", new Object[0]); } } /* compiled from: ParameterHandler */ public static final class i extends t { public final Method a; public final int b; /* renamed from: c reason: collision with root package name */ public final String f2839c; public final h d; public final boolean e; public i(Method method, int i, String str, h hVar, boolean z2) { this.a = method; this.b = i; Objects.requireNonNull(str, "name == null"); this.f2839c = str; this.d = hVar; this.e = z2; } @Override // i0.t public void a(v vVar, T t) throws IOException { String str; int i; int i2; if (t != null) { String str2 = this.f2839c; String convert = this.d.convert(t); boolean z2 = this.e; if (vVar.e != null) { int length = convert.length(); int i3 = 0; while (true) { if (i3 >= length) { str = convert; break; } int codePointAt = convert.codePointAt(i3); i = 47; i2 = -1; if (codePointAt < 32 || codePointAt >= 127 || " \"<>^`{}|\\?#".indexOf(codePointAt) != -1 || (!z2 && (codePointAt == 47 || codePointAt == 37))) { break; } i3 += Character.charCount(codePointAt); } g0.e eVar = new g0.e(); eVar.c0(convert, 0, i3); g0.e eVar2 = null; while (i3 < length) { int codePointAt2 = convert.codePointAt(i3); if (!z2 || !(codePointAt2 == 9 || codePointAt2 == 10 || codePointAt2 == 12 || codePointAt2 == 13)) { if (codePointAt2 < 32 || codePointAt2 >= 127 || " \"<>^`{}|\\?#".indexOf(codePointAt2) != i2 || (!z2 && (codePointAt2 == i || codePointAt2 == 37))) { if (eVar2 == null) { eVar2 = new g0.e(); } eVar2.e0(codePointAt2); while (!eVar2.v()) { 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.e0(codePointAt2); } } i3 += Character.charCount(codePointAt2); i = 47; i2 = -1; } str = eVar.G(); String str3 = vVar.e; String replace = str3.replace("{" + str2 + "}", str); if (!v.b.matcher(replace).matches()) { vVar.e = replace; return; } throw new IllegalArgumentException(c.d.b.a.a.s("@Path parameters shouldn't perform path traversal ('.' or '..'): ", convert)); } throw new AssertionError(); } throw c0.l(this.a, this.b, c.d.b.a.a.C(c.d.b.a.a.K("Path parameter \""), this.f2839c, "\" value must not be null."), new Object[0]); } } /* compiled from: ParameterHandler */ public static final class j extends t { public final String a; public final h b; /* renamed from: c reason: collision with root package name */ public final boolean f2840c; public j(String str, h hVar, boolean z2) { Objects.requireNonNull(str, "name == null"); this.a = str; this.b = hVar; this.f2840c = z2; } @Override // i0.t public void a(v vVar, T t) throws IOException { String convert; if (t != null && (convert = this.b.convert(t)) != null) { vVar.d(this.a, convert, this.f2840c); } } } /* compiled from: ParameterHandler */ public static final class k extends t> { public final Method a; public final int b; /* renamed from: c reason: collision with root package name */ public final h f2841c; public final boolean d; public k(Method method, int i, h hVar, boolean z2) { this.a = method; this.b = i; this.f2841c = hVar; this.d = z2; } /* JADX DEBUG: Multi-variable search result rejected for r4v0, resolved type: i0.h */ /* 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.f2841c.convert(value); if (str2 != null) { vVar.d(str, str2, this.d); } else { Method method = this.a; int i = this.b; throw c0.l(method, i, "Query map value '" + value + "' converted to null by " + this.f2841c.getClass().getName() + " for key '" + str + "'.", new Object[0]); } } else { throw c0.l(this.a, this.b, c.d.b.a.a.t("Query map contained null value for key '", str, "'."), new Object[0]); } } else { throw c0.l(this.a, this.b, "Query map contained null key.", new Object[0]); } } return; } throw c0.l(this.a, this.b, "Query map was null", new Object[0]); } } /* compiled from: ParameterHandler */ public static final class l extends t { public final h a; public final boolean b; public l(h hVar, boolean z2) { this.a = hVar; this.b = z2; } @Override // i0.t public void a(v vVar, T t) throws IOException { if (t != null) { vVar.d(this.a.convert(t), null, this.b); } } } /* compiled from: ParameterHandler */ public static final class m extends t { public static final m a = new m(); /* JADX DEBUG: Method arguments types fixed to match base method, original types: [i0.v, java.lang.Object] */ @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 */ public static final class n extends t { public final Method a; public final int b; public n(Method method, int i) { this.a = method; this.b = 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.b, "@Url parameter is null.", new Object[0]); } } /* compiled from: ParameterHandler */ 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; }