42 lines
1.7 KiB
Java
42 lines
1.7 KiB
Java
package com.discord.stores.utilities;
|
|
|
|
import com.discord.analytics.generated.traits.TrackNetworkMetadata;
|
|
import com.discord.analytics.generated.traits.TrackNetworkMetadataReceiver;
|
|
import com.discord.utilities.analytics.AnalyticsUtils;
|
|
import com.discord.utilities.features.GrowthTeamFeatures;
|
|
import d0.z.d.m;
|
|
import kotlin.jvm.functions.Function1;
|
|
import okhttp3.Request;
|
|
import retrofit2.HttpException;
|
|
import retrofit2.Response;
|
|
import rx.functions.Action1;
|
|
/* compiled from: RestCallState.kt */
|
|
public final class RestCallStateKt$logNetworkAction$2<T> implements Action1<Response<T>> {
|
|
public final /* synthetic */ Function1 $networkActionProvider;
|
|
public final /* synthetic */ AnalyticsUtils.Tracker $tracker;
|
|
|
|
public RestCallStateKt$logNetworkAction$2(Function1 function1, AnalyticsUtils.Tracker tracker) {
|
|
this.$networkActionProvider = function1;
|
|
this.$tracker = tracker;
|
|
}
|
|
|
|
@Override // rx.functions.Action1
|
|
public /* bridge */ /* synthetic */ void call(Object obj) {
|
|
call((Response) ((Response) obj));
|
|
}
|
|
|
|
public final void call(Response<T> response) {
|
|
TrackNetworkMetadataReceiver schema;
|
|
m.checkNotNullExpressionValue(response, "response");
|
|
if (response.a()) {
|
|
Request request = RestCallStateKt.getRequest(response);
|
|
if (GrowthTeamFeatures.INSTANCE.isNetworkActionLoggingEnabled() && (schema = RestCallStateKt.getSchema(this.$networkActionProvider, new TrackNetworkMetadata(request.b.l, request.f2969c, Long.valueOf((long) response.a.l), null, null, 24), response.b)) != null) {
|
|
this.$tracker.track(schema);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
throw new HttpException(response);
|
|
}
|
|
}
|