UNPKG

@vrspace/babylonjs

Version:

vrspace.org babylonjs client

176 lines (145 loc) 5.69 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 WebPushMessage model module. * @module model/WebPushMessage * @version v0 */ export class WebPushMessage { /** * Constructs a new <code>WebPushMessage</code>. * @alias WebPushMessage */ constructor() { WebPushMessage.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>WebPushMessage</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 {WebPushMessage} obj Optional instance to populate. * @return {WebPushMessage} The populated <code>WebPushMessage</code> instance. */ static constructFromObject(data, obj) { if (data) { obj = obj || new WebPushMessage(); if (data.hasOwnProperty('type')) { obj['type'] = ApiClient.convertToType(data['type'], 'String'); } if (data.hasOwnProperty('sender')) { obj['sender'] = ApiClient.convertToType(data['sender'], 'String'); } if (data.hasOwnProperty('group')) { obj['group'] = ApiClient.convertToType(data['group'], 'String'); } if (data.hasOwnProperty('world')) { obj['world'] = ApiClient.convertToType(data['world'], 'String'); } if (data.hasOwnProperty('message')) { obj['message'] = ApiClient.convertToType(data['message'], 'String'); } if (data.hasOwnProperty('url')) { obj['url'] = ApiClient.convertToType(data['url'], 'String'); } } return obj; } /** * Validates the JSON data with respect to <code>WebPushMessage</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>WebPushMessage</code>. */ static validateJSON(data) { // ensure the json data is a string if (data['type'] && !(typeof data['type'] === 'string' || data['type'] instanceof String)) { throw new Error("Expected the field `type` to be a primitive type in the JSON string but got " + data['type']); } // ensure the json data is a string if (data['sender'] && !(typeof data['sender'] === 'string' || data['sender'] instanceof String)) { throw new Error("Expected the field `sender` to be a primitive type in the JSON string but got " + data['sender']); } // ensure the json data is a string if (data['group'] && !(typeof data['group'] === 'string' || data['group'] instanceof String)) { throw new Error("Expected the field `group` to be a primitive type in the JSON string but got " + data['group']); } // ensure the json data is a string if (data['world'] && !(typeof data['world'] === 'string' || data['world'] instanceof String)) { throw new Error("Expected the field `world` to be a primitive type in the JSON string but got " + data['world']); } // ensure the json data is a string if (data['message'] && !(typeof data['message'] === 'string' || data['message'] instanceof String)) { throw new Error("Expected the field `message` to be a primitive type in the JSON string but got " + data['message']); } // ensure the json data is a string if (data['url'] && !(typeof data['url'] === 'string' || data['url'] instanceof String)) { throw new Error("Expected the field `url` to be a primitive type in the JSON string but got " + data['url']); } return true; } } /** * @member {WebPushMessage.TypeEnum} type */ WebPushMessage.prototype['type'] = undefined; /** * Name of the client that sends the message * @member {String} sender */ WebPushMessage.prototype['sender'] = undefined; /** * @member {String} group */ WebPushMessage.prototype['group'] = undefined; /** * @member {String} world */ WebPushMessage.prototype['world'] = undefined; /** * @member {String} message */ WebPushMessage.prototype['message'] = undefined; /** * @member {String} url */ WebPushMessage.prototype['url'] = undefined; /** * Allowed values for the <code>type</code> property. * @enum {String} * @readonly */ WebPushMessage['TypeEnum'] = { /** * value: "GROUP_INVITE" * @const */ "GROUP_INVITE": "GROUP_INVITE", /** * value: "GROUP_MESSAGE" * @const */ "GROUP_MESSAGE": "GROUP_MESSAGE", /** * value: "WORLD_INVITE" * @const */ "WORLD_INVITE": "WORLD_INVITE" }; export default WebPushMessage;