voucherify 8.2.0 → 8.3.0

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 (252) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile +1 -1
  3. data/ENDPOINTS-COVERAGE.md +17 -15
  4. data/Gemfile.lock +9 -9
  5. data/README.md +12 -0
  6. data/__tests__/lib/campaigns.rb +2 -2
  7. data/__tests__/spec/snapshots/campaigns/created_validation_rule_applicable_to.snap +1 -1
  8. data/__tests__/spec/snapshots/campaigns/created_validation_rule_more_than.snap +1 -1
  9. data/docs/AccessSettingsAssign.md +3 -3
  10. data/docs/AccessSettingsProductCollectionAssignmentsList.md +11 -0
  11. data/docs/AccessSettingsUnassign.md +3 -3
  12. data/docs/ApplicableTo.md +1 -1
  13. data/docs/AreaStoreProductCollectionAssignment.md +14 -0
  14. data/docs/Campaign.md +2 -2
  15. data/docs/CampaignBase.md +2 -2
  16. data/docs/CampaignsApi.md +4 -4
  17. data/docs/CampaignsCreateRequestBody.md +2 -2
  18. data/docs/CampaignsCreateResponseBody.md +2 -2
  19. data/docs/CampaignsGetResponseBody.md +2 -2
  20. data/docs/CampaignsUpdateRequestBody.md +2 -2
  21. data/docs/CampaignsUpdateResponseBody.md +2 -2
  22. data/docs/CardDailyReportEntry.md +3 -1
  23. data/docs/CardLifetimeBucketPoints.md +2 -0
  24. data/docs/CustomerLoyalty.md +2 -2
  25. data/docs/CustomerLoyaltyCampaignsEntry.md +1 -1
  26. data/docs/CustomersApi.md +4 -4
  27. data/docs/InapplicableTo.md +1 -1
  28. data/docs/LV2BenefitsApi.md +1 -1
  29. data/docs/LV2EarningRulesApi.md +1 -1
  30. data/docs/LV2ExamineApi.md +2 -2
  31. data/docs/LV2ProgramsApi.md +44 -44
  32. data/docs/LV2RewardsApi.md +1 -1
  33. data/docs/ListPublicationsItemVoucher.md +1 -1
  34. data/docs/LoyaltiesApi.md +6 -6
  35. data/docs/LoyaltiesCreateCampaignRequestBody.md +2 -2
  36. data/docs/LoyaltiesCreateCampaignResponseBody.md +2 -2
  37. data/docs/LoyaltiesGetCampaignResponseBody.md +2 -2
  38. data/docs/LoyaltiesListMembersResponseBody.md +1 -1
  39. data/docs/LoyaltiesMembersRedemptionRedeemResponseBodyChannel.md +1 -1
  40. data/docs/LoyaltiesRewardAssignmentsGetResponseBody.md +2 -2
  41. data/docs/LoyaltiesRewardAssignmentsGetResponseBodyParametersLoyalty.md +1 -1
  42. data/docs/LoyaltiesRewardAssignmentsRewardGetResponseBody.md +1 -1
  43. data/docs/LoyaltiesRewardsCreateAssignmentResponseBody.md +2 -2
  44. data/docs/LoyaltiesRewardsCreateAssignmentResponseBodyParametersLoyalty.md +1 -1
  45. data/docs/LoyaltiesRewardsGetResponseBody.md +2 -2
  46. data/docs/LoyaltiesRewardsGetResponseBodyParametersLoyalty.md +1 -1
  47. data/docs/LoyaltiesRewardsUpdateAssignmentRequestBodyParametersLoyalty.md +1 -1
  48. data/docs/LoyaltiesRewardsUpdateAssignmentResponseBody.md +2 -2
  49. data/docs/LoyaltiesRewardsUpdateAssignmentResponseBodyParametersLoyalty.md +1 -1
  50. data/docs/LoyaltiesTiersListResponseBody.md +1 -1
  51. data/docs/LoyaltiesUpdateCampaignRequestBody.md +2 -2
  52. data/docs/LoyaltiesUpdateCampaignResponseBody.md +2 -2
  53. data/docs/LoyaltyCampaign.md +2 -2
  54. data/docs/LoyaltyV2ActivityBenefitStockLimited.md +1 -1
  55. data/docs/LoyaltyV2ActivityEarningRuleEffectPointsExpirationCalendarExpirationDate.md +1 -1
  56. data/docs/LoyaltyV2ActivityEarningRuleEffectPointsExpirationRollingExpirationRounding.md +1 -1
  57. data/docs/LoyaltyV2ActivityEarningRulePointsProportionalEvery.md +1 -1
  58. data/docs/LoyaltyV2ActivityEarningRulePointsProportionalMetadata.md +1 -1
  59. data/docs/ManagementApi.md +2 -2
  60. data/docs/ManagementProjectsCreateRequestBodyUsersItem.md +2 -2
  61. data/docs/ManagementProjectsUsersAssignRequestBody.md +2 -2
  62. data/docs/MetadataSchemasApi.md +1 -1
  63. data/docs/ProductCollectionsApi.md +4 -4
  64. data/docs/ProductCollectionsCreateRequestBody.md +1 -0
  65. data/docs/ProductCollectionsCreateResponseBody.md +2 -0
  66. data/docs/ProductCollectionsGetResponseBody.md +2 -0
  67. data/docs/ProductCollectionsItem.md +2 -0
  68. data/docs/ProductCollectionsListResponseBody.md +1 -1
  69. data/docs/ProductsApi.md +1 -1
  70. data/docs/RedemptionChannel.md +1 -1
  71. data/docs/RedemptionRewardResult.md +1 -1
  72. data/docs/RedemptionRewardResultParametersCoin.md +1 -1
  73. data/docs/Reward.md +1 -1
  74. data/docs/RewardAssignment.md +2 -2
  75. data/docs/RewardAssignmentParametersLoyalty.md +1 -1
  76. data/docs/RewardType.md +1 -0
  77. data/docs/RewardTypeCoin.md +2 -2
  78. data/docs/RewardTypeLoyaltyPoints.md +11 -0
  79. data/docs/RewardsApi.md +5 -5
  80. data/docs/RewardsAssignmentsCreateRequestBody.md +2 -0
  81. data/docs/RewardsAssignmentsCreateRequestBodyParametersLoyalty.md +1 -1
  82. data/docs/RewardsAssignmentsCreateResponseBody.md +2 -2
  83. data/docs/RewardsAssignmentsCreateResponseBodyParametersLoyalty.md +1 -1
  84. data/docs/RewardsAssignmentsGetResponseBody.md +2 -2
  85. data/docs/RewardsAssignmentsGetResponseBodyParametersLoyalty.md +1 -1
  86. data/docs/RewardsAssignmentsUpdateRequestBodyParametersLoyalty.md +1 -1
  87. data/docs/RewardsAssignmentsUpdateResponseBody.md +2 -2
  88. data/docs/RewardsAssignmentsUpdateResponseBodyParametersLoyalty.md +1 -1
  89. data/docs/RewardsCreateRequestBody.md +1 -0
  90. data/docs/RewardsCreateRequestBodyParameters.md +1 -0
  91. data/docs/RewardsCreateRequestBodyParametersCoin.md +1 -1
  92. data/docs/RewardsCreateRequestBodyParametersLoyaltyPoints.md +11 -0
  93. data/docs/RewardsCreateResponseBody.md +1 -1
  94. data/docs/RewardsUpdateRequestBodyParameters.md +1 -0
  95. data/docs/RewardsUpdateRequestBodyParametersCoin.md +1 -1
  96. data/docs/RewardsUpdateRequestBodyParametersLoyaltyPoints.md +11 -0
  97. data/docs/RewardsUpdateResponseBody.md +1 -1
  98. data/docs/TemplatesApi.md +1 -1
  99. data/docs/TemplatesCampaignsCampaignSetupCreateRequestBody.md +2 -2
  100. data/docs/V2LoyaltiesBenefitsGetResponseBody.md +1 -1
  101. data/docs/V2LoyaltiesBenefitsGetResponseBodyPoints.md +1 -1
  102. data/docs/V2LoyaltiesBenefitsGetResponseBodyPointsProportional.md +2 -2
  103. data/docs/V2LoyaltiesEarningRulesGetResponseBody.md +1 -1
  104. data/docs/VouchersApi.md +6 -6
  105. data/lib/VoucherifySdk/api/campaigns_api.rb +6 -6
  106. data/lib/VoucherifySdk/api/customers_api.rb +4 -4
  107. data/lib/VoucherifySdk/api/loyalties_api.rb +8 -8
  108. data/lib/VoucherifySdk/api/lv2_benefits_api.rb +2 -2
  109. data/lib/VoucherifySdk/api/lv2_earning_rules_api.rb +2 -2
  110. data/lib/VoucherifySdk/api/lv2_examine_api.rb +4 -4
  111. data/lib/VoucherifySdk/api/lv2_programs_api.rb +88 -88
  112. data/lib/VoucherifySdk/api/lv2_rewards_api.rb +2 -2
  113. data/lib/VoucherifySdk/api/management_api.rb +4 -4
  114. data/lib/VoucherifySdk/api/metadata_schemas_api.rb +2 -2
  115. data/lib/VoucherifySdk/api/product_collections_api.rb +8 -8
  116. data/lib/VoucherifySdk/api/products_api.rb +2 -2
  117. data/lib/VoucherifySdk/api/rewards_api.rb +8 -8
  118. data/lib/VoucherifySdk/api/templates_api.rb +2 -2
  119. data/lib/VoucherifySdk/api/vouchers_api.rb +12 -12
  120. data/lib/VoucherifySdk/models/access_settings.rb +1 -1
  121. data/lib/VoucherifySdk/models/access_settings_assign.rb +4 -4
  122. data/lib/VoucherifySdk/models/access_settings_product_collection_assignments_list.rb +280 -0
  123. data/lib/VoucherifySdk/models/access_settings_unassign.rb +4 -4
  124. data/lib/VoucherifySdk/models/applicable_to.rb +1 -1
  125. data/lib/VoucherifySdk/models/area_store_product_collection_assignment.rb +302 -0
  126. data/lib/VoucherifySdk/models/benefit_points_proportional_custom_event_metadata.rb +1 -1
  127. data/lib/VoucherifySdk/models/benefit_points_proportional_customer_metadata.rb +1 -1
  128. data/lib/VoucherifySdk/models/benefit_points_proportional_order_amount.rb +1 -1
  129. data/lib/VoucherifySdk/models/benefit_points_proportional_order_metadata.rb +1 -1
  130. data/lib/VoucherifySdk/models/benefit_points_proportional_order_total_amount.rb +1 -1
  131. data/lib/VoucherifySdk/models/campaign.rb +2 -2
  132. data/lib/VoucherifySdk/models/campaign_base.rb +2 -2
  133. data/lib/VoucherifySdk/models/campaign_loyalty_card.rb +1 -1
  134. data/lib/VoucherifySdk/models/campaign_loyalty_card_expiration_rules.rb +1 -1
  135. data/lib/VoucherifySdk/models/campaigns_create_request_body.rb +2 -2
  136. data/lib/VoucherifySdk/models/campaigns_create_response_body.rb +2 -2
  137. data/lib/VoucherifySdk/models/campaigns_get_response_body.rb +2 -2
  138. data/lib/VoucherifySdk/models/campaigns_update_request_body.rb +2 -2
  139. data/lib/VoucherifySdk/models/campaigns_update_response_body.rb +2 -2
  140. data/lib/VoucherifySdk/models/campaigns_vouchers_create_combined_response_body_loyalty_card.rb +1 -1
  141. data/lib/VoucherifySdk/models/campaigns_vouchers_create_response_body_loyalty_card.rb +1 -1
  142. data/lib/VoucherifySdk/models/card_daily_report_entry.rb +24 -2
  143. data/lib/VoucherifySdk/models/card_lifetime_bucket_points.rb +31 -5
  144. data/lib/VoucherifySdk/models/card_transaction.rb +1 -1
  145. data/lib/VoucherifySdk/models/client_events_create_request_body_loyalty.rb +1 -1
  146. data/lib/VoucherifySdk/models/customer_loyalty.rb +3 -2
  147. data/lib/VoucherifySdk/models/customer_loyalty_campaigns_entry.rb +2 -2
  148. data/lib/VoucherifySdk/models/customer_summary_redemptions_loyalty_card.rb +1 -1
  149. data/lib/VoucherifySdk/models/earning_rule.rb +1 -0
  150. data/lib/VoucherifySdk/models/events_create_request_body_loyalty.rb +1 -1
  151. data/lib/VoucherifySdk/models/inapplicable_to.rb +1 -1
  152. data/lib/VoucherifySdk/models/list_publications_item_voucher.rb +1 -1
  153. data/lib/VoucherifySdk/models/loyalties_create_campaign_request_body.rb +3 -3
  154. data/lib/VoucherifySdk/models/loyalties_create_campaign_response_body.rb +3 -3
  155. data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_custom_event.rb +1 -1
  156. data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_segment.rb +1 -1
  157. data/lib/VoucherifySdk/models/loyalties_earning_rules_list_response_body.rb +1 -1
  158. data/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body.rb +1 -0
  159. data/lib/VoucherifySdk/models/loyalties_get_campaign_response_body.rb +3 -3
  160. data/lib/VoucherifySdk/models/loyalties_list_campaigns_response_body.rb +1 -1
  161. data/lib/VoucherifySdk/models/loyalties_list_members_response_body.rb +1 -1
  162. data/lib/VoucherifySdk/models/loyalties_loyalty_tier_reward.rb +1 -1
  163. data/lib/VoucherifySdk/models/loyalties_members_create_response_body_loyalty_card.rb +1 -1
  164. data/lib/VoucherifySdk/models/loyalties_members_get_response_body_loyalty_card.rb +1 -1
  165. data/lib/VoucherifySdk/models/loyalties_members_redemption_redeem_response_body_channel.rb +1 -1
  166. data/lib/VoucherifySdk/models/loyalties_members_redemption_redeem_response_body_voucher_loyalty_card.rb +1 -1
  167. data/lib/VoucherifySdk/models/loyalties_members_transfers_create_response_body_loyalty_card.rb +1 -1
  168. data/lib/VoucherifySdk/models/loyalties_programs_members_benefits_transactions_list_request_query_benefit_id.rb +1 -1
  169. data/lib/VoucherifySdk/models/loyalties_reward_assignments_get_response_body.rb +3 -3
  170. data/lib/VoucherifySdk/models/loyalties_reward_assignments_get_response_body_parameters_loyalty.rb +1 -1
  171. data/lib/VoucherifySdk/models/loyalties_reward_assignments_reward_get_response_body.rb +2 -2
  172. data/lib/VoucherifySdk/models/loyalties_rewards_create_assignment_response_body.rb +3 -3
  173. data/lib/VoucherifySdk/models/loyalties_rewards_create_assignment_response_body_parameters_loyalty.rb +1 -1
  174. data/lib/VoucherifySdk/models/loyalties_rewards_get_response_body.rb +3 -3
  175. data/lib/VoucherifySdk/models/loyalties_rewards_get_response_body_parameters_loyalty.rb +1 -1
  176. data/lib/VoucherifySdk/models/loyalties_rewards_update_assignment_request_body_parameters_loyalty.rb +1 -1
  177. data/lib/VoucherifySdk/models/loyalties_rewards_update_assignment_response_body.rb +3 -3
  178. data/lib/VoucherifySdk/models/loyalties_rewards_update_assignment_response_body_parameters_loyalty.rb +1 -1
  179. data/lib/VoucherifySdk/models/loyalties_tiers_list_response_body.rb +1 -1
  180. data/lib/VoucherifySdk/models/loyalties_transfer_points.rb +1 -0
  181. data/lib/VoucherifySdk/models/loyalties_update_campaign_request_body.rb +3 -3
  182. data/lib/VoucherifySdk/models/loyalties_update_campaign_response_body.rb +3 -3
  183. data/lib/VoucherifySdk/models/loyalty_campaign.rb +3 -2
  184. data/lib/VoucherifySdk/models/loyalty_campaign_voucher.rb +1 -1
  185. data/lib/VoucherifySdk/models/loyalty_card_transaction_details_holder_loyalty_tier.rb +1 -1
  186. data/lib/VoucherifySdk/models/loyalty_card_transaction_details_loyalty_tier.rb +1 -1
  187. data/lib/VoucherifySdk/models/loyalty_member.rb +1 -1
  188. data/lib/VoucherifySdk/models/loyalty_member_loyalty_card.rb +1 -1
  189. data/lib/VoucherifySdk/models/loyalty_pending_points_details_holder_loyalty_tier.rb +1 -1
  190. data/lib/VoucherifySdk/models/loyalty_tier.rb +1 -0
  191. data/lib/VoucherifySdk/models/loyalty_tiers_expiration_all.rb +1 -1
  192. data/lib/VoucherifySdk/models/loyalty_v2_activity_benefit_stock_limited.rb +1 -1
  193. data/lib/VoucherifySdk/models/loyalty_v2_activity_earning_rule_effect_points_expiration_calendar_expiration_date.rb +1 -1
  194. data/lib/VoucherifySdk/models/loyalty_v2_activity_earning_rule_effect_points_expiration_rolling_expiration_rounding.rb +2 -2
  195. data/lib/VoucherifySdk/models/loyalty_v2_activity_earning_rule_points_proportional_every.rb +1 -1
  196. data/lib/VoucherifySdk/models/loyalty_v2_activity_earning_rule_points_proportional_metadata.rb +1 -1
  197. data/lib/VoucherifySdk/models/management_projects_create_request_body_users_item.rb +2 -2
  198. data/lib/VoucherifySdk/models/management_projects_users_assign_request_body.rb +2 -2
  199. data/lib/VoucherifySdk/models/member_activity.rb +1 -1
  200. data/lib/VoucherifySdk/models/parameter_filters_list_customer_redeemables_campaign_type.rb +1 -1
  201. data/lib/VoucherifySdk/models/product_collections_create_request_body.rb +10 -1
  202. data/lib/VoucherifySdk/models/product_collections_create_response_body.rb +21 -1
  203. data/lib/VoucherifySdk/models/product_collections_get_response_body.rb +21 -1
  204. data/lib/VoucherifySdk/models/product_collections_item.rb +21 -1
  205. data/lib/VoucherifySdk/models/product_collections_list_response_body.rb +1 -1
  206. data/lib/VoucherifySdk/models/redeemable_voucher_loyalty_card.rb +1 -1
  207. data/lib/VoucherifySdk/models/redemption_channel.rb +1 -1
  208. data/lib/VoucherifySdk/models/redemption_reward_result.rb +2 -2
  209. data/lib/VoucherifySdk/models/redemption_reward_result_parameters_coin.rb +2 -2
  210. data/lib/VoucherifySdk/models/redemption_voucher_loyalty_card.rb +1 -1
  211. data/lib/VoucherifySdk/models/reward.rb +2 -2
  212. data/lib/VoucherifySdk/models/reward_assignment.rb +3 -3
  213. data/lib/VoucherifySdk/models/reward_assignment_parameters_loyalty.rb +1 -1
  214. data/lib/VoucherifySdk/models/reward_type.rb +15 -5
  215. data/lib/VoucherifySdk/models/reward_type_coin.rb +3 -3
  216. data/lib/VoucherifySdk/models/reward_type_loyalty_points.rb +284 -0
  217. data/lib/VoucherifySdk/models/rewards_assignments_create_request_body.rb +50 -5
  218. data/lib/VoucherifySdk/models/rewards_assignments_create_request_body_parameters_loyalty.rb +1 -1
  219. data/lib/VoucherifySdk/models/rewards_assignments_create_response_body.rb +3 -3
  220. data/lib/VoucherifySdk/models/rewards_assignments_create_response_body_parameters_loyalty.rb +1 -1
  221. data/lib/VoucherifySdk/models/rewards_assignments_get_response_body.rb +3 -3
  222. data/lib/VoucherifySdk/models/rewards_assignments_get_response_body_parameters_loyalty.rb +1 -1
  223. data/lib/VoucherifySdk/models/rewards_assignments_update_request_body_parameters_loyalty.rb +1 -1
  224. data/lib/VoucherifySdk/models/rewards_assignments_update_response_body.rb +3 -3
  225. data/lib/VoucherifySdk/models/rewards_assignments_update_response_body_parameters_loyalty.rb +1 -1
  226. data/lib/VoucherifySdk/models/rewards_create_request_body.rb +35 -1
  227. data/lib/VoucherifySdk/models/rewards_create_request_body_parameters.rb +15 -5
  228. data/lib/VoucherifySdk/models/rewards_create_request_body_parameters_coin.rb +2 -2
  229. data/lib/VoucherifySdk/models/rewards_create_request_body_parameters_loyalty_points.rb +284 -0
  230. data/lib/VoucherifySdk/models/rewards_create_response_body.rb +2 -2
  231. data/lib/VoucherifySdk/models/rewards_update_request_body_parameters.rb +15 -5
  232. data/lib/VoucherifySdk/models/rewards_update_request_body_parameters_coin.rb +2 -2
  233. data/lib/VoucherifySdk/models/rewards_update_request_body_parameters_loyalty_points.rb +284 -0
  234. data/lib/VoucherifySdk/models/rewards_update_response_body.rb +2 -2
  235. data/lib/VoucherifySdk/models/simple_loyalty_card.rb +1 -1
  236. data/lib/VoucherifySdk/models/templates_campaigns_campaign_setup_create_request_body.rb +2 -2
  237. data/lib/VoucherifySdk/models/v2_loyalties_benefits_get_response_body.rb +1 -1
  238. data/lib/VoucherifySdk/models/v2_loyalties_benefits_get_response_body_points.rb +1 -1
  239. data/lib/VoucherifySdk/models/v2_loyalties_benefits_get_response_body_points_proportional.rb +3 -3
  240. data/lib/VoucherifySdk/models/v2_loyalties_earning_rules_get_response_body.rb +2 -2
  241. data/lib/VoucherifySdk/models/voucher_loyalty_card.rb +1 -1
  242. data/lib/VoucherifySdk/models/voucher_transaction_details_holder_loyalty_tier.rb +1 -1
  243. data/lib/VoucherifySdk/models/voucher_transaction_details_loyalty_tier.rb +1 -1
  244. data/lib/VoucherifySdk/models/voucher_with_categories_loyalty_card.rb +1 -1
  245. data/lib/VoucherifySdk/models/vouchers_create_response_body_loyalty_card.rb +1 -1
  246. data/lib/VoucherifySdk/models/vouchers_disable_response_body_loyalty_card.rb +1 -1
  247. data/lib/VoucherifySdk/models/vouchers_enable_response_body_loyalty_card.rb +1 -1
  248. data/lib/VoucherifySdk/models/vouchers_get_response_body_loyalty_card.rb +1 -1
  249. data/lib/VoucherifySdk/models/vouchers_update_response_body_loyalty_card.rb +1 -1
  250. data/lib/VoucherifySdk/version.rb +1 -1
  251. data/lib/VoucherifySdk.rb +5 -0
  252. metadata +39 -29
