"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FullTextSearchModel = void 0;
const query_builder_1 = require("../query-builder");
const input_types_1 = require("../input-types");
class FullTextSearchModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('FullTextSearch', 'fullTextSearches', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'FullTextSearchFilter', 'FullTextSearchOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'FullTextSearch',
            fieldName: 'fullTextSearches',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('FullTextSearch', 'fullTextSearches', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'FullTextSearchFilter', 'FullTextSearchOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'FullTextSearch',
            fieldName: 'fullTextSearch',
            document,
            variables,
            transform: (data) => ({
                fullTextSearch: data.fullTextSearches?.nodes?.[0] ?? null,
            }),
        });
    }
    findOne(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('FullTextSearch', 'fullTextSearches', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'FullTextSearchFilter', 'FullTextSearchOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'FullTextSearch',
            fieldName: 'fullTextSearch',
            document,
            variables,
            transform: (data) => ({
                fullTextSearch: data.fullTextSearches?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = (0, query_builder_1.buildCreateDocument)('FullTextSearch', 'createFullTextSearch', 'fullTextSearch', args.select, args.data, 'CreateFullTextSearchInput', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'FullTextSearch',
            fieldName: 'createFullTextSearch',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = (0, query_builder_1.buildUpdateByPkDocument)('FullTextSearch', 'updateFullTextSearch', 'fullTextSearch', args.select, args.where.id, args.data, 'UpdateFullTextSearchInput', 'id', 'fullTextSearchPatch', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'FullTextSearch',
            fieldName: 'updateFullTextSearch',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('FullTextSearch', 'deleteFullTextSearch', 'fullTextSearch', {
            id: args.where.id,
        }, 'DeleteFullTextSearchInput', args.select, input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'FullTextSearch',
            fieldName: 'deleteFullTextSearch',
            document,
            variables,
        });
    }
}
exports.FullTextSearchModel = FullTextSearchModel;
