"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EncryptedSecretsModuleModel = void 0;
const query_builder_1 = require("../query-builder");
const input_types_1 = require("../input-types");
class EncryptedSecretsModuleModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('EncryptedSecretsModule', 'encryptedSecretsModules', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'EncryptedSecretsModuleFilter', 'EncryptedSecretsModuleOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'EncryptedSecretsModule',
            fieldName: 'encryptedSecretsModules',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('EncryptedSecretsModule', 'encryptedSecretsModules', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'EncryptedSecretsModuleFilter', 'EncryptedSecretsModuleOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'EncryptedSecretsModule',
            fieldName: 'encryptedSecretsModule',
            document,
            variables,
            transform: (data) => ({
                encryptedSecretsModule: data.encryptedSecretsModules?.nodes?.[0] ?? null,
            }),
        });
    }
    findOne(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('EncryptedSecretsModule', 'encryptedSecretsModules', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'EncryptedSecretsModuleFilter', 'EncryptedSecretsModuleOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'EncryptedSecretsModule',
            fieldName: 'encryptedSecretsModule',
            document,
            variables,
            transform: (data) => ({
                encryptedSecretsModule: data.encryptedSecretsModules?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = (0, query_builder_1.buildCreateDocument)('EncryptedSecretsModule', 'createEncryptedSecretsModule', 'encryptedSecretsModule', args.select, args.data, 'CreateEncryptedSecretsModuleInput', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'EncryptedSecretsModule',
            fieldName: 'createEncryptedSecretsModule',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = (0, query_builder_1.buildUpdateByPkDocument)('EncryptedSecretsModule', 'updateEncryptedSecretsModule', 'encryptedSecretsModule', args.select, args.where.id, args.data, 'UpdateEncryptedSecretsModuleInput', 'id', 'encryptedSecretsModulePatch', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'EncryptedSecretsModule',
            fieldName: 'updateEncryptedSecretsModule',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('EncryptedSecretsModule', 'deleteEncryptedSecretsModule', 'encryptedSecretsModule', {
            id: args.where.id,
        }, 'DeleteEncryptedSecretsModuleInput', args.select, input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'EncryptedSecretsModule',
            fieldName: 'deleteEncryptedSecretsModule',
            document,
            variables,
        });
    }
}
exports.EncryptedSecretsModuleModel = EncryptedSecretsModuleModel;
