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

103 lines
3.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 { exists, mapValues } from '../runtime';
import type { AuthenticationResultSessionInfo } from './AuthenticationResultSessionInfo';
import {
AuthenticationResultSessionInfoFromJSON,
AuthenticationResultSessionInfoFromJSONTyped,
AuthenticationResultSessionInfoToJSON,
} from './AuthenticationResultSessionInfo';
import type { AuthenticationResultUser } from './AuthenticationResultUser';
import {
AuthenticationResultUserFromJSON,
AuthenticationResultUserFromJSONTyped,
AuthenticationResultUserToJSON,
} from './AuthenticationResultUser';
/**
*
* @export
* @interface AuthenticationResult
*/
export interface AuthenticationResult {
/**
*
* @type {AuthenticationResultUser}
* @memberof AuthenticationResult
*/
user?: AuthenticationResultUser | null;
/**
*
* @type {AuthenticationResultSessionInfo}
* @memberof AuthenticationResult
*/
sessionInfo?: AuthenticationResultSessionInfo | null;
/**
*
* @type {string}
* @memberof AuthenticationResult
*/
accessToken?: string | null;
/**
*
* @type {string}
* @memberof AuthenticationResult
*/
serverId?: string | null;
}
/**
* Check if a given object implements the AuthenticationResult interface.
*/
export function instanceOfAuthenticationResult(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function AuthenticationResultFromJSON(json: any): AuthenticationResult {
return AuthenticationResultFromJSONTyped(json, false);
}
export function AuthenticationResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthenticationResult {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'user': !exists(json, 'User') ? undefined : AuthenticationResultUserFromJSON(json['User']),
'sessionInfo': !exists(json, 'SessionInfo') ? undefined : AuthenticationResultSessionInfoFromJSON(json['SessionInfo']),
'accessToken': !exists(json, 'AccessToken') ? undefined : json['AccessToken'],
'serverId': !exists(json, 'ServerId') ? undefined : json['ServerId'],
};
}
export function AuthenticationResultToJSON(value?: AuthenticationResult | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'User': AuthenticationResultUserToJSON(value.user),
'SessionInfo': AuthenticationResultSessionInfoToJSON(value.sessionInfo),
'AccessToken': value.accessToken,
'ServerId': value.serverId,
};
}