Source: models/RangeFilter.js

  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * */
  2. /* Copyright (c) 2020 Mobify Research & Development Inc. All rights reserved. */
  3. /* * * * * * * * * * * * * * * * * * * * * * * * * * * */
  4. /**
  5. * Shop API
  6. * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
  7. *
  8. * OpenAPI spec version: 20.4
  9. *
  10. *
  11. * NOTE: This class is auto generated by the swagger code generator program.
  12. * https://github.com/swagger-api/swagger-codegen.git
  13. * Do not edit the class manually.
  14. *
  15. */
  16. import ApiClient from '../ApiClient'
  17. /**
  18. * The RangeFilter model module.
  19. * @module models/RangeFilter
  20. * @version 20.4
  21. */
  22. export default class RangeFilter {
  23. /**
  24. * Constructs a new <code>RangeFilter</code>.
  25. * Document representing a range filter.
  26. * @alias module:models/RangeFilter
  27. * @class
  28. * @param field {String} The search field.
  29. */
  30. constructor(field) {
  31. this.field = field
  32. }
  33. /**
  34. * Constructs a <code>RangeFilter</code> from a plain JavaScript object, optionally creating a new instance.
  35. * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
  36. * @param {Object} data The plain JavaScript object bearing properties of interest.
  37. * @param {module:models/RangeFilter} obj Optional instance to populate.
  38. * @return {module:models/RangeFilter} The populated <code>RangeFilter</code> instance.
  39. */
  40. static constructFromObject(data, obj) {
  41. if (data) {
  42. obj = obj || new RangeFilter()
  43. if (data.hasOwnProperty('field')) {
  44. obj.field = ApiClient.convertToType(data.field, 'String')
  45. }
  46. if (data.hasOwnProperty('from')) {
  47. obj.from = ApiClient.convertToType(data.from, Object)
  48. }
  49. if (data.hasOwnProperty('from_inclusive')) {
  50. obj.from_inclusive = ApiClient.convertToType(data.from_inclusive, 'Boolean')
  51. }
  52. if (data.hasOwnProperty('to')) {
  53. obj.to = ApiClient.convertToType(data.to, Object)
  54. }
  55. if (data.hasOwnProperty('to_inclusive')) {
  56. obj.to_inclusive = ApiClient.convertToType(data.to_inclusive, 'Boolean')
  57. }
  58. }
  59. return obj
  60. }
  61. /**
  62. * The search field.
  63. * @member {String} field
  64. */
  65. field = undefined;
  66. /**
  67. * The lower bound of the filter 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.
  68. * @member {Object} from
  69. */
  70. from = undefined;
  71. /**
  72. * Indicates whether the lower bound of the range is inclusive. If not specified, the default is true. Set to false to make the lower bound exclusive.
  73. * @member {Boolean} from_inclusive
  74. */
  75. from_inclusive = undefined;
  76. /**
  77. * The upper bound of the filter 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.
  78. * @member {Object} to
  79. */
  80. to = undefined;
  81. /**
  82. * Indicates whether the upper bound of the range is inclusive. If not specified, the default is true. Set to false to made the upper bound exclusive.
  83. * @member {Boolean} to_inclusive
  84. */
  85. to_inclusive = undefined;
  86. }