"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AppLimitDefaultModel = void 0;
const query_builder_1 = require("../query-builder");
const input_types_1 = require("../input-types");
class AppLimitDefaultModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('AppLimitDefault', 'appLimitDefaults', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'AppLimitDefaultFilter', 'AppLimitDefaultOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'AppLimitDefault',
            fieldName: 'appLimitDefaults',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('AppLimitDefault', 'appLimitDefaults', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'AppLimitDefaultFilter', 'AppLimitDefaultOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'AppLimitDefault',
            fieldName: 'appLimitDefault',
            document,
            variables,
            transform: (data) => ({
                appLimitDefault: data.appLimitDefaults?.nodes?.[0] ?? null,
            }),
        });
    }
    findOne(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('AppLimitDefault', 'appLimitDefaults', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'AppLimitDefaultFilter', 'AppLimitDefaultOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'AppLimitDefault',
            fieldName: 'appLimitDefault',
            document,
            variables,
            transform: (data) => ({
                appLimitDefault: data.appLimitDefaults?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = (0, query_builder_1.buildCreateDocument)('AppLimitDefault', 'createAppLimitDefault', 'appLimitDefault', args.select, args.data, 'CreateAppLimitDefaultInput', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'AppLimitDefault',
            fieldName: 'createAppLimitDefault',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = (0, query_builder_1.buildUpdateByPkDocument)('AppLimitDefault', 'updateAppLimitDefault', 'appLimitDefault', args.select, args.where.id, args.data, 'UpdateAppLimitDefaultInput', 'id', 'appLimitDefaultPatch', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'AppLimitDefault',
            fieldName: 'updateAppLimitDefault',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('AppLimitDefault', 'deleteAppLimitDefault', 'appLimitDefault', {
            id: args.where.id,
        }, 'DeleteAppLimitDefaultInput', args.select, input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'AppLimitDefault',
            fieldName: 'deleteAppLimitDefault',
            document,
            variables,
        });
    }
}
exports.AppLimitDefaultModel = AppLimitDefaultModel;
