import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class ComputeLogModuleModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('ComputeLogModule', 'computeLogModules', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'ComputeLogModuleFilter', 'ComputeLogModuleOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'ComputeLogModule',
            fieldName: 'computeLogModules',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('ComputeLogModule', 'computeLogModules', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'ComputeLogModuleFilter', 'ComputeLogModuleOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'ComputeLogModule',
            fieldName: 'computeLogModule',
            document,
            variables,
            transform: (data) => ({
                computeLogModule: data.computeLogModules?.nodes?.[0] ?? null,
            }),
        });
    }
    findOne(args) {
        const { document, variables } = buildFindManyDocument('ComputeLogModule', 'computeLogModules', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'ComputeLogModuleFilter', 'ComputeLogModuleOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'ComputeLogModule',
            fieldName: 'computeLogModule',
            document,
            variables,
            transform: (data) => ({
                computeLogModule: data.computeLogModules?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('ComputeLogModule', 'createComputeLogModule', 'computeLogModule', args.select, args.data, 'CreateComputeLogModuleInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'ComputeLogModule',
            fieldName: 'createComputeLogModule',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = buildUpdateByPkDocument('ComputeLogModule', 'updateComputeLogModule', 'computeLogModule', args.select, args.where.id, args.data, 'UpdateComputeLogModuleInput', 'id', 'computeLogModulePatch', connectionFieldsMap, undefined);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'ComputeLogModule',
            fieldName: 'updateComputeLogModule',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = buildDeleteByPkDocument('ComputeLogModule', 'deleteComputeLogModule', 'computeLogModule', {
            id: args.where.id,
        }, 'DeleteComputeLogModuleInput', args.select, connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'ComputeLogModule',
            fieldName: 'deleteComputeLogModule',
            document,
            variables,
        });
    }
}
