49 lines
2 KiB
Java
49 lines
2 KiB
Java
package com.discord.utilities.rest;
|
|
|
|
import com.discord.models.domain.ModelAuditLogEntry;
|
|
import com.discord.utilities.analytics.AnalyticSuperProperties;
|
|
import d0.t.h0;
|
|
import d0.z.d.m;
|
|
import f0.e0.c;
|
|
import f0.w;
|
|
import java.util.Collections;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.Map;
|
|
import okhttp3.Headers;
|
|
import okhttp3.Interceptor;
|
|
import okhttp3.Request;
|
|
import okhttp3.RequestBody;
|
|
import okhttp3.Response;
|
|
/* compiled from: Interceptor.kt */
|
|
public final class RestAPI$Companion$buildAnalyticsInterceptor$$inlined$invoke$1 implements Interceptor {
|
|
@Override // okhttp3.Interceptor
|
|
public Response intercept(Interceptor.Chain chain) {
|
|
Map map;
|
|
m.checkParameterIsNotNull(chain, "chain");
|
|
Request c2 = chain.c();
|
|
m.checkParameterIsNotNull(c2, "request");
|
|
new LinkedHashMap();
|
|
w wVar = c2.b;
|
|
String str = c2.f2911c;
|
|
RequestBody requestBody = c2.e;
|
|
Map linkedHashMap = c2.f.isEmpty() ? new LinkedHashMap() : h0.toMutableMap(c2.f);
|
|
Headers.a e = c2.d.e();
|
|
String superPropertiesStringBase64 = AnalyticSuperProperties.INSTANCE.getSuperPropertiesStringBase64();
|
|
m.checkParameterIsNotNull("X-Super-Properties", ModelAuditLogEntry.CHANGE_KEY_NAME);
|
|
m.checkParameterIsNotNull(superPropertiesStringBase64, "value");
|
|
e.a("X-Super-Properties", superPropertiesStringBase64);
|
|
if (wVar != null) {
|
|
Headers c3 = e.c();
|
|
byte[] bArr = c.a;
|
|
m.checkParameterIsNotNull(linkedHashMap, "$this$toImmutableMap");
|
|
if (linkedHashMap.isEmpty()) {
|
|
map = h0.emptyMap();
|
|
} else {
|
|
map = Collections.unmodifiableMap(new LinkedHashMap(linkedHashMap));
|
|
m.checkExpressionValueIsNotNull(map, "Collections.unmodifiableMap(LinkedHashMap(this))");
|
|
}
|
|
return chain.a(new Request(wVar, str, c3, requestBody, map));
|
|
}
|
|
throw new IllegalStateException("url == null".toString());
|
|
}
|
|
}
|