/**
* 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';
import { PersistentEvent } from './PersistentEvent.js';
/**
* The RecordingData model module.
* @module model/RecordingData
* @version v0
*/
export class RecordingData {
/**
* Constructs a new <code>RecordingData</code>.
* @alias RecordingData
*/
constructor() {
/** events
* @type {Array.<PersistentEvent>}
*/
this.events = undefined;
/** length
* @type {Number}
*/
this.length = undefined;
RecordingData.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>RecordingData</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 {RecordingData} obj Optional instance to populate.
* @return {RecordingData} The populated <code>RecordingData</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new RecordingData();
if (data.hasOwnProperty('events')) {
obj['events'] = ApiClient.convertToType(data['events'], [PersistentEvent]);
}
if (data.hasOwnProperty('length')) {
obj['length'] = ApiClient.convertToType(data['length'], 'Number');
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>RecordingData</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>RecordingData</code>.
*/
static validateJSON(data) {
if (data['events']) { // data not null
// ensure the json data is an array
if (!Array.isArray(data['events'])) {
throw new Error("Expected the field `events` to be an array in the JSON data but got " + data['events']);
}
// validate the optional field `events` (array)
for (const item of data['events']) {
PersistentEvent.validateJSON(item);
};
}
return true;
}
}
export default RecordingData;