UNPKG

@jellyfin/sdk

Version:
110 lines (107 loc) 4.2 kB
import globalAxios from 'axios'; import { DUMMY_BASE_URL, setSearchParams, toPathString, 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/. */ /** * TimeSyncApi - axios parameter creator * @export */ const TimeSyncApiAxiosParamCreator = function (configuration) { return { /** * * @summary Gets the current UTC time. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getUtcTime: async (options = {}) => { const localVarPath = `/GetUtcTime`; // 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: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * TimeSyncApi - functional programming interface * @export */ const TimeSyncApiFp = function (configuration) { const localVarAxiosParamCreator = TimeSyncApiAxiosParamCreator(configuration); return { /** * * @summary Gets the current UTC time. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getUtcTime(options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.getUtcTime(options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = operationServerMap['TimeSyncApi.getUtcTime']) === 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); }, }; }; /** * TimeSyncApi - factory interface * @export */ const TimeSyncApiFactory = function (configuration, basePath, axios) { const localVarFp = TimeSyncApiFp(configuration); return { /** * * @summary Gets the current UTC time. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getUtcTime(options) { return localVarFp.getUtcTime(options).then((request) => request(axios, basePath)); }, }; }; /** * TimeSyncApi - object-oriented interface * @export * @class TimeSyncApi * @extends {BaseAPI} */ class TimeSyncApi extends BaseAPI { /** * * @summary Gets the current UTC time. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TimeSyncApi */ getUtcTime(options) { return TimeSyncApiFp(this.configuration).getUtcTime(options).then((request) => request(this.axios, this.basePath)); } } export { TimeSyncApi, TimeSyncApiAxiosParamCreator, TimeSyncApiFactory, TimeSyncApiFp };