"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Webhooks = void 0;
class Webhooks {
    constructor(client) {
        this.client = client;
    }
    async createWebhook(parameters, callback) {
        const config = {
            url: '/webhooks/',
            method: 'POST',
            params: {
                description: parameters.description,
                callbackURL: parameters.callbackURL,
                idModel: parameters.idModel,
                active: parameters.active,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getWebhook(parameters, callback) {
        const config = {
            url: `/webhooks/${parameters.id}`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async updateWebhook(parameters, callback) {
        const config = {
            url: `/webhooks/${parameters.id}`,
            method: 'PUT',
            params: {
                description: parameters.description,
                callbackURL: parameters.callbackURL,
                idModel: parameters.idModel,
                active: parameters.active,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async deleteWebhook(parameters, callback) {
        const config = {
            url: `/webhooks/${parameters.id}`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
    async getWebhookField(parameters, callback) {
        const config = {
            url: `/webhooks/${parameters.id}/${parameters.field}`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
}
exports.Webhooks = Webhooks;
