"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CryptoAddressesModuleModel = void 0;
const query_builder_1 = require("../query-builder");
const input_types_1 = require("../input-types");
class CryptoAddressesModuleModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('CryptoAddressesModule', 'cryptoAddressesModules', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'CryptoAddressesModuleFilter', 'CryptoAddressesModuleOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'CryptoAddressesModule',
            fieldName: 'cryptoAddressesModules',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('CryptoAddressesModule', 'cryptoAddressesModules', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'CryptoAddressesModuleFilter', 'CryptoAddressesModuleOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'CryptoAddressesModule',
            fieldName: 'cryptoAddressesModule',
            document,
            variables,
            transform: (data) => ({
                cryptoAddressesModule: data.cryptoAddressesModules?.nodes?.[0] ?? null,
            }),
        });
    }
    findOne(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('CryptoAddressesModule', 'cryptoAddressesModules', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'CryptoAddressesModuleFilter', 'CryptoAddressesModuleOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'CryptoAddressesModule',
            fieldName: 'cryptoAddressesModule',
            document,
            variables,
            transform: (data) => ({
                cryptoAddressesModule: data.cryptoAddressesModules?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = (0, query_builder_1.buildCreateDocument)('CryptoAddressesModule', 'createCryptoAddressesModule', 'cryptoAddressesModule', args.select, args.data, 'CreateCryptoAddressesModuleInput', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'CryptoAddressesModule',
            fieldName: 'createCryptoAddressesModule',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = (0, query_builder_1.buildUpdateByPkDocument)('CryptoAddressesModule', 'updateCryptoAddressesModule', 'cryptoAddressesModule', args.select, args.where.id, args.data, 'UpdateCryptoAddressesModuleInput', 'id', 'cryptoAddressesModulePatch', input_types_1.connectionFieldsMap, undefined);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'CryptoAddressesModule',
            fieldName: 'updateCryptoAddressesModule',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('CryptoAddressesModule', 'deleteCryptoAddressesModule', 'cryptoAddressesModule', {
            id: args.where.id,
        }, 'DeleteCryptoAddressesModuleInput', args.select, input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'CryptoAddressesModule',
            fieldName: 'deleteCryptoAddressesModule',
            document,
            variables,
        });
    }
}
exports.CryptoAddressesModuleModel = CryptoAddressesModuleModel;
