import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class DeclaredCapacityModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('DeclaredCapacity', 'declaredCapacities', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'DeclaredCapacityFilter', 'DeclaredCapacityOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'DeclaredCapacity',
            fieldName: 'declaredCapacities',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('DeclaredCapacity', 'declaredCapacities', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'DeclaredCapacityFilter', 'DeclaredCapacityOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'DeclaredCapacity',
            fieldName: 'declaredCapacity',
            document,
            variables,
            transform: (data) => ({
                declaredCapacity: data.declaredCapacities?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('DeclaredCapacity', 'createDeclaredCapacity', 'declaredCapacity', args.select, args.data, 'CreateDeclaredCapacityInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'DeclaredCapacity',
            fieldName: 'createDeclaredCapacity',
            document,
            variables,
        });
    }
}
