package F7;

import java.io.IOException;
import java.lang.reflect.Method;
import java.util.Map;
import n4.u0;

/* JADX INFO: loaded from: classes.dex */
public final class H extends b0 {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ int f2609d = 1;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final Method f2610e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final int f2611f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final InterfaceC0130n f2612g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final Object f2613h;

    public H(Method method, int i, InterfaceC0130n interfaceC0130n, String str) {
        this.f2610e = method;
        this.f2611f = i;
        this.f2612g = interfaceC0130n;
        this.f2613h = str;
    }

    @Override // F7.b0
    public final void a(P p3, Object obj) {
        InterfaceC0130n interfaceC0130n = this.f2612g;
        Object obj2 = this.f2613h;
        int i = this.f2611f;
        Method method = this.f2610e;
        switch (this.f2609d) {
            case u0.f15495q /* 0 */:
                if (obj == null) {
                    return;
                }
                try {
                    p3.c((k7.o) obj2, (k7.A) interfaceC0130n.o(obj));
                    return;
                } catch (IOException e8) {
                    throw b0.o(method, i, "Unable to convert " + obj + " to RequestBody", e8);
                }
            default:
                Map map = (Map) obj;
                if (map == null) {
                    throw b0.o(method, i, "Part map was null.", new Object[0]);
                }
                for (Map.Entry entry : map.entrySet()) {
                    String str = (String) entry.getKey();
                    if (str == null) {
                        throw b0.o(method, i, "Part map contained null key.", new Object[0]);
                    }
                    Object value = entry.getValue();
                    if (value == null) {
                        throw b0.o(method, i, I1.a.p("Part map contained null value for key '", str, "'."), new Object[0]);
                    }
                    p3.c(W3.b.q("Content-Disposition", I1.a.p("form-data; name=\"", str, "\""), "Content-Transfer-Encoding", (String) obj2), (k7.A) interfaceC0130n.o(value));
                }
                return;
        }
    }

    public H(Method method, int i, k7.o oVar, InterfaceC0130n interfaceC0130n) {
        this.f2610e = method;
        this.f2611f = i;
        this.f2613h = oVar;
        this.f2612g = interfaceC0130n;
    }
}