@@ -18,16 +18,45 @@ module VoucherifySdk
18
18
  # The campaign ID of the campaign to which the reward is to be assigned.
19
19
  attr_accessor :campaign
20
20
 
21
+ attr_accessor :related_object_type
22
+
21
23
  attr_accessor :parameters
22
24
 
23
25
  attr_accessor :validation_rules
24
26
 
27
+ # Unique referral tier ID, assigned by Voucherify.
28
+ attr_accessor :related_object_id
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
25
52
  # Attribute mapping from ruby-style variable name to JSON key.
26
53
  def self.attribute_map
27
54
  {
28
55
  :'campaign' => :'campaign',
56
+ :'related_object_type' => :'related_object_type',
29
57
  :'parameters' => :'parameters',
30
- :'validation_rules' => :'validation_rules'
58
+ :'validation_rules' => :'validation_rules',
59
+ :'related_object_id' => :'related_object_id'
31
60
  }
32
61
  end
33
62
 
@@ -40,8 +69,10 @@ module VoucherifySdk
40
69
  def self.openapi_types
41
70
  {
42
71
  :'campaign' => :'String',
72
+ :'related_object_type' => :'String',
43
73
  :'parameters' => :'RewardsAssignmentsCreateRequestBodyParameters',
44
- :'validation_rules' => :'Array<String>'
74
+ :'validation_rules' => :'Array<String>',
75
+ :'related_object_id' => :'String'
45
76
  }
