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