jellyfin-discord-bot/server/jellyfin/models/BaseItemDtoUserData.ts

146 lines
4.6 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 { exists, mapValues } from '../runtime';
/**
* Gets or sets the user data for this item based on the user it's being requested for.
* @export
* @interface BaseItemDtoUserData
*/
export interface BaseItemDtoUserData {
/**
* Gets or sets the rating.
* @type {number}
* @memberof BaseItemDtoUserData
*/
rating?: number | null;
/**
* Gets or sets the played percentage.
* @type {number}
* @memberof BaseItemDtoUserData
*/
playedPercentage?: number | null;
/**
* Gets or sets the unplayed item count.
* @type {number}
* @memberof BaseItemDtoUserData
*/
unplayedItemCount?: number | null;
/**
* Gets or sets the playback position ticks.
* @type {number}
* @memberof BaseItemDtoUserData
*/
playbackPositionTicks?: number;
/**
* Gets or sets the play count.
* @type {number}
* @memberof BaseItemDtoUserData
*/
playCount?: number;
/**
* Gets or sets a value indicating whether this instance is favorite.
* @type {boolean}
* @memberof BaseItemDtoUserData
*/
isFavorite?: boolean;
/**
* Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is likes.
* @type {boolean}
* @memberof BaseItemDtoUserData
*/
likes?: boolean | null;
/**
* Gets or sets the last played date.
* @type {Date}
* @memberof BaseItemDtoUserData
*/
lastPlayedDate?: Date | null;
/**
* Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played.
* @type {boolean}
* @memberof BaseItemDtoUserData
*/
played?: boolean;
/**
* Gets or sets the key.
* @type {string}
* @memberof BaseItemDtoUserData
*/
key?: string | null;
/**
* Gets or sets the item identifier.
* @type {string}
* @memberof BaseItemDtoUserData
*/
itemId?: string | null;
}
/**
* Check if a given object implements the BaseItemDtoUserData interface.
*/
export function instanceOfBaseItemDtoUserData(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function BaseItemDtoUserDataFromJSON(json: any): BaseItemDtoUserData {
return BaseItemDtoUserDataFromJSONTyped(json, false);
}
export function BaseItemDtoUserDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): BaseItemDtoUserData {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'rating': !exists(json, 'Rating') ? undefined : json['Rating'],
'playedPercentage': !exists(json, 'PlayedPercentage') ? undefined : json['PlayedPercentage'],
'unplayedItemCount': !exists(json, 'UnplayedItemCount') ? undefined : json['UnplayedItemCount'],
'playbackPositionTicks': !exists(json, 'PlaybackPositionTicks') ? undefined : json['PlaybackPositionTicks'],
'playCount': !exists(json, 'PlayCount') ? undefined : json['PlayCount'],
'isFavorite': !exists(json, 'IsFavorite') ? undefined : json['IsFavorite'],
'likes': !exists(json, 'Likes') ? undefined : json['Likes'],
'lastPlayedDate': !exists(json, 'LastPlayedDate') ? undefined : (json['LastPlayedDate'] === null ? null : new Date(json['LastPlayedDate'])),
'played': !exists(json, 'Played') ? undefined : json['Played'],
'key': !exists(json, 'Key') ? undefined : json['Key'],
'itemId': !exists(json, 'ItemId') ? undefined : json['ItemId'],
};
}
export function BaseItemDtoUserDataToJSON(value?: BaseItemDtoUserData | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'Rating': value.rating,
'PlayedPercentage': value.playedPercentage,
'UnplayedItemCount': value.unplayedItemCount,
'PlaybackPositionTicks': value.playbackPositionTicks,
'PlayCount': value.playCount,
'IsFavorite': value.isFavorite,
'Likes': value.likes,
'LastPlayedDate': value.lastPlayedDate === undefined ? undefined : (value.lastPlayedDate === null ? null : value.lastPlayedDate.toISOString()),
'Played': value.played,
'Key': value.key,
'ItemId': value.itemId,
};
}