46
77
  end
47
78
 
@@ -49,8 +80,10 @@ module VoucherifySdk
49
80
  def self.openapi_nullable
50
81
  Set.new([
51
82
  :'campaign',
83
+ :'related_object_type',
52
84
  :'parameters',
53
- :'validation_rules'
85
+ :'validation_rules',
86
+ :'related_object_id'
54
87
  ])
55
88
  end
56
89
 
@@ -66,6 +99,10 @@ module VoucherifySdk
66
99
  self.campaign = attributes[:'campaign']
67
100
  end
68
101
 
102
+ if attributes.key?(:'related_object_type')
103
+ self.related_object_type = attributes[:'related_object_type']
104
+ end
105
+
69
106
  if attributes.key?(:'parameters')
70
107
  self.parameters = attributes[:'parameters']
71
108
  end
@@ -75,6 +112,10 @@ module VoucherifySdk
75
112
  self.validation_rules = value
76
113
  end
77
114
  end
115
+
116
+ if attributes.key?(:'related_object_id')
117
+ self.related_object_id = attributes[:'related_object_id']
118
+ end
78
119
  end
79
120
 
80
121
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -89,6 +130,8 @@ module VoucherifySdk
89
130
  # @return true if the model is valid
90
131
  def valid?
91
132
  warn '[DEPRECATED] the `valid?` method is obsolete'
