/* * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Copyright (c) 2020 Mobify Research & Development Inc. All rights reserved. */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* Shop API
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: 20.4
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient'
/**
* The Range2Filter model module.
* @module models/Range2Filter
* @version 20.4
*/
export default class Range2Filter {
/**
* Constructs a new <code>Range2Filter</code>.
* Document representing a range compare with range filter, named Range2Filter.
* @alias module:models/Range2Filter
* @class
* @param fromField {String} The field name of the field that starts the first range.
* @param toField {String} The field name of the field that ends the first range.
*/
constructor(fromField, toField) {
this.from_field = fromField; this.to_field = toField
}
/**
* Constructs a <code>Range2Filter</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:models/Range2Filter} obj Optional instance to populate.
* @return {module:models/Range2Filter} The populated <code>Range2Filter</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new Range2Filter()
if (data.hasOwnProperty('filter_mode')) {
obj.filter_mode = ApiClient.convertToType(data.filter_mode, 'String')
}
if (data.hasOwnProperty('from_field')) {
obj.from_field = ApiClient.convertToType(data.from_field, 'String')
}
if (data.hasOwnProperty('from_inclusive')) {
obj.from_inclusive = ApiClient.convertToType(data.from_inclusive, 'Boolean')
}
if (data.hasOwnProperty('from_value')) {
obj.from_value = ApiClient.convertToType(data.from_value, Object)
}
if (data.hasOwnProperty('to_field')) {
obj.to_field = ApiClient.convertToType(data.to_field, 'String')
}
if (data.hasOwnProperty('to_inclusive')) {
obj.to_inclusive = ApiClient.convertToType(data.to_inclusive, 'Boolean')
}
if (data.hasOwnProperty('to_value')) {
obj.to_value = ApiClient.convertToType(data.to_value, Object)
}
}
return obj
}
/**
* Compare mode: overlap, containing, or contained. If not specified, the default is overlap.
* @member {module:models/Range2Filter.FilterModeEnum} filter_mode
*/
filter_mode = undefined;
/**
* The field name of the field that starts the first range.
* @member {String} from_field
*/
from_field = undefined;
/**
* Indicates whether the lower bound of the second range is inclusive. If not specified, the default is true. Set to false to make the lower bound exclusive.
* @member {Boolean} from_inclusive
*/
from_inclusive = undefined;
/**
* The lower bound of the second range. If not specified, the range is open-ended with respect to the lower bound. You can't leave both the lower and upper bounds open-ended.
* @member {Object} from_value
*/
from_value = undefined;
/**
* The field name of the field that ends the first range.
* @member {String} to_field
*/
to_field = undefined;
/**
* Indicates whether the upper bound of the second range is inclusive. If not specified, the default is true. Set to false to make the lower bound exclusive.
* @member {Boolean} to_inclusive
*/
to_inclusive = undefined;
/**
* The upper bound of the second range. If not specified, the range is open-ended with respect to the upper bound. You can't leave both the upper and lower bounds open-ended.
* @member {Object} to_value
*/
to_value = undefined;
/**
* Allowed values for the <code>filter_mode</code> property.
* @enum {String}
* @readonly
*/
static FilterModeEnum = {
/**
* value: "overlap"
* @const
*/
overlap: 'overlap',
/**
* value: "containing"
* @const
*/
containing: 'containing',
/**
* value: "contained"
* @const
*/
contained: 'contained'
};
}