Files
BordroRobot/app/frontend/bindings/models.ts
2024-03-25 15:20:22 +03:00

34 lines
1.1 KiB
TypeScript

// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export const LoginUser = class {
/**
* Creates a new LoginUser instance.
* @constructor
* @param {Object} source - The source object to create the LoginUser.
* @param {string} source.UserName
* @param {string} source.password
* @param {string} source.Token
* @param {boolean} source.LoggedIn
*/
constructor(source = {}) {
const { userName = "", password = "", token = "", loggedIn = false } = source;
this.userName = userName;
this.password = password;
this.token = token;
this.loggedIn = loggedIn;
}
/**
* Creates a new LoginUser instance from a string or object.
* @param {string|object} source - The source data to create a LoginUser instance from.
* @returns {LoginUser} A new LoginUser instance.
*/
static createFrom(source) {
let parsedSource = typeof source === 'string' ? JSON.parse(source) : source;
return new LoginUser(parsedSource);
}
};