UNPKG

@vrspace/babylonjs

Version:

vrspace.org babylonjs client

105 lines (81 loc) 3.17 kB
/** * OpenAPI definition * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. * */ import {ApiClient} from '../ApiClient.js'; /** * The WorldStatus model module. * @module model/WorldStatus * @version v0 */ export class WorldStatus { /** * Constructs a new <code>WorldStatus</code>. * @alias WorldStatus */ constructor() { /** worldName * @type {String} */ this.worldName = undefined; /** activeUsers * @type {Number} */ this.activeUsers = undefined; /** totalUsers * @type {Number} */ this.totalUsers = undefined; WorldStatus.initialize(this); } /** * Initializes the fields of this object. * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). * Only for internal use. */ static initialize(obj) { } /** * Constructs a <code>WorldStatus</code> from a plain JavaScript object, optionally creating a new instance. * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not. * @param {Object} data The plain JavaScript object bearing properties of interest. * @param {WorldStatus} obj Optional instance to populate. * @return {WorldStatus} The populated <code>WorldStatus</code> instance. */ static constructFromObject(data, obj) { if (data) { obj = obj || new WorldStatus(); if (data.hasOwnProperty('worldName')) { obj['worldName'] = ApiClient.convertToType(data['worldName'], 'String'); } if (data.hasOwnProperty('activeUsers')) { obj['activeUsers'] = ApiClient.convertToType(data['activeUsers'], 'Number'); } if (data.hasOwnProperty('totalUsers')) { obj['totalUsers'] = ApiClient.convertToType(data['totalUsers'], 'Number'); } } return obj; } /** * Validates the JSON data with respect to <code>WorldStatus</code>. * @param {Object} data The plain JavaScript object bearing properties of interest. * @return {boolean} to indicate whether the JSON data is valid with respect to <code>WorldStatus</code>. */ static validateJSON(data) { // ensure the json data is a string if (data['worldName'] && !(typeof data['worldName'] === 'string' || data['worldName'] instanceof String)) { throw new Error("Expected the field `worldName` to be a primitive type in the JSON string but got " + data['worldName']); } return true; } } export default WorldStatus;