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

340 lines
13 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 { 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 AuthenticationResultSessionInfo
*/
export interface AuthenticationResultSessionInfo {
/**
*
* @type {PlayerStateInfo}
* @memberof AuthenticationResultSessionInfo
*/
playState?: PlayerStateInfo | null;
/**
*
* @type {Array<SessionUserInfo>}
* @memberof AuthenticationResultSessionInfo
*/
additionalUsers?: Array<SessionUserInfo> | null;
/**
*
* @type {ClientCapabilities}
* @memberof AuthenticationResultSessionInfo
*/
capabilities?: ClientCapabilities | null;
/**
* Gets or sets the remote end point.
* @type {string}
* @memberof AuthenticationResultSessionInfo
*/
remoteEndPoint?: string | null;
/**
* Gets the playable media types.
* @type {Array<string>}
* @memberof AuthenticationResultSessionInfo
*/
readonly playableMediaTypes?: Array<string> | null;
/**
* Gets or sets the id.
* @type {string}
* @memberof AuthenticationResultSessionInfo
*/
id?: string | null;
/**
* Gets or sets the user id.
* @type {string}
* @memberof AuthenticationResultSessionInfo
*/
userId?: string;
/**
* Gets or sets the username.
* @type {string}
* @memberof AuthenticationResultSessionInfo
*/
userName?: string | null;
/**
* Gets or sets the type of the client.
* @type {string}
* @memberof AuthenticationResultSessionInfo
*/
client?: string | null;
/**
* Gets or sets the last activity date.
* @type {Date}
* @memberof AuthenticationResultSessionInfo
*/
lastActivityDate?: Date;
/**
* Gets or sets the last playback check in.
* @type {Date}
* @memberof AuthenticationResultSessionInfo
*/
lastPlaybackCheckIn?: Date;
/**
* Gets or sets the name of the device.
* @type {string}
* @memberof AuthenticationResultSessionInfo
*/
deviceName?: string | null;
/**
* Gets or sets the type of the device.
* @type {string}
* @memberof AuthenticationResultSessionInfo
*/
deviceType?: string | null;
/**
*
* @type {SessionInfoNowPlayingItem}
* @memberof AuthenticationResultSessionInfo
*/
nowPlayingItem?: SessionInfoNowPlayingItem | null;
/**
*
* @type {SessionInfoFullNowPlayingItem}
* @memberof AuthenticationResultSessionInfo
*/
fullNowPlayingItem?: SessionInfoFullNowPlayingItem | null;
/**
*
* @type {SessionInfoNowPlayingItem}
* @memberof AuthenticationResultSessionInfo
*/
nowViewingItem?: SessionInfoNowPlayingItem | null;
/**
* Gets or sets the device id.
* @type {string}
* @memberof AuthenticationResultSessionInfo
*/
deviceId?: string | null;
/**
* Gets or sets the application version.
* @type {string}
* @memberof AuthenticationResultSessionInfo
*/
applicationVersion?: string | null;
/**
*
* @type {TranscodingInfo}
* @memberof AuthenticationResultSessionInfo
*/
transcodingInfo?: TranscodingInfo | null;
/**
* Gets a value indicating whether this instance is active.
* @type {boolean}
* @memberof AuthenticationResultSessionInfo
*/
readonly isActive?: boolean;
/**
*
* @type {boolean}
* @memberof AuthenticationResultSessionInfo
*/
readonly supportsMediaControl?: boolean;
/**
*
* @type {boolean}
* @memberof AuthenticationResultSessionInfo
*/
readonly supportsRemoteControl?: boolean;
/**
*
* @type {Array<QueueItem>}
* @memberof AuthenticationResultSessionInfo
*/
nowPlayingQueue?: Array<QueueItem> | null;
/**
*
* @type {Array<BaseItemDto>}
* @memberof AuthenticationResultSessionInfo
*/
nowPlayingQueueFullItems?: Array<BaseItemDto> | null;
/**
*
* @type {boolean}
* @memberof AuthenticationResultSessionInfo
*/
hasCustomDeviceName?: boolean;
/**
*
* @type {string}
* @memberof AuthenticationResultSessionInfo
*/
playlistItemId?: string | null;
/**
*
* @type {string}
* @memberof AuthenticationResultSessionInfo
*/
serverId?: string | null;
/**
*
* @type {string}
* @memberof AuthenticationResultSessionInfo
*/
userPrimaryImageTag?: string | null;
/**
* Gets the supported commands.
* @type {Array<GeneralCommandType>}
* @memberof AuthenticationResultSessionInfo
*/
readonly supportedCommands?: Array<GeneralCommandType> | null;
}
/**
* Check if a given object implements the AuthenticationResultSessionInfo interface.
*/
export function instanceOfAuthenticationResultSessionInfo(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function AuthenticationResultSessionInfoFromJSON(json: any): AuthenticationResultSessionInfo {
return AuthenticationResultSessionInfoFromJSONTyped(json, false);
}
export function AuthenticationResultSessionInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthenticationResultSessionInfo {
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<any>).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<any>).map(QueueItemFromJSON)),
'nowPlayingQueueFullItems': !exists(json, 'NowPlayingQueueFullItems') ? undefined : (json['NowPlayingQueueFullItems'] === null ? null : (json['NowPlayingQueueFullItems'] as Array<any>).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<any>).map(GeneralCommandTypeFromJSON)),
};
}
export function AuthenticationResultSessionInfoToJSON(value?: AuthenticationResultSessionInfo | 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<any>).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<any>).map(QueueItemToJSON)),
'NowPlayingQueueFullItems': value.nowPlayingQueueFullItems === undefined ? undefined : (value.nowPlayingQueueFullItems === null ? null : (value.nowPlayingQueueFullItems as Array<any>).map(BaseItemDtoToJSON)),
'HasCustomDeviceName': value.hasCustomDeviceName,
'PlaylistItemId': value.playlistItemId,
'ServerId': value.serverId,
'UserPrimaryImageTag': value.userPrimaryImageTag,
};
}