voucherify 8.0.1 → 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 (289) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile +1 -1
  3. data/ENDPOINTS-COVERAGE.md +69 -60
  4. data/Gemfile.lock +9 -7
  5. data/README.md +55 -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 +3 -3
  16. data/docs/CampaignBase.md +3 -2
  17. data/docs/CampaignsApi.md +3 -3
  18. data/docs/CampaignsCreateRequestBody.md +2 -1
  19. data/docs/CampaignsCreateResponseBody.md +3 -3
  20. data/docs/CampaignsGetResponseBody.md +3 -3
  21. data/docs/CampaignsUpdateRequestBody.md +3 -2
  22. data/docs/CampaignsUpdateResponseBody.md +3 -3
  23. data/docs/CampaignsVouchersCreateCombinedResponseBodyLoyaltyCard.md +2 -1
  24. data/docs/CampaignsVouchersCreateResponseBodyLoyaltyCard.md +2 -1
  25. data/docs/ClientValidationsValidateResponseBodyRedeemablesItem.md +3 -2
  26. data/docs/ClientValidationsValidateResponseBodyRedeemablesItemResultDiscount.md +1 -1
  27. data/docs/CustomerLoyalty.md +1 -1
  28. data/docs/Discount.md +1 -1
  29. data/docs/DiscountUnitMultipleOneUnit.md +1 -1
  30. data/docs/EarningRule.md +1 -0
  31. data/docs/EarningRulePendingPoints.md +9 -0
  32. data/docs/Error.md +1 -0
  33. data/docs/ErrorError.md +8 -0
  34. data/docs/EventSource.md +10 -0
  35. data/docs/EventSourceApiKey.md +9 -0
  36. data/docs/EventSourceUser.md +8 -0
  37. data/docs/InapplicableTo.md +3 -2
  38. data/docs/InapplicableToOrderItemUnitsItem.md +9 -0
  39. data/docs/LoyaltiesApi.md +334 -10
  40. data/docs/LoyaltiesCreateCampaignRequestBody.md +2 -1
  41. data/docs/LoyaltiesEarningRulesCreateResponseBody.md +1 -0
  42. data/docs/LoyaltiesEarningRulesCreateResponseBodyPendingPoints.md +9 -0
  43. data/docs/LoyaltiesEarningRulesDisableResponseBody.md +1 -0
  44. data/docs/LoyaltiesEarningRulesDisableResponseBodyPendingPoints.md +9 -0
  45. data/docs/LoyaltiesEarningRulesEnableResponseBody.md +1 -0
  46. data/docs/LoyaltiesEarningRulesEnableResponseBodyPendingPoints.md +9 -0
  47. data/docs/LoyaltiesEarningRulesGetResponseBody.md +1 -0
  48. data/docs/LoyaltiesEarningRulesGetResponseBodyPendingPoints.md +9 -0
  49. data/docs/LoyaltiesEarningRulesUpdateResponseBody.md +1 -0
  50. data/docs/LoyaltiesEarningRulesUpdateResponseBodyPendingPoints.md +9 -0
  51. data/docs/LoyaltiesMembersBalanceUpdateResponseBody.md +1 -1
  52. data/docs/LoyaltiesMembersCreateResponseBodyLoyaltyCard.md +2 -1
  53. data/docs/LoyaltiesMembersGetResponseBodyLoyaltyCard.md +2 -1
  54. data/docs/LoyaltiesMembersPendingPointsActivateResponseBody.md +14 -0
  55. data/docs/LoyaltiesMembersPendingPointsActivateResponseBodyRelatedObject.md +9 -0
  56. data/docs/LoyaltiesMembersPendingPointsListResponseBody.md +12 -0
  57. data/docs/LoyaltiesMembersPointsExpirationListResponseBodyDataItem.md +9 -9
  58. data/docs/LoyaltiesMembersPointsExpirationListResponseBodyDataItemBucket.md +1 -1
  59. data/docs/LoyaltiesMembersRedemptionRedeemResponseBodyVoucherLoyaltyCard.md +2 -1
  60. data/docs/LoyaltiesMembersTransfersCreateResponseBodyLoyaltyCard.md +2 -1
  61. data/docs/LoyaltiesPendingPointsListResponseBody.md +12 -0
  62. data/docs/LoyaltiesUpdateCampaignRequestBody.md +3 -2
  63. data/docs/LoyaltyCardTransaction.md +2 -2
  64. data/docs/LoyaltyCardTransactionDetails.md +2 -0
  65. data/docs/LoyaltyCardTransactionDetailsBalance.md +5 -4
  66. data/docs/LoyaltyCardTransactionDetailsBalanceRelatedObject.md +1 -1
  67. data/docs/LoyaltyCardTransactionDetailsEarningRule.md +1 -1
  68. data/docs/LoyaltyCardTransactionDetailsHolderLoyaltyTier.md +9 -0
  69. data/docs/LoyaltyCardTransactionDetailsLoyaltyTier.md +2 -2
  70. data/docs/LoyaltyMemberLoyaltyCard.md +2 -1
  71. data/docs/LoyaltyPendingPoints.md +17 -0
  72. data/docs/LoyaltyPendingPointsDetails.md +12 -0
  73. data/docs/LoyaltyPendingPointsDetailsEarningRule.md +9 -0
  74. data/docs/LoyaltyPendingPointsDetailsEarningRuleSource.md +8 -0
  75. data/docs/LoyaltyPendingPointsDetailsEvent.md +14 -0
  76. data/docs/LoyaltyPendingPointsDetailsHolderLoyaltyTier.md +9 -0
  77. data/docs/LoyaltyPendingPointsDetailsLoyaltyTier.md +9 -0
  78. data/docs/LoyaltyPendingPointsDetailsOrder.md +9 -0
  79. data/docs/LoyaltyPointsBucket.md +16 -0
  80. data/docs/LoyaltyPointsBucketBucket.md +8 -0
  81. data/docs/LoyaltyTierExpiration.md +1 -1
  82. data/docs/Order.md +3 -3
  83. data/docs/OrderCalculated.md +12 -12
  84. data/docs/OrderCalculatedItem.md +2 -1
  85. data/docs/OrderCalculatedItemProduct.md +1 -1
  86. data/docs/OrderCalculatedItemSku.md +1 -0
  87. data/docs/OrderItem.md +1 -1
  88. data/docs/OrderItemProduct.md +1 -1
  89. data/docs/OrderItemSku.md +1 -0
  90. data/docs/OrderRedemptionsEntry.md +1 -1
  91. data/docs/OrdersCreateRequestBody.md +3 -3
  92. data/docs/OrdersCreateResponseBody.md +12 -12
  93. data/docs/OrdersGetResponseBody.md +12 -12
  94. data/docs/OrdersImportCreateRequestBodyItem.md +3 -3
  95. data/docs/OrdersUpdateRequestBody.md +3 -3
  96. data/docs/OrdersUpdateResponseBody.md +12 -12
  97. data/docs/ParameterOrderListPendingPoints.md +7 -0
  98. data/docs/Product.md +1 -1
  99. data/docs/ProductCollectionsProductsListResponseBodyDataItem.md +1 -1
  100. data/docs/ProductWithoutSkus.md +1 -1
  101. data/docs/ProductsCreateResponseBody.md +1 -1
  102. data/docs/ProductsGetResponseBody.md +1 -1
  103. data/docs/ProductsSkusCreateResponseBody.md +1 -1
  104. data/docs/ProductsSkusUpdateResponseBody.md +1 -1
  105. data/docs/ProductsUpdateResponseBody.md +1 -1
  106. data/docs/RedeemableLoyaltyCard.md +1 -1
  107. data/docs/RedeemableVoucherLoyaltyCard.md +2 -1
  108. data/docs/RedemptionEntryOrder.md +12 -12
  109. data/docs/RedemptionEntryVoucherLoyaltyCard.md +2 -1
  110. data/docs/RedemptionVoucherLoyaltyCard.md +2 -1
  111. data/docs/RedemptionsGetResponseBodyOrder.md +12 -12
  112. data/docs/RedemptionsGetResponseBodyVoucherLoyaltyCard.md +2 -1
  113. data/docs/RedemptionsListResponseBodyRedemptionsItemOrder.md +12 -12
  114. data/docs/RedemptionsListResponseBodyRedemptionsItemVoucherLoyaltyCard.md +2 -1
  115. data/docs/SimpleLoyaltyCard.md +2 -1
  116. data/docs/Sku.md +1 -1
  117. data/docs/SkusGetResponseBody.md +1 -1
  118. data/docs/TemplatesCampaignsCampaignSetupCreateRequestBody.md +2 -1
  119. data/docs/ValidationsRedeemableInapplicable.md +3 -2
  120. data/docs/ValidationsRedeemableSkipped.md +3 -2
  121. data/docs/ValidationsValidateResponseBodyRedeemablesItem.md +3 -2
  122. data/docs/ValidationsValidateResponseBodyRedeemablesItemResultDiscount.md +1 -1
  123. data/docs/VoucherBalance.md +14 -0
  124. data/docs/VoucherBalanceRelatedObject.md +9 -0
  125. data/docs/VoucherLoyaltyCard.md +2 -1
  126. data/docs/VoucherTransaction.md +2 -2
  127. data/docs/VoucherTransactionDetails.md +2 -0
  128. data/docs/VoucherTransactionDetailsBalance.md +5 -4
  129. data/docs/VoucherTransactionDetailsBalanceRelatedObject.md +1 -1
  130. data/docs/VoucherTransactionDetailsCustomEvent.md +2 -2
  131. data/docs/VoucherTransactionDetailsEarningRule.md +1 -1
  132. data/docs/VoucherTransactionDetailsEventSchema.md +2 -2
  133. data/docs/VoucherTransactionDetailsHolderLoyaltyTier.md +9 -0
  134. data/docs/VoucherTransactionDetailsLoyaltyTier.md +2 -2
  135. data/docs/VoucherTransactionDetailsRollback.md +1 -1
  136. data/docs/VoucherTransactionDetailsSegment.md +2 -2
  137. data/docs/VoucherWithCategoriesLoyaltyCard.md +2 -1
  138. data/docs/VouchersApi.md +6 -6
  139. data/docs/VouchersBalanceUpdateResponseBody.md +1 -1
  140. data/docs/VouchersCreateResponseBodyLoyaltyCard.md +2 -1
  141. data/docs/VouchersDisableResponseBodyLoyaltyCard.md +2 -1
  142. data/docs/VouchersEnableResponseBodyLoyaltyCard.md +2 -1
  143. data/docs/VouchersGetResponseBodyLoyaltyCard.md +2 -1
  144. data/docs/VouchersUpdateResponseBodyLoyaltyCard.md +2 -1
  145. data/lib/VoucherifySdk/api/bin_api.rb +4 -4
  146. data/lib/VoucherifySdk/api/campaigns_api.rb +4 -4
  147. data/lib/VoucherifySdk/api/loyalties_api.rb +334 -8
  148. data/lib/VoucherifySdk/api/vouchers_api.rb +10 -10
  149. data/lib/VoucherifySdk/models/access_settings.rb +219 -0
  150. data/lib/VoucherifySdk/models/access_settings_assign.rb +238 -0
  151. data/lib/VoucherifySdk/models/access_settings_campaign_assignments_list.rb +1 -1
  152. data/lib/VoucherifySdk/models/access_settings_unassign.rb +238 -0
  153. data/lib/VoucherifySdk/models/applicable_to.rb +16 -3
  154. data/lib/VoucherifySdk/models/applicable_to_order_item_units_item.rb +220 -0
  155. data/lib/VoucherifySdk/models/application_details_item.rb +284 -0
  156. data/lib/VoucherifySdk/models/area_store_campaign_assignment.rb +12 -1
  157. data/lib/VoucherifySdk/models/campaign.rb +16 -16
  158. data/lib/VoucherifySdk/models/campaign_base.rb +16 -7
  159. data/lib/VoucherifySdk/models/campaigns_create_request_body.rb +11 -2
  160. data/lib/VoucherifySdk/models/campaigns_create_response_body.rb +16 -16
  161. data/lib/VoucherifySdk/models/campaigns_get_response_body.rb +16 -16
  162. data/lib/VoucherifySdk/models/campaigns_update_request_body.rb +12 -3
  163. data/lib/VoucherifySdk/models/campaigns_update_response_body.rb +16 -16
  164. data/lib/VoucherifySdk/models/campaigns_vouchers_create_combined_response_body_loyalty_card.rb +17 -6
  165. data/lib/VoucherifySdk/models/campaigns_vouchers_create_response_body_loyalty_card.rb +17 -6
  166. data/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item.rb +18 -7
  167. data/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item_result_discount.rb +1 -0
  168. data/lib/VoucherifySdk/models/customer_loyalty.rb +1 -1
  169. data/lib/VoucherifySdk/models/discount.rb +1 -0
  170. data/lib/VoucherifySdk/models/discount_unit_multiple_one_unit.rb +1 -0
  171. data/lib/VoucherifySdk/models/earning_rule.rb +11 -1
  172. data/lib/VoucherifySdk/models/earning_rule_pending_points.rb +257 -0
  173. data/lib/VoucherifySdk/models/error.rb +15 -5
  174. data/lib/VoucherifySdk/models/error_error.rb +210 -0
  175. data/lib/VoucherifySdk/models/event_source.rb +254 -0
  176. data/lib/VoucherifySdk/models/event_source_api_key.rb +221 -0
  177. data/lib/VoucherifySdk/models/event_source_user.rb +210 -0
  178. data/lib/VoucherifySdk/models/inapplicable_to.rb +16 -3
  179. data/lib/VoucherifySdk/models/inapplicable_to_order_item_units_item.rb +220 -0
  180. data/lib/VoucherifySdk/models/loyalties_create_campaign_request_body.rb +11 -2
  181. data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body.rb +11 -1
  182. data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_pending_points.rb +257 -0
  183. data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body.rb +11 -1
  184. data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_pending_points.rb +257 -0
  185. data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body.rb +11 -1
  186. data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_pending_points.rb +257 -0
  187. data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body.rb +11 -1
  188. data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_pending_points.rb +257 -0
  189. data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body.rb +11 -1
  190. data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_pending_points.rb +257 -0
  191. data/lib/VoucherifySdk/models/loyalties_members_balance_update_response_body.rb +1 -0
  192. data/lib/VoucherifySdk/models/loyalties_members_create_response_body_loyalty_card.rb +17 -6
  193. data/lib/VoucherifySdk/models/loyalties_members_get_response_body_loyalty_card.rb +17 -6
  194. data/lib/VoucherifySdk/models/loyalties_members_pending_points_activate_response_body.rb +309 -0
  195. data/lib/VoucherifySdk/models/loyalties_members_pending_points_activate_response_body_related_object.rb +247 -0
  196. data/lib/VoucherifySdk/models/loyalties_members_pending_points_list_response_body.rb +286 -0
  197. data/lib/VoucherifySdk/models/loyalties_members_points_expiration_list_response_body_data_item.rb +27 -77
  198. data/lib/VoucherifySdk/models/loyalties_members_points_expiration_list_response_body_data_item_bucket.rb +3 -9
  199. data/lib/VoucherifySdk/models/loyalties_members_redemption_redeem_response_body_voucher_loyalty_card.rb +17 -6
  200. data/lib/VoucherifySdk/models/loyalties_members_transfers_create_response_body_loyalty_card.rb +17 -6
  201. data/lib/VoucherifySdk/models/loyalties_pending_points_list_response_body.rb +286 -0
  202. data/lib/VoucherifySdk/models/loyalties_update_campaign_request_body.rb +12 -3
  203. data/lib/VoucherifySdk/models/loyalty_card_transaction.rb +24 -31
  204. data/lib/VoucherifySdk/models/loyalty_card_transaction_details.rb +20 -2
  205. data/lib/VoucherifySdk/models/loyalty_card_transaction_details_balance.rb +18 -19
  206. data/lib/VoucherifySdk/models/loyalty_card_transaction_details_balance_related_object.rb +1 -7
  207. data/lib/VoucherifySdk/models/loyalty_card_transaction_details_earning_rule.rb +1 -1
  208. data/lib/VoucherifySdk/models/loyalty_card_transaction_details_holder_loyalty_tier.rb +221 -0
  209. data/lib/VoucherifySdk/models/loyalty_card_transaction_details_loyalty_tier.rb +3 -1
  210. data/lib/VoucherifySdk/models/loyalty_card_transactions_type.rb +2 -1
  211. data/lib/VoucherifySdk/models/loyalty_member_loyalty_card.rb +17 -6
  212. data/lib/VoucherifySdk/models/loyalty_pending_points.rb +314 -0
  213. data/lib/VoucherifySdk/models/loyalty_pending_points_details.rb +249 -0
  214. data/lib/VoucherifySdk/models/loyalty_pending_points_details_earning_rule.rb +220 -0
  215. data/lib/VoucherifySdk/models/loyalty_pending_points_details_earning_rule_source.rb +210 -0
  216. data/lib/VoucherifySdk/models/loyalty_pending_points_details_event.rb +302 -0
  217. data/lib/VoucherifySdk/models/loyalty_pending_points_details_holder_loyalty_tier.rb +221 -0
  218. data/lib/VoucherifySdk/models/loyalty_pending_points_details_loyalty_tier.rb +221 -0
  219. data/lib/VoucherifySdk/models/loyalty_pending_points_details_order.rb +221 -0
  220. data/lib/VoucherifySdk/models/loyalty_points_bucket.rb +323 -0
  221. data/lib/VoucherifySdk/models/loyalty_points_bucket_bucket.rb +210 -0
  222. data/lib/VoucherifySdk/models/loyalty_tier_expiration.rb +1 -1
  223. data/lib/VoucherifySdk/models/order.rb +3 -3
  224. data/lib/VoucherifySdk/models/order_calculated.rb +29 -29
  225. data/lib/VoucherifySdk/models/order_calculated_item.rb +18 -6
  226. data/lib/VoucherifySdk/models/order_calculated_item_product.rb +1 -1
  227. data/lib/VoucherifySdk/models/order_calculated_item_sku.rb +16 -5
  228. data/lib/VoucherifySdk/models/order_item.rb +1 -1
  229. data/lib/VoucherifySdk/models/order_item_product.rb +1 -1
  230. data/lib/VoucherifySdk/models/order_item_sku.rb +16 -5
  231. data/lib/VoucherifySdk/models/order_redemptions_entry.rb +1 -1
  232. data/lib/VoucherifySdk/models/orders_create_request_body.rb +3 -3
  233. data/lib/VoucherifySdk/models/orders_create_response_body.rb +29 -29
  234. data/lib/VoucherifySdk/models/orders_get_response_body.rb +29 -29
  235. data/lib/VoucherifySdk/models/orders_import_create_request_body_item.rb +3 -3
  236. data/lib/VoucherifySdk/models/orders_update_request_body.rb +3 -3
  237. data/lib/VoucherifySdk/models/orders_update_response_body.rb +29 -29
  238. data/lib/VoucherifySdk/models/parameter_expand_list_campaigns.rb +2 -1
  239. data/lib/VoucherifySdk/models/parameter_order_list_pending_points.rb +40 -0
  240. data/lib/VoucherifySdk/models/product.rb +1 -1
  241. data/lib/VoucherifySdk/models/product_collections_products_list_response_body_data_item.rb +1 -1
  242. data/lib/VoucherifySdk/models/product_without_skus.rb +1 -1
  243. data/lib/VoucherifySdk/models/products_create_response_body.rb +1 -1
  244. data/lib/VoucherifySdk/models/products_get_response_body.rb +1 -1
  245. data/lib/VoucherifySdk/models/products_skus_create_response_body.rb +1 -1
  246. data/lib/VoucherifySdk/models/products_skus_update_response_body.rb +1 -1
  247. data/lib/VoucherifySdk/models/products_update_response_body.rb +1 -1
  248. data/lib/VoucherifySdk/models/qualifications_option.rb +3 -3
  249. data/lib/VoucherifySdk/models/redeemable_loyalty_card.rb +1 -1
  250. data/lib/VoucherifySdk/models/redeemable_voucher_loyalty_card.rb +17 -6
  251. data/lib/VoucherifySdk/models/redemption_entry_order.rb +29 -29
  252. data/lib/VoucherifySdk/models/redemption_entry_voucher_loyalty_card.rb +17 -6
  253. data/lib/VoucherifySdk/models/redemption_voucher_loyalty_card.rb +17 -6
  254. data/lib/VoucherifySdk/models/redemptions_get_response_body_order.rb +29 -29
  255. data/lib/VoucherifySdk/models/redemptions_get_response_body_voucher_loyalty_card.rb +17 -6
  256. data/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_order.rb +28 -29
  257. data/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_voucher_loyalty_card.rb +17 -6
  258. data/lib/VoucherifySdk/models/simple_loyalty_card.rb +17 -6
  259. data/lib/VoucherifySdk/models/sku.rb +1 -1
  260. data/lib/VoucherifySdk/models/skus_get_response_body.rb +1 -1
  261. data/lib/VoucherifySdk/models/templates_campaigns_campaign_setup_create_request_body.rb +11 -2
  262. data/lib/VoucherifySdk/models/validations_redeemable_inapplicable.rb +18 -7
  263. data/lib/VoucherifySdk/models/validations_redeemable_skipped.rb +18 -7
  264. data/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item.rb +18 -7
  265. data/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item_result_discount.rb +1 -0
  266. data/lib/VoucherifySdk/models/voucher_balance.rb +305 -0
  267. data/lib/VoucherifySdk/models/voucher_balance_related_object.rb +247 -0
  268. data/lib/VoucherifySdk/models/voucher_loyalty_card.rb +17 -6
  269. data/lib/VoucherifySdk/models/voucher_transaction.rb +27 -31
  270. data/lib/VoucherifySdk/models/voucher_transaction_details.rb +20 -2
  271. data/lib/VoucherifySdk/models/voucher_transaction_details_balance.rb +18 -19
  272. data/lib/VoucherifySdk/models/voucher_transaction_details_balance_related_object.rb +1 -7
  273. data/lib/VoucherifySdk/models/voucher_transaction_details_custom_event.rb +2 -2
  274. data/lib/VoucherifySdk/models/voucher_transaction_details_earning_rule.rb +1 -1
  275. data/lib/VoucherifySdk/models/voucher_transaction_details_event_schema.rb +2 -2
  276. data/lib/VoucherifySdk/models/voucher_transaction_details_holder_loyalty_tier.rb +221 -0
  277. data/lib/VoucherifySdk/models/voucher_transaction_details_loyalty_tier.rb +3 -1
  278. data/lib/VoucherifySdk/models/voucher_transaction_details_rollback.rb +1 -1
  279. data/lib/VoucherifySdk/models/voucher_transaction_details_segment.rb +2 -0
  280. data/lib/VoucherifySdk/models/voucher_with_categories_loyalty_card.rb +17 -6
  281. data/lib/VoucherifySdk/models/vouchers_balance_update_response_body.rb +1 -0
  282. data/lib/VoucherifySdk/models/vouchers_create_response_body_loyalty_card.rb +17 -6
  283. data/lib/VoucherifySdk/models/vouchers_disable_response_body_loyalty_card.rb +17 -6
  284. data/lib/VoucherifySdk/models/vouchers_enable_response_body_loyalty_card.rb +17 -6
  285. data/lib/VoucherifySdk/models/vouchers_get_response_body_loyalty_card.rb +17 -6
  286. data/lib/VoucherifySdk/models/vouchers_update_response_body_loyalty_card.rb +17 -6
  287. data/lib/VoucherifySdk/version.rb +1 -1
  288. data/lib/VoucherifySdk.rb +35 -0
  289. metadata +106 -36
