package com.amplifyframework.api.graphql.model;

import com.amplifyframework.api.aws.AppSyncGraphQLRequestFactory;
import com.amplifyframework.api.graphql.GraphQLRequest;
import com.amplifyframework.api.graphql.MutationType;
import com.amplifyframework.core.model.Model;
import com.amplifyframework.core.model.ModelPath;
import com.amplifyframework.core.model.query.predicate.QueryPredicate;
import com.amplifyframework.core.model.query.predicate.QueryPredicates;
import dn.l;
import kotlin.Metadata;
import kotlin.jvm.internal.t;

@Metadata(d1 = {"\u00006\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\b\bÆ\u0002\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0015\u0010\u0016J'\u0010\u0006\u001a\b\u0012\u0004\u0012\u00028\u00000\u0005\"\b\b\u0000\u0010\u0003*\u00020\u00022\u0006\u0010\u0004\u001a\u00028\u0000H\u0007¢\u0006\u0004\b\u0006\u0010\u0007JQ\u0010\u0006\u001a\b\u0012\u0004\u0012\u00028\u00000\u0005\"\b\b\u0000\u0010\u0003*\u00020\u0002\"\u000e\b\u0001\u0010\t*\b\u0012\u0004\u0012\u00028\u00000\b2\u0006\u0010\u0004\u001a\u00028\u00002\u0018\u0010\r\u001a\u0014\u0012\u0004\u0012\u00028\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00020\f0\u000b0\nH\u0007¢\u0006\u0004\b\u0006\u0010\u000eJ/\u0010\u0011\u001a\b\u0012\u0004\u0012\u00028\u00000\u0005\"\b\b\u0000\u0010\u0003*\u00020\u00022\u0006\u0010\u0004\u001a\u00028\u00002\u0006\u0010\u0010\u001a\u00020\u000fH\u0007¢\u0006\u0004\b\u0011\u0010\u0012JY\u0010\u0011\u001a\b\u0012\u0004\u0012\u00028\u00000\u0005\"\b\b\u0000\u0010\u0003*\u00020\u0002\"\u000e\b\u0001\u0010\t*\b\u0012\u0004\u0012\u00028\u00000\b2\u0006\u0010\u0004\u001a\u00028\u00002\u0006\u0010\u0010\u001a\u00020\u000f2\u0018\u0010\r\u001a\u0014\u0012\u0004\u0012\u00028\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00020\f0\u000b0\nH\u0007¢\u0006\u0004\b\u0011\u0010\u0013J'\u0010\u0011\u001a\b\u0012\u0004\u0012\u00028\u00000\u0005\"\b\b\u0000\u0010\u0003*\u00020\u00022\u0006\u0010\u0004\u001a\u00028\u0000H\u0007¢\u0006\u0004\b\u0011\u0010\u0007JQ\u0010\u0011\u001a\b\u0012\u0004\u0012\u00028\u00000\u0005\"\b\b\u0000\u0010\u0003*\u00020\u0002\"\u000e\b\u0001\u0010\t*\b\u0012\u0004\u0012\u00028\u00000\b2\u0006\u0010\u0004\u001a\u00028\u00002\u0018\u0010\r\u001a\u0014\u0012\u0004\u0012\u00028\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00020\f0\u000b0\nH\u0007¢\u0006\u0004\b\u0011\u0010\u000eJ/\u0010\u0014\u001a\b\u0012\u0004\u0012\u00028\u00000\u0005\"\b\b\u0000\u0010\u0003*\u00020\u00022\u0006\u0010\u0004\u001a\u00028\u00002\u0006\u0010\u0010\u001a\u00020\u000fH\u0007¢\u0006\u0004\b\u0014\u0010\u0012JY\u0010\u0014\u001a\b\u0012\u0004\u0012\u00028\u00000\u0005\"\b\b\u0000\u0010\u0003*\u00020\u0002\"\u000e\b\u0001\u0010\t*\b\u0012\u0004\u0012\u00028\u00000\b2\u0006\u0010\u0004\u001a\u00028\u00002\u0006\u0010\u0010\u001a\u00020\u000f2\u0018\u0010\r\u001a\u0014\u0012\u0004\u0012\u00028\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00020\f0\u000b0\nH\u0007¢\u0006\u0004\b\u0014\u0010\u0013J'\u0010\u0014\u001a\b\u0012\u0004\u0012\u00028\u00000\u0005\"\b\b\u0000\u0010\u0003*\u00020\u00022\u0006\u0010\u0004\u001a\u00028\u0000H\u0007¢\u0006\u0004\b\u0014\u0010\u0007JQ\u0010\u0014\u001a\b\u0012\u0004\u0012\u00028\u00000\u0005\"\b\b\u0000\u0010\u0003*\u00020\u0002\"\u000e\b\u0001\u0010\t*\b\u0012\u0004\u0012\u00028\u00000\b2\u0006\u0010\u0004\u001a\u00028\u00002\u0018\u0010\r\u001a\u0014\u0012\u0004\u0012\u00028\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00020\f0\u000b0\nH\u0007¢\u0006\u0004\b\u0014\u0010\u000e¨\u0006\u0017"}, d2 = {"Lcom/amplifyframework/api/graphql/model/ModelMutation;", "", "Lcom/amplifyframework/core/model/Model;", "M", "model", "Lcom/amplifyframework/api/graphql/GraphQLRequest;", "create", "(Lcom/amplifyframework/core/model/Model;)Lcom/amplifyframework/api/graphql/GraphQLRequest;", "Lcom/amplifyframework/core/model/ModelPath;", "P", "Lkotlin/Function1;", "", "Lcom/amplifyframework/core/model/PropertyContainerPath;", "includes", "(Lcom/amplifyframework/core/model/Model;Ldn/l;)Lcom/amplifyframework/api/graphql/GraphQLRequest;", "Lcom/amplifyframework/core/model/query/predicate/QueryPredicate;", "predicate", "update", "(Lcom/amplifyframework/core/model/Model;Lcom/amplifyframework/core/model/query/predicate/QueryPredicate;)Lcom/amplifyframework/api/graphql/GraphQLRequest;", "(Lcom/amplifyframework/core/model/Model;Lcom/amplifyframework/core/model/query/predicate/QueryPredicate;Ldn/l;)Lcom/amplifyframework/api/graphql/GraphQLRequest;", "delete", "<init>", "()V", "aws-api_release"}, k = 1, mv = {1, 9, 0})
/* loaded from: classes4.dex */
public final class ModelMutation {
    public static final ModelMutation INSTANCE = new ModelMutation();

