import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class EmbeddingChunkModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('EmbeddingChunk', 'embeddingChunks', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'EmbeddingChunkFilter', 'EmbeddingChunkOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'EmbeddingChunk',
            fieldName: 'embeddingChunks',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('EmbeddingChunk', 'embeddingChunks', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'EmbeddingChunkFilter', 'EmbeddingChunkOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'EmbeddingChunk',
            fieldName: 'embeddingChunk',
            document,
            variables,
            transform: (data) => ({
                embeddingChunk: data.embeddingChunks?.nodes?.[0] ?? null,
            }),
        });
    }
    findOne(args) {
        const { document, variables } = buildFindManyDocument('EmbeddingChunk', 'embeddingChunks', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'EmbeddingChunkFilter', 'EmbeddingChunkOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'EmbeddingChunk',
            fieldName: 'embeddingChunk',
            document,
            variables,
            transform: (data) => ({
                embeddingChunk: data.embeddingChunks?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('EmbeddingChunk', 'createEmbeddingChunk', 'embeddingChunk', args.select, args.data, 'CreateEmbeddingChunkInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'EmbeddingChunk',
            fieldName: 'createEmbeddingChunk',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = buildUpdateByPkDocument('EmbeddingChunk', 'updateEmbeddingChunk', 'embeddingChunk', args.select, args.where.id, args.data, 'UpdateEmbeddingChunkInput', 'id', 'embeddingChunkPatch', connectionFieldsMap, undefined);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'EmbeddingChunk',
            fieldName: 'updateEmbeddingChunk',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = buildDeleteByPkDocument('EmbeddingChunk', 'deleteEmbeddingChunk', 'embeddingChunk', {
            id: args.where.id,
        }, 'DeleteEmbeddingChunkInput', args.select, connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'EmbeddingChunk',
            fieldName: 'deleteEmbeddingChunk',
            document,
            variables,
        });
    }
}
