import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class InfraGetAllTreeNodesRecordModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('InfraGetAllTreeNodesRecord', 'infraGetAllTreeNodes', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'InfraGetAllTreeNodesRecordFilter', 'InfraGetAllTreeNodesRecordsOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'InfraGetAllTreeNodesRecord',
            fieldName: 'infraGetAllTreeNodes',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('InfraGetAllTreeNodesRecord', 'infraGetAllTreeNodes', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'InfraGetAllTreeNodesRecordFilter', 'InfraGetAllTreeNodesRecordsOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'InfraGetAllTreeNodesRecord',
            fieldName: 'infraGetAllTreeNodesRecord',
            document,
            variables,
            transform: (data) => ({
                infraGetAllTreeNodesRecord: data.infraGetAllTreeNodes?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('InfraGetAllTreeNodesRecord', 'createInfraGetAllTreeNodesRecord', 'infraGetAllTreeNodesRecord', args.select, args.data, 'CreateInfraGetAllTreeNodesRecordInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'InfraGetAllTreeNodesRecord',
            fieldName: 'createInfraGetAllTreeNodesRecord',
            document,
            variables,
        });
    }
}
