UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

89 lines (88 loc) 3.58 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var BaseAPI_1 = require("../../../common/BaseAPI"); var Mapper_1 = require("../../../common/Mapper"); var AgentSessionHistoryResponse_1 = require("../../../models/AgentSessionHistoryResponse"); var AgentSessionListResponse_1 = require("../../../models/AgentSessionListResponse"); var AgentSessionResponse_1 = require("../../../models/AgentSessionResponse"); /** * SessionsApi - object-oriented interface * @export * @class SessionsApi * @extends {BaseAPI} */ var SessionsApi = /** @class */ (function (_super) { __extends(SessionsApi, _super); function SessionsApi(configuration) { return _super.call(this, configuration) || this; } /** * @summary Create Agent Session * @param {string} xUserId User ID used to scope agent sessions * @throws {BitmovinError} * @memberof SessionsApi */ SessionsApi.prototype.create = function () { return this.restClient.post('/agents/aisa/sessions', {}).then(function (response) { return (0, Mapper_1.map)(response, AgentSessionResponse_1.default); }); }; /** * @summary Delete Agent Session * @param {string} sessionId Id of the session * @param {string} xUserId User ID used to scope agent sessions * @throws {BitmovinError} * @memberof SessionsApi */ SessionsApi.prototype.delete = function (sessionId) { var pathParamMap = { session_id: sessionId }; return this.restClient.delete('/agents/aisa/sessions/{session_id}', pathParamMap).then(function (response) { return (0, Mapper_1.map)(response, AgentSessionResponse_1.default); }); }; /** * @summary Get Agent Session Details * @param {string} sessionId Id of the session * @param {string} xUserId User ID used to scope agent sessions * @throws {BitmovinError} * @memberof SessionsApi */ SessionsApi.prototype.get = function (sessionId) { var pathParamMap = { session_id: sessionId }; return this.restClient.get('/agents/aisa/sessions/{session_id}', pathParamMap).then(function (response) { return (0, Mapper_1.map)(response, AgentSessionHistoryResponse_1.default); }); }; /** * @summary List Agent Sessions * @param {string} xUserId User ID used to scope agent sessions * @throws {BitmovinError} * @memberof SessionsApi */ SessionsApi.prototype.list = function () { return this.restClient.get('/agents/aisa/sessions', {}).then(function (response) { return (0, Mapper_1.map)(response, AgentSessionListResponse_1.default); }); }; return SessionsApi; }(BaseAPI_1.BaseAPI)); exports.default = SessionsApi;