UNPKG

@vrspace/babylonjs

Version:

vrspace.org babylonjs client

120 lines (96 loc) 3.93 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 WebPushSubscription model module. * @module model/WebPushSubscription * @version v0 */ export class WebPushSubscription { /** * Constructs a new <code>WebPushSubscription</code>. * @alias WebPushSubscription */ constructor() { WebPushSubscription.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>WebPushSubscription</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 {WebPushSubscription} obj Optional instance to populate. * @return {WebPushSubscription} The populated <code>WebPushSubscription</code> instance. */ static constructFromObject(data, obj) { if (data) { obj = obj || new WebPushSubscription(); if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } if (data.hasOwnProperty('endpoint')) { obj['endpoint'] = ApiClient.convertToType(data['endpoint'], 'String'); } if (data.hasOwnProperty('key')) { obj['key'] = ApiClient.convertToType(data['key'], 'String'); } if (data.hasOwnProperty('auth')) { obj['auth'] = ApiClient.convertToType(data['auth'], 'String'); } } return obj; } /** * Validates the JSON data with respect to <code>WebPushSubscription</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>WebPushSubscription</code>. */ static validateJSON(data) { // ensure the json data is a string if (data['endpoint'] && !(typeof data['endpoint'] === 'string' || data['endpoint'] instanceof String)) { throw new Error("Expected the field `endpoint` to be a primitive type in the JSON string but got " + data['endpoint']); } // ensure the json data is a string if (data['key'] && !(typeof data['key'] === 'string' || data['key'] instanceof String)) { throw new Error("Expected the field `key` to be a primitive type in the JSON string but got " + data['key']); } // ensure the json data is a string if (data['auth'] && !(typeof data['auth'] === 'string' || data['auth'] instanceof String)) { throw new Error("Expected the field `auth` to be a primitive type in the JSON string but got " + data['auth']); } return true; } } /** * @member {Number} id */ WebPushSubscription.prototype['id'] = undefined; /** * @member {String} endpoint */ WebPushSubscription.prototype['endpoint'] = undefined; /** * @member {String} key */ WebPushSubscription.prototype['key'] = undefined; /** * @member {String} auth */ WebPushSubscription.prototype['auth'] = undefined; export default WebPushSubscription;