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

154 lines
4.6 KiB
TypeScript
Raw 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';
/**
*
* @export
* @interface AuthenticationInfo
*/
export interface AuthenticationInfo {
/**
* Gets or sets the identifier.
* @type {number}
* @memberof AuthenticationInfo
*/
id?: number;
/**
* Gets or sets the access token.
* @type {string}
* @memberof AuthenticationInfo
*/
accessToken?: string | null;
/**
* Gets or sets the device identifier.
* @type {string}
* @memberof AuthenticationInfo
*/
deviceId?: string | null;
/**
* Gets or sets the name of the application.
* @type {string}
* @memberof AuthenticationInfo
*/
appName?: string | null;
/**
* Gets or sets the application version.
* @type {string}
* @memberof AuthenticationInfo
*/
appVersion?: string | null;
/**
* Gets or sets the name of the device.
* @type {string}
* @memberof AuthenticationInfo
*/
deviceName?: string | null;
/**
* Gets or sets the user identifier.
* @type {string}
* @memberof AuthenticationInfo
*/
userId?: string;
/**
* Gets or sets a value indicating whether this instance is active.
* @type {boolean}
* @memberof AuthenticationInfo
*/
isActive?: boolean;
/**
* Gets or sets the date created.
* @type {Date}
* @memberof AuthenticationInfo
*/
dateCreated?: Date;
/**
* Gets or sets the date revoked.
* @type {Date}
* @memberof AuthenticationInfo
*/
dateRevoked?: Date | null;
/**
*
* @type {Date}
* @memberof AuthenticationInfo
*/
dateLastActivity?: Date;
/**
*
* @type {string}
* @memberof AuthenticationInfo
*/
userName?: string | null;
}
/**
* Check if a given object implements the AuthenticationInfo interface.
*/
export function instanceOfAuthenticationInfo(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function AuthenticationInfoFromJSON(json: any): AuthenticationInfo {
return AuthenticationInfoFromJSONTyped(json, false);
}
export function AuthenticationInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthenticationInfo {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'Id') ? undefined : json['Id'],
'accessToken': !exists(json, 'AccessToken') ? undefined : json['AccessToken'],
'deviceId': !exists(json, 'DeviceId') ? undefined : json['DeviceId'],
'appName': !exists(json, 'AppName') ? undefined : json['AppName'],
'appVersion': !exists(json, 'AppVersion') ? undefined : json['AppVersion'],
'deviceName': !exists(json, 'DeviceName') ? undefined : json['DeviceName'],
'userId': !exists(json, 'UserId') ? undefined : json['UserId'],
'isActive': !exists(json, 'IsActive') ? undefined : json['IsActive'],
'dateCreated': !exists(json, 'DateCreated') ? undefined : (new Date(json['DateCreated'])),
'dateRevoked': !exists(json, 'DateRevoked') ? undefined : (json['DateRevoked'] === null ? null : new Date(json['DateRevoked'])),
'dateLastActivity': !exists(json, 'DateLastActivity') ? undefined : (new Date(json['DateLastActivity'])),
'userName': !exists(json, 'UserName') ? undefined : json['UserName'],
};
}
export function AuthenticationInfoToJSON(value?: AuthenticationInfo | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'Id': value.id,
'AccessToken': value.accessToken,
'DeviceId': value.deviceId,
'AppName': value.appName,
'AppVersion': value.appVersion,
'DeviceName': value.deviceName,
'UserId': value.userId,
'IsActive': value.isActive,
'DateCreated': value.dateCreated === undefined ? undefined : (value.dateCreated.toISOString()),
'DateRevoked': value.dateRevoked === undefined ? undefined : (value.dateRevoked === null ? null : value.dateRevoked.toISOString()),
'DateLastActivity': value.dateLastActivity === undefined ? undefined : (value.dateLastActivity.toISOString()),
'UserName': value.userName,
};
}