voucherify 8.0.2 → 8.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile +1 -1
  3. data/ENDPOINTS-COVERAGE.md +53 -48
  4. data/Gemfile.lock +8 -6
  5. data/README.md +44 -2
  6. data/__tests__/spec/12_validation_rules_spec.rb +1 -15
  7. data/docs/AccessSettings.md +9 -0
  8. data/docs/AccessSettingsAssign.md +10 -0
  9. data/docs/AccessSettingsUnassign.md +10 -0
  10. data/docs/ApplicableTo.md +3 -2
  11. data/docs/ApplicableToOrderItemUnitsItem.md +9 -0
  12. data/docs/ApplicationDetailsItem.md +14 -0
  13. data/docs/AreaStoreCampaignAssignment.md +1 -0
  14. data/docs/BinApi.md +4 -4
  15. data/docs/Campaign.md +1 -1
  16. data/docs/CampaignBase.md +1 -0
  17. data/docs/CampaignsCreateRequestBody.md +1 -0
  18. data/docs/CampaignsCreateResponseBody.md +1 -1
  19. data/docs/CampaignsGetResponseBody.md +1 -1
  20. data/docs/CampaignsUpdateRequestBody.md +1 -0
  21. data/docs/CampaignsUpdateResponseBody.md +1 -1
  22. data/docs/CampaignsVouchersCreateCombinedResponseBodyLoyaltyCard.md +2 -1
  23. data/docs/CampaignsVouchersCreateResponseBodyLoyaltyCard.md +2 -1
  24. data/docs/ClientValidationsValidateResponseBodyRedeemablesItemResultDiscount.md +1 -1
  25. data/docs/CustomerLoyalty.md +1 -1
  26. data/docs/Discount.md +1 -1
  27. data/docs/DiscountUnitMultipleOneUnit.md +1 -1
  28. data/docs/EarningRule.md +1 -0
  29. data/docs/EarningRulePendingPoints.md +9 -0
  30. data/docs/EventSource.md +10 -0
  31. data/docs/EventSourceApiKey.md +9 -0
  32. data/docs/EventSourceUser.md +8 -0
  33. data/docs/InapplicableTo.md +3 -2
  34. data/docs/InapplicableToOrderItemUnitsItem.md +9 -0
  35. data/docs/LoyaltiesApi.md +334 -10
  36. data/docs/LoyaltiesCreateCampaignRequestBody.md +1 -0
  37. data/docs/LoyaltiesEarningRulesCreateResponseBody.md +1 -0
  38. data/docs/LoyaltiesEarningRulesCreateResponseBodyPendingPoints.md +9 -0
  39. data/docs/LoyaltiesEarningRulesDisableResponseBody.md +1 -0
  40. data/docs/LoyaltiesEarningRulesDisableResponseBodyPendingPoints.md +9 -0
  41. data/docs/LoyaltiesEarningRulesEnableResponseBody.md +1 -0
  42. data/docs/LoyaltiesEarningRulesEnableResponseBodyPendingPoints.md +9 -0
  43. data/docs/LoyaltiesEarningRulesGetResponseBody.md +1 -0
  44. data/docs/LoyaltiesEarningRulesGetResponseBodyPendingPoints.md +9 -0
  45. data/docs/LoyaltiesEarningRulesUpdateResponseBody.md +1 -0
  46. data/docs/LoyaltiesEarningRulesUpdateResponseBodyPendingPoints.md +9 -0
  47. data/docs/LoyaltiesMembersCreateResponseBodyLoyaltyCard.md +2 -1
  48. data/docs/LoyaltiesMembersGetResponseBodyLoyaltyCard.md +2 -1
  49. data/docs/LoyaltiesMembersPendingPointsActivateResponseBody.md +14 -0
  50. data/docs/LoyaltiesMembersPendingPointsActivateResponseBodyRelatedObject.md +9 -0
  51. data/docs/LoyaltiesMembersPendingPointsListResponseBody.md +12 -0
  52. data/docs/LoyaltiesMembersRedemptionRedeemResponseBodyVoucherLoyaltyCard.md +2 -1
  53. data/docs/LoyaltiesMembersTransfersCreateResponseBodyLoyaltyCard.md +2 -1
  54. data/docs/LoyaltiesPendingPointsListResponseBody.md +12 -0
  55. data/docs/LoyaltiesUpdateCampaignRequestBody.md +1 -0
  56. data/docs/LoyaltyCardTransactionDetails.md +2 -0
  57. data/docs/LoyaltyCardTransactionDetailsEarningRule.md +1 -1
  58. data/docs/LoyaltyCardTransactionDetailsHolderLoyaltyTier.md +9 -0
  59. data/docs/LoyaltyCardTransactionDetailsLoyaltyTier.md +2 -2
  60. data/docs/LoyaltyMemberLoyaltyCard.md +2 -1
  61. data/docs/LoyaltyPendingPoints.md +17 -0
  62. data/docs/LoyaltyPendingPointsDetails.md +12 -0
  63. data/docs/LoyaltyPendingPointsDetailsEarningRule.md +9 -0
  64. data/docs/LoyaltyPendingPointsDetailsEarningRuleSource.md +8 -0
  65. data/docs/LoyaltyPendingPointsDetailsEvent.md +14 -0
  66. data/docs/LoyaltyPendingPointsDetailsHolderLoyaltyTier.md +9 -0
  67. data/docs/LoyaltyPendingPointsDetailsLoyaltyTier.md +9 -0
  68. data/docs/LoyaltyPendingPointsDetailsOrder.md +9 -0
  69. data/docs/LoyaltyTierExpiration.md +1 -1
  70. data/docs/Order.md +2 -2
  71. data/docs/OrderCalculated.md +11 -11
  72. data/docs/OrderCalculatedItem.md +1 -0
  73. data/docs/OrderRedemptionsEntry.md +1 -1
  74. data/docs/OrdersCreateRequestBody.md +2 -2
  75. data/docs/OrdersCreateResponseBody.md +11 -11
  76. data/docs/OrdersGetResponseBody.md +11 -11
  77. data/docs/OrdersImportCreateRequestBodyItem.md +2 -2
  78. data/docs/OrdersUpdateRequestBody.md +2 -2
  79. data/docs/OrdersUpdateResponseBody.md +11 -11
  80. data/docs/ParameterOrderListPendingPoints.md +7 -0
  81. data/docs/RedeemableLoyaltyCard.md +1 -1
  82. data/docs/RedeemableVoucherLoyaltyCard.md +2 -1
  83. data/docs/RedemptionEntryOrder.md +11 -11
  84. data/docs/RedemptionEntryVoucherLoyaltyCard.md +2 -1
  85. data/docs/RedemptionVoucherLoyaltyCard.md +2 -1
  86. data/docs/RedemptionsGetResponseBodyOrder.md +11 -11
  87. data/docs/RedemptionsGetResponseBodyVoucherLoyaltyCard.md +2 -1
  88. data/docs/RedemptionsListResponseBodyRedemptionsItemOrder.md +11 -11
  89. data/docs/RedemptionsListResponseBodyRedemptionsItemVoucherLoyaltyCard.md +2 -1
  90. data/docs/SimpleLoyaltyCard.md +2 -1
  91. data/docs/TemplatesCampaignsCampaignSetupCreateRequestBody.md +1 -0
  92. data/docs/ValidationsValidateResponseBodyRedeemablesItemResultDiscount.md +1 -1
  93. data/docs/VoucherLoyaltyCard.md +2 -1
  94. data/docs/VoucherTransactionDetails.md +2 -0
  95. data/docs/VoucherTransactionDetailsCustomEvent.md +2 -2
  96. data/docs/VoucherTransactionDetailsEarningRule.md +1 -1
  97. data/docs/VoucherTransactionDetailsEventSchema.md +2 -2
  98. data/docs/VoucherTransactionDetailsHolderLoyaltyTier.md +9 -0
  99. data/docs/VoucherTransactionDetailsLoyaltyTier.md +2 -2
  100. data/docs/VoucherTransactionDetailsRollback.md +1 -1
  101. data/docs/VoucherTransactionDetailsSegment.md +2 -2
  102. data/docs/VoucherWithCategoriesLoyaltyCard.md +2 -1
  103. data/docs/VouchersCreateResponseBodyLoyaltyCard.md +2 -1
  104. data/docs/VouchersDisableResponseBodyLoyaltyCard.md +2 -1
  105. data/docs/VouchersEnableResponseBodyLoyaltyCard.md +2 -1
  106. data/docs/VouchersGetResponseBodyLoyaltyCard.md +2 -1
  107. data/docs/VouchersUpdateResponseBodyLoyaltyCard.md +2 -1
  108. data/lib/VoucherifySdk/api/bin_api.rb +4 -4
  109. data/lib/VoucherifySdk/api/loyalties_api.rb +334 -8
  110. data/lib/VoucherifySdk/models/access_settings.rb +219 -0
  111. data/lib/VoucherifySdk/models/access_settings_assign.rb +238 -0
  112. data/lib/VoucherifySdk/models/access_settings_unassign.rb +238 -0
  113. data/lib/VoucherifySdk/models/applicable_to.rb +16 -3
  114. data/lib/VoucherifySdk/models/applicable_to_order_item_units_item.rb +220 -0
  115. data/lib/VoucherifySdk/models/application_details_item.rb +284 -0
  116. data/lib/VoucherifySdk/models/area_store_campaign_assignment.rb +12 -1
  117. data/lib/VoucherifySdk/models/campaign.rb +13 -13
  118. data/lib/VoucherifySdk/models/campaign_base.rb +13 -4
  119. data/lib/VoucherifySdk/models/campaigns_create_request_body.rb +10 -1
  120. data/lib/VoucherifySdk/models/campaigns_create_response_body.rb +13 -13
  121. data/lib/VoucherifySdk/models/campaigns_get_response_body.rb +13 -13
  122. data/lib/VoucherifySdk/models/campaigns_update_request_body.rb +10 -1
  123. data/lib/VoucherifySdk/models/campaigns_update_response_body.rb +13 -13
  124. data/lib/VoucherifySdk/models/campaigns_vouchers_create_combined_response_body_loyalty_card.rb +17 -6
  125. data/lib/VoucherifySdk/models/campaigns_vouchers_create_response_body_loyalty_card.rb +17 -6
  126. data/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item_result_discount.rb +1 -0
  127. data/lib/VoucherifySdk/models/customer_loyalty.rb +1 -1
  128. data/lib/VoucherifySdk/models/discount.rb +1 -0
  129. data/lib/VoucherifySdk/models/discount_unit_multiple_one_unit.rb +1 -0
  130. data/lib/VoucherifySdk/models/earning_rule.rb +11 -1
  131. data/lib/VoucherifySdk/models/earning_rule_pending_points.rb +257 -0
  132. data/lib/VoucherifySdk/models/event_source.rb +254 -0
  133. data/lib/VoucherifySdk/models/event_source_api_key.rb +221 -0
  134. data/lib/VoucherifySdk/models/event_source_user.rb +210 -0
  135. data/lib/VoucherifySdk/models/inapplicable_to.rb +16 -3
  136. data/lib/VoucherifySdk/models/inapplicable_to_order_item_units_item.rb +220 -0
  137. data/lib/VoucherifySdk/models/loyalties_create_campaign_request_body.rb +10 -1
  138. data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body.rb +11 -1
  139. data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_pending_points.rb +257 -0
  140. data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body.rb +11 -1
  141. data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_pending_points.rb +257 -0
  142. data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body.rb +11 -1
  143. data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_pending_points.rb +257 -0
  144. data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body.rb +11 -1
  145. data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_pending_points.rb +257 -0
  146. data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body.rb +11 -1
  147. data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_pending_points.rb +257 -0
  148. data/lib/VoucherifySdk/models/loyalties_members_create_response_body_loyalty_card.rb +17 -6
  149. data/lib/VoucherifySdk/models/loyalties_members_get_response_body_loyalty_card.rb +17 -6
  150. data/lib/VoucherifySdk/models/loyalties_members_pending_points_activate_response_body.rb +309 -0
  151. data/lib/VoucherifySdk/models/loyalties_members_pending_points_activate_response_body_related_object.rb +247 -0
  152. data/lib/VoucherifySdk/models/loyalties_members_pending_points_list_response_body.rb +286 -0
  153. data/lib/VoucherifySdk/models/loyalties_members_redemption_redeem_response_body_voucher_loyalty_card.rb +17 -6
  154. data/lib/VoucherifySdk/models/loyalties_members_transfers_create_response_body_loyalty_card.rb +17 -6
  155. data/lib/VoucherifySdk/models/loyalties_pending_points_list_response_body.rb +286 -0
  156. data/lib/VoucherifySdk/models/loyalties_update_campaign_request_body.rb +10 -1
  157. data/lib/VoucherifySdk/models/loyalty_card_transaction_details.rb +20 -1
  158. data/lib/VoucherifySdk/models/loyalty_card_transaction_details_earning_rule.rb +1 -1
  159. data/lib/VoucherifySdk/models/loyalty_card_transaction_details_holder_loyalty_tier.rb +221 -0
  160. data/lib/VoucherifySdk/models/loyalty_card_transaction_details_loyalty_tier.rb +3 -1
  161. data/lib/VoucherifySdk/models/loyalty_card_transactions_type.rb +2 -1
  162. data/lib/VoucherifySdk/models/loyalty_member_loyalty_card.rb +17 -6
  163. data/lib/VoucherifySdk/models/loyalty_pending_points.rb +314 -0
  164. data/lib/VoucherifySdk/models/loyalty_pending_points_details.rb +249 -0
  165. data/lib/VoucherifySdk/models/loyalty_pending_points_details_earning_rule.rb +220 -0
  166. data/lib/VoucherifySdk/models/loyalty_pending_points_details_earning_rule_source.rb +210 -0
  167. data/lib/VoucherifySdk/models/loyalty_pending_points_details_event.rb +302 -0
  168. data/lib/VoucherifySdk/models/loyalty_pending_points_details_holder_loyalty_tier.rb +221 -0
  169. data/lib/VoucherifySdk/models/loyalty_pending_points_details_loyalty_tier.rb +221 -0
  170. data/lib/VoucherifySdk/models/loyalty_pending_points_details_order.rb +221 -0
  171. data/lib/VoucherifySdk/models/loyalty_tier_expiration.rb +1 -1
  172. data/lib/VoucherifySdk/models/order.rb +2 -2
  173. data/lib/VoucherifySdk/models/order_calculated.rb +28 -28
  174. data/lib/VoucherifySdk/models/order_calculated_item.rb +17 -5
  175. data/lib/VoucherifySdk/models/order_redemptions_entry.rb +1 -1
  176. data/lib/VoucherifySdk/models/orders_create_request_body.rb +2 -2
  177. data/lib/VoucherifySdk/models/orders_create_response_body.rb +28 -28
  178. data/lib/VoucherifySdk/models/orders_get_response_body.rb +28 -28
  179. data/lib/VoucherifySdk/models/orders_import_create_request_body_item.rb +2 -2
  180. data/lib/VoucherifySdk/models/orders_update_request_body.rb +2 -2
  181. data/lib/VoucherifySdk/models/orders_update_response_body.rb +28 -28
  182. data/lib/VoucherifySdk/models/parameter_order_list_pending_points.rb +40 -0
  183. data/lib/VoucherifySdk/models/qualifications_option.rb +3 -3
  184. data/lib/VoucherifySdk/models/redeemable_loyalty_card.rb +1 -1
  185. data/lib/VoucherifySdk/models/redeemable_voucher_loyalty_card.rb +17 -6
  186. data/lib/VoucherifySdk/models/redemption_entry_order.rb +28 -28
  187. data/lib/VoucherifySdk/models/redemption_entry_voucher_loyalty_card.rb +17 -6
  188. data/lib/VoucherifySdk/models/redemption_voucher_loyalty_card.rb +17 -6
  189. data/lib/VoucherifySdk/models/redemptions_get_response_body_order.rb +28 -28
  190. data/lib/VoucherifySdk/models/redemptions_get_response_body_voucher_loyalty_card.rb +17 -6
  191. data/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_order.rb +27 -28
  192. data/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_voucher_loyalty_card.rb +17 -6
  193. data/lib/VoucherifySdk/models/simple_loyalty_card.rb +17 -6
  194. data/lib/VoucherifySdk/models/templates_campaigns_campaign_setup_create_request_body.rb +10 -1
  195. data/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item_result_discount.rb +1 -0
  196. data/lib/VoucherifySdk/models/voucher_loyalty_card.rb +17 -6
  197. data/lib/VoucherifySdk/models/voucher_transaction.rb +1 -1
  198. data/lib/VoucherifySdk/models/voucher_transaction_details.rb +20 -1
  199. data/lib/VoucherifySdk/models/voucher_transaction_details_custom_event.rb +2 -2
  200. data/lib/VoucherifySdk/models/voucher_transaction_details_earning_rule.rb +1 -1
  201. data/lib/VoucherifySdk/models/voucher_transaction_details_event_schema.rb +2 -2
  202. data/lib/VoucherifySdk/models/voucher_transaction_details_holder_loyalty_tier.rb +221 -0
  203. data/lib/VoucherifySdk/models/voucher_transaction_details_loyalty_tier.rb +3 -1
  204. data/lib/VoucherifySdk/models/voucher_transaction_details_rollback.rb +1 -1
  205. data/lib/VoucherifySdk/models/voucher_transaction_details_segment.rb +2 -0
  206. data/lib/VoucherifySdk/models/voucher_with_categories_loyalty_card.rb +17 -6
  207. data/lib/VoucherifySdk/models/vouchers_create_response_body_loyalty_card.rb +17 -6
  208. data/lib/VoucherifySdk/models/vouchers_disable_response_body_loyalty_card.rb +17 -6
  209. data/lib/VoucherifySdk/models/vouchers_enable_response_body_loyalty_card.rb +17 -6
  210. data/lib/VoucherifySdk/models/vouchers_get_response_body_loyalty_card.rb +17 -6
  211. data/lib/VoucherifySdk/models/vouchers_update_response_body_loyalty_card.rb +17 -6
  212. data/lib/VoucherifySdk/version.rb +1 -1
  213. data/lib/VoucherifySdk.rb +30 -0
  214. metadata +96 -36
