import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, } 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,
            }),
        });
    }
    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,
        });
    }
}
