"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultIdsModuleModel = void 0;
const query_builder_1 = require("../query-builder");
const input_types_1 = require("../input-types");
class DefaultIdsModuleModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('DefaultIdsModule', 'defaultIdsModules', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'DefaultIdsModuleFilter', 'DefaultIdsModuleOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'DefaultIdsModule',
            fieldName: 'defaultIdsModules',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('DefaultIdsModule', 'defaultIdsModules', args.select, {
            where: args?.where,
        }, 'DefaultIdsModuleFilter', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'DefaultIdsModule',
            fieldName: 'defaultIdsModules',
            document,
            variables,
        });
    }
    findOne(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('DefaultIdsModule', 'defaultIdsModules', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'DefaultIdsModuleFilter', 'DefaultIdsModuleOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'DefaultIdsModule',
            fieldName: 'defaultIdsModule',
            document,
            variables,
            transform: (data) => ({
                defaultIdsModule: data.defaultIdsModules?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = (0, query_builder_1.buildCreateDocument)('DefaultIdsModule', 'createDefaultIdsModule', 'defaultIdsModule', args.select, args.data, 'CreateDefaultIdsModuleInput', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'DefaultIdsModule',
            fieldName: 'createDefaultIdsModule',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = (0, query_builder_1.buildUpdateByPkDocument)('DefaultIdsModule', 'updateDefaultIdsModule', 'defaultIdsModule', args.select, args.where.id, args.data, 'UpdateDefaultIdsModuleInput', 'id', 'defaultIdsModulePatch', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'DefaultIdsModule',
            fieldName: 'updateDefaultIdsModule',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('DefaultIdsModule', 'deleteDefaultIdsModule', 'defaultIdsModule', {
            id: args.where.id,
        }, 'DeleteDefaultIdsModuleInput', args.select, input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'DefaultIdsModule',
            fieldName: 'deleteDefaultIdsModule',
            document,
            variables,
        });
    }
}
exports.DefaultIdsModuleModel = DefaultIdsModuleModel;