133
+ related_object_type_validator = EnumAttributeValidator.new('String', ["campaign", "referral_tier"])
134
+ return false unless related_object_type_validator.valid?(@related_object_type)
92
135
  true
93
136
  end
94
137
 
@@ -98,8 +141,10 @@ module VoucherifySdk
98
141
  return true if self.equal?(o)
99
142
  self.class == o.class &&
100
143
  campaign == o.campaign &&
144
+ related_object_type == o.related_object_type &&
101
145
  parameters == o.parameters &&
102
- validation_rules == o.validation_rules
146
+ validation_rules == o.validation_rules &&
147
+ related_object_id == o.related_object_id
103
148
  end
104
149
 
105
150
  # @see the `==` method
@@ -111,7 +156,7 @@ module VoucherifySdk
111
156
  # Calculates hash code according to all attributes.
112
157
  # @return [Integer] Hash code
113
158
  def hash
114
- [campaign, parameters, validation_rules].hash
159
+ [campaign, related_object_type, parameters, validation_rules, related_object_id].hash
115
160
  end
116
161
 
117
162
  # Builds the object from hash
@@ -19,7 +19,7 @@ module VoucherifySdk
19
19
  # Number of points that will be subtracted from the loyalty card points balance if the reward is redeemed. Must be positive integer.
