import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class AppClaimedInviteModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('AppClaimedInvite', 'appClaimedInvites', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'AppClaimedInviteFilter', 'AppClaimedInviteOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'AppClaimedInvite',
            fieldName: 'appClaimedInvites',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('AppClaimedInvite', 'appClaimedInvites', args.select, {
            where: args?.where,
        }, 'AppClaimedInviteFilter', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'AppClaimedInvite',
            fieldName: 'appClaimedInvites',
            document,
            variables,
        });
    }
    findOne(args) {
        const { document, variables } = buildFindManyDocument('AppClaimedInvite', 'appClaimedInvites', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'AppClaimedInviteFilter', 'AppClaimedInviteOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'AppClaimedInvite',
            fieldName: 'appClaimedInvite',
            document,
            variables,
            transform: (data) => ({
                appClaimedInvite: data.appClaimedInvites?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('AppClaimedInvite', 'createAppClaimedInvite', 'appClaimedInvite', args.select, args.data, 'CreateAppClaimedInviteInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'AppClaimedInvite',
            fieldName: 'createAppClaimedInvite',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = buildUpdateByPkDocument('AppClaimedInvite', 'updateAppClaimedInvite', 'appClaimedInvite', args.select, args.where.id, args.data, 'UpdateAppClaimedInviteInput', 'id', 'appClaimedInvitePatch', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'AppClaimedInvite',
            fieldName: 'updateAppClaimedInvite',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = buildDeleteByPkDocument('AppClaimedInvite', 'deleteAppClaimedInvite', 'appClaimedInvite', {
            id: args.where.id,
        }, 'DeleteAppClaimedInviteInput', args.select, connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'AppClaimedInvite',
            fieldName: 'deleteAppClaimedInvite',
            document,
            variables,
        });
    }
}
