@venly/venly-core-sdk
Version:
Javascrip/Typescript SDK for Venly's Web3 Services
84 lines • 3.57 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.VyNotificationsAPI_Gen = void 0;
const core_1 = require("../core");
const json_1 = require("../helpers/json");
const notifications = __importStar(require("../models/notifications/index"));
const shared = __importStar(require("../models/shared/index"));
const enums = __importStar(require("../models/enums/index"));
class VyNotificationsAPI_Gen {
constructor(_apiBase) {
this._apiBase = _apiBase;
this._apiEndpoint = enums.VyApiEndpoint.Notifications;
}
/**
* This endpoint is used to create a webhook, to receive updates of your user's payments (_successful/cancelled_).
* @param {VyNotificationWebhookRequest} reqParams - Request data for the operation
* @returns {string}
*/
createWebhook(reqParams) {
var reqData = core_1.VyRequestData.post("/webhooks", this._apiEndpoint)
.setEnveloped(false)
.setAuth_OAuth2(true)
.addJsonContent(reqParams, notifications.VyNotificationWebhookRequest);
return this._apiBase.makeRequest(reqData, String);
}
/**
* This endpoint is used to get all of your webhooks.
* @returns {VyWebhookDto[]}
*/
findAll() {
var reqData = core_1.VyRequestData.get("/webhooks", this._apiEndpoint)
.setEnveloped(false)
.setAuth_OAuth2(true);
return this._apiBase.makeRequest(reqData, shared.VyWebhookDto);
}
/**
*
* @param {string} webhookId - This is the ```ID``` of the webhook you want to update.
* @param {VyNotificationWebhookRequest} reqParams - Request data for the operation
* @returns {VyWebhookDto}
*/
update(webhookId, reqParams) {
var reqData = core_1.VyRequestData.put(`/webhooks/${webhookId}`, this._apiEndpoint)
.setEnveloped(false)
.setAuth_OAuth2(true)
.addJsonContent(reqParams, notifications.VyNotificationWebhookRequest);
return this._apiBase.makeRequest(reqData, shared.VyWebhookDto);
}
/**
*
* @param {string} webhookId - This is the ```ID``` of the webhook you want to delete.
*/
delete(webhookId) {
var reqData = core_1.VyRequestData.delete(`/webhooks/${webhookId}`, this._apiEndpoint)
.setEnveloped(false)
.setAuth_OAuth2(true);
return this._apiBase.makeRequest(reqData, json_1.Any);
}
}
exports.VyNotificationsAPI_Gen = VyNotificationsAPI_Gen;
//# sourceMappingURL=VyNotificationsAPI.generated.js.map