@adyen/api-library
Version:
The Adyen API Library for NodeJS enables you to work with Adyen APIs.
114 lines • 7.06 kB
JavaScript
;
/*
* The version of the OpenAPI document: v2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BalancesApi = void 0;
const getJsonResponse_1 = __importDefault(require("../../helpers/getJsonResponse"));
const service_1 = __importDefault(require("../../service"));
const resource_1 = __importDefault(require("../resource"));
const objectSerializer_1 = require("../../typings/balancePlatform/objectSerializer");
/**
* API handler for BalancesApi
*/
class BalancesApi extends service_1.default {
constructor(client) {
super(client);
this.API_BASEPATH = "https://balanceplatform-api-test.adyen.com/bcl/v2";
this.baseUrl = this.createBaseUrl(this.API_BASEPATH);
}
/**
* @summary Create a balance webhook setting
* @param balancePlatformId {@link string } The unique identifier of the balance platform.
* @param webhookId {@link string } The unique identifier of the balance webhook.
* @param balanceWebhookSettingInfo {@link BalanceWebhookSettingInfo }
* @param requestOptions {@link IRequest.Options }
* @return {@link WebhookSetting }
*/
async createWebhookSetting(balancePlatformId, webhookId, balanceWebhookSettingInfo, requestOptions) {
const endpoint = `${this.baseUrl}/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings`
.replace("{" + "balancePlatformId" + "}", encodeURIComponent(String(balancePlatformId)))
.replace("{" + "webhookId" + "}", encodeURIComponent(String(webhookId)));
const resource = new resource_1.default(this, endpoint);
const request = objectSerializer_1.ObjectSerializer.serialize(balanceWebhookSettingInfo, "BalanceWebhookSettingInfo");
const response = await (0, getJsonResponse_1.default)(resource, request, { ...requestOptions, method: "POST" });
return objectSerializer_1.ObjectSerializer.deserialize(response, "WebhookSetting");
}
/**
* @summary Delete a balance webhook setting by id
* @param balancePlatformId {@link string } The unique identifier of the balance platform.
* @param webhookId {@link string } The unique identifier of the balance webhook.
* @param settingId {@link string } The unique identifier of the balance webhook setting.
* @param requestOptions {@link IRequest.Options }
* @return {@link void }
*/
async deleteWebhookSetting(balancePlatformId, webhookId, settingId, requestOptions) {
const endpoint = `${this.baseUrl}/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}`
.replace("{" + "balancePlatformId" + "}", encodeURIComponent(String(balancePlatformId)))
.replace("{" + "webhookId" + "}", encodeURIComponent(String(webhookId)))
.replace("{" + "settingId" + "}", encodeURIComponent(String(settingId)));
const resource = new resource_1.default(this, endpoint);
await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "DELETE" });
}
/**
* @summary Get all balance webhook settings
* @param balancePlatformId {@link string } The unique identifier of the balance platform.
* @param webhookId {@link string } The unique identifier of the balance webhook.
* @param requestOptions {@link IRequest.Options }
* @return {@link WebhookSettings }
*/
async getAllWebhookSettings(balancePlatformId, webhookId, requestOptions) {
const endpoint = `${this.baseUrl}/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings`
.replace("{" + "balancePlatformId" + "}", encodeURIComponent(String(balancePlatformId)))
.replace("{" + "webhookId" + "}", encodeURIComponent(String(webhookId)));
const resource = new resource_1.default(this, endpoint);
const response = await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "GET" });
return objectSerializer_1.ObjectSerializer.deserialize(response, "WebhookSettings");
}
/**
* @summary Get a balance webhook setting by id
* @param balancePlatformId {@link string } The unique identifier of the balance platform.
* @param webhookId {@link string } The unique identifier of the balance webhook.
* @param settingId {@link string } The unique identifier of the balance webhook setting.
* @param requestOptions {@link IRequest.Options }
* @return {@link WebhookSetting }
*/
async getWebhookSetting(balancePlatformId, webhookId, settingId, requestOptions) {
const endpoint = `${this.baseUrl}/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}`
.replace("{" + "balancePlatformId" + "}", encodeURIComponent(String(balancePlatformId)))
.replace("{" + "webhookId" + "}", encodeURIComponent(String(webhookId)))
.replace("{" + "settingId" + "}", encodeURIComponent(String(settingId)));
const resource = new resource_1.default(this, endpoint);
const response = await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "GET" });
return objectSerializer_1.ObjectSerializer.deserialize(response, "WebhookSetting");
}
/**
* @summary Update a balance webhook setting by id
* @param balancePlatformId {@link string } The unique identifier of the balance platform.
* @param webhookId {@link string } The unique identifier of the balance webhook.
* @param settingId {@link string } The unique identifier of the balance webhook setting.
* @param balanceWebhookSettingInfoUpdate {@link BalanceWebhookSettingInfoUpdate }
* @param requestOptions {@link IRequest.Options }
* @return {@link WebhookSetting }
*/
async updateWebhookSetting(balancePlatformId, webhookId, settingId, balanceWebhookSettingInfoUpdate, requestOptions) {
const endpoint = `${this.baseUrl}/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}`
.replace("{" + "balancePlatformId" + "}", encodeURIComponent(String(balancePlatformId)))
.replace("{" + "webhookId" + "}", encodeURIComponent(String(webhookId)))
.replace("{" + "settingId" + "}", encodeURIComponent(String(settingId)));
const resource = new resource_1.default(this, endpoint);
const request = objectSerializer_1.ObjectSerializer.serialize(balanceWebhookSettingInfoUpdate, "BalanceWebhookSettingInfoUpdate");
const response = await (0, getJsonResponse_1.default)(resource, request, { ...requestOptions, method: "PATCH" });
return objectSerializer_1.ObjectSerializer.deserialize(response, "WebhookSetting");
}
}
exports.BalancesApi = BalancesApi;
//# sourceMappingURL=balancesApi.js.map