sinch-rtc
Version:
RTC JavaScript/Web SDK
72 lines • 3.42 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Ocra (REST API for Sinch RTC clients)
* REST API for Sinch RTC clients.
*
* The version of the OpenAPI document: 0.11.0
* Contact: rtc@sinch.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfigApi = void 0;
const runtime = require("../runtime");
const models_1 = require("../models");
/**
*
*/
class ConfigApi extends runtime.BaseAPI {
/**
* Get client configuration (supporting Instance-specific configuration)
*/
getConfigRaw(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters.userId === null || requestParameters.userId === undefined) {
throw new runtime.RequiredError('userId', 'Required parameter requestParameters.userId was null or undefined when calling getConfig.');
}
if (requestParameters.instanceId === null || requestParameters.instanceId === undefined) {
throw new runtime.RequiredError('instanceId', 'Required parameter requestParameters.instanceId was null or undefined when calling getConfig.');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = typeof token === 'function' ? token("instanceAuth", []) : token;
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = yield this.request({
path: `/v1/users/{userId}/instances/{instanceId}/config`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))).replace(`{${"instanceId"}}`, encodeURIComponent(String(requestParameters.instanceId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
});
return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.ConfigFromJSON)(jsonValue));
});
}
/**
* Get client configuration (supporting Instance-specific configuration)
*/
getConfig(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.getConfigRaw(requestParameters);
return yield response.value();
});
}
}
exports.ConfigApi = ConfigApi;
//# sourceMappingURL=ConfigApi.js.map