1/** 2 * OpenAPI definition 3 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 4 * 5 * The version of the OpenAPI document: v0 6 * 7 * 8 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 * https://openapi-generator.tech 10 * Do not edit the class manually. 11 * 12 */ 13 14import {ApiClient} from '../ApiClient.js'; 15 16/** 17 * The CreateWorldOptions model module. 18 * @module model/CreateWorldOptions 19 * @version v0 20 */ 21export class CreateWorldOptions { 22 /** 23 * Constructs a new <code>CreateWorldOptions</code>. 24 * World options 25 * @alias CreateWorldOptions 26 */ 27 constructor() { 28 29 30 /** worldName 31 * @type {String} 32 */ 33 this.worldName = undefined; 34 35 /** templateName 36 * Optional world template to use 37 * @type {String} 38 */ 39 this.templateName = undefined; 40 41 /** token 42 * Optional UUID used as world token, required to enter private worlds, defaults to a random UUID 43 * @type {String} 44 */ 45 this.token = undefined; 46 47 /** publicWorld 48 * Optional flag to create public or private world, default false 49 * @type {Boolean} 50 */ 51 this.publicWorld = undefined; 52 53 /** temporaryWorld 54 * optional flag to create a temporary world, default true 55 * @type {Boolean} 56 */ 57 this.temporaryWorld = undefined; 58 59 60 61 62 CreateWorldOptions.initialize(this); 63 } 64 65 /** 66 * Initializes the fields of this object. 67 * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). 68 * Only for internal use. 69 */ 70 static initialize(obj) { 71 } 72 73 /** 74 * Constructs a <code>CreateWorldOptions</code> from a plain JavaScript object, optionally creating a new instance. 75 * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not. 76 * @param {Object} data The plain JavaScript object bearing properties of interest. 77 * @param {CreateWorldOptions} obj Optional instance to populate. 78 * @return {CreateWorldOptions} The populated <code>CreateWorldOptions</code> instance. 79 */ 80 static constructFromObject(data, obj) { 81 if (data) { 82 obj = obj || new CreateWorldOptions(); 83 84 if (data.hasOwnProperty('worldName')) { 85 obj['worldName'] = ApiClient.convertToType(data['worldName'], 'String'); 86 } 87 if (data.hasOwnProperty('templateName')) { 88 obj['templateName'] = ApiClient.convertToType(data['templateName'], 'String'); 89 } 90 if (data.hasOwnProperty('token')) { 91 obj['token'] = ApiClient.convertToType(data['token'], 'String'); 92 } 93 if (data.hasOwnProperty('publicWorld')) { 94 obj['publicWorld'] = ApiClient.convertToType(data['publicWorld'], 'Boolean'); 95 } 96 if (data.hasOwnProperty('temporaryWorld')) { 97 obj['temporaryWorld'] = ApiClient.convertToType(data['temporaryWorld'], 'Boolean'); 98 } 99 } 100 return obj; 101 } 102 103 /** 104 * Validates the JSON data with respect to <code>CreateWorldOptions</code>. 105 * @param {Object} data The plain JavaScript object bearing properties of interest. 106 * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreateWorldOptions</code>. 107 */ 108 static validateJSON(data) { 109 // ensure the json data is a string 110 if (data['worldName'] && !(typeof data['worldName'] === 'string' || data['worldName'] instanceof String)) { 111 throw new Error("Expected the field `worldName` to be a primitive type in the JSON string but got " + data['worldName']); 112 } 113 // ensure the json data is a string 114 if (data['templateName'] && !(typeof data['templateName'] === 'string' || data['templateName'] instanceof String)) { 115 throw new Error("Expected the field `templateName` to be a primitive type in the JSON string but got " + data['templateName']); 116 } 117 // ensure the json data is a string 118 if (data['token'] && !(typeof data['token'] === 'string' || data['token'] instanceof String)) { 119 throw new Error("Expected the field `token` to be a primitive type in the JSON string but got " + data['token']); 120 } 121 122 return true; 123 } 124 125 126} 127 128 129 130 131 132export default CreateWorldOptions; 133
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.