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,221 @@
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
+ # Loyalty tier of the loyalty card holder at the moment when the transaction occurred. The loyalty tier is the tier in which the holder was before the loyalty point balance changed.
18
+ class VoucherTransactionDetailsHolderLoyaltyTier
19
+ # Unique identifier of the loyalty tier, assigned by Voucherify.
20
+ attr_accessor :id
21
+
22
+ # User-defined name of the loyalty tier.
23
+ attr_accessor :name
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'id' => :'id',
29
+ :'name' => :'name'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'id' => :'String',
42
+ :'name' => :'String'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ :'id',
50
+ :'name'
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ h[k.to_sym] = v
60
+ }
61
+
62
+ if attributes.key?(:'id')
63
+ self.id = attributes[:'id']
64
+ end
65
+
66
+ if attributes.key?(:'name')
67
+ self.name = attributes[:'name']
68
+ end
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properties with the reasons
73
+ def list_invalid_properties
74
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
75
+ invalid_properties = Array.new
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ warn '[DEPRECATED] the `valid?` method is obsolete'
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ id == o.id &&
92
+ name == o.name
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [id, name].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ attributes = attributes.transform_keys(&:to_sym)
113
+ transformed_hash = {}
114
+ openapi_types.each_pair do |key, type|
115
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = nil
117
+ elsif type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[attribute_map[key]].is_a?(Array)
121
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
122
+ end
123
+ elsif !attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
125
+ end
126
+ end
127
+ new(transformed_hash)
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def self._deserialize(type, value)
135
+ case type.to_sym
136
+ when :Time
137
+ Time.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :Boolean
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ # models (e.g. Pet) or oneOf
168
+ klass = VoucherifySdk.const_get(type)
169
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ if value.nil?
192
+ is_nullable = self.class.openapi_nullable.include?(attr)
193
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
+ end
195
+
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+
219
+ end
220
+
221
+ end
@@ -14,10 +14,12 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module VoucherifySdk
17
- # Contains information about the loyalty tier.
17
+ # Contains information about the loyalty tier that is mapped for the earning rule and used in the transaction.
18
18
  class VoucherTransactionDetailsLoyaltyTier
19
+ # Unique identifier of the loyalty tier, assigned by Voucherify.
19
20
  attr_accessor :id
20
21
 
22
+ # User-defined name of the loyalty tier.
21
23
  attr_accessor :name
22
24
 
23
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -16,7 +16,7 @@ require 'time'
16
16
  module VoucherifySdk
17
17
  # Contains information about the redemption rollback.
18
18
  class VoucherTransactionDetailsRollback
19
- # Unique redemption rollback ID.
19
+ # Unique identifier of the redemption rollback.
20
20
  attr_accessor :id
21
21
 
22
22
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -16,8 +16,10 @@ require 'time'
16
16
  module VoucherifySdk
17
17
  # Contains information about the segment.
18
18
  class VoucherTransactionDetailsSegment
19
+ # Unique identifier of the segment.
19
20
  attr_accessor :id
20
21
 
22
+ # Name of the segment.
21
23
  attr_accessor :name
22
24
 
23
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -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 VoucherWithCategoriesLoyaltyCard
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`. Defaults to `null`.
18
18
  class VouchersCreateResponseBodyLoyaltyCard
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`. Defaults to `null`.
18
18
  class VouchersDisableResponseBodyLoyaltyCard
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`. Defaults to `null`.
18
18
  class VouchersEnableResponseBodyLoyaltyCard
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`. Defaults to `null`.
18
18
  class VouchersGetResponseBodyLoyaltyCard
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