@@ -0,0 +1,309 @@
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 **POST** `/loyalties/members/{memberId}/pending-points/{pendingPointsId}/activate`.
18
+ class LoyaltiesMembersPendingPointsActivateResponseBody
19
+ # The number of pending points added to the loyalty card.
20
+ attr_accessor :points
21
+
22
+ # Total number of points incurred over the lifespan of the loyalty card, minus the expired points.
23
+ attr_accessor :total
24
+
25
+ # The current number of loyalty points after the pendint points have been added.
26
+ attr_accessor :balance
27
+
28
+ # The type of the voucher being modified. For pending points, it is always `loyalty_card`.
29
+ attr_accessor :type
30
+
31
+ # The type of the object represented by JSON. Default is `balance`.
32
+ attr_accessor :object
33
+
34
+ attr_accessor :related_object
35
+
36
+ # The type of the operation being performed.
37
+ attr_accessor :operation_type
38
+
39
+ class EnumAttributeValidator
40
+ attr_reader :datatype
41
+ attr_reader :allowable_values
42
+
43
+ def initialize(datatype, allowable_values)
44
+ @allowable_values = allowable_values.map do |value|
45
+ case datatype.to_s
46
+ when /Integer/i
47
+ value.to_i
48
+ when /Float/i
49
+ value.to_f
50
+ else
51
+ value
52
+ end
53
+ end
54
+ end
55
+
56
+ def valid?(value)
57
+ !value || allowable_values.include?(value)
58
+ end
59
+ end
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'points' => :'points',
65
+ :'total' => :'total',
66
+ :'balance' => :'balance',
67
+ :'type' => :'type',
68
+ :'object' => :'object',
69
+ :'related_object' => :'related_object',
70
+ :'operation_type' => :'operation_type'
71
+ }
72
+ end
73
+
74
+ # Returns all the JSON keys this model knows about
75
+ def self.acceptable_attributes
76
+ attribute_map.values
77
+ end
78
+
79
+ # Attribute type mapping.
80
+ def self.openapi_types
81
+ {
82
+ :'points' => :'Integer',
83
+ :'total' => :'Integer',
84
+ :'balance' => :'Integer',
85
+ :'type' => :'String',
86
+ :'object' => :'String',
87
+ :'related_object' => :'LoyaltiesMembersPendingPointsActivateResponseBodyRelatedObject',
88
+ :'operation_type' => :'String'
89
+ }
90
+ end
91
+
92
+ # List of attributes with nullable: true
93
+ def self.openapi_nullable
94
+ Set.new([
95
+ :'points',
96
+ :'total',
97
+ :'balance',
98
+ :'type',
99
+ :'object',
100
+ :'related_object',
101
+ :'operation_type'
102
+ ])
103
+ end
104
+
105
+ # Initializes the object
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ def initialize(attributes = {})
108
+ # check to see if the attribute exists and convert string to symbol for hash key
109
+ attributes = attributes.each_with_object({}) { |(k, v), h|
110
+ h[k.to_sym] = v
111
+ }
112
+
113
+ if attributes.key?(:'points')
114
+ self.points = attributes[:'points']
115
+ end
116
+
117
+ if attributes.key?(:'total')
118
+ self.total = attributes[:'total']
119
+ end
120
+
121
+ if attributes.key?(:'balance')
122
+ self.balance = attributes[:'balance']
123
+ end
124
+
125
+ if attributes.key?(:'type')
126
+ self.type = attributes[:'type']
127
+ else
128
+ self.type = 'loyalty_card'
129
+ end
130
+
131
+ if attributes.key?(:'object')
132
+ self.object = attributes[:'object']
133
+ else
134
+ self.object = 'balance'
135
+ end
136
+
137
+ if attributes.key?(:'related_object')
138
+ self.related_object = attributes[:'related_object']
139
+ end
140
+
141
+ if attributes.key?(:'operation_type')
142
+ self.operation_type = attributes[:'operation_type']
143
+ else
144
+ self.operation_type = 'MANUAL'
145
+ end
146
+ end
147
+
148
+ # Show invalid properties with the reasons. Usually used together with valid?
149
+ # @return Array for valid properties with the reasons
150
+ def list_invalid_properties
151
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
152
+ invalid_properties = Array.new
153
+ invalid_properties
154
+ end
155
+
156
+ # Check to see if the all the properties in the model are valid
157
+ # @return true if the model is valid
158
+ def valid?
159
+ warn '[DEPRECATED] the `valid?` method is obsolete'
160
+ type_validator = EnumAttributeValidator.new('String', ["loyalty_card"])
161
+ return false unless type_validator.valid?(@type)
162
+ object_validator = EnumAttributeValidator.new('String', ["balance"])
163
+ return false unless object_validator.valid?(@object)
164
+ operation_type_validator = EnumAttributeValidator.new('String', ["MANUAL"])
165
+ return false unless operation_type_validator.valid?(@operation_type)
166
+ true
167
+ end
168
+
169
+ # Checks equality by comparing each attribute.
170
+ # @param [Object] Object to be compared
171
+ def ==(o)
172
+ return true if self.equal?(o)
173
+ self.class == o.class &&
174
+ points == o.points &&
175
+ total == o.total &&
176
+ balance == o.balance &&
177
+ type == o.type &&
178
+ object == o.object &&
179
+ related_object == o.related_object &&
180
+ operation_type == o.operation_type
181
+ end
182
+
183
+ # @see the `==` method
184
+ # @param [Object] Object to be compared
185
+ def eql?(o)
186
+ self == o
187
+ end
188
+
189
+ # Calculates hash code according to all attributes.
190
+ # @return [Integer] Hash code
191
+ def hash
192
+ [points, total, balance, type, object, related_object, operation_type].hash
193
+ end
194
+
195
+ # Builds the object from hash
196
+ # @param [Hash] attributes Model attributes in the form of hash
197
+ # @return [Object] Returns the model itself
198
+ def self.build_from_hash(attributes)
199
+ return nil unless attributes.is_a?(Hash)
200
+ attributes = attributes.transform_keys(&:to_sym)
201
+ transformed_hash = {}
202
+ openapi_types.each_pair do |key, type|
203
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
204
+ transformed_hash["#{key}"] = nil
205
+ elsif type =~ /\AArray<(.*)>/i
206
+ # check to ensure the input is an array given that the attribute
207
+ # is documented as an array but the input is not
208
+ if attributes[attribute_map[key]].is_a?(Array)
209
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
210
+ end
211
+ elsif !attributes[attribute_map[key]].nil?
212
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
213
+ end
214
+ end
215
+ new(transformed_hash)
216
+ end
217
+
218
+ # Deserializes the data based on type
219
+ # @param string type Data type
220
+ # @param string value Value to be deserialized
221
+ # @return [Object] Deserialized data
222
+ def self._deserialize(type, value)
223
+ case type.to_sym
224
+ when :Time
225
+ Time.parse(value)
226
+ when :Date
227
+ Date.parse(value)
228
+ when :String
229
+ value.to_s
230
+ when :Integer
231
+ value.to_i
232
+ when :Float
233
+ value.to_f
234
+ when :Boolean
235
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
236
+ true
237
+ else
238
+ false
239
+ end
240
+ when :Object
241
+ # generic object (usually a Hash), return directly
242
+ value
243
+ when /\AArray<(?<inner_type>.+)>\z/
244
+ inner_type = Regexp.last_match[:inner_type]
245
+ value.map { |v| _deserialize(inner_type, v) }
246
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
247
+ k_type = Regexp.last_match[:k_type]
248
+ v_type = Regexp.last_match[:v_type]
249
+ {}.tap do |hash|
250
+ value.each do |k, v|
251
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
252
+ end
253
+ end
254
+ else # model
255
+ # models (e.g. Pet) or oneOf
256
+ klass = VoucherifySdk.const_get(type)
257
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
258
+ end
259
+ end
260
+
261
+ # Returns the string representation of the object
262
+ # @return [String] String presentation of the object
263
+ def to_s
264
+ to_hash.to_s
265
+ end
266
+
267
+ # to_body is an alias to to_hash (backward compatibility)
268
+ # @return [Hash] Returns the object in the form of hash
269
+ def to_body
270
+ to_hash
271
+ end
272
+
273
+ # Returns the object in the form of hash
274
+ # @return [Hash] Returns the object in the form of hash
275
+ def to_hash
276
+ hash = {}
277
+ self.class.attribute_map.each_pair do |attr, param|
278
+ value = self.send(attr)
279
+ if value.nil?
280
+ is_nullable = self.class.openapi_nullable.include?(attr)
281
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
282
+ end
283
+
284
+ hash[param] = _to_hash(value)
285
+ end
286
+ hash
287
+ end
288
+
289
+ # Outputs non-array value in the form of hash
290
+ # For object, use to_hash. Otherwise, just return the value
291
+ # @param [Object] value Any valid value
292
+ # @return [Hash] Returns the value in the form of hash
293
+ def _to_hash(value)
294
+ if value.is_a?(Array)
295
+ value.compact.map { |v| _to_hash(v) }
296
+ elsif value.is_a?(Hash)
297
+ {}.tap do |hash|
298
+ value.each { |k, v| hash[k] = _to_hash(v) }
299
+ end
300
+ elsif value.respond_to? :to_hash
301
+ value.to_hash
302
+ else
303
+ value
304
+ end
305
+ end
306
+
307
+ end
308
+
309
+ end
@@ -0,0 +1,247 @@
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
+ # Defines the resource that is being modified.
18
+ class LoyaltiesMembersPendingPointsActivateResponseBodyRelatedObject
19
+ # The object being modified, i.e. `voucher`.
20
+ attr_accessor :type
21
+
22
+ # Identifies the voucher that is being modified. This is the unique identifer that was assigned by Voucherify.
23
+ attr_accessor :id
24
+
25
+ class EnumAttributeValidator
26
+ attr_reader :datatype
27
+ attr_reader :allowable_values
28
+
29
+ def initialize(datatype, allowable_values)
30
+ @allowable_values = allowable_values.map do |value|
31
+ case datatype.to_s
32
+ when /Integer/i
33
+ value.to_i
34
+ when /Float/i
35
+ value.to_f
36
+ else
37
+ value
38
+ end
39
+ end
40
+ end
41
+
42
+ def valid?(value)
43
+ !value || allowable_values.include?(value)
44
+ end
45
+ end
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'type' => :'type',
51
+ :'id' => :'id'
52
+ }
53
+ end
54
+
55
+ # Returns all the JSON keys this model knows about
56
+ def self.acceptable_attributes
57
+ attribute_map.values
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.openapi_types
62
+ {
63
+ :'type' => :'String',
64
+ :'id' => :'String'
65
+ }
66
+ end
67
+
68
+ # List of attributes with nullable: true
69
+ def self.openapi_nullable
70
+ Set.new([
71
+ :'type',
72
+ :'id'
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ h[k.to_sym] = v
82
+ }
83
+
84
+ if attributes.key?(:'type')
85
+ self.type = attributes[:'type']
86
+ else
87
+ self.type = 'voucher'
88
+ end
89
+
90
+ if attributes.key?(:'id')
91
+ self.id = attributes[:'id']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ warn '[DEPRECATED] the `valid?` method is obsolete'
107
+ type_validator = EnumAttributeValidator.new('String', ["voucher"])
108
+ return false unless type_validator.valid?(@type)
109
+ true
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ type == o.type &&
118
+ id == o.id
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Integer] Hash code
129
+ def hash
130
+ [type, id].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def self.build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ attributes = attributes.transform_keys(&:to_sym)
139
+ transformed_hash = {}
140
+ openapi_types.each_pair do |key, type|
141
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = nil
143
+ elsif type =~ /\AArray<(.*)>/i
144
+ # check to ensure the input is an array given that the attribute
145
+ # is documented as an array but the input is not
146
+ if attributes[attribute_map[key]].is_a?(Array)
147
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
148
+ end
149
+ elsif !attributes[attribute_map[key]].nil?
150
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
151
+ end
152
+ end
153
+ new(transformed_hash)
154
+ end
155
+
156
+ # Deserializes the data based on type
157
+ # @param string type Data type
158
+ # @param string value Value to be deserialized
159
+ # @return [Object] Deserialized data
160
+ def self._deserialize(type, value)
161
+ case type.to_sym
162
+ when :Time
163
+ Time.parse(value)
164
+ when :Date
165
+ Date.parse(value)
166
+ when :String
167
+ value.to_s
168
+ when :Integer
169
+ value.to_i
170
+ when :Float
171
+ value.to_f
172
+ when :Boolean
173
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
174
+ true
175
+ else
176
+ false
177
+ end
178
+ when :Object
179
+ # generic object (usually a Hash), return directly
180
+ value
181
+ when /\AArray<(?<inner_type>.+)>\z/
182
+ inner_type = Regexp.last_match[:inner_type]
183
+ value.map { |v| _deserialize(inner_type, v) }
184
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
185
+ k_type = Regexp.last_match[:k_type]
186
+ v_type = Regexp.last_match[:v_type]
187
+ {}.tap do |hash|
188
+ value.each do |k, v|
189
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
190
+ end
191
+ end
192
+ else # model
193
+ # models (e.g. Pet) or oneOf
194
+ klass = VoucherifySdk.const_get(type)
195
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
196
+ end
197
+ end
198
+
199
+ # Returns the string representation of the object
200
+ # @return [String] String presentation of the object
201
+ def to_s
202
+ to_hash.to_s
203
+ end
204
+
205
+ # to_body is an alias to to_hash (backward compatibility)
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_body
208
+ to_hash
209
+ end
210
+
211
+ # Returns the object in the form of hash
212
+ # @return [Hash] Returns the object in the form of hash
213
+ def to_hash
214
+ hash = {}
215
+ self.class.attribute_map.each_pair do |attr, param|
216
+ value = self.send(attr)
217
+ if value.nil?
218
+ is_nullable = self.class.openapi_nullable.include?(attr)
219
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
220
+ end
221
+
222
+ hash[param] = _to_hash(value)
223
+ end
224
+ hash
225
+ end
226
+
227
+ # Outputs non-array value in the form of hash
228
+ # For object, use to_hash. Otherwise, just return the value
229
+ # @param [Object] value Any valid value
230
+ # @return [Hash] Returns the value in the form of hash
231
+ def _to_hash(value)
232
+ if value.is_a?(Array)
233
+ value.compact.map { |v| _to_hash(v) }
234
+ elsif value.is_a?(Hash)
235
+ {}.tap do |hash|
236
+ value.each { |k, v| hash[k] = _to_hash(v) }
237
+ end
238
+ elsif value.respond_to? :to_hash
239
+ value.to_hash
240
+ else
241
+ value
242
+ end
243
+ end
244
+
245
+ end
246
+
247
+ end