import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class InfraGetAllRecordModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('InfraGetAllRecord', 'infraGetAll', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'InfraGetAllRecordFilter', 'InfraGetAllRecordsOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'InfraGetAllRecord',
            fieldName: 'infraGetAll',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('InfraGetAllRecord', 'infraGetAll', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'InfraGetAllRecordFilter', 'InfraGetAllRecordsOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'InfraGetAllRecord',
            fieldName: 'infraGetAllRecord',
            document,
            variables,
            transform: (data) => ({
                infraGetAllRecord: data.infraGetAll?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('InfraGetAllRecord', 'createInfraGetAllRecord', 'infraGetAllRecord', args.select, args.data, 'CreateInfraGetAllRecordInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'InfraGetAllRecord',
            fieldName: 'createInfraGetAllRecord',
            document,
            variables,
        });
    }
}