20
20
  attr_accessor :points
21
21
 
22
- # Determines if the reward is redeemed automatically when the customer reaches the sufficient number of points to redeem it. Value `true` means that the automatic reward redemption is active. Only one reward can be set to be redeemed automatically in a loyalty campaign, i.e. only one can have the value `true`.
22
+ # Determines if the reward is redeemed automatically when the customer reaches the sufficient number of points to redeem it. Value `true` means that the automatic reward redemption is active. Only one reward can be set to be redeemed automatically in a **legacy loyalty** campaign, i.e. only one can have the value `true`.
23
23
  attr_accessor :auto_redeem
24
24
 
25
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -31,10 +31,10 @@ module VoucherifySdk
31
31
  # The type of the object represented by the JSON. This object stores information about the reward assignment.
32
32
  attr_accessor :object
33
33
 
34
- # Related object ID to which the reward was assigned.
34
+ # Related object ID to which the reward was assigned. For `related_object_type` `campaign`, this is the campaign ID. For `referral_tier`, this is the referral tier ID.
35
35
  attr_accessor :related_object_id
36
36
 
37
- # Related object type to which the reward was assigned.
37
+ # Related object type to which the reward was assigned. Use `campaign` for **legacy loyalty** campaign rewards. Use `referral_tier` for `LOYALTY_POINTS` rewards that credit a `v2/loyalties` (loyalty hub) card from a referral tier. A `LOYALTY_POINTS` reward can only be assigned to a referral tier.
38
38
  attr_accessor :related_object_type
