UNPKG

@vrspace/babylonjs

Version:

vrspace.org babylonjs client

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