"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomFields = void 0;
class CustomFields {
    constructor(client) {
        this.client = client;
    }
    async createCustomField(parameters, callback) {
        const config = {
            url: '/customFields',
            method: 'POST',
            data: {
                idModel: parameters === null || parameters === void 0 ? void 0 : parameters.idModel,
                modelType: parameters === null || parameters === void 0 ? void 0 : parameters.modelType,
                name: parameters === null || parameters === void 0 ? void 0 : parameters.name,
                type: parameters === null || parameters === void 0 ? void 0 : parameters.type,
                options: parameters === null || parameters === void 0 ? void 0 : parameters.options,
                pos: parameters === null || parameters === void 0 ? void 0 : parameters.pos,
                display_cardFront: parameters === null || parameters === void 0 ? void 0 : parameters.displayCardFront,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getCustomField(parameters, callback) {
        const config = {
            url: `/customFields/${parameters.id}`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async updateCustomField(parameters, callback) {
        const config = {
            url: `/customFields/${parameters.id}`,
            method: 'PUT',
            data: {
                name: parameters.name,
                pos: parameters.pos,
                'display/cardFront': parameters.dispalyCardFront,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async deleteCustomField(parameters, callback) {
        const config = {
            url: `/customFields/${parameters.id}`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
    async getCustomFieldOptions(parameters, callback) {
        const config = {
            url: `/customFields/${parameters.id}/options`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async addCustomFieldOption(parameters, callback) {
        const config = {
            url: `/customFields/${parameters.id}/options`,
            method: 'POST',
        };
        return this.client.sendRequest(config, callback);
    }
    async getCustomFieldsOption(parameters, callback) {
        const config = {
            url: `/customFields/${parameters.id}/options/${parameters.idCustomFieldOption}`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async deleteCustomFieldsOption(parameters, callback) {
        const config = {
            url: `/customFields/${parameters.id}/options/${parameters.idCustomFieldOption}`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
}
exports.CustomFields = CustomFields;
