jellyfin-discord-bot/server/jellyfin/apis/MoviesApi.ts

92 lines
2.8 KiB
TypeScript
Raw Permalink Normal View History

2023-05-04 23:34:53 +02:00
/* tslint:disable */
/* eslint-disable */
/**
* Jellyfin API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 10.8.9
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
ItemFields,
RecommendationDto,
} from '../models';
import {
ItemFieldsFromJSON,
ItemFieldsToJSON,
RecommendationDtoFromJSON,
RecommendationDtoToJSON,
} from '../models';
export interface GetMovieRecommendationsRequest {
userId?: string;
parentId?: string;
fields?: Array<ItemFields>;
categoryLimit?: number;
itemLimit?: number;
}
/**
*
*/
export class MoviesApi extends runtime.BaseAPI {
/**
* Gets movie recommendations.
*/
async getMovieRecommendationsRaw(requestParameters: GetMovieRecommendationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<RecommendationDto>>> {
const queryParameters: any = {};
if (requestParameters.userId !== undefined) {
queryParameters['userId'] = requestParameters.userId;
}
if (requestParameters.parentId !== undefined) {
queryParameters['parentId'] = requestParameters.parentId;
}
if (requestParameters.fields) {
queryParameters['fields'] = requestParameters.fields;
}
if (requestParameters.categoryLimit !== undefined) {
queryParameters['categoryLimit'] = requestParameters.categoryLimit;
}
if (requestParameters.itemLimit !== undefined) {
queryParameters['itemLimit'] = requestParameters.itemLimit;
}
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
}
const response = await this.request({
path: `/Movies/Recommendations`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(RecommendationDtoFromJSON));
}
/**
* Gets movie recommendations.
*/
async getMovieRecommendations(requestParameters: GetMovieRecommendationsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<RecommendationDto>> {
const response = await this.getMovieRecommendationsRaw(requestParameters, initOverrides);
return await response.value();
}
}