import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class BlueprintConstructionModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('BlueprintConstruction', 'blueprintConstructions', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'BlueprintConstructionFilter', 'BlueprintConstructionOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'BlueprintConstruction',
            fieldName: 'blueprintConstructions',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('BlueprintConstruction', 'blueprintConstructions', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'BlueprintConstructionFilter', 'BlueprintConstructionOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'BlueprintConstruction',
            fieldName: 'blueprintConstruction',
            document,
            variables,
            transform: (data) => ({
                blueprintConstruction: data.blueprintConstructions?.nodes?.[0] ?? null,
            }),
        });
    }
    findOne(args) {
        const { document, variables } = buildFindManyDocument('BlueprintConstruction', 'blueprintConstructions', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'BlueprintConstructionFilter', 'BlueprintConstructionOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'BlueprintConstruction',
            fieldName: 'blueprintConstruction',
            document,
            variables,
            transform: (data) => ({
                blueprintConstruction: data.blueprintConstructions?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('BlueprintConstruction', 'createBlueprintConstruction', 'blueprintConstruction', args.select, args.data, 'CreateBlueprintConstructionInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'BlueprintConstruction',
            fieldName: 'createBlueprintConstruction',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = buildUpdateByPkDocument('BlueprintConstruction', 'updateBlueprintConstruction', 'blueprintConstruction', args.select, args.where.id, args.data, 'UpdateBlueprintConstructionInput', 'id', 'blueprintConstructionPatch', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'BlueprintConstruction',
            fieldName: 'updateBlueprintConstruction',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = buildDeleteByPkDocument('BlueprintConstruction', 'deleteBlueprintConstruction', 'blueprintConstruction', {
            id: args.where.id,
        }, 'DeleteBlueprintConstructionInput', args.select, connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'BlueprintConstruction',
            fieldName: 'deleteBlueprintConstruction',
            document,
            variables,
        });
    }
}