@@ -0,0 +1,286 @@
1
+ =begin
2
+ #Voucherify API
3
+
4
+ #Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details.
5
+
6
+ The version of the OpenAPI document: v2018-08-01
7
+ Contact: support@voucherify.io
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.0.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module VoucherifySdk
17
+ # Response body schema for **GET** `/loyalties/{campaignId}/members/{memberId}/pending-points` and **GET** `/loyalties/members/{memberId}/pending-points`.
18
+ class LoyaltiesMembersPendingPointsListResponseBody
19
+ # The type of the object represented by JSON.
20
+ attr_accessor :object
21
+
22
+ # Identifies the name of the attribute that contains the array of pending point objects.
23
+ attr_accessor :data_ref
24
+
25
+ # A dictionary that contains an array of pending point entries. Each entry in the array is a separate pending point object.
26
+ attr_accessor :data
27
+
28
+ # As query results are always limited (by the limit parameter), the `has_more` flag indicates if there are more records for given filter parameters. This lets you know if you can run another request to get more records returned in the results.
29
+ attr_accessor :has_more
30
+
31
+ # Returns an ID that can be used to return another page of results. Use the pending point entry ID in the `starting_after_id` query parameter to display another page of the results starting after the entry with that ID.
32
+ attr_accessor :more_starting_after
33
+
34
+ class EnumAttributeValidator
35
+ attr_reader :datatype
36
+ attr_reader :allowable_values
37
+
38
+ def initialize(datatype, allowable_values)
39
+ @allowable_values = allowable_values.map do |value|
40
+ case datatype.to_s
41
+ when /Integer/i
42
+ value.to_i
43
+ when /Float/i
44
+ value.to_f
45
+ else
46
+ value
47
+ end
48
+ end
49
+ end
50
+
51
+ def valid?(value)
52
+ !value || allowable_values.include?(value)
53
+ end
54
+ end
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'object' => :'object',
60
+ :'data_ref' => :'data_ref',
61
+ :'data' => :'data',
62
+ :'has_more' => :'has_more',
63
+ :'more_starting_after' => :'more_starting_after'
64
+ }
65
+ end
66
+
67
+ # Returns all the JSON keys this model knows about
68
+ def self.acceptable_attributes
69
+ attribute_map.values
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.openapi_types
74
+ {
75
+ :'object' => :'String',
76
+ :'data_ref' => :'String',
77
+ :'data' => :'Array<LoyaltyPendingPoints>',
78
+ :'has_more' => :'Boolean',
79
+ :'more_starting_after' => :'String'
80
+ }
81
+ end
82
+
83
+ # List of attributes with nullable: true
84
+ def self.openapi_nullable
85
+ Set.new([
86
+ :'object',
87
+ :'data_ref',
88
+ :'data',
89
+ :'has_more',
90
+ :'more_starting_after'
91
+ ])
92
+ end
93
+
94
+ # Initializes the object
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ def initialize(attributes = {})
97
+ # check to see if the attribute exists and convert string to symbol for hash key
98
+ attributes = attributes.each_with_object({}) { |(k, v), h|
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'object')
103
+ self.object = attributes[:'object']
104
+ else
105
+ self.object = 'list'
106
+ end
107
+
108
+ if attributes.key?(:'data_ref')
109
+ self.data_ref = attributes[:'data_ref']
110
+ else
111
+ self.data_ref = 'data'
112
+ end
113
+
114
+ if attributes.key?(:'data')
115
+ if (value = attributes[:'data']).is_a?(Array)
116
+ self.data = value
117
+ end
118
+ end
119
+
120
+ if attributes.key?(:'has_more')
121
+ self.has_more = attributes[:'has_more']
122
+ end
123
+
124
+ if attributes.key?(:'more_starting_after')
125
+ self.more_starting_after = attributes[:'more_starting_after']
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
133
+ invalid_properties = Array.new
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ object_validator = EnumAttributeValidator.new('String', ["list"])
142
+ return false unless object_validator.valid?(@object)
143
+ data_ref_validator = EnumAttributeValidator.new('String', ["data"])
144
+ return false unless data_ref_validator.valid?(@data_ref)
145
+ true
146
+ end
147
+
148
+ # Checks equality by comparing each attribute.
149
+ # @param [Object] Object to be compared
150
+ def ==(o)
151
+ return true if self.equal?(o)
152
+ self.class == o.class &&
153
+ object == o.object &&
154
+ data_ref == o.data_ref &&
155
+ data == o.data &&
156
+ has_more == o.has_more &&
157
+ more_starting_after == o.more_starting_after
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param [Object] Object to be compared
162
+ def eql?(o)
163
+ self == o
164
+ end
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Integer] Hash code
168
+ def hash
169
+ [object, data_ref, data, has_more, more_starting_after].hash
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def self.build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ attributes = attributes.transform_keys(&:to_sym)
178
+ transformed_hash = {}
179
+ openapi_types.each_pair do |key, type|
180
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
181
+ transformed_hash["#{key}"] = nil
182
+ elsif type =~ /\AArray<(.*)>/i
183
+ # check to ensure the input is an array given that the attribute
184
+ # is documented as an array but the input is not
185
+ if attributes[attribute_map[key]].is_a?(Array)
186
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
187
+ end
188
+ elsif !attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
190
+ end
191
+ end
192
+ new(transformed_hash)
193
+ end
194
+
195
+ # Deserializes the data based on type
196
+ # @param string type Data type
197
+ # @param string value Value to be deserialized
198
+ # @return [Object] Deserialized data
199
+ def self._deserialize(type, value)
200
+ case type.to_sym
201
+ when :Time
202
+ Time.parse(value)
203
+ when :Date
204
+ Date.parse(value)
205
+ when :String
206
+ value.to_s
207
+ when :Integer
208
+ value.to_i
209
+ when :Float
210
+ value.to_f
211
+ when :Boolean
212
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
213
+ true
214
+ else
215
+ false
216
+ end
217
+ when :Object
218
+ # generic object (usually a Hash), return directly
219
+ value
220
+ when /\AArray<(?<inner_type>.+)>\z/
221
+ inner_type = Regexp.last_match[:inner_type]
222
+ value.map { |v| _deserialize(inner_type, v) }
223
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
224
+ k_type = Regexp.last_match[:k_type]
225
+ v_type = Regexp.last_match[:v_type]
226
+ {}.tap do |hash|
227
+ value.each do |k, v|
228
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
229
+ end
230
+ end
231
+ else # model
232
+ # models (e.g. Pet) or oneOf
233
+ klass = VoucherifySdk.const_get(type)
234
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
235
+ end
236
+ end
237
+
238
+ # Returns the string representation of the object
239
+ # @return [String] String presentation of the object
240
+ def to_s
241
+ to_hash.to_s
242
+ end
243
+
244
+ # to_body is an alias to to_hash (backward compatibility)
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_body
247
+ to_hash
248
+ end
249
+
250
+ # Returns the object in the form of hash
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_hash
253
+ hash = {}
254
+ self.class.attribute_map.each_pair do |attr, param|
255
+ value = self.send(attr)
256
+ if value.nil?
257
+ is_nullable = self.class.openapi_nullable.include?(attr)
258
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
259
+ end
260
+
261
+ hash[param] = _to_hash(value)
262
+ end
263
+ hash
264
+ end
265
+
266
+ # Outputs non-array value in the form of hash
267
+ # For object, use to_hash. Otherwise, just return the value
268
+ # @param [Object] value Any valid value
269
+ # @return [Hash] Returns the value in the form of hash
270
+ def _to_hash(value)
271
+ if value.is_a?(Array)
272
+ value.compact.map { |v| _to_hash(v) }
273
+ elsif value.is_a?(Hash)
274
+ {}.tap do |hash|
275
+ value.each { |k, v| hash[k] = _to_hash(v) }
276
+ end
277
+ elsif value.respond_to? :to_hash
278
+ value.to_hash
279
+ else
280
+ value
281
+ end
282
+ end
283
+
284
+ end
285
+
286
+ end
@@ -16,7 +16,7 @@ require 'time'
16
16
  module VoucherifySdk
