/* 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'; import type { BaseItemDto } from './BaseItemDto'; import { BaseItemDtoFromJSON, BaseItemDtoFromJSONTyped, BaseItemDtoToJSON, } from './BaseItemDto'; import type { ClientCapabilities } from './ClientCapabilities'; import { ClientCapabilitiesFromJSON, ClientCapabilitiesFromJSONTyped, ClientCapabilitiesToJSON, } from './ClientCapabilities'; import type { GeneralCommandType } from './GeneralCommandType'; import { GeneralCommandTypeFromJSON, GeneralCommandTypeFromJSONTyped, GeneralCommandTypeToJSON, } from './GeneralCommandType'; import type { PlayerStateInfo } from './PlayerStateInfo'; import { PlayerStateInfoFromJSON, PlayerStateInfoFromJSONTyped, PlayerStateInfoToJSON, } from './PlayerStateInfo'; import type { QueueItem } from './QueueItem'; import { QueueItemFromJSON, QueueItemFromJSONTyped, QueueItemToJSON, } from './QueueItem'; import type { SessionInfoFullNowPlayingItem } from './SessionInfoFullNowPlayingItem'; import { SessionInfoFullNowPlayingItemFromJSON, SessionInfoFullNowPlayingItemFromJSONTyped, SessionInfoFullNowPlayingItemToJSON, } from './SessionInfoFullNowPlayingItem'; import type { SessionInfoNowPlayingItem } from './SessionInfoNowPlayingItem'; import { SessionInfoNowPlayingItemFromJSON, SessionInfoNowPlayingItemFromJSONTyped, SessionInfoNowPlayingItemToJSON, } from './SessionInfoNowPlayingItem'; import type { SessionUserInfo } from './SessionUserInfo'; import { SessionUserInfoFromJSON, SessionUserInfoFromJSONTyped, SessionUserInfoToJSON, } from './SessionUserInfo'; import type { TranscodingInfo } from './TranscodingInfo'; import { TranscodingInfoFromJSON, TranscodingInfoFromJSONTyped, TranscodingInfoToJSON, } from './TranscodingInfo'; /** * Class SessionInfo. * @export * @interface SessionInfo */ export interface SessionInfo { /** * * @type {PlayerStateInfo} * @memberof SessionInfo */ playState?: PlayerStateInfo | null; /** * * @type {Array} * @memberof SessionInfo */ additionalUsers?: Array | null; /** * * @type {ClientCapabilities} * @memberof SessionInfo */ capabilities?: ClientCapabilities | null; /** * Gets or sets the remote end point. * @type {string} * @memberof SessionInfo */ remoteEndPoint?: string | null; /** * Gets the playable media types. * @type {Array} * @memberof SessionInfo */ readonly playableMediaTypes?: Array | null; /** * Gets or sets the id. * @type {string} * @memberof SessionInfo */ id?: string | null; /** * Gets or sets the user id. * @type {string} * @memberof SessionInfo */ userId?: string; /** * Gets or sets the username. * @type {string} * @memberof SessionInfo */ userName?: string | null; /** * Gets or sets the type of the client. * @type {string} * @memberof SessionInfo */ client?: string | null; /** * Gets or sets the last activity date. * @type {Date} * @memberof SessionInfo */ lastActivityDate?: Date; /** * Gets or sets the last playback check in. * @type {Date} * @memberof SessionInfo */ lastPlaybackCheckIn?: Date; /** * Gets or sets the name of the device. * @type {string} * @memberof SessionInfo */ deviceName?: string | null; /** * Gets or sets the type of the device. * @type {string} * @memberof SessionInfo */ deviceType?: string | null; /** * * @type {SessionInfoNowPlayingItem} * @memberof SessionInfo */ nowPlayingItem?: SessionInfoNowPlayingItem | null; /** * * @type {SessionInfoFullNowPlayingItem} * @memberof SessionInfo */ fullNowPlayingItem?: SessionInfoFullNowPlayingItem | null; /** * * @type {SessionInfoNowPlayingItem} * @memberof SessionInfo */ nowViewingItem?: SessionInfoNowPlayingItem | null; /** * Gets or sets the device id. * @type {string} * @memberof SessionInfo */ deviceId?: string | null; /** * Gets or sets the application version. * @type {string} * @memberof SessionInfo */ applicationVersion?: string | null; /** * * @type {TranscodingInfo} * @memberof SessionInfo */ transcodingInfo?: TranscodingInfo | null; /** * Gets a value indicating whether this instance is active. * @type {boolean} * @memberof SessionInfo */ readonly isActive?: boolean; /** * * @type {boolean} * @memberof SessionInfo */ readonly supportsMediaControl?: boolean; /** * * @type {boolean} * @memberof SessionInfo */ readonly supportsRemoteControl?: boolean; /** * * @type {Array} * @memberof SessionInfo */ nowPlayingQueue?: Array | null; /** * * @type {Array} * @memberof SessionInfo */ nowPlayingQueueFullItems?: Array | null; /** * * @type {boolean} * @memberof SessionInfo */ hasCustomDeviceName?: boolean; /** * * @type {string} * @memberof SessionInfo */ playlistItemId?: string | null; /** * * @type {string} * @memberof SessionInfo */ serverId?: string | null; /** * * @type {string} * @memberof SessionInfo */ userPrimaryImageTag?: string | null; /** * Gets the supported commands. * @type {Array} * @memberof SessionInfo */ readonly supportedCommands?: Array | null; } /** * Check if a given object implements the SessionInfo interface. */ export function instanceOfSessionInfo(value: object): boolean { let isInstance = true; return isInstance; } export function SessionInfoFromJSON(json: any): SessionInfo { return SessionInfoFromJSONTyped(json, false); } export function SessionInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): SessionInfo { if ((json === undefined) || (json === null)) { return json; } return { 'playState': !exists(json, 'PlayState') ? undefined : PlayerStateInfoFromJSON(json['PlayState']), 'additionalUsers': !exists(json, 'AdditionalUsers') ? undefined : (json['AdditionalUsers'] === null ? null : (json['AdditionalUsers'] as Array).map(SessionUserInfoFromJSON)), 'capabilities': !exists(json, 'Capabilities') ? undefined : ClientCapabilitiesFromJSON(json['Capabilities']), 'remoteEndPoint': !exists(json, 'RemoteEndPoint') ? undefined : json['RemoteEndPoint'], 'playableMediaTypes': !exists(json, 'PlayableMediaTypes') ? undefined : json['PlayableMediaTypes'], 'id': !exists(json, 'Id') ? undefined : json['Id'], 'userId': !exists(json, 'UserId') ? undefined : json['UserId'], 'userName': !exists(json, 'UserName') ? undefined : json['UserName'], 'client': !exists(json, 'Client') ? undefined : json['Client'], 'lastActivityDate': !exists(json, 'LastActivityDate') ? undefined : (new Date(json['LastActivityDate'])), 'lastPlaybackCheckIn': !exists(json, 'LastPlaybackCheckIn') ? undefined : (new Date(json['LastPlaybackCheckIn'])), 'deviceName': !exists(json, 'DeviceName') ? undefined : json['DeviceName'], 'deviceType': !exists(json, 'DeviceType') ? undefined : json['DeviceType'], 'nowPlayingItem': !exists(json, 'NowPlayingItem') ? undefined : SessionInfoNowPlayingItemFromJSON(json['NowPlayingItem']), 'fullNowPlayingItem': !exists(json, 'FullNowPlayingItem') ? undefined : SessionInfoFullNowPlayingItemFromJSON(json['FullNowPlayingItem']), 'nowViewingItem': !exists(json, 'NowViewingItem') ? undefined : SessionInfoNowPlayingItemFromJSON(json['NowViewingItem']), 'deviceId': !exists(json, 'DeviceId') ? undefined : json['DeviceId'], 'applicationVersion': !exists(json, 'ApplicationVersion') ? undefined : json['ApplicationVersion'], 'transcodingInfo': !exists(json, 'TranscodingInfo') ? undefined : TranscodingInfoFromJSON(json['TranscodingInfo']), 'isActive': !exists(json, 'IsActive') ? undefined : json['IsActive'], 'supportsMediaControl': !exists(json, 'SupportsMediaControl') ? undefined : json['SupportsMediaControl'], 'supportsRemoteControl': !exists(json, 'SupportsRemoteControl') ? undefined : json['SupportsRemoteControl'], 'nowPlayingQueue': !exists(json, 'NowPlayingQueue') ? undefined : (json['NowPlayingQueue'] === null ? null : (json['NowPlayingQueue'] as Array).map(QueueItemFromJSON)), 'nowPlayingQueueFullItems': !exists(json, 'NowPlayingQueueFullItems') ? undefined : (json['NowPlayingQueueFullItems'] === null ? null : (json['NowPlayingQueueFullItems'] as Array).map(BaseItemDtoFromJSON)), 'hasCustomDeviceName': !exists(json, 'HasCustomDeviceName') ? undefined : json['HasCustomDeviceName'], 'playlistItemId': !exists(json, 'PlaylistItemId') ? undefined : json['PlaylistItemId'], 'serverId': !exists(json, 'ServerId') ? undefined : json['ServerId'], 'userPrimaryImageTag': !exists(json, 'UserPrimaryImageTag') ? undefined : json['UserPrimaryImageTag'], 'supportedCommands': !exists(json, 'SupportedCommands') ? undefined : (json['SupportedCommands'] === null ? null : (json['SupportedCommands'] as Array).map(GeneralCommandTypeFromJSON)), }; } export function SessionInfoToJSON(value?: SessionInfo | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'PlayState': PlayerStateInfoToJSON(value.playState), 'AdditionalUsers': value.additionalUsers === undefined ? undefined : (value.additionalUsers === null ? null : (value.additionalUsers as Array).map(SessionUserInfoToJSON)), 'Capabilities': ClientCapabilitiesToJSON(value.capabilities), 'RemoteEndPoint': value.remoteEndPoint, 'Id': value.id, 'UserId': value.userId, 'UserName': value.userName, 'Client': value.client, 'LastActivityDate': value.lastActivityDate === undefined ? undefined : (value.lastActivityDate.toISOString()), 'LastPlaybackCheckIn': value.lastPlaybackCheckIn === undefined ? undefined : (value.lastPlaybackCheckIn.toISOString()), 'DeviceName': value.deviceName, 'DeviceType': value.deviceType, 'NowPlayingItem': SessionInfoNowPlayingItemToJSON(value.nowPlayingItem), 'FullNowPlayingItem': SessionInfoFullNowPlayingItemToJSON(value.fullNowPlayingItem), 'NowViewingItem': SessionInfoNowPlayingItemToJSON(value.nowViewingItem), 'DeviceId': value.deviceId, 'ApplicationVersion': value.applicationVersion, 'TranscodingInfo': TranscodingInfoToJSON(value.transcodingInfo), 'NowPlayingQueue': value.nowPlayingQueue === undefined ? undefined : (value.nowPlayingQueue === null ? null : (value.nowPlayingQueue as Array).map(QueueItemToJSON)), 'NowPlayingQueueFullItems': value.nowPlayingQueueFullItems === undefined ? undefined : (value.nowPlayingQueueFullItems === null ? null : (value.nowPlayingQueueFullItems as Array).map(BaseItemDtoToJSON)), 'HasCustomDeviceName': value.hasCustomDeviceName, 'PlaylistItemId': value.playlistItemId, 'ServerId': value.serverId, 'UserPrimaryImageTag': value.userPrimaryImageTag, }; }