import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class ResourcesRequirementsStateModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('ResourcesRequirementsState', 'resourcesRequirementsStates', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'ResourcesRequirementsStateFilter', 'ResourcesRequirementsStateOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'ResourcesRequirementsState',
            fieldName: 'resourcesRequirementsStates',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('ResourcesRequirementsState', 'resourcesRequirementsStates', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'ResourcesRequirementsStateFilter', 'ResourcesRequirementsStateOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'ResourcesRequirementsState',
            fieldName: 'resourcesRequirementsState',
            document,
            variables,
            transform: (data) => ({
                resourcesRequirementsState: data.resourcesRequirementsStates?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('ResourcesRequirementsState', 'createResourcesRequirementsState', 'resourcesRequirementsState', args.select, args.data, 'CreateResourcesRequirementsStateInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'ResourcesRequirementsState',
            fieldName: 'createResourcesRequirementsState',
            document,
            variables,
        });
    }
}