17
17
  # Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`.
18
18
  class LoyaltiesMembersRedemptionRedeemResponseBodyVoucherLoyaltyCard
19
- # Total points incurred over the lifespan of the loyalty card.
19
+ # Total points incurred over the lifespan of the loyalty card, minus the expired points.
20
20
  attr_accessor :points
21
21
 
22
22
  # Points available for reward redemption.
@@ -28,13 +28,17 @@ module VoucherifySdk
28
28
  # The amount of points that are set to expire next.
29
29
  attr_accessor :next_expiration_points
30
30
 
31
+ # Determines the number of pending points that will be added to the loyalty card after the predefined time.
32
+ attr_accessor :pending_points
33
+
31
34
  # Attribute mapping from ruby-style variable name to JSON key.
32
35
  def self.attribute_map
33
36
  {
34
37
  :'points' => :'points',
35
38
  :'balance' => :'balance',
36
39
  :'next_expiration_date' => :'next_expiration_date',
37
- :'next_expiration_points' => :'next_expiration_points'
40
+ :'next_expiration_points' => :'next_expiration_points',
41
+ :'pending_points' => :'pending_points'
38
42
  }
39
43
  end
40
44
 
@@ -49,7 +53,8 @@ module VoucherifySdk
49
53
  :'points' => :'Integer',
