UNPKG

@vrspace/babylonjs

Version:

vrspace.org babylonjs client

122 lines (96 loc) 3.76 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 World model module. * @module model/World * @version v0 */ export class World { /** * Constructs a new <code>World</code>. * VRObject container, contains isolated parts of space, like chat room. One default world is created on startup, others are typically created on demand, after Enter command is issued. * @alias World */ constructor() { /** id * @type {Number} */ this.id = undefined; /** name * @type {String} */ this.name = undefined; /** defaultWorld * @type {Boolean} */ this.defaultWorld = undefined; /** publicWorld * @type {Boolean} */ this.publicWorld = undefined; /** temporaryWorld * @type {Boolean} */ this.temporaryWorld = undefined; World.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>World</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 {World} obj Optional instance to populate. * @return {World} The populated <code>World</code> instance. */ static constructFromObject(data, obj) { if (data) { obj = obj || new World(); if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } if (data.hasOwnProperty('name')) { obj['name'] = ApiClient.convertToType(data['name'], 'String'); } if (data.hasOwnProperty('defaultWorld')) { obj['defaultWorld'] = ApiClient.convertToType(data['defaultWorld'], 'Boolean'); } if (data.hasOwnProperty('publicWorld')) { obj['publicWorld'] = ApiClient.convertToType(data['publicWorld'], 'Boolean'); } if (data.hasOwnProperty('temporaryWorld')) { obj['temporaryWorld'] = ApiClient.convertToType(data['temporaryWorld'], 'Boolean'); } } return obj; } /** * Validates the JSON data with respect to <code>World</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>World</code>. */ static validateJSON(data) { // ensure the json data is a string if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) { throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']); } return true; } } export default World;