import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class EncryptedSecretsModuleModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = 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', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'EncryptedSecretsModule',
            fieldName: 'encryptedSecretsModules',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('EncryptedSecretsModule', 'encryptedSecretsModules', args.select, {
            where: args?.where,
        }, 'EncryptedSecretsModuleFilter', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'EncryptedSecretsModule',
            fieldName: 'encryptedSecretsModules',
            document,
            variables,
        });
    }
    findOne(args) {
        const { document, variables } = buildFindManyDocument('EncryptedSecretsModule', 'encryptedSecretsModules', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'EncryptedSecretsModuleFilter', 'EncryptedSecretsModuleOrderBy', connectionFieldsMap);
        return new 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 } = buildCreateDocument('EncryptedSecretsModule', 'createEncryptedSecretsModule', 'encryptedSecretsModule', args.select, args.data, 'CreateEncryptedSecretsModuleInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'EncryptedSecretsModule',
            fieldName: 'createEncryptedSecretsModule',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = buildUpdateByPkDocument('EncryptedSecretsModule', 'updateEncryptedSecretsModule', 'encryptedSecretsModule', args.select, args.where.id, args.data, 'UpdateEncryptedSecretsModuleInput', 'id', 'encryptedSecretsModulePatch', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'EncryptedSecretsModule',
            fieldName: 'updateEncryptedSecretsModule',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = buildDeleteByPkDocument('EncryptedSecretsModule', 'deleteEncryptedSecretsModule', 'encryptedSecretsModule', {
            id: args.where.id,
        }, 'DeleteEncryptedSecretsModuleInput', args.select, connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'EncryptedSecretsModule',
            fieldName: 'deleteEncryptedSecretsModule',
            document,
            variables,
        });
    }
}
