/**
* GameBrain API
* GameBrain API
*
* The version of the OpenAPI document: 1.0.1
* Contact: mail@gamebrain.co
*
* 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';
/**
* The GameResponsePlaytime model module.
* @module model/GameResponsePlaytime
* @version 1.0.2
*/
class GameResponsePlaytime {
/**
* Constructs a new <code>GameResponsePlaytime</code>.
* @alias module:model/GameResponsePlaytime
*/
constructor() {
GameResponsePlaytime.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>GameResponsePlaytime</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 {module:model/GameResponsePlaytime} obj Optional instance to populate.
* @return {module:model/GameResponsePlaytime} The populated <code>GameResponsePlaytime</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new GameResponsePlaytime();
if (data.hasOwnProperty('percentiles')) {
obj['percentiles'] = ApiClient.convertToType(data['percentiles'], ['Number']);
}
if (data.hasOwnProperty('min')) {
obj['min'] = ApiClient.convertToType(data['min'], 'Number');
}
if (data.hasOwnProperty('median')) {
obj['median'] = ApiClient.convertToType(data['median'], 'Number');
}
if (data.hasOwnProperty('max')) {
obj['max'] = ApiClient.convertToType(data['max'], 'Number');
}
if (data.hasOwnProperty('mean')) {
obj['mean'] = ApiClient.convertToType(data['mean'], 'Number');
}
if (data.hasOwnProperty('mentions')) {
obj['mentions'] = ApiClient.convertToType(data['mentions'], 'Number');
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>GameResponsePlaytime</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>GameResponsePlaytime</code>.
*/
static validateJSON(data) {
// ensure the json data is an array
if (!Array.isArray(data['percentiles'])) {
throw new Error("Expected the field `percentiles` to be an array in the JSON data but got " + data['percentiles']);
}
return true;
}
}
/**
* @member {Array.<Number>} percentiles
*/
GameResponsePlaytime.prototype['percentiles'] = undefined;
/**
* @member {Number} min
*/
GameResponsePlaytime.prototype['min'] = undefined;
/**
* @member {Number} median
*/
GameResponsePlaytime.prototype['median'] = undefined;
/**
* @member {Number} max
*/
GameResponsePlaytime.prototype['max'] = undefined;
/**
* @member {Number} mean
*/
GameResponsePlaytime.prototype['mean'] = undefined;
/**
* @member {Number} mentions
*/
GameResponsePlaytime.prototype['mentions'] = undefined;
export default GameResponsePlaytime;