package com.amplifyframework.api.aws;

import com.amplifyframework.core.model.Model;
import com.amplifyframework.core.model.ModelList;
import java.lang.reflect.Type;
import java.util.List;
import kotlin.Metadata;

@Metadata(d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\b\u0000\u0018\u0000 \u000e*\b\b\u0000\u0010\u0002*\u00020\u00012\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u00040\u0003:\u0001\u000eB\u0007¢\u0006\u0004\b\f\u0010\rJ&\u0010\u000b\u001a\b\u0012\u0004\u0012\u00028\u00000\u00042\u0006\u0010\u0006\u001a\u00020\u00052\u0006\u0010\b\u001a\u00020\u00072\u0006\u0010\n\u001a\u00020\tH\u0016¨\u0006\u000f"}, d2 = {"Lcom/amplifyframework/api/aws/ModelListDeserializer;", "Lcom/amplifyframework/core/model/Model;", "M", "Lcom/google/gson/h;", "Lcom/amplifyframework/core/model/ModelList;", "Lcom/google/gson/i;", "json", "Ljava/lang/reflect/Type;", "typeOfT", "Lcom/google/gson/g;", "context", "deserialize", "<init>", "()V", "Companion", "aws-api_release"}, k = 1, mv = {1, 9, 0})
/* loaded from: classes4.dex */
public final class ModelListDeserializer<M extends Model> implements com.google.gson.h {

    /* renamed from: Companion, reason: from kotlin metadata */
    public static final Companion INSTANCE = new Companion(null);

    @Metadata(d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0006\u0010\u0007J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0007¨\u0006\b"}, d2 = {"Lcom/amplifyframework/api/aws/ModelListDeserializer$Companion;", "", "Lcom/google/gson/e;", "builder", "Lrm/n0;", "register", "<init>", "()V", "aws-api_release"}, k = 1, mv = {1, 9, 0})
    /* loaded from: classes4.dex */
    public static final class Companion {
        private Companion() {
        }

        public /* synthetic */ Companion(kotlin.jvm.internal.k kVar) {
            this();
        }

        public final void register(com.google.gson.e builder) {
            kotlin.jvm.internal.t.g(builder, "builder");
            builder.c(ModelList.class, new ModelListDeserializer());
        }
    }

    public static final void register(com.google.gson.e eVar) {
        INSTANCE.register(eVar);
    }

    @Override // com.google.gson.h
    public ModelList<M> deserialize(com.google.gson.i json, Type typeOfT, com.google.gson.g context) throws com.google.gson.m {
        List deserializeItems;
        kotlin.jvm.internal.t.g(json, "json");
        kotlin.jvm.internal.t.g(typeOfT, "typeOfT");
        kotlin.jvm.internal.t.g(context, "context");
        deserializeItems = LazyTypeDeserializersKt.deserializeItems(json, typeOfT, context);
        return new ApiLoadedModelList(deserializeItems);
    }
}
