@jellyfin/sdk
Version:
A TypeScript SDK for Jellyfin.
778 lines (775 loc) • 45.1 kB
JavaScript
import globalAxios from 'axios';
import { assertParamExists, DUMMY_BASE_URL, setApiKeyToObject, setSearchParams, toPathString, serializeDataIfNeeded, createRequestFunction } from '../common.js';
import { operationServerMap, BaseAPI, BASE_PATH } from '../base.js';
/* tslint:disable */
/* eslint-disable */
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit the class manually.
*
* Jellyfin API
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/**
* PlaystateApi - axios parameter creator
* @export
*/
const PlaystateApiAxiosParamCreator = function (configuration) {
return {
/**
*
* @summary Marks an item as played for user.
* @param {string} itemId Item id.
* @param {string} [userId] User id.
* @param {string} [datePlayed] Optional. The date the item was played.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
markPlayedItem: async (itemId, userId, datePlayed, options = {}) => {
// verify required parameter 'itemId' is not null or undefined
assertParamExists('markPlayedItem', 'itemId', itemId);
const localVarPath = `/UserPlayedItems/{itemId}`
.replace(`{${"itemId"}}`, encodeURIComponent(String(itemId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
if (userId !== undefined) {
localVarQueryParameter['userId'] = userId;
}
if (datePlayed !== undefined) {
localVarQueryParameter['datePlayed'] = (datePlayed instanceof Date) ?
datePlayed.toISOString() :
datePlayed;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Marks an item as unplayed for user.
* @param {string} itemId Item id.
* @param {string} [userId] User id.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
markUnplayedItem: async (itemId, userId, options = {}) => {
// verify required parameter 'itemId' is not null or undefined
assertParamExists('markUnplayedItem', 'itemId', itemId);
const localVarPath = `/UserPlayedItems/{itemId}`
.replace(`{${"itemId"}}`, encodeURIComponent(String(itemId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
if (userId !== undefined) {
localVarQueryParameter['userId'] = userId;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Reports a session\'s playback progress.
* @param {string} itemId Item id.
* @param {string} [mediaSourceId] The id of the MediaSource.
* @param {number} [positionTicks] Optional. The current position, in ticks. 1 tick = 10000 ms.
* @param {number} [audioStreamIndex] The audio stream index.
* @param {number} [subtitleStreamIndex] The subtitle stream index.
* @param {number} [volumeLevel] Scale of 0-100.
* @param {PlayMethod} [playMethod] The play method.
* @param {string} [liveStreamId] The live stream id.
* @param {string} [playSessionId] The play session id.
* @param {RepeatMode} [repeatMode] The repeat mode.
* @param {boolean} [isPaused] Indicates if the player is paused.
* @param {boolean} [isMuted] Indicates if the player is muted.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
onPlaybackProgress: async (itemId, mediaSourceId, positionTicks, audioStreamIndex, subtitleStreamIndex, volumeLevel, playMethod, liveStreamId, playSessionId, repeatMode, isPaused, isMuted, options = {}) => {
// verify required parameter 'itemId' is not null or undefined
assertParamExists('onPlaybackProgress', 'itemId', itemId);
const localVarPath = `/PlayingItems/{itemId}/Progress`
.replace(`{${"itemId"}}`, encodeURIComponent(String(itemId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
if (mediaSourceId !== undefined) {
localVarQueryParameter['mediaSourceId'] = mediaSourceId;
}
if (positionTicks !== undefined) {
localVarQueryParameter['positionTicks'] = positionTicks;
}
if (audioStreamIndex !== undefined) {
localVarQueryParameter['audioStreamIndex'] = audioStreamIndex;
}
if (subtitleStreamIndex !== undefined) {
localVarQueryParameter['subtitleStreamIndex'] = subtitleStreamIndex;
}
if (volumeLevel !== undefined) {
localVarQueryParameter['volumeLevel'] = volumeLevel;
}
if (playMethod !== undefined) {
localVarQueryParameter['playMethod'] = playMethod;
}
if (liveStreamId !== undefined) {
localVarQueryParameter['liveStreamId'] = liveStreamId;
}
if (playSessionId !== undefined) {
localVarQueryParameter['playSessionId'] = playSessionId;
}
if (repeatMode !== undefined) {
localVarQueryParameter['repeatMode'] = repeatMode;
}
if (isPaused !== undefined) {
localVarQueryParameter['isPaused'] = isPaused;
}
if (isMuted !== undefined) {
localVarQueryParameter['isMuted'] = isMuted;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Reports that a session has begun playing an item.
* @param {string} itemId Item id.
* @param {string} [mediaSourceId] The id of the MediaSource.
* @param {number} [audioStreamIndex] The audio stream index.
* @param {number} [subtitleStreamIndex] The subtitle stream index.
* @param {PlayMethod} [playMethod] The play method.
* @param {string} [liveStreamId] The live stream id.
* @param {string} [playSessionId] The play session id.
* @param {boolean} [canSeek] Indicates if the client can seek.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
onPlaybackStart: async (itemId, mediaSourceId, audioStreamIndex, subtitleStreamIndex, playMethod, liveStreamId, playSessionId, canSeek, options = {}) => {
// verify required parameter 'itemId' is not null or undefined
assertParamExists('onPlaybackStart', 'itemId', itemId);
const localVarPath = `/PlayingItems/{itemId}`
.replace(`{${"itemId"}}`, encodeURIComponent(String(itemId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
if (mediaSourceId !== undefined) {
localVarQueryParameter['mediaSourceId'] = mediaSourceId;
}
if (audioStreamIndex !== undefined) {
localVarQueryParameter['audioStreamIndex'] = audioStreamIndex;
}
if (subtitleStreamIndex !== undefined) {
localVarQueryParameter['subtitleStreamIndex'] = subtitleStreamIndex;
}
if (playMethod !== undefined) {
localVarQueryParameter['playMethod'] = playMethod;
}
if (liveStreamId !== undefined) {
localVarQueryParameter['liveStreamId'] = liveStreamId;
}
if (playSessionId !== undefined) {
localVarQueryParameter['playSessionId'] = playSessionId;
}
if (canSeek !== undefined) {
localVarQueryParameter['canSeek'] = canSeek;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Reports that a session has stopped playing an item.
* @param {string} itemId Item id.
* @param {string} [mediaSourceId] The id of the MediaSource.
* @param {string} [nextMediaType] The next media type that will play.
* @param {number} [positionTicks] Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms.
* @param {string} [liveStreamId] The live stream id.
* @param {string} [playSessionId] The play session id.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
onPlaybackStopped: async (itemId, mediaSourceId, nextMediaType, positionTicks, liveStreamId, playSessionId, options = {}) => {
// verify required parameter 'itemId' is not null or undefined
assertParamExists('onPlaybackStopped', 'itemId', itemId);
const localVarPath = `/PlayingItems/{itemId}`
.replace(`{${"itemId"}}`, encodeURIComponent(String(itemId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
if (mediaSourceId !== undefined) {
localVarQueryParameter['mediaSourceId'] = mediaSourceId;
}
if (nextMediaType !== undefined) {
localVarQueryParameter['nextMediaType'] = nextMediaType;
}
if (positionTicks !== undefined) {
localVarQueryParameter['positionTicks'] = positionTicks;
}
if (liveStreamId !== undefined) {
localVarQueryParameter['liveStreamId'] = liveStreamId;
}
if (playSessionId !== undefined) {
localVarQueryParameter['playSessionId'] = playSessionId;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Pings a playback session.
* @param {string} playSessionId Playback session id.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
pingPlaybackSession: async (playSessionId, options = {}) => {
// verify required parameter 'playSessionId' is not null or undefined
assertParamExists('pingPlaybackSession', 'playSessionId', playSessionId);
const localVarPath = `/Sessions/Playing/Ping`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
if (playSessionId !== undefined) {
localVarQueryParameter['playSessionId'] = playSessionId;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Reports playback progress within a session.
* @param {PlaybackProgressInfo} [playbackProgressInfo] The playback progress info.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
reportPlaybackProgress: async (playbackProgressInfo, options = {}) => {
const localVarPath = `/Sessions/Playing/Progress`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = serializeDataIfNeeded(playbackProgressInfo, localVarRequestOptions, configuration);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Reports playback has started within a session.
* @param {PlaybackStartInfo} [playbackStartInfo] The playback start info.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
reportPlaybackStart: async (playbackStartInfo, options = {}) => {
const localVarPath = `/Sessions/Playing`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = serializeDataIfNeeded(playbackStartInfo, localVarRequestOptions, configuration);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Reports playback has stopped within a session.
* @param {PlaybackStopInfo} [playbackStopInfo] The playback stop info.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
reportPlaybackStopped: async (playbackStopInfo, options = {}) => {
const localVarPath = `/Sessions/Playing/Stopped`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = serializeDataIfNeeded(playbackStopInfo, localVarRequestOptions, configuration);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
/**
* PlaystateApi - functional programming interface
* @export
*/
const PlaystateApiFp = function (configuration) {
const localVarAxiosParamCreator = PlaystateApiAxiosParamCreator(configuration);
return {
/**
*
* @summary Marks an item as played for user.
* @param {string} itemId Item id.
* @param {string} [userId] User id.
* @param {string} [datePlayed] Optional. The date the item was played.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async markPlayedItem(itemId, userId, datePlayed, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.markPlayedItem(itemId, userId, datePlayed, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaystateApi.markPlayedItem']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Marks an item as unplayed for user.
* @param {string} itemId Item id.
* @param {string} [userId] User id.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async markUnplayedItem(itemId, userId, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.markUnplayedItem(itemId, userId, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaystateApi.markUnplayedItem']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Reports a session\'s playback progress.
* @param {string} itemId Item id.
* @param {string} [mediaSourceId] The id of the MediaSource.
* @param {number} [positionTicks] Optional. The current position, in ticks. 1 tick = 10000 ms.
* @param {number} [audioStreamIndex] The audio stream index.
* @param {number} [subtitleStreamIndex] The subtitle stream index.
* @param {number} [volumeLevel] Scale of 0-100.
* @param {PlayMethod} [playMethod] The play method.
* @param {string} [liveStreamId] The live stream id.
* @param {string} [playSessionId] The play session id.
* @param {RepeatMode} [repeatMode] The repeat mode.
* @param {boolean} [isPaused] Indicates if the player is paused.
* @param {boolean} [isMuted] Indicates if the player is muted.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async onPlaybackProgress(itemId, mediaSourceId, positionTicks, audioStreamIndex, subtitleStreamIndex, volumeLevel, playMethod, liveStreamId, playSessionId, repeatMode, isPaused, isMuted, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.onPlaybackProgress(itemId, mediaSourceId, positionTicks, audioStreamIndex, subtitleStreamIndex, volumeLevel, playMethod, liveStreamId, playSessionId, repeatMode, isPaused, isMuted, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaystateApi.onPlaybackProgress']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Reports that a session has begun playing an item.
* @param {string} itemId Item id.
* @param {string} [mediaSourceId] The id of the MediaSource.
* @param {number} [audioStreamIndex] The audio stream index.
* @param {number} [subtitleStreamIndex] The subtitle stream index.
* @param {PlayMethod} [playMethod] The play method.
* @param {string} [liveStreamId] The live stream id.
* @param {string} [playSessionId] The play session id.
* @param {boolean} [canSeek] Indicates if the client can seek.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async onPlaybackStart(itemId, mediaSourceId, audioStreamIndex, subtitleStreamIndex, playMethod, liveStreamId, playSessionId, canSeek, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.onPlaybackStart(itemId, mediaSourceId, audioStreamIndex, subtitleStreamIndex, playMethod, liveStreamId, playSessionId, canSeek, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaystateApi.onPlaybackStart']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Reports that a session has stopped playing an item.
* @param {string} itemId Item id.
* @param {string} [mediaSourceId] The id of the MediaSource.
* @param {string} [nextMediaType] The next media type that will play.
* @param {number} [positionTicks] Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms.
* @param {string} [liveStreamId] The live stream id.
* @param {string} [playSessionId] The play session id.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async onPlaybackStopped(itemId, mediaSourceId, nextMediaType, positionTicks, liveStreamId, playSessionId, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.onPlaybackStopped(itemId, mediaSourceId, nextMediaType, positionTicks, liveStreamId, playSessionId, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaystateApi.onPlaybackStopped']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Pings a playback session.
* @param {string} playSessionId Playback session id.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async pingPlaybackSession(playSessionId, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.pingPlaybackSession(playSessionId, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaystateApi.pingPlaybackSession']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Reports playback progress within a session.
* @param {PlaybackProgressInfo} [playbackProgressInfo] The playback progress info.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async reportPlaybackProgress(playbackProgressInfo, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.reportPlaybackProgress(playbackProgressInfo, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaystateApi.reportPlaybackProgress']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Reports playback has started within a session.
* @param {PlaybackStartInfo} [playbackStartInfo] The playback start info.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async reportPlaybackStart(playbackStartInfo, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.reportPlaybackStart(playbackStartInfo, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaystateApi.reportPlaybackStart']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Reports playback has stopped within a session.
* @param {PlaybackStopInfo} [playbackStopInfo] The playback stop info.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async reportPlaybackStopped(playbackStopInfo, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.reportPlaybackStopped(playbackStopInfo, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaystateApi.reportPlaybackStopped']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
};
};
/**
* PlaystateApi - factory interface
* @export
*/
const PlaystateApiFactory = function (configuration, basePath, axios) {
const localVarFp = PlaystateApiFp(configuration);
return {
/**
*
* @summary Marks an item as played for user.
* @param {PlaystateApiMarkPlayedItemRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
markPlayedItem(requestParameters, options) {
return localVarFp.markPlayedItem(requestParameters.itemId, requestParameters.userId, requestParameters.datePlayed, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Marks an item as unplayed for user.
* @param {PlaystateApiMarkUnplayedItemRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
markUnplayedItem(requestParameters, options) {
return localVarFp.markUnplayedItem(requestParameters.itemId, requestParameters.userId, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Reports a session\'s playback progress.
* @param {PlaystateApiOnPlaybackProgressRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
onPlaybackProgress(requestParameters, options) {
return localVarFp.onPlaybackProgress(requestParameters.itemId, requestParameters.mediaSourceId, requestParameters.positionTicks, requestParameters.audioStreamIndex, requestParameters.subtitleStreamIndex, requestParameters.volumeLevel, requestParameters.playMethod, requestParameters.liveStreamId, requestParameters.playSessionId, requestParameters.repeatMode, requestParameters.isPaused, requestParameters.isMuted, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Reports that a session has begun playing an item.
* @param {PlaystateApiOnPlaybackStartRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
onPlaybackStart(requestParameters, options) {
return localVarFp.onPlaybackStart(requestParameters.itemId, requestParameters.mediaSourceId, requestParameters.audioStreamIndex, requestParameters.subtitleStreamIndex, requestParameters.playMethod, requestParameters.liveStreamId, requestParameters.playSessionId, requestParameters.canSeek, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Reports that a session has stopped playing an item.
* @param {PlaystateApiOnPlaybackStoppedRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
onPlaybackStopped(requestParameters, options) {
return localVarFp.onPlaybackStopped(requestParameters.itemId, requestParameters.mediaSourceId, requestParameters.nextMediaType, requestParameters.positionTicks, requestParameters.liveStreamId, requestParameters.playSessionId, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Pings a playback session.
* @param {PlaystateApiPingPlaybackSessionRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
pingPlaybackSession(requestParameters, options) {
return localVarFp.pingPlaybackSession(requestParameters.playSessionId, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Reports playback progress within a session.
* @param {PlaystateApiReportPlaybackProgressRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
reportPlaybackProgress(requestParameters = {}, options) {
return localVarFp.reportPlaybackProgress(requestParameters.playbackProgressInfo, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Reports playback has started within a session.
* @param {PlaystateApiReportPlaybackStartRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
reportPlaybackStart(requestParameters = {}, options) {
return localVarFp.reportPlaybackStart(requestParameters.playbackStartInfo, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Reports playback has stopped within a session.
* @param {PlaystateApiReportPlaybackStoppedRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
reportPlaybackStopped(requestParameters = {}, options) {
return localVarFp.reportPlaybackStopped(requestParameters.playbackStopInfo, options).then((request) => request(axios, basePath));
},
};
};
/**
* PlaystateApi - object-oriented interface
* @export
* @class PlaystateApi
* @extends {BaseAPI}
*/
class PlaystateApi extends BaseAPI {
/**
*
* @summary Marks an item as played for user.
* @param {PlaystateApiMarkPlayedItemRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PlaystateApi
*/
markPlayedItem(requestParameters, options) {
return PlaystateApiFp(this.configuration).markPlayedItem(requestParameters.itemId, requestParameters.userId, requestParameters.datePlayed, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Marks an item as unplayed for user.
* @param {PlaystateApiMarkUnplayedItemRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PlaystateApi
*/
markUnplayedItem(requestParameters, options) {
return PlaystateApiFp(this.configuration).markUnplayedItem(requestParameters.itemId, requestParameters.userId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Reports a session\'s playback progress.
* @param {PlaystateApiOnPlaybackProgressRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PlaystateApi
*/
onPlaybackProgress(requestParameters, options) {
return PlaystateApiFp(this.configuration).onPlaybackProgress(requestParameters.itemId, requestParameters.mediaSourceId, requestParameters.positionTicks, requestParameters.audioStreamIndex, requestParameters.subtitleStreamIndex, requestParameters.volumeLevel, requestParameters.playMethod, requestParameters.liveStreamId, requestParameters.playSessionId, requestParameters.repeatMode, requestParameters.isPaused, requestParameters.isMuted, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Reports that a session has begun playing an item.
* @param {PlaystateApiOnPlaybackStartRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PlaystateApi
*/
onPlaybackStart(requestParameters, options) {
return PlaystateApiFp(this.configuration).onPlaybackStart(requestParameters.itemId, requestParameters.mediaSourceId, requestParameters.audioStreamIndex, requestParameters.subtitleStreamIndex, requestParameters.playMethod, requestParameters.liveStreamId, requestParameters.playSessionId, requestParameters.canSeek, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Reports that a session has stopped playing an item.
* @param {PlaystateApiOnPlaybackStoppedRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PlaystateApi
*/
onPlaybackStopped(requestParameters, options) {
return PlaystateApiFp(this.configuration).onPlaybackStopped(requestParameters.itemId, requestParameters.mediaSourceId, requestParameters.nextMediaType, requestParameters.positionTicks, requestParameters.liveStreamId, requestParameters.playSessionId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Pings a playback session.
* @param {PlaystateApiPingPlaybackSessionRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PlaystateApi
*/
pingPlaybackSession(requestParameters, options) {
return PlaystateApiFp(this.configuration).pingPlaybackSession(requestParameters.playSessionId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Reports playback progress within a session.
* @param {PlaystateApiReportPlaybackProgressRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PlaystateApi
*/
reportPlaybackProgress(requestParameters = {}, options) {
return PlaystateApiFp(this.configuration).reportPlaybackProgress(requestParameters.playbackProgressInfo, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Reports playback has started within a session.
* @param {PlaystateApiReportPlaybackStartRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PlaystateApi
*/
reportPlaybackStart(requestParameters = {}, options) {
return PlaystateApiFp(this.configuration).reportPlaybackStart(requestParameters.playbackStartInfo, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Reports playback has stopped within a session.
* @param {PlaystateApiReportPlaybackStoppedRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PlaystateApi
*/
reportPlaybackStopped(requestParameters = {}, options) {
return PlaystateApiFp(this.configuration).reportPlaybackStopped(requestParameters.playbackStopInfo, options).then((request) => request(this.axios, this.basePath));
}
}
export { PlaystateApi, PlaystateApiAxiosParamCreator, PlaystateApiFactory, PlaystateApiFp };