1. 1 :
  2. 2 :
  3. 3 : (function(root, factory) {
  4. 4 :
  5. 5 : if (typeof module === 'object' && module.exports) {
  6. 6 : // CommonJS-like environments that support module.exports, like Node.
  7. 7 : module.exports = factory(require('../ApiClient'), require('./InvocationContext'), require('../CommonUtil'), require('../ResponseWrapper'), require('./Base'), require('../OrbipayApiError'));
  8. 8 : }
  9. 9 : }(this, function(ApiClient, InvocationContext, CommonUtil, ResponseWrapper, Base, OrbipayApiError) {
  10. 10 : 'use strict';
  11. 11 :
  12. 12 : /**
  13. 13 : * The RecordedPayments wrapper module.
  14. 14 : * @module wrappers/RecordedPayments
  15. 15 : */
  16. 16 : var exports = function() {
  17. 17 :
  18. 18 : };
  19. 19 : exports.constructFromObject = function (data, obj) {
  20. 20 : if (data) {
  21. 21 : obj = obj || new exports();
  22. 22 : if (data.hasOwnProperty('list')) {
  23. 23 : var RecordedPayment = require('./RecordedPayment');
  24. 24 : obj['list'] = ApiClient.convertToType(data['list'], [RecordedPayment]);
  25. 25 : }
  26. 26 : if (data.hasOwnProperty('total_results_count')) {
  27. 27 : obj['total_results_count'] = data['total_results_count'];
  28. 28 : }
  29. 29 : if (data.hasOwnProperty('has_more_results')) {
  30. 30 : obj['has_more_results'] = data['has_more_results'];
  31. 31 : }
  32. 32 : if (data.hasOwnProperty('url')) {
  33. 33 : obj['url'] = data['url'];
  34. 34 : }
  35. 35 : if (data.hasOwnProperty('from_index')) {
  36. 36 : obj['from_index'] = data['from_index'];
  37. 37 : }
  38. 38 : if (data.hasOwnProperty('to_index')) {
  39. 39 : obj['to_index'] = data['to_index'];
  40. 40 : }
  41. 41 : if (data.hasOwnProperty('query_id')) {
  42. 42 : obj['query_id'] = data['query_id'];
  43. 43 : }
  44. 44 : }
  45. 45 : return obj;
  46. 46 : };
  47. 47 :
  48. 48 :
  49. 49 : exports.prototype = Object.create(Base.prototype);
  50. 50 : exports.prototype.constructor = exports;
  51. 51 :
  52. 52 : /**
  53. 53 : * @member [RecordedPayment] list
  54. 54 : */
  55. 55 : exports.prototype['list'] = undefined;
  56. 56 : /**
  57. 57 : * total number of payments available with matching criteria
  58. 58 : * @member {String} total_results_count
  59. 59 : */
  60. 60 : exports.prototype['total_results_count'] = undefined;
  61. 61 : /**
  62. 62 : * true if there are more results or pages
  63. 63 : * @member {String} has_more_results
  64. 64 : */
  65. 65 : exports.prototype['has_more_results'] = undefined;
  66. 66 : /**
  67. 67 : * This URL fetches the next or previous set of payments, based on the presence of after_object or before_object parameter.
  68. 68 : * @member {String} url
  69. 69 : */
  70. 70 : exports.prototype['url'] = undefined;
  71. 71 : /**
  72. 72 : * The id of the object before which the previous set of objects are to be retrieved.
  73. 73 : * @member {String} from_index
  74. 74 : */
  75. 75 : exports.prototype['from_index'] = undefined;
  76. 76 : /**
  77. 77 : * The id of the object after which the next set of objects are to be retrieved.
  78. 78 : * @member {String} to_index
  79. 79 : */
  80. 80 : exports.prototype['to_index'] = undefined;
  81. 81 : /**
  82. 82 : * The query id of the object.
  83. 83 : * @member {String} query_id
  84. 84 : */
  85. 85 : exports.prototype['query_id'] = undefined;
  86. 86 :
  87. 87 : /**
  88. 88 : * @param {String} client_key - The client_key of RecordedPayments.
  89. 89 : * @return {module:wrappers/RecordedPayments} The instance of <code>RecordedPayments</code>.
  90. 90 : */
  91. 91 : exports.prototype.forClient = function (client_key) {
  92. 92 : var _this = this;
  93. 93 : Base.prototype.forClient.call(_this,client_key);
  94. 94 : return _this;
  95. 95 : };
  96. 96 : /**
  97. 97 : * @param {String} channel - The channel of RecordedPayments.
  98. 98 : * @return {module:wrappers/RecordedPayments} The instance of <code>RecordedPayments</code>.
  99. 99 : */
  100. 100 : exports.prototype.videChannel = function (channel) {
  101. 101 : var _this = this;
  102. 102 : Base.prototype.videChannel.call(_this,channel);
  103. 103 : return _this;
  104. 104 : };
  105. 105 : /**
  106. 106 : * @param {String} from_index - The from_index of RecordedPayments.
  107. 107 : * @param {String} to_index - The to_index of RecordedPayments.
  108. 108 : * @param {String} query_id - The query_id of RecordedPayments.
  109. 109 : * @return {module:wrappers/RecordedPayments} The instance of <code>RecordedPayments</code>.
  110. 110 : */
  111. 111 : exports.prototype.findBy = function (filterParameters) {
  112. 112 : var _this = this;
  113. 113 : if(filterParameters){
  114. 114 :
  115. 115 : _this['from_index'] = CommonUtil.getValuesFromMultiMap(filterParameters, 'from_index', false);
  116. 116 :
  117. 117 : _this['to_index'] = CommonUtil.getValuesFromMultiMap(filterParameters, 'to_index', false);
  118. 118 :
  119. 119 : _this['query_id'] = CommonUtil.getValuesFromMultiMap(filterParameters, 'query_id', false);
  120. 120 : }
  121. 121 : return _this;
  122. 122 : };
  123. 123 : /**
  124. 124 : * @return {module:wrappers/RecordedPayments} The instance of <code>RecordedPayments</code>.
  125. 125 : */
  126. 126 : exports.prototype.forCustomer = function () {
  127. 127 : var _this = this;
  128. 128 :
  129. 129 :
  130. 130 : return _this;
  131. 131 : };
  132. 132 :
  133. 133 :
  134. 134 :
  135. 135 : return exports;
  136. 136 :
  137. 137 : }));