import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class ResourcesResolvedRequirementModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('ResourcesResolvedRequirement', 'resourcesResolvedRequirements', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'ResourcesResolvedRequirementFilter', 'ResourcesResolvedRequirementOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'ResourcesResolvedRequirement',
            fieldName: 'resourcesResolvedRequirements',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('ResourcesResolvedRequirement', 'resourcesResolvedRequirements', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'ResourcesResolvedRequirementFilter', 'ResourcesResolvedRequirementOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'ResourcesResolvedRequirement',
            fieldName: 'resourcesResolvedRequirement',
            document,
            variables,
            transform: (data) => ({
                resourcesResolvedRequirement: data.resourcesResolvedRequirements?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('ResourcesResolvedRequirement', 'createResourcesResolvedRequirement', 'resourcesResolvedRequirement', args.select, args.data, 'CreateResourcesResolvedRequirementInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'ResourcesResolvedRequirement',
            fieldName: 'createResourcesResolvedRequirement',
            document,
            variables,
        });
    }
}
