"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Tokens = void 0;
class Tokens {
    constructor(client) {
        this.client = client;
    }
    async getToken(parameters, callback) {
        const config = {
            url: `/tokens/${parameters.token}`,
            method: 'GET',
            params: {
                fields: parameters.fields,
                webhooks: parameters.webhooks,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getTokenMember(parameters, callback) {
        const config = {
            url: `/tokens/${parameters.token}/member`,
            method: 'GET',
            params: {
                fields: parameters.fields,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getTokenWebhooks(parameters, callback) {
        const config = {
            url: `/tokens/${parameters.token}/webhooks`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async createTokenWebhooks(parameters, callback) {
        const config = {
            url: `/tokens/${parameters.token}/webhooks`,
            method: 'POST',
            params: {
                description: parameters.description,
                callbackURL: parameters.callbackURL,
                idModel: parameters.idModel,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getTokenWebhook(parameters, callback) {
        const config = {
            url: `/tokens/${parameters.token}/webhooks/${parameters.idWebhook}`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async updateTokenWebhook(parameters, callback) {
        const config = {
            url: `/tokens/${parameters.token}/webhooks/${parameters.idWebhook}`,
            method: 'PUT',
            params: {
                description: parameters.description,
                callbackURL: parameters.callbackURL,
                idModel: parameters.idModel,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async deleteTokenWebhook(parameters, callback) {
        const config = {
            url: `/tokens/${parameters.token}/webhooks/${parameters.idWebhook}`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
    async deleteToken(parameters, callback) {
        const config = {
            url: `/tokens/${parameters.token}/`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
}
exports.Tokens = Tokens;
