UNPKG

@vrspace/babylonjs

Version:

vrspace.org babylonjs client

134 lines (108 loc) 4.74 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 CreateWorldOptions model module. * @module model/CreateWorldOptions * @version v0 */ export class CreateWorldOptions { /** * Constructs a new <code>CreateWorldOptions</code>. * World options * @alias CreateWorldOptions */ constructor() { /** worldName * @type {String} */ this.worldName = undefined; /** templateName * Optional world template to use * @type {String} */ this.templateName = undefined; /** token * Optional UUID used as world token, required to enter private worlds, defaults to a random UUID * @type {String} */ this.token = undefined; /** publicWorld * Optional flag to create public or private world, default false * @type {Boolean} */ this.publicWorld = undefined; /** temporaryWorld * optional flag to create a temporary world, default true * @type {Boolean} */ this.temporaryWorld = undefined; CreateWorldOptions.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>CreateWorldOptions</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 {CreateWorldOptions} obj Optional instance to populate. * @return {CreateWorldOptions} The populated <code>CreateWorldOptions</code> instance. */ static constructFromObject(data, obj) { if (data) { obj = obj || new CreateWorldOptions(); if (data.hasOwnProperty('worldName')) { obj['worldName'] = ApiClient.convertToType(data['worldName'], 'String'); } if (data.hasOwnProperty('templateName')) { obj['templateName'] = ApiClient.convertToType(data['templateName'], 'String'); } if (data.hasOwnProperty('token')) { obj['token'] = ApiClient.convertToType(data['token'], 'String'); } 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>CreateWorldOptions</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>CreateWorldOptions</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']); } // ensure the json data is a string if (data['templateName'] && !(typeof data['templateName'] === 'string' || data['templateName'] instanceof String)) { throw new Error("Expected the field `templateName` to be a primitive type in the JSON string but got " + data['templateName']); } // ensure the json data is a string if (data['token'] && !(typeof data['token'] === 'string' || data['token'] instanceof String)) { throw new Error("Expected the field `token` to be a primitive type in the JSON string but got " + data['token']); } return true; } } export default CreateWorldOptions;