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