import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class AppLimitEventModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('AppLimitEvent', 'appLimitEvents', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'AppLimitEventFilter', 'AppLimitEventOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'AppLimitEvent',
            fieldName: 'appLimitEvents',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('AppLimitEvent', 'appLimitEvents', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'AppLimitEventFilter', 'AppLimitEventOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'AppLimitEvent',
            fieldName: 'appLimitEvent',
            document,
            variables,
            transform: (data) => ({
                appLimitEvent: data.appLimitEvents?.nodes?.[0] ?? null,
            }),
        });
    }
    findOne(args) {
        const { document, variables } = buildFindManyDocument('AppLimitEvent', 'appLimitEvents', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'AppLimitEventFilter', 'AppLimitEventOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'AppLimitEvent',
            fieldName: 'appLimitEvent',
            document,
            variables,
            transform: (data) => ({
                appLimitEvent: data.appLimitEvents?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('AppLimitEvent', 'createAppLimitEvent', 'appLimitEvent', args.select, args.data, 'CreateAppLimitEventInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'AppLimitEvent',
            fieldName: 'createAppLimitEvent',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = buildUpdateByPkDocument('AppLimitEvent', 'updateAppLimitEvent', 'appLimitEvent', args.select, args.where.id, args.data, 'UpdateAppLimitEventInput', 'id', 'appLimitEventPatch', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'AppLimitEvent',
            fieldName: 'updateAppLimitEvent',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = buildDeleteByPkDocument('AppLimitEvent', 'deleteAppLimitEvent', 'appLimitEvent', {
            id: args.where.id,
        }, 'DeleteAppLimitEventInput', args.select, connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'AppLimitEvent',
            fieldName: 'deleteAppLimitEvent',
            document,
            variables,
        });
    }
}