39
39
 
40
40
  attr_accessor :parameters
@@ -167,7 +167,7 @@ module VoucherifySdk
167
167
  warn '[DEPRECATED] the `valid?` method is obsolete'
168
168
  object_validator = EnumAttributeValidator.new('String', ["reward_assignment"])
169
169
  return false unless object_validator.valid?(@object)
170
- related_object_type_validator = EnumAttributeValidator.new('String', ["campaign"])
170
+ related_object_type_validator = EnumAttributeValidator.new('String', ["campaign", "referral_tier"])
171
171
  return false unless related_object_type_validator.valid?(@related_object_type)
172
172
  true
173
173
  end
@@ -19,7 +19,7 @@ module VoucherifySdk
19
19
  # The number of points required to redeem the reward.
20
20
  attr_accessor :points
21
21
 
22
- # Determines if the reward is redeemed automatically when the customer reaches the sufficient number of points to redeem it. Value `true` means that the automatic reward redemption is active. Only one reward can be set to be redeemed automatically in a loyalty campaign, i.e. only one can have the value `true`.
22
+ # Determines if the reward is redeemed automatically when the customer reaches the sufficient number of points to redeem it. Value `true` means that the automatic reward redemption is active. Only one reward can be set to be redeemed automatically in a **legacy loyalty** campaign, i.e. only one can have the value `true`.
23
23
  attr_accessor :auto_redeem
24
24
 
25
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -31,10 +31,10 @@ module VoucherifySdk
31
31
  # The type of the object represented by the JSON. This object stores information about the reward assignment.
32
32
  attr_accessor :object
33
33
 
34
- # Related object ID to which the reward was assigned.
34
+ # Related object ID to which the reward was assigned. For `related_object_type` `campaign`, this is the campaign ID. For `referral_tier`, this is the referral tier ID.
35
35
  attr_accessor :related_object_id
36
36
 
37
- # Related object type to which the reward was assigned.
37
+ # Related object type to which the reward was assigned. Use `campaign` for **legacy loyalty** campaign rewards. Use `referral_tier` for `LOYALTY_POINTS` rewards that credit a `v2/loyalties` (loyalty hub) card from a referral tier. A `LOYALTY_POINTS` reward can only be assigned to a referral tier.
38
38
  attr_accessor :related_object_type
39
39
 
40
40
  attr_accessor :parameters
@@ -167,7 +167,7 @@ module VoucherifySdk
167
167
  warn '[DEPRECATED] the `valid?` method is obsolete'
168
168
  object_validator = EnumAttributeValidator.new('String', ["reward_assignment"])
