"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PubkeySettingModel = void 0;
const query_builder_1 = require("../query-builder");
const input_types_1 = require("../input-types");
class PubkeySettingModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('PubkeySetting', 'pubkeySettings', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'PubkeySettingFilter', 'PubkeySettingOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'PubkeySetting',
            fieldName: 'pubkeySettings',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('PubkeySetting', 'pubkeySettings', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'PubkeySettingFilter', 'PubkeySettingOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'PubkeySetting',
            fieldName: 'pubkeySetting',
            document,
            variables,
            transform: (data) => ({
                pubkeySetting: data.pubkeySettings?.nodes?.[0] ?? null,
            }),
        });
    }
    findOne(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('PubkeySetting', 'pubkeySettings', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'PubkeySettingFilter', 'PubkeySettingOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'PubkeySetting',
            fieldName: 'pubkeySetting',
            document,
            variables,
            transform: (data) => ({
                pubkeySetting: data.pubkeySettings?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = (0, query_builder_1.buildCreateDocument)('PubkeySetting', 'createPubkeySetting', 'pubkeySetting', args.select, args.data, 'CreatePubkeySettingInput', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'PubkeySetting',
            fieldName: 'createPubkeySetting',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = (0, query_builder_1.buildUpdateByPkDocument)('PubkeySetting', 'updatePubkeySetting', 'pubkeySetting', args.select, args.where.id, args.data, 'UpdatePubkeySettingInput', 'id', 'pubkeySettingPatch', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'PubkeySetting',
            fieldName: 'updatePubkeySetting',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('PubkeySetting', 'deletePubkeySetting', 'pubkeySetting', {
            id: args.where.id,
        }, 'DeletePubkeySettingInput', args.select, input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'PubkeySetting',
            fieldName: 'deletePubkeySetting',
            document,
            variables,
        });
    }
}
exports.PubkeySettingModel = PubkeySettingModel;
