212 lines
7.0 KiB
TypeScript
212 lines
7.0 KiB
TypeScript
|
/* 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 {
|
||
|
BaseItemDto,
|
||
|
BaseItemDtoQueryResult,
|
||
|
BaseItemKind,
|
||
|
ImageType,
|
||
|
ItemFields,
|
||
|
SortOrder,
|
||
|
} from '../models';
|
||
|
import {
|
||
|
BaseItemDtoFromJSON,
|
||
|
BaseItemDtoToJSON,
|
||
|
BaseItemDtoQueryResultFromJSON,
|
||
|
BaseItemDtoQueryResultToJSON,
|
||
|
BaseItemKindFromJSON,
|
||
|
BaseItemKindToJSON,
|
||
|
ImageTypeFromJSON,
|
||
|
ImageTypeToJSON,
|
||
|
ItemFieldsFromJSON,
|
||
|
ItemFieldsToJSON,
|
||
|
SortOrderFromJSON,
|
||
|
SortOrderToJSON,
|
||
|
} from '../models';
|
||
|
|
||
|
export interface GetGenreRequest {
|
||
|
genreName: string;
|
||
|
userId?: string;
|
||
|
}
|
||
|
|
||
|
export interface GetGenresRequest {
|
||
|
startIndex?: number;
|
||
|
limit?: number;
|
||
|
searchTerm?: string;
|
||
|
parentId?: string;
|
||
|
fields?: Array<ItemFields>;
|
||
|
excludeItemTypes?: Array<BaseItemKind>;
|
||
|
includeItemTypes?: Array<BaseItemKind>;
|
||
|
isFavorite?: boolean;
|
||
|
imageTypeLimit?: number;
|
||
|
enableImageTypes?: Array<ImageType>;
|
||
|
userId?: string;
|
||
|
nameStartsWithOrGreater?: string;
|
||
|
nameStartsWith?: string;
|
||
|
nameLessThan?: string;
|
||
|
sortBy?: Array<string>;
|
||
|
sortOrder?: Array<SortOrder>;
|
||
|
enableImages?: boolean;
|
||
|
enableTotalRecordCount?: boolean;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
*/
|
||
|
export class GenresApi extends runtime.BaseAPI {
|
||
|
|
||
|
/**
|
||
|
* Gets a genre, by name.
|
||
|
*/
|
||
|
async getGenreRaw(requestParameters: GetGenreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BaseItemDto>> {
|
||
|
if (requestParameters.genreName === null || requestParameters.genreName === undefined) {
|
||
|
throw new runtime.RequiredError('genreName','Required parameter requestParameters.genreName was null or undefined when calling getGenre.');
|
||
|
}
|
||
|
|
||
|
const queryParameters: any = {};
|
||
|
|
||
|
if (requestParameters.userId !== undefined) {
|
||
|
queryParameters['userId'] = requestParameters.userId;
|
||
|
}
|
||
|
|
||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||
|
|
||
|
if (this.configuration && this.configuration.apiKey) {
|
||
|
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
|
||
|
}
|
||
|
|
||
|
const response = await this.request({
|
||
|
path: `/Genres/{genreName}`.replace(`{${"genreName"}}`, encodeURIComponent(String(requestParameters.genreName))),
|
||
|
method: 'GET',
|
||
|
headers: headerParameters,
|
||
|
query: queryParameters,
|
||
|
}, initOverrides);
|
||
|
|
||
|
return new runtime.JSONApiResponse(response, (jsonValue) => BaseItemDtoFromJSON(jsonValue));
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Gets a genre, by name.
|
||
|
*/
|
||
|
async getGenre(requestParameters: GetGenreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BaseItemDto> {
|
||
|
const response = await this.getGenreRaw(requestParameters, initOverrides);
|
||
|
return await response.value();
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Gets all genres from a given item, folder, or the entire library.
|
||
|
*/
|
||
|
async getGenresRaw(requestParameters: GetGenresRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BaseItemDtoQueryResult>> {
|
||
|
const queryParameters: any = {};
|
||
|
|
||
|
if (requestParameters.startIndex !== undefined) {
|
||
|
queryParameters['startIndex'] = requestParameters.startIndex;
|
||
|
}
|
||
|
|
||
|
if (requestParameters.limit !== undefined) {
|
||
|
queryParameters['limit'] = requestParameters.limit;
|
||
|
}
|
||
|
|
||
|
if (requestParameters.searchTerm !== undefined) {
|
||
|
queryParameters['searchTerm'] = requestParameters.searchTerm;
|
||
|
}
|
||
|
|
||
|
if (requestParameters.parentId !== undefined) {
|
||
|
queryParameters['parentId'] = requestParameters.parentId;
|
||
|
}
|
||
|
|
||
|
if (requestParameters.fields) {
|
||
|
queryParameters['fields'] = requestParameters.fields;
|
||
|
}
|
||
|
|
||
|
if (requestParameters.excludeItemTypes) {
|
||
|
queryParameters['excludeItemTypes'] = requestParameters.excludeItemTypes;
|
||
|
}
|
||
|
|
||
|
if (requestParameters.includeItemTypes) {
|
||
|
queryParameters['includeItemTypes'] = requestParameters.includeItemTypes;
|
||
|
}
|
||
|
|
||
|
if (requestParameters.isFavorite !== undefined) {
|
||
|
queryParameters['isFavorite'] = requestParameters.isFavorite;
|
||
|
}
|
||
|
|
||
|
if (requestParameters.imageTypeLimit !== undefined) {
|
||
|
queryParameters['imageTypeLimit'] = requestParameters.imageTypeLimit;
|
||
|
}
|
||
|
|
||
|
if (requestParameters.enableImageTypes) {
|
||
|
queryParameters['enableImageTypes'] = requestParameters.enableImageTypes;
|
||
|
}
|
||
|
|
||
|
if (requestParameters.userId !== undefined) {
|
||
|
queryParameters['userId'] = requestParameters.userId;
|
||
|
}
|
||
|
|
||
|
if (requestParameters.nameStartsWithOrGreater !== undefined) {
|
||
|
queryParameters['nameStartsWithOrGreater'] = requestParameters.nameStartsWithOrGreater;
|
||
|
}
|
||
|
|
||
|
if (requestParameters.nameStartsWith !== undefined) {
|
||
|
queryParameters['nameStartsWith'] = requestParameters.nameStartsWith;
|
||
|
}
|
||
|
|
||
|
if (requestParameters.nameLessThan !== undefined) {
|
||
|
queryParameters['nameLessThan'] = requestParameters.nameLessThan;
|
||
|
}
|
||
|
|
||
|
if (requestParameters.sortBy) {
|
||
|
queryParameters['sortBy'] = requestParameters.sortBy;
|
||
|
}
|
||
|
|
||
|
if (requestParameters.sortOrder) {
|
||
|
queryParameters['sortOrder'] = requestParameters.sortOrder;
|
||
|
}
|
||
|
|
||
|
if (requestParameters.enableImages !== undefined) {
|
||
|
queryParameters['enableImages'] = requestParameters.enableImages;
|
||
|
}
|
||
|
|
||
|
if (requestParameters.enableTotalRecordCount !== undefined) {
|
||
|
queryParameters['enableTotalRecordCount'] = requestParameters.enableTotalRecordCount;
|
||
|
}
|
||
|
|
||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||
|
|
||
|
if (this.configuration && this.configuration.apiKey) {
|
||
|
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
|
||
|
}
|
||
|
|
||
|
const response = await this.request({
|
||
|
path: `/Genres`,
|
||
|
method: 'GET',
|
||
|
headers: headerParameters,
|
||
|
query: queryParameters,
|
||
|
}, initOverrides);
|
||
|
|
||
|
return new runtime.JSONApiResponse(response, (jsonValue) => BaseItemDtoQueryResultFromJSON(jsonValue));
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Gets all genres from a given item, folder, or the entire library.
|
||
|
*/
|
||
|
async getGenres(requestParameters: GetGenresRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BaseItemDtoQueryResult> {
|
||
|
const response = await this.getGenresRaw(requestParameters, initOverrides);
|
||
|
return await response.value();
|
||
|
}
|
||
|
|
||
|
}
|