import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class DefaultIdsModuleModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = 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', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'DefaultIdsModule',
            fieldName: 'defaultIdsModules',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('DefaultIdsModule', 'defaultIdsModules', args.select, {
            where: args?.where,
        }, 'DefaultIdsModuleFilter', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'DefaultIdsModule',
            fieldName: 'defaultIdsModules',
            document,
            variables,
        });
    }
    findOne(args) {
        const { document, variables } = buildFindManyDocument('DefaultIdsModule', 'defaultIdsModules', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'DefaultIdsModuleFilter', 'DefaultIdsModuleOrderBy', connectionFieldsMap);
        return new 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 } = buildCreateDocument('DefaultIdsModule', 'createDefaultIdsModule', 'defaultIdsModule', args.select, args.data, 'CreateDefaultIdsModuleInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'DefaultIdsModule',
            fieldName: 'createDefaultIdsModule',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = buildUpdateByPkDocument('DefaultIdsModule', 'updateDefaultIdsModule', 'defaultIdsModule', args.select, args.where.id, args.data, 'UpdateDefaultIdsModuleInput', 'id', 'defaultIdsModulePatch', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'DefaultIdsModule',
            fieldName: 'updateDefaultIdsModule',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = buildDeleteByPkDocument('DefaultIdsModule', 'deleteDefaultIdsModule', 'defaultIdsModule', {
            id: args.where.id,
        }, 'DeleteDefaultIdsModuleInput', args.select, connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'DefaultIdsModule',
            fieldName: 'deleteDefaultIdsModule',
            document,
            variables,
        });
    }
}