169
169
  return false unless object_validator.valid?(@object)
170
- related_object_type_validator = EnumAttributeValidator.new('String', ["campaign"])
170
+ related_object_type_validator = EnumAttributeValidator.new('String', ["campaign", "referral_tier"])
171
171
  return false unless related_object_type_validator.valid?(@related_object_type)
172
172
  true
173
173
  end
@@ -19,7 +19,7 @@ module VoucherifySdk
19
19
  # The number of points required to redeem the reward.
20
20
  attr_accessor :points
21
21
 
22
- # Determines if the reward is redeemed automatically when the customer reaches the sufficient number of points to redeem it. Value `true` means that the automatic reward redemption is active. Only one reward can be set to be redeemed automatically in a loyalty campaign, i.e. only one can have the value `true`.
22
+ # Determines if the reward is redeemed automatically when the customer reaches the sufficient number of points to redeem it. Value `true` means that the automatic reward redemption is active. Only one reward can be set to be redeemed automatically in a **legacy loyalty** campaign, i.e. only one can have the value `true`.
23
23
  attr_accessor :auto_redeem
24
24
 
25
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -19,7 +19,7 @@ module VoucherifySdk
19
19
  # Defines how many points are required to obtain the reward.
20
20
  attr_accessor :points
21
21
 
22
- # Determines if the reward is redeemed automatically when the customer reaches the sufficient number of points to redeem it. Value `true` means that the automatic reward redemption is active. Only one reward can be set to be redeemed automatically in a loyalty campaign, i.e. only one can have the value `true`.
22
+ # Determines if the reward is redeemed automatically when the customer reaches the sufficient number of points to redeem it. Value `true` means that the automatic reward redemption is active. Only one reward can be set to be redeemed automatically in a **legacy loyalty** campaign, i.e. only one can have the value `true`.
23
23
  attr_accessor :auto_redeem
24
24
 
25
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -31,10 +31,10 @@ module VoucherifySdk
31
31
  # The type of the object represented by the JSON. This object stores information about the reward assignment.
32
32
  attr_accessor :object
33
33
 
34
- # Related object ID to which the reward was assigned.
34
+ # Related object ID to which the reward was assigned. For `related_object_type` `campaign`, this is the campaign ID. For `referral_tier`, this is the referral tier ID.
35
35
  attr_accessor :related_object_id
36
36
 
37
- # Related object type to which the reward was assigned.
37
+ # Related object type to which the reward was assigned. Use `campaign` for **legacy loyalty** campaign rewards. Use `referral_tier` for `LOYALTY_POINTS` rewards that credit a `v2/loyalties` (loyalty hub) card from a referral tier. A `LOYALTY_POINTS` reward can only be assigned to a referral tier.
38
38
  attr_accessor :related_object_type
39
39
 
40
40
  attr_accessor :parameters
@@ -167,7 +167,7 @@ module VoucherifySdk
167
167
  warn '[DEPRECATED] the `valid?` method is obsolete'
168
168
  object_validator = EnumAttributeValidator.new('String', ["reward_assignment"])
169
169
  return false unless object_validator.valid?(@object)
170
- related_object_type_validator = EnumAttributeValidator.new('String', ["campaign"])
170
+ related_object_type_validator = EnumAttributeValidator.new('String', ["campaign", "referral_tier"])
171
171
  return false unless related_object_type_validator.valid?(@related_object_type)
172
172
  true
173
173
  end
@@ -19,7 +19,7 @@ module VoucherifySdk
19
19
  # The number of points required to redeem the reward.
20
20
  attr_accessor :points
21
21
 
22
- # Determines if the reward is redeemed automatically when the customer reaches the sufficient number of points to redeem it. Value `true` means that the automatic reward redemption is active. Only one reward can be set to be redeemed automatically in a loyalty campaign, i.e. only one can have the value `true`.
22
+ # Determines if the reward is redeemed automatically when the customer reaches the sufficient number of points to redeem it. Value `true` means that the automatic reward redemption is active. Only one reward can be set to be redeemed automatically in a **legacy loyalty** campaign, i.e. only one can have the value `true`.
23
23
  attr_accessor :auto_redeem
24
24
 
25
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -18,6 +18,8 @@ module VoucherifySdk
18
18
  # Reward name.
19
19
  attr_accessor :name
20
20
 
21
+ attr_accessor :type
22
+
21
23
  attr_accessor :parameters
22
24
 
23
25
  # The metadata object stores all custom attributes assigned to the reward. A set of key/value pairs that you can attach to a reward object. It can be useful for storing additional information about the reward in a structured format.
@@ -28,10 +30,33 @@ module VoucherifySdk
28
30
 
29
31
  attr_accessor :attributes
30
32
 
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
31
55
  # Attribute mapping from ruby-style variable name to JSON key.
32
56
  def self.attribute_map