50
54
  :'balance' => :'Integer',
51
55
  :'next_expiration_date' => :'Date',
52
- :'next_expiration_points' => :'Integer'
56
+ :'next_expiration_points' => :'Integer',
57
+ :'pending_points' => :'Integer'
53
58
  }
54
59
  end
55
60
 
@@ -59,7 +64,8 @@ module VoucherifySdk
59
64
  :'points',
60
65
  :'balance',
61
66
  :'next_expiration_date',
62
- :'next_expiration_points'
67
+ :'next_expiration_points',
68
+ :'pending_points'
63
69
  ])
64
70
  end
65
71
 
@@ -86,6 +92,10 @@ module VoucherifySdk
86
92
  if attributes.key?(:'next_expiration_points')
87
93
  self.next_expiration_points = attributes[:'next_expiration_points']
88
94
  end
95
+
96
+ if attributes.key?(:'pending_points')
97
+ self.pending_points = attributes[:'pending_points']
98
+ end
89
99
  end
90
100
 
91
101
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -111,7 +121,8 @@ module VoucherifySdk
111
121
  points == o.points &&
112
122
  balance == o.balance &&
113
123
  next_expiration_date == o.next_expiration_date &&
114
- next_expiration_points == o.next_expiration_points
124
+ next_expiration_points == o.next_expiration_points &&
125
+ pending_points == o.pending_points
115
126
  end
