import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class OrgClaimedInviteModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('OrgClaimedInvite', 'orgClaimedInvites', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'OrgClaimedInviteFilter', 'OrgClaimedInviteOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'OrgClaimedInvite',
            fieldName: 'orgClaimedInvites',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('OrgClaimedInvite', 'orgClaimedInvites', args.select, {
            where: args?.where,
        }, 'OrgClaimedInviteFilter', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'OrgClaimedInvite',
            fieldName: 'orgClaimedInvites',
            document,
            variables,
        });
    }
    findOne(args) {
        const { document, variables } = buildFindManyDocument('OrgClaimedInvite', 'orgClaimedInvites', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'OrgClaimedInviteFilter', 'OrgClaimedInviteOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'OrgClaimedInvite',
            fieldName: 'orgClaimedInvite',
            document,
            variables,
            transform: (data) => ({
                orgClaimedInvite: data.orgClaimedInvites?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('OrgClaimedInvite', 'createOrgClaimedInvite', 'orgClaimedInvite', args.select, args.data, 'CreateOrgClaimedInviteInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'OrgClaimedInvite',
            fieldName: 'createOrgClaimedInvite',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = buildUpdateByPkDocument('OrgClaimedInvite', 'updateOrgClaimedInvite', 'orgClaimedInvite', args.select, args.where.id, args.data, 'UpdateOrgClaimedInviteInput', 'id', 'orgClaimedInvitePatch', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'OrgClaimedInvite',
            fieldName: 'updateOrgClaimedInvite',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = buildDeleteByPkDocument('OrgClaimedInvite', 'deleteOrgClaimedInvite', 'orgClaimedInvite', {
            id: args.where.id,
        }, 'DeleteOrgClaimedInviteInput', args.select, connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'OrgClaimedInvite',
            fieldName: 'deleteOrgClaimedInvite',
            document,
            variables,
        });
    }
}
