UNPKG

@eulerstream/euler-api-sdk

Version:

Node.js module for interacting with the Euler Stream signature service.

918 lines 142 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * The Sign Server™ * Sign Server API Documentation * * The version of the OpenAPI document: dev * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.WebcastApi = exports.WebcastApiFactory = exports.WebcastApiFp = exports.WebcastApiAxiosParamCreator = exports.UpdateKeyUpdateByEnum = exports.GetKeyRetrieveByEnum = exports.DeleteKeyDeleteByEnum = exports.AuthenticationApi = exports.AuthenticationApiFactory = exports.AuthenticationApiFp = exports.AuthenticationApiAxiosParamCreator = exports.AnalyticsApi = exports.AnalyticsApiFactory = exports.AnalyticsApiFp = exports.AnalyticsApiAxiosParamCreator = exports.AlertsApi = exports.AlertsApiFactory = exports.AlertsApiFp = exports.AlertsApiAxiosParamCreator = exports.AlertTargetsApi = exports.AlertTargetsApiFactory = exports.AlertTargetsApiFp = exports.AlertTargetsApiAxiosParamCreator = exports.RetrieveAggregateUsagePeriodEnum = exports.AccountsApi = exports.AccountsApiFactory = exports.AccountsApiFp = exports.AccountsApiAxiosParamCreator = exports.StreamType = exports.PeerRole = exports.PeerPresenceTypeEnum = exports.LogRequestMethod = exports.LiveClient = exports.ISignTikTokUrlBodyTypeEnum = exports.ISignTikTokUrlBodyMethodEnum = exports.IAlertTargetStatus = exports.IAlertTargetFormat = exports.ApiRoutes = void 0; const axios_1 = __importDefault(require("axios")); // Some imports not used depending on template conditions // @ts-ignore const common_1 = require("./common"); // @ts-ignore const base_1 = require("./base"); /** * * @export * @enum {string} */ exports.ApiRoutes = { ApiLive: 'api-live', InfoByUser: 'info-by-user' }; /** * * @export * @enum {number} */ exports.IAlertTargetFormat = { NUMBER_0: 0, NUMBER_1: 1 }; /** * * @export * @enum {number} */ exports.IAlertTargetStatus = { NUMBER_0: 0, NUMBER_1: 1, NUMBER_4: 4 }; exports.ISignTikTokUrlBodyMethodEnum = { Get: 'GET', Post: 'POST', Options: 'OPTIONS', Put: 'PUT', Delete: 'DELETE', Patch: 'PATCH', Head: 'HEAD' }; exports.ISignTikTokUrlBodyTypeEnum = { Fetch: 'fetch', Xhr: 'xhr' }; /** * * @export * @enum {string} */ exports.LiveClient = { TtliveJava: 'ttlive-java', TtliveNode: 'ttlive-node', TtlivePython: 'ttlive-python', TtliveNet: 'ttlive-net', TtliveRust: 'ttlive-rust', GotiktokLive: 'gotiktok_live', TtliveCloudflare: 'ttlive-cloudflare', TtliveOther: 'ttlive-other' }; /** * * @export * @enum {number} */ exports.LogRequestMethod = { NUMBER_0: 0, NUMBER_1: 1 }; exports.PeerPresenceTypeEnum = { Api: 'api', Agent: 'agent' }; /** * * @export * @enum {string} */ exports.PeerRole = { Public: 'public', Enterprise: 'enterprise', Staging: 'staging' }; /** * * @export * @enum {string} */ exports.StreamType = { HlsLd: 'hls_ld', HlsSd: 'hls_sd', FlvLd: 'flv_ld', FlvSd: 'flv_sd' }; /** * AccountsApi - axios parameter creator * @export */ const AccountsApiAxiosParamCreator = function (configuration) { return { /** * Retrieve the usage logs for a specific account * @param {number} accountId Account ID to retrieve usage logs for * @param {string} from Start date for the logs * @param {string} to End date for the logs * @param {number} [apiKeyId] Optional API key ID to filter logs by * @param {*} [options] Override http request option. * @throws {RequiredError} */ countSignUsage: async (accountId, from, to, apiKeyId, options = {}) => { // verify required parameter 'accountId' is not null or undefined (0, common_1.assertParamExists)('countSignUsage', 'accountId', accountId); // verify required parameter 'from' is not null or undefined (0, common_1.assertParamExists)('countSignUsage', 'from', from); // verify required parameter 'to' is not null or undefined (0, common_1.assertParamExists)('countSignUsage', 'to', to); const localVarPath = `/accounts/{account_id}/usage/sign_usage/page_count` .replace(`{${"account_id"}}`, encodeURIComponent(String(accountId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication api_key_query required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, "apiKey", configuration); // authentication api_key_header required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (from !== undefined) { localVarQueryParameter['from'] = (from instanceof Date) ? from.toISOString() : from; } if (to !== undefined) { localVarQueryParameter['to'] = (to instanceof Date) ? to.toISOString() : to; } if (apiKeyId !== undefined) { localVarQueryParameter['api_key_id'] = apiKeyId; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieve the usage logs for a specific account * @param {number} accountId Account ID to retrieve usage logs for * @param {string} from Start date for the logs * @param {string} to End date for the logs * @param {number} [apiKeyId] Optional API key ID to filter logs by * @param {number} [page] Page number to retrieve * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSignUsage: async (accountId, from, to, apiKeyId, page, options = {}) => { // verify required parameter 'accountId' is not null or undefined (0, common_1.assertParamExists)('getSignUsage', 'accountId', accountId); // verify required parameter 'from' is not null or undefined (0, common_1.assertParamExists)('getSignUsage', 'from', from); // verify required parameter 'to' is not null or undefined (0, common_1.assertParamExists)('getSignUsage', 'to', to); const localVarPath = `/accounts/{account_id}/usage/sign_usage` .replace(`{${"account_id"}}`, encodeURIComponent(String(accountId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication api_key_query required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, "apiKey", configuration); // authentication api_key_header required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (from !== undefined) { localVarQueryParameter['from'] = (from instanceof Date) ? from.toISOString() : from; } if (to !== undefined) { localVarQueryParameter['to'] = (to instanceof Date) ? to.toISOString() : to; } if (apiKeyId !== undefined) { localVarQueryParameter['api_key_id'] = apiKeyId; } if (page !== undefined) { localVarQueryParameter['page'] = page; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieve the usage logs for a specific account * @param {number} accountId Account ID to retrieve usage logs for * @param {RetrieveAggregateUsagePeriodEnum} period The period for aggregate statistics to check * @param {number} value The value for the period (either hours or numbers) * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveAggregateUsage: async (accountId, period, value, options = {}) => { // verify required parameter 'accountId' is not null or undefined (0, common_1.assertParamExists)('retrieveAggregateUsage', 'accountId', accountId); // verify required parameter 'period' is not null or undefined (0, common_1.assertParamExists)('retrieveAggregateUsage', 'period', period); // verify required parameter 'value' is not null or undefined (0, common_1.assertParamExists)('retrieveAggregateUsage', 'value', value); const localVarPath = `/accounts/{account_id}/usage/sign_usage/aggregate` .replace(`{${"account_id"}}`, encodeURIComponent(String(accountId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication api_key_query required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, "apiKey", configuration); // authentication api_key_header required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (period !== undefined) { localVarQueryParameter['period'] = period; } if (value !== undefined) { localVarQueryParameter['value'] = value; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.AccountsApiAxiosParamCreator = AccountsApiAxiosParamCreator; /** * AccountsApi - functional programming interface * @export */ const AccountsApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.AccountsApiAxiosParamCreator)(configuration); return { /** * Retrieve the usage logs for a specific account * @param {number} accountId Account ID to retrieve usage logs for * @param {string} from Start date for the logs * @param {string} to End date for the logs * @param {number} [apiKeyId] Optional API key ID to filter logs by * @param {*} [options] Override http request option. * @throws {RequiredError} */ async countSignUsage(accountId, from, to, apiKeyId, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.countSignUsage(accountId, from, to, apiKeyId, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = base_1.operationServerMap['AccountsApi.countSignUsage']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Retrieve the usage logs for a specific account * @param {number} accountId Account ID to retrieve usage logs for * @param {string} from Start date for the logs * @param {string} to End date for the logs * @param {number} [apiKeyId] Optional API key ID to filter logs by * @param {number} [page] Page number to retrieve * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getSignUsage(accountId, from, to, apiKeyId, page, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getSignUsage(accountId, from, to, apiKeyId, page, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = base_1.operationServerMap['AccountsApi.getSignUsage']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Retrieve the usage logs for a specific account * @param {number} accountId Account ID to retrieve usage logs for * @param {RetrieveAggregateUsagePeriodEnum} period The period for aggregate statistics to check * @param {number} value The value for the period (either hours or numbers) * @param {*} [options] Override http request option. * @throws {RequiredError} */ async retrieveAggregateUsage(accountId, period, value, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveAggregateUsage(accountId, period, value, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = base_1.operationServerMap['AccountsApi.retrieveAggregateUsage']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, }; }; exports.AccountsApiFp = AccountsApiFp; /** * AccountsApi - factory interface * @export */ const AccountsApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.AccountsApiFp)(configuration); return { /** * Retrieve the usage logs for a specific account * @param {number} accountId Account ID to retrieve usage logs for * @param {string} from Start date for the logs * @param {string} to End date for the logs * @param {number} [apiKeyId] Optional API key ID to filter logs by * @param {*} [options] Override http request option. * @throws {RequiredError} */ countSignUsage(accountId, from, to, apiKeyId, options) { return localVarFp.countSignUsage(accountId, from, to, apiKeyId, options).then((request) => request(axios, basePath)); }, /** * Retrieve the usage logs for a specific account * @param {number} accountId Account ID to retrieve usage logs for * @param {string} from Start date for the logs * @param {string} to End date for the logs * @param {number} [apiKeyId] Optional API key ID to filter logs by * @param {number} [page] Page number to retrieve * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSignUsage(accountId, from, to, apiKeyId, page, options) { return localVarFp.getSignUsage(accountId, from, to, apiKeyId, page, options).then((request) => request(axios, basePath)); }, /** * Retrieve the usage logs for a specific account * @param {number} accountId Account ID to retrieve usage logs for * @param {RetrieveAggregateUsagePeriodEnum} period The period for aggregate statistics to check * @param {number} value The value for the period (either hours or numbers) * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveAggregateUsage(accountId, period, value, options) { return localVarFp.retrieveAggregateUsage(accountId, period, value, options).then((request) => request(axios, basePath)); }, }; }; exports.AccountsApiFactory = AccountsApiFactory; /** * AccountsApi - object-oriented interface * @export * @class AccountsApi * @extends {BaseAPI} */ class AccountsApi extends base_1.BaseAPI { /** * Retrieve the usage logs for a specific account * @param {number} accountId Account ID to retrieve usage logs for * @param {string} from Start date for the logs * @param {string} to End date for the logs * @param {number} [apiKeyId] Optional API key ID to filter logs by * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountsApi */ countSignUsage(accountId, from, to, apiKeyId, options) { return (0, exports.AccountsApiFp)(this.configuration).countSignUsage(accountId, from, to, apiKeyId, options).then((request) => request(this.axios, this.basePath)); } /** * Retrieve the usage logs for a specific account * @param {number} accountId Account ID to retrieve usage logs for * @param {string} from Start date for the logs * @param {string} to End date for the logs * @param {number} [apiKeyId] Optional API key ID to filter logs by * @param {number} [page] Page number to retrieve * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountsApi */ getSignUsage(accountId, from, to, apiKeyId, page, options) { return (0, exports.AccountsApiFp)(this.configuration).getSignUsage(accountId, from, to, apiKeyId, page, options).then((request) => request(this.axios, this.basePath)); } /** * Retrieve the usage logs for a specific account * @param {number} accountId Account ID to retrieve usage logs for * @param {RetrieveAggregateUsagePeriodEnum} period The period for aggregate statistics to check * @param {number} value The value for the period (either hours or numbers) * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountsApi */ retrieveAggregateUsage(accountId, period, value, options) { return (0, exports.AccountsApiFp)(this.configuration).retrieveAggregateUsage(accountId, period, value, options).then((request) => request(this.axios, this.basePath)); } } exports.AccountsApi = AccountsApi; /** * @export */ exports.RetrieveAggregateUsagePeriodEnum = { Hour: 'hour', Day: 'day' }; /** * AlertTargetsApi - axios parameter creator * @export */ const AlertTargetsApiAxiosParamCreator = function (configuration) { return { /** * Create a target for an alert. This is the HTTP endpoint that will be called when an alert is triggered. * @param {number} accountId The ID of the account to create the alert target for * @param {number} alertId The ID of the alert to create the target for * @param {IAlertTargetConfigBase} iAlertTargetConfigBase Configuration for the alert target * @param {*} [options] Override http request option. * @throws {RequiredError} */ createAlertTarget: async (accountId, alertId, iAlertTargetConfigBase, options = {}) => { // verify required parameter 'accountId' is not null or undefined (0, common_1.assertParamExists)('createAlertTarget', 'accountId', accountId); // verify required parameter 'alertId' is not null or undefined (0, common_1.assertParamExists)('createAlertTarget', 'alertId', alertId); // verify required parameter 'iAlertTargetConfigBase' is not null or undefined (0, common_1.assertParamExists)('createAlertTarget', 'iAlertTargetConfigBase', iAlertTargetConfigBase); const localVarPath = `/accounts/{account_id}/alerts/{alert_id}/targets/create` .replace(`{${"account_id"}}`, encodeURIComponent(String(accountId))) .replace(`{${"alert_id"}}`, encodeURIComponent(String(alertId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication api_key_query required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, "apiKey", configuration); // authentication jwt_key_header required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-jwt-key", configuration); // authentication api_key_header required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(iAlertTargetConfigBase, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Delete an alert target from the Sign API * @param {number} accountId The ID of the account to delete the alert target from * @param {number} alertId The ID of the alert to delete the target from * @param {number} targetId The ID of the target to delete * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteAlertTarget: async (accountId, alertId, targetId, options = {}) => { // verify required parameter 'accountId' is not null or undefined (0, common_1.assertParamExists)('deleteAlertTarget', 'accountId', accountId); // verify required parameter 'alertId' is not null or undefined (0, common_1.assertParamExists)('deleteAlertTarget', 'alertId', alertId); // verify required parameter 'targetId' is not null or undefined (0, common_1.assertParamExists)('deleteAlertTarget', 'targetId', targetId); const localVarPath = `/accounts/{account_id}/alerts/{alert_id}/targets/{target_id}/delete` .replace(`{${"account_id"}}`, encodeURIComponent(String(accountId))) .replace(`{${"alert_id"}}`, encodeURIComponent(String(alertId))) .replace(`{${"target_id"}}`, encodeURIComponent(String(targetId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication api_key_query required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, "apiKey", configuration); // authentication jwt_key_header required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-jwt-key", configuration); // authentication api_key_header required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * List all alert targets for a specific alert * @param {number} accountId The account that the alert belongs to * @param {number} alertId The alert to list targets for * @param {*} [options] Override http request option. * @throws {RequiredError} */ listAlertTargets: async (accountId, alertId, options = {}) => { // verify required parameter 'accountId' is not null or undefined (0, common_1.assertParamExists)('listAlertTargets', 'accountId', accountId); // verify required parameter 'alertId' is not null or undefined (0, common_1.assertParamExists)('listAlertTargets', 'alertId', alertId); const localVarPath = `/accounts/{account_id}/alerts/{alert_id}/targets/list` .replace(`{${"account_id"}}`, encodeURIComponent(String(accountId))) .replace(`{${"alert_id"}}`, encodeURIComponent(String(alertId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication api_key_query required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, "apiKey", configuration); // authentication jwt_key_header required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-jwt-key", configuration); // authentication api_key_header required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Test an alert target * @param {number} accountId The account that the alert belongs to * @param {number} alertId The alert that the target belongs to * @param {number} targetId The target to test * @param {*} [options] Override http request option. * @throws {RequiredError} */ testAlertTarget: async (accountId, alertId, targetId, options = {}) => { // verify required parameter 'accountId' is not null or undefined (0, common_1.assertParamExists)('testAlertTarget', 'accountId', accountId); // verify required parameter 'alertId' is not null or undefined (0, common_1.assertParamExists)('testAlertTarget', 'alertId', alertId); // verify required parameter 'targetId' is not null or undefined (0, common_1.assertParamExists)('testAlertTarget', 'targetId', targetId); const localVarPath = `/accounts/{account_id}/alerts/{alert_id}/targets/{target_id}/test` .replace(`{${"account_id"}}`, encodeURIComponent(String(accountId))) .replace(`{${"alert_id"}}`, encodeURIComponent(String(alertId))) .replace(`{${"target_id"}}`, encodeURIComponent(String(targetId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication api_key_query required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, "apiKey", configuration); // authentication jwt_key_header required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-jwt-key", configuration); // authentication api_key_header required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.AlertTargetsApiAxiosParamCreator = AlertTargetsApiAxiosParamCreator; /** * AlertTargetsApi - functional programming interface * @export */ const AlertTargetsApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.AlertTargetsApiAxiosParamCreator)(configuration); return { /** * Create a target for an alert. This is the HTTP endpoint that will be called when an alert is triggered. * @param {number} accountId The ID of the account to create the alert target for * @param {number} alertId The ID of the alert to create the target for * @param {IAlertTargetConfigBase} iAlertTargetConfigBase Configuration for the alert target * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createAlertTarget(accountId, alertId, iAlertTargetConfigBase, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.createAlertTarget(accountId, alertId, iAlertTargetConfigBase, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = base_1.operationServerMap['AlertTargetsApi.createAlertTarget']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Delete an alert target from the Sign API * @param {number} accountId The ID of the account to delete the alert target from * @param {number} alertId The ID of the alert to delete the target from * @param {number} targetId The ID of the target to delete * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteAlertTarget(accountId, alertId, targetId, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAlertTarget(accountId, alertId, targetId, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = base_1.operationServerMap['AlertTargetsApi.deleteAlertTarget']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * List all alert targets for a specific alert * @param {number} accountId The account that the alert belongs to * @param {number} alertId The alert to list targets for * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listAlertTargets(accountId, alertId, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.listAlertTargets(accountId, alertId, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = base_1.operationServerMap['AlertTargetsApi.listAlertTargets']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Test an alert target * @param {number} accountId The account that the alert belongs to * @param {number} alertId The alert that the target belongs to * @param {number} targetId The target to test * @param {*} [options] Override http request option. * @throws {RequiredError} */ async testAlertTarget(accountId, alertId, targetId, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.testAlertTarget(accountId, alertId, targetId, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = base_1.operationServerMap['AlertTargetsApi.testAlertTarget']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, }; }; exports.AlertTargetsApiFp = AlertTargetsApiFp; /** * AlertTargetsApi - factory interface * @export */ const AlertTargetsApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.AlertTargetsApiFp)(configuration); return { /** * Create a target for an alert. This is the HTTP endpoint that will be called when an alert is triggered. * @param {number} accountId The ID of the account to create the alert target for * @param {number} alertId The ID of the alert to create the target for * @param {IAlertTargetConfigBase} iAlertTargetConfigBase Configuration for the alert target * @param {*} [options] Override http request option. * @throws {RequiredError} */ createAlertTarget(accountId, alertId, iAlertTargetConfigBase, options) { return localVarFp.createAlertTarget(accountId, alertId, iAlertTargetConfigBase, options).then((request) => request(axios, basePath)); }, /** * Delete an alert target from the Sign API * @param {number} accountId The ID of the account to delete the alert target from * @param {number} alertId The ID of the alert to delete the target from * @param {number} targetId The ID of the target to delete * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteAlertTarget(accountId, alertId, targetId, options) { return localVarFp.deleteAlertTarget(accountId, alertId, targetId, options).then((request) => request(axios, basePath)); }, /** * List all alert targets for a specific alert * @param {number} accountId The account that the alert belongs to * @param {number} alertId The alert to list targets for * @param {*} [options] Override http request option. * @throws {RequiredError} */ listAlertTargets(accountId, alertId, options) { return localVarFp.listAlertTargets(accountId, alertId, options).then((request) => request(axios, basePath)); }, /** * Test an alert target * @param {number} accountId The account that the alert belongs to * @param {number} alertId The alert that the target belongs to * @param {number} targetId The target to test * @param {*} [options] Override http request option. * @throws {RequiredError} */ testAlertTarget(accountId, alertId, targetId, options) { return localVarFp.testAlertTarget(accountId, alertId, targetId, options).then((request) => request(axios, basePath)); }, }; }; exports.AlertTargetsApiFactory = AlertTargetsApiFactory; /** * AlertTargetsApi - object-oriented interface * @export * @class AlertTargetsApi * @extends {BaseAPI} */ class AlertTargetsApi extends base_1.BaseAPI { /** * Create a target for an alert. This is the HTTP endpoint that will be called when an alert is triggered. * @param {number} accountId The ID of the account to create the alert target for * @param {number} alertId The ID of the alert to create the target for * @param {IAlertTargetConfigBase} iAlertTargetConfigBase Configuration for the alert target * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AlertTargetsApi */ createAlertTarget(accountId, alertId, iAlertTargetConfigBase, options) { return (0, exports.AlertTargetsApiFp)(this.configuration).createAlertTarget(accountId, alertId, iAlertTargetConfigBase, options).then((request) => request(this.axios, this.basePath)); } /** * Delete an alert target from the Sign API * @param {number} accountId The ID of the account to delete the alert target from * @param {number} alertId The ID of the alert to delete the target from * @param {number} targetId The ID of the target to delete * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AlertTargetsApi */ deleteAlertTarget(accountId, alertId, targetId, options) { return (0, exports.AlertTargetsApiFp)(this.configuration).deleteAlertTarget(accountId, alertId, targetId, options).then((request) => request(this.axios, this.basePath)); } /** * List all alert targets for a specific alert * @param {number} accountId The account that the alert belongs to * @param {number} alertId The alert to list targets for * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AlertTargetsApi */ listAlertTargets(accountId, alertId, options) { return (0, exports.AlertTargetsApiFp)(this.configuration).listAlertTargets(accountId, alertId, options).then((request) => request(this.axios, this.basePath)); } /** * Test an alert target * @param {number} accountId The account that the alert belongs to * @param {number} alertId The alert that the target belongs to * @param {number} targetId The target to test * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AlertTargetsApi */ testAlertTarget(accountId, alertId, targetId, options) { return (0, exports.AlertTargetsApiFp)(this.configuration).testAlertTarget(accountId, alertId, targetId, options).then((request) => request(this.axios, this.basePath)); } } exports.AlertTargetsApi = AlertTargetsApi; /** * AlertsApi - axios parameter creator * @export */ const AlertsApiAxiosParamCreator = function (configuration) { return { /** * Create a creator alert. These alerts are used to notify users of a new livestream. * @param {number} accountId The ID of the account to create the alert for * @param {IAlertConfigBase} iAlertConfigBase Configuration for the alert * @param {*} [options] Override http request option. * @throws {RequiredError} */ createAlert: async (accountId, iAlertConfigBase, options = {}) => { // verify required parameter 'accountId' is not null or undefined (0, common_1.assertParamExists)('createAlert', 'accountId', accountId); // verify required parameter 'iAlertConfigBase' is not null or undefined (0, common_1.assertParamExists)('createAlert', 'iAlertConfigBase', iAlertConfigBase); const localVarPath = `/accounts/{account_id}/alerts/create` .replace(`{${"account_id"}}`, encodeURIComponent(String(accountId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication api_key_query required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, "apiKey", configuration); // authentication jwt_key_header required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-jwt-key", configuration); // authentication api_key_header required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(iAlertConfigBase, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Delete an alert from the Sign API * @param {number} accountId The ID of the account to delete the alert from * @param {number} alertId The ID of the alert to delete * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteAlert: async (accountId, alertId, options = {}) => { // verify required parameter 'accountId' is not null or undefined (0, common_1.assertParamExists)('deleteAlert', 'accountId', accountId); // verify required parameter 'alertId' is not null or undefined (0, common_1.assertParamExists)('deleteAlert', 'alertId', alertId); const localVarPath = `/accounts/{account_id}/alerts/{alert_id}/delete` .replace(`{${"account_id"}}`, encodeURIComponent(String(accountId))) .replace(`{${"alert_id"}}`, encodeURIComponent(String(alertId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication api_key_query required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, "apiKey", configuration); // authentication jwt_key_header required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-jwt-key", configuration); // authentication api_key_header required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @param {number} accountId * @param {boolean} [includeRoomInfo] * @param {*} [options] Override http request option. * @throws {RequiredError} */ listAlerts: async (accountId, includeRoomInfo, options = {}) => { // verify required parameter 'accountId' is not null or undefined (0, common_1.assertParamExists)('listAlerts', 'accountId', accountId); const localVarPath = `/accounts/{account_id}/alerts/list` .replace(`{${"account_id"}}`, encodeURIComponent(String(accountId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication api_key_query required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, "apiKey", configuration); // authentication jwt_key_header required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-jwt-key", configuration); // authentication api_key_header required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (includeRoomInfo !== undefined) { localVarQueryParameter['include_room_info'] = includeRoomInfo; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieve a specific alert by its ID * @param {number} accountId The account that the alert belongs to * @param {number} alertId The ID of the alert to retrieve * @param {boolean} [includeRoomInfo] Whether to include room information in the response * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveAlert: async (accountId, alertId, includeRoomInfo, options = {}) => { // verify required parameter 'accountId' is not null or undefined (0, common_1.assertParamExists)('retrieveAlert', 'accountId', accountId); // verify required parameter 'alertId' is not null or undefined (0, common_1.assertParamExists)('retrieveAlert', 'alertId', alertId); const localVarPath = `/accounts/{account_id}/alerts/{alert_id}/retrieve` .replace(`{${"account_id"}}`, encodeURIComponent(String(accountId))) .replace(`{${"alert_id"}}`, encodeURIComponent(String(alertId))); //