116
127
 
117
128
  # @see the `==` method
@@ -123,7 +134,7 @@ module VoucherifySdk
123
134
  # Calculates hash code according to all attributes.
124
135
  # @return [Integer] Hash code
125
136
  def hash
126
- [points, balance, next_expiration_date, next_expiration_points].hash
137
+ [points, balance, next_expiration_date, next_expiration_points, pending_points].hash
127
138
  end
128
139
 
129
140
  # Builds the object from hash
@@ -16,7 +16,7 @@ require 'time'
16
16
  module VoucherifySdk
17
17
  # Object representing loyalty card parameters. Child attributes are present only if type is LOYALTY_CARD.
18
18
  class LoyaltiesMembersTransfersCreateResponseBodyLoyaltyCard
19
- # Total points incurred over the lifespan of the loyalty card.
19
+ # Total points incurred over the lifespan of the loyalty card, minus the expired points.
20
20
  attr_accessor :points
21
21
 
22
22
  # Points available for reward redemption.
@@ -28,13 +28,17 @@ module VoucherifySdk
28
28
  # The amount of points that are set to expire next.
29
29
  attr_accessor :next_expiration_points
30
30
 
31
+ # Determines the number of pending points that will be added to the loyalty card after the predefined time.
32
+ attr_accessor :pending_points
33
+
31
34
  # Attribute mapping from ruby-style variable name to JSON key.
