import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class OrgLimitWarningModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('OrgLimitWarning', 'orgLimitWarnings', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'OrgLimitWarningFilter', 'OrgLimitWarningOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'OrgLimitWarning',
            fieldName: 'orgLimitWarnings',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('OrgLimitWarning', 'orgLimitWarnings', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'OrgLimitWarningFilter', 'OrgLimitWarningOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'OrgLimitWarning',
            fieldName: 'orgLimitWarning',
            document,
            variables,
            transform: (data) => ({
                orgLimitWarning: data.orgLimitWarnings?.nodes?.[0] ?? null,
            }),
        });
    }
    findOne(args) {
        const { document, variables } = buildFindManyDocument('OrgLimitWarning', 'orgLimitWarnings', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'OrgLimitWarningFilter', 'OrgLimitWarningOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'OrgLimitWarning',
            fieldName: 'orgLimitWarning',
            document,
            variables,
            transform: (data) => ({
                orgLimitWarning: data.orgLimitWarnings?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('OrgLimitWarning', 'createOrgLimitWarning', 'orgLimitWarning', args.select, args.data, 'CreateOrgLimitWarningInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'OrgLimitWarning',
            fieldName: 'createOrgLimitWarning',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = buildUpdateByPkDocument('OrgLimitWarning', 'updateOrgLimitWarning', 'orgLimitWarning', args.select, args.where.id, args.data, 'UpdateOrgLimitWarningInput', 'id', 'orgLimitWarningPatch', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'OrgLimitWarning',
            fieldName: 'updateOrgLimitWarning',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = buildDeleteByPkDocument('OrgLimitWarning', 'deleteOrgLimitWarning', 'orgLimitWarning', {
            id: args.where.id,
        }, 'DeleteOrgLimitWarningInput', args.select, connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'OrgLimitWarning',
            fieldName: 'deleteOrgLimitWarning',
            document,
            variables,
        });
    }
}
