import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class PlatformInfraGetAllTreeNodesRecordModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('PlatformInfraGetAllTreeNodesRecord', 'platformInfraGetAllTreeNodes', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'PlatformInfraGetAllTreeNodesRecordFilter', 'PlatformInfraGetAllTreeNodesRecordsOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'PlatformInfraGetAllTreeNodesRecord',
            fieldName: 'platformInfraGetAllTreeNodes',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('PlatformInfraGetAllTreeNodesRecord', 'platformInfraGetAllTreeNodes', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'PlatformInfraGetAllTreeNodesRecordFilter', 'PlatformInfraGetAllTreeNodesRecordsOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'PlatformInfraGetAllTreeNodesRecord',
            fieldName: 'platformInfraGetAllTreeNodesRecord',
            document,
            variables,
            transform: (data) => ({
                platformInfraGetAllTreeNodesRecord: data.platformInfraGetAllTreeNodes?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('PlatformInfraGetAllTreeNodesRecord', 'createPlatformInfraGetAllTreeNodesRecord', 'platformInfraGetAllTreeNodesRecord', args.select, args.data, 'CreatePlatformInfraGetAllTreeNodesRecordInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'PlatformInfraGetAllTreeNodesRecord',
            fieldName: 'createPlatformInfraGetAllTreeNodesRecord',
            document,
            variables,
        });
    }
}