32
35
  def self.attribute_map
33
36
  {
34
37
  :'points' => :'points',
35
38
  :'balance' => :'balance',
36
39
  :'next_expiration_date' => :'next_expiration_date',
37
- :'next_expiration_points' => :'next_expiration_points'
40
+ :'next_expiration_points' => :'next_expiration_points',
41
+ :'pending_points' => :'pending_points'
38
42
  }
39
43
  end
40
44
 
@@ -49,7 +53,8 @@ module VoucherifySdk
49
53
  :'points' => :'Integer',
50
54
  :'balance' => :'Integer',
51
55
  :'next_expiration_date' => :'String',
52
- :'next_expiration_points' => :'Integer'
56
+ :'next_expiration_points' => :'Integer',
57
+ :'pending_points' => :'Integer'
53
58
  }
54
59
  end
55
60
 
@@ -59,7 +64,8 @@ module VoucherifySdk
59
64
  :'points',
60
65
  :'balance',
61
66
  :'next_expiration_date',
62
- :'next_expiration_points'
67
+ :'next_expiration_points',
68
+ :'pending_points'
63
69
  ])
64
70
  end
65
71
 
@@ -86,6 +92,10 @@ module VoucherifySdk
86
92
  if attributes.key?(:'next_expiration_points')
87
93
  self.next_expiration_points = attributes[:'next_expiration_points']
88
94
  end
95
+
96
+ if attributes.key?(:'pending_points')
97
+ self.pending_points = attributes[:'pending_points']
98
+ end
89
99
  end
90
100
 
91
101
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -111,7 +121,8 @@ module VoucherifySdk
111
121
  points == o.points &&
112
122
  balance == o.balance &&
113
123
  next_expiration_date == o.next_expiration_date &&
114
- next_expiration_points == o.next_expiration_points
124
+ next_expiration_points == o.next_expiration_points &&
125
+ pending_points == o.pending_points
115
126
  end
116
127
 
117
128
  # @see the `==` method
@@ -123,7 +134,7 @@ module VoucherifySdk
123
134
  # Calculates hash code according to all attributes.
124
135
  # @return [Integer] Hash code
125
136
  def hash
126
- [points, balance, next_expiration_date, next_expiration_points].hash
137
+ [points, balance, next_expiration_date, next_expiration_points, pending_points].hash
127
138
  end
128
139
 
129
140
  # Builds the object from hash