    private ModelMutation() {
    }

    public static final <M extends Model> GraphQLRequest<M> create(M model) {
        t.g(model, "model");
        QueryPredicate all = QueryPredicates.all();
        t.f(all, "all(...)");
        return AppSyncGraphQLRequestFactory.buildMutation(model, all, MutationType.CREATE);
    }

    public static final <M extends Model> GraphQLRequest<M> delete(M model, QueryPredicate predicate) {
        t.g(model, "model");
        t.g(predicate, "predicate");
        return AppSyncGraphQLRequestFactory.buildMutation(model, predicate, MutationType.DELETE);
    }

    public static final <M extends Model> GraphQLRequest<M> update(M model, QueryPredicate predicate) {
        t.g(model, "model");
        t.g(predicate, "predicate");
        return AppSyncGraphQLRequestFactory.buildMutation(model, predicate, MutationType.UPDATE);
    }

    public static final <M extends Model, P extends ModelPath<M>> GraphQLRequest<M> create(M model, l includes) {
        t.g(model, "model");
        t.g(includes, "includes");
        QueryPredicate all = QueryPredicates.all();
        t.f(all, "all(...)");
        return AppSyncGraphQLRequestFactory.buildMutation(model, all, MutationType.CREATE, includes);
    }

    public static final <M extends Model, P extends ModelPath<M>> GraphQLRequest<M> delete(M model, QueryPredicate predicate, l includes) {
        t.g(model, "model");
        t.g(predicate, "predicate");
        t.g(includes, "includes");
        return AppSyncGraphQLRequestFactory.buildMutation(model, predicate, MutationType.DELETE, includes);
    }

    public static final <M extends Model, P extends ModelPath<M>> GraphQLRequest<M> update(M model, QueryPredicate predicate, l includes) {
        t.g(model, "model");
        t.g(predicate, "predicate");
        t.g(includes, "includes");
        return AppSyncGraphQLRequestFactory.buildMutation(model, predicate, MutationType.UPDATE, includes);
    }

    public static final <M extends Model> GraphQLRequest<M> delete(M model) {
        t.g(model, "model");
        QueryPredicate all = QueryPredicates.all();
        t.f(all, "all(...)");
        return AppSyncGraphQLRequestFactory.buildMutation(model, all, MutationType.DELETE);
    }

    public static final <M extends Model> GraphQLRequest<M> update(M model) {
        t.g(model, "model");
        QueryPredicate all = QueryPredicates.all();
        t.f(all, "all(...)");
        return AppSyncGraphQLRequestFactory.buildMutation(model, all, MutationType.UPDATE);
    }

    public static final <M extends Model, P extends ModelPath<M>> GraphQLRequest<M> delete(M model, l includes) {
        t.g(model, "model");
        t.g(includes, "includes");
        QueryPredicate all = QueryPredicates.all();
        t.f(all, "all(...)");
        return AppSyncGraphQLRequestFactory.buildMutation(model, all, MutationType.DELETE, includes);
    }

    public static final <M extends Model, P extends ModelPath<M>> GraphQLRequest<M> update(M model, l includes) {
        t.g(model, "model");
        t.g(includes, "includes");
        QueryPredicate all = QueryPredicates.all();
        t.f(all, "all(...)");
        return AppSyncGraphQLRequestFactory.buildMutation(model, all, MutationType.UPDATE, includes);
    }
}