33
57
  {
34
58
  :'name' => :'name',
59
+ :'type' => :'type',
35
60
  :'parameters' => :'parameters',
36
61
  :'metadata' => :'metadata',
37
62
  :'stock' => :'stock',
@@ -48,6 +73,7 @@ module VoucherifySdk
48
73
  def self.openapi_types
49
74
  {
50
75
  :'name' => :'String',
76
+ :'type' => :'String',
51
77
  :'parameters' => :'RewardsCreateRequestBodyParameters',
52
78
  :'metadata' => :'Object',
53
79
  :'stock' => :'Integer',
@@ -59,6 +85,7 @@ module VoucherifySdk
59
85
  def self.openapi_nullable
60
86
  Set.new([
61
87
  :'name',
88
+ :'type',
62
89
  :'parameters',
63
90
  :'metadata',
64
91
  :'stock',
@@ -78,6 +105,10 @@ module VoucherifySdk
78
105
  self.name = attributes[:'name']
79
106
  end
80
107
 
108
+ if attributes.key?(:'type')
109
+ self.type = attributes[:'type']
110
+ end
111
+
81
112
  if attributes.key?(:'parameters')
82
113
  self.parameters = attributes[:'parameters']
83
114
  end
@@ -107,6 +138,8 @@ module VoucherifySdk
107
138
  # @return true if the model is valid
108
139
  def valid?
109
140
  warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ type_validator = EnumAttributeValidator.new('String', ["CAMPAIGN", "MATERIAL", "COIN", "LOYALTY_POINTS"])
142
+ return false unless type_validator.valid?(@type)
110
143
  true
111
144
  end
112
145
 
@@ -116,6 +149,7 @@ module VoucherifySdk
116
149
  return true if self.equal?(o)
117
150
  self.class == o.class &&
118
151
  name == o.name &&
152
+ type == o.type &&
119
153
  parameters == o.parameters &&
120
154
  metadata == o.metadata &&
121
155
  stock == o.stock &&
@@ -131,7 +165,7 @@ module VoucherifySdk
131
165
  # Calculates hash code according to all attributes.
132
166
  # @return [Integer] Hash code
133
167
  def hash
134
- [name, parameters, metadata, stock, attributes].hash
168
+ [name, type, parameters, metadata, stock, attributes].hash
135
169
  end
136
170
 
137
171
  # Builds the object from hash
@@ -21,12 +21,15 @@ module VoucherifySdk
21
21
 
22
22
  attr_accessor :coin
23
23
 
24
+ attr_accessor :loyalty_points
25
+
24
26
  # Attribute mapping from ruby-style variable name to JSON key.
25
27
  def self.attribute_map
26
28
  {
27
29
  :'campaign' => :'campaign',
28
30
  :'product' => :'product',
29
- :'coin' => :'coin'
31
+ :'coin' => :'coin',
32
+ :'loyalty_points' => :'loyalty_points'
30
33
  }
31
34
  end
32
35
 
@@ -40,7 +43,8 @@ module VoucherifySdk
40
43
  {
41
44
  :'campaign' => :'RewardsCreateRequestBodyParametersCampaign',
42
45
  :'product' => :'RewardsCreateRequestBodyParametersProduct',
43
- :'coin' => :'RewardsCreateRequestBodyParametersCoin'
46
+ :'coin' => :'RewardsCreateRequestBodyParametersCoin',
47
+ :'loyalty_points' => :'RewardsCreateRequestBodyParametersLoyaltyPoints'
44
48
  }
45
49
  end
46
50
 
@@ -49,7 +53,8 @@ module VoucherifySdk
49
53
  Set.new([
50
54
  :'campaign',
51
55
  :'product',
52
- :'coin'
56
+ :'coin',
57
+ :'loyalty_points'
53
58
  ])
54
59
  end
55
60
 
@@ -72,6 +77,10 @@ module VoucherifySdk
72
77
  if attributes.key?(:'coin')
73
78
  self.coin = attributes[:'coin']
74
79
  end
80
+
81
+ if attributes.key?(:'loyalty_points')
82
+ self.loyalty_points = attributes[:'loyalty_points']
83
+ end
75
84
  end
76
85
 
77
86
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -96,7 +105,8 @@ module VoucherifySdk
96
105
  self.class == o.class &&
97
106
  campaign == o.campaign &&
98
107
  product == o.product &&
99
- coin == o.coin
108
+ coin == o.coin &&
109
+ loyalty_points == o.loyalty_points
100
110
  end
101
111
 
102
112
  # @see the `==` method
@@ -108,7 +118,7 @@ module VoucherifySdk
108
118
  # Calculates hash code according to all attributes.
109
119
  # @return [Integer] Hash code
110
120
  def hash
111
- [campaign, product, coin].hash
121
+ [campaign, product, coin, loyalty_points].hash
112
122
  end
113
123
 
114
124
  # Builds the object from hash
@@ -14,12 +14,12 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module VoucherifySdk
17
- # Define the ratio by mapping the number of loyalty points in `points_ratio` to a predefined cash amount in `exchange_ratio`.
17
+ # Define the ratio by mapping the number of loyalty points (**legacy loyalty**) in `points_ratio` to a predefined cash amount in `exchange_ratio`.
18
18
  class RewardsCreateRequestBodyParametersCoin
19
19
  # The cash equivalent of the points defined in the `points_ratio` property.
20
20
  attr_accessor :exchange_ratio
21
21
 
22
- # The number of loyalty points that will map to the predefined cash amount defined by the `exchange_ratio` property.
22
+ # The number of loyalty points (**legacy loyalty**) that will map to the predefined cash amount defined by the `exchange_ratio` property.
23
23
  attr_accessor :points_ratio
24
24
 
25
25
  # Attribute mapping from ruby-style variable name to JSON key.