UNPKG

@vrspace/babylonjs

Version:

vrspace.org babylonjs client

125 lines (99 loc) 3.78 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 ImageInfo model module. * @module model/ImageInfo * @version v0 */ export class ImageInfo { /** * Constructs a new <code>ImageInfo</code>. * @alias ImageInfo */ constructor() { /** uid * @type {String} */ this.uid = undefined; /** size * @type {Number} */ this.size = undefined; /** width * @type {Number} */ this.width = undefined; /** url * @type {String} */ this.url = undefined; /** height * @type {Number} */ this.height = undefined; ImageInfo.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>ImageInfo</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 {ImageInfo} obj Optional instance to populate. * @return {ImageInfo} The populated <code>ImageInfo</code> instance. */ static constructFromObject(data, obj) { if (data) { obj = obj || new ImageInfo(); if (data.hasOwnProperty('uid')) { obj['uid'] = ApiClient.convertToType(data['uid'], 'String'); } if (data.hasOwnProperty('size')) { obj['size'] = ApiClient.convertToType(data['size'], 'Number'); } if (data.hasOwnProperty('width')) { obj['width'] = ApiClient.convertToType(data['width'], 'Number'); } if (data.hasOwnProperty('url')) { obj['url'] = ApiClient.convertToType(data['url'], 'String'); } if (data.hasOwnProperty('height')) { obj['height'] = ApiClient.convertToType(data['height'], 'Number'); } } return obj; } /** * Validates the JSON data with respect to <code>ImageInfo</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>ImageInfo</code>. */ static validateJSON(data) { // ensure the json data is a string if (data['uid'] && !(typeof data['uid'] === 'string' || data['uid'] instanceof String)) { throw new Error("Expected the field `uid` to be a primitive type in the JSON string but got " + data['uid']); } // 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; } } export default ImageInfo;