import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class PlatformResourcesRequirementsStateModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('PlatformResourcesRequirementsState', 'platformResourcesRequirementsStates', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'PlatformResourcesRequirementsStateFilter', 'PlatformResourcesRequirementsStateOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'PlatformResourcesRequirementsState',
            fieldName: 'platformResourcesRequirementsStates',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('PlatformResourcesRequirementsState', 'platformResourcesRequirementsStates', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'PlatformResourcesRequirementsStateFilter', 'PlatformResourcesRequirementsStateOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'PlatformResourcesRequirementsState',
            fieldName: 'platformResourcesRequirementsState',
            document,
            variables,
            transform: (data) => ({
                platformResourcesRequirementsState: data.platformResourcesRequirementsStates?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('PlatformResourcesRequirementsState', 'createPlatformResourcesRequirementsState', 'platformResourcesRequirementsState', args.select, args.data, 'CreatePlatformResourcesRequirementsStateInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'PlatformResourcesRequirementsState',
            fieldName: 'createPlatformResourcesRequirementsState',
            document,
            variables,
        });
    }
}
