From 08e6a7aa6023fa257910d2863ebbaf0ff46d8445 Mon Sep 17 00:00:00 2001 From: p-zielinski Date: Tue, 28 Jan 2025 17:21:10 +0100 Subject: [PATCH] v8.0.3 --- Dockerfile | 2 +- ENDPOINTS-COVERAGE.md | 101 ++--- README.md | 46 ++- __tests__/spec/12_validation_rules_spec.rb | 16 +- docs/AccessSettings.md | 9 + docs/AccessSettingsAssign.md | 10 + docs/AccessSettingsUnassign.md | 10 + docs/ApplicableTo.md | 5 +- docs/ApplicableToOrderItemUnitsItem.md | 9 + docs/ApplicationDetailsItem.md | 14 + docs/AreaStoreCampaignAssignment.md | 1 + docs/BinApi.md | 8 +- docs/Campaign.md | 2 +- docs/CampaignBase.md | 1 + docs/CampaignsCreateRequestBody.md | 1 + docs/CampaignsCreateResponseBody.md | 2 +- docs/CampaignsGetResponseBody.md | 2 +- docs/CampaignsUpdateRequestBody.md | 1 + docs/CampaignsUpdateResponseBody.md | 2 +- ...rsCreateCombinedResponseBodyLoyaltyCard.md | 3 +- ...nsVouchersCreateResponseBodyLoyaltyCard.md | 3 +- ...sponseBodyRedeemablesItemResultDiscount.md | 2 +- docs/CustomerLoyalty.md | 2 +- docs/Discount.md | 2 +- docs/DiscountUnitMultipleOneUnit.md | 2 +- docs/EarningRule.md | 1 + docs/EarningRulePendingPoints.md | 9 + docs/EventSource.md | 10 + docs/EventSourceApiKey.md | 9 + docs/EventSourceUser.md | 8 + docs/InapplicableTo.md | 5 +- docs/InapplicableToOrderItemUnitsItem.md | 9 + docs/LoyaltiesApi.md | 344 +++++++++++++++++- docs/LoyaltiesCreateCampaignRequestBody.md | 1 + ...LoyaltiesEarningRulesCreateResponseBody.md | 1 + ...ingRulesCreateResponseBodyPendingPoints.md | 9 + ...oyaltiesEarningRulesDisableResponseBody.md | 1 + ...ngRulesDisableResponseBodyPendingPoints.md | 9 + ...LoyaltiesEarningRulesEnableResponseBody.md | 1 + ...ingRulesEnableResponseBodyPendingPoints.md | 9 + docs/LoyaltiesEarningRulesGetResponseBody.md | 1 + ...arningRulesGetResponseBodyPendingPoints.md | 9 + ...LoyaltiesEarningRulesUpdateResponseBody.md | 1 + ...ingRulesUpdateResponseBodyPendingPoints.md | 9 + ...iesMembersCreateResponseBodyLoyaltyCard.md | 3 +- ...altiesMembersGetResponseBodyLoyaltyCard.md | 3 +- ...embersPendingPointsActivateResponseBody.md | 14 + ...PointsActivateResponseBodyRelatedObject.md | 9 + ...iesMembersPendingPointsListResponseBody.md | 12 + ...ionRedeemResponseBodyVoucherLoyaltyCard.md | 3 +- ...sTransfersCreateResponseBodyLoyaltyCard.md | 3 +- .../LoyaltiesPendingPointsListResponseBody.md | 12 + docs/LoyaltiesUpdateCampaignRequestBody.md | 1 + docs/LoyaltyCardTransactionDetails.md | 2 + ...oyaltyCardTransactionDetailsEarningRule.md | 2 +- ...CardTransactionDetailsHolderLoyaltyTier.md | 9 + ...oyaltyCardTransactionDetailsLoyaltyTier.md | 4 +- docs/LoyaltyMemberLoyaltyCard.md | 3 +- docs/LoyaltyPendingPoints.md | 17 + docs/LoyaltyPendingPointsDetails.md | 12 + .../LoyaltyPendingPointsDetailsEarningRule.md | 9 + ...tyPendingPointsDetailsEarningRuleSource.md | 8 + docs/LoyaltyPendingPointsDetailsEvent.md | 14 + ...tyPendingPointsDetailsHolderLoyaltyTier.md | 9 + .../LoyaltyPendingPointsDetailsLoyaltyTier.md | 9 + docs/LoyaltyPendingPointsDetailsOrder.md | 9 + docs/LoyaltyTierExpiration.md | 2 +- docs/Order.md | 4 +- docs/OrderCalculated.md | 22 +- docs/OrderCalculatedItem.md | 1 + docs/OrderRedemptionsEntry.md | 2 +- docs/OrdersCreateRequestBody.md | 4 +- docs/OrdersCreateResponseBody.md | 22 +- docs/OrdersGetResponseBody.md | 22 +- docs/OrdersImportCreateRequestBodyItem.md | 4 +- docs/OrdersUpdateRequestBody.md | 4 +- docs/OrdersUpdateResponseBody.md | 22 +- docs/ParameterOrderListPendingPoints.md | 7 + docs/RedeemableLoyaltyCard.md | 2 +- docs/RedeemableVoucherLoyaltyCard.md | 3 +- docs/RedemptionEntryOrder.md | 22 +- docs/RedemptionEntryVoucherLoyaltyCard.md | 3 +- docs/RedemptionVoucherLoyaltyCard.md | 3 +- docs/RedemptionsGetResponseBodyOrder.md | 22 +- ...ptionsGetResponseBodyVoucherLoyaltyCard.md | 3 +- ...onsListResponseBodyRedemptionsItemOrder.md | 22 +- ...seBodyRedemptionsItemVoucherLoyaltyCard.md | 3 +- docs/SimpleLoyaltyCard.md | 3 +- ...CampaignsCampaignSetupCreateRequestBody.md | 1 + ...sponseBodyRedeemablesItemResultDiscount.md | 2 +- docs/VoucherLoyaltyCard.md | 3 +- docs/VoucherTransactionDetails.md | 2 + docs/VoucherTransactionDetailsCustomEvent.md | 4 +- docs/VoucherTransactionDetailsEarningRule.md | 2 +- docs/VoucherTransactionDetailsEventSchema.md | 4 +- ...cherTransactionDetailsHolderLoyaltyTier.md | 9 + docs/VoucherTransactionDetailsLoyaltyTier.md | 4 +- docs/VoucherTransactionDetailsRollback.md | 2 +- docs/VoucherTransactionDetailsSegment.md | 4 +- docs/VoucherWithCategoriesLoyaltyCard.md | 3 +- docs/VouchersCreateResponseBodyLoyaltyCard.md | 3 +- .../VouchersDisableResponseBodyLoyaltyCard.md | 3 +- docs/VouchersEnableResponseBodyLoyaltyCard.md | 3 +- docs/VouchersGetResponseBodyLoyaltyCard.md | 3 +- docs/VouchersUpdateResponseBodyLoyaltyCard.md | 3 +- lib/VoucherifySdk.rb | 30 ++ lib/VoucherifySdk/api/bin_api.rb | 8 +- lib/VoucherifySdk/api/loyalties_api.rb | 342 ++++++++++++++++- lib/VoucherifySdk/models/access_settings.rb | 219 +++++++++++ .../models/access_settings_assign.rb | 238 ++++++++++++ .../models/access_settings_unassign.rb | 238 ++++++++++++ lib/VoucherifySdk/models/applicable_to.rb | 19 +- .../applicable_to_order_item_units_item.rb | 220 +++++++++++ .../models/application_details_item.rb | 284 +++++++++++++++ .../models/area_store_campaign_assignment.rb | 13 +- lib/VoucherifySdk/models/campaign.rb | 26 +- lib/VoucherifySdk/models/campaign_base.rb | 17 +- .../models/campaigns_create_request_body.rb | 11 +- .../models/campaigns_create_response_body.rb | 26 +- .../models/campaigns_get_response_body.rb | 26 +- .../models/campaigns_update_request_body.rb | 11 +- .../models/campaigns_update_response_body.rb | 26 +- ...ate_combined_response_body_loyalty_card.rb | 23 +- ...chers_create_response_body_loyalty_card.rb | 23 +- ...e_body_redeemables_item_result_discount.rb | 1 + lib/VoucherifySdk/models/customer_loyalty.rb | 2 +- lib/VoucherifySdk/models/discount.rb | 1 + .../models/discount_unit_multiple_one_unit.rb | 1 + lib/VoucherifySdk/models/earning_rule.rb | 12 +- .../models/earning_rule_pending_points.rb | 257 +++++++++++++ lib/VoucherifySdk/models/event_source.rb | 254 +++++++++++++ .../models/event_source_api_key.rb | 221 +++++++++++ lib/VoucherifySdk/models/event_source_user.rb | 210 +++++++++++ lib/VoucherifySdk/models/inapplicable_to.rb | 19 +- .../inapplicable_to_order_item_units_item.rb | 220 +++++++++++ .../loyalties_create_campaign_request_body.rb | 11 +- ...ties_earning_rules_create_response_body.rb | 12 +- ...les_create_response_body_pending_points.rb | 257 +++++++++++++ ...ies_earning_rules_disable_response_body.rb | 12 +- ...es_disable_response_body_pending_points.rb | 257 +++++++++++++ ...ties_earning_rules_enable_response_body.rb | 12 +- ...les_enable_response_body_pending_points.rb | 257 +++++++++++++ ...yalties_earning_rules_get_response_body.rb | 12 +- ..._rules_get_response_body_pending_points.rb | 257 +++++++++++++ ...ties_earning_rules_update_response_body.rb | 12 +- ...les_update_response_body_pending_points.rb | 257 +++++++++++++ ...mbers_create_response_body_loyalty_card.rb | 23 +- ..._members_get_response_body_loyalty_card.rb | 23 +- ...s_pending_points_activate_response_body.rb | 309 ++++++++++++++++ ...s_activate_response_body_related_object.rb | 247 +++++++++++++ ...mbers_pending_points_list_response_body.rb | 286 +++++++++++++++ ...deem_response_body_voucher_loyalty_card.rb | 23 +- ...sfers_create_response_body_loyalty_card.rb | 23 +- ...lties_pending_points_list_response_body.rb | 286 +++++++++++++++ .../loyalties_update_campaign_request_body.rb | 11 +- .../loyalty_card_transaction_details.rb | 21 +- ...y_card_transaction_details_earning_rule.rb | 2 +- ...transaction_details_holder_loyalty_tier.rb | 221 +++++++++++ ...y_card_transaction_details_loyalty_tier.rb | 4 +- .../models/loyalty_card_transactions_type.rb | 3 +- .../models/loyalty_member_loyalty_card.rb | 23 +- .../models/loyalty_pending_points.rb | 314 ++++++++++++++++ .../models/loyalty_pending_points_details.rb | 249 +++++++++++++ ...lty_pending_points_details_earning_rule.rb | 220 +++++++++++ ...ding_points_details_earning_rule_source.rb | 210 +++++++++++ .../loyalty_pending_points_details_event.rb | 302 +++++++++++++++ ...ding_points_details_holder_loyalty_tier.rb | 221 +++++++++++ ...lty_pending_points_details_loyalty_tier.rb | 221 +++++++++++ .../loyalty_pending_points_details_order.rb | 221 +++++++++++ .../models/loyalty_tier_expiration.rb | 2 +- lib/VoucherifySdk/models/order.rb | 4 +- lib/VoucherifySdk/models/order_calculated.rb | 56 +-- .../models/order_calculated_item.rb | 22 +- .../models/order_redemptions_entry.rb | 2 +- .../models/orders_create_request_body.rb | 4 +- .../models/orders_create_response_body.rb | 56 +-- .../models/orders_get_response_body.rb | 56 +-- .../orders_import_create_request_body_item.rb | 4 +- .../models/orders_update_request_body.rb | 4 +- .../models/orders_update_response_body.rb | 56 +-- .../parameter_order_list_pending_points.rb | 40 ++ .../models/qualifications_option.rb | 6 +- .../models/redeemable_loyalty_card.rb | 2 +- .../models/redeemable_voucher_loyalty_card.rb | 23 +- .../models/redemption_entry_order.rb | 56 +-- .../redemption_entry_voucher_loyalty_card.rb | 23 +- .../models/redemption_voucher_loyalty_card.rb | 23 +- .../redemptions_get_response_body_order.rb | 56 +-- ..._get_response_body_voucher_loyalty_card.rb | 23 +- ...st_response_body_redemptions_item_order.rb | 55 ++- ...y_redemptions_item_voucher_loyalty_card.rb | 23 +- .../models/simple_loyalty_card.rb | 23 +- ...igns_campaign_setup_create_request_body.rb | 11 +- ...e_body_redeemables_item_result_discount.rb | 1 + .../models/voucher_loyalty_card.rb | 23 +- .../models/voucher_transaction.rb | 2 +- .../models/voucher_transaction_details.rb | 21 +- ...oucher_transaction_details_custom_event.rb | 4 +- ...oucher_transaction_details_earning_rule.rb | 2 +- ...oucher_transaction_details_event_schema.rb | 4 +- ...transaction_details_holder_loyalty_tier.rb | 221 +++++++++++ ...oucher_transaction_details_loyalty_tier.rb | 4 +- .../voucher_transaction_details_rollback.rb | 2 +- .../voucher_transaction_details_segment.rb | 2 + .../voucher_with_categories_loyalty_card.rb | 23 +- ...chers_create_response_body_loyalty_card.rb | 23 +- ...hers_disable_response_body_loyalty_card.rb | 23 +- ...chers_enable_response_body_loyalty_card.rb | 23 +- ...vouchers_get_response_body_loyalty_card.rb | 23 +- ...chers_update_response_body_loyalty_card.rb | 23 +- lib/VoucherifySdk/version.rb | 2 +- 211 files changed, 9349 insertions(+), 650 deletions(-) create mode 100644 docs/AccessSettings.md create mode 100644 docs/AccessSettingsAssign.md create mode 100644 docs/AccessSettingsUnassign.md create mode 100644 docs/ApplicableToOrderItemUnitsItem.md create mode 100644 docs/ApplicationDetailsItem.md create mode 100644 docs/EarningRulePendingPoints.md create mode 100644 docs/EventSource.md create mode 100644 docs/EventSourceApiKey.md create mode 100644 docs/EventSourceUser.md create mode 100644 docs/InapplicableToOrderItemUnitsItem.md create mode 100644 docs/LoyaltiesEarningRulesCreateResponseBodyPendingPoints.md create mode 100644 docs/LoyaltiesEarningRulesDisableResponseBodyPendingPoints.md create mode 100644 docs/LoyaltiesEarningRulesEnableResponseBodyPendingPoints.md create mode 100644 docs/LoyaltiesEarningRulesGetResponseBodyPendingPoints.md create mode 100644 docs/LoyaltiesEarningRulesUpdateResponseBodyPendingPoints.md create mode 100644 docs/LoyaltiesMembersPendingPointsActivateResponseBody.md create mode 100644 docs/LoyaltiesMembersPendingPointsActivateResponseBodyRelatedObject.md create mode 100644 docs/LoyaltiesMembersPendingPointsListResponseBody.md create mode 100644 docs/LoyaltiesPendingPointsListResponseBody.md create mode 100644 docs/LoyaltyCardTransactionDetailsHolderLoyaltyTier.md create mode 100644 docs/LoyaltyPendingPoints.md create mode 100644 docs/LoyaltyPendingPointsDetails.md create mode 100644 docs/LoyaltyPendingPointsDetailsEarningRule.md create mode 100644 docs/LoyaltyPendingPointsDetailsEarningRuleSource.md create mode 100644 docs/LoyaltyPendingPointsDetailsEvent.md create mode 100644 docs/LoyaltyPendingPointsDetailsHolderLoyaltyTier.md create mode 100644 docs/LoyaltyPendingPointsDetailsLoyaltyTier.md create mode 100644 docs/LoyaltyPendingPointsDetailsOrder.md create mode 100644 docs/ParameterOrderListPendingPoints.md create mode 100644 docs/VoucherTransactionDetailsHolderLoyaltyTier.md create mode 100644 lib/VoucherifySdk/models/access_settings.rb create mode 100644 lib/VoucherifySdk/models/access_settings_assign.rb create mode 100644 lib/VoucherifySdk/models/access_settings_unassign.rb create mode 100644 lib/VoucherifySdk/models/applicable_to_order_item_units_item.rb create mode 100644 lib/VoucherifySdk/models/application_details_item.rb create mode 100644 lib/VoucherifySdk/models/earning_rule_pending_points.rb create mode 100644 lib/VoucherifySdk/models/event_source.rb create mode 100644 lib/VoucherifySdk/models/event_source_api_key.rb create mode 100644 lib/VoucherifySdk/models/event_source_user.rb create mode 100644 lib/VoucherifySdk/models/inapplicable_to_order_item_units_item.rb create mode 100644 lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_pending_points.rb create mode 100644 lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_pending_points.rb create mode 100644 lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_pending_points.rb create mode 100644 lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_pending_points.rb create mode 100644 lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_pending_points.rb create mode 100644 lib/VoucherifySdk/models/loyalties_members_pending_points_activate_response_body.rb create mode 100644 lib/VoucherifySdk/models/loyalties_members_pending_points_activate_response_body_related_object.rb create mode 100644 lib/VoucherifySdk/models/loyalties_members_pending_points_list_response_body.rb create mode 100644 lib/VoucherifySdk/models/loyalties_pending_points_list_response_body.rb create mode 100644 lib/VoucherifySdk/models/loyalty_card_transaction_details_holder_loyalty_tier.rb create mode 100644 lib/VoucherifySdk/models/loyalty_pending_points.rb create mode 100644 lib/VoucherifySdk/models/loyalty_pending_points_details.rb create mode 100644 lib/VoucherifySdk/models/loyalty_pending_points_details_earning_rule.rb create mode 100644 lib/VoucherifySdk/models/loyalty_pending_points_details_earning_rule_source.rb create mode 100644 lib/VoucherifySdk/models/loyalty_pending_points_details_event.rb create mode 100644 lib/VoucherifySdk/models/loyalty_pending_points_details_holder_loyalty_tier.rb create mode 100644 lib/VoucherifySdk/models/loyalty_pending_points_details_loyalty_tier.rb create mode 100644 lib/VoucherifySdk/models/loyalty_pending_points_details_order.rb create mode 100644 lib/VoucherifySdk/models/parameter_order_list_pending_points.rb create mode 100644 lib/VoucherifySdk/models/voucher_transaction_details_holder_loyalty_tier.rb diff --git a/Dockerfile b/Dockerfile index e7eff1a6..4f2af7d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ WORKDIR /app COPY . . RUN gem build VoucherifySdk.gemspec -RUN gem install voucherify-8.0.2.gem +RUN gem install voucherify-8.0.3.gem RUN gem install dotenv RUN gem install rspec diff --git a/ENDPOINTS-COVERAGE.md b/ENDPOINTS-COVERAGE.md index 0d38cf17..3f429757 100644 --- a/ENDPOINTS-COVERAGE.md +++ b/ENDPOINTS-COVERAGE.md @@ -126,54 +126,59 @@ | /v1/rewards/{rewardId}/assignments/{assignmentId} | delete | Delete Reward Assignment | supported | | | /v1/rewards/{rewardId}/assignments/{assignmentId} | get | Get Reward Assignment | supported | | ## Loyalties -| endpoint | method | summary | is supported | is deprecated | -| ------------------------------------------------------------------- | ------ | ------------------------------------ | ------------------------------------ | ------------- | -| /v1/loyalties | get | List Loyalty Campaigns | supported | | -| /v1/loyalties | post | Create Loyalty Campaign | supported | | -| /v1/loyalties/{campaignId} | get | Get Loyalty Campaign | supported | | -| /v1/loyalties/{campaignId} | put | Update Loyalty Campaign | supported | | -| /v1/loyalties/{campaignId} | delete | Delete Loyalty Campaign | supported | | -| /v1/loyalties/{campaignId}/members | get | List Members | supported | | -| /v1/loyalties/{campaignId}/members | post | Add Member | supported | | -| /v1/loyalties/{campaignId}/members/{memberId} | get | Get Member | supported | | -| /v1/loyalties/members/{memberId} | get | Get Member | supported | | -| /v1/loyalties/{campaignId}/members/{memberId}/activity | get | List Member Activity | supported | | -| /v1/loyalties/members/{memberId}/activity | get | List Member Activity | supported | | -| /v1/loyalties/{campaignId}/members/{memberId}/balance | post | Add or Remove Loyalty Card Balance | supported | | -| /v1/loyalties/members/{memberId}/balance | post | Add or Remove Loyalty Card Balance | supported | | -| /v1/loyalties/{campaignId}/members/{memberId}/transfers | post | Transfer Loyalty Points | supported | | -| /v1/loyalties/{campaignId}/transactions | get | List Loyalty Campaign Transactions | | | -| /v1/loyalties/{campaignId}/transactions/export | post | Export Loyalty Campaign Transactions | | | -| /v1/loyalties/{campaignId}/members/{memberId}/transactions | get | List Loyalty Card Transactions | supported | | -| /v1/loyalties/members/{memberId}/transactions | get | List Loyalty Card Transactions | supported | | -| /v1/loyalties/members/{memberId}/transactions/export | post | Export Loyalty Card Transactions | supported | | -| /v1/loyalties/{campaignId}/members/{memberId}/transactions/export | post | Export Loyalty Card Transactions | supported | | -| /v1/loyalties/{campaignId}/members/{memberId}/points-expiration | get | Get Points Expiration | supported | | -| /v1/loyalties/{campaignId}/points-expiration/export | post | Create Points Expiration Export | supported | | -| /v1/loyalties/{campaignId}/earning-rules | get | List Earning Rules | supported | | -| /v1/loyalties/{campaignId}/earning-rules | post | Create Earning Rule | supported | | -| /v1/loyalties/{campaignId}/earning-rules/{earningRuleId} | get | Get Earning Rule | supported | | -| /v1/loyalties/{campaignId}/earning-rules/{earningRuleId} | put | Update Earning Rule | supported | | -| /v1/loyalties/{campaignId}/earning-rules/{earningRuleId} | delete | Delete Earning Rule | supported | | -| /v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/enable | post | Enable Earning Rule | supported | | -| /v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/disable | post | Disable Earning Rule | supported | | -| /v1/loyalties/members/{memberId}/rewards | get | List Member Rewards | supported | | -| /v1/loyalties/{campaignId}/reward-assignments/{assignmentId}/reward | get | Get Reward Details | supported | | -| /v1/loyalties/{campaignId}/reward-assignments | get | List Reward Assignments | supported | | -| /v1/loyalties/{campaignId}/rewards | get | List Reward Assignments | supported | | -| /v1/loyalties/{campaignId}/rewards | post | Create Reward Assignment | supported | | -| /v1/loyalties/{campaignId}/reward-assignments/{assignmentId} | get | Get Reward Assignment | supported | | -| /v1/loyalties/{campaignId}/rewards/{assignmentId} | get | Get Reward Assignment | supported | | -| /v1/loyalties/{campaignId}/rewards/{assignmentId} | put | Update Reward Assignment | supported | | -| /v1/loyalties/{campaignId}/rewards/{assignmentId} | delete | Delete Reward Assignment | supported | | -| /v1/loyalties/{campaignId}/members/{memberId}/redemption | post | Redeem Reward | supported | | -| /v1/loyalties/members/{memberId}/redemption | post | Redeem Reward | supported | | -| /v1/loyalties/{campaignId}/tiers | get | List Loyalty Tiers | supported | | -| /v1/loyalties/{campaignId}/tiers | post | Create loyalty tiers | supported | | -| /v1/loyalties/{campaignId}/tiers/{loyaltyTierId} | get | Get Loyalty Tier | supported | | -| /v1/loyalties/members/{memberId}/tiers | get | List Member's Loyalty Tiers | supported | | -| /v1/loyalties/{campaignId}/tiers/{loyaltyTierId}/earning-rules | get | List Loyalty Tier Earning Rules | supported | | -| /v1/loyalties/{campaignId}/tiers/{loyaltyTierId}/rewards | get | List Loyalty Tier Rewards | supported | | +| endpoint | method | summary | is supported | is deprecated | +| -------------------------------------------------------------------------- | ------ | ---------------------------------------- | ------------------------------------ | ------------- | +| /v1/loyalties | get | List Loyalty Campaigns | supported | | +| /v1/loyalties | post | Create Loyalty Campaign | supported | | +| /v1/loyalties/{campaignId} | get | Get Loyalty Campaign | supported | | +| /v1/loyalties/{campaignId} | put | Update Loyalty Campaign | supported | | +| /v1/loyalties/{campaignId} | delete | Delete Loyalty Campaign | supported | | +| /v1/loyalties/{campaignId}/members | get | List Members | supported | | +| /v1/loyalties/{campaignId}/members | post | Add Member | supported | | +| /v1/loyalties/{campaignId}/members/{memberId} | get | Get Member | supported | | +| /v1/loyalties/members/{memberId} | get | Get Member | supported | | +| /v1/loyalties/{campaignId}/pending-points | get | List Campaign Pending Points | supported | | +| /v1/loyalties/{campaignId}/members/{memberId}/pending-points | get | List Member Pending Points | supported | | +| /v1/loyalties/members/{memberId}/pending-points | get | List Member Pending Points | supported | | +| /v1/loyalties/members/{memberId}/pending-points/{pendingPointsId}/activate | post | Activate Member Pending Points | supported | | +| /v1/loyalties/members/{memberId}/pending-points/{pendingPointsId}/cancel | post | Cancel Member Pending Points | supported | | +| /v1/loyalties/{campaignId}/members/{memberId}/activity | get | List Member Activity | supported | | +| /v1/loyalties/members/{memberId}/activity | get | List Member Activity | supported | | +| /v1/loyalties/{campaignId}/members/{memberId}/balance | post | Add or Remove Loyalty Card Balance | supported | | +| /v1/loyalties/members/{memberId}/balance | post | Add or Remove Loyalty Card Balance | supported | | +| /v1/loyalties/{campaignId}/members/{memberId}/transfers | post | Transfer Loyalty Points | supported | | +| /v1/loyalties/{campaignId}/transactions | get | List Loyalty Campaign Transactions | | | +| /v1/loyalties/{campaignId}/transactions/export | post | Export Loyalty Campaign Transactions | | | +| /v1/loyalties/{campaignId}/members/{memberId}/transactions | get | List Loyalty Card Transactions | supported | | +| /v1/loyalties/members/{memberId}/transactions | get | List Loyalty Card Transactions | supported | | +| /v1/loyalties/members/{memberId}/transactions/export | post | Export Loyalty Card Transactions | supported | | +| /v1/loyalties/{campaignId}/members/{memberId}/transactions/export | post | Export Loyalty Card Transactions | supported | | +| /v1/loyalties/{campaignId}/members/{memberId}/points-expiration | get | List Loyalty Card Point Expiration | supported | | +| /v1/loyalties/{campaignId}/points-expiration/export | post | Export Loyalty Campaign Point Expiration | supported | | +| /v1/loyalties/{campaignId}/earning-rules | get | List Earning Rules | supported | | +| /v1/loyalties/{campaignId}/earning-rules | post | Create Earning Rule | supported | | +| /v1/loyalties/{campaignId}/earning-rules/{earningRuleId} | get | Get Earning Rule | supported | | +| /v1/loyalties/{campaignId}/earning-rules/{earningRuleId} | put | Update Earning Rule | supported | | +| /v1/loyalties/{campaignId}/earning-rules/{earningRuleId} | delete | Delete Earning Rule | supported | | +| /v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/enable | post | Enable Earning Rule | supported | | +| /v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/disable | post | Disable Earning Rule | supported | | +| /v1/loyalties/members/{memberId}/rewards | get | List Member Rewards | supported | | +| /v1/loyalties/{campaignId}/reward-assignments/{assignmentId}/reward | get | Get Reward Details | supported | | +| /v1/loyalties/{campaignId}/reward-assignments | get | List Reward Assignments | supported | | +| /v1/loyalties/{campaignId}/rewards | get | List Reward Assignments | supported | | +| /v1/loyalties/{campaignId}/rewards | post | Create Reward Assignment | supported | | +| /v1/loyalties/{campaignId}/reward-assignments/{assignmentId} | get | Get Reward Assignment | supported | | +| /v1/loyalties/{campaignId}/rewards/{assignmentId} | get | Get Reward Assignment | supported | | +| /v1/loyalties/{campaignId}/rewards/{assignmentId} | put | Update Reward Assignment | supported | | +| /v1/loyalties/{campaignId}/rewards/{assignmentId} | delete | Delete Reward Assignment | supported | | +| /v1/loyalties/{campaignId}/members/{memberId}/redemption | post | Redeem Reward | supported | | +| /v1/loyalties/members/{memberId}/redemption | post | Redeem Reward | supported | | +| /v1/loyalties/{campaignId}/tiers | get | List Loyalty Tiers | supported | | +| /v1/loyalties/{campaignId}/tiers | post | Create loyalty tiers | supported | | +| /v1/loyalties/{campaignId}/tiers/{loyaltyTierId} | get | Get Loyalty Tier | supported | | +| /v1/loyalties/members/{memberId}/tiers | get | List Member's Loyalty Tiers | supported | | +| /v1/loyalties/{campaignId}/tiers/{loyaltyTierId}/earning-rules | get | List Loyalty Tier Earning Rules | supported | | +| /v1/loyalties/{campaignId}/tiers/{loyaltyTierId}/rewards | get | List Loyalty Tier Rewards | supported | | ## Customers | endpoint | method | summary | is supported | is deprecated | | --------------------------------------------- | ------ | ------------------------------------- | ------------------------------------ | ------------------------------------ | diff --git a/README.md b/README.md index 2f928b5d..813b0186 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,13 @@ Remember that this SDK is auto generated (except of the tests) so changes made h ## 📅 Changelog +- **2024-01-29** - `8.0.3` + - Added support for **GET** /v1/loyalties/{campaignId}/pending-points + - Added support for **GET** /v1/loyalties/members/{memberId}/pending-points + - Added support for **GET** /v1/loyalties/{campaignId}/members/{memberId}/pending-points + - Added support for **POST** /v1/loyalties/members/{memberId}/pending-points/{pendingPointsId}/activate + - Added support for **POST** /v1/loyalties/members/{memberId}/pending-points/{pendingPointsId}/cancel + - Added types for pending points (loyalties) and access settings (areas and stores) - **2024-11-26** - `8.0.2` - Added support for `STANDALONE` campaign type. - Added optional `metadata` in `OrderCalculatedItemSku` @@ -286,11 +293,13 @@ Class | Method | HTTP request | Description *VoucherifySdk::ExportsApi* | [**list_exports**](docs/ExportsApi.md#list_exports) | **GET** /v1/exports | List Exports *VoucherifySdk::LocationsApi* | [**get_location**](docs/LocationsApi.md#get_location) | **GET** /v1/locations/{locationId} | Get Location *VoucherifySdk::LocationsApi* | [**list_locations**](docs/LocationsApi.md#list_locations) | **GET** /v1/locations | List Locations +*VoucherifySdk::LoyaltiesApi* | [**activate_member_pending_points**](docs/LoyaltiesApi.md#activate_member_pending_points) | **POST** /v1/loyalties/members/{memberId}/pending-points/{pendingPointsId}/activate | Activate Member Pending Points *VoucherifySdk::LoyaltiesApi* | [**add_member**](docs/LoyaltiesApi.md#add_member) | **POST** /v1/loyalties/{campaignId}/members | Add Member +*VoucherifySdk::LoyaltiesApi* | [**cancel_member_pending_points**](docs/LoyaltiesApi.md#cancel_member_pending_points) | **POST** /v1/loyalties/members/{memberId}/pending-points/{pendingPointsId}/cancel | Cancel Member Pending Points *VoucherifySdk::LoyaltiesApi* | [**create_earning_rule**](docs/LoyaltiesApi.md#create_earning_rule) | **POST** /v1/loyalties/{campaignId}/earning-rules | Create Earning Rule *VoucherifySdk::LoyaltiesApi* | [**create_in_bulk_loyalty_tiers**](docs/LoyaltiesApi.md#create_in_bulk_loyalty_tiers) | **POST** /v1/loyalties/{campaignId}/tiers | Create loyalty tiers *VoucherifySdk::LoyaltiesApi* | [**create_loyalty_program**](docs/LoyaltiesApi.md#create_loyalty_program) | **POST** /v1/loyalties | Create Loyalty Campaign -*VoucherifySdk::LoyaltiesApi* | [**create_points_expiration_export**](docs/LoyaltiesApi.md#create_points_expiration_export) | **POST** /v1/loyalties/{campaignId}/points-expiration/export | Create Points Expiration Export +*VoucherifySdk::LoyaltiesApi* | [**create_points_expiration_export**](docs/LoyaltiesApi.md#create_points_expiration_export) | **POST** /v1/loyalties/{campaignId}/points-expiration/export | Export Loyalty Campaign Point Expiration *VoucherifySdk::LoyaltiesApi* | [**create_reward_assignment1**](docs/LoyaltiesApi.md#create_reward_assignment1) | **POST** /v1/loyalties/{campaignId}/rewards | Create Reward Assignment *VoucherifySdk::LoyaltiesApi* | [**delete_earning_rule**](docs/LoyaltiesApi.md#delete_earning_rule) | **DELETE** /v1/loyalties/{campaignId}/earning-rules/{earningRuleId} | Delete Earning Rule *VoucherifySdk::LoyaltiesApi* | [**delete_loyalty_program**](docs/LoyaltiesApi.md#delete_loyalty_program) | **DELETE** /v1/loyalties/{campaignId} | Delete Loyalty Campaign @@ -307,6 +316,7 @@ Class | Method | HTTP request | Description *VoucherifySdk::LoyaltiesApi* | [**get_reward_assignment1**](docs/LoyaltiesApi.md#get_reward_assignment1) | **GET** /v1/loyalties/{campaignId}/reward-assignments/{assignmentId} | Get Reward Assignment *VoucherifySdk::LoyaltiesApi* | [**get_reward_assignment2**](docs/LoyaltiesApi.md#get_reward_assignment2) | **GET** /v1/loyalties/{campaignId}/rewards/{assignmentId} | Get Reward Assignment *VoucherifySdk::LoyaltiesApi* | [**get_reward_details**](docs/LoyaltiesApi.md#get_reward_details) | **GET** /v1/loyalties/{campaignId}/reward-assignments/{assignmentId}/reward | Get Reward Details +*VoucherifySdk::LoyaltiesApi* | [**list_campaign_pending_points**](docs/LoyaltiesApi.md#list_campaign_pending_points) | **GET** /v1/loyalties/{campaignId}/pending-points | List Campaign Pending Points *VoucherifySdk::LoyaltiesApi* | [**list_earning_rules**](docs/LoyaltiesApi.md#list_earning_rules) | **GET** /v1/loyalties/{campaignId}/earning-rules | List Earning Rules *VoucherifySdk::LoyaltiesApi* | [**list_loyalty_card_transactions**](docs/LoyaltiesApi.md#list_loyalty_card_transactions) | **GET** /v1/loyalties/members/{memberId}/transactions | List Loyalty Card Transactions *VoucherifySdk::LoyaltiesApi* | [**list_loyalty_card_transactions1**](docs/LoyaltiesApi.md#list_loyalty_card_transactions1) | **GET** /v1/loyalties/{campaignId}/members/{memberId}/transactions | List Loyalty Card Transactions @@ -317,9 +327,11 @@ Class | Method | HTTP request | Description *VoucherifySdk::LoyaltiesApi* | [**list_member_activity**](docs/LoyaltiesApi.md#list_member_activity) | **GET** /v1/loyalties/members/{memberId}/activity | List Member Activity *VoucherifySdk::LoyaltiesApi* | [**list_member_activity1**](docs/LoyaltiesApi.md#list_member_activity1) | **GET** /v1/loyalties/{campaignId}/members/{memberId}/activity | List Member Activity *VoucherifySdk::LoyaltiesApi* | [**list_member_loyalty_tier**](docs/LoyaltiesApi.md#list_member_loyalty_tier) | **GET** /v1/loyalties/members/{memberId}/tiers | List Member's Loyalty Tiers +*VoucherifySdk::LoyaltiesApi* | [**list_member_pending_points**](docs/LoyaltiesApi.md#list_member_pending_points) | **GET** /v1/loyalties/members/{memberId}/pending-points | List Member Pending Points +*VoucherifySdk::LoyaltiesApi* | [**list_member_pending_points1**](docs/LoyaltiesApi.md#list_member_pending_points1) | **GET** /v1/loyalties/{campaignId}/members/{memberId}/pending-points | List Member Pending Points *VoucherifySdk::LoyaltiesApi* | [**list_member_rewards**](docs/LoyaltiesApi.md#list_member_rewards) | **GET** /v1/loyalties/members/{memberId}/rewards | List Member Rewards *VoucherifySdk::LoyaltiesApi* | [**list_members**](docs/LoyaltiesApi.md#list_members) | **GET** /v1/loyalties/{campaignId}/members | List Members -*VoucherifySdk::LoyaltiesApi* | [**list_points_expiration**](docs/LoyaltiesApi.md#list_points_expiration) | **GET** /v1/loyalties/{campaignId}/members/{memberId}/points-expiration | Get Points Expiration +*VoucherifySdk::LoyaltiesApi* | [**list_points_expiration**](docs/LoyaltiesApi.md#list_points_expiration) | **GET** /v1/loyalties/{campaignId}/members/{memberId}/points-expiration | List Loyalty Card Point Expiration *VoucherifySdk::LoyaltiesApi* | [**list_reward_assignments1**](docs/LoyaltiesApi.md#list_reward_assignments1) | **GET** /v1/loyalties/{campaignId}/reward-assignments | List Reward Assignments *VoucherifySdk::LoyaltiesApi* | [**list_reward_assignments2**](docs/LoyaltiesApi.md#list_reward_assignments2) | **GET** /v1/loyalties/{campaignId}/rewards | List Reward Assignments *VoucherifySdk::LoyaltiesApi* | [**redeem_reward**](docs/LoyaltiesApi.md#redeem_reward) | **POST** /v1/loyalties/members/{memberId}/redemption | Redeem Reward @@ -475,10 +487,15 @@ Class | Method | HTTP request | Description ## 📚 Documentation for Models + - [VoucherifySdk::AccessSettings](docs/AccessSettings.md) + - [VoucherifySdk::AccessSettingsAssign](docs/AccessSettingsAssign.md) - [VoucherifySdk::AccessSettingsCampaignAssignmentsList](docs/AccessSettingsCampaignAssignmentsList.md) + - [VoucherifySdk::AccessSettingsUnassign](docs/AccessSettingsUnassign.md) - [VoucherifySdk::ApplicableTo](docs/ApplicableTo.md) - [VoucherifySdk::ApplicableToEffect](docs/ApplicableToEffect.md) + - [VoucherifySdk::ApplicableToOrderItemUnitsItem](docs/ApplicableToOrderItemUnitsItem.md) - [VoucherifySdk::ApplicableToResultList](docs/ApplicableToResultList.md) + - [VoucherifySdk::ApplicationDetailsItem](docs/ApplicationDetailsItem.md) - [VoucherifySdk::AreaStoreCampaignAssignment](docs/AreaStoreCampaignAssignment.md) - [VoucherifySdk::AsyncActionBase](docs/AsyncActionBase.md) - [VoucherifySdk::AsyncActionGetResponseBody](docs/AsyncActionGetResponseBody.md) @@ -621,10 +638,14 @@ Class | Method | HTTP request | Description - [VoucherifySdk::EarningRuleLoyaltyOrderMetadata](docs/EarningRuleLoyaltyOrderMetadata.md) - [VoucherifySdk::EarningRuleLoyaltyOrderTotalAmount](docs/EarningRuleLoyaltyOrderTotalAmount.md) - [VoucherifySdk::EarningRuleLoyaltyTier](docs/EarningRuleLoyaltyTier.md) + - [VoucherifySdk::EarningRulePendingPoints](docs/EarningRulePendingPoints.md) - [VoucherifySdk::EarningRuleSegment](docs/EarningRuleSegment.md) - [VoucherifySdk::EarningRuleSource](docs/EarningRuleSource.md) - [VoucherifySdk::Error](docs/Error.md) - [VoucherifySdk::ErrorError](docs/ErrorError.md) + - [VoucherifySdk::EventSource](docs/EventSource.md) + - [VoucherifySdk::EventSourceApiKey](docs/EventSourceApiKey.md) + - [VoucherifySdk::EventSourceUser](docs/EventSourceUser.md) - [VoucherifySdk::EventsCreateRequestBody](docs/EventsCreateRequestBody.md) - [VoucherifySdk::EventsCreateRequestBodyLoyalty](docs/EventsCreateRequestBodyLoyalty.md) - [VoucherifySdk::EventsCreateRequestBodyReferral](docs/EventsCreateRequestBodyReferral.md) @@ -651,6 +672,7 @@ Class | Method | HTTP request | Description - [VoucherifySdk::FiltersCondition](docs/FiltersCondition.md) - [VoucherifySdk::Gift](docs/Gift.md) - [VoucherifySdk::InapplicableTo](docs/InapplicableTo.md) + - [VoucherifySdk::InapplicableToOrderItemUnitsItem](docs/InapplicableToOrderItemUnitsItem.md) - [VoucherifySdk::InapplicableToResultList](docs/InapplicableToResultList.md) - [VoucherifySdk::Junction](docs/Junction.md) - [VoucherifySdk::ListPublicationsItemVoucher](docs/ListPublicationsItemVoucher.md) @@ -700,6 +722,7 @@ Class | Method | HTTP request | Description - [VoucherifySdk::LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrderMetadata](docs/LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrderMetadata.md) - [VoucherifySdk::LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrderTotalAmount](docs/LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrderTotalAmount.md) - [VoucherifySdk::LoyaltiesEarningRulesCreateResponseBodyLoyaltyTier](docs/LoyaltiesEarningRulesCreateResponseBodyLoyaltyTier.md) + - [VoucherifySdk::LoyaltiesEarningRulesCreateResponseBodyPendingPoints](docs/LoyaltiesEarningRulesCreateResponseBodyPendingPoints.md) - [VoucherifySdk::LoyaltiesEarningRulesCreateResponseBodySegment](docs/LoyaltiesEarningRulesCreateResponseBodySegment.md) - [VoucherifySdk::LoyaltiesEarningRulesCreateResponseBodySource](docs/LoyaltiesEarningRulesCreateResponseBodySource.md) - [VoucherifySdk::LoyaltiesEarningRulesDisableResponseBody](docs/LoyaltiesEarningRulesDisableResponseBody.md) @@ -718,6 +741,7 @@ Class | Method | HTTP request | Description - [VoucherifySdk::LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrderMetadata](docs/LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrderMetadata.md) - [VoucherifySdk::LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrderTotalAmount](docs/LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrderTotalAmount.md) - [VoucherifySdk::LoyaltiesEarningRulesDisableResponseBodyLoyaltyTier](docs/LoyaltiesEarningRulesDisableResponseBodyLoyaltyTier.md) + - [VoucherifySdk::LoyaltiesEarningRulesDisableResponseBodyPendingPoints](docs/LoyaltiesEarningRulesDisableResponseBodyPendingPoints.md) - [VoucherifySdk::LoyaltiesEarningRulesDisableResponseBodySegment](docs/LoyaltiesEarningRulesDisableResponseBodySegment.md) - [VoucherifySdk::LoyaltiesEarningRulesDisableResponseBodySource](docs/LoyaltiesEarningRulesDisableResponseBodySource.md) - [VoucherifySdk::LoyaltiesEarningRulesEnableResponseBody](docs/LoyaltiesEarningRulesEnableResponseBody.md) @@ -736,6 +760,7 @@ Class | Method | HTTP request | Description - [VoucherifySdk::LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrderMetadata](docs/LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrderMetadata.md) - [VoucherifySdk::LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrderTotalAmount](docs/LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrderTotalAmount.md) - [VoucherifySdk::LoyaltiesEarningRulesEnableResponseBodyLoyaltyTier](docs/LoyaltiesEarningRulesEnableResponseBodyLoyaltyTier.md) + - [VoucherifySdk::LoyaltiesEarningRulesEnableResponseBodyPendingPoints](docs/LoyaltiesEarningRulesEnableResponseBodyPendingPoints.md) - [VoucherifySdk::LoyaltiesEarningRulesEnableResponseBodySegment](docs/LoyaltiesEarningRulesEnableResponseBodySegment.md) - [VoucherifySdk::LoyaltiesEarningRulesEnableResponseBodySource](docs/LoyaltiesEarningRulesEnableResponseBodySource.md) - [VoucherifySdk::LoyaltiesEarningRulesGetResponseBody](docs/LoyaltiesEarningRulesGetResponseBody.md) @@ -754,6 +779,7 @@ Class | Method | HTTP request | Description - [VoucherifySdk::LoyaltiesEarningRulesGetResponseBodyLoyaltyOrderMetadata](docs/LoyaltiesEarningRulesGetResponseBodyLoyaltyOrderMetadata.md) - [VoucherifySdk::LoyaltiesEarningRulesGetResponseBodyLoyaltyOrderTotalAmount](docs/LoyaltiesEarningRulesGetResponseBodyLoyaltyOrderTotalAmount.md) - [VoucherifySdk::LoyaltiesEarningRulesGetResponseBodyLoyaltyTier](docs/LoyaltiesEarningRulesGetResponseBodyLoyaltyTier.md) + - [VoucherifySdk::LoyaltiesEarningRulesGetResponseBodyPendingPoints](docs/LoyaltiesEarningRulesGetResponseBodyPendingPoints.md) - [VoucherifySdk::LoyaltiesEarningRulesGetResponseBodySegment](docs/LoyaltiesEarningRulesGetResponseBodySegment.md) - [VoucherifySdk::LoyaltiesEarningRulesGetResponseBodySource](docs/LoyaltiesEarningRulesGetResponseBodySource.md) - [VoucherifySdk::LoyaltiesEarningRulesListResponseBody](docs/LoyaltiesEarningRulesListResponseBody.md) @@ -788,6 +814,7 @@ Class | Method | HTTP request | Description - [VoucherifySdk::LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrderMetadata](docs/LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrderMetadata.md) - [VoucherifySdk::LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrderTotalAmount](docs/LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrderTotalAmount.md) - [VoucherifySdk::LoyaltiesEarningRulesUpdateResponseBodyLoyaltyTier](docs/LoyaltiesEarningRulesUpdateResponseBodyLoyaltyTier.md) + - [VoucherifySdk::LoyaltiesEarningRulesUpdateResponseBodyPendingPoints](docs/LoyaltiesEarningRulesUpdateResponseBodyPendingPoints.md) - [VoucherifySdk::LoyaltiesEarningRulesUpdateResponseBodySegment](docs/LoyaltiesEarningRulesUpdateResponseBodySegment.md) - [VoucherifySdk::LoyaltiesEarningRulesUpdateResponseBodySource](docs/LoyaltiesEarningRulesUpdateResponseBodySource.md) - [VoucherifySdk::LoyaltiesGetCampaignResponseBody](docs/LoyaltiesGetCampaignResponseBody.md) @@ -807,6 +834,9 @@ Class | Method | HTTP request | Description - [VoucherifySdk::LoyaltiesMembersGetResponseBodyLoyaltyCard](docs/LoyaltiesMembersGetResponseBodyLoyaltyCard.md) - [VoucherifySdk::LoyaltiesMembersGetResponseBodyPublish](docs/LoyaltiesMembersGetResponseBodyPublish.md) - [VoucherifySdk::LoyaltiesMembersGetResponseBodyRedemption](docs/LoyaltiesMembersGetResponseBodyRedemption.md) + - [VoucherifySdk::LoyaltiesMembersPendingPointsActivateResponseBody](docs/LoyaltiesMembersPendingPointsActivateResponseBody.md) + - [VoucherifySdk::LoyaltiesMembersPendingPointsActivateResponseBodyRelatedObject](docs/LoyaltiesMembersPendingPointsActivateResponseBodyRelatedObject.md) + - [VoucherifySdk::LoyaltiesMembersPendingPointsListResponseBody](docs/LoyaltiesMembersPendingPointsListResponseBody.md) - [VoucherifySdk::LoyaltiesMembersPointsExpirationListResponseBody](docs/LoyaltiesMembersPointsExpirationListResponseBody.md) - [VoucherifySdk::LoyaltiesMembersPointsExpirationListResponseBodyDataItem](docs/LoyaltiesMembersPointsExpirationListResponseBodyDataItem.md) - [VoucherifySdk::LoyaltiesMembersPointsExpirationListResponseBodyDataItemBucket](docs/LoyaltiesMembersPointsExpirationListResponseBodyDataItemBucket.md) @@ -839,6 +869,7 @@ Class | Method | HTTP request | Description - [VoucherifySdk::LoyaltiesMembersTransfersCreateResponseBodyLoyaltyCard](docs/LoyaltiesMembersTransfersCreateResponseBodyLoyaltyCard.md) - [VoucherifySdk::LoyaltiesMembersTransfersCreateResponseBodyPublish](docs/LoyaltiesMembersTransfersCreateResponseBodyPublish.md) - [VoucherifySdk::LoyaltiesMembersTransfersCreateResponseBodyRedemption](docs/LoyaltiesMembersTransfersCreateResponseBodyRedemption.md) + - [VoucherifySdk::LoyaltiesPendingPointsListResponseBody](docs/LoyaltiesPendingPointsListResponseBody.md) - [VoucherifySdk::LoyaltiesPointsExpirationExportCreateRequestBody](docs/LoyaltiesPointsExpirationExportCreateRequestBody.md) - [VoucherifySdk::LoyaltiesPointsExpirationExportCreateRequestBodyParameters](docs/LoyaltiesPointsExpirationExportCreateRequestBodyParameters.md) - [VoucherifySdk::LoyaltiesPointsExpirationExportCreateRequestBodyParametersFilters](docs/LoyaltiesPointsExpirationExportCreateRequestBodyParametersFilters.md) @@ -899,6 +930,7 @@ Class | Method | HTTP request | Description - [VoucherifySdk::LoyaltyCardTransactionDetailsEarningRuleSource](docs/LoyaltyCardTransactionDetailsEarningRuleSource.md) - [VoucherifySdk::LoyaltyCardTransactionDetailsEvent](docs/LoyaltyCardTransactionDetailsEvent.md) - [VoucherifySdk::LoyaltyCardTransactionDetailsEventSchema](docs/LoyaltyCardTransactionDetailsEventSchema.md) + - [VoucherifySdk::LoyaltyCardTransactionDetailsHolderLoyaltyTier](docs/LoyaltyCardTransactionDetailsHolderLoyaltyTier.md) - [VoucherifySdk::LoyaltyCardTransactionDetailsLoyaltyTier](docs/LoyaltyCardTransactionDetailsLoyaltyTier.md) - [VoucherifySdk::LoyaltyCardTransactionDetailsOrder](docs/LoyaltyCardTransactionDetailsOrder.md) - [VoucherifySdk::LoyaltyCardTransactionDetailsRedemption](docs/LoyaltyCardTransactionDetailsRedemption.md) @@ -910,6 +942,14 @@ Class | Method | HTTP request | Description - [VoucherifySdk::LoyaltyMemberLoyaltyCard](docs/LoyaltyMemberLoyaltyCard.md) - [VoucherifySdk::LoyaltyMemberPublish](docs/LoyaltyMemberPublish.md) - [VoucherifySdk::LoyaltyMemberRedemption](docs/LoyaltyMemberRedemption.md) + - [VoucherifySdk::LoyaltyPendingPoints](docs/LoyaltyPendingPoints.md) + - [VoucherifySdk::LoyaltyPendingPointsDetails](docs/LoyaltyPendingPointsDetails.md) + - [VoucherifySdk::LoyaltyPendingPointsDetailsEarningRule](docs/LoyaltyPendingPointsDetailsEarningRule.md) + - [VoucherifySdk::LoyaltyPendingPointsDetailsEarningRuleSource](docs/LoyaltyPendingPointsDetailsEarningRuleSource.md) + - [VoucherifySdk::LoyaltyPendingPointsDetailsEvent](docs/LoyaltyPendingPointsDetailsEvent.md) + - [VoucherifySdk::LoyaltyPendingPointsDetailsHolderLoyaltyTier](docs/LoyaltyPendingPointsDetailsHolderLoyaltyTier.md) + - [VoucherifySdk::LoyaltyPendingPointsDetailsLoyaltyTier](docs/LoyaltyPendingPointsDetailsLoyaltyTier.md) + - [VoucherifySdk::LoyaltyPendingPointsDetailsOrder](docs/LoyaltyPendingPointsDetailsOrder.md) - [VoucherifySdk::LoyaltyPointsBucket](docs/LoyaltyPointsBucket.md) - [VoucherifySdk::LoyaltyPointsBucketBucket](docs/LoyaltyPointsBucketBucket.md) - [VoucherifySdk::LoyaltyTier](docs/LoyaltyTier.md) @@ -1152,6 +1192,7 @@ Class | Method | HTTP request | Description - [VoucherifySdk::ParameterOrderListLocations](docs/ParameterOrderListLocations.md) - [VoucherifySdk::ParameterOrderListLoyaltyTiers](docs/ParameterOrderListLoyaltyTiers.md) - [VoucherifySdk::ParameterOrderListOrders](docs/ParameterOrderListOrders.md) + - [VoucherifySdk::ParameterOrderListPendingPoints](docs/ParameterOrderListPendingPoints.md) - [VoucherifySdk::ParameterOrderListPromotionTiers](docs/ParameterOrderListPromotionTiers.md) - [VoucherifySdk::ParameterOrderListPromotionTiersClientSide](docs/ParameterOrderListPromotionTiersClientSide.md) - [VoucherifySdk::ParameterOrderListPublications](docs/ParameterOrderListPublications.md) @@ -1544,6 +1585,7 @@ Class | Method | HTTP request | Description - [VoucherifySdk::VoucherTransactionDetailsEarningRuleSource](docs/VoucherTransactionDetailsEarningRuleSource.md) - [VoucherifySdk::VoucherTransactionDetailsEvent](docs/VoucherTransactionDetailsEvent.md) - [VoucherifySdk::VoucherTransactionDetailsEventSchema](docs/VoucherTransactionDetailsEventSchema.md) + - [VoucherifySdk::VoucherTransactionDetailsHolderLoyaltyTier](docs/VoucherTransactionDetailsHolderLoyaltyTier.md) - [VoucherifySdk::VoucherTransactionDetailsLoyaltyTier](docs/VoucherTransactionDetailsLoyaltyTier.md) - [VoucherifySdk::VoucherTransactionDetailsOrder](docs/VoucherTransactionDetailsOrder.md) - [VoucherifySdk::VoucherTransactionDetailsRedemption](docs/VoucherTransactionDetailsRedemption.md) diff --git a/__tests__/spec/12_validation_rules_spec.rb b/__tests__/spec/12_validation_rules_spec.rb index 2b33253c..1d05999b 100644 --- a/__tests__/spec/12_validation_rules_spec.rb +++ b/__tests__/spec/12_validation_rules_spec.rb @@ -19,21 +19,7 @@ related_object_type: "voucher", related_object_id: voucher.code }) - - created_validation_rule_assignment = @validation_rules_api_instance.create_validation_rule_assignment(validation_rule.id, { - validation_rules_assignments_create_request_body: validationRulesAssignmentsCreateRequestBody - }) - snapshot_name = 'validation_rules/created_validation_rule_assignment' - filtered_snapshot = get_snapshot_without_uniq_keys(snapshot_name) - - expect(created_validation_rule_assignment).not_to be_nil - expect(created_validation_rule_assignment.id).not_to be_nil - expect(created_validation_rule_assignment.created_at).not_to be_nil - expect(created_validation_rule_assignment.rule_id).to eq(validation_rule.id) - expect(created_validation_rule_assignment.related_object_id).to eq(voucher.id) - expect(created_validation_rule_assignment.related_object_type).to eq("voucher") - expect(created_validation_rule_assignment.object).to eq("validation_rules_assignment") - expect(validate_deep_match(filtered_snapshot, created_validation_rule_assignment)).to be true + # TODO end end diff --git a/docs/AccessSettings.md b/docs/AccessSettings.md new file mode 100644 index 00000000..ffd9e6d7 --- /dev/null +++ b/docs/AccessSettings.md @@ -0,0 +1,9 @@ +# VoucherifySdk::AccessSettings + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **assign** | [**AccessSettingsAssign**](AccessSettingsAssign.md) | | [optional] | +| **unassign** | [**AccessSettingsUnassign**](AccessSettingsUnassign.md) | | [optional] | + diff --git a/docs/AccessSettingsAssign.md b/docs/AccessSettingsAssign.md new file mode 100644 index 00000000..7e5f4717 --- /dev/null +++ b/docs/AccessSettingsAssign.md @@ -0,0 +1,10 @@ +# VoucherifySdk::AccessSettingsAssign + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **areas_ids** | **Array<String>** | List all area IDs to which the campaign will be assigned. | [optional] | +| **area_stores_ids** | **Array<String>** | List all store IDs to which the campaign will be assigned. | [optional] | +| **area_all_stores_ids** | **Array<String>** | List all area IDs where the campaign is assigned to all stores in the area. This assignment is not equal to the assignment to all `area_stores_ids` listed separately. | [optional] | + diff --git a/docs/AccessSettingsUnassign.md b/docs/AccessSettingsUnassign.md new file mode 100644 index 00000000..addbe6f9 --- /dev/null +++ b/docs/AccessSettingsUnassign.md @@ -0,0 +1,10 @@ +# VoucherifySdk::AccessSettingsUnassign + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **areas_ids** | **Array<String>** | List all area IDs from which the campaign will be unassigned. | [optional] | +| **area_stores_ids** | **Array<String>** | List all store IDs from which the campaign will be unassigned. | [optional] | +| **area_all_stores_ids** | **Array<String>** | List all area IDs where the campaign will be unassigned from all stores in the area. This unassignment is not equal to the unassignment from all `area_stores_ids` listed separately. | [optional] | + diff --git a/docs/ApplicableTo.md b/docs/ApplicableTo.md index 6ef67ea6..e4f02185 100644 --- a/docs/ApplicableTo.md +++ b/docs/ApplicableTo.md @@ -17,8 +17,9 @@ | **aggregated_quantity_limit** | **Integer** | The maximum number of units allowed to be discounted combined across all matched order line items. | [optional] | | **amount_limit** | **Integer** | Upper limit allowed to be applied as a discount per order line item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600. | [optional] | | **aggregated_amount_limit** | **Integer** | Maximum discount amount per order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects: - `APPLY_TO_ITEMS` (each item subtotal is discounted equally) - `APPLY_TO_ITEMS_BY_QUANTITY` (each unit of matched products has the same discount value) | [optional] | -| **order_item_indices** | **Array<Integer>** | Determines the order in which the discount is applied to the products or SKUs sent in the `order` object in the request. The counting begins from `0`. | [optional] | +| **order_item_indices** | **Array<Integer>** | Lists which order lines are (not) covered by the discount. The order in the array is determined by the sequence of applied discounts, while the numbers correspond to the order lines sent in the `order` object in the request. The first order line is assigned `0`, the second order line is assigned `1`, and so on. | [optional] | +| **order_item_units** | [**Array<ApplicableToOrderItemUnitsItem>**](ApplicableToOrderItemUnitsItem.md) | Lists which units within order lines are covered by the discount. The order line items are listed according to sequence of applied discounts while the `index` corresponds to the order line sent in the `order` object in the request. | [optional] | | **repeat** | **Integer** | Determines the recurrence of the discount, e.g. `\"repeat\": 3` means that the discount is applied to every third item. | [optional] | | **skip_initially** | **Integer** | Determines how many items are skipped before the discount is applied. | [optional] | -| **target** | **String** | Determines to which kinds of objects the discount is applicable. `\"ITEM\"` includes products and SKUs. | [optional] | +| **target** | **String** | Determines to which kinds of objects the discount is applicable. `ITEM` includes products and SKUs. `UNIT` means particular units within an order line. | [optional] | diff --git a/docs/ApplicableToOrderItemUnitsItem.md b/docs/ApplicableToOrderItemUnitsItem.md new file mode 100644 index 00000000..7e114c6e --- /dev/null +++ b/docs/ApplicableToOrderItemUnitsItem.md @@ -0,0 +1,9 @@ +# VoucherifySdk::ApplicableToOrderItemUnitsItem + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **index** | **Integer** | Number assigned to the order line item in accordance with the order sent in the request. | [optional] | +| **units** | **Array<Integer>** | Numbers of units in the order line covered by the discount; e.g. `2, 5, 8` for 10 units with the setting `\"skip_initially\": 1`, `\"repeat\": 3`. The counting of units starts from `1`. | [optional] | + diff --git a/docs/ApplicationDetailsItem.md b/docs/ApplicationDetailsItem.md new file mode 100644 index 00000000..98480d33 --- /dev/null +++ b/docs/ApplicationDetailsItem.md @@ -0,0 +1,14 @@ +# VoucherifySdk::ApplicationDetailsItem + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **source_index** | **Integer** | Index number of the source item that is replaced. The enumeration starts from `0`, which represents the first item in the request, e.g., if the replaced item is passed as the second in the request, `source_index` equals `3`. | [optional] | +| **source_applied_quantity** | **Integer** | Number of source units that are replaced. | [optional] | +| **source_applied_quantity_amount** | **Integer** | Amount equal to the price of the units that are replaced. Determines the change of the amount of the source item quantity. | [optional] | +| **target_index** | **Integer** | Index number of the target item that is a replacement of the source item. The enumeration continues the values for the order items, e.g. if there are three items in the request, `target_index` equals `3`, as enumeration starts from `0`. | [optional] | +| **target_applied_quantity** | **Integer** | Number of added target units that are replacements. | [optional] | +| **target_applied_quantity_amount** | **Integer** | Amount equal to the price of the units that are replacements. Determines the change in the amount of the target item quantity. | [optional] | +| **target_applied_discount_amount** | **Integer** | Discount amount applied to the target item with regard to the replacement. Equals the `target_applied_quantity_amount` minus `source_applied_quantity_amount`. | [optional] | + diff --git a/docs/AreaStoreCampaignAssignment.md b/docs/AreaStoreCampaignAssignment.md index 4aae6d1a..4d1246eb 100644 --- a/docs/AreaStoreCampaignAssignment.md +++ b/docs/AreaStoreCampaignAssignment.md @@ -6,6 +6,7 @@ | ---- | ---- | ----------- | ----- | | **id** | **String** | Unique identifier of the campaign assignment. | [optional] | | **area_id** | **String** | Unique identifier of the area to which the campaign is assigned. | [optional] | +| **all_stores** | **Boolean** | Determines if the campaign is assigned to all of the stores in the area, i.e. if an area ID is passed in the `access_settings.assign.area_all_stores_ids` in the request. | [optional] | | **area_store_id** | **String** | Unique identifier of the store to which the campaign is assigned. | [optional] | | **created_at** | **Time** | Date and time when the assignment was made. The value is shown in the ISO 8601 format. | [optional] | | **object** | **String** | The type of the object represented by JSON. This object stores information about the campaign assignment to areas or stores. | [optional][default to 'area_store_campaign_assignment'] | diff --git a/docs/BinApi.md b/docs/BinApi.md index 626b4214..2a4e7c4b 100644 --- a/docs/BinApi.md +++ b/docs/BinApi.md @@ -94,8 +94,8 @@ end api_instance = VoucherifySdk::BinApi.new opts = { limit: 56, # Integer | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. - order: VoucherifySdk::ParameterOrderListBin::ID, # ParameterOrderListBin | Orders the bin entries according the date and time when they were moved to the bin or according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order. - starting_after_id: 'starting_after_id_example', # String | A cursor for pagination. It retrieves the events starting after an event with the given ID. + order: VoucherifySdk::ParameterOrderListBin::ID, # ParameterOrderListBin | Orders the bin entries according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order. + starting_after_id: 'starting_after_id_example', # String | A cursor for pagination. It retrieves the results starting after a result with the given ID. filters: VoucherifySdk::ParameterFiltersListBin.new # ParameterFiltersListBin | Filters for listing bin entries. } @@ -113,8 +113,8 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **limit** | **Integer** | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. | [optional] | -| **order** | [**ParameterOrderListBin**](.md) | Orders the bin entries according the date and time when they were moved to the bin or according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order. | [optional] | -| **starting_after_id** | **String** | A cursor for pagination. It retrieves the events starting after an event with the given ID. | [optional] | +| **order** | [**ParameterOrderListBin**](.md) | Orders the bin entries according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order. | [optional] | +| **starting_after_id** | **String** | A cursor for pagination. It retrieves the results starting after a result with the given ID. | [optional] | | **filters** | [**ParameterFiltersListBin**](.md) | Filters for listing bin entries. | [optional] | ### Return type diff --git a/docs/Campaign.md b/docs/Campaign.md index f1536954..2276e76d 100644 --- a/docs/Campaign.md +++ b/docs/Campaign.md @@ -34,7 +34,7 @@ | **object** | **String** | The type of the object represented by JSON. This object stores information about the campaign. | [optional][default to 'campaign'] | | **referral_program** | [**ReferralProgram**](ReferralProgram.md) | | [optional] | | **loyalty_tiers_expiration** | [**LoyaltyTiersExpirationAll**](LoyaltyTiersExpirationAll.md) | | [optional] | +| **access_settings_assignments** | [**AccessSettingsCampaignAssignmentsList**](AccessSettingsCampaignAssignmentsList.md) | | [optional] | | **promotion** | [**PromotionTiersList**](PromotionTiersList.md) | | [optional] | | **validation_rules_assignments** | [**ValidationRulesAssignmentsList**](ValidationRulesAssignmentsList.md) | | [optional] | -| **access_settings_assignments** | [**AccessSettingsCampaignAssignmentsList**](AccessSettingsCampaignAssignmentsList.md) | | [optional] | diff --git a/docs/CampaignBase.md b/docs/CampaignBase.md index 6fa45661..b9a21979 100644 --- a/docs/CampaignBase.md +++ b/docs/CampaignBase.md @@ -34,4 +34,5 @@ | **object** | **String** | The type of the object represented by JSON. This object stores information about the campaign. | [optional][default to 'campaign'] | | **referral_program** | [**ReferralProgram**](ReferralProgram.md) | | [optional] | | **loyalty_tiers_expiration** | [**LoyaltyTiersExpirationAll**](LoyaltyTiersExpirationAll.md) | | [optional] | +| **access_settings_assignments** | [**AccessSettingsCampaignAssignmentsList**](AccessSettingsCampaignAssignmentsList.md) | | [optional] | diff --git a/docs/CampaignsCreateRequestBody.md b/docs/CampaignsCreateRequestBody.md index 9d315681..2c9f2851 100644 --- a/docs/CampaignsCreateRequestBody.md +++ b/docs/CampaignsCreateRequestBody.md @@ -20,6 +20,7 @@ | **category_id** | **String** | Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`. | [optional] | | **category** | **String** | The category assigned to the campaign. Either pass this parameter OR the `category_id`. | [optional] | | **metadata** | **Object** | The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format. | [optional] | +| **access_settings** | [**AccessSettings**](AccessSettings.md) | | [optional] | | **validation_rules** | **Array<String>** | Array containing the ID of the validation rule associated with the promotion tier. | [optional] | | **campaign_type** | **String** | | [optional] | | **voucher** | [**CampaignsCreateRequestBodyVoucher**](CampaignsCreateRequestBodyVoucher.md) | | [optional] | diff --git a/docs/CampaignsCreateResponseBody.md b/docs/CampaignsCreateResponseBody.md index e18ebfdc..4c7f7928 100644 --- a/docs/CampaignsCreateResponseBody.md +++ b/docs/CampaignsCreateResponseBody.md @@ -34,7 +34,7 @@ | **object** | **String** | The type of the object represented by JSON. This object stores information about the campaign. | [optional][default to 'campaign'] | | **referral_program** | [**ReferralProgram**](ReferralProgram.md) | | [optional] | | **loyalty_tiers_expiration** | [**LoyaltyTiersExpirationAll**](LoyaltyTiersExpirationAll.md) | | [optional] | +| **access_settings_assignments** | [**AccessSettingsCampaignAssignmentsList**](AccessSettingsCampaignAssignmentsList.md) | | [optional] | | **promotion** | [**PromotionTiersList**](PromotionTiersList.md) | | [optional] | | **validation_rules_assignments** | [**ValidationRulesAssignmentsList**](ValidationRulesAssignmentsList.md) | | [optional] | -| **access_settings_assignments** | [**AccessSettingsCampaignAssignmentsList**](AccessSettingsCampaignAssignmentsList.md) | | [optional] | diff --git a/docs/CampaignsGetResponseBody.md b/docs/CampaignsGetResponseBody.md index e91aaebb..79f415cd 100644 --- a/docs/CampaignsGetResponseBody.md +++ b/docs/CampaignsGetResponseBody.md @@ -34,7 +34,7 @@ | **object** | **String** | The type of the object represented by JSON. This object stores information about the campaign. | [optional][default to 'campaign'] | | **referral_program** | [**ReferralProgram**](ReferralProgram.md) | | [optional] | | **loyalty_tiers_expiration** | [**LoyaltyTiersExpirationAll**](LoyaltyTiersExpirationAll.md) | | [optional] | +| **access_settings_assignments** | [**AccessSettingsCampaignAssignmentsList**](AccessSettingsCampaignAssignmentsList.md) | | [optional] | | **promotion** | [**PromotionTiersList**](PromotionTiersList.md) | | [optional] | | **validation_rules_assignments** | [**ValidationRulesAssignmentsList**](ValidationRulesAssignmentsList.md) | | [optional] | -| **access_settings_assignments** | [**AccessSettingsCampaignAssignmentsList**](AccessSettingsCampaignAssignmentsList.md) | | [optional] | diff --git a/docs/CampaignsUpdateRequestBody.md b/docs/CampaignsUpdateRequestBody.md index 5be8c8c9..415fe31a 100644 --- a/docs/CampaignsUpdateRequestBody.md +++ b/docs/CampaignsUpdateRequestBody.md @@ -14,6 +14,7 @@ | **metadata** | **Object** | The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format. | [optional] | | **unset_metadata_fields** | **Array<String>** | Determine which metadata should be removed from campaign. | [optional] | | **category_id** | **String** | Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`. | [optional] | +| **access_settings** | [**AccessSettings**](AccessSettings.md) | | [optional] | | **activity_duration_after_publishing** | **String** | Defines the amount of time the vouchers will be active after publishing. The value is shown in the ISO 8601 format. For example, a voucher with the value of P24D will be valid for a duration of 24 days. | [optional] | | **join_once** | **Boolean** | If this value is set to `true`, customers will be able to join the campaign only once. It is always `false` for standalone voucher campaigns and it cannot be changed in them. | [optional] | | **auto_join** | **Boolean** | Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. | [optional] | diff --git a/docs/CampaignsUpdateResponseBody.md b/docs/CampaignsUpdateResponseBody.md index 0ed7e1d5..4ab654fd 100644 --- a/docs/CampaignsUpdateResponseBody.md +++ b/docs/CampaignsUpdateResponseBody.md @@ -34,7 +34,7 @@ | **object** | **String** | The type of the object represented by JSON. This object stores information about the campaign. | [optional][default to 'campaign'] | | **referral_program** | [**ReferralProgram**](ReferralProgram.md) | | [optional] | | **loyalty_tiers_expiration** | [**LoyaltyTiersExpirationAll**](LoyaltyTiersExpirationAll.md) | | [optional] | +| **access_settings_assignments** | [**AccessSettingsCampaignAssignmentsList**](AccessSettingsCampaignAssignmentsList.md) | | [optional] | | **promotion** | [**PromotionTiersList**](PromotionTiersList.md) | | [optional] | | **validation_rules_assignments** | [**ValidationRulesAssignmentsList**](ValidationRulesAssignmentsList.md) | | [optional] | -| **access_settings_assignments** | [**AccessSettingsCampaignAssignmentsList**](AccessSettingsCampaignAssignmentsList.md) | | [optional] | diff --git a/docs/CampaignsVouchersCreateCombinedResponseBodyLoyaltyCard.md b/docs/CampaignsVouchersCreateCombinedResponseBodyLoyaltyCard.md index 425b6e93..24114a9c 100644 --- a/docs/CampaignsVouchersCreateCombinedResponseBodyLoyaltyCard.md +++ b/docs/CampaignsVouchersCreateCombinedResponseBodyLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/CampaignsVouchersCreateResponseBodyLoyaltyCard.md b/docs/CampaignsVouchersCreateResponseBodyLoyaltyCard.md index 3d81d39c..0d2041f0 100644 --- a/docs/CampaignsVouchersCreateResponseBodyLoyaltyCard.md +++ b/docs/CampaignsVouchersCreateResponseBodyLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/ClientValidationsValidateResponseBodyRedeemablesItemResultDiscount.md b/docs/ClientValidationsValidateResponseBodyRedeemablesItemResultDiscount.md index 6f75c985..0ab474c7 100644 --- a/docs/ClientValidationsValidateResponseBodyRedeemablesItemResultDiscount.md +++ b/docs/ClientValidationsValidateResponseBodyRedeemablesItemResultDiscount.md @@ -11,7 +11,7 @@ | **effect** | **String** | | [optional] | | **is_dynamic** | **Boolean** | Flag indicating whether the discount was calculated using a formula. | [optional] | | **unit_off** | **Integer** | Number of units to be granted a full value discount. | [optional] | -| **unit_off_formula** | **String** | | [optional] | +| **unit_off_formula** | **String** | Formula used to calculate the number of units. | [optional] | | **unit_type** | **String** | The product deemed as free, chosen from product inventory (e.g. time, items). | [optional] | | **product** | [**ClientValidationsValidateResponseBodyRedeemablesItemResultDiscountProduct**](ClientValidationsValidateResponseBodyRedeemablesItemResultDiscountProduct.md) | | [optional] | | **sku** | [**SimpleSkuDiscountUnit**](SimpleSkuDiscountUnit.md) | | [optional] | diff --git a/docs/CustomerLoyalty.md b/docs/CustomerLoyalty.md index 48f36afe..83dc6f8e 100644 --- a/docs/CustomerLoyalty.md +++ b/docs/CustomerLoyalty.md @@ -4,7 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Customer's loyalty points. | [optional] | +| **points** | **Integer** | Customer's loyalty points minus expired for all loyalty cards which the customer has. | [optional] | | **referred_customers** | **Integer** | Total number of customers referred by the customer. | [optional] | | **campaigns** | [**Hash<String, CustomerLoyaltyCampaignsEntry>**](CustomerLoyaltyCampaignsEntry.md) | Contains campaigns with details about point balances and how many customers were referred by the customer. | [optional] | diff --git a/docs/Discount.md b/docs/Discount.md index 8834b261..d6a4d0b0 100644 --- a/docs/Discount.md +++ b/docs/Discount.md @@ -11,7 +11,7 @@ | **effect** | **String** | | [optional] | | **is_dynamic** | **Boolean** | Flag indicating whether the discount was calculated using a formula. | [optional] | | **unit_off** | **Integer** | Number of units to be granted a full value discount. | [optional] | -| **unit_off_formula** | **String** | | [optional] | +| **unit_off_formula** | **String** | Formula used to calculate the number of units. | [optional] | | **unit_type** | **String** | The product deemed as free, chosen from product inventory (e.g. time, items). | [optional] | | **product** | [**DiscountProduct**](DiscountProduct.md) | | [optional] | | **sku** | [**SimpleSkuDiscountUnit**](SimpleSkuDiscountUnit.md) | | [optional] | diff --git a/docs/DiscountUnitMultipleOneUnit.md b/docs/DiscountUnitMultipleOneUnit.md index b654af07..8211b890 100644 --- a/docs/DiscountUnitMultipleOneUnit.md +++ b/docs/DiscountUnitMultipleOneUnit.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **unit_off** | **Float** | Number of units to be granted a full value discount. | [optional] | -| **unit_off_formula** | **String** | | [optional] | +| **unit_off_formula** | **String** | Formula used to calculate the number of units. | [optional] | | **effect** | **String** | Defines how the unit is added to the customer's order. | [optional] | | **unit_type** | **String** | The product deemed as free, chosen from product inventory (e.g. time, items). | [optional] | | **product** | [**SimpleProductDiscountUnit**](SimpleProductDiscountUnit.md) | | [optional] | diff --git a/docs/EarningRule.md b/docs/EarningRule.md index de23cb58..7b633f84 100644 --- a/docs/EarningRule.md +++ b/docs/EarningRule.md @@ -11,6 +11,7 @@ | **custom_event** | [**EarningRuleCustomEvent**](EarningRuleCustomEvent.md) | | [optional] | | **segment** | [**EarningRuleSegment**](EarningRuleSegment.md) | | [optional] | | **loyalty_tier** | [**EarningRuleLoyaltyTier**](EarningRuleLoyaltyTier.md) | | [optional] | +| **pending_points** | [**EarningRulePendingPoints**](EarningRulePendingPoints.md) | | [optional] | | **source** | [**EarningRuleSource**](EarningRuleSource.md) | | [optional] | | **object** | **String** | The type of the object represented by JSON. Default is earning_rule. | [optional][default to 'earning_rule'] | | **automation_id** | **String** | For internal use by Voucherify. | [optional] | diff --git a/docs/EarningRulePendingPoints.md b/docs/EarningRulePendingPoints.md new file mode 100644 index 00000000..2ec53010 --- /dev/null +++ b/docs/EarningRulePendingPoints.md @@ -0,0 +1,9 @@ +# VoucherifySdk::EarningRulePendingPoints + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **period_type** | **String** | Defines the type of the period during which the points are in the pending state. Currently, only `DAY` value is accepted. | [optional][default to 'DAY'] | +| **period_value** | **Integer** | Defines for how long the points are in the pending state. The minimum value is 1, maximum is 90. | [optional] | + diff --git a/docs/EventSource.md b/docs/EventSource.md new file mode 100644 index 00000000..075cf6d5 --- /dev/null +++ b/docs/EventSource.md @@ -0,0 +1,10 @@ +# VoucherifySdk::EventSource + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **channel** | **String** | Determines the channel that initiated the event. | [optional] | +| **user** | [**EventSourceUser**](EventSourceUser.md) | | [optional] | +| **api_key** | [**EventSourceApiKey**](EventSourceApiKey.md) | | [optional] | + diff --git a/docs/EventSourceApiKey.md b/docs/EventSourceApiKey.md new file mode 100644 index 00000000..6ce09eb1 --- /dev/null +++ b/docs/EventSourceApiKey.md @@ -0,0 +1,9 @@ +# VoucherifySdk::EventSourceApiKey + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Channel name in the application keys. | [optional] | +| **app_id** | **String** | Contains the application ID from the Voucherify API key pair. | [optional] | + diff --git a/docs/EventSourceUser.md b/docs/EventSourceUser.md new file mode 100644 index 00000000..a5161f4f --- /dev/null +++ b/docs/EventSourceUser.md @@ -0,0 +1,8 @@ +# VoucherifySdk::EventSourceUser + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the user. | [optional] | + diff --git a/docs/InapplicableTo.md b/docs/InapplicableTo.md index 136674c3..5c74acfd 100644 --- a/docs/InapplicableTo.md +++ b/docs/InapplicableTo.md @@ -17,8 +17,9 @@ | **aggregated_quantity_limit** | **Integer** | The maximum number of units allowed to be discounted combined across all matched order line items. | [optional] | | **amount_limit** | **Integer** | Upper limit allowed to be applied as a discount per order line item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600. | [optional] | | **aggregated_amount_limit** | **Integer** | Maximum discount amount per order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects: - `APPLY_TO_ITEMS` (each item subtotal is discounted equally) - `APPLY_TO_ITEMS_BY_QUANTITY` (each unit of matched products has the same discount value) | [optional] | -| **order_item_indices** | **Array<Integer>** | Determines the order in which the discount is applied to the products or SKUs sent in the `order` object in the request. The counting begins from `0`. | [optional] | +| **order_item_indices** | **Array<Integer>** | Lists which order lines are (not) covered by the discount. The order in the array is determined by the sequence of applied discounts, while the numbers correspond to the order lines sent in the `order` object in the request. The first order line is assigned `0`, the second order line is assigned `1`, and so on. | [optional] | +| **order_item_units** | [**Array<InapplicableToOrderItemUnitsItem>**](InapplicableToOrderItemUnitsItem.md) | Lists which units within order lines are covered by the discount. The order line items are listed according to sequence of applied discounts while the `index` corresponds to the order line sent in the `order` object in the request. | [optional] | | **repeat** | **Integer** | Determines the recurrence of the discount, e.g. `\"repeat\": 3` means that the discount is applied to every third item. | [optional] | | **skip_initially** | **Integer** | Determines how many items are skipped before the discount is applied. | [optional] | -| **target** | **String** | Determines to which kinds of objects the discount is applicable. `\"ITEM\"` includes products and SKUs. | [optional] | +| **target** | **String** | Determines to which kinds of objects the discount is applicable. `ITEM` includes products and SKUs. `UNIT` means particular units within an order line. | [optional] | diff --git a/docs/InapplicableToOrderItemUnitsItem.md b/docs/InapplicableToOrderItemUnitsItem.md new file mode 100644 index 00000000..871486e9 --- /dev/null +++ b/docs/InapplicableToOrderItemUnitsItem.md @@ -0,0 +1,9 @@ +# VoucherifySdk::InapplicableToOrderItemUnitsItem + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **index** | **Integer** | Number assigned to the order line item in accordance with the order sent in the request. | [optional] | +| **units** | **Array<Integer>** | Numbers of units in the order line covered by the discount; e.g. `2, 5, 8` for 10 units with the setting `\"skip_initially\": 1`, `\"repeat\": 3`. The counting of units starts from `1`. | [optional] | + diff --git a/docs/LoyaltiesApi.md b/docs/LoyaltiesApi.md index 104a0ef9..bdcc7076 100644 --- a/docs/LoyaltiesApi.md +++ b/docs/LoyaltiesApi.md @@ -4,11 +4,13 @@ All URIs are relative to *https://api.voucherify.io* | Method | HTTP request | Description | | ------ | ------------ | ----------- | +| [**activate_member_pending_points**](LoyaltiesApi.md#activate_member_pending_points) | **POST** /v1/loyalties/members/{memberId}/pending-points/{pendingPointsId}/activate | Activate Member Pending Points | | [**add_member**](LoyaltiesApi.md#add_member) | **POST** /v1/loyalties/{campaignId}/members | Add Member | +| [**cancel_member_pending_points**](LoyaltiesApi.md#cancel_member_pending_points) | **POST** /v1/loyalties/members/{memberId}/pending-points/{pendingPointsId}/cancel | Cancel Member Pending Points | | [**create_earning_rule**](LoyaltiesApi.md#create_earning_rule) | **POST** /v1/loyalties/{campaignId}/earning-rules | Create Earning Rule | | [**create_in_bulk_loyalty_tiers**](LoyaltiesApi.md#create_in_bulk_loyalty_tiers) | **POST** /v1/loyalties/{campaignId}/tiers | Create loyalty tiers | | [**create_loyalty_program**](LoyaltiesApi.md#create_loyalty_program) | **POST** /v1/loyalties | Create Loyalty Campaign | -| [**create_points_expiration_export**](LoyaltiesApi.md#create_points_expiration_export) | **POST** /v1/loyalties/{campaignId}/points-expiration/export | Create Points Expiration Export | +| [**create_points_expiration_export**](LoyaltiesApi.md#create_points_expiration_export) | **POST** /v1/loyalties/{campaignId}/points-expiration/export | Export Loyalty Campaign Point Expiration | | [**create_reward_assignment1**](LoyaltiesApi.md#create_reward_assignment1) | **POST** /v1/loyalties/{campaignId}/rewards | Create Reward Assignment | | [**delete_earning_rule**](LoyaltiesApi.md#delete_earning_rule) | **DELETE** /v1/loyalties/{campaignId}/earning-rules/{earningRuleId} | Delete Earning Rule | | [**delete_loyalty_program**](LoyaltiesApi.md#delete_loyalty_program) | **DELETE** /v1/loyalties/{campaignId} | Delete Loyalty Campaign | @@ -25,6 +27,7 @@ All URIs are relative to *https://api.voucherify.io* | [**get_reward_assignment1**](LoyaltiesApi.md#get_reward_assignment1) | **GET** /v1/loyalties/{campaignId}/reward-assignments/{assignmentId} | Get Reward Assignment | | [**get_reward_assignment2**](LoyaltiesApi.md#get_reward_assignment2) | **GET** /v1/loyalties/{campaignId}/rewards/{assignmentId} | Get Reward Assignment | | [**get_reward_details**](LoyaltiesApi.md#get_reward_details) | **GET** /v1/loyalties/{campaignId}/reward-assignments/{assignmentId}/reward | Get Reward Details | +| [**list_campaign_pending_points**](LoyaltiesApi.md#list_campaign_pending_points) | **GET** /v1/loyalties/{campaignId}/pending-points | List Campaign Pending Points | | [**list_earning_rules**](LoyaltiesApi.md#list_earning_rules) | **GET** /v1/loyalties/{campaignId}/earning-rules | List Earning Rules | | [**list_loyalty_card_transactions**](LoyaltiesApi.md#list_loyalty_card_transactions) | **GET** /v1/loyalties/members/{memberId}/transactions | List Loyalty Card Transactions | | [**list_loyalty_card_transactions1**](LoyaltiesApi.md#list_loyalty_card_transactions1) | **GET** /v1/loyalties/{campaignId}/members/{memberId}/transactions | List Loyalty Card Transactions | @@ -35,9 +38,11 @@ All URIs are relative to *https://api.voucherify.io* | [**list_member_activity**](LoyaltiesApi.md#list_member_activity) | **GET** /v1/loyalties/members/{memberId}/activity | List Member Activity | | [**list_member_activity1**](LoyaltiesApi.md#list_member_activity1) | **GET** /v1/loyalties/{campaignId}/members/{memberId}/activity | List Member Activity | | [**list_member_loyalty_tier**](LoyaltiesApi.md#list_member_loyalty_tier) | **GET** /v1/loyalties/members/{memberId}/tiers | List Member's Loyalty Tiers | +| [**list_member_pending_points**](LoyaltiesApi.md#list_member_pending_points) | **GET** /v1/loyalties/members/{memberId}/pending-points | List Member Pending Points | +| [**list_member_pending_points1**](LoyaltiesApi.md#list_member_pending_points1) | **GET** /v1/loyalties/{campaignId}/members/{memberId}/pending-points | List Member Pending Points | | [**list_member_rewards**](LoyaltiesApi.md#list_member_rewards) | **GET** /v1/loyalties/members/{memberId}/rewards | List Member Rewards | | [**list_members**](LoyaltiesApi.md#list_members) | **GET** /v1/loyalties/{campaignId}/members | List Members | -| [**list_points_expiration**](LoyaltiesApi.md#list_points_expiration) | **GET** /v1/loyalties/{campaignId}/members/{memberId}/points-expiration | Get Points Expiration | +| [**list_points_expiration**](LoyaltiesApi.md#list_points_expiration) | **GET** /v1/loyalties/{campaignId}/members/{memberId}/points-expiration | List Loyalty Card Point Expiration | | [**list_reward_assignments1**](LoyaltiesApi.md#list_reward_assignments1) | **GET** /v1/loyalties/{campaignId}/reward-assignments | List Reward Assignments | | [**list_reward_assignments2**](LoyaltiesApi.md#list_reward_assignments2) | **GET** /v1/loyalties/{campaignId}/rewards | List Reward Assignments | | [**redeem_reward**](LoyaltiesApi.md#redeem_reward) | **POST** /v1/loyalties/members/{memberId}/redemption | Redeem Reward | @@ -50,6 +55,66 @@ All URIs are relative to *https://api.voucherify.io* | [**update_reward_assignment1**](LoyaltiesApi.md#update_reward_assignment1) | **PUT** /v1/loyalties/{campaignId}/rewards/{assignmentId} | Update Reward Assignment | +## activate_member_pending_points + +> activate_member_pending_points(member_id, pending_points_id) + +Activate Member Pending Points + +>🚧 Beta endpoint The endpoint is behind a feature flag as it is still in development. Contact [Voucherify support](https://www.voucherify.io/contact-support) to unlock the feature for your organization. All current parameters and fields are listed and described. Activate manually the pending points and add them to the loyalty card. The pending points are determined by the pending point ID. Once activated, the pending point entry with that ID is not listed by the endpoints: List member (with campaign ID, without campaign ID), List campaign pending points. This **POST** method does not require a request body. + +### Examples + +```ruby +require 'time' +require 'VoucherifySdk' +# setup authorization +VoucherifySdk.configure do |config| + # Configure API key authorization: X-App-Id + config.api_key['X-App-Id'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['X-App-Id'] = 'Bearer' + + # Configure API key authorization: X-App-Token + config.api_key['X-App-Token'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['X-App-Token'] = 'Bearer' +end + +api_instance = VoucherifySdk::LoyaltiesApi.new +member_id = 'member_id_example' # String | Unique loyalty card code assigned to a particular customer. +pending_points_id = 'pending_points_id_example' # String | Unique pending point identifier, assigned by Voucherify. + +begin + # Activate Member Pending Points + result = api_instance.activate_member_pending_points(member_id, pending_points_id) + p result +rescue VoucherifySdk::ApiError => e + puts "Error when calling LoyaltiesApi->activate_member_pending_points: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **member_id** | **String** | Unique loyalty card code assigned to a particular customer. | | +| **pending_points_id** | **String** | Unique pending point identifier, assigned by Voucherify. | | + +### Return type + +[**LoyaltiesMembersPendingPointsActivateResponseBody**](LoyaltiesMembersPendingPointsActivateResponseBody.md) + +### Authorization + +[X-App-Id](../README.md#X-App-Id), [X-App-Token](../README.md#X-App-Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + ## add_member > add_member(campaign_id, opts) @@ -112,6 +177,65 @@ end - **Accept**: application/json +## cancel_member_pending_points + +> cancel_member_pending_points(member_id, pending_points_id) + +Cancel Member Pending Points + +>🚧 Beta endpoint The endpoint is behind a feature flag as it is still in development. Contact [Voucherify support](https://www.voucherify.io/contact-support) to unlock the feature for your organization. All current parameters and fields are listed and described. Cancel manually the pending points for the loyalty card. The pending points are determined by the pending point ID. Once canceled, the pending point entry with that ID is not listed by the endpoints: List member (with campaign ID, without campaign ID), List campaign pending points. This **POST** method does not require a request body and it returns an empty, 204, response. + +### Examples + +```ruby +require 'time' +require 'VoucherifySdk' +# setup authorization +VoucherifySdk.configure do |config| + # Configure API key authorization: X-App-Id + config.api_key['X-App-Id'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['X-App-Id'] = 'Bearer' + + # Configure API key authorization: X-App-Token + config.api_key['X-App-Token'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['X-App-Token'] = 'Bearer' +end + +api_instance = VoucherifySdk::LoyaltiesApi.new +member_id = 'member_id_example' # String | Unique loyalty card code assigned to a particular customer. +pending_points_id = 'pending_points_id_example' # String | Unique pending point identifier, assigned by Voucherify. + +begin + # Cancel Member Pending Points + api_instance.cancel_member_pending_points(member_id, pending_points_id) +rescue VoucherifySdk::ApiError => e + puts "Error when calling LoyaltiesApi->cancel_member_pending_points: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **member_id** | **String** | Unique loyalty card code assigned to a particular customer. | | +| **pending_points_id** | **String** | Unique pending point identifier, assigned by Voucherify. | | + +### Return type + +nil (empty response body) + +### Authorization + +[X-App-Id](../README.md#X-App-Id), [X-App-Token](../README.md#X-App-Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + ## create_earning_rule > > create_earning_rule(campaign_id, opts) @@ -300,7 +424,7 @@ end > create_points_expiration_export(campaign_id, opts) -Create Points Expiration Export +Export Loyalty Campaign Point Expiration Schedule the generation of a points expiration CSV file for a particular campaign. @@ -329,7 +453,7 @@ opts = { } begin - # Create Points Expiration Export + # Export Loyalty Campaign Point Expiration result = api_instance.create_points_expiration_export(campaign_id, opts) p result rescue VoucherifySdk::ApiError => e @@ -628,7 +752,7 @@ end api_instance = VoucherifySdk::LoyaltiesApi.new campaign_id = 'campaign_id_example' # String | Unique campaign ID or name. -earning_rule_id = 'earning_rule_id_example' # String | Unique earning rule ID. +earning_rule_id = 'earning_rule_id_example' # String | Unique identifier of an earning rule, assigned by Voucherify. begin # Disable Earning Rule @@ -644,7 +768,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **campaign_id** | **String** | Unique campaign ID or name. | | -| **earning_rule_id** | **String** | Unique earning rule ID. | | +| **earning_rule_id** | **String** | Unique identifier of an earning rule, assigned by Voucherify. | | ### Return type @@ -688,7 +812,7 @@ end api_instance = VoucherifySdk::LoyaltiesApi.new campaign_id = 'campaign_id_example' # String | Unique campaign ID or name. -earning_rule_id = 'earning_rule_id_example' # String | Unique earning rule ID. +earning_rule_id = 'earning_rule_id_example' # String | Unique identifier of an earning rule, assigned by Voucherify. begin # Enable Earning Rule @@ -704,7 +828,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **campaign_id** | **String** | Unique campaign ID or name. | | -| **earning_rule_id** | **String** | Unique earning rule ID. | | +| **earning_rule_id** | **String** | Unique identifier of an earning rule, assigned by Voucherify. | | ### Return type @@ -1322,6 +1446,72 @@ end - **Accept**: application/json +## list_campaign_pending_points + +> list_campaign_pending_points(campaign_id, opts) + +List Campaign Pending Points + +>🚧 Beta endpoint The endpoint is behind a feature flag as it is still in development. Contact [Voucherify support](https://www.voucherify.io/contact-support) to unlock the feature for your organization. All current parameters and fields are listed and described. Lists all pending points that are currently assigned to all loyalty cards in a campaign. Once the points are added to the card, the entry is no longer returned. + +### Examples + +```ruby +require 'time' +require 'VoucherifySdk' +# setup authorization +VoucherifySdk.configure do |config| + # Configure API key authorization: X-App-Id + config.api_key['X-App-Id'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['X-App-Id'] = 'Bearer' + + # Configure API key authorization: X-App-Token + config.api_key['X-App-Token'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['X-App-Token'] = 'Bearer' +end + +api_instance = VoucherifySdk::LoyaltiesApi.new +campaign_id = 'campaign_id_example' # String | Unique campaign ID. +opts = { + limit: 56, # Integer | Limit the number of the pending point entries that the API returns in the response. + order: VoucherifySdk::ParameterOrderListPendingPoints::ID, # ParameterOrderListPendingPoints | Orders the pending point entries according the pending point entry ID. The dash - preceding a sorting option means sorting in a descending order. + starting_after_id: 'starting_after_id_example' # String | A cursor for pagination. It retrieves the results starting after a result with the given ID. +} + +begin + # List Campaign Pending Points + result = api_instance.list_campaign_pending_points(campaign_id, opts) + p result +rescue VoucherifySdk::ApiError => e + puts "Error when calling LoyaltiesApi->list_campaign_pending_points: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **String** | Unique campaign ID. | | +| **limit** | **Integer** | Limit the number of the pending point entries that the API returns in the response. | [optional] | +| **order** | [**ParameterOrderListPendingPoints**](.md) | Orders the pending point entries according the pending point entry ID. The dash - preceding a sorting option means sorting in a descending order. | [optional] | +| **starting_after_id** | **String** | A cursor for pagination. It retrieves the results starting after a result with the given ID. | [optional] | + +### Return type + +[**LoyaltiesPendingPointsListResponseBody**](LoyaltiesPendingPointsListResponseBody.md) + +### Authorization + +[X-App-Id](../README.md#X-App-Id), [X-App-Token](../README.md#X-App-Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + ## list_earning_rules > list_earning_rules(campaign_id, opts) @@ -1968,6 +2158,140 @@ end - **Accept**: application/json +## list_member_pending_points + +> list_member_pending_points(member_id, opts) + +List Member Pending Points + +>🚧 Beta endpoint The endpoint is behind a feature flag as it is still in development. Contact [Voucherify support](https://www.voucherify.io/contact-support) to unlock the feature for your organization. All current parameters and fields are listed and described. 📘 Alternative endpoint This endpoint is an alternative to this endpoint. The URL was re-designed to list member pending points without having to provide the campaignId as a path parameter. Lists all pending points that are currently assigned to the loyalty card. Once the points are added to the card, the entry is no longer returned. + +### Examples + +```ruby +require 'time' +require 'VoucherifySdk' +# setup authorization +VoucherifySdk.configure do |config| + # Configure API key authorization: X-App-Id + config.api_key['X-App-Id'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['X-App-Id'] = 'Bearer' + + # Configure API key authorization: X-App-Token + config.api_key['X-App-Token'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['X-App-Token'] = 'Bearer' +end + +api_instance = VoucherifySdk::LoyaltiesApi.new +member_id = 'member_id_example' # String | Unique loyalty card code assigned to a particular customer. +opts = { + limit: 56, # Integer | Limit the number of the pending point entries that the API returns in the response. + order: VoucherifySdk::ParameterOrderListPendingPoints::ID, # ParameterOrderListPendingPoints | Orders the pending point entries according the pending point entry ID. The dash - preceding a sorting option means sorting in a descending order. + starting_after_id: 'starting_after_id_example' # String | A cursor for pagination. It retrieves the results starting after a result with the given ID. +} + +begin + # List Member Pending Points + result = api_instance.list_member_pending_points(member_id, opts) + p result +rescue VoucherifySdk::ApiError => e + puts "Error when calling LoyaltiesApi->list_member_pending_points: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **member_id** | **String** | Unique loyalty card code assigned to a particular customer. | | +| **limit** | **Integer** | Limit the number of the pending point entries that the API returns in the response. | [optional] | +| **order** | [**ParameterOrderListPendingPoints**](.md) | Orders the pending point entries according the pending point entry ID. The dash - preceding a sorting option means sorting in a descending order. | [optional] | +| **starting_after_id** | **String** | A cursor for pagination. It retrieves the results starting after a result with the given ID. | [optional] | + +### Return type + +[**LoyaltiesMembersPendingPointsListResponseBody**](LoyaltiesMembersPendingPointsListResponseBody.md) + +### Authorization + +[X-App-Id](../README.md#X-App-Id), [X-App-Token](../README.md#X-App-Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_member_pending_points1 + +> list_member_pending_points1(campaign_id, member_id, opts) + +List Member Pending Points + +>🚧 Beta endpoint The endpoint is behind a feature flag as it is still in development. Contact [Voucherify support](https://www.voucherify.io/contact-support) to unlock the feature for your organization. All current parameters and fields are listed and described. Lists all pending points that are currently assigned to the loyalty card. Once the points are added to the card, the entry is no longer returned. + +### Examples + +```ruby +require 'time' +require 'VoucherifySdk' +# setup authorization +VoucherifySdk.configure do |config| + # Configure API key authorization: X-App-Id + config.api_key['X-App-Id'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['X-App-Id'] = 'Bearer' + + # Configure API key authorization: X-App-Token + config.api_key['X-App-Token'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['X-App-Token'] = 'Bearer' +end + +api_instance = VoucherifySdk::LoyaltiesApi.new +campaign_id = 'campaign_id_example' # String | Unique campaign ID. +member_id = 'member_id_example' # String | Unique loyalty card code assigned to a particular customer. +opts = { + limit: 56, # Integer | Limit the number of the pending point entries that the API returns in the response. + order: VoucherifySdk::ParameterOrderListPendingPoints::ID, # ParameterOrderListPendingPoints | Orders the pending point entries according the pending point entry ID. The dash - preceding a sorting option means sorting in a descending order. + starting_after_id: 'starting_after_id_example' # String | A cursor for pagination. It retrieves the results starting after a result with the given ID. +} + +begin + # List Member Pending Points + result = api_instance.list_member_pending_points1(campaign_id, member_id, opts) + p result +rescue VoucherifySdk::ApiError => e + puts "Error when calling LoyaltiesApi->list_member_pending_points1: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **String** | Unique campaign ID. | | +| **member_id** | **String** | Unique loyalty card code assigned to a particular customer. | | +| **limit** | **Integer** | Limit the number of the pending point entries that the API returns in the response. | [optional] | +| **order** | [**ParameterOrderListPendingPoints**](.md) | Orders the pending point entries according the pending point entry ID. The dash - preceding a sorting option means sorting in a descending order. | [optional] | +| **starting_after_id** | **String** | A cursor for pagination. It retrieves the results starting after a result with the given ID. | [optional] | + +### Return type + +[**LoyaltiesMembersPendingPointsListResponseBody**](LoyaltiesMembersPendingPointsListResponseBody.md) + +### Authorization + +[X-App-Id](../README.md#X-App-Id), [X-App-Token](../README.md#X-App-Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + ## list_member_rewards > list_member_rewards(member_id, opts) @@ -2110,7 +2434,7 @@ end > list_points_expiration(campaign_id, member_id, opts) -Get Points Expiration +List Loyalty Card Point Expiration Retrieve loyalty point expiration buckets for a given loyalty card. Expired point buckets are not returned in this endpoint. You can use the Exports API to retrieve a list of both ACTIVE and EXPIRED point buckets. @@ -2141,7 +2465,7 @@ opts = { } begin - # Get Points Expiration + # List Loyalty Card Point Expiration result = api_instance.list_points_expiration(campaign_id, member_id, opts) p result rescue VoucherifySdk::ApiError => e diff --git a/docs/LoyaltiesCreateCampaignRequestBody.md b/docs/LoyaltiesCreateCampaignRequestBody.md index 1fdfdc9c..f1be1949 100644 --- a/docs/LoyaltiesCreateCampaignRequestBody.md +++ b/docs/LoyaltiesCreateCampaignRequestBody.md @@ -20,6 +20,7 @@ | **category_id** | **String** | Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`. | [optional] | | **category** | **String** | The category assigned to the campaign. Either pass this parameter OR the `category_id`. | [optional] | | **metadata** | **Object** | The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format. | [optional] | +| **access_settings** | [**AccessSettings**](AccessSettings.md) | | [optional] | | **validation_rules** | **Array<String>** | Array containing the ID of the validation rule associated with the promotion tier. | [optional] | | **campaign_type** | **String** | Type of campaign. | [optional][default to 'LOYALTY_PROGRAM'] | | **voucher** | [**CampaignLoyaltyVoucher**](CampaignLoyaltyVoucher.md) | | [optional] | diff --git a/docs/LoyaltiesEarningRulesCreateResponseBody.md b/docs/LoyaltiesEarningRulesCreateResponseBody.md index 598198c1..bc49d136 100644 --- a/docs/LoyaltiesEarningRulesCreateResponseBody.md +++ b/docs/LoyaltiesEarningRulesCreateResponseBody.md @@ -11,6 +11,7 @@ | **custom_event** | [**LoyaltiesEarningRulesCreateResponseBodyCustomEvent**](LoyaltiesEarningRulesCreateResponseBodyCustomEvent.md) | | [optional] | | **segment** | [**LoyaltiesEarningRulesCreateResponseBodySegment**](LoyaltiesEarningRulesCreateResponseBodySegment.md) | | [optional] | | **loyalty_tier** | [**LoyaltiesEarningRulesCreateResponseBodyLoyaltyTier**](LoyaltiesEarningRulesCreateResponseBodyLoyaltyTier.md) | | [optional] | +| **pending_points** | [**LoyaltiesEarningRulesCreateResponseBodyPendingPoints**](LoyaltiesEarningRulesCreateResponseBodyPendingPoints.md) | | [optional] | | **source** | [**LoyaltiesEarningRulesCreateResponseBodySource**](LoyaltiesEarningRulesCreateResponseBodySource.md) | | [optional] | | **object** | **String** | The type of the object represented by JSON. Default is earning_rule. | [optional][default to 'earning_rule'] | | **automation_id** | **String** | For internal use by Voucherify. | [optional] | diff --git a/docs/LoyaltiesEarningRulesCreateResponseBodyPendingPoints.md b/docs/LoyaltiesEarningRulesCreateResponseBodyPendingPoints.md new file mode 100644 index 00000000..e3fb3e8f --- /dev/null +++ b/docs/LoyaltiesEarningRulesCreateResponseBodyPendingPoints.md @@ -0,0 +1,9 @@ +# VoucherifySdk::LoyaltiesEarningRulesCreateResponseBodyPendingPoints + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **period_type** | **String** | Defines the type of the period during which the points are in the pending state. Currently, only `DAY` value is accepted. | [optional][default to 'DAY'] | +| **period_value** | **Integer** | Defines for how long the points are in the pending state. The minimum value is 1, maximum is 90. | [optional] | + diff --git a/docs/LoyaltiesEarningRulesDisableResponseBody.md b/docs/LoyaltiesEarningRulesDisableResponseBody.md index ba68fce1..b3e7fc05 100644 --- a/docs/LoyaltiesEarningRulesDisableResponseBody.md +++ b/docs/LoyaltiesEarningRulesDisableResponseBody.md @@ -11,6 +11,7 @@ | **custom_event** | [**LoyaltiesEarningRulesDisableResponseBodyCustomEvent**](LoyaltiesEarningRulesDisableResponseBodyCustomEvent.md) | | [optional] | | **segment** | [**LoyaltiesEarningRulesDisableResponseBodySegment**](LoyaltiesEarningRulesDisableResponseBodySegment.md) | | [optional] | | **loyalty_tier** | [**LoyaltiesEarningRulesDisableResponseBodyLoyaltyTier**](LoyaltiesEarningRulesDisableResponseBodyLoyaltyTier.md) | | [optional] | +| **pending_points** | [**LoyaltiesEarningRulesDisableResponseBodyPendingPoints**](LoyaltiesEarningRulesDisableResponseBodyPendingPoints.md) | | [optional] | | **source** | [**LoyaltiesEarningRulesDisableResponseBodySource**](LoyaltiesEarningRulesDisableResponseBodySource.md) | | [optional] | | **object** | **String** | The type of the object represented by JSON. Default is earning_rule. | [optional][default to 'earning_rule'] | | **automation_id** | **String** | For internal use by Voucherify. | [optional] | diff --git a/docs/LoyaltiesEarningRulesDisableResponseBodyPendingPoints.md b/docs/LoyaltiesEarningRulesDisableResponseBodyPendingPoints.md new file mode 100644 index 00000000..98ed0feb --- /dev/null +++ b/docs/LoyaltiesEarningRulesDisableResponseBodyPendingPoints.md @@ -0,0 +1,9 @@ +# VoucherifySdk::LoyaltiesEarningRulesDisableResponseBodyPendingPoints + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **period_type** | **String** | Defines the type of the period during which the points are in the pending state. Currently, only `DAY` value is accepted. | [optional][default to 'DAY'] | +| **period_value** | **Integer** | Defines for how long the points are in the pending state. The minimum value is 1, maximum is 90. | [optional] | + diff --git a/docs/LoyaltiesEarningRulesEnableResponseBody.md b/docs/LoyaltiesEarningRulesEnableResponseBody.md index 2dca1d8a..9867d3e7 100644 --- a/docs/LoyaltiesEarningRulesEnableResponseBody.md +++ b/docs/LoyaltiesEarningRulesEnableResponseBody.md @@ -11,6 +11,7 @@ | **custom_event** | [**LoyaltiesEarningRulesEnableResponseBodyCustomEvent**](LoyaltiesEarningRulesEnableResponseBodyCustomEvent.md) | | [optional] | | **segment** | [**LoyaltiesEarningRulesEnableResponseBodySegment**](LoyaltiesEarningRulesEnableResponseBodySegment.md) | | [optional] | | **loyalty_tier** | [**LoyaltiesEarningRulesEnableResponseBodyLoyaltyTier**](LoyaltiesEarningRulesEnableResponseBodyLoyaltyTier.md) | | [optional] | +| **pending_points** | [**LoyaltiesEarningRulesEnableResponseBodyPendingPoints**](LoyaltiesEarningRulesEnableResponseBodyPendingPoints.md) | | [optional] | | **source** | [**LoyaltiesEarningRulesEnableResponseBodySource**](LoyaltiesEarningRulesEnableResponseBodySource.md) | | [optional] | | **object** | **String** | The type of the object represented by JSON. Default is earning_rule. | [optional][default to 'earning_rule'] | | **automation_id** | **String** | For internal use by Voucherify. | [optional] | diff --git a/docs/LoyaltiesEarningRulesEnableResponseBodyPendingPoints.md b/docs/LoyaltiesEarningRulesEnableResponseBodyPendingPoints.md new file mode 100644 index 00000000..ae51084c --- /dev/null +++ b/docs/LoyaltiesEarningRulesEnableResponseBodyPendingPoints.md @@ -0,0 +1,9 @@ +# VoucherifySdk::LoyaltiesEarningRulesEnableResponseBodyPendingPoints + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **period_type** | **String** | Defines the type of the period during which the points are in the pending state. Currently, only `DAY` value is accepted. | [optional][default to 'DAY'] | +| **period_value** | **Integer** | Defines for how long the points are in the pending state. The minimum value is 1, maximum is 90. | [optional] | + diff --git a/docs/LoyaltiesEarningRulesGetResponseBody.md b/docs/LoyaltiesEarningRulesGetResponseBody.md index 94d4f9ea..59c1bd06 100644 --- a/docs/LoyaltiesEarningRulesGetResponseBody.md +++ b/docs/LoyaltiesEarningRulesGetResponseBody.md @@ -11,6 +11,7 @@ | **custom_event** | [**LoyaltiesEarningRulesGetResponseBodyCustomEvent**](LoyaltiesEarningRulesGetResponseBodyCustomEvent.md) | | [optional] | | **segment** | [**LoyaltiesEarningRulesGetResponseBodySegment**](LoyaltiesEarningRulesGetResponseBodySegment.md) | | [optional] | | **loyalty_tier** | [**LoyaltiesEarningRulesGetResponseBodyLoyaltyTier**](LoyaltiesEarningRulesGetResponseBodyLoyaltyTier.md) | | [optional] | +| **pending_points** | [**LoyaltiesEarningRulesGetResponseBodyPendingPoints**](LoyaltiesEarningRulesGetResponseBodyPendingPoints.md) | | [optional] | | **source** | [**LoyaltiesEarningRulesGetResponseBodySource**](LoyaltiesEarningRulesGetResponseBodySource.md) | | [optional] | | **object** | **String** | The type of the object represented by JSON. Default is earning_rule. | [optional][default to 'earning_rule'] | | **automation_id** | **String** | For internal use by Voucherify. | [optional] | diff --git a/docs/LoyaltiesEarningRulesGetResponseBodyPendingPoints.md b/docs/LoyaltiesEarningRulesGetResponseBodyPendingPoints.md new file mode 100644 index 00000000..fee48680 --- /dev/null +++ b/docs/LoyaltiesEarningRulesGetResponseBodyPendingPoints.md @@ -0,0 +1,9 @@ +# VoucherifySdk::LoyaltiesEarningRulesGetResponseBodyPendingPoints + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **period_type** | **String** | Defines the type of the period during which the points are in the pending state. Currently, only `DAY` value is accepted. | [optional][default to 'DAY'] | +| **period_value** | **Integer** | Defines for how long the points are in the pending state. The minimum value is 1, maximum is 90. | [optional] | + diff --git a/docs/LoyaltiesEarningRulesUpdateResponseBody.md b/docs/LoyaltiesEarningRulesUpdateResponseBody.md index 7354ae6b..da9af2c0 100644 --- a/docs/LoyaltiesEarningRulesUpdateResponseBody.md +++ b/docs/LoyaltiesEarningRulesUpdateResponseBody.md @@ -11,6 +11,7 @@ | **custom_event** | [**LoyaltiesEarningRulesUpdateResponseBodyCustomEvent**](LoyaltiesEarningRulesUpdateResponseBodyCustomEvent.md) | | [optional] | | **segment** | [**LoyaltiesEarningRulesUpdateResponseBodySegment**](LoyaltiesEarningRulesUpdateResponseBodySegment.md) | | [optional] | | **loyalty_tier** | [**LoyaltiesEarningRulesUpdateResponseBodyLoyaltyTier**](LoyaltiesEarningRulesUpdateResponseBodyLoyaltyTier.md) | | [optional] | +| **pending_points** | [**LoyaltiesEarningRulesUpdateResponseBodyPendingPoints**](LoyaltiesEarningRulesUpdateResponseBodyPendingPoints.md) | | [optional] | | **source** | [**LoyaltiesEarningRulesUpdateResponseBodySource**](LoyaltiesEarningRulesUpdateResponseBodySource.md) | | [optional] | | **object** | **String** | The type of the object represented by JSON. Default is earning_rule. | [optional][default to 'earning_rule'] | | **automation_id** | **String** | For internal use by Voucherify. | [optional] | diff --git a/docs/LoyaltiesEarningRulesUpdateResponseBodyPendingPoints.md b/docs/LoyaltiesEarningRulesUpdateResponseBodyPendingPoints.md new file mode 100644 index 00000000..11756ee6 --- /dev/null +++ b/docs/LoyaltiesEarningRulesUpdateResponseBodyPendingPoints.md @@ -0,0 +1,9 @@ +# VoucherifySdk::LoyaltiesEarningRulesUpdateResponseBodyPendingPoints + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **period_type** | **String** | Defines the type of the period during which the points are in the pending state. Currently, only `DAY` value is accepted. | [optional][default to 'DAY'] | +| **period_value** | **Integer** | Defines for how long the points are in the pending state. The minimum value is 1, maximum is 90. | [optional] | + diff --git a/docs/LoyaltiesMembersCreateResponseBodyLoyaltyCard.md b/docs/LoyaltiesMembersCreateResponseBodyLoyaltyCard.md index 011a1e75..1d485f6f 100644 --- a/docs/LoyaltiesMembersCreateResponseBodyLoyaltyCard.md +++ b/docs/LoyaltiesMembersCreateResponseBodyLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/LoyaltiesMembersGetResponseBodyLoyaltyCard.md b/docs/LoyaltiesMembersGetResponseBodyLoyaltyCard.md index 52b39ca6..a16c30a4 100644 --- a/docs/LoyaltiesMembersGetResponseBodyLoyaltyCard.md +++ b/docs/LoyaltiesMembersGetResponseBodyLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/LoyaltiesMembersPendingPointsActivateResponseBody.md b/docs/LoyaltiesMembersPendingPointsActivateResponseBody.md new file mode 100644 index 00000000..8265f2bf --- /dev/null +++ b/docs/LoyaltiesMembersPendingPointsActivateResponseBody.md @@ -0,0 +1,14 @@ +# VoucherifySdk::LoyaltiesMembersPendingPointsActivateResponseBody + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **points** | **Integer** | The number of pending points added to the loyalty card. | [optional] | +| **total** | **Integer** | Total number of points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | +| **balance** | **Integer** | The current number of loyalty points after the pendint points have been added. | [optional] | +| **type** | **String** | The type of the voucher being modified. For pending points, it is always `loyalty_card`. | [optional][default to 'loyalty_card'] | +| **object** | **String** | The type of the object represented by JSON. Default is `balance`. | [optional][default to 'balance'] | +| **related_object** | [**LoyaltiesMembersPendingPointsActivateResponseBodyRelatedObject**](LoyaltiesMembersPendingPointsActivateResponseBodyRelatedObject.md) | | [optional] | +| **operation_type** | **String** | The type of the operation being performed. | [optional][default to 'MANUAL'] | + diff --git a/docs/LoyaltiesMembersPendingPointsActivateResponseBodyRelatedObject.md b/docs/LoyaltiesMembersPendingPointsActivateResponseBodyRelatedObject.md new file mode 100644 index 00000000..18f5d9be --- /dev/null +++ b/docs/LoyaltiesMembersPendingPointsActivateResponseBodyRelatedObject.md @@ -0,0 +1,9 @@ +# VoucherifySdk::LoyaltiesMembersPendingPointsActivateResponseBodyRelatedObject + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | The object being modified, i.e. `voucher`. | [optional][default to 'voucher'] | +| **id** | **String** | Identifies the voucher that is being modified. This is the unique identifer that was assigned by Voucherify. | [optional] | + diff --git a/docs/LoyaltiesMembersPendingPointsListResponseBody.md b/docs/LoyaltiesMembersPendingPointsListResponseBody.md new file mode 100644 index 00000000..911c992d --- /dev/null +++ b/docs/LoyaltiesMembersPendingPointsListResponseBody.md @@ -0,0 +1,12 @@ +# VoucherifySdk::LoyaltiesMembersPendingPointsListResponseBody + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **object** | **String** | The type of the object represented by JSON. | [optional][default to 'list'] | +| **data_ref** | **String** | Identifies the name of the attribute that contains the array of pending point objects. | [optional][default to 'data'] | +| **data** | [**Array<LoyaltyPendingPoints>**](LoyaltyPendingPoints.md) | A dictionary that contains an array of pending point entries. Each entry in the array is a separate pending point object. | [optional] | +| **has_more** | **Boolean** | As query results are always limited (by the limit parameter), the `has_more` flag indicates if there are more records for given filter parameters. This lets you know if you can run another request to get more records returned in the results. | [optional] | +| **more_starting_after** | **String** | Returns an ID that can be used to return another page of results. Use the pending point entry ID in the `starting_after_id` query parameter to display another page of the results starting after the entry with that ID. | [optional] | + diff --git a/docs/LoyaltiesMembersRedemptionRedeemResponseBodyVoucherLoyaltyCard.md b/docs/LoyaltiesMembersRedemptionRedeemResponseBodyVoucherLoyaltyCard.md index 1c440eb3..f6ee680d 100644 --- a/docs/LoyaltiesMembersRedemptionRedeemResponseBodyVoucherLoyaltyCard.md +++ b/docs/LoyaltiesMembersRedemptionRedeemResponseBodyVoucherLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/LoyaltiesMembersTransfersCreateResponseBodyLoyaltyCard.md b/docs/LoyaltiesMembersTransfersCreateResponseBodyLoyaltyCard.md index 005e4ccc..8187b2fc 100644 --- a/docs/LoyaltiesMembersTransfersCreateResponseBodyLoyaltyCard.md +++ b/docs/LoyaltiesMembersTransfersCreateResponseBodyLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **String** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/LoyaltiesPendingPointsListResponseBody.md b/docs/LoyaltiesPendingPointsListResponseBody.md new file mode 100644 index 00000000..5bf9283f --- /dev/null +++ b/docs/LoyaltiesPendingPointsListResponseBody.md @@ -0,0 +1,12 @@ +# VoucherifySdk::LoyaltiesPendingPointsListResponseBody + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **object** | **String** | The type of the object represented by JSON. | [optional][default to 'list'] | +| **data_ref** | **String** | Identifies the name of the attribute that contains the array of pending point objects. | [optional][default to 'data'] | +| **data** | [**Array<LoyaltyPendingPoints>**](LoyaltyPendingPoints.md) | A dictionary that contains an array of pending point entries. Each entry in the array is a separate pending point object. | [optional] | +| **has_more** | **Boolean** | As query results are always limited (by the limit parameter), the `has_more` flag indicates if there are more records for given filter parameters. This lets you know if you can run another request to get more records returned in the results. | [optional] | +| **more_starting_after** | **String** | Returns an ID that can be used to return another page of results. Use the pending point entry ID in the `starting_after_id` query parameter to display another page of the results starting after the entry with that ID. | [optional] | + diff --git a/docs/LoyaltiesUpdateCampaignRequestBody.md b/docs/LoyaltiesUpdateCampaignRequestBody.md index 8cb90cd8..929739fd 100644 --- a/docs/LoyaltiesUpdateCampaignRequestBody.md +++ b/docs/LoyaltiesUpdateCampaignRequestBody.md @@ -14,6 +14,7 @@ | **metadata** | **Object** | The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format. | [optional] | | **unset_metadata_fields** | **Array<String>** | Determine which metadata should be removed from campaign. | [optional] | | **category_id** | **String** | Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`. | [optional] | +| **access_settings** | [**AccessSettings**](AccessSettings.md) | | [optional] | | **activity_duration_after_publishing** | **String** | Defines the amount of time the vouchers will be active after publishing. The value is shown in the ISO 8601 format. For example, a voucher with the value of P24D will be valid for a duration of 24 days. | [optional] | | **join_once** | **Boolean** | If this value is set to `true`, customers will be able to join the campaign only once. It is always `false` for standalone voucher campaigns and it cannot be changed in them. | [optional] | | **auto_join** | **Boolean** | Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. | [optional] | diff --git a/docs/LoyaltyCardTransactionDetails.md b/docs/LoyaltyCardTransactionDetails.md index 4e51ab5e..d3f0a2b9 100644 --- a/docs/LoyaltyCardTransactionDetails.md +++ b/docs/LoyaltyCardTransactionDetails.md @@ -14,6 +14,8 @@ | **rollback** | [**LoyaltyCardTransactionDetailsRollback**](LoyaltyCardTransactionDetailsRollback.md) | | [optional] | | **custom_event** | [**LoyaltyCardTransactionDetailsCustomEvent**](LoyaltyCardTransactionDetailsCustomEvent.md) | | [optional] | | **event_schema** | [**LoyaltyCardTransactionDetailsEventSchema**](LoyaltyCardTransactionDetailsEventSchema.md) | | [optional] | +| **holder_loyalty_tier** | [**LoyaltyCardTransactionDetailsHolderLoyaltyTier**](LoyaltyCardTransactionDetailsHolderLoyaltyTier.md) | | [optional] | +| **pending_points** | [**LoyaltyPendingPoints**](LoyaltyPendingPoints.md) | | [optional] | | **reward** | [**LoyaltyCardTransactionDetailsReward**](LoyaltyCardTransactionDetailsReward.md) | | [optional] | | **source_voucher** | [**SimpleVoucher**](SimpleVoucher.md) | | [optional] | | **destination_voucher** | [**SimpleVoucher**](SimpleVoucher.md) | | [optional] | diff --git a/docs/LoyaltyCardTransactionDetailsEarningRule.md b/docs/LoyaltyCardTransactionDetailsEarningRule.md index 218d8847..20a34b0f 100644 --- a/docs/LoyaltyCardTransactionDetailsEarningRule.md +++ b/docs/LoyaltyCardTransactionDetailsEarningRule.md @@ -4,6 +4,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **id** | **String** | Unique earning rule ID. | [optional] | +| **id** | **String** | Unique identifier of an earning rule, assigned by Voucherify. | [optional] | | **source** | [**LoyaltyCardTransactionDetailsEarningRuleSource**](LoyaltyCardTransactionDetailsEarningRuleSource.md) | | [optional] | diff --git a/docs/LoyaltyCardTransactionDetailsHolderLoyaltyTier.md b/docs/LoyaltyCardTransactionDetailsHolderLoyaltyTier.md new file mode 100644 index 00000000..954f0ba5 --- /dev/null +++ b/docs/LoyaltyCardTransactionDetailsHolderLoyaltyTier.md @@ -0,0 +1,9 @@ +# VoucherifySdk::LoyaltyCardTransactionDetailsHolderLoyaltyTier + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the loyalty tier, assigned by Voucherify. | [optional] | +| **name** | **String** | User-defined name of the loyalty tier. | [optional] | + diff --git a/docs/LoyaltyCardTransactionDetailsLoyaltyTier.md b/docs/LoyaltyCardTransactionDetailsLoyaltyTier.md index 53b08a61..e94f6407 100644 --- a/docs/LoyaltyCardTransactionDetailsLoyaltyTier.md +++ b/docs/LoyaltyCardTransactionDetailsLoyaltyTier.md @@ -4,6 +4,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **id** | **String** | | [optional] | -| **name** | **String** | | [optional] | +| **id** | **String** | Unique identifier of the loyalty tier, assigned by Voucherify. | [optional] | +| **name** | **String** | User-defined name of the loyalty tier. | [optional] | diff --git a/docs/LoyaltyMemberLoyaltyCard.md b/docs/LoyaltyMemberLoyaltyCard.md index e1d88b95..359d8836 100644 --- a/docs/LoyaltyMemberLoyaltyCard.md +++ b/docs/LoyaltyMemberLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/LoyaltyPendingPoints.md b/docs/LoyaltyPendingPoints.md new file mode 100644 index 00000000..f0bcec80 --- /dev/null +++ b/docs/LoyaltyPendingPoints.md @@ -0,0 +1,17 @@ +# VoucherifySdk::LoyaltyPendingPoints + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the pending point entry, assigned by Voucherify. | [optional] | +| **voucher_id** | **String** | Unique identifier of the loyalty card, assigned by Voucherify. | [optional] | +| **campaign_id** | **String** | Unique campaign identifier, assigned by Voucherify. | [optional] | +| **customer_id** | **String** | Unique customer identifier, assigned by Voucherify. | [optional] | +| **order_id** | **String** | Unique order identifier, assigned by Voucherify. | [optional] | +| **points** | **Integer** | Number of points in the pending state. | [optional] | +| **activates_at** | **Date** | Date when the pending points are activated and added to the customer's loyalty card. | [optional] | +| **details** | [**LoyaltyPendingPointsDetails**](LoyaltyPendingPointsDetails.md) | | | +| **created_at** | **Time** | Timestamp representing the date and time when the pending point entry was created. The value is shown in the ISO 8601 format. | [optional] | +| **updated_at** | **Time** | Timestamp representing the date and time when the pending point entry was modified. The value is shown in the ISO 8601 format. | [optional] | + diff --git a/docs/LoyaltyPendingPointsDetails.md b/docs/LoyaltyPendingPointsDetails.md new file mode 100644 index 00000000..d5e192bd --- /dev/null +++ b/docs/LoyaltyPendingPointsDetails.md @@ -0,0 +1,12 @@ +# VoucherifySdk::LoyaltyPendingPointsDetails + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **loyalty_tier** | [**LoyaltyPendingPointsDetailsLoyaltyTier**](LoyaltyPendingPointsDetailsLoyaltyTier.md) | | [optional] | +| **holder_loyalty_tier** | [**LoyaltyPendingPointsDetailsHolderLoyaltyTier**](LoyaltyPendingPointsDetailsHolderLoyaltyTier.md) | | [optional] | +| **event** | [**LoyaltyPendingPointsDetailsEvent**](LoyaltyPendingPointsDetailsEvent.md) | | [optional] | +| **earning_rule** | [**LoyaltyPendingPointsDetailsEarningRule**](LoyaltyPendingPointsDetailsEarningRule.md) | | [optional] | +| **order** | [**LoyaltyPendingPointsDetailsOrder**](LoyaltyPendingPointsDetailsOrder.md) | | [optional] | + diff --git a/docs/LoyaltyPendingPointsDetailsEarningRule.md b/docs/LoyaltyPendingPointsDetailsEarningRule.md new file mode 100644 index 00000000..0889cd1c --- /dev/null +++ b/docs/LoyaltyPendingPointsDetailsEarningRule.md @@ -0,0 +1,9 @@ +# VoucherifySdk::LoyaltyPendingPointsDetailsEarningRule + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of an earning rule, assigned by Voucherify. | [optional] | +| **source** | [**LoyaltyPendingPointsDetailsEarningRuleSource**](LoyaltyPendingPointsDetailsEarningRuleSource.md) | | [optional] | + diff --git a/docs/LoyaltyPendingPointsDetailsEarningRuleSource.md b/docs/LoyaltyPendingPointsDetailsEarningRuleSource.md new file mode 100644 index 00000000..aa5d2d3d --- /dev/null +++ b/docs/LoyaltyPendingPointsDetailsEarningRuleSource.md @@ -0,0 +1,8 @@ +# VoucherifySdk::LoyaltyPendingPointsDetailsEarningRuleSource + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **banner** | **String** | Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard. | [optional] | + diff --git a/docs/LoyaltyPendingPointsDetailsEvent.md b/docs/LoyaltyPendingPointsDetailsEvent.md new file mode 100644 index 00000000..7bed762c --- /dev/null +++ b/docs/LoyaltyPendingPointsDetailsEvent.md @@ -0,0 +1,14 @@ +# VoucherifySdk::LoyaltyPendingPointsDetailsEvent + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique event identifier, assigned by Voucherify. | [optional] | +| **type** | **String** | Type of the event that triggered the creation of pending points. | [optional][default to 'customer.order.paid'] | +| **group_id** | **String** | Unique identifier of the request that triggered the event, assigned by Voucherify. | [optional] | +| **entity_id** | **String** | Unique identifier of the entity that triggered the event, assigned by Voucherify. For pending points, it is the `customer_id` of the customer who paid for the order. | [optional] | +| **created_at** | **Time** | Timestamp representing the date and time when the event occurred. The value is shown in the ISO 8601 format. | [optional] | +| **category** | **String** | Type of the event. | [optional] | +| **event_source** | [**EventSource**](EventSource.md) | | [optional] | + diff --git a/docs/LoyaltyPendingPointsDetailsHolderLoyaltyTier.md b/docs/LoyaltyPendingPointsDetailsHolderLoyaltyTier.md new file mode 100644 index 00000000..33bba73b --- /dev/null +++ b/docs/LoyaltyPendingPointsDetailsHolderLoyaltyTier.md @@ -0,0 +1,9 @@ +# VoucherifySdk::LoyaltyPendingPointsDetailsHolderLoyaltyTier + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the loyalty tier, assigned by Voucherify. | [optional] | +| **name** | **String** | User-defined name of the loyalty tier. | [optional] | + diff --git a/docs/LoyaltyPendingPointsDetailsLoyaltyTier.md b/docs/LoyaltyPendingPointsDetailsLoyaltyTier.md new file mode 100644 index 00000000..70a875b0 --- /dev/null +++ b/docs/LoyaltyPendingPointsDetailsLoyaltyTier.md @@ -0,0 +1,9 @@ +# VoucherifySdk::LoyaltyPendingPointsDetailsLoyaltyTier + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the loyalty tier, assigned by Voucherify. | [optional] | +| **name** | **String** | User-defined name of the loyalty tier. | [optional] | + diff --git a/docs/LoyaltyPendingPointsDetailsOrder.md b/docs/LoyaltyPendingPointsDetailsOrder.md new file mode 100644 index 00000000..7d7fb288 --- /dev/null +++ b/docs/LoyaltyPendingPointsDetailsOrder.md @@ -0,0 +1,9 @@ +# VoucherifySdk::LoyaltyPendingPointsDetailsOrder + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique order identifier, assigned by Voucherify. | [optional] | +| **source_id** | **String** | User-defined order identifier. | [optional] | + diff --git a/docs/LoyaltyTierExpiration.md b/docs/LoyaltyTierExpiration.md index ef3dc958..dc5df61e 100644 --- a/docs/LoyaltyTierExpiration.md +++ b/docs/LoyaltyTierExpiration.md @@ -4,7 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **customer_id** | **String** | Unique customer ID of the customer making the purchase. | [optional] | +| **customer_id** | **String** | Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify. | [optional] | | **campaign_id** | **String** | Unique campaign ID, assigned by Voucherify. | [optional] | | **tier_id** | **String** | Unique tier ID, assigned by Voucherify. | [optional] | | **start_date** | **String** | Activation timestamp defines when the loyalty tier starts to be active in ISO 8601 format. Loyalty tier is inactive before this date. | [optional] | diff --git a/docs/Order.md b/docs/Order.md index 83c893c5..640da4ad 100644 --- a/docs/Order.md +++ b/docs/Order.md @@ -9,7 +9,7 @@ | **status** | **String** | The order status. | [optional] | | **amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | | **initial_amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. | [optional] | -| **items** | [**Array<OrderItem>**](OrderItem.md) | Array of items applied to the order. It can include up 500 items. | [optional] | +| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items** | [**Array<OrderItem>**](OrderItem.md) | Array of items applied to the order. It can include up to 500 items. | [optional] | | **metadata** | **Object** | A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. | [optional] | diff --git a/docs/OrderCalculated.md b/docs/OrderCalculated.md index 2cc8dae1..7015dd0b 100644 --- a/docs/OrderCalculated.md +++ b/docs/OrderCalculated.md @@ -7,23 +7,23 @@ | **id** | **String** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | [optional] | | **source_id** | **String** | Unique source ID of an existing order that will be linked to the redemption of this request. | [optional] | | **status** | **String** | The order status. | [optional] | -| **amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **initial_amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. | [optional] | -| **items_discount_amount** | **Integer** | Sum of all product-specific discounts applied to the order. | [optional] | -| **total_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied to the order. | [optional] | -| **total_amount** | **Integer** | Order amount after undoing all the discounts through the rollback redemption. | [optional] | -| **applied_discount_amount** | **Integer** | This field shows the order-level discount applied. | [optional] | -| **items_applied_discount_amount** | **Integer** | Sum of all product-specific discounts applied in a particular request. `sum(items, i => i.applied_discount_amount)` | [optional] | -| **total_applied_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied in a particular request. `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | [optional] | -| **items** | [**Array<OrderCalculatedItem>**](OrderCalculatedItem.md) | Array of items applied to the order. It can include up 500 items. | [optional] | +| **amount** | **Integer** | This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **initial_amount** | **Integer** | This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items_discount_amount** | **Integer** | Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **total_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **total_amount** | **Integer** | Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **applied_discount_amount** | **Integer** | This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items_applied_discount_amount** | **Integer** | Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `sum(items, i => i.applied_discount_amount)` | [optional] | +| **total_applied_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | [optional] | | **metadata** | **Object** | A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. | [optional] | | **object** | **String** | The type of the object represented by JSON. | [optional][default to 'order'] | | **created_at** | **Time** | Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format. | [optional] | | **updated_at** | **Time** | Timestamp representing the date and time when the order was last updated in ISO 8601 format. | [optional] | -| **customer_id** | **String** | Unique customer ID of the customer making the purchase. | [optional] | +| **customer_id** | **String** | Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify. | [optional] | | **referrer_id** | **String** | Unique referrer ID. | [optional] | | **customer** | [**CustomerId**](CustomerId.md) | | [optional] | | **referrer** | [**ReferrerId**](ReferrerId.md) | | [optional] | | **redemptions** | [**Hash<String, OrderRedemptionsEntry>**](OrderRedemptionsEntry.md) | | [optional] | +| **items** | [**Array<OrderCalculatedItem>**](OrderCalculatedItem.md) | Array of items applied to the order. It can include up 500 items. | [optional] | diff --git a/docs/OrderCalculatedItem.md b/docs/OrderCalculatedItem.md index d26730d0..99ddfc5b 100644 --- a/docs/OrderCalculatedItem.md +++ b/docs/OrderCalculatedItem.md @@ -25,4 +25,5 @@ | **sku** | [**OrderCalculatedItemSku**](OrderCalculatedItemSku.md) | | [optional] | | **object** | **String** | The type of the object represented by JSON. | [optional][default to 'order_item'] | | **metadata** | **Object** | A set of custom key/value pairs that you can attach to an item object. It can be useful for storing additional information about the item in a structured format. It can be used to define business validation rules or discount formulas. | [optional] | +| **application_details** | [**Array<ApplicationDetailsItem>**](ApplicationDetailsItem.md) | Array containing details about the items that are replaced and the items that are replacements for discounts with the `REPLACE_ITEMS` effect. | [optional] | diff --git a/docs/OrderRedemptionsEntry.md b/docs/OrderRedemptionsEntry.md index 7465647b..009595d3 100644 --- a/docs/OrderRedemptionsEntry.md +++ b/docs/OrderRedemptionsEntry.md @@ -6,7 +6,7 @@ | ---- | ---- | ----------- | ----- | | **date** | **Time** | Timestamp representing the date and time when the redemption was created. The value is shown in the ISO 8601 format. | [optional] | | **rollback_id** | **String** | Unique ID of the redemption rollback. | [optional] | -| **rollback_date** | **Time** | Timestamp representing the date and tiem when the redemption rollback was created. The value is shown in the ISO 8601 format. | [optional] | +| **rollback_date** | **Time** | Timestamp representing the date and time when the redemption rollback was created. The value is shown in the ISO 8601 format. | [optional] | | **related_object_type** | **String** | The source of the incentive. | [optional][default to 'redemption'] | | **related_object_id** | **String** | Unique ID of the parent redemption. | [optional] | | **related_object_parent_id** | **String** | Represent's the campaign ID of the voucher if the redemption was based on a voucher that was part of bulk codes generated within a campaign. In case of a promotion tier, this represents the campaign ID of the promotion tier's parent campaign. | [optional] | diff --git a/docs/OrdersCreateRequestBody.md b/docs/OrdersCreateRequestBody.md index 9af6ad03..5cedd887 100644 --- a/docs/OrdersCreateRequestBody.md +++ b/docs/OrdersCreateRequestBody.md @@ -9,8 +9,8 @@ | **status** | **String** | The order status. | [optional] | | **amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | | **initial_amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. | [optional] | -| **items** | [**Array<OrderItem>**](OrderItem.md) | Array of items applied to the order. It can include up 500 items. | [optional] | +| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items** | [**Array<OrderItem>**](OrderItem.md) | Array of items applied to the order. It can include up to 500 items. | [optional] | | **metadata** | **Object** | A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. | [optional] | | **created_at** | **Time** | Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format. | [optional] | | **referrer_id** | **String** | Unique referrer ID. | [optional] | diff --git a/docs/OrdersCreateResponseBody.md b/docs/OrdersCreateResponseBody.md index 74dced14..f0435ac3 100644 --- a/docs/OrdersCreateResponseBody.md +++ b/docs/OrdersCreateResponseBody.md @@ -7,23 +7,23 @@ | **id** | **String** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | [optional] | | **source_id** | **String** | Unique source ID of an existing order that will be linked to the redemption of this request. | [optional] | | **status** | **String** | The order status. | [optional] | -| **amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **initial_amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. | [optional] | -| **items_discount_amount** | **Integer** | Sum of all product-specific discounts applied to the order. | [optional] | -| **total_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied to the order. | [optional] | -| **total_amount** | **Integer** | Order amount after undoing all the discounts through the rollback redemption. | [optional] | -| **applied_discount_amount** | **Integer** | This field shows the order-level discount applied. | [optional] | -| **items_applied_discount_amount** | **Integer** | Sum of all product-specific discounts applied in a particular request. `sum(items, i => i.applied_discount_amount)` | [optional] | -| **total_applied_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied in a particular request. `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | [optional] | -| **items** | [**Array<OrderCalculatedItem>**](OrderCalculatedItem.md) | Array of items applied to the order. It can include up 500 items. | [optional] | +| **amount** | **Integer** | This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **initial_amount** | **Integer** | This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items_discount_amount** | **Integer** | Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **total_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **total_amount** | **Integer** | Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **applied_discount_amount** | **Integer** | This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items_applied_discount_amount** | **Integer** | Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `sum(items, i => i.applied_discount_amount)` | [optional] | +| **total_applied_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | [optional] | | **metadata** | **Object** | A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. | [optional] | | **object** | **String** | The type of the object represented by JSON. | [optional][default to 'order'] | | **created_at** | **Time** | Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format. | [optional] | | **updated_at** | **Time** | Timestamp representing the date and time when the order was last updated in ISO 8601 format. | [optional] | -| **customer_id** | **String** | Unique customer ID of the customer making the purchase. | [optional] | +| **customer_id** | **String** | Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify. | [optional] | | **referrer_id** | **String** | Unique referrer ID. | [optional] | | **customer** | [**CustomerId**](CustomerId.md) | | [optional] | | **referrer** | [**ReferrerId**](ReferrerId.md) | | [optional] | | **redemptions** | [**Hash<String, OrderRedemptionsEntry>**](OrderRedemptionsEntry.md) | | [optional] | +| **items** | [**Array<OrderCalculatedItem>**](OrderCalculatedItem.md) | Array of items applied to the order. It can include up to 500 items. | [optional] | diff --git a/docs/OrdersGetResponseBody.md b/docs/OrdersGetResponseBody.md index e156683c..bd052468 100644 --- a/docs/OrdersGetResponseBody.md +++ b/docs/OrdersGetResponseBody.md @@ -7,23 +7,23 @@ | **id** | **String** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | [optional] | | **source_id** | **String** | Unique source ID of an existing order that will be linked to the redemption of this request. | [optional] | | **status** | **String** | The order status. | [optional] | -| **amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **initial_amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. | [optional] | -| **items_discount_amount** | **Integer** | Sum of all product-specific discounts applied to the order. | [optional] | -| **total_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied to the order. | [optional] | -| **total_amount** | **Integer** | Order amount after undoing all the discounts through the rollback redemption. | [optional] | -| **applied_discount_amount** | **Integer** | This field shows the order-level discount applied. | [optional] | -| **items_applied_discount_amount** | **Integer** | Sum of all product-specific discounts applied in a particular request. `sum(items, i => i.applied_discount_amount)` | [optional] | -| **total_applied_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied in a particular request. `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | [optional] | -| **items** | [**Array<OrderCalculatedItem>**](OrderCalculatedItem.md) | Array of items applied to the order. It can include up 500 items. | [optional] | +| **amount** | **Integer** | This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **initial_amount** | **Integer** | This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items_discount_amount** | **Integer** | Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **total_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **total_amount** | **Integer** | Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **applied_discount_amount** | **Integer** | This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items_applied_discount_amount** | **Integer** | Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `sum(items, i => i.applied_discount_amount)` | [optional] | +| **total_applied_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | [optional] | | **metadata** | **Object** | A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. | [optional] | | **object** | **String** | The type of the object represented by JSON. | [optional][default to 'order'] | | **created_at** | **Time** | Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format. | [optional] | | **updated_at** | **Time** | Timestamp representing the date and time when the order was last updated in ISO 8601 format. | [optional] | -| **customer_id** | **String** | Unique customer ID of the customer making the purchase. | [optional] | +| **customer_id** | **String** | Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify. | [optional] | | **referrer_id** | **String** | Unique referrer ID. | [optional] | | **customer** | [**CustomerId**](CustomerId.md) | | [optional] | | **referrer** | [**ReferrerId**](ReferrerId.md) | | [optional] | | **redemptions** | [**Hash<String, OrderRedemptionsEntry>**](OrderRedemptionsEntry.md) | | [optional] | +| **items** | [**Array<OrderCalculatedItem>**](OrderCalculatedItem.md) | Array of items applied to the order. It can include up to 500 items. | [optional] | diff --git a/docs/OrdersImportCreateRequestBodyItem.md b/docs/OrdersImportCreateRequestBodyItem.md index 4bfdfa32..1c8ae7c8 100644 --- a/docs/OrdersImportCreateRequestBodyItem.md +++ b/docs/OrdersImportCreateRequestBodyItem.md @@ -9,8 +9,8 @@ | **status** | **String** | The order status. | [optional] | | **amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | | **initial_amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. | [optional] | -| **items** | [**Array<OrderItem>**](OrderItem.md) | Array of items applied to the order. It can include up 500 items. | [optional] | +| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items** | [**Array<OrderItem>**](OrderItem.md) | Array of items applied to the order. It can include up to 500 items. | [optional] | | **metadata** | **Object** | A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. | [optional] | | **created_at** | **Time** | Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format. | [optional] | | **referrer_id** | **String** | Unique referrer ID. | [optional] | diff --git a/docs/OrdersUpdateRequestBody.md b/docs/OrdersUpdateRequestBody.md index 6df94970..09d7cb30 100644 --- a/docs/OrdersUpdateRequestBody.md +++ b/docs/OrdersUpdateRequestBody.md @@ -8,8 +8,8 @@ | **status** | **String** | The order status. | [optional] | | **amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | | **initial_amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. | [optional] | -| **items** | [**Array<OrderItem>**](OrderItem.md) | Array of items applied to the order. It can include up 500 items. | [optional] | +| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items** | [**Array<OrderItem>**](OrderItem.md) | Array of items applied to the order. It can include up to 500 items. | [optional] | | **metadata** | **Object** | A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. | [optional] | | **created_at** | **Time** | Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format. | [optional] | | **referrer_id** | **String** | Unique referrer ID. | [optional] | diff --git a/docs/OrdersUpdateResponseBody.md b/docs/OrdersUpdateResponseBody.md index 4b60bd2c..a81f542d 100644 --- a/docs/OrdersUpdateResponseBody.md +++ b/docs/OrdersUpdateResponseBody.md @@ -7,23 +7,23 @@ | **id** | **String** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | [optional] | | **source_id** | **String** | Unique source ID of an existing order that will be linked to the redemption of this request. | [optional] | | **status** | **String** | The order status. | [optional] | -| **amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **initial_amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. | [optional] | -| **items_discount_amount** | **Integer** | Sum of all product-specific discounts applied to the order. | [optional] | -| **total_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied to the order. | [optional] | -| **total_amount** | **Integer** | Order amount after undoing all the discounts through the rollback redemption. | [optional] | -| **applied_discount_amount** | **Integer** | This field shows the order-level discount applied. | [optional] | -| **items_applied_discount_amount** | **Integer** | Sum of all product-specific discounts applied in a particular request. `sum(items, i => i.applied_discount_amount)` | [optional] | -| **total_applied_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied in a particular request. `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | [optional] | -| **items** | [**Array<OrderCalculatedItem>**](OrderCalculatedItem.md) | Array of items applied to the order. It can include up 500 items. | [optional] | +| **amount** | **Integer** | This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **initial_amount** | **Integer** | This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items_discount_amount** | **Integer** | Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **total_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **total_amount** | **Integer** | Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **applied_discount_amount** | **Integer** | This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items_applied_discount_amount** | **Integer** | Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `sum(items, i => i.applied_discount_amount)` | [optional] | +| **total_applied_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | [optional] | | **metadata** | **Object** | A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. | [optional] | | **object** | **String** | The type of the object represented by JSON. | [optional][default to 'order'] | | **created_at** | **Time** | Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format. | [optional] | | **updated_at** | **Time** | Timestamp representing the date and time when the order was last updated in ISO 8601 format. | [optional] | -| **customer_id** | **String** | Unique customer ID of the customer making the purchase. | [optional] | +| **customer_id** | **String** | Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify. | [optional] | | **referrer_id** | **String** | Unique referrer ID. | [optional] | | **customer** | [**CustomerId**](CustomerId.md) | | [optional] | | **referrer** | [**ReferrerId**](ReferrerId.md) | | [optional] | | **redemptions** | [**Hash<String, OrderRedemptionsEntry>**](OrderRedemptionsEntry.md) | | [optional] | +| **items** | [**Array<OrderCalculatedItem>**](OrderCalculatedItem.md) | Array of items applied to the order. It can include up to 500 items. | [optional] | diff --git a/docs/ParameterOrderListPendingPoints.md b/docs/ParameterOrderListPendingPoints.md new file mode 100644 index 00000000..f9193f93 --- /dev/null +++ b/docs/ParameterOrderListPendingPoints.md @@ -0,0 +1,7 @@ +# VoucherifySdk::ParameterOrderListPendingPoints + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + diff --git a/docs/RedeemableLoyaltyCard.md b/docs/RedeemableLoyaltyCard.md index 6d826c28..4e1127c5 100644 --- a/docs/RedeemableLoyaltyCard.md +++ b/docs/RedeemableLoyaltyCard.md @@ -4,7 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **exchange_ratio** | **Float** | The cash equivalent of the points defined in the points_ratio property. | [optional] | | **points_ratio** | **Integer** | The number of loyalty points that will map to the predefined cash amount defined by the exchange_ratio property. | [optional] | diff --git a/docs/RedeemableVoucherLoyaltyCard.md b/docs/RedeemableVoucherLoyaltyCard.md index b6559348..c0de9309 100644 --- a/docs/RedeemableVoucherLoyaltyCard.md +++ b/docs/RedeemableVoucherLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/RedemptionEntryOrder.md b/docs/RedemptionEntryOrder.md index 3b6d395f..15cc2488 100644 --- a/docs/RedemptionEntryOrder.md +++ b/docs/RedemptionEntryOrder.md @@ -7,23 +7,23 @@ | **id** | **String** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | [optional] | | **source_id** | **String** | Unique source ID of an existing order that will be linked to the redemption of this request. | [optional] | | **status** | **String** | The order status. | [optional] | -| **amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **initial_amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. | [optional] | -| **items_discount_amount** | **Integer** | Sum of all product-specific discounts applied to the order. | [optional] | -| **total_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied to the order. | [optional] | -| **total_amount** | **Integer** | Order amount after undoing all the discounts through the rollback redemption. | [optional] | -| **applied_discount_amount** | **Integer** | This field shows the order-level discount applied. | [optional] | -| **items_applied_discount_amount** | **Integer** | Sum of all product-specific discounts applied in a particular request. `sum(items, i => i.applied_discount_amount)` | [optional] | -| **total_applied_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied in a particular request. `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | [optional] | -| **items** | [**Array<OrderCalculatedItem>**](OrderCalculatedItem.md) | Array of items applied to the order. It can include up 500 items. | [optional] | +| **amount** | **Integer** | This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **initial_amount** | **Integer** | This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items_discount_amount** | **Integer** | Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **total_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **total_amount** | **Integer** | Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **applied_discount_amount** | **Integer** | This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items_applied_discount_amount** | **Integer** | Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `sum(items, i => i.applied_discount_amount)` | [optional] | +| **total_applied_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | [optional] | | **metadata** | **Object** | A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. | [optional] | | **object** | **String** | The type of the object represented by JSON. | [optional][default to 'order'] | | **created_at** | **Time** | Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format. | [optional] | | **updated_at** | **Time** | Timestamp representing the date and time when the order was last updated in ISO 8601 format. | [optional] | -| **customer_id** | **String** | Unique customer ID of the customer making the purchase. | [optional] | +| **customer_id** | **String** | Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify. | [optional] | | **referrer_id** | **String** | Unique referrer ID. | [optional] | | **customer** | [**RedemptionEntryOrderCustomer**](RedemptionEntryOrderCustomer.md) | | [optional] | | **referrer** | [**RedemptionEntryOrderReferrer**](RedemptionEntryOrderReferrer.md) | | [optional] | | **redemptions** | [**Hash<String, OrderRedemptionsEntry>**](OrderRedemptionsEntry.md) | | [optional] | +| **items** | [**Array<OrderCalculatedItem>**](OrderCalculatedItem.md) | Array of items applied to the order. It can include up 500 items. | [optional] | diff --git a/docs/RedemptionEntryVoucherLoyaltyCard.md b/docs/RedemptionEntryVoucherLoyaltyCard.md index 2bc5e009..eccafd65 100644 --- a/docs/RedemptionEntryVoucherLoyaltyCard.md +++ b/docs/RedemptionEntryVoucherLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/RedemptionVoucherLoyaltyCard.md b/docs/RedemptionVoucherLoyaltyCard.md index e16c4d42..feb02c9f 100644 --- a/docs/RedemptionVoucherLoyaltyCard.md +++ b/docs/RedemptionVoucherLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/RedemptionsGetResponseBodyOrder.md b/docs/RedemptionsGetResponseBodyOrder.md index bf1d4402..14a8dbe9 100644 --- a/docs/RedemptionsGetResponseBodyOrder.md +++ b/docs/RedemptionsGetResponseBodyOrder.md @@ -7,23 +7,23 @@ | **id** | **String** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | [optional] | | **source_id** | **String** | Unique source ID of an existing order that will be linked to the redemption of this request. | [optional] | | **status** | **String** | The order status. | [optional] | -| **amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **initial_amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. | [optional] | -| **items_discount_amount** | **Integer** | Sum of all product-specific discounts applied to the order. | [optional] | -| **total_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied to the order. | [optional] | -| **total_amount** | **Integer** | Order amount after undoing all the discounts through the rollback redemption. | [optional] | -| **applied_discount_amount** | **Integer** | This field shows the order-level discount applied. | [optional] | -| **items_applied_discount_amount** | **Integer** | Sum of all product-specific discounts applied in a particular request. `sum(items, i => i.applied_discount_amount)` | [optional] | -| **total_applied_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied in a particular request. `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | [optional] | -| **items** | [**Array<OrderCalculatedItem>**](OrderCalculatedItem.md) | Array of items applied to the order. It can include up 500 items. | [optional] | +| **amount** | **Integer** | This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **initial_amount** | **Integer** | This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items_discount_amount** | **Integer** | Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **total_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **total_amount** | **Integer** | Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **applied_discount_amount** | **Integer** | This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items_applied_discount_amount** | **Integer** | Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `sum(items, i => i.applied_discount_amount)` | [optional] | +| **total_applied_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | [optional] | | **metadata** | **Object** | A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. | [optional] | | **object** | **String** | The type of the object represented by JSON. | [optional][default to 'order'] | | **created_at** | **Time** | Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format. | [optional] | | **updated_at** | **Time** | Timestamp representing the date and time when the order was last updated in ISO 8601 format. | [optional] | -| **customer_id** | **String** | Unique customer ID of the customer making the purchase. | [optional] | +| **customer_id** | **String** | Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify. | [optional] | | **referrer_id** | **String** | Unique referrer ID. | [optional] | | **customer** | [**RedemptionsGetResponseBodyOrderCustomer**](RedemptionsGetResponseBodyOrderCustomer.md) | | [optional] | | **referrer** | [**RedemptionsGetResponseBodyOrderReferrer**](RedemptionsGetResponseBodyOrderReferrer.md) | | [optional] | | **redemptions** | [**Hash<String, OrderRedemptionsEntry>**](OrderRedemptionsEntry.md) | | [optional] | +| **items** | [**Array<OrderCalculatedItem>**](OrderCalculatedItem.md) | Array of items applied to the order. It can include up 500 items. | [optional] | diff --git a/docs/RedemptionsGetResponseBodyVoucherLoyaltyCard.md b/docs/RedemptionsGetResponseBodyVoucherLoyaltyCard.md index aac5c2ac..12e23b33 100644 --- a/docs/RedemptionsGetResponseBodyVoucherLoyaltyCard.md +++ b/docs/RedemptionsGetResponseBodyVoucherLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/RedemptionsListResponseBodyRedemptionsItemOrder.md b/docs/RedemptionsListResponseBodyRedemptionsItemOrder.md index 582f000d..17e42edb 100644 --- a/docs/RedemptionsListResponseBodyRedemptionsItemOrder.md +++ b/docs/RedemptionsListResponseBodyRedemptionsItemOrder.md @@ -7,23 +7,23 @@ | **id** | **String** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | [optional] | | **source_id** | **String** | Unique source ID of an existing order that will be linked to the redemption of this request. | [optional] | | **status** | **String** | The order status. | [optional] | -| **amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **initial_amount** | **Integer** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] | -| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. | [optional] | -| **items_discount_amount** | **Integer** | Sum of all product-specific discounts applied to the order. | [optional] | -| **total_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied to the order. | [optional] | -| **total_amount** | **Integer** | Order amount after undoing all the discounts through the rollback redemption. | [optional] | -| **applied_discount_amount** | **Integer** | This field shows the order-level discount applied. | [optional] | -| **items_applied_discount_amount** | **Integer** | Sum of all product-specific discounts applied in a particular request. `sum(items, i => i.applied_discount_amount)` | [optional] | -| **total_applied_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied in a particular request. `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | [optional] | -| **items** | [**Array<OrderCalculatedItem>**](OrderCalculatedItem.md) | Array of items applied to the order. It can include up 500 items. | [optional] | +| **amount** | **Integer** | This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **initial_amount** | **Integer** | This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **discount_amount** | **Integer** | Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items_discount_amount** | **Integer** | Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **total_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **total_amount** | **Integer** | Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **applied_discount_amount** | **Integer** | This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] | +| **items_applied_discount_amount** | **Integer** | Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `sum(items, i => i.applied_discount_amount)` | [optional] | +| **total_applied_discount_amount** | **Integer** | Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | [optional] | | **metadata** | **Object** | A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. | [optional] | | **object** | **String** | The type of the object represented by JSON. | [optional][default to 'order'] | | **created_at** | **Time** | Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format. | [optional] | | **updated_at** | **Time** | Timestamp representing the date and time when the order was last updated in ISO 8601 format. | [optional] | -| **customer_id** | **String** | Unique customer ID of the customer making the purchase. | [optional] | +| **customer_id** | **String** | Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify. | [optional] | | **referrer_id** | **String** | Unique referrer ID. | [optional] | | **customer** | [**RedemptionsListResponseBodyRedemptionsItemOrderCustomer**](RedemptionsListResponseBodyRedemptionsItemOrderCustomer.md) | | [optional] | | **referrer** | [**RedemptionsListResponseBodyRedemptionsItemOrderReferrer**](RedemptionsListResponseBodyRedemptionsItemOrderReferrer.md) | | [optional] | | **redemptions** | [**Hash<String, OrderRedemptionsEntry>**](OrderRedemptionsEntry.md) | | [optional] | +| **items** | [**Array<OrderCalculatedItem>**](OrderCalculatedItem.md) | Array of items applied to the order. It can include up 500 items. | [optional] | diff --git a/docs/RedemptionsListResponseBodyRedemptionsItemVoucherLoyaltyCard.md b/docs/RedemptionsListResponseBodyRedemptionsItemVoucherLoyaltyCard.md index d5ded7ce..8d212ea2 100644 --- a/docs/RedemptionsListResponseBodyRedemptionsItemVoucherLoyaltyCard.md +++ b/docs/RedemptionsListResponseBodyRedemptionsItemVoucherLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/SimpleLoyaltyCard.md b/docs/SimpleLoyaltyCard.md index c8dde1fb..b265bd79 100644 --- a/docs/SimpleLoyaltyCard.md +++ b/docs/SimpleLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **String** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/TemplatesCampaignsCampaignSetupCreateRequestBody.md b/docs/TemplatesCampaignsCampaignSetupCreateRequestBody.md index 64805931..dfbbb1ae 100644 --- a/docs/TemplatesCampaignsCampaignSetupCreateRequestBody.md +++ b/docs/TemplatesCampaignsCampaignSetupCreateRequestBody.md @@ -20,5 +20,6 @@ | **category_id** | **String** | Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`. | [optional] | | **category** | **String** | The category assigned to the campaign. Either pass this parameter OR the `category_id`. | [optional] | | **metadata** | **Object** | The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format. | [optional] | +| **access_settings** | [**AccessSettings**](AccessSettings.md) | | [optional] | | **voucher** | [**TemplatesCampaignsCampaignSetupCreateRequestBodyVoucher**](TemplatesCampaignsCampaignSetupCreateRequestBodyVoucher.md) | | [optional] | diff --git a/docs/ValidationsValidateResponseBodyRedeemablesItemResultDiscount.md b/docs/ValidationsValidateResponseBodyRedeemablesItemResultDiscount.md index 2f06e047..1ba93ece 100644 --- a/docs/ValidationsValidateResponseBodyRedeemablesItemResultDiscount.md +++ b/docs/ValidationsValidateResponseBodyRedeemablesItemResultDiscount.md @@ -11,7 +11,7 @@ | **effect** | **String** | | [optional] | | **is_dynamic** | **Boolean** | Flag indicating whether the discount was calculated using a formula. | [optional] | | **unit_off** | **Integer** | Number of units to be granted a full value discount. | [optional] | -| **unit_off_formula** | **String** | | [optional] | +| **unit_off_formula** | **String** | Formula used to calculate the number of units. | [optional] | | **unit_type** | **String** | The product deemed as free, chosen from product inventory (e.g. time, items). | [optional] | | **product** | [**ValidationsValidateResponseBodyRedeemablesItemResultDiscountProduct**](ValidationsValidateResponseBodyRedeemablesItemResultDiscountProduct.md) | | [optional] | | **sku** | [**SimpleSkuDiscountUnit**](SimpleSkuDiscountUnit.md) | | [optional] | diff --git a/docs/VoucherLoyaltyCard.md b/docs/VoucherLoyaltyCard.md index de9d65bb..02a0438b 100644 --- a/docs/VoucherLoyaltyCard.md +++ b/docs/VoucherLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/VoucherTransactionDetails.md b/docs/VoucherTransactionDetails.md index e1cc724c..16327c98 100644 --- a/docs/VoucherTransactionDetails.md +++ b/docs/VoucherTransactionDetails.md @@ -14,6 +14,8 @@ | **rollback** | [**VoucherTransactionDetailsRollback**](VoucherTransactionDetailsRollback.md) | | [optional] | | **custom_event** | [**VoucherTransactionDetailsCustomEvent**](VoucherTransactionDetailsCustomEvent.md) | | [optional] | | **event_schema** | [**VoucherTransactionDetailsEventSchema**](VoucherTransactionDetailsEventSchema.md) | | [optional] | +| **holder_loyalty_tier** | [**VoucherTransactionDetailsHolderLoyaltyTier**](VoucherTransactionDetailsHolderLoyaltyTier.md) | | [optional] | +| **pending_points** | [**LoyaltyPendingPoints**](LoyaltyPendingPoints.md) | | [optional] | | **reward** | [**VoucherTransactionDetailsReward**](VoucherTransactionDetailsReward.md) | | [optional] | | **source_voucher** | [**SimpleVoucher**](SimpleVoucher.md) | | [optional] | | **destination_voucher** | [**SimpleVoucher**](SimpleVoucher.md) | | [optional] | diff --git a/docs/VoucherTransactionDetailsCustomEvent.md b/docs/VoucherTransactionDetailsCustomEvent.md index f4fb1e86..533a7b13 100644 --- a/docs/VoucherTransactionDetailsCustomEvent.md +++ b/docs/VoucherTransactionDetailsCustomEvent.md @@ -4,6 +4,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **id** | **String** | Unique event ID. | [optional] | -| **type** | **String** | Type of custom event. | [optional] | +| **id** | **String** | Unique identifier of the event. | [optional] | +| **type** | **String** | Type of the custom event. | [optional] | diff --git a/docs/VoucherTransactionDetailsEarningRule.md b/docs/VoucherTransactionDetailsEarningRule.md index 12f7d0d9..1afccf44 100644 --- a/docs/VoucherTransactionDetailsEarningRule.md +++ b/docs/VoucherTransactionDetailsEarningRule.md @@ -4,6 +4,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **id** | **String** | Unique earning rule ID. | [optional] | +| **id** | **String** | Unique identifier of an earning rule, assigned by Voucherify. | [optional] | | **source** | [**VoucherTransactionDetailsEarningRuleSource**](VoucherTransactionDetailsEarningRuleSource.md) | | [optional] | diff --git a/docs/VoucherTransactionDetailsEventSchema.md b/docs/VoucherTransactionDetailsEventSchema.md index 90594d66..76495513 100644 --- a/docs/VoucherTransactionDetailsEventSchema.md +++ b/docs/VoucherTransactionDetailsEventSchema.md @@ -4,6 +4,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **id** | **String** | Unique metadata schema ID. | [optional] | -| **name** | **String** | Type of custom event. | [optional] | +| **id** | **String** | Unique identifier of the metadata schema. | [optional] | +| **name** | **String** | Type of the custom event. | [optional] | diff --git a/docs/VoucherTransactionDetailsHolderLoyaltyTier.md b/docs/VoucherTransactionDetailsHolderLoyaltyTier.md new file mode 100644 index 00000000..bcbcc69c --- /dev/null +++ b/docs/VoucherTransactionDetailsHolderLoyaltyTier.md @@ -0,0 +1,9 @@ +# VoucherifySdk::VoucherTransactionDetailsHolderLoyaltyTier + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the loyalty tier, assigned by Voucherify. | [optional] | +| **name** | **String** | User-defined name of the loyalty tier. | [optional] | + diff --git a/docs/VoucherTransactionDetailsLoyaltyTier.md b/docs/VoucherTransactionDetailsLoyaltyTier.md index 3c5256b9..f0efa23b 100644 --- a/docs/VoucherTransactionDetailsLoyaltyTier.md +++ b/docs/VoucherTransactionDetailsLoyaltyTier.md @@ -4,6 +4,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **id** | **String** | | [optional] | -| **name** | **String** | | [optional] | +| **id** | **String** | Unique identifier of the loyalty tier, assigned by Voucherify. | [optional] | +| **name** | **String** | User-defined name of the loyalty tier. | [optional] | diff --git a/docs/VoucherTransactionDetailsRollback.md b/docs/VoucherTransactionDetailsRollback.md index e1f57fe3..bef2c368 100644 --- a/docs/VoucherTransactionDetailsRollback.md +++ b/docs/VoucherTransactionDetailsRollback.md @@ -4,5 +4,5 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **id** | **String** | Unique redemption rollback ID. | [optional] | +| **id** | **String** | Unique identifier of the redemption rollback. | [optional] | diff --git a/docs/VoucherTransactionDetailsSegment.md b/docs/VoucherTransactionDetailsSegment.md index 1f206d06..e2dbc4c4 100644 --- a/docs/VoucherTransactionDetailsSegment.md +++ b/docs/VoucherTransactionDetailsSegment.md @@ -4,6 +4,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **id** | **String** | | [optional] | -| **name** | **String** | | [optional] | +| **id** | **String** | Unique identifier of the segment. | [optional] | +| **name** | **String** | Name of the segment. | [optional] | diff --git a/docs/VoucherWithCategoriesLoyaltyCard.md b/docs/VoucherWithCategoriesLoyaltyCard.md index ac9c4990..31527663 100644 --- a/docs/VoucherWithCategoriesLoyaltyCard.md +++ b/docs/VoucherWithCategoriesLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/VouchersCreateResponseBodyLoyaltyCard.md b/docs/VouchersCreateResponseBodyLoyaltyCard.md index 4ca8aa52..0beb1bde 100644 --- a/docs/VouchersCreateResponseBodyLoyaltyCard.md +++ b/docs/VouchersCreateResponseBodyLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/VouchersDisableResponseBodyLoyaltyCard.md b/docs/VouchersDisableResponseBodyLoyaltyCard.md index 3b408245..7c33e052 100644 --- a/docs/VouchersDisableResponseBodyLoyaltyCard.md +++ b/docs/VouchersDisableResponseBodyLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/VouchersEnableResponseBodyLoyaltyCard.md b/docs/VouchersEnableResponseBodyLoyaltyCard.md index d8da755c..49018a9e 100644 --- a/docs/VouchersEnableResponseBodyLoyaltyCard.md +++ b/docs/VouchersEnableResponseBodyLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/VouchersGetResponseBodyLoyaltyCard.md b/docs/VouchersGetResponseBodyLoyaltyCard.md index d6e81377..337e41ec 100644 --- a/docs/VouchersGetResponseBodyLoyaltyCard.md +++ b/docs/VouchersGetResponseBodyLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/docs/VouchersUpdateResponseBodyLoyaltyCard.md b/docs/VouchersUpdateResponseBodyLoyaltyCard.md index 16c53f0e..ab90973e 100644 --- a/docs/VouchersUpdateResponseBodyLoyaltyCard.md +++ b/docs/VouchersUpdateResponseBodyLoyaltyCard.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card. | [optional] | +| **points** | **Integer** | Total points incurred over the lifespan of the loyalty card, minus the expired points. | [optional] | | **balance** | **Integer** | Points available for reward redemption. | [optional] | | **next_expiration_date** | **Date** | The next closest date when the next set of points are due to expire. | [optional] | | **next_expiration_points** | **Integer** | The amount of points that are set to expire next. | [optional] | +| **pending_points** | **Integer** | Determines the number of pending points that will be added to the loyalty card after the predefined time. | [optional] | diff --git a/lib/VoucherifySdk.rb b/lib/VoucherifySdk.rb index 4cd57346..251dcf8c 100644 --- a/lib/VoucherifySdk.rb +++ b/lib/VoucherifySdk.rb @@ -17,10 +17,15 @@ require 'VoucherifySdk/configuration' # Models +require 'VoucherifySdk/models/access_settings' +require 'VoucherifySdk/models/access_settings_assign' require 'VoucherifySdk/models/access_settings_campaign_assignments_list' +require 'VoucherifySdk/models/access_settings_unassign' require 'VoucherifySdk/models/applicable_to' require 'VoucherifySdk/models/applicable_to_effect' +require 'VoucherifySdk/models/applicable_to_order_item_units_item' require 'VoucherifySdk/models/applicable_to_result_list' +require 'VoucherifySdk/models/application_details_item' require 'VoucherifySdk/models/area_store_campaign_assignment' require 'VoucherifySdk/models/async_action_base' require 'VoucherifySdk/models/async_action_get_response_body' @@ -163,10 +168,14 @@ require 'VoucherifySdk/models/earning_rule_loyalty_order_metadata' require 'VoucherifySdk/models/earning_rule_loyalty_order_total_amount' require 'VoucherifySdk/models/earning_rule_loyalty_tier' +require 'VoucherifySdk/models/earning_rule_pending_points' require 'VoucherifySdk/models/earning_rule_segment' require 'VoucherifySdk/models/earning_rule_source' require 'VoucherifySdk/models/error' require 'VoucherifySdk/models/error_error' +require 'VoucherifySdk/models/event_source' +require 'VoucherifySdk/models/event_source_api_key' +require 'VoucherifySdk/models/event_source_user' require 'VoucherifySdk/models/events_create_request_body' require 'VoucherifySdk/models/events_create_request_body_loyalty' require 'VoucherifySdk/models/events_create_request_body_referral' @@ -193,6 +202,7 @@ require 'VoucherifySdk/models/filters_condition' require 'VoucherifySdk/models/gift' require 'VoucherifySdk/models/inapplicable_to' +require 'VoucherifySdk/models/inapplicable_to_order_item_units_item' require 'VoucherifySdk/models/inapplicable_to_result_list' require 'VoucherifySdk/models/junction' require 'VoucherifySdk/models/list_publications_item_voucher' @@ -242,6 +252,7 @@ require 'VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty_order_metadata' require 'VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty_order_total_amount' require 'VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty_tier' +require 'VoucherifySdk/models/loyalties_earning_rules_create_response_body_pending_points' require 'VoucherifySdk/models/loyalties_earning_rules_create_response_body_segment' require 'VoucherifySdk/models/loyalties_earning_rules_create_response_body_source' require 'VoucherifySdk/models/loyalties_earning_rules_disable_response_body' @@ -260,6 +271,7 @@ require 'VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty_order_metadata' require 'VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty_order_total_amount' require 'VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty_tier' +require 'VoucherifySdk/models/loyalties_earning_rules_disable_response_body_pending_points' require 'VoucherifySdk/models/loyalties_earning_rules_disable_response_body_segment' require 'VoucherifySdk/models/loyalties_earning_rules_disable_response_body_source' require 'VoucherifySdk/models/loyalties_earning_rules_enable_response_body' @@ -278,6 +290,7 @@ require 'VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty_order_metadata' require 'VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty_order_total_amount' require 'VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty_tier' +require 'VoucherifySdk/models/loyalties_earning_rules_enable_response_body_pending_points' require 'VoucherifySdk/models/loyalties_earning_rules_enable_response_body_segment' require 'VoucherifySdk/models/loyalties_earning_rules_enable_response_body_source' require 'VoucherifySdk/models/loyalties_earning_rules_get_response_body' @@ -296,6 +309,7 @@ require 'VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty_order_metadata' require 'VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty_order_total_amount' require 'VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty_tier' +require 'VoucherifySdk/models/loyalties_earning_rules_get_response_body_pending_points' require 'VoucherifySdk/models/loyalties_earning_rules_get_response_body_segment' require 'VoucherifySdk/models/loyalties_earning_rules_get_response_body_source' require 'VoucherifySdk/models/loyalties_earning_rules_list_response_body' @@ -330,6 +344,7 @@ require 'VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty_order_metadata' require 'VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty_order_total_amount' require 'VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty_tier' +require 'VoucherifySdk/models/loyalties_earning_rules_update_response_body_pending_points' require 'VoucherifySdk/models/loyalties_earning_rules_update_response_body_segment' require 'VoucherifySdk/models/loyalties_earning_rules_update_response_body_source' require 'VoucherifySdk/models/loyalties_get_campaign_response_body' @@ -349,6 +364,9 @@ require 'VoucherifySdk/models/loyalties_members_get_response_body_loyalty_card' require 'VoucherifySdk/models/loyalties_members_get_response_body_publish' require 'VoucherifySdk/models/loyalties_members_get_response_body_redemption' +require 'VoucherifySdk/models/loyalties_members_pending_points_activate_response_body' +require 'VoucherifySdk/models/loyalties_members_pending_points_activate_response_body_related_object' +require 'VoucherifySdk/models/loyalties_members_pending_points_list_response_body' require 'VoucherifySdk/models/loyalties_members_points_expiration_list_response_body' require 'VoucherifySdk/models/loyalties_members_points_expiration_list_response_body_data_item' require 'VoucherifySdk/models/loyalties_members_points_expiration_list_response_body_data_item_bucket' @@ -381,6 +399,7 @@ require 'VoucherifySdk/models/loyalties_members_transfers_create_response_body_loyalty_card' require 'VoucherifySdk/models/loyalties_members_transfers_create_response_body_publish' require 'VoucherifySdk/models/loyalties_members_transfers_create_response_body_redemption' +require 'VoucherifySdk/models/loyalties_pending_points_list_response_body' require 'VoucherifySdk/models/loyalties_points_expiration_export_create_request_body' require 'VoucherifySdk/models/loyalties_points_expiration_export_create_request_body_parameters' require 'VoucherifySdk/models/loyalties_points_expiration_export_create_request_body_parameters_filters' @@ -441,6 +460,7 @@ require 'VoucherifySdk/models/loyalty_card_transaction_details_earning_rule_source' require 'VoucherifySdk/models/loyalty_card_transaction_details_event' require 'VoucherifySdk/models/loyalty_card_transaction_details_event_schema' +require 'VoucherifySdk/models/loyalty_card_transaction_details_holder_loyalty_tier' require 'VoucherifySdk/models/loyalty_card_transaction_details_loyalty_tier' require 'VoucherifySdk/models/loyalty_card_transaction_details_order' require 'VoucherifySdk/models/loyalty_card_transaction_details_redemption' @@ -452,6 +472,14 @@ require 'VoucherifySdk/models/loyalty_member_loyalty_card' require 'VoucherifySdk/models/loyalty_member_publish' require 'VoucherifySdk/models/loyalty_member_redemption' +require 'VoucherifySdk/models/loyalty_pending_points' +require 'VoucherifySdk/models/loyalty_pending_points_details' +require 'VoucherifySdk/models/loyalty_pending_points_details_earning_rule' +require 'VoucherifySdk/models/loyalty_pending_points_details_earning_rule_source' +require 'VoucherifySdk/models/loyalty_pending_points_details_event' +require 'VoucherifySdk/models/loyalty_pending_points_details_holder_loyalty_tier' +require 'VoucherifySdk/models/loyalty_pending_points_details_loyalty_tier' +require 'VoucherifySdk/models/loyalty_pending_points_details_order' require 'VoucherifySdk/models/loyalty_points_bucket' require 'VoucherifySdk/models/loyalty_points_bucket_bucket' require 'VoucherifySdk/models/loyalty_tier' @@ -694,6 +722,7 @@ require 'VoucherifySdk/models/parameter_order_list_locations' require 'VoucherifySdk/models/parameter_order_list_loyalty_tiers' require 'VoucherifySdk/models/parameter_order_list_orders' +require 'VoucherifySdk/models/parameter_order_list_pending_points' require 'VoucherifySdk/models/parameter_order_list_promotion_tiers' require 'VoucherifySdk/models/parameter_order_list_promotion_tiers_client_side' require 'VoucherifySdk/models/parameter_order_list_publications' @@ -1086,6 +1115,7 @@ require 'VoucherifySdk/models/voucher_transaction_details_earning_rule_source' require 'VoucherifySdk/models/voucher_transaction_details_event' require 'VoucherifySdk/models/voucher_transaction_details_event_schema' +require 'VoucherifySdk/models/voucher_transaction_details_holder_loyalty_tier' require 'VoucherifySdk/models/voucher_transaction_details_loyalty_tier' require 'VoucherifySdk/models/voucher_transaction_details_order' require 'VoucherifySdk/models/voucher_transaction_details_redemption' diff --git a/lib/VoucherifySdk/api/bin_api.rb b/lib/VoucherifySdk/api/bin_api.rb index e61c0795..49de2d99 100644 --- a/lib/VoucherifySdk/api/bin_api.rb +++ b/lib/VoucherifySdk/api/bin_api.rb @@ -80,8 +80,8 @@ def delete_bin_entry(bin_entry_id, opts = {}) # Retrieves a list of resources moved to the bin. The following resources can be moved to the bin: - campaigns - vouchers - products - SKUs To use this endpoint, you must have the following permissions: - vouchers.read - campaigns.read - products.read # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. - # @option opts [ParameterOrderListBin] :order Orders the bin entries according the date and time when they were moved to the bin or according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order. - # @option opts [String] :starting_after_id A cursor for pagination. It retrieves the events starting after an event with the given ID. + # @option opts [ParameterOrderListBin] :order Orders the bin entries according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order. + # @option opts [String] :starting_after_id A cursor for pagination. It retrieves the results starting after a result with the given ID. # @option opts [ParameterFiltersListBin] :filters Filters for listing bin entries. # @return [TrashBinListResponseBody] def list_bin_entries(opts = {}) @@ -93,8 +93,8 @@ def list_bin_entries(opts = {}) # Retrieves a list of resources moved to the bin. The following resources can be moved to the bin: - campaigns - vouchers - products - SKUs To use this endpoint, you must have the following permissions: - vouchers.read - campaigns.read - products.read # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. - # @option opts [ParameterOrderListBin] :order Orders the bin entries according the date and time when they were moved to the bin or according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order. - # @option opts [String] :starting_after_id A cursor for pagination. It retrieves the events starting after an event with the given ID. + # @option opts [ParameterOrderListBin] :order Orders the bin entries according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order. + # @option opts [String] :starting_after_id A cursor for pagination. It retrieves the results starting after a result with the given ID. # @option opts [ParameterFiltersListBin] :filters Filters for listing bin entries. # @return [Array<(TrashBinListResponseBody, Integer, Hash)>] TrashBinListResponseBody data, response status code and response headers private def list_bin_entries_with_http_info(opts = {}) diff --git a/lib/VoucherifySdk/api/loyalties_api.rb b/lib/VoucherifySdk/api/loyalties_api.rb index de2c3386..b0b360c2 100644 --- a/lib/VoucherifySdk/api/loyalties_api.rb +++ b/lib/VoucherifySdk/api/loyalties_api.rb @@ -19,6 +19,67 @@ class LoyaltiesApi def initialize(api_client = ApiClient.default) @api_client = api_client end + # Activate Member Pending Points + # >🚧 Beta endpoint The endpoint is behind a feature flag as it is still in development. Contact [Voucherify support](https://www.voucherify.io/contact-support) to unlock the feature for your organization. All current parameters and fields are listed and described. Activate manually the pending points and add them to the loyalty card. The pending points are determined by the pending point ID. Once activated, the pending point entry with that ID is not listed by the endpoints: List member (with campaign ID, without campaign ID), List campaign pending points. This **POST** method does not require a request body. + # @param member_id [String] Unique loyalty card code assigned to a particular customer. + # @param pending_points_id [String] Unique pending point identifier, assigned by Voucherify. + # @param [Hash] opts the optional parameters + # @return [LoyaltiesMembersPendingPointsActivateResponseBody] + def activate_member_pending_points(member_id, pending_points_id, opts = {}) + data, _status_code, _headers = activate_member_pending_points_with_http_info(member_id, pending_points_id, opts) + data + end + + # Activate Member Pending Points + # >🚧 Beta endpoint The endpoint is behind a feature flag as it is still in development. Contact [Voucherify support](https://www.voucherify.io/contact-support) to unlock the feature for your organization. All current parameters and fields are listed and described. Activate manually the pending points and add them to the loyalty card. The pending points are determined by the pending point ID. Once activated, the pending point entry with that ID is not listed by the endpoints: List member (with campaign ID, without campaign ID), List campaign pending points. This **POST** method does not require a request body. + # @param member_id [String] Unique loyalty card code assigned to a particular customer. + # @param pending_points_id [String] Unique pending point identifier, assigned by Voucherify. + # @param [Hash] opts the optional parameters + # @return [Array<(LoyaltiesMembersPendingPointsActivateResponseBody, Integer, Hash)>] LoyaltiesMembersPendingPointsActivateResponseBody data, response status code and response headers + private def activate_member_pending_points_with_http_info(member_id, pending_points_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LoyaltiesApi.activate_member_pending_points ...' + end + # resource path + local_var_path = '/v1/loyalties/members/{memberId}/pending-points/{pendingPointsId}/activate'.sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s)).sub('{' + 'pendingPointsId' + '}', CGI.escape(pending_points_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'LoyaltiesMembersPendingPointsActivateResponseBody' + + # auth_names + auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token'] + + new_options = opts.merge( + :operation => :"LoyaltiesApi.activate_member_pending_points", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LoyaltiesApi#activate_member_pending_points\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Add Member # This method assigns a loyalty card to a customer. It selects a loyalty card suitable for publication, adds a publish entry, and returns the published voucher. A voucher is suitable for publication when its active and hasnt been published yet. 📘 Auto-update campaign In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use **auto-update** campaign. # @param campaign_id [String] Unique campaign ID of the loyalty program. @@ -85,6 +146,65 @@ def add_member(campaign_id, opts = {}) return data, status_code, headers end + # Cancel Member Pending Points + # >🚧 Beta endpoint The endpoint is behind a feature flag as it is still in development. Contact [Voucherify support](https://www.voucherify.io/contact-support) to unlock the feature for your organization. All current parameters and fields are listed and described. Cancel manually the pending points for the loyalty card. The pending points are determined by the pending point ID. Once canceled, the pending point entry with that ID is not listed by the endpoints: List member (with campaign ID, without campaign ID), List campaign pending points. This **POST** method does not require a request body and it returns an empty, 204, response. + # @param member_id [String] Unique loyalty card code assigned to a particular customer. + # @param pending_points_id [String] Unique pending point identifier, assigned by Voucherify. + # @param [Hash] opts the optional parameters + # @return [nil] + def cancel_member_pending_points(member_id, pending_points_id, opts = {}) + cancel_member_pending_points_with_http_info(member_id, pending_points_id, opts) + nil + end + + # Cancel Member Pending Points + # >🚧 Beta endpoint The endpoint is behind a feature flag as it is still in development. Contact [Voucherify support](https://www.voucherify.io/contact-support) to unlock the feature for your organization. All current parameters and fields are listed and described. Cancel manually the pending points for the loyalty card. The pending points are determined by the pending point ID. Once canceled, the pending point entry with that ID is not listed by the endpoints: List member (with campaign ID, without campaign ID), List campaign pending points. This **POST** method does not require a request body and it returns an empty, 204, response. + # @param member_id [String] Unique loyalty card code assigned to a particular customer. + # @param pending_points_id [String] Unique pending point identifier, assigned by Voucherify. + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + private def cancel_member_pending_points_with_http_info(member_id, pending_points_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LoyaltiesApi.cancel_member_pending_points ...' + end + # resource path + local_var_path = '/v1/loyalties/members/{memberId}/pending-points/{pendingPointsId}/cancel'.sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s)).sub('{' + 'pendingPointsId' + '}', CGI.escape(pending_points_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token'] + + new_options = opts.merge( + :operation => :"LoyaltiesApi.cancel_member_pending_points", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LoyaltiesApi#cancel_member_pending_points\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create Earning Rule # Create earning rules for a loyalty campaign. # @param campaign_id [String] The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign. @@ -281,7 +401,7 @@ def create_loyalty_program(opts = {}) return data, status_code, headers end - # Create Points Expiration Export + # Export Loyalty Campaign Point Expiration # Schedule the generation of a points expiration CSV file for a particular campaign. # @param campaign_id [String] Unique campaign ID or name. # @param [Hash] opts the optional parameters @@ -292,7 +412,7 @@ def create_points_expiration_export(campaign_id, opts = {}) data end - # Create Points Expiration Export + # Export Loyalty Campaign Point Expiration # Schedule the generation of a points expiration CSV file for a particular campaign. # @param campaign_id [String] Unique campaign ID or name. # @param [Hash] opts the optional parameters @@ -596,7 +716,7 @@ def delete_reward_assignment1(campaign_id, assignment_id, opts = {}) # Disable Earning Rule # Disable an earning rule. # @param campaign_id [String] Unique campaign ID or name. - # @param earning_rule_id [String] Unique earning rule ID. + # @param earning_rule_id [String] Unique identifier of an earning rule, assigned by Voucherify. # @param [Hash] opts the optional parameters # @return [LoyaltiesEarningRulesDisableResponseBody] def disable_earning_rule(campaign_id, earning_rule_id, opts = {}) @@ -607,7 +727,7 @@ def disable_earning_rule(campaign_id, earning_rule_id, opts = {}) # Disable Earning Rule # Disable an earning rule. # @param campaign_id [String] Unique campaign ID or name. - # @param earning_rule_id [String] Unique earning rule ID. + # @param earning_rule_id [String] Unique identifier of an earning rule, assigned by Voucherify. # @param [Hash] opts the optional parameters # @return [Array<(LoyaltiesEarningRulesDisableResponseBody, Integer, Hash)>] LoyaltiesEarningRulesDisableResponseBody data, response status code and response headers private def disable_earning_rule_with_http_info(campaign_id, earning_rule_id, opts = {}) @@ -657,7 +777,7 @@ def disable_earning_rule(campaign_id, earning_rule_id, opts = {}) # Enable Earning Rule # Enable an earning rule. # @param campaign_id [String] Unique campaign ID or name. - # @param earning_rule_id [String] Unique earning rule ID. + # @param earning_rule_id [String] Unique identifier of an earning rule, assigned by Voucherify. # @param [Hash] opts the optional parameters # @return [LoyaltiesEarningRulesEnableResponseBody] def enable_earning_rule(campaign_id, earning_rule_id, opts = {}) @@ -668,7 +788,7 @@ def enable_earning_rule(campaign_id, earning_rule_id, opts = {}) # Enable Earning Rule # Enable an earning rule. # @param campaign_id [String] Unique campaign ID or name. - # @param earning_rule_id [String] Unique earning rule ID. + # @param earning_rule_id [String] Unique identifier of an earning rule, assigned by Voucherify. # @param [Hash] opts the optional parameters # @return [Array<(LoyaltiesEarningRulesEnableResponseBody, Integer, Hash)>] LoyaltiesEarningRulesEnableResponseBody data, response status code and response headers private def enable_earning_rule_with_http_info(campaign_id, earning_rule_id, opts = {}) @@ -1333,6 +1453,74 @@ def get_reward_details(campaign_id, assignment_id, opts = {}) return data, status_code, headers end + # List Campaign Pending Points + # >🚧 Beta endpoint The endpoint is behind a feature flag as it is still in development. Contact [Voucherify support](https://www.voucherify.io/contact-support) to unlock the feature for your organization. All current parameters and fields are listed and described. Lists all pending points that are currently assigned to all loyalty cards in a campaign. Once the points are added to the card, the entry is no longer returned. + # @param campaign_id [String] Unique campaign ID. + # @param [Hash] opts the optional parameters + # @option opts [Integer] :limit Limit the number of the pending point entries that the API returns in the response. + # @option opts [ParameterOrderListPendingPoints] :order Orders the pending point entries according the pending point entry ID. The dash - preceding a sorting option means sorting in a descending order. + # @option opts [String] :starting_after_id A cursor for pagination. It retrieves the results starting after a result with the given ID. + # @return [LoyaltiesPendingPointsListResponseBody] + def list_campaign_pending_points(campaign_id, opts = {}) + data, _status_code, _headers = list_campaign_pending_points_with_http_info(campaign_id, opts) + data + end + + # List Campaign Pending Points + # >🚧 Beta endpoint The endpoint is behind a feature flag as it is still in development. Contact [Voucherify support](https://www.voucherify.io/contact-support) to unlock the feature for your organization. All current parameters and fields are listed and described. Lists all pending points that are currently assigned to all loyalty cards in a campaign. Once the points are added to the card, the entry is no longer returned. + # @param campaign_id [String] Unique campaign ID. + # @param [Hash] opts the optional parameters + # @option opts [Integer] :limit Limit the number of the pending point entries that the API returns in the response. + # @option opts [ParameterOrderListPendingPoints] :order Orders the pending point entries according the pending point entry ID. The dash - preceding a sorting option means sorting in a descending order. + # @option opts [String] :starting_after_id A cursor for pagination. It retrieves the results starting after a result with the given ID. + # @return [Array<(LoyaltiesPendingPointsListResponseBody, Integer, Hash)>] LoyaltiesPendingPointsListResponseBody data, response status code and response headers + private def list_campaign_pending_points_with_http_info(campaign_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_campaign_pending_points ...' + end + # resource path + local_var_path = '/v1/loyalties/{campaignId}/pending-points'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'starting_after_id'] = opts[:'starting_after_id'] if !opts[:'starting_after_id'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'LoyaltiesPendingPointsListResponseBody' + + # auth_names + auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token'] + + new_options = opts.merge( + :operation => :"LoyaltiesApi.list_campaign_pending_points", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LoyaltiesApi#list_campaign_pending_points\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List Earning Rules # Returns a list of all earning rules within a given campaign. # @param campaign_id [String] The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign. @@ -1995,6 +2183,144 @@ def list_member_loyalty_tier(member_id, opts = {}) return data, status_code, headers end + # List Member Pending Points + # >🚧 Beta endpoint The endpoint is behind a feature flag as it is still in development. Contact [Voucherify support](https://www.voucherify.io/contact-support) to unlock the feature for your organization. All current parameters and fields are listed and described. 📘 Alternative endpoint This endpoint is an alternative to this endpoint. The URL was re-designed to list member pending points without having to provide the campaignId as a path parameter. Lists all pending points that are currently assigned to the loyalty card. Once the points are added to the card, the entry is no longer returned. + # @param member_id [String] Unique loyalty card code assigned to a particular customer. + # @param [Hash] opts the optional parameters + # @option opts [Integer] :limit Limit the number of the pending point entries that the API returns in the response. + # @option opts [ParameterOrderListPendingPoints] :order Orders the pending point entries according the pending point entry ID. The dash - preceding a sorting option means sorting in a descending order. + # @option opts [String] :starting_after_id A cursor for pagination. It retrieves the results starting after a result with the given ID. + # @return [LoyaltiesMembersPendingPointsListResponseBody] + def list_member_pending_points(member_id, opts = {}) + data, _status_code, _headers = list_member_pending_points_with_http_info(member_id, opts) + data + end + + # List Member Pending Points + # >🚧 Beta endpoint The endpoint is behind a feature flag as it is still in development. Contact [Voucherify support](https://www.voucherify.io/contact-support) to unlock the feature for your organization. All current parameters and fields are listed and described. 📘 Alternative endpoint This endpoint is an alternative to this endpoint. The URL was re-designed to list member pending points without having to provide the campaignId as a path parameter. Lists all pending points that are currently assigned to the loyalty card. Once the points are added to the card, the entry is no longer returned. + # @param member_id [String] Unique loyalty card code assigned to a particular customer. + # @param [Hash] opts the optional parameters + # @option opts [Integer] :limit Limit the number of the pending point entries that the API returns in the response. + # @option opts [ParameterOrderListPendingPoints] :order Orders the pending point entries according the pending point entry ID. The dash - preceding a sorting option means sorting in a descending order. + # @option opts [String] :starting_after_id A cursor for pagination. It retrieves the results starting after a result with the given ID. + # @return [Array<(LoyaltiesMembersPendingPointsListResponseBody, Integer, Hash)>] LoyaltiesMembersPendingPointsListResponseBody data, response status code and response headers + private def list_member_pending_points_with_http_info(member_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_member_pending_points ...' + end + # resource path + local_var_path = '/v1/loyalties/members/{memberId}/pending-points'.sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'starting_after_id'] = opts[:'starting_after_id'] if !opts[:'starting_after_id'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'LoyaltiesMembersPendingPointsListResponseBody' + + # auth_names + auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token'] + + new_options = opts.merge( + :operation => :"LoyaltiesApi.list_member_pending_points", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LoyaltiesApi#list_member_pending_points\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Member Pending Points + # >🚧 Beta endpoint The endpoint is behind a feature flag as it is still in development. Contact [Voucherify support](https://www.voucherify.io/contact-support) to unlock the feature for your organization. All current parameters and fields are listed and described. Lists all pending points that are currently assigned to the loyalty card. Once the points are added to the card, the entry is no longer returned. + # @param campaign_id [String] Unique campaign ID. + # @param member_id [String] Unique loyalty card code assigned to a particular customer. + # @param [Hash] opts the optional parameters + # @option opts [Integer] :limit Limit the number of the pending point entries that the API returns in the response. + # @option opts [ParameterOrderListPendingPoints] :order Orders the pending point entries according the pending point entry ID. The dash - preceding a sorting option means sorting in a descending order. + # @option opts [String] :starting_after_id A cursor for pagination. It retrieves the results starting after a result with the given ID. + # @return [LoyaltiesMembersPendingPointsListResponseBody] + def list_member_pending_points1(campaign_id, member_id, opts = {}) + data, _status_code, _headers = list_member_pending_points1_with_http_info(campaign_id, member_id, opts) + data + end + + # List Member Pending Points + # >🚧 Beta endpoint The endpoint is behind a feature flag as it is still in development. Contact [Voucherify support](https://www.voucherify.io/contact-support) to unlock the feature for your organization. All current parameters and fields are listed and described. Lists all pending points that are currently assigned to the loyalty card. Once the points are added to the card, the entry is no longer returned. + # @param campaign_id [String] Unique campaign ID. + # @param member_id [String] Unique loyalty card code assigned to a particular customer. + # @param [Hash] opts the optional parameters + # @option opts [Integer] :limit Limit the number of the pending point entries that the API returns in the response. + # @option opts [ParameterOrderListPendingPoints] :order Orders the pending point entries according the pending point entry ID. The dash - preceding a sorting option means sorting in a descending order. + # @option opts [String] :starting_after_id A cursor for pagination. It retrieves the results starting after a result with the given ID. + # @return [Array<(LoyaltiesMembersPendingPointsListResponseBody, Integer, Hash)>] LoyaltiesMembersPendingPointsListResponseBody data, response status code and response headers + private def list_member_pending_points1_with_http_info(campaign_id, member_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_member_pending_points1 ...' + end + # resource path + local_var_path = '/v1/loyalties/{campaignId}/members/{memberId}/pending-points'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'starting_after_id'] = opts[:'starting_after_id'] if !opts[:'starting_after_id'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'LoyaltiesMembersPendingPointsListResponseBody' + + # auth_names + auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token'] + + new_options = opts.merge( + :operation => :"LoyaltiesApi.list_member_pending_points1", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LoyaltiesApi#list_member_pending_points1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List Member Rewards # Retrieves the list of rewards that the given customer (identified by member_id, which is a loyalty card assigned to a particular customer) **can get in exchange for loyalty points**. You can use the affordable_only parameter to limit the results to rewards that the customer can actually afford (only rewards whose price in points is not higher than the loyalty points balance on a loyalty card). Please note that rewards that are disabled (i.e. set to Not Available in the Dashboard) for a given loyalty tier reward mapping will not be returned in this endpoint. # @param member_id [String] Unique loyalty card assigned to a particular customer. @@ -2140,7 +2466,7 @@ def list_members(campaign_id, opts = {}) return data, status_code, headers end - # Get Points Expiration + # List Loyalty Card Point Expiration # Retrieve loyalty point expiration buckets for a given loyalty card. Expired point buckets are not returned in this endpoint. You can use the Exports API to retrieve a list of both ACTIVE and EXPIRED point buckets. # @param campaign_id [String] The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign. # @param member_id [String] Loyalty card code. @@ -2153,7 +2479,7 @@ def list_points_expiration(campaign_id, member_id, opts = {}) data end - # Get Points Expiration + # List Loyalty Card Point Expiration # Retrieve loyalty point expiration buckets for a given loyalty card. Expired point buckets are not returned in this endpoint. You can use the Exports API to retrieve a list of both ACTIVE and EXPIRED point buckets. # @param campaign_id [String] The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign. # @param member_id [String] Loyalty card code. diff --git a/lib/VoucherifySdk/models/access_settings.rb b/lib/VoucherifySdk/models/access_settings.rb new file mode 100644 index 00000000..6721628c --- /dev/null +++ b/lib/VoucherifySdk/models/access_settings.rb @@ -0,0 +1,219 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Assigns or unassigns an area or store to the campaign. **NOTE**: this object can be sent if the Areas and Stores enterprise feature is enabled. Contact [Voucherify Sales](https://www.voucherify.io/contact-sales) to learn more. + class AccessSettings + attr_accessor :assign + + attr_accessor :unassign + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'assign' => :'assign', + :'unassign' => :'unassign' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'assign' => :'AccessSettingsAssign', + :'unassign' => :'AccessSettingsUnassign' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'assign', + :'unassign' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'assign') + self.assign = attributes[:'assign'] + end + + if attributes.key?(:'unassign') + self.unassign = attributes[:'unassign'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assign == o.assign && + unassign == o.unassign + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [assign, unassign].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/access_settings_assign.rb b/lib/VoucherifySdk/models/access_settings_assign.rb new file mode 100644 index 00000000..00c75cde --- /dev/null +++ b/lib/VoucherifySdk/models/access_settings_assign.rb @@ -0,0 +1,238 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Assigns the campaign to an area or a store. Provide the area and/or store IDs in the respective arrays. If a campaign changes assignments between areas or stores, unassign it from the area. For example, if a campaign is assigned to Area-01, but it must be now assigned to Store-01 within this area, you have to unassign the campaign from Area-01 and assign to Store-01 only. If you want to assign the campaign to stores only, you do not have to send the area ID. + class AccessSettingsAssign + # List all area IDs to which the campaign will be assigned. + attr_accessor :areas_ids + + # List all store IDs to which the campaign will be assigned. + attr_accessor :area_stores_ids + + # List all area IDs where the campaign is assigned to all stores in the area. This assignment is not equal to the assignment to all `area_stores_ids` listed separately. + attr_accessor :area_all_stores_ids + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'areas_ids' => :'areas_ids', + :'area_stores_ids' => :'area_stores_ids', + :'area_all_stores_ids' => :'area_all_stores_ids' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'areas_ids' => :'Array', + :'area_stores_ids' => :'Array', + :'area_all_stores_ids' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'areas_ids', + :'area_stores_ids', + :'area_all_stores_ids' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'areas_ids') + if (value = attributes[:'areas_ids']).is_a?(Array) + self.areas_ids = value + end + end + + if attributes.key?(:'area_stores_ids') + if (value = attributes[:'area_stores_ids']).is_a?(Array) + self.area_stores_ids = value + end + end + + if attributes.key?(:'area_all_stores_ids') + if (value = attributes[:'area_all_stores_ids']).is_a?(Array) + self.area_all_stores_ids = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + areas_ids == o.areas_ids && + area_stores_ids == o.area_stores_ids && + area_all_stores_ids == o.area_all_stores_ids + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [areas_ids, area_stores_ids, area_all_stores_ids].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/access_settings_unassign.rb b/lib/VoucherifySdk/models/access_settings_unassign.rb new file mode 100644 index 00000000..996f285a --- /dev/null +++ b/lib/VoucherifySdk/models/access_settings_unassign.rb @@ -0,0 +1,238 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Unassigns the campaign from an area or a store. Provide the area and/or store IDs in the respective arrays. If a campaign changes assignments between areas or stores, unassign it first. For example, if a campaign is assigned to Area-01, but it must be now assigned to Store-01 within this area, you have to unassign the campaign from Area-01 and assigned to Store-01 only. If you want to assign the campaign to stores only, you do not have to send the area ID. + class AccessSettingsUnassign + # List all area IDs from which the campaign will be unassigned. + attr_accessor :areas_ids + + # List all store IDs from which the campaign will be unassigned. + attr_accessor :area_stores_ids + + # List all area IDs where the campaign will be unassigned from all stores in the area. This unassignment is not equal to the unassignment from all `area_stores_ids` listed separately. + attr_accessor :area_all_stores_ids + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'areas_ids' => :'areas_ids', + :'area_stores_ids' => :'area_stores_ids', + :'area_all_stores_ids' => :'area_all_stores_ids' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'areas_ids' => :'Array', + :'area_stores_ids' => :'Array', + :'area_all_stores_ids' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'areas_ids', + :'area_stores_ids', + :'area_all_stores_ids' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'areas_ids') + if (value = attributes[:'areas_ids']).is_a?(Array) + self.areas_ids = value + end + end + + if attributes.key?(:'area_stores_ids') + if (value = attributes[:'area_stores_ids']).is_a?(Array) + self.area_stores_ids = value + end + end + + if attributes.key?(:'area_all_stores_ids') + if (value = attributes[:'area_all_stores_ids']).is_a?(Array) + self.area_all_stores_ids = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + areas_ids == o.areas_ids && + area_stores_ids == o.area_stores_ids && + area_all_stores_ids == o.area_all_stores_ids + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [areas_ids, area_stores_ids, area_all_stores_ids].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/applicable_to.rb b/lib/VoucherifySdk/models/applicable_to.rb index c87cc93a..a0e7d28f 100644 --- a/lib/VoucherifySdk/models/applicable_to.rb +++ b/lib/VoucherifySdk/models/applicable_to.rb @@ -52,16 +52,19 @@ class ApplicableTo # Maximum discount amount per order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects: - `APPLY_TO_ITEMS` (each item subtotal is discounted equally) - `APPLY_TO_ITEMS_BY_QUANTITY` (each unit of matched products has the same discount value) attr_accessor :aggregated_amount_limit - # Determines the order in which the discount is applied to the products or SKUs sent in the `order` object in the request. The counting begins from `0`. + # Lists which order lines are (not) covered by the discount. The order in the array is determined by the sequence of applied discounts, while the numbers correspond to the order lines sent in the `order` object in the request. The first order line is assigned `0`, the second order line is assigned `1`, and so on. attr_accessor :order_item_indices + # Lists which units within order lines are covered by the discount. The order line items are listed according to sequence of applied discounts while the `index` corresponds to the order line sent in the `order` object in the request. + attr_accessor :order_item_units + # Determines the recurrence of the discount, e.g. `\"repeat\": 3` means that the discount is applied to every third item. attr_accessor :repeat # Determines how many items are skipped before the discount is applied. attr_accessor :skip_initially - # Determines to which kinds of objects the discount is applicable. `\"ITEM\"` includes products and SKUs. + # Determines to which kinds of objects the discount is applicable. `ITEM` includes products and SKUs. `UNIT` means particular units within an order line. attr_accessor :target class EnumAttributeValidator @@ -103,6 +106,7 @@ def self.attribute_map :'amount_limit' => :'amount_limit', :'aggregated_amount_limit' => :'aggregated_amount_limit', :'order_item_indices' => :'order_item_indices', + :'order_item_units' => :'order_item_units', :'repeat' => :'repeat', :'skip_initially' => :'skip_initially', :'target' => :'target' @@ -131,6 +135,7 @@ def self.openapi_types :'amount_limit' => :'Integer', :'aggregated_amount_limit' => :'Integer', :'order_item_indices' => :'Array', + :'order_item_units' => :'Array', :'repeat' => :'Integer', :'skip_initially' => :'Integer', :'target' => :'String' @@ -153,6 +158,7 @@ def self.openapi_nullable :'amount_limit', :'aggregated_amount_limit', :'order_item_indices', + :'order_item_units', :'repeat', :'skip_initially', :'target' @@ -227,6 +233,12 @@ def initialize(attributes = {}) end end + if attributes.key?(:'order_item_units') + if (value = attributes[:'order_item_units']).is_a?(Array) + self.order_item_units = value + end + end + if attributes.key?(:'repeat') self.repeat = attributes[:'repeat'] end @@ -281,6 +293,7 @@ def ==(o) amount_limit == o.amount_limit && aggregated_amount_limit == o.aggregated_amount_limit && order_item_indices == o.order_item_indices && + order_item_units == o.order_item_units && repeat == o.repeat && skip_initially == o.skip_initially && target == o.target @@ -295,7 +308,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [object, id, source_id, product_id, product_source_id, strict, price, price_formula, effect, quantity_limit, aggregated_quantity_limit, amount_limit, aggregated_amount_limit, order_item_indices, repeat, skip_initially, target].hash + [object, id, source_id, product_id, product_source_id, strict, price, price_formula, effect, quantity_limit, aggregated_quantity_limit, amount_limit, aggregated_amount_limit, order_item_indices, order_item_units, repeat, skip_initially, target].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/applicable_to_order_item_units_item.rb b/lib/VoucherifySdk/models/applicable_to_order_item_units_item.rb new file mode 100644 index 00000000..035259bc --- /dev/null +++ b/lib/VoucherifySdk/models/applicable_to_order_item_units_item.rb @@ -0,0 +1,220 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + class ApplicableToOrderItemUnitsItem + # Number assigned to the order line item in accordance with the order sent in the request. + attr_accessor :index + + # Numbers of units in the order line covered by the discount; e.g. `2, 5, 8` for 10 units with the setting `\"skip_initially\": 1`, `\"repeat\": 3`. The counting of units starts from `1`. + attr_accessor :units + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'index' => :'index', + :'units' => :'units' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'index' => :'Integer', + :'units' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'index') + self.index = attributes[:'index'] + end + + if attributes.key?(:'units') + if (value = attributes[:'units']).is_a?(Array) + self.units = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + index == o.index && + units == o.units + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [index, units].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/application_details_item.rb b/lib/VoucherifySdk/models/application_details_item.rb new file mode 100644 index 00000000..987dd7e1 --- /dev/null +++ b/lib/VoucherifySdk/models/application_details_item.rb @@ -0,0 +1,284 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Object representing item replacement. + class ApplicationDetailsItem + # Index number of the source item that is replaced. The enumeration starts from `0`, which represents the first item in the request, e.g., if the replaced item is passed as the second in the request, `source_index` equals `3`. + attr_accessor :source_index + + # Number of source units that are replaced. + attr_accessor :source_applied_quantity + + # Amount equal to the price of the units that are replaced. Determines the change of the amount of the source item quantity. + attr_accessor :source_applied_quantity_amount + + # Index number of the target item that is a replacement of the source item. The enumeration continues the values for the order items, e.g. if there are three items in the request, `target_index` equals `3`, as enumeration starts from `0`. + attr_accessor :target_index + + # Number of added target units that are replacements. + attr_accessor :target_applied_quantity + + # Amount equal to the price of the units that are replacements. Determines the change in the amount of the target item quantity. + attr_accessor :target_applied_quantity_amount + + # Discount amount applied to the target item with regard to the replacement. Equals the `target_applied_quantity_amount` minus `source_applied_quantity_amount`. + attr_accessor :target_applied_discount_amount + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'source_index' => :'source_index', + :'source_applied_quantity' => :'source_applied_quantity', + :'source_applied_quantity_amount' => :'source_applied_quantity_amount', + :'target_index' => :'target_index', + :'target_applied_quantity' => :'target_applied_quantity', + :'target_applied_quantity_amount' => :'target_applied_quantity_amount', + :'target_applied_discount_amount' => :'target_applied_discount_amount' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'source_index' => :'Integer', + :'source_applied_quantity' => :'Integer', + :'source_applied_quantity_amount' => :'Integer', + :'target_index' => :'Integer', + :'target_applied_quantity' => :'Integer', + :'target_applied_quantity_amount' => :'Integer', + :'target_applied_discount_amount' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'source_index') + self.source_index = attributes[:'source_index'] + end + + if attributes.key?(:'source_applied_quantity') + self.source_applied_quantity = attributes[:'source_applied_quantity'] + end + + if attributes.key?(:'source_applied_quantity_amount') + self.source_applied_quantity_amount = attributes[:'source_applied_quantity_amount'] + end + + if attributes.key?(:'target_index') + self.target_index = attributes[:'target_index'] + end + + if attributes.key?(:'target_applied_quantity') + self.target_applied_quantity = attributes[:'target_applied_quantity'] + end + + if attributes.key?(:'target_applied_quantity_amount') + self.target_applied_quantity_amount = attributes[:'target_applied_quantity_amount'] + end + + if attributes.key?(:'target_applied_discount_amount') + self.target_applied_discount_amount = attributes[:'target_applied_discount_amount'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if !@source_index.nil? && @source_index < 0 + invalid_properties.push('invalid value for "source_index", must be greater than or equal to 0.') + end + + if !@source_applied_quantity.nil? && @source_applied_quantity > -1 + invalid_properties.push('invalid value for "source_applied_quantity", must be smaller than or equal to -1.') + end + + if !@source_applied_quantity_amount.nil? && @source_applied_quantity_amount > 0 + invalid_properties.push('invalid value for "source_applied_quantity_amount", must be smaller than or equal to 0.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if !@source_index.nil? && @source_index < 0 + return false if !@source_applied_quantity.nil? && @source_applied_quantity > -1 + return false if !@source_applied_quantity_amount.nil? && @source_applied_quantity_amount > 0 + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + source_index == o.source_index && + source_applied_quantity == o.source_applied_quantity && + source_applied_quantity_amount == o.source_applied_quantity_amount && + target_index == o.target_index && + target_applied_quantity == o.target_applied_quantity && + target_applied_quantity_amount == o.target_applied_quantity_amount && + target_applied_discount_amount == o.target_applied_discount_amount + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [source_index, source_applied_quantity, source_applied_quantity_amount, target_index, target_applied_quantity, target_applied_quantity_amount, target_applied_discount_amount].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/area_store_campaign_assignment.rb b/lib/VoucherifySdk/models/area_store_campaign_assignment.rb index 9648e451..ef898bb3 100644 --- a/lib/VoucherifySdk/models/area_store_campaign_assignment.rb +++ b/lib/VoucherifySdk/models/area_store_campaign_assignment.rb @@ -22,6 +22,9 @@ class AreaStoreCampaignAssignment # Unique identifier of the area to which the campaign is assigned. attr_accessor :area_id + # Determines if the campaign is assigned to all of the stores in the area, i.e. if an area ID is passed in the `access_settings.assign.area_all_stores_ids` in the request. + attr_accessor :all_stores + # Unique identifier of the store to which the campaign is assigned. attr_accessor :area_store_id @@ -58,6 +61,7 @@ def self.attribute_map { :'id' => :'id', :'area_id' => :'area_id', + :'all_stores' => :'all_stores', :'area_store_id' => :'area_store_id', :'created_at' => :'created_at', :'object' => :'object' @@ -74,6 +78,7 @@ def self.openapi_types { :'id' => :'String', :'area_id' => :'String', + :'all_stores' => :'Boolean', :'area_store_id' => :'String', :'created_at' => :'Time', :'object' => :'String' @@ -85,6 +90,7 @@ def self.openapi_nullable Set.new([ :'id', :'area_id', + :'all_stores', :'area_store_id', :'created_at', :'object' @@ -107,6 +113,10 @@ def initialize(attributes = {}) self.area_id = attributes[:'area_id'] end + if attributes.key?(:'all_stores') + self.all_stores = attributes[:'all_stores'] + end + if attributes.key?(:'area_store_id') self.area_store_id = attributes[:'area_store_id'] end @@ -146,6 +156,7 @@ def ==(o) self.class == o.class && id == o.id && area_id == o.area_id && + all_stores == o.all_stores && area_store_id == o.area_store_id && created_at == o.created_at && object == o.object @@ -160,7 +171,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, area_id, area_store_id, created_at, object].hash + [id, area_id, all_stores, area_store_id, created_at, object].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/campaign.rb b/lib/VoucherifySdk/models/campaign.rb index 04a3e933..7053baa0 100644 --- a/lib/VoucherifySdk/models/campaign.rb +++ b/lib/VoucherifySdk/models/campaign.rb @@ -100,12 +100,12 @@ class Campaign attr_accessor :loyalty_tiers_expiration + attr_accessor :access_settings_assignments + attr_accessor :promotion attr_accessor :validation_rules_assignments - attr_accessor :access_settings_assignments - class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -161,9 +161,9 @@ def self.attribute_map :'object' => :'object', :'referral_program' => :'referral_program', :'loyalty_tiers_expiration' => :'loyalty_tiers_expiration', + :'access_settings_assignments' => :'access_settings_assignments', :'promotion' => :'promotion', - :'validation_rules_assignments' => :'validation_rules_assignments', - :'access_settings_assignments' => :'access_settings_assignments' + :'validation_rules_assignments' => :'validation_rules_assignments' } end @@ -205,9 +205,9 @@ def self.openapi_types :'object' => :'String', :'referral_program' => :'ReferralProgram', :'loyalty_tiers_expiration' => :'LoyaltyTiersExpirationAll', + :'access_settings_assignments' => :'AccessSettingsCampaignAssignmentsList', :'promotion' => :'PromotionTiersList', - :'validation_rules_assignments' => :'ValidationRulesAssignmentsList', - :'access_settings_assignments' => :'AccessSettingsCampaignAssignmentsList' + :'validation_rules_assignments' => :'ValidationRulesAssignmentsList' } end @@ -375,6 +375,10 @@ def initialize(attributes = {}) self.loyalty_tiers_expiration = attributes[:'loyalty_tiers_expiration'] end + if attributes.key?(:'access_settings_assignments') + self.access_settings_assignments = attributes[:'access_settings_assignments'] + end + if attributes.key?(:'promotion') self.promotion = attributes[:'promotion'] end @@ -382,10 +386,6 @@ def initialize(attributes = {}) if attributes.key?(:'validation_rules_assignments') self.validation_rules_assignments = attributes[:'validation_rules_assignments'] end - - if attributes.key?(:'access_settings_assignments') - self.access_settings_assignments = attributes[:'access_settings_assignments'] - end end # Show invalid properties with the reasons. Usually used together with valid? @@ -446,9 +446,9 @@ def ==(o) object == o.object && referral_program == o.referral_program && loyalty_tiers_expiration == o.loyalty_tiers_expiration && + access_settings_assignments == o.access_settings_assignments && promotion == o.promotion && - validation_rules_assignments == o.validation_rules_assignments && - access_settings_assignments == o.access_settings_assignments + validation_rules_assignments == o.validation_rules_assignments end # @see the `==` method @@ -460,7 +460,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, name, description, campaign_type, type, voucher, auto_join, join_once, use_voucher_metadata_schema, validity_timeframe, validity_day_of_week, validity_hours, activity_duration_after_publishing, vouchers_count, start_date, expiration_date, active, metadata, created_at, updated_at, category, creation_status, vouchers_generation_status, readonly, protected, category_id, categories, object, referral_program, loyalty_tiers_expiration, promotion, validation_rules_assignments, access_settings_assignments].hash + [id, name, description, campaign_type, type, voucher, auto_join, join_once, use_voucher_metadata_schema, validity_timeframe, validity_day_of_week, validity_hours, activity_duration_after_publishing, vouchers_count, start_date, expiration_date, active, metadata, created_at, updated_at, category, creation_status, vouchers_generation_status, readonly, protected, category_id, categories, object, referral_program, loyalty_tiers_expiration, access_settings_assignments, promotion, validation_rules_assignments].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/campaign_base.rb b/lib/VoucherifySdk/models/campaign_base.rb index 04c139ad..678da560 100644 --- a/lib/VoucherifySdk/models/campaign_base.rb +++ b/lib/VoucherifySdk/models/campaign_base.rb @@ -101,6 +101,8 @@ class CampaignBase attr_accessor :loyalty_tiers_expiration + attr_accessor :access_settings_assignments + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -155,7 +157,8 @@ def self.attribute_map :'categories' => :'categories', :'object' => :'object', :'referral_program' => :'referral_program', - :'loyalty_tiers_expiration' => :'loyalty_tiers_expiration' + :'loyalty_tiers_expiration' => :'loyalty_tiers_expiration', + :'access_settings_assignments' => :'access_settings_assignments' } end @@ -196,7 +199,8 @@ def self.openapi_types :'categories' => :'Array', :'object' => :'String', :'referral_program' => :'ReferralProgram', - :'loyalty_tiers_expiration' => :'LoyaltyTiersExpirationAll' + :'loyalty_tiers_expiration' => :'LoyaltyTiersExpirationAll', + :'access_settings_assignments' => :'AccessSettingsCampaignAssignmentsList' } end @@ -363,6 +367,10 @@ def initialize(attributes = {}) if attributes.key?(:'loyalty_tiers_expiration') self.loyalty_tiers_expiration = attributes[:'loyalty_tiers_expiration'] end + + if attributes.key?(:'access_settings_assignments') + self.access_settings_assignments = attributes[:'access_settings_assignments'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -422,7 +430,8 @@ def ==(o) categories == o.categories && object == o.object && referral_program == o.referral_program && - loyalty_tiers_expiration == o.loyalty_tiers_expiration + loyalty_tiers_expiration == o.loyalty_tiers_expiration && + access_settings_assignments == o.access_settings_assignments end # @see the `==` method @@ -434,7 +443,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, name, description, campaign_type, type, voucher, auto_join, join_once, use_voucher_metadata_schema, validity_timeframe, validity_day_of_week, validity_hours, activity_duration_after_publishing, vouchers_count, start_date, expiration_date, active, metadata, created_at, updated_at, category, creation_status, vouchers_generation_status, readonly, protected, category_id, categories, object, referral_program, loyalty_tiers_expiration].hash + [id, name, description, campaign_type, type, voucher, auto_join, join_once, use_voucher_metadata_schema, validity_timeframe, validity_day_of_week, validity_hours, activity_duration_after_publishing, vouchers_count, start_date, expiration_date, active, metadata, created_at, updated_at, category, creation_status, vouchers_generation_status, readonly, protected, category_id, categories, object, referral_program, loyalty_tiers_expiration, access_settings_assignments].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/campaigns_create_request_body.rb b/lib/VoucherifySdk/models/campaigns_create_request_body.rb index 61d30e3b..203a5d79 100644 --- a/lib/VoucherifySdk/models/campaigns_create_request_body.rb +++ b/lib/VoucherifySdk/models/campaigns_create_request_body.rb @@ -61,6 +61,8 @@ class CampaignsCreateRequestBody # The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format. attr_accessor :metadata + attr_accessor :access_settings + # Array containing the ID of the validation rule associated with the promotion tier. attr_accessor :validation_rules @@ -113,6 +115,7 @@ def self.attribute_map :'category_id' => :'category_id', :'category' => :'category', :'metadata' => :'metadata', + :'access_settings' => :'access_settings', :'validation_rules' => :'validation_rules', :'campaign_type' => :'campaign_type', :'voucher' => :'voucher', @@ -145,6 +148,7 @@ def self.openapi_types :'category_id' => :'String', :'category' => :'String', :'metadata' => :'Object', + :'access_settings' => :'AccessSettings', :'validation_rules' => :'Array', :'campaign_type' => :'String', :'voucher' => :'CampaignsCreateRequestBodyVoucher', @@ -250,6 +254,10 @@ def initialize(attributes = {}) self.metadata = attributes[:'metadata'] end + if attributes.key?(:'access_settings') + self.access_settings = attributes[:'access_settings'] + end + if attributes.key?(:'validation_rules') if (value = attributes[:'validation_rules']).is_a?(Array) self.validation_rules = value @@ -318,6 +326,7 @@ def ==(o) category_id == o.category_id && category == o.category && metadata == o.metadata && + access_settings == o.access_settings && validation_rules == o.validation_rules && campaign_type == o.campaign_type && voucher == o.voucher && @@ -334,7 +343,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [name, description, type, join_once, auto_join, use_voucher_metadata_schema, vouchers_count, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, activity_duration_after_publishing, category_id, category, metadata, validation_rules, campaign_type, voucher, referral_program, promotion].hash + [name, description, type, join_once, auto_join, use_voucher_metadata_schema, vouchers_count, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, activity_duration_after_publishing, category_id, category, metadata, access_settings, validation_rules, campaign_type, voucher, referral_program, promotion].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/campaigns_create_response_body.rb b/lib/VoucherifySdk/models/campaigns_create_response_body.rb index 36d1774f..5887d41d 100644 --- a/lib/VoucherifySdk/models/campaigns_create_response_body.rb +++ b/lib/VoucherifySdk/models/campaigns_create_response_body.rb @@ -101,12 +101,12 @@ class CampaignsCreateResponseBody attr_accessor :loyalty_tiers_expiration + attr_accessor :access_settings_assignments + attr_accessor :promotion attr_accessor :validation_rules_assignments - attr_accessor :access_settings_assignments - class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -162,9 +162,9 @@ def self.attribute_map :'object' => :'object', :'referral_program' => :'referral_program', :'loyalty_tiers_expiration' => :'loyalty_tiers_expiration', + :'access_settings_assignments' => :'access_settings_assignments', :'promotion' => :'promotion', - :'validation_rules_assignments' => :'validation_rules_assignments', - :'access_settings_assignments' => :'access_settings_assignments' + :'validation_rules_assignments' => :'validation_rules_assignments' } end @@ -206,9 +206,9 @@ def self.openapi_types :'object' => :'String', :'referral_program' => :'ReferralProgram', :'loyalty_tiers_expiration' => :'LoyaltyTiersExpirationAll', + :'access_settings_assignments' => :'AccessSettingsCampaignAssignmentsList', :'promotion' => :'PromotionTiersList', - :'validation_rules_assignments' => :'ValidationRulesAssignmentsList', - :'access_settings_assignments' => :'AccessSettingsCampaignAssignmentsList' + :'validation_rules_assignments' => :'ValidationRulesAssignmentsList' } end @@ -376,6 +376,10 @@ def initialize(attributes = {}) self.loyalty_tiers_expiration = attributes[:'loyalty_tiers_expiration'] end + if attributes.key?(:'access_settings_assignments') + self.access_settings_assignments = attributes[:'access_settings_assignments'] + end + if attributes.key?(:'promotion') self.promotion = attributes[:'promotion'] end @@ -383,10 +387,6 @@ def initialize(attributes = {}) if attributes.key?(:'validation_rules_assignments') self.validation_rules_assignments = attributes[:'validation_rules_assignments'] end - - if attributes.key?(:'access_settings_assignments') - self.access_settings_assignments = attributes[:'access_settings_assignments'] - end end # Show invalid properties with the reasons. Usually used together with valid? @@ -447,9 +447,9 @@ def ==(o) object == o.object && referral_program == o.referral_program && loyalty_tiers_expiration == o.loyalty_tiers_expiration && + access_settings_assignments == o.access_settings_assignments && promotion == o.promotion && - validation_rules_assignments == o.validation_rules_assignments && - access_settings_assignments == o.access_settings_assignments + validation_rules_assignments == o.validation_rules_assignments end # @see the `==` method @@ -461,7 +461,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, name, description, campaign_type, type, voucher, auto_join, join_once, use_voucher_metadata_schema, validity_timeframe, validity_day_of_week, validity_hours, activity_duration_after_publishing, vouchers_count, start_date, expiration_date, active, metadata, created_at, updated_at, category, creation_status, vouchers_generation_status, readonly, protected, category_id, categories, object, referral_program, loyalty_tiers_expiration, promotion, validation_rules_assignments, access_settings_assignments].hash + [id, name, description, campaign_type, type, voucher, auto_join, join_once, use_voucher_metadata_schema, validity_timeframe, validity_day_of_week, validity_hours, activity_duration_after_publishing, vouchers_count, start_date, expiration_date, active, metadata, created_at, updated_at, category, creation_status, vouchers_generation_status, readonly, protected, category_id, categories, object, referral_program, loyalty_tiers_expiration, access_settings_assignments, promotion, validation_rules_assignments].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/campaigns_get_response_body.rb b/lib/VoucherifySdk/models/campaigns_get_response_body.rb index a9bd000b..5929bccd 100644 --- a/lib/VoucherifySdk/models/campaigns_get_response_body.rb +++ b/lib/VoucherifySdk/models/campaigns_get_response_body.rb @@ -101,12 +101,12 @@ class CampaignsGetResponseBody attr_accessor :loyalty_tiers_expiration + attr_accessor :access_settings_assignments + attr_accessor :promotion attr_accessor :validation_rules_assignments - attr_accessor :access_settings_assignments - class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -162,9 +162,9 @@ def self.attribute_map :'object' => :'object', :'referral_program' => :'referral_program', :'loyalty_tiers_expiration' => :'loyalty_tiers_expiration', + :'access_settings_assignments' => :'access_settings_assignments', :'promotion' => :'promotion', - :'validation_rules_assignments' => :'validation_rules_assignments', - :'access_settings_assignments' => :'access_settings_assignments' + :'validation_rules_assignments' => :'validation_rules_assignments' } end @@ -206,9 +206,9 @@ def self.openapi_types :'object' => :'String', :'referral_program' => :'ReferralProgram', :'loyalty_tiers_expiration' => :'LoyaltyTiersExpirationAll', + :'access_settings_assignments' => :'AccessSettingsCampaignAssignmentsList', :'promotion' => :'PromotionTiersList', - :'validation_rules_assignments' => :'ValidationRulesAssignmentsList', - :'access_settings_assignments' => :'AccessSettingsCampaignAssignmentsList' + :'validation_rules_assignments' => :'ValidationRulesAssignmentsList' } end @@ -376,6 +376,10 @@ def initialize(attributes = {}) self.loyalty_tiers_expiration = attributes[:'loyalty_tiers_expiration'] end + if attributes.key?(:'access_settings_assignments') + self.access_settings_assignments = attributes[:'access_settings_assignments'] + end + if attributes.key?(:'promotion') self.promotion = attributes[:'promotion'] end @@ -383,10 +387,6 @@ def initialize(attributes = {}) if attributes.key?(:'validation_rules_assignments') self.validation_rules_assignments = attributes[:'validation_rules_assignments'] end - - if attributes.key?(:'access_settings_assignments') - self.access_settings_assignments = attributes[:'access_settings_assignments'] - end end # Show invalid properties with the reasons. Usually used together with valid? @@ -447,9 +447,9 @@ def ==(o) object == o.object && referral_program == o.referral_program && loyalty_tiers_expiration == o.loyalty_tiers_expiration && + access_settings_assignments == o.access_settings_assignments && promotion == o.promotion && - validation_rules_assignments == o.validation_rules_assignments && - access_settings_assignments == o.access_settings_assignments + validation_rules_assignments == o.validation_rules_assignments end # @see the `==` method @@ -461,7 +461,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, name, description, campaign_type, type, voucher, auto_join, join_once, use_voucher_metadata_schema, validity_timeframe, validity_day_of_week, validity_hours, activity_duration_after_publishing, vouchers_count, start_date, expiration_date, active, metadata, created_at, updated_at, category, creation_status, vouchers_generation_status, readonly, protected, category_id, categories, object, referral_program, loyalty_tiers_expiration, promotion, validation_rules_assignments, access_settings_assignments].hash + [id, name, description, campaign_type, type, voucher, auto_join, join_once, use_voucher_metadata_schema, validity_timeframe, validity_day_of_week, validity_hours, activity_duration_after_publishing, vouchers_count, start_date, expiration_date, active, metadata, created_at, updated_at, category, creation_status, vouchers_generation_status, readonly, protected, category_id, categories, object, referral_program, loyalty_tiers_expiration, access_settings_assignments, promotion, validation_rules_assignments].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/campaigns_update_request_body.rb b/lib/VoucherifySdk/models/campaigns_update_request_body.rb index fe98ca27..a5fd0b60 100644 --- a/lib/VoucherifySdk/models/campaigns_update_request_body.rb +++ b/lib/VoucherifySdk/models/campaigns_update_request_body.rb @@ -43,6 +43,8 @@ class CampaignsUpdateRequestBody # Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`. attr_accessor :category_id + attr_accessor :access_settings + # Defines the amount of time the vouchers will be active after publishing. The value is shown in the ISO 8601 format. For example, a voucher with the value of P24D will be valid for a duration of 24 days. attr_accessor :activity_duration_after_publishing @@ -100,6 +102,7 @@ def self.attribute_map :'metadata' => :'metadata', :'unset_metadata_fields' => :'unset_metadata_fields', :'category_id' => :'category_id', + :'access_settings' => :'access_settings', :'activity_duration_after_publishing' => :'activity_duration_after_publishing', :'join_once' => :'join_once', :'auto_join' => :'auto_join', @@ -130,6 +133,7 @@ def self.openapi_types :'metadata' => :'Object', :'unset_metadata_fields' => :'Array', :'category_id' => :'String', + :'access_settings' => :'AccessSettings', :'activity_duration_after_publishing' => :'String', :'join_once' => :'Boolean', :'auto_join' => :'Boolean', @@ -212,6 +216,10 @@ def initialize(attributes = {}) self.category_id = attributes[:'category_id'] end + if attributes.key?(:'access_settings') + self.access_settings = attributes[:'access_settings'] + end + if attributes.key?(:'activity_duration_after_publishing') self.activity_duration_after_publishing = attributes[:'activity_duration_after_publishing'] end @@ -281,6 +289,7 @@ def ==(o) metadata == o.metadata && unset_metadata_fields == o.unset_metadata_fields && category_id == o.category_id && + access_settings == o.access_settings && activity_duration_after_publishing == o.activity_duration_after_publishing && join_once == o.join_once && auto_join == o.auto_join && @@ -301,7 +310,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, description, category, metadata, unset_metadata_fields, category_id, activity_duration_after_publishing, join_once, auto_join, type, discount, referral_program, gift, loyalty_tiers_expiration, options].hash + [start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, description, category, metadata, unset_metadata_fields, category_id, access_settings, activity_duration_after_publishing, join_once, auto_join, type, discount, referral_program, gift, loyalty_tiers_expiration, options].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/campaigns_update_response_body.rb b/lib/VoucherifySdk/models/campaigns_update_response_body.rb index 33f67a90..5bac03aa 100644 --- a/lib/VoucherifySdk/models/campaigns_update_response_body.rb +++ b/lib/VoucherifySdk/models/campaigns_update_response_body.rb @@ -101,12 +101,12 @@ class CampaignsUpdateResponseBody attr_accessor :loyalty_tiers_expiration + attr_accessor :access_settings_assignments + attr_accessor :promotion attr_accessor :validation_rules_assignments - attr_accessor :access_settings_assignments - class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -162,9 +162,9 @@ def self.attribute_map :'object' => :'object', :'referral_program' => :'referral_program', :'loyalty_tiers_expiration' => :'loyalty_tiers_expiration', + :'access_settings_assignments' => :'access_settings_assignments', :'promotion' => :'promotion', - :'validation_rules_assignments' => :'validation_rules_assignments', - :'access_settings_assignments' => :'access_settings_assignments' + :'validation_rules_assignments' => :'validation_rules_assignments' } end @@ -206,9 +206,9 @@ def self.openapi_types :'object' => :'String', :'referral_program' => :'ReferralProgram', :'loyalty_tiers_expiration' => :'LoyaltyTiersExpirationAll', + :'access_settings_assignments' => :'AccessSettingsCampaignAssignmentsList', :'promotion' => :'PromotionTiersList', - :'validation_rules_assignments' => :'ValidationRulesAssignmentsList', - :'access_settings_assignments' => :'AccessSettingsCampaignAssignmentsList' + :'validation_rules_assignments' => :'ValidationRulesAssignmentsList' } end @@ -376,6 +376,10 @@ def initialize(attributes = {}) self.loyalty_tiers_expiration = attributes[:'loyalty_tiers_expiration'] end + if attributes.key?(:'access_settings_assignments') + self.access_settings_assignments = attributes[:'access_settings_assignments'] + end + if attributes.key?(:'promotion') self.promotion = attributes[:'promotion'] end @@ -383,10 +387,6 @@ def initialize(attributes = {}) if attributes.key?(:'validation_rules_assignments') self.validation_rules_assignments = attributes[:'validation_rules_assignments'] end - - if attributes.key?(:'access_settings_assignments') - self.access_settings_assignments = attributes[:'access_settings_assignments'] - end end # Show invalid properties with the reasons. Usually used together with valid? @@ -447,9 +447,9 @@ def ==(o) object == o.object && referral_program == o.referral_program && loyalty_tiers_expiration == o.loyalty_tiers_expiration && + access_settings_assignments == o.access_settings_assignments && promotion == o.promotion && - validation_rules_assignments == o.validation_rules_assignments && - access_settings_assignments == o.access_settings_assignments + validation_rules_assignments == o.validation_rules_assignments end # @see the `==` method @@ -461,7 +461,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, name, description, campaign_type, type, voucher, auto_join, join_once, use_voucher_metadata_schema, validity_timeframe, validity_day_of_week, validity_hours, activity_duration_after_publishing, vouchers_count, start_date, expiration_date, active, metadata, created_at, updated_at, category, creation_status, vouchers_generation_status, readonly, protected, category_id, categories, object, referral_program, loyalty_tiers_expiration, promotion, validation_rules_assignments, access_settings_assignments].hash + [id, name, description, campaign_type, type, voucher, auto_join, join_once, use_voucher_metadata_schema, validity_timeframe, validity_day_of_week, validity_hours, activity_duration_after_publishing, vouchers_count, start_date, expiration_date, active, metadata, created_at, updated_at, category, creation_status, vouchers_generation_status, readonly, protected, category_id, categories, object, referral_program, loyalty_tiers_expiration, access_settings_assignments, promotion, validation_rules_assignments].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/campaigns_vouchers_create_combined_response_body_loyalty_card.rb b/lib/VoucherifySdk/models/campaigns_vouchers_create_combined_response_body_loyalty_card.rb index 1ff27ab3..65fc52f9 100644 --- a/lib/VoucherifySdk/models/campaigns_vouchers_create_combined_response_body_loyalty_card.rb +++ b/lib/VoucherifySdk/models/campaigns_vouchers_create_combined_response_body_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`. class CampaignsVouchersCreateCombinedResponseBodyLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -28,13 +28,17 @@ class CampaignsVouchersCreateCombinedResponseBodyLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -49,7 +53,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -59,7 +64,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -86,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -111,7 +121,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -123,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/campaigns_vouchers_create_response_body_loyalty_card.rb b/lib/VoucherifySdk/models/campaigns_vouchers_create_response_body_loyalty_card.rb index ef0f01de..6a2e22aa 100644 --- a/lib/VoucherifySdk/models/campaigns_vouchers_create_response_body_loyalty_card.rb +++ b/lib/VoucherifySdk/models/campaigns_vouchers_create_response_body_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`. class CampaignsVouchersCreateResponseBodyLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -28,13 +28,17 @@ class CampaignsVouchersCreateResponseBodyLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -49,7 +53,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -59,7 +64,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -86,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -111,7 +121,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -123,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item_result_discount.rb b/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item_result_discount.rb index 041581e0..3e685474 100644 --- a/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item_result_discount.rb +++ b/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item_result_discount.rb @@ -33,6 +33,7 @@ class ClientValidationsValidateResponseBodyRedeemablesItemResultDiscount # Number of units to be granted a full value discount. attr_accessor :unit_off + # Formula used to calculate the number of units. attr_accessor :unit_off_formula # The product deemed as free, chosen from product inventory (e.g. time, items). diff --git a/lib/VoucherifySdk/models/customer_loyalty.rb b/lib/VoucherifySdk/models/customer_loyalty.rb index 56638e14..56163823 100644 --- a/lib/VoucherifySdk/models/customer_loyalty.rb +++ b/lib/VoucherifySdk/models/customer_loyalty.rb @@ -15,7 +15,7 @@ module VoucherifySdk class CustomerLoyalty - # Customer's loyalty points. + # Customer's loyalty points minus expired for all loyalty cards which the customer has. attr_accessor :points # Total number of customers referred by the customer. diff --git a/lib/VoucherifySdk/models/discount.rb b/lib/VoucherifySdk/models/discount.rb index d1e12e9f..ec37a6b2 100644 --- a/lib/VoucherifySdk/models/discount.rb +++ b/lib/VoucherifySdk/models/discount.rb @@ -33,6 +33,7 @@ class Discount # Number of units to be granted a full value discount. attr_accessor :unit_off + # Formula used to calculate the number of units. attr_accessor :unit_off_formula # The product deemed as free, chosen from product inventory (e.g. time, items). diff --git a/lib/VoucherifySdk/models/discount_unit_multiple_one_unit.rb b/lib/VoucherifySdk/models/discount_unit_multiple_one_unit.rb index 1187148c..df1f84a2 100644 --- a/lib/VoucherifySdk/models/discount_unit_multiple_one_unit.rb +++ b/lib/VoucherifySdk/models/discount_unit_multiple_one_unit.rb @@ -18,6 +18,7 @@ class DiscountUnitMultipleOneUnit # Number of units to be granted a full value discount. attr_accessor :unit_off + # Formula used to calculate the number of units. attr_accessor :unit_off_formula # Defines how the unit is added to the customer's order. diff --git a/lib/VoucherifySdk/models/earning_rule.rb b/lib/VoucherifySdk/models/earning_rule.rb index 935d0c5b..ed7a5c68 100644 --- a/lib/VoucherifySdk/models/earning_rule.rb +++ b/lib/VoucherifySdk/models/earning_rule.rb @@ -31,6 +31,8 @@ class EarningRule attr_accessor :loyalty_tier + attr_accessor :pending_points + attr_accessor :source # The type of the object represented by JSON. Default is earning_rule. @@ -96,6 +98,7 @@ def self.attribute_map :'custom_event' => :'custom_event', :'segment' => :'segment', :'loyalty_tier' => :'loyalty_tier', + :'pending_points' => :'pending_points', :'source' => :'source', :'object' => :'object', :'automation_id' => :'automation_id', @@ -126,6 +129,7 @@ def self.openapi_types :'custom_event' => :'EarningRuleCustomEvent', :'segment' => :'EarningRuleSegment', :'loyalty_tier' => :'EarningRuleLoyaltyTier', + :'pending_points' => :'EarningRulePendingPoints', :'source' => :'EarningRuleSource', :'object' => :'String', :'automation_id' => :'String', @@ -150,6 +154,7 @@ def self.openapi_nullable :'custom_event', :'segment', :'loyalty_tier', + :'pending_points', :'source', :'object', :'automation_id', @@ -198,6 +203,10 @@ def initialize(attributes = {}) self.loyalty_tier = attributes[:'loyalty_tier'] end + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end + if attributes.key?(:'source') self.source = attributes[:'source'] end @@ -280,6 +289,7 @@ def ==(o) custom_event == o.custom_event && segment == o.segment && loyalty_tier == o.loyalty_tier && + pending_points == o.pending_points && source == o.source && object == o.object && automation_id == o.automation_id && @@ -303,7 +313,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, created_at, loyalty, event, custom_event, segment, loyalty_tier, source, object, automation_id, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, metadata, validation_rule_id, updated_at, active].hash + [id, created_at, loyalty, event, custom_event, segment, loyalty_tier, pending_points, source, object, automation_id, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, metadata, validation_rule_id, updated_at, active].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/earning_rule_pending_points.rb b/lib/VoucherifySdk/models/earning_rule_pending_points.rb new file mode 100644 index 00000000..97f73734 --- /dev/null +++ b/lib/VoucherifySdk/models/earning_rule_pending_points.rb @@ -0,0 +1,257 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Defines the configuration for pending points. Pending points can be used only with the `order.paid` event. + class EarningRulePendingPoints + # Defines the type of the period during which the points are in the pending state. Currently, only `DAY` value is accepted. + attr_accessor :period_type + + # Defines for how long the points are in the pending state. The minimum value is 1, maximum is 90. + attr_accessor :period_value + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'period_type' => :'period_type', + :'period_value' => :'period_value' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'period_type' => :'String', + :'period_value' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'period_type', + :'period_value' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'period_type') + self.period_type = attributes[:'period_type'] + else + self.period_type = 'DAY' + end + + if attributes.key?(:'period_value') + self.period_value = attributes[:'period_value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if !@period_value.nil? && @period_value > 90 + invalid_properties.push('invalid value for "period_value", must be smaller than or equal to 90.') + end + + if !@period_value.nil? && @period_value < 1 + invalid_properties.push('invalid value for "period_value", must be greater than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + period_type_validator = EnumAttributeValidator.new('String', ["DAY"]) + return false unless period_type_validator.valid?(@period_type) + return false if !@period_value.nil? && @period_value > 90 + return false if !@period_value.nil? && @period_value < 1 + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + period_type == o.period_type && + period_value == o.period_value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [period_type, period_value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/event_source.rb b/lib/VoucherifySdk/models/event_source.rb new file mode 100644 index 00000000..9d753a15 --- /dev/null +++ b/lib/VoucherifySdk/models/event_source.rb @@ -0,0 +1,254 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Contains the source of the object that initiated the event. + class EventSource + # Determines the channel that initiated the event. + attr_accessor :channel + + attr_accessor :user + + attr_accessor :api_key + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'channel' => :'channel', + :'user' => :'user', + :'api_key' => :'api_key' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'channel' => :'String', + :'user' => :'EventSourceUser', + :'api_key' => :'EventSourceApiKey' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'channel', + :'user', + :'api_key' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'channel') + self.channel = attributes[:'channel'] + end + + if attributes.key?(:'user') + self.user = attributes[:'user'] + end + + if attributes.key?(:'api_key') + self.api_key = attributes[:'api_key'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + channel_validator = EnumAttributeValidator.new('String', ["USER_PORTAL", "API", "CLIENT_API", "INTERNAL"]) + return false unless channel_validator.valid?(@channel) + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + channel == o.channel && + user == o.user && + api_key == o.api_key + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [channel, user, api_key].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/event_source_api_key.rb b/lib/VoucherifySdk/models/event_source_api_key.rb new file mode 100644 index 00000000..f635a3c6 --- /dev/null +++ b/lib/VoucherifySdk/models/event_source_api_key.rb @@ -0,0 +1,221 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Determines the API key used to initiate the event. + class EventSourceApiKey + # Channel name in the application keys. + attr_accessor :name + + # Contains the application ID from the Voucherify API key pair. + attr_accessor :app_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'app_id' => :'app_id' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'app_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'name', + :'app_id' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'app_id') + self.app_id = attributes[:'app_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + app_id == o.app_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, app_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/event_source_user.rb b/lib/VoucherifySdk/models/event_source_user.rb new file mode 100644 index 00000000..27cd62c5 --- /dev/null +++ b/lib/VoucherifySdk/models/event_source_user.rb @@ -0,0 +1,210 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Determines the Voucherify user who triggered the event. + class EventSourceUser + # Unique identifier of the user. + attr_accessor :id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'id' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/inapplicable_to.rb b/lib/VoucherifySdk/models/inapplicable_to.rb index d2a54cf6..474a4b0b 100644 --- a/lib/VoucherifySdk/models/inapplicable_to.rb +++ b/lib/VoucherifySdk/models/inapplicable_to.rb @@ -52,16 +52,19 @@ class InapplicableTo # Maximum discount amount per order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects: - `APPLY_TO_ITEMS` (each item subtotal is discounted equally) - `APPLY_TO_ITEMS_BY_QUANTITY` (each unit of matched products has the same discount value) attr_accessor :aggregated_amount_limit - # Determines the order in which the discount is applied to the products or SKUs sent in the `order` object in the request. The counting begins from `0`. + # Lists which order lines are (not) covered by the discount. The order in the array is determined by the sequence of applied discounts, while the numbers correspond to the order lines sent in the `order` object in the request. The first order line is assigned `0`, the second order line is assigned `1`, and so on. attr_accessor :order_item_indices + # Lists which units within order lines are covered by the discount. The order line items are listed according to sequence of applied discounts while the `index` corresponds to the order line sent in the `order` object in the request. + attr_accessor :order_item_units + # Determines the recurrence of the discount, e.g. `\"repeat\": 3` means that the discount is applied to every third item. attr_accessor :repeat # Determines how many items are skipped before the discount is applied. attr_accessor :skip_initially - # Determines to which kinds of objects the discount is applicable. `\"ITEM\"` includes products and SKUs. + # Determines to which kinds of objects the discount is applicable. `ITEM` includes products and SKUs. `UNIT` means particular units within an order line. attr_accessor :target class EnumAttributeValidator @@ -103,6 +106,7 @@ def self.attribute_map :'amount_limit' => :'amount_limit', :'aggregated_amount_limit' => :'aggregated_amount_limit', :'order_item_indices' => :'order_item_indices', + :'order_item_units' => :'order_item_units', :'repeat' => :'repeat', :'skip_initially' => :'skip_initially', :'target' => :'target' @@ -131,6 +135,7 @@ def self.openapi_types :'amount_limit' => :'Integer', :'aggregated_amount_limit' => :'Integer', :'order_item_indices' => :'Array', + :'order_item_units' => :'Array', :'repeat' => :'Integer', :'skip_initially' => :'Integer', :'target' => :'String' @@ -153,6 +158,7 @@ def self.openapi_nullable :'amount_limit', :'aggregated_amount_limit', :'order_item_indices', + :'order_item_units', :'repeat', :'skip_initially', :'target' @@ -227,6 +233,12 @@ def initialize(attributes = {}) end end + if attributes.key?(:'order_item_units') + if (value = attributes[:'order_item_units']).is_a?(Array) + self.order_item_units = value + end + end + if attributes.key?(:'repeat') self.repeat = attributes[:'repeat'] end @@ -281,6 +293,7 @@ def ==(o) amount_limit == o.amount_limit && aggregated_amount_limit == o.aggregated_amount_limit && order_item_indices == o.order_item_indices && + order_item_units == o.order_item_units && repeat == o.repeat && skip_initially == o.skip_initially && target == o.target @@ -295,7 +308,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [object, id, source_id, product_id, product_source_id, strict, price, price_formula, effect, quantity_limit, aggregated_quantity_limit, amount_limit, aggregated_amount_limit, order_item_indices, repeat, skip_initially, target].hash + [object, id, source_id, product_id, product_source_id, strict, price, price_formula, effect, quantity_limit, aggregated_quantity_limit, amount_limit, aggregated_amount_limit, order_item_indices, order_item_units, repeat, skip_initially, target].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/inapplicable_to_order_item_units_item.rb b/lib/VoucherifySdk/models/inapplicable_to_order_item_units_item.rb new file mode 100644 index 00000000..a6862832 --- /dev/null +++ b/lib/VoucherifySdk/models/inapplicable_to_order_item_units_item.rb @@ -0,0 +1,220 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + class InapplicableToOrderItemUnitsItem + # Number assigned to the order line item in accordance with the order sent in the request. + attr_accessor :index + + # Numbers of units in the order line covered by the discount; e.g. `2, 5, 8` for 10 units with the setting `\"skip_initially\": 1`, `\"repeat\": 3`. The counting of units starts from `1`. + attr_accessor :units + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'index' => :'index', + :'units' => :'units' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'index' => :'Integer', + :'units' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'index') + self.index = attributes[:'index'] + end + + if attributes.key?(:'units') + if (value = attributes[:'units']).is_a?(Array) + self.units = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + index == o.index && + units == o.units + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [index, units].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalties_create_campaign_request_body.rb b/lib/VoucherifySdk/models/loyalties_create_campaign_request_body.rb index 830c771e..cd3bc4b9 100644 --- a/lib/VoucherifySdk/models/loyalties_create_campaign_request_body.rb +++ b/lib/VoucherifySdk/models/loyalties_create_campaign_request_body.rb @@ -62,6 +62,8 @@ class LoyaltiesCreateCampaignRequestBody # The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format. attr_accessor :metadata + attr_accessor :access_settings + # Array containing the ID of the validation rule associated with the promotion tier. attr_accessor :validation_rules @@ -111,6 +113,7 @@ def self.attribute_map :'category_id' => :'category_id', :'category' => :'category', :'metadata' => :'metadata', + :'access_settings' => :'access_settings', :'validation_rules' => :'validation_rules', :'campaign_type' => :'campaign_type', :'voucher' => :'voucher' @@ -141,6 +144,7 @@ def self.openapi_types :'category_id' => :'String', :'category' => :'String', :'metadata' => :'Object', + :'access_settings' => :'AccessSettings', :'validation_rules' => :'Array', :'campaign_type' => :'String', :'voucher' => :'CampaignLoyaltyVoucher' @@ -242,6 +246,10 @@ def initialize(attributes = {}) self.metadata = attributes[:'metadata'] end + if attributes.key?(:'access_settings') + self.access_settings = attributes[:'access_settings'] + end + if attributes.key?(:'validation_rules') if (value = attributes[:'validation_rules']).is_a?(Array) self.validation_rules = value @@ -304,6 +312,7 @@ def ==(o) category_id == o.category_id && category == o.category && metadata == o.metadata && + access_settings == o.access_settings && validation_rules == o.validation_rules && campaign_type == o.campaign_type && voucher == o.voucher @@ -318,7 +327,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [name, description, type, join_once, auto_join, use_voucher_metadata_schema, vouchers_count, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, activity_duration_after_publishing, category_id, category, metadata, validation_rules, campaign_type, voucher].hash + [name, description, type, join_once, auto_join, use_voucher_metadata_schema, vouchers_count, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, activity_duration_after_publishing, category_id, category, metadata, access_settings, validation_rules, campaign_type, voucher].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body.rb index 4c2f71f8..f637db88 100644 --- a/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body.rb +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body.rb @@ -32,6 +32,8 @@ class LoyaltiesEarningRulesCreateResponseBody attr_accessor :loyalty_tier + attr_accessor :pending_points + attr_accessor :source # The type of the object represented by JSON. Default is earning_rule. @@ -97,6 +99,7 @@ def self.attribute_map :'custom_event' => :'custom_event', :'segment' => :'segment', :'loyalty_tier' => :'loyalty_tier', + :'pending_points' => :'pending_points', :'source' => :'source', :'object' => :'object', :'automation_id' => :'automation_id', @@ -127,6 +130,7 @@ def self.openapi_types :'custom_event' => :'LoyaltiesEarningRulesCreateResponseBodyCustomEvent', :'segment' => :'LoyaltiesEarningRulesCreateResponseBodySegment', :'loyalty_tier' => :'LoyaltiesEarningRulesCreateResponseBodyLoyaltyTier', + :'pending_points' => :'LoyaltiesEarningRulesCreateResponseBodyPendingPoints', :'source' => :'LoyaltiesEarningRulesCreateResponseBodySource', :'object' => :'String', :'automation_id' => :'String', @@ -151,6 +155,7 @@ def self.openapi_nullable :'custom_event', :'segment', :'loyalty_tier', + :'pending_points', :'source', :'object', :'automation_id', @@ -199,6 +204,10 @@ def initialize(attributes = {}) self.loyalty_tier = attributes[:'loyalty_tier'] end + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end + if attributes.key?(:'source') self.source = attributes[:'source'] end @@ -281,6 +290,7 @@ def ==(o) custom_event == o.custom_event && segment == o.segment && loyalty_tier == o.loyalty_tier && + pending_points == o.pending_points && source == o.source && object == o.object && automation_id == o.automation_id && @@ -304,7 +314,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, created_at, loyalty, event, custom_event, segment, loyalty_tier, source, object, automation_id, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, metadata, validation_rule_id, updated_at, active].hash + [id, created_at, loyalty, event, custom_event, segment, loyalty_tier, pending_points, source, object, automation_id, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, metadata, validation_rule_id, updated_at, active].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_pending_points.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_pending_points.rb new file mode 100644 index 00000000..ed19306a --- /dev/null +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_pending_points.rb @@ -0,0 +1,257 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Defines the configuration for pending points. Pending points can be used only with the `order.paid` event. + class LoyaltiesEarningRulesCreateResponseBodyPendingPoints + # Defines the type of the period during which the points are in the pending state. Currently, only `DAY` value is accepted. + attr_accessor :period_type + + # Defines for how long the points are in the pending state. The minimum value is 1, maximum is 90. + attr_accessor :period_value + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'period_type' => :'period_type', + :'period_value' => :'period_value' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'period_type' => :'String', + :'period_value' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'period_type', + :'period_value' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'period_type') + self.period_type = attributes[:'period_type'] + else + self.period_type = 'DAY' + end + + if attributes.key?(:'period_value') + self.period_value = attributes[:'period_value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if !@period_value.nil? && @period_value > 90 + invalid_properties.push('invalid value for "period_value", must be smaller than or equal to 90.') + end + + if !@period_value.nil? && @period_value < 1 + invalid_properties.push('invalid value for "period_value", must be greater than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + period_type_validator = EnumAttributeValidator.new('String', ["DAY"]) + return false unless period_type_validator.valid?(@period_type) + return false if !@period_value.nil? && @period_value > 90 + return false if !@period_value.nil? && @period_value < 1 + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + period_type == o.period_type && + period_value == o.period_value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [period_type, period_value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body.rb index 9f1f507c..8c86b2d0 100644 --- a/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body.rb +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body.rb @@ -32,6 +32,8 @@ class LoyaltiesEarningRulesDisableResponseBody attr_accessor :loyalty_tier + attr_accessor :pending_points + attr_accessor :source # The type of the object represented by JSON. Default is earning_rule. @@ -94,6 +96,7 @@ def self.attribute_map :'custom_event' => :'custom_event', :'segment' => :'segment', :'loyalty_tier' => :'loyalty_tier', + :'pending_points' => :'pending_points', :'source' => :'source', :'object' => :'object', :'automation_id' => :'automation_id', @@ -123,6 +126,7 @@ def self.openapi_types :'custom_event' => :'LoyaltiesEarningRulesDisableResponseBodyCustomEvent', :'segment' => :'LoyaltiesEarningRulesDisableResponseBodySegment', :'loyalty_tier' => :'LoyaltiesEarningRulesDisableResponseBodyLoyaltyTier', + :'pending_points' => :'LoyaltiesEarningRulesDisableResponseBodyPendingPoints', :'source' => :'LoyaltiesEarningRulesDisableResponseBodySource', :'object' => :'String', :'automation_id' => :'String', @@ -146,6 +150,7 @@ def self.openapi_nullable :'custom_event', :'segment', :'loyalty_tier', + :'pending_points', :'source', :'object', :'automation_id', @@ -193,6 +198,10 @@ def initialize(attributes = {}) self.loyalty_tier = attributes[:'loyalty_tier'] end + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end + if attributes.key?(:'source') self.source = attributes[:'source'] end @@ -273,6 +282,7 @@ def ==(o) custom_event == o.custom_event && segment == o.segment && loyalty_tier == o.loyalty_tier && + pending_points == o.pending_points && source == o.source && object == o.object && automation_id == o.automation_id && @@ -295,7 +305,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, created_at, loyalty, event, custom_event, segment, loyalty_tier, source, object, automation_id, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, metadata, updated_at, active].hash + [id, created_at, loyalty, event, custom_event, segment, loyalty_tier, pending_points, source, object, automation_id, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, metadata, updated_at, active].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_pending_points.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_pending_points.rb new file mode 100644 index 00000000..17fd0fb7 --- /dev/null +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_pending_points.rb @@ -0,0 +1,257 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Defines the configuration for pending points. Pending points can be used only with the `order.paid` event. + class LoyaltiesEarningRulesDisableResponseBodyPendingPoints + # Defines the type of the period during which the points are in the pending state. Currently, only `DAY` value is accepted. + attr_accessor :period_type + + # Defines for how long the points are in the pending state. The minimum value is 1, maximum is 90. + attr_accessor :period_value + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'period_type' => :'period_type', + :'period_value' => :'period_value' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'period_type' => :'String', + :'period_value' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'period_type', + :'period_value' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'period_type') + self.period_type = attributes[:'period_type'] + else + self.period_type = 'DAY' + end + + if attributes.key?(:'period_value') + self.period_value = attributes[:'period_value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if !@period_value.nil? && @period_value > 90 + invalid_properties.push('invalid value for "period_value", must be smaller than or equal to 90.') + end + + if !@period_value.nil? && @period_value < 1 + invalid_properties.push('invalid value for "period_value", must be greater than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + period_type_validator = EnumAttributeValidator.new('String', ["DAY"]) + return false unless period_type_validator.valid?(@period_type) + return false if !@period_value.nil? && @period_value > 90 + return false if !@period_value.nil? && @period_value < 1 + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + period_type == o.period_type && + period_value == o.period_value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [period_type, period_value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body.rb index bd3c9c71..d31ecfbe 100644 --- a/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body.rb +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body.rb @@ -32,6 +32,8 @@ class LoyaltiesEarningRulesEnableResponseBody attr_accessor :loyalty_tier + attr_accessor :pending_points + attr_accessor :source # The type of the object represented by JSON. Default is earning_rule. @@ -94,6 +96,7 @@ def self.attribute_map :'custom_event' => :'custom_event', :'segment' => :'segment', :'loyalty_tier' => :'loyalty_tier', + :'pending_points' => :'pending_points', :'source' => :'source', :'object' => :'object', :'automation_id' => :'automation_id', @@ -123,6 +126,7 @@ def self.openapi_types :'custom_event' => :'LoyaltiesEarningRulesEnableResponseBodyCustomEvent', :'segment' => :'LoyaltiesEarningRulesEnableResponseBodySegment', :'loyalty_tier' => :'LoyaltiesEarningRulesEnableResponseBodyLoyaltyTier', + :'pending_points' => :'LoyaltiesEarningRulesEnableResponseBodyPendingPoints', :'source' => :'LoyaltiesEarningRulesEnableResponseBodySource', :'object' => :'String', :'automation_id' => :'String', @@ -146,6 +150,7 @@ def self.openapi_nullable :'custom_event', :'segment', :'loyalty_tier', + :'pending_points', :'source', :'object', :'automation_id', @@ -193,6 +198,10 @@ def initialize(attributes = {}) self.loyalty_tier = attributes[:'loyalty_tier'] end + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end + if attributes.key?(:'source') self.source = attributes[:'source'] end @@ -273,6 +282,7 @@ def ==(o) custom_event == o.custom_event && segment == o.segment && loyalty_tier == o.loyalty_tier && + pending_points == o.pending_points && source == o.source && object == o.object && automation_id == o.automation_id && @@ -295,7 +305,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, created_at, loyalty, event, custom_event, segment, loyalty_tier, source, object, automation_id, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, metadata, updated_at, active].hash + [id, created_at, loyalty, event, custom_event, segment, loyalty_tier, pending_points, source, object, automation_id, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, metadata, updated_at, active].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_pending_points.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_pending_points.rb new file mode 100644 index 00000000..4e501571 --- /dev/null +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_pending_points.rb @@ -0,0 +1,257 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Defines the configuration for pending points. Pending points can be used only with the `order.paid` event. + class LoyaltiesEarningRulesEnableResponseBodyPendingPoints + # Defines the type of the period during which the points are in the pending state. Currently, only `DAY` value is accepted. + attr_accessor :period_type + + # Defines for how long the points are in the pending state. The minimum value is 1, maximum is 90. + attr_accessor :period_value + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'period_type' => :'period_type', + :'period_value' => :'period_value' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'period_type' => :'String', + :'period_value' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'period_type', + :'period_value' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'period_type') + self.period_type = attributes[:'period_type'] + else + self.period_type = 'DAY' + end + + if attributes.key?(:'period_value') + self.period_value = attributes[:'period_value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if !@period_value.nil? && @period_value > 90 + invalid_properties.push('invalid value for "period_value", must be smaller than or equal to 90.') + end + + if !@period_value.nil? && @period_value < 1 + invalid_properties.push('invalid value for "period_value", must be greater than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + period_type_validator = EnumAttributeValidator.new('String', ["DAY"]) + return false unless period_type_validator.valid?(@period_type) + return false if !@period_value.nil? && @period_value > 90 + return false if !@period_value.nil? && @period_value < 1 + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + period_type == o.period_type && + period_value == o.period_value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [period_type, period_value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body.rb index def97907..71583848 100644 --- a/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body.rb +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body.rb @@ -32,6 +32,8 @@ class LoyaltiesEarningRulesGetResponseBody attr_accessor :loyalty_tier + attr_accessor :pending_points + attr_accessor :source # The type of the object represented by JSON. Default is earning_rule. @@ -97,6 +99,7 @@ def self.attribute_map :'custom_event' => :'custom_event', :'segment' => :'segment', :'loyalty_tier' => :'loyalty_tier', + :'pending_points' => :'pending_points', :'source' => :'source', :'object' => :'object', :'automation_id' => :'automation_id', @@ -127,6 +130,7 @@ def self.openapi_types :'custom_event' => :'LoyaltiesEarningRulesGetResponseBodyCustomEvent', :'segment' => :'LoyaltiesEarningRulesGetResponseBodySegment', :'loyalty_tier' => :'LoyaltiesEarningRulesGetResponseBodyLoyaltyTier', + :'pending_points' => :'LoyaltiesEarningRulesGetResponseBodyPendingPoints', :'source' => :'LoyaltiesEarningRulesGetResponseBodySource', :'object' => :'String', :'automation_id' => :'String', @@ -151,6 +155,7 @@ def self.openapi_nullable :'custom_event', :'segment', :'loyalty_tier', + :'pending_points', :'source', :'object', :'automation_id', @@ -199,6 +204,10 @@ def initialize(attributes = {}) self.loyalty_tier = attributes[:'loyalty_tier'] end + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end + if attributes.key?(:'source') self.source = attributes[:'source'] end @@ -281,6 +290,7 @@ def ==(o) custom_event == o.custom_event && segment == o.segment && loyalty_tier == o.loyalty_tier && + pending_points == o.pending_points && source == o.source && object == o.object && automation_id == o.automation_id && @@ -304,7 +314,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, created_at, loyalty, event, custom_event, segment, loyalty_tier, source, object, automation_id, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, metadata, validation_rule_id, updated_at, active].hash + [id, created_at, loyalty, event, custom_event, segment, loyalty_tier, pending_points, source, object, automation_id, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, metadata, validation_rule_id, updated_at, active].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_pending_points.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_pending_points.rb new file mode 100644 index 00000000..bbc21412 --- /dev/null +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_pending_points.rb @@ -0,0 +1,257 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Defines the configuration for pending points. Pending points can be used only with the `order.paid` event. + class LoyaltiesEarningRulesGetResponseBodyPendingPoints + # Defines the type of the period during which the points are in the pending state. Currently, only `DAY` value is accepted. + attr_accessor :period_type + + # Defines for how long the points are in the pending state. The minimum value is 1, maximum is 90. + attr_accessor :period_value + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'period_type' => :'period_type', + :'period_value' => :'period_value' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'period_type' => :'String', + :'period_value' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'period_type', + :'period_value' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'period_type') + self.period_type = attributes[:'period_type'] + else + self.period_type = 'DAY' + end + + if attributes.key?(:'period_value') + self.period_value = attributes[:'period_value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if !@period_value.nil? && @period_value > 90 + invalid_properties.push('invalid value for "period_value", must be smaller than or equal to 90.') + end + + if !@period_value.nil? && @period_value < 1 + invalid_properties.push('invalid value for "period_value", must be greater than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + period_type_validator = EnumAttributeValidator.new('String', ["DAY"]) + return false unless period_type_validator.valid?(@period_type) + return false if !@period_value.nil? && @period_value > 90 + return false if !@period_value.nil? && @period_value < 1 + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + period_type == o.period_type && + period_value == o.period_value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [period_type, period_value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body.rb index 2f12a28b..6967b921 100644 --- a/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body.rb +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body.rb @@ -32,6 +32,8 @@ class LoyaltiesEarningRulesUpdateResponseBody attr_accessor :loyalty_tier + attr_accessor :pending_points + attr_accessor :source # The type of the object represented by JSON. Default is earning_rule. @@ -97,6 +99,7 @@ def self.attribute_map :'custom_event' => :'custom_event', :'segment' => :'segment', :'loyalty_tier' => :'loyalty_tier', + :'pending_points' => :'pending_points', :'source' => :'source', :'object' => :'object', :'automation_id' => :'automation_id', @@ -127,6 +130,7 @@ def self.openapi_types :'custom_event' => :'LoyaltiesEarningRulesUpdateResponseBodyCustomEvent', :'segment' => :'LoyaltiesEarningRulesUpdateResponseBodySegment', :'loyalty_tier' => :'LoyaltiesEarningRulesUpdateResponseBodyLoyaltyTier', + :'pending_points' => :'LoyaltiesEarningRulesUpdateResponseBodyPendingPoints', :'source' => :'LoyaltiesEarningRulesUpdateResponseBodySource', :'object' => :'String', :'automation_id' => :'String', @@ -151,6 +155,7 @@ def self.openapi_nullable :'custom_event', :'segment', :'loyalty_tier', + :'pending_points', :'source', :'object', :'automation_id', @@ -199,6 +204,10 @@ def initialize(attributes = {}) self.loyalty_tier = attributes[:'loyalty_tier'] end + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end + if attributes.key?(:'source') self.source = attributes[:'source'] end @@ -281,6 +290,7 @@ def ==(o) custom_event == o.custom_event && segment == o.segment && loyalty_tier == o.loyalty_tier && + pending_points == o.pending_points && source == o.source && object == o.object && automation_id == o.automation_id && @@ -304,7 +314,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, created_at, loyalty, event, custom_event, segment, loyalty_tier, source, object, automation_id, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, metadata, validation_rule_id, updated_at, active].hash + [id, created_at, loyalty, event, custom_event, segment, loyalty_tier, pending_points, source, object, automation_id, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, metadata, validation_rule_id, updated_at, active].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_pending_points.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_pending_points.rb new file mode 100644 index 00000000..ecfe7cfb --- /dev/null +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_pending_points.rb @@ -0,0 +1,257 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Defines the configuration for pending points. Pending points can be used only with the `order.paid` event. + class LoyaltiesEarningRulesUpdateResponseBodyPendingPoints + # Defines the type of the period during which the points are in the pending state. Currently, only `DAY` value is accepted. + attr_accessor :period_type + + # Defines for how long the points are in the pending state. The minimum value is 1, maximum is 90. + attr_accessor :period_value + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'period_type' => :'period_type', + :'period_value' => :'period_value' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'period_type' => :'String', + :'period_value' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'period_type', + :'period_value' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'period_type') + self.period_type = attributes[:'period_type'] + else + self.period_type = 'DAY' + end + + if attributes.key?(:'period_value') + self.period_value = attributes[:'period_value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if !@period_value.nil? && @period_value > 90 + invalid_properties.push('invalid value for "period_value", must be smaller than or equal to 90.') + end + + if !@period_value.nil? && @period_value < 1 + invalid_properties.push('invalid value for "period_value", must be greater than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + period_type_validator = EnumAttributeValidator.new('String', ["DAY"]) + return false unless period_type_validator.valid?(@period_type) + return false if !@period_value.nil? && @period_value > 90 + return false if !@period_value.nil? && @period_value < 1 + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + period_type == o.period_type && + period_value == o.period_value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [period_type, period_value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalties_members_create_response_body_loyalty_card.rb b/lib/VoucherifySdk/models/loyalties_members_create_response_body_loyalty_card.rb index 4dcfa7a4..c6a9ef25 100644 --- a/lib/VoucherifySdk/models/loyalties_members_create_response_body_loyalty_card.rb +++ b/lib/VoucherifySdk/models/loyalties_members_create_response_body_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`. class LoyaltiesMembersCreateResponseBodyLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -28,13 +28,17 @@ class LoyaltiesMembersCreateResponseBodyLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -49,7 +53,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -59,7 +64,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -86,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -111,7 +121,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -123,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalties_members_get_response_body_loyalty_card.rb b/lib/VoucherifySdk/models/loyalties_members_get_response_body_loyalty_card.rb index 3b156cfb..1fe16da4 100644 --- a/lib/VoucherifySdk/models/loyalties_members_get_response_body_loyalty_card.rb +++ b/lib/VoucherifySdk/models/loyalties_members_get_response_body_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`. class LoyaltiesMembersGetResponseBodyLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -28,13 +28,17 @@ class LoyaltiesMembersGetResponseBodyLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -49,7 +53,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -59,7 +64,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -86,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -111,7 +121,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -123,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalties_members_pending_points_activate_response_body.rb b/lib/VoucherifySdk/models/loyalties_members_pending_points_activate_response_body.rb new file mode 100644 index 00000000..ee8788d7 --- /dev/null +++ b/lib/VoucherifySdk/models/loyalties_members_pending_points_activate_response_body.rb @@ -0,0 +1,309 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Response body schema for **POST** `/loyalties/members/{memberId}/pending-points/{pendingPointsId}/activate`. + class LoyaltiesMembersPendingPointsActivateResponseBody + # The number of pending points added to the loyalty card. + attr_accessor :points + + # Total number of points incurred over the lifespan of the loyalty card, minus the expired points. + attr_accessor :total + + # The current number of loyalty points after the pendint points have been added. + attr_accessor :balance + + # The type of the voucher being modified. For pending points, it is always `loyalty_card`. + attr_accessor :type + + # The type of the object represented by JSON. Default is `balance`. + attr_accessor :object + + attr_accessor :related_object + + # The type of the operation being performed. + attr_accessor :operation_type + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'points' => :'points', + :'total' => :'total', + :'balance' => :'balance', + :'type' => :'type', + :'object' => :'object', + :'related_object' => :'related_object', + :'operation_type' => :'operation_type' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'points' => :'Integer', + :'total' => :'Integer', + :'balance' => :'Integer', + :'type' => :'String', + :'object' => :'String', + :'related_object' => :'LoyaltiesMembersPendingPointsActivateResponseBodyRelatedObject', + :'operation_type' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'points', + :'total', + :'balance', + :'type', + :'object', + :'related_object', + :'operation_type' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'points') + self.points = attributes[:'points'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + end + + if attributes.key?(:'balance') + self.balance = attributes[:'balance'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = 'loyalty_card' + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + else + self.object = 'balance' + end + + if attributes.key?(:'related_object') + self.related_object = attributes[:'related_object'] + end + + if attributes.key?(:'operation_type') + self.operation_type = attributes[:'operation_type'] + else + self.operation_type = 'MANUAL' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + type_validator = EnumAttributeValidator.new('String', ["loyalty_card"]) + return false unless type_validator.valid?(@type) + object_validator = EnumAttributeValidator.new('String', ["balance"]) + return false unless object_validator.valid?(@object) + operation_type_validator = EnumAttributeValidator.new('String', ["MANUAL"]) + return false unless operation_type_validator.valid?(@operation_type) + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + points == o.points && + total == o.total && + balance == o.balance && + type == o.type && + object == o.object && + related_object == o.related_object && + operation_type == o.operation_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [points, total, balance, type, object, related_object, operation_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalties_members_pending_points_activate_response_body_related_object.rb b/lib/VoucherifySdk/models/loyalties_members_pending_points_activate_response_body_related_object.rb new file mode 100644 index 00000000..1c39cb56 --- /dev/null +++ b/lib/VoucherifySdk/models/loyalties_members_pending_points_activate_response_body_related_object.rb @@ -0,0 +1,247 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Defines the resource that is being modified. + class LoyaltiesMembersPendingPointsActivateResponseBodyRelatedObject + # The object being modified, i.e. `voucher`. + attr_accessor :type + + # Identifies the voucher that is being modified. This is the unique identifer that was assigned by Voucherify. + attr_accessor :id + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'id' => :'id' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'type', + :'id' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = 'voucher' + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + type_validator = EnumAttributeValidator.new('String', ["voucher"]) + return false unless type_validator.valid?(@type) + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + id == o.id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalties_members_pending_points_list_response_body.rb b/lib/VoucherifySdk/models/loyalties_members_pending_points_list_response_body.rb new file mode 100644 index 00000000..5772e79b --- /dev/null +++ b/lib/VoucherifySdk/models/loyalties_members_pending_points_list_response_body.rb @@ -0,0 +1,286 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Response body schema for **GET** `/loyalties/{campaignId}/members/{memberId}/pending-points` and **GET** `/loyalties/members/{memberId}/pending-points`. + class LoyaltiesMembersPendingPointsListResponseBody + # The type of the object represented by JSON. + attr_accessor :object + + # Identifies the name of the attribute that contains the array of pending point objects. + attr_accessor :data_ref + + # A dictionary that contains an array of pending point entries. Each entry in the array is a separate pending point object. + attr_accessor :data + + # As query results are always limited (by the limit parameter), the `has_more` flag indicates if there are more records for given filter parameters. This lets you know if you can run another request to get more records returned in the results. + attr_accessor :has_more + + # Returns an ID that can be used to return another page of results. Use the pending point entry ID in the `starting_after_id` query parameter to display another page of the results starting after the entry with that ID. + attr_accessor :more_starting_after + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'object' => :'object', + :'data_ref' => :'data_ref', + :'data' => :'data', + :'has_more' => :'has_more', + :'more_starting_after' => :'more_starting_after' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'object' => :'String', + :'data_ref' => :'String', + :'data' => :'Array', + :'has_more' => :'Boolean', + :'more_starting_after' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'object', + :'data_ref', + :'data', + :'has_more', + :'more_starting_after' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'object') + self.object = attributes[:'object'] + else + self.object = 'list' + end + + if attributes.key?(:'data_ref') + self.data_ref = attributes[:'data_ref'] + else + self.data_ref = 'data' + end + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'has_more') + self.has_more = attributes[:'has_more'] + end + + if attributes.key?(:'more_starting_after') + self.more_starting_after = attributes[:'more_starting_after'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + object_validator = EnumAttributeValidator.new('String', ["list"]) + return false unless object_validator.valid?(@object) + data_ref_validator = EnumAttributeValidator.new('String', ["data"]) + return false unless data_ref_validator.valid?(@data_ref) + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + object == o.object && + data_ref == o.data_ref && + data == o.data && + has_more == o.has_more && + more_starting_after == o.more_starting_after + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [object, data_ref, data, has_more, more_starting_after].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalties_members_redemption_redeem_response_body_voucher_loyalty_card.rb b/lib/VoucherifySdk/models/loyalties_members_redemption_redeem_response_body_voucher_loyalty_card.rb index ea9d1128..90049693 100644 --- a/lib/VoucherifySdk/models/loyalties_members_redemption_redeem_response_body_voucher_loyalty_card.rb +++ b/lib/VoucherifySdk/models/loyalties_members_redemption_redeem_response_body_voucher_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`. class LoyaltiesMembersRedemptionRedeemResponseBodyVoucherLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -28,13 +28,17 @@ class LoyaltiesMembersRedemptionRedeemResponseBodyVoucherLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -49,7 +53,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -59,7 +64,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -86,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -111,7 +121,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -123,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalties_members_transfers_create_response_body_loyalty_card.rb b/lib/VoucherifySdk/models/loyalties_members_transfers_create_response_body_loyalty_card.rb index 699552a0..aa1698e0 100644 --- a/lib/VoucherifySdk/models/loyalties_members_transfers_create_response_body_loyalty_card.rb +++ b/lib/VoucherifySdk/models/loyalties_members_transfers_create_response_body_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Object representing loyalty card parameters. Child attributes are present only if type is LOYALTY_CARD. class LoyaltiesMembersTransfersCreateResponseBodyLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -28,13 +28,17 @@ class LoyaltiesMembersTransfersCreateResponseBodyLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -49,7 +53,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'String', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -59,7 +64,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -86,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -111,7 +121,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -123,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalties_pending_points_list_response_body.rb b/lib/VoucherifySdk/models/loyalties_pending_points_list_response_body.rb new file mode 100644 index 00000000..a7545e75 --- /dev/null +++ b/lib/VoucherifySdk/models/loyalties_pending_points_list_response_body.rb @@ -0,0 +1,286 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Response body schema for **GET** `/loyalties/{campaignId}/pending-points`. + class LoyaltiesPendingPointsListResponseBody + # The type of the object represented by JSON. + attr_accessor :object + + # Identifies the name of the attribute that contains the array of pending point objects. + attr_accessor :data_ref + + # A dictionary that contains an array of pending point entries. Each entry in the array is a separate pending point object. + attr_accessor :data + + # As query results are always limited (by the limit parameter), the `has_more` flag indicates if there are more records for given filter parameters. This lets you know if you can run another request to get more records returned in the results. + attr_accessor :has_more + + # Returns an ID that can be used to return another page of results. Use the pending point entry ID in the `starting_after_id` query parameter to display another page of the results starting after the entry with that ID. + attr_accessor :more_starting_after + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'object' => :'object', + :'data_ref' => :'data_ref', + :'data' => :'data', + :'has_more' => :'has_more', + :'more_starting_after' => :'more_starting_after' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'object' => :'String', + :'data_ref' => :'String', + :'data' => :'Array', + :'has_more' => :'Boolean', + :'more_starting_after' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'object', + :'data_ref', + :'data', + :'has_more', + :'more_starting_after' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'object') + self.object = attributes[:'object'] + else + self.object = 'list' + end + + if attributes.key?(:'data_ref') + self.data_ref = attributes[:'data_ref'] + else + self.data_ref = 'data' + end + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'has_more') + self.has_more = attributes[:'has_more'] + end + + if attributes.key?(:'more_starting_after') + self.more_starting_after = attributes[:'more_starting_after'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + object_validator = EnumAttributeValidator.new('String', ["list"]) + return false unless object_validator.valid?(@object) + data_ref_validator = EnumAttributeValidator.new('String', ["data"]) + return false unless data_ref_validator.valid?(@data_ref) + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + object == o.object && + data_ref == o.data_ref && + data == o.data && + has_more == o.has_more && + more_starting_after == o.more_starting_after + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [object, data_ref, data, has_more, more_starting_after].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalties_update_campaign_request_body.rb b/lib/VoucherifySdk/models/loyalties_update_campaign_request_body.rb index a8663ad4..56db0406 100644 --- a/lib/VoucherifySdk/models/loyalties_update_campaign_request_body.rb +++ b/lib/VoucherifySdk/models/loyalties_update_campaign_request_body.rb @@ -44,6 +44,8 @@ class LoyaltiesUpdateCampaignRequestBody # Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`. attr_accessor :category_id + attr_accessor :access_settings + # Defines the amount of time the vouchers will be active after publishing. The value is shown in the ISO 8601 format. For example, a voucher with the value of P24D will be valid for a duration of 24 days. attr_accessor :activity_duration_after_publishing @@ -95,6 +97,7 @@ def self.attribute_map :'metadata' => :'metadata', :'unset_metadata_fields' => :'unset_metadata_fields', :'category_id' => :'category_id', + :'access_settings' => :'access_settings', :'activity_duration_after_publishing' => :'activity_duration_after_publishing', :'join_once' => :'join_once', :'auto_join' => :'auto_join', @@ -122,6 +125,7 @@ def self.openapi_types :'metadata' => :'Object', :'unset_metadata_fields' => :'Array', :'category_id' => :'String', + :'access_settings' => :'AccessSettings', :'activity_duration_after_publishing' => :'String', :'join_once' => :'Boolean', :'auto_join' => :'Boolean', @@ -201,6 +205,10 @@ def initialize(attributes = {}) self.category_id = attributes[:'category_id'] end + if attributes.key?(:'access_settings') + self.access_settings = attributes[:'access_settings'] + end + if attributes.key?(:'activity_duration_after_publishing') self.activity_duration_after_publishing = attributes[:'activity_duration_after_publishing'] end @@ -258,6 +266,7 @@ def ==(o) metadata == o.metadata && unset_metadata_fields == o.unset_metadata_fields && category_id == o.category_id && + access_settings == o.access_settings && activity_duration_after_publishing == o.activity_duration_after_publishing && join_once == o.join_once && auto_join == o.auto_join && @@ -275,7 +284,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, description, category, metadata, unset_metadata_fields, category_id, activity_duration_after_publishing, join_once, auto_join, type, loyalty_tiers_expiration, options].hash + [start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, description, category, metadata, unset_metadata_fields, category_id, access_settings, activity_duration_after_publishing, join_once, auto_join, type, loyalty_tiers_expiration, options].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalty_card_transaction_details.rb b/lib/VoucherifySdk/models/loyalty_card_transaction_details.rb index 2791fb3b..7e17e2b4 100644 --- a/lib/VoucherifySdk/models/loyalty_card_transaction_details.rb +++ b/lib/VoucherifySdk/models/loyalty_card_transaction_details.rb @@ -36,6 +36,10 @@ class LoyaltyCardTransactionDetails attr_accessor :event_schema + attr_accessor :holder_loyalty_tier + + attr_accessor :pending_points + attr_accessor :reward attr_accessor :source_voucher @@ -55,6 +59,8 @@ def self.attribute_map :'rollback' => :'rollback', :'custom_event' => :'custom_event', :'event_schema' => :'event_schema', + :'holder_loyalty_tier' => :'holder_loyalty_tier', + :'pending_points' => :'pending_points', :'reward' => :'reward', :'source_voucher' => :'source_voucher', :'destination_voucher' => :'destination_voucher' @@ -79,6 +85,8 @@ def self.openapi_types :'rollback' => :'LoyaltyCardTransactionDetailsRollback', :'custom_event' => :'LoyaltyCardTransactionDetailsCustomEvent', :'event_schema' => :'LoyaltyCardTransactionDetailsEventSchema', + :'holder_loyalty_tier' => :'LoyaltyCardTransactionDetailsHolderLoyaltyTier', + :'pending_points' => :'LoyaltyPendingPoints', :'reward' => :'LoyaltyCardTransactionDetailsReward', :'source_voucher' => :'SimpleVoucher', :'destination_voucher' => :'SimpleVoucher' @@ -97,6 +105,7 @@ def self.openapi_nullable :'rollback', :'custom_event', :'event_schema', + :'holder_loyalty_tier', :'reward', ]) end @@ -149,6 +158,14 @@ def initialize(attributes = {}) self.event_schema = attributes[:'event_schema'] end + if attributes.key?(:'holder_loyalty_tier') + self.holder_loyalty_tier = attributes[:'holder_loyalty_tier'] + end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end + if attributes.key?(:'reward') self.reward = attributes[:'reward'] end @@ -192,6 +209,8 @@ def ==(o) rollback == o.rollback && custom_event == o.custom_event && event_schema == o.event_schema && + holder_loyalty_tier == o.holder_loyalty_tier && + pending_points == o.pending_points && reward == o.reward && source_voucher == o.source_voucher && destination_voucher == o.destination_voucher @@ -206,7 +225,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [balance, order, event, earning_rule, segment, loyalty_tier, redemption, rollback, custom_event, event_schema, reward, source_voucher, destination_voucher].hash + [balance, order, event, earning_rule, segment, loyalty_tier, redemption, rollback, custom_event, event_schema, holder_loyalty_tier, pending_points, reward, source_voucher, destination_voucher].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalty_card_transaction_details_earning_rule.rb b/lib/VoucherifySdk/models/loyalty_card_transaction_details_earning_rule.rb index c6fb4dcf..cc1f1e84 100644 --- a/lib/VoucherifySdk/models/loyalty_card_transaction_details_earning_rule.rb +++ b/lib/VoucherifySdk/models/loyalty_card_transaction_details_earning_rule.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Contains information about the earning rule. class LoyaltyCardTransactionDetailsEarningRule - # Unique earning rule ID. + # Unique identifier of an earning rule, assigned by Voucherify. attr_accessor :id attr_accessor :source diff --git a/lib/VoucherifySdk/models/loyalty_card_transaction_details_holder_loyalty_tier.rb b/lib/VoucherifySdk/models/loyalty_card_transaction_details_holder_loyalty_tier.rb new file mode 100644 index 00000000..df55c99b --- /dev/null +++ b/lib/VoucherifySdk/models/loyalty_card_transaction_details_holder_loyalty_tier.rb @@ -0,0 +1,221 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # 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. + class LoyaltyCardTransactionDetailsHolderLoyaltyTier + # Unique identifier of the loyalty tier, assigned by Voucherify. + attr_accessor :id + + # User-defined name of the loyalty tier. + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'id', + :'name' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalty_card_transaction_details_loyalty_tier.rb b/lib/VoucherifySdk/models/loyalty_card_transaction_details_loyalty_tier.rb index dc2872cf..985776b0 100644 --- a/lib/VoucherifySdk/models/loyalty_card_transaction_details_loyalty_tier.rb +++ b/lib/VoucherifySdk/models/loyalty_card_transaction_details_loyalty_tier.rb @@ -14,10 +14,12 @@ require 'time' module VoucherifySdk - # Contains information about the loyalty tier. + # Contains information about the loyalty tier that is mapped for the earning rule and used in the transaction. class LoyaltyCardTransactionDetailsLoyaltyTier + # Unique identifier of the loyalty tier, assigned by Voucherify. attr_accessor :id + # User-defined name of the loyalty tier. attr_accessor :name # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/VoucherifySdk/models/loyalty_card_transactions_type.rb b/lib/VoucherifySdk/models/loyalty_card_transactions_type.rb index 80ce043e..7c961d86 100644 --- a/lib/VoucherifySdk/models/loyalty_card_transactions_type.rb +++ b/lib/VoucherifySdk/models/loyalty_card_transactions_type.rb @@ -15,6 +15,7 @@ module VoucherifySdk class LoyaltyCardTransactionsType + PENDING_ACTIVATION = "POINTS_PENDING_ACTIVATION".freeze ACCRUAL = "POINTS_ACCRUAL".freeze REDEMPTION = "POINTS_REDEMPTION".freeze REFUND = "POINTS_REFUND".freeze @@ -25,7 +26,7 @@ class LoyaltyCardTransactionsType TRANSFER_OUT = "POINTS_TRANSFER_OUT".freeze def self.all_vars - @all_vars ||= [ACCRUAL, REDEMPTION, REFUND, ADDITION, REMOVAL, EXPIRATION, TRANSFER_IN, TRANSFER_OUT].freeze + @all_vars ||= [PENDING_ACTIVATION, ACCRUAL, REDEMPTION, REFUND, ADDITION, REMOVAL, EXPIRATION, TRANSFER_IN, TRANSFER_OUT].freeze end # Builds the enum from string diff --git a/lib/VoucherifySdk/models/loyalty_member_loyalty_card.rb b/lib/VoucherifySdk/models/loyalty_member_loyalty_card.rb index 16b0414c..419022c4 100644 --- a/lib/VoucherifySdk/models/loyalty_member_loyalty_card.rb +++ b/lib/VoucherifySdk/models/loyalty_member_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`. class LoyaltyMemberLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -28,13 +28,17 @@ class LoyaltyMemberLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -49,7 +53,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -59,7 +64,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -86,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -111,7 +121,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -123,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalty_pending_points.rb b/lib/VoucherifySdk/models/loyalty_pending_points.rb new file mode 100644 index 00000000..7ef9a63b --- /dev/null +++ b/lib/VoucherifySdk/models/loyalty_pending_points.rb @@ -0,0 +1,314 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Contains details about the pending point entry. + class LoyaltyPendingPoints + # Unique identifier of the pending point entry, assigned by Voucherify. + attr_accessor :id + + # Unique identifier of the loyalty card, assigned by Voucherify. + attr_accessor :voucher_id + + # Unique campaign identifier, assigned by Voucherify. + attr_accessor :campaign_id + + # Unique customer identifier, assigned by Voucherify. + attr_accessor :customer_id + + # Unique order identifier, assigned by Voucherify. + attr_accessor :order_id + + # Number of points in the pending state. + attr_accessor :points + + # Date when the pending points are activated and added to the customer's loyalty card. + attr_accessor :activates_at + + attr_accessor :details + + # Timestamp representing the date and time when the pending point entry was created. The value is shown in the ISO 8601 format. + attr_accessor :created_at + + # Timestamp representing the date and time when the pending point entry was modified. The value is shown in the ISO 8601 format. + attr_accessor :updated_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'voucher_id' => :'voucher_id', + :'campaign_id' => :'campaign_id', + :'customer_id' => :'customer_id', + :'order_id' => :'order_id', + :'points' => :'points', + :'activates_at' => :'activates_at', + :'details' => :'details', + :'created_at' => :'created_at', + :'updated_at' => :'updated_at' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'voucher_id' => :'String', + :'campaign_id' => :'String', + :'customer_id' => :'String', + :'order_id' => :'String', + :'points' => :'Integer', + :'activates_at' => :'Date', + :'details' => :'LoyaltyPendingPointsDetails', + :'created_at' => :'Time', + :'updated_at' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'id', + :'voucher_id', + :'campaign_id', + :'customer_id', + :'order_id', + :'points', + :'activates_at', + :'created_at', + :'updated_at' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'voucher_id') + self.voucher_id = attributes[:'voucher_id'] + end + + if attributes.key?(:'campaign_id') + self.campaign_id = attributes[:'campaign_id'] + end + + if attributes.key?(:'customer_id') + self.customer_id = attributes[:'customer_id'] + end + + if attributes.key?(:'order_id') + self.order_id = attributes[:'order_id'] + end + + if attributes.key?(:'points') + self.points = attributes[:'points'] + end + + if attributes.key?(:'activates_at') + self.activates_at = attributes[:'activates_at'] + end + + if attributes.key?(:'details') + self.details = attributes[:'details'] + else + self.details = nil + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @details.nil? + invalid_properties.push('invalid value for "details", details cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @details.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + voucher_id == o.voucher_id && + campaign_id == o.campaign_id && + customer_id == o.customer_id && + order_id == o.order_id && + points == o.points && + activates_at == o.activates_at && + details == o.details && + created_at == o.created_at && + updated_at == o.updated_at + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, voucher_id, campaign_id, customer_id, order_id, points, activates_at, details, created_at, updated_at].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalty_pending_points_details.rb b/lib/VoucherifySdk/models/loyalty_pending_points_details.rb new file mode 100644 index 00000000..1f9ac32e --- /dev/null +++ b/lib/VoucherifySdk/models/loyalty_pending_points_details.rb @@ -0,0 +1,249 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Details about how the pending points were earned. + class LoyaltyPendingPointsDetails + attr_accessor :loyalty_tier + + attr_accessor :holder_loyalty_tier + + attr_accessor :event + + attr_accessor :earning_rule + + attr_accessor :order + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'loyalty_tier' => :'loyalty_tier', + :'holder_loyalty_tier' => :'holder_loyalty_tier', + :'event' => :'event', + :'earning_rule' => :'earning_rule', + :'order' => :'order' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'loyalty_tier' => :'LoyaltyPendingPointsDetailsLoyaltyTier', + :'holder_loyalty_tier' => :'LoyaltyPendingPointsDetailsHolderLoyaltyTier', + :'event' => :'LoyaltyPendingPointsDetailsEvent', + :'earning_rule' => :'LoyaltyPendingPointsDetailsEarningRule', + :'order' => :'LoyaltyPendingPointsDetailsOrder' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'loyalty_tier', + :'holder_loyalty_tier', + :'event', + :'earning_rule', + :'order' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'loyalty_tier') + self.loyalty_tier = attributes[:'loyalty_tier'] + end + + if attributes.key?(:'holder_loyalty_tier') + self.holder_loyalty_tier = attributes[:'holder_loyalty_tier'] + end + + if attributes.key?(:'event') + self.event = attributes[:'event'] + end + + if attributes.key?(:'earning_rule') + self.earning_rule = attributes[:'earning_rule'] + end + + if attributes.key?(:'order') + self.order = attributes[:'order'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + loyalty_tier == o.loyalty_tier && + holder_loyalty_tier == o.holder_loyalty_tier && + event == o.event && + earning_rule == o.earning_rule && + order == o.order + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [loyalty_tier, holder_loyalty_tier, event, earning_rule, order].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalty_pending_points_details_earning_rule.rb b/lib/VoucherifySdk/models/loyalty_pending_points_details_earning_rule.rb new file mode 100644 index 00000000..be508555 --- /dev/null +++ b/lib/VoucherifySdk/models/loyalty_pending_points_details_earning_rule.rb @@ -0,0 +1,220 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Contains information about the earning rule. + class LoyaltyPendingPointsDetailsEarningRule + # Unique identifier of an earning rule, assigned by Voucherify. + attr_accessor :id + + attr_accessor :source + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'source' => :'source' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'source' => :'LoyaltyPendingPointsDetailsEarningRuleSource' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'id', + :'source' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + source == o.source + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, source].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalty_pending_points_details_earning_rule_source.rb b/lib/VoucherifySdk/models/loyalty_pending_points_details_earning_rule_source.rb new file mode 100644 index 00000000..2ea8313f --- /dev/null +++ b/lib/VoucherifySdk/models/loyalty_pending_points_details_earning_rule_source.rb @@ -0,0 +1,210 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Contains the custom earning rule name. + class LoyaltyPendingPointsDetailsEarningRuleSource + # Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard. + attr_accessor :banner + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'banner' => :'banner' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'banner' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'banner' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'banner') + self.banner = attributes[:'banner'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + banner == o.banner + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [banner].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalty_pending_points_details_event.rb b/lib/VoucherifySdk/models/loyalty_pending_points_details_event.rb new file mode 100644 index 00000000..5a708fe4 --- /dev/null +++ b/lib/VoucherifySdk/models/loyalty_pending_points_details_event.rb @@ -0,0 +1,302 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Details about the event that created pending points. + class LoyaltyPendingPointsDetailsEvent + # Unique event identifier, assigned by Voucherify. + attr_accessor :id + + # Type of the event that triggered the creation of pending points. + attr_accessor :type + + # Unique identifier of the request that triggered the event, assigned by Voucherify. + attr_accessor :group_id + + # Unique identifier of the entity that triggered the event, assigned by Voucherify. For pending points, it is the `customer_id` of the customer who paid for the order. + attr_accessor :entity_id + + # Timestamp representing the date and time when the event occurred. The value is shown in the ISO 8601 format. + attr_accessor :created_at + + # Type of the event. + attr_accessor :category + + attr_accessor :event_source + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type', + :'group_id' => :'group_id', + :'entity_id' => :'entity_id', + :'created_at' => :'created_at', + :'category' => :'category', + :'event_source' => :'event_source' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'type' => :'String', + :'group_id' => :'String', + :'entity_id' => :'String', + :'created_at' => :'Time', + :'category' => :'String', + :'event_source' => :'EventSource' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'id', + :'type', + :'group_id', + :'entity_id', + :'created_at', + :'category', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = 'customer.order.paid' + end + + if attributes.key?(:'group_id') + self.group_id = attributes[:'group_id'] + end + + if attributes.key?(:'entity_id') + self.entity_id = attributes[:'entity_id'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'event_source') + self.event_source = attributes[:'event_source'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + type_validator = EnumAttributeValidator.new('String', ["customer.order.paid"]) + return false unless type_validator.valid?(@type) + category_validator = EnumAttributeValidator.new('String', ["ACTION", "EFFECT"]) + return false unless category_validator.valid?(@category) + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + group_id == o.group_id && + entity_id == o.entity_id && + created_at == o.created_at && + category == o.category && + event_source == o.event_source + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, type, group_id, entity_id, created_at, category, event_source].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalty_pending_points_details_holder_loyalty_tier.rb b/lib/VoucherifySdk/models/loyalty_pending_points_details_holder_loyalty_tier.rb new file mode 100644 index 00000000..99adb572 --- /dev/null +++ b/lib/VoucherifySdk/models/loyalty_pending_points_details_holder_loyalty_tier.rb @@ -0,0 +1,221 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # 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 at the moment pending points were created. + class LoyaltyPendingPointsDetailsHolderLoyaltyTier + # Unique identifier of the loyalty tier, assigned by Voucherify. + attr_accessor :id + + # User-defined name of the loyalty tier. + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'id', + :'name' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalty_pending_points_details_loyalty_tier.rb b/lib/VoucherifySdk/models/loyalty_pending_points_details_loyalty_tier.rb new file mode 100644 index 00000000..0de9b706 --- /dev/null +++ b/lib/VoucherifySdk/models/loyalty_pending_points_details_loyalty_tier.rb @@ -0,0 +1,221 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # The loyalty tier that is mapped for the earning rule and used in the pending point transaction. + class LoyaltyPendingPointsDetailsLoyaltyTier + # Unique identifier of the loyalty tier, assigned by Voucherify. + attr_accessor :id + + # User-defined name of the loyalty tier. + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'id', + :'name' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalty_pending_points_details_order.rb b/lib/VoucherifySdk/models/loyalty_pending_points_details_order.rb new file mode 100644 index 00000000..c554f1d0 --- /dev/null +++ b/lib/VoucherifySdk/models/loyalty_pending_points_details_order.rb @@ -0,0 +1,221 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # Details about the order that caused adding pending points. + class LoyaltyPendingPointsDetailsOrder + # Unique order identifier, assigned by Voucherify. + attr_accessor :id + + # User-defined order identifier. + attr_accessor :source_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'source_id' => :'source_id' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'source_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'id', + :'source_id' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'source_id') + self.source_id = attributes[:'source_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + source_id == o.source_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, source_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/loyalty_tier_expiration.rb b/lib/VoucherifySdk/models/loyalty_tier_expiration.rb index 8441af32..72b8e6c0 100644 --- a/lib/VoucherifySdk/models/loyalty_tier_expiration.rb +++ b/lib/VoucherifySdk/models/loyalty_tier_expiration.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Defines loyalty tier expiration date. class LoyaltyTierExpiration - # Unique customer ID of the customer making the purchase. + # Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify. attr_accessor :customer_id # Unique campaign ID, assigned by Voucherify. diff --git a/lib/VoucherifySdk/models/order.rb b/lib/VoucherifySdk/models/order.rb index 62f85a1b..3f44b336 100644 --- a/lib/VoucherifySdk/models/order.rb +++ b/lib/VoucherifySdk/models/order.rb @@ -31,10 +31,10 @@ class Order # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. attr_accessor :initial_amount - # Sum of all order-level discounts applied to the order. + # Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :discount_amount - # Array of items applied to the order. It can include up 500 items. + # Array of items applied to the order. It can include up to 500 items. attr_accessor :items # A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. diff --git a/lib/VoucherifySdk/models/order_calculated.rb b/lib/VoucherifySdk/models/order_calculated.rb index ac4bc0f9..dcf52d1f 100644 --- a/lib/VoucherifySdk/models/order_calculated.rb +++ b/lib/VoucherifySdk/models/order_calculated.rb @@ -25,36 +25,33 @@ class OrderCalculated # The order status. attr_accessor :status - # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. + # This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :amount - # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. + # This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :initial_amount - # Sum of all order-level discounts applied to the order. + # Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :discount_amount - # Sum of all product-specific discounts applied to the order. + # Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :items_discount_amount - # Sum of all order-level AND all product-specific discounts applied to the order. + # Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :total_discount_amount - # Order amount after undoing all the discounts through the rollback redemption. + # Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :total_amount - # This field shows the order-level discount applied. + # This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :applied_discount_amount - # Sum of all product-specific discounts applied in a particular request. `sum(items, i => i.applied_discount_amount)` + # Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `sum(items, i => i.applied_discount_amount)` attr_accessor :items_applied_discount_amount - # Sum of all order-level AND all product-specific discounts applied in a particular request. `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` + # Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` attr_accessor :total_applied_discount_amount - # Array of items applied to the order. It can include up 500 items. - attr_accessor :items - # A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. attr_accessor :metadata @@ -67,7 +64,7 @@ class OrderCalculated # Timestamp representing the date and time when the order was last updated in ISO 8601 format. attr_accessor :updated_at - # Unique customer ID of the customer making the purchase. + # Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify. attr_accessor :customer_id # Unique referrer ID. @@ -79,6 +76,9 @@ class OrderCalculated attr_accessor :redemptions + # Array of items applied to the order. It can include up 500 items. + attr_accessor :items + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -116,7 +116,6 @@ def self.attribute_map :'applied_discount_amount' => :'applied_discount_amount', :'items_applied_discount_amount' => :'items_applied_discount_amount', :'total_applied_discount_amount' => :'total_applied_discount_amount', - :'items' => :'items', :'metadata' => :'metadata', :'object' => :'object', :'created_at' => :'created_at', @@ -125,7 +124,8 @@ def self.attribute_map :'referrer_id' => :'referrer_id', :'customer' => :'customer', :'referrer' => :'referrer', - :'redemptions' => :'redemptions' + :'redemptions' => :'redemptions', + :'items' => :'items' } end @@ -149,7 +149,6 @@ def self.openapi_types :'applied_discount_amount' => :'Integer', :'items_applied_discount_amount' => :'Integer', :'total_applied_discount_amount' => :'Integer', - :'items' => :'Array', :'metadata' => :'Object', :'object' => :'String', :'created_at' => :'Time', @@ -158,7 +157,8 @@ def self.openapi_types :'referrer_id' => :'String', :'customer' => :'CustomerId', :'referrer' => :'ReferrerId', - :'redemptions' => :'Hash' + :'redemptions' => :'Hash', + :'items' => :'Array' } end @@ -177,14 +177,14 @@ def self.openapi_nullable :'applied_discount_amount', :'items_applied_discount_amount', :'total_applied_discount_amount', - :'items', :'metadata', :'object', :'created_at', :'updated_at', :'customer_id', :'referrer_id', - :'redemptions' + :'redemptions', + :'items' ]) end @@ -244,12 +244,6 @@ def initialize(attributes = {}) self.total_applied_discount_amount = attributes[:'total_applied_discount_amount'] end - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - if attributes.key?(:'metadata') self.metadata = attributes[:'metadata'] end @@ -289,6 +283,12 @@ def initialize(attributes = {}) self.redemptions = value end end + + if attributes.key?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -327,7 +327,6 @@ def ==(o) applied_discount_amount == o.applied_discount_amount && items_applied_discount_amount == o.items_applied_discount_amount && total_applied_discount_amount == o.total_applied_discount_amount && - items == o.items && metadata == o.metadata && object == o.object && created_at == o.created_at && @@ -336,7 +335,8 @@ def ==(o) referrer_id == o.referrer_id && customer == o.customer && referrer == o.referrer && - redemptions == o.redemptions + redemptions == o.redemptions && + items == o.items end # @see the `==` method @@ -348,7 +348,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, source_id, status, amount, initial_amount, discount_amount, items_discount_amount, total_discount_amount, total_amount, applied_discount_amount, items_applied_discount_amount, total_applied_discount_amount, items, metadata, object, created_at, updated_at, customer_id, referrer_id, customer, referrer, redemptions].hash + [id, source_id, status, amount, initial_amount, discount_amount, items_discount_amount, total_discount_amount, total_amount, applied_discount_amount, items_applied_discount_amount, total_applied_discount_amount, metadata, object, created_at, updated_at, customer_id, referrer_id, customer, referrer, redemptions, items].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/order_calculated_item.rb b/lib/VoucherifySdk/models/order_calculated_item.rb index 0cafa29b..a485c3b4 100644 --- a/lib/VoucherifySdk/models/order_calculated_item.rb +++ b/lib/VoucherifySdk/models/order_calculated_item.rb @@ -76,6 +76,9 @@ class OrderCalculatedItem # A set of custom key/value pairs that you can attach to an item object. It can be useful for storing additional information about the item in a structured format. It can be used to define business validation rules or discount formulas. attr_accessor :metadata + # Array containing details about the items that are replaced and the items that are replacements for discounts with the `REPLACE_ITEMS` effect. + attr_accessor :application_details + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -121,7 +124,8 @@ def self.attribute_map :'product' => :'product', :'sku' => :'sku', :'object' => :'object', - :'metadata' => :'metadata' + :'metadata' => :'metadata', + :'application_details' => :'application_details' } end @@ -153,7 +157,8 @@ def self.openapi_types :'product' => :'OrderCalculatedItemProduct', :'sku' => :'OrderCalculatedItemSku', :'object' => :'String', - :'metadata' => :'Object' + :'metadata' => :'Object', + :'application_details' => :'Array' } end @@ -180,7 +185,7 @@ def self.openapi_nullable :'product', :'sku', :'object', - :'metadata' + :'metadata', ]) end @@ -277,6 +282,12 @@ def initialize(attributes = {}) if attributes.key?(:'metadata') self.metadata = attributes[:'metadata'] end + + if attributes.key?(:'application_details') + if (value = attributes[:'application_details']).is_a?(Array) + self.application_details = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -323,7 +334,8 @@ def ==(o) product == o.product && sku == o.sku && object == o.object && - metadata == o.metadata + metadata == o.metadata && + application_details == o.application_details end # @see the `==` method @@ -335,7 +347,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, sku_id, product_id, related_object, source_id, quantity, discount_quantity, initial_quantity, amount, discount_amount, applied_discount_amount, applied_discount_quantity, applied_quantity, applied_quantity_amount, initial_amount, price, subtotal_amount, product, sku, object, metadata].hash + [id, sku_id, product_id, related_object, source_id, quantity, discount_quantity, initial_quantity, amount, discount_amount, applied_discount_amount, applied_discount_quantity, applied_quantity, applied_quantity_amount, initial_amount, price, subtotal_amount, product, sku, object, metadata, application_details].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/order_redemptions_entry.rb b/lib/VoucherifySdk/models/order_redemptions_entry.rb index 52c75b20..e7eaee53 100644 --- a/lib/VoucherifySdk/models/order_redemptions_entry.rb +++ b/lib/VoucherifySdk/models/order_redemptions_entry.rb @@ -21,7 +21,7 @@ class OrderRedemptionsEntry # Unique ID of the redemption rollback. attr_accessor :rollback_id - # Timestamp representing the date and tiem when the redemption rollback was created. The value is shown in the ISO 8601 format. + # Timestamp representing the date and time when the redemption rollback was created. The value is shown in the ISO 8601 format. attr_accessor :rollback_date # The source of the incentive. diff --git a/lib/VoucherifySdk/models/orders_create_request_body.rb b/lib/VoucherifySdk/models/orders_create_request_body.rb index 8a6c3121..550546b8 100644 --- a/lib/VoucherifySdk/models/orders_create_request_body.rb +++ b/lib/VoucherifySdk/models/orders_create_request_body.rb @@ -31,10 +31,10 @@ class OrdersCreateRequestBody # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. attr_accessor :initial_amount - # Sum of all order-level discounts applied to the order. + # Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :discount_amount - # Array of items applied to the order. It can include up 500 items. + # Array of items applied to the order. It can include up to 500 items. attr_accessor :items # A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. diff --git a/lib/VoucherifySdk/models/orders_create_response_body.rb b/lib/VoucherifySdk/models/orders_create_response_body.rb index 6b0215fd..1c047e73 100644 --- a/lib/VoucherifySdk/models/orders_create_response_body.rb +++ b/lib/VoucherifySdk/models/orders_create_response_body.rb @@ -25,36 +25,33 @@ class OrdersCreateResponseBody # The order status. attr_accessor :status - # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. + # This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :amount - # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. + # This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :initial_amount - # Sum of all order-level discounts applied to the order. + # Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :discount_amount - # Sum of all product-specific discounts applied to the order. + # Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :items_discount_amount - # Sum of all order-level AND all product-specific discounts applied to the order. + # Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :total_discount_amount - # Order amount after undoing all the discounts through the rollback redemption. + # Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :total_amount - # This field shows the order-level discount applied. + # This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :applied_discount_amount - # Sum of all product-specific discounts applied in a particular request. `sum(items, i => i.applied_discount_amount)` + # Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `sum(items, i => i.applied_discount_amount)` attr_accessor :items_applied_discount_amount - # Sum of all order-level AND all product-specific discounts applied in a particular request. `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` + # Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` attr_accessor :total_applied_discount_amount - # Array of items applied to the order. It can include up 500 items. - attr_accessor :items - # A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. attr_accessor :metadata @@ -67,7 +64,7 @@ class OrdersCreateResponseBody # Timestamp representing the date and time when the order was last updated in ISO 8601 format. attr_accessor :updated_at - # Unique customer ID of the customer making the purchase. + # Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify. attr_accessor :customer_id # Unique referrer ID. @@ -79,6 +76,9 @@ class OrdersCreateResponseBody attr_accessor :redemptions + # Array of items applied to the order. It can include up to 500 items. + attr_accessor :items + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -116,7 +116,6 @@ def self.attribute_map :'applied_discount_amount' => :'applied_discount_amount', :'items_applied_discount_amount' => :'items_applied_discount_amount', :'total_applied_discount_amount' => :'total_applied_discount_amount', - :'items' => :'items', :'metadata' => :'metadata', :'object' => :'object', :'created_at' => :'created_at', @@ -125,7 +124,8 @@ def self.attribute_map :'referrer_id' => :'referrer_id', :'customer' => :'customer', :'referrer' => :'referrer', - :'redemptions' => :'redemptions' + :'redemptions' => :'redemptions', + :'items' => :'items' } end @@ -149,7 +149,6 @@ def self.openapi_types :'applied_discount_amount' => :'Integer', :'items_applied_discount_amount' => :'Integer', :'total_applied_discount_amount' => :'Integer', - :'items' => :'Array', :'metadata' => :'Object', :'object' => :'String', :'created_at' => :'Time', @@ -158,7 +157,8 @@ def self.openapi_types :'referrer_id' => :'String', :'customer' => :'CustomerId', :'referrer' => :'ReferrerId', - :'redemptions' => :'Hash' + :'redemptions' => :'Hash', + :'items' => :'Array' } end @@ -177,14 +177,14 @@ def self.openapi_nullable :'applied_discount_amount', :'items_applied_discount_amount', :'total_applied_discount_amount', - :'items', :'metadata', :'object', :'created_at', :'updated_at', :'customer_id', :'referrer_id', - :'redemptions' + :'redemptions', + :'items' ]) end @@ -244,12 +244,6 @@ def initialize(attributes = {}) self.total_applied_discount_amount = attributes[:'total_applied_discount_amount'] end - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - if attributes.key?(:'metadata') self.metadata = attributes[:'metadata'] end @@ -289,6 +283,12 @@ def initialize(attributes = {}) self.redemptions = value end end + + if attributes.key?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -327,7 +327,6 @@ def ==(o) applied_discount_amount == o.applied_discount_amount && items_applied_discount_amount == o.items_applied_discount_amount && total_applied_discount_amount == o.total_applied_discount_amount && - items == o.items && metadata == o.metadata && object == o.object && created_at == o.created_at && @@ -336,7 +335,8 @@ def ==(o) referrer_id == o.referrer_id && customer == o.customer && referrer == o.referrer && - redemptions == o.redemptions + redemptions == o.redemptions && + items == o.items end # @see the `==` method @@ -348,7 +348,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, source_id, status, amount, initial_amount, discount_amount, items_discount_amount, total_discount_amount, total_amount, applied_discount_amount, items_applied_discount_amount, total_applied_discount_amount, items, metadata, object, created_at, updated_at, customer_id, referrer_id, customer, referrer, redemptions].hash + [id, source_id, status, amount, initial_amount, discount_amount, items_discount_amount, total_discount_amount, total_amount, applied_discount_amount, items_applied_discount_amount, total_applied_discount_amount, metadata, object, created_at, updated_at, customer_id, referrer_id, customer, referrer, redemptions, items].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/orders_get_response_body.rb b/lib/VoucherifySdk/models/orders_get_response_body.rb index e02a1190..27ca659d 100644 --- a/lib/VoucherifySdk/models/orders_get_response_body.rb +++ b/lib/VoucherifySdk/models/orders_get_response_body.rb @@ -25,36 +25,33 @@ class OrdersGetResponseBody # The order status. attr_accessor :status - # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. + # This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :amount - # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. + # This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :initial_amount - # Sum of all order-level discounts applied to the order. + # Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :discount_amount - # Sum of all product-specific discounts applied to the order. + # Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :items_discount_amount - # Sum of all order-level AND all product-specific discounts applied to the order. + # Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :total_discount_amount - # Order amount after undoing all the discounts through the rollback redemption. + # Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :total_amount - # This field shows the order-level discount applied. + # This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :applied_discount_amount - # Sum of all product-specific discounts applied in a particular request. `sum(items, i => i.applied_discount_amount)` + # Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `sum(items, i => i.applied_discount_amount)` attr_accessor :items_applied_discount_amount - # Sum of all order-level AND all product-specific discounts applied in a particular request. `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` + # Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` attr_accessor :total_applied_discount_amount - # Array of items applied to the order. It can include up 500 items. - attr_accessor :items - # A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. attr_accessor :metadata @@ -67,7 +64,7 @@ class OrdersGetResponseBody # Timestamp representing the date and time when the order was last updated in ISO 8601 format. attr_accessor :updated_at - # Unique customer ID of the customer making the purchase. + # Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify. attr_accessor :customer_id # Unique referrer ID. @@ -79,6 +76,9 @@ class OrdersGetResponseBody attr_accessor :redemptions + # Array of items applied to the order. It can include up to 500 items. + attr_accessor :items + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -116,7 +116,6 @@ def self.attribute_map :'applied_discount_amount' => :'applied_discount_amount', :'items_applied_discount_amount' => :'items_applied_discount_amount', :'total_applied_discount_amount' => :'total_applied_discount_amount', - :'items' => :'items', :'metadata' => :'metadata', :'object' => :'object', :'created_at' => :'created_at', @@ -125,7 +124,8 @@ def self.attribute_map :'referrer_id' => :'referrer_id', :'customer' => :'customer', :'referrer' => :'referrer', - :'redemptions' => :'redemptions' + :'redemptions' => :'redemptions', + :'items' => :'items' } end @@ -149,7 +149,6 @@ def self.openapi_types :'applied_discount_amount' => :'Integer', :'items_applied_discount_amount' => :'Integer', :'total_applied_discount_amount' => :'Integer', - :'items' => :'Array', :'metadata' => :'Object', :'object' => :'String', :'created_at' => :'Time', @@ -158,7 +157,8 @@ def self.openapi_types :'referrer_id' => :'String', :'customer' => :'CustomerId', :'referrer' => :'ReferrerId', - :'redemptions' => :'Hash' + :'redemptions' => :'Hash', + :'items' => :'Array' } end @@ -177,14 +177,14 @@ def self.openapi_nullable :'applied_discount_amount', :'items_applied_discount_amount', :'total_applied_discount_amount', - :'items', :'metadata', :'object', :'created_at', :'updated_at', :'customer_id', :'referrer_id', - :'redemptions' + :'redemptions', + :'items' ]) end @@ -244,12 +244,6 @@ def initialize(attributes = {}) self.total_applied_discount_amount = attributes[:'total_applied_discount_amount'] end - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - if attributes.key?(:'metadata') self.metadata = attributes[:'metadata'] end @@ -289,6 +283,12 @@ def initialize(attributes = {}) self.redemptions = value end end + + if attributes.key?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -327,7 +327,6 @@ def ==(o) applied_discount_amount == o.applied_discount_amount && items_applied_discount_amount == o.items_applied_discount_amount && total_applied_discount_amount == o.total_applied_discount_amount && - items == o.items && metadata == o.metadata && object == o.object && created_at == o.created_at && @@ -336,7 +335,8 @@ def ==(o) referrer_id == o.referrer_id && customer == o.customer && referrer == o.referrer && - redemptions == o.redemptions + redemptions == o.redemptions && + items == o.items end # @see the `==` method @@ -348,7 +348,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, source_id, status, amount, initial_amount, discount_amount, items_discount_amount, total_discount_amount, total_amount, applied_discount_amount, items_applied_discount_amount, total_applied_discount_amount, items, metadata, object, created_at, updated_at, customer_id, referrer_id, customer, referrer, redemptions].hash + [id, source_id, status, amount, initial_amount, discount_amount, items_discount_amount, total_discount_amount, total_amount, applied_discount_amount, items_applied_discount_amount, total_applied_discount_amount, metadata, object, created_at, updated_at, customer_id, referrer_id, customer, referrer, redemptions, items].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/orders_import_create_request_body_item.rb b/lib/VoucherifySdk/models/orders_import_create_request_body_item.rb index d701c7b1..a2a3b6b5 100644 --- a/lib/VoucherifySdk/models/orders_import_create_request_body_item.rb +++ b/lib/VoucherifySdk/models/orders_import_create_request_body_item.rb @@ -30,10 +30,10 @@ class OrdersImportCreateRequestBodyItem # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. attr_accessor :initial_amount - # Sum of all order-level discounts applied to the order. + # Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :discount_amount - # Array of items applied to the order. It can include up 500 items. + # Array of items applied to the order. It can include up to 500 items. attr_accessor :items # A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. diff --git a/lib/VoucherifySdk/models/orders_update_request_body.rb b/lib/VoucherifySdk/models/orders_update_request_body.rb index 3b518004..8a1a6ecf 100644 --- a/lib/VoucherifySdk/models/orders_update_request_body.rb +++ b/lib/VoucherifySdk/models/orders_update_request_body.rb @@ -28,10 +28,10 @@ class OrdersUpdateRequestBody # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. attr_accessor :initial_amount - # Sum of all order-level discounts applied to the order. + # Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :discount_amount - # Array of items applied to the order. It can include up 500 items. + # Array of items applied to the order. It can include up to 500 items. attr_accessor :items # A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. diff --git a/lib/VoucherifySdk/models/orders_update_response_body.rb b/lib/VoucherifySdk/models/orders_update_response_body.rb index da0f95dd..9a2dc210 100644 --- a/lib/VoucherifySdk/models/orders_update_response_body.rb +++ b/lib/VoucherifySdk/models/orders_update_response_body.rb @@ -25,36 +25,33 @@ class OrdersUpdateResponseBody # The order status. attr_accessor :status - # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. + # This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :amount - # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. + # This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :initial_amount - # Sum of all order-level discounts applied to the order. + # Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :discount_amount - # Sum of all product-specific discounts applied to the order. + # Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :items_discount_amount - # Sum of all order-level AND all product-specific discounts applied to the order. + # Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :total_discount_amount - # Order amount after undoing all the discounts through the rollback redemption. + # Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :total_amount - # This field shows the order-level discount applied. + # This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :applied_discount_amount - # Sum of all product-specific discounts applied in a particular request. `sum(items, i => i.applied_discount_amount)` + # Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `sum(items, i => i.applied_discount_amount)` attr_accessor :items_applied_discount_amount - # Sum of all order-level AND all product-specific discounts applied in a particular request. `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` + # Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` attr_accessor :total_applied_discount_amount - # Array of items applied to the order. It can include up 500 items. - attr_accessor :items - # A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. attr_accessor :metadata @@ -67,7 +64,7 @@ class OrdersUpdateResponseBody # Timestamp representing the date and time when the order was last updated in ISO 8601 format. attr_accessor :updated_at - # Unique customer ID of the customer making the purchase. + # Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify. attr_accessor :customer_id # Unique referrer ID. @@ -79,6 +76,9 @@ class OrdersUpdateResponseBody attr_accessor :redemptions + # Array of items applied to the order. It can include up to 500 items. + attr_accessor :items + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -116,7 +116,6 @@ def self.attribute_map :'applied_discount_amount' => :'applied_discount_amount', :'items_applied_discount_amount' => :'items_applied_discount_amount', :'total_applied_discount_amount' => :'total_applied_discount_amount', - :'items' => :'items', :'metadata' => :'metadata', :'object' => :'object', :'created_at' => :'created_at', @@ -125,7 +124,8 @@ def self.attribute_map :'referrer_id' => :'referrer_id', :'customer' => :'customer', :'referrer' => :'referrer', - :'redemptions' => :'redemptions' + :'redemptions' => :'redemptions', + :'items' => :'items' } end @@ -149,7 +149,6 @@ def self.openapi_types :'applied_discount_amount' => :'Integer', :'items_applied_discount_amount' => :'Integer', :'total_applied_discount_amount' => :'Integer', - :'items' => :'Array', :'metadata' => :'Object', :'object' => :'String', :'created_at' => :'Time', @@ -158,7 +157,8 @@ def self.openapi_types :'referrer_id' => :'String', :'customer' => :'CustomerId', :'referrer' => :'ReferrerId', - :'redemptions' => :'Hash' + :'redemptions' => :'Hash', + :'items' => :'Array' } end @@ -177,14 +177,14 @@ def self.openapi_nullable :'applied_discount_amount', :'items_applied_discount_amount', :'total_applied_discount_amount', - :'items', :'metadata', :'object', :'created_at', :'updated_at', :'customer_id', :'referrer_id', - :'redemptions' + :'redemptions', + :'items' ]) end @@ -244,12 +244,6 @@ def initialize(attributes = {}) self.total_applied_discount_amount = attributes[:'total_applied_discount_amount'] end - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - if attributes.key?(:'metadata') self.metadata = attributes[:'metadata'] end @@ -289,6 +283,12 @@ def initialize(attributes = {}) self.redemptions = value end end + + if attributes.key?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -327,7 +327,6 @@ def ==(o) applied_discount_amount == o.applied_discount_amount && items_applied_discount_amount == o.items_applied_discount_amount && total_applied_discount_amount == o.total_applied_discount_amount && - items == o.items && metadata == o.metadata && object == o.object && created_at == o.created_at && @@ -336,7 +335,8 @@ def ==(o) referrer_id == o.referrer_id && customer == o.customer && referrer == o.referrer && - redemptions == o.redemptions + redemptions == o.redemptions && + items == o.items end # @see the `==` method @@ -348,7 +348,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, source_id, status, amount, initial_amount, discount_amount, items_discount_amount, total_discount_amount, total_amount, applied_discount_amount, items_applied_discount_amount, total_applied_discount_amount, items, metadata, object, created_at, updated_at, customer_id, referrer_id, customer, referrer, redemptions].hash + [id, source_id, status, amount, initial_amount, discount_amount, items_discount_amount, total_discount_amount, total_amount, applied_discount_amount, items_applied_discount_amount, total_applied_discount_amount, metadata, object, created_at, updated_at, customer_id, referrer_id, customer, referrer, redemptions, items].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/parameter_order_list_pending_points.rb b/lib/VoucherifySdk/models/parameter_order_list_pending_points.rb new file mode 100644 index 00000000..75c5c0ae --- /dev/null +++ b/lib/VoucherifySdk/models/parameter_order_list_pending_points.rb @@ -0,0 +1,40 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + class ParameterOrderListPendingPoints + ID = "id".freeze + ID2 = "-id".freeze + + def self.all_vars + @all_vars ||= [ID, ID2].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if ParameterOrderListPendingPoints.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #ParameterOrderListPendingPoints" + end + end +end diff --git a/lib/VoucherifySdk/models/qualifications_option.rb b/lib/VoucherifySdk/models/qualifications_option.rb index 13445e08..bbf0ad42 100644 --- a/lib/VoucherifySdk/models/qualifications_option.rb +++ b/lib/VoucherifySdk/models/qualifications_option.rb @@ -126,8 +126,8 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@limit.nil? && @limit > 100 - invalid_properties.push('invalid value for "limit", must be smaller than or equal to 100.') + if !@limit.nil? && @limit > 50 + invalid_properties.push('invalid value for "limit", must be smaller than or equal to 50.') end invalid_properties @@ -137,7 +137,7 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@limit.nil? && @limit > 100 + return false if !@limit.nil? && @limit > 50 sorting_rule_validator = EnumAttributeValidator.new('String', ["BEST_DEAL", "LEAST_DEAL", "DEFAULT"]) return false unless sorting_rule_validator.valid?(@sorting_rule) true diff --git a/lib/VoucherifySdk/models/redeemable_loyalty_card.rb b/lib/VoucherifySdk/models/redeemable_loyalty_card.rb index 6b722140..570cd383 100644 --- a/lib/VoucherifySdk/models/redeemable_loyalty_card.rb +++ b/lib/VoucherifySdk/models/redeemable_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Redeemable loyalty card object response class RedeemableLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. diff --git a/lib/VoucherifySdk/models/redeemable_voucher_loyalty_card.rb b/lib/VoucherifySdk/models/redeemable_voucher_loyalty_card.rb index 4a780123..2b1fb70d 100644 --- a/lib/VoucherifySdk/models/redeemable_voucher_loyalty_card.rb +++ b/lib/VoucherifySdk/models/redeemable_voucher_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`. class RedeemableVoucherLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -28,13 +28,17 @@ class RedeemableVoucherLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -49,7 +53,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -59,7 +64,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -86,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -111,7 +121,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -123,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/redemption_entry_order.rb b/lib/VoucherifySdk/models/redemption_entry_order.rb index daad4fa1..b4ec15af 100644 --- a/lib/VoucherifySdk/models/redemption_entry_order.rb +++ b/lib/VoucherifySdk/models/redemption_entry_order.rb @@ -24,36 +24,33 @@ class RedemptionEntryOrder # The order status. attr_accessor :status - # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. + # This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :amount - # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. + # This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :initial_amount - # Sum of all order-level discounts applied to the order. + # Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :discount_amount - # Sum of all product-specific discounts applied to the order. + # Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :items_discount_amount - # Sum of all order-level AND all product-specific discounts applied to the order. + # Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :total_discount_amount - # Order amount after undoing all the discounts through the rollback redemption. + # Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :total_amount - # This field shows the order-level discount applied. + # This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :applied_discount_amount - # Sum of all product-specific discounts applied in a particular request. `sum(items, i => i.applied_discount_amount)` + # Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `sum(items, i => i.applied_discount_amount)` attr_accessor :items_applied_discount_amount - # Sum of all order-level AND all product-specific discounts applied in a particular request. `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` + # Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` attr_accessor :total_applied_discount_amount - # Array of items applied to the order. It can include up 500 items. - attr_accessor :items - # A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. attr_accessor :metadata @@ -66,7 +63,7 @@ class RedemptionEntryOrder # Timestamp representing the date and time when the order was last updated in ISO 8601 format. attr_accessor :updated_at - # Unique customer ID of the customer making the purchase. + # Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify. attr_accessor :customer_id # Unique referrer ID. @@ -78,6 +75,9 @@ class RedemptionEntryOrder attr_accessor :redemptions + # Array of items applied to the order. It can include up 500 items. + attr_accessor :items + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -115,7 +115,6 @@ def self.attribute_map :'applied_discount_amount' => :'applied_discount_amount', :'items_applied_discount_amount' => :'items_applied_discount_amount', :'total_applied_discount_amount' => :'total_applied_discount_amount', - :'items' => :'items', :'metadata' => :'metadata', :'object' => :'object', :'created_at' => :'created_at', @@ -124,7 +123,8 @@ def self.attribute_map :'referrer_id' => :'referrer_id', :'customer' => :'customer', :'referrer' => :'referrer', - :'redemptions' => :'redemptions' + :'redemptions' => :'redemptions', + :'items' => :'items' } end @@ -148,7 +148,6 @@ def self.openapi_types :'applied_discount_amount' => :'Integer', :'items_applied_discount_amount' => :'Integer', :'total_applied_discount_amount' => :'Integer', - :'items' => :'Array', :'metadata' => :'Object', :'object' => :'String', :'created_at' => :'Time', @@ -157,7 +156,8 @@ def self.openapi_types :'referrer_id' => :'String', :'customer' => :'RedemptionEntryOrderCustomer', :'referrer' => :'RedemptionEntryOrderReferrer', - :'redemptions' => :'Hash' + :'redemptions' => :'Hash', + :'items' => :'Array' } end @@ -176,7 +176,6 @@ def self.openapi_nullable :'applied_discount_amount', :'items_applied_discount_amount', :'total_applied_discount_amount', - :'items', :'metadata', :'object', :'created_at', @@ -185,7 +184,8 @@ def self.openapi_nullable :'referrer_id', :'customer', :'referrer', - :'redemptions' + :'redemptions', + :'items' ]) end @@ -245,12 +245,6 @@ def initialize(attributes = {}) self.total_applied_discount_amount = attributes[:'total_applied_discount_amount'] end - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - if attributes.key?(:'metadata') self.metadata = attributes[:'metadata'] end @@ -290,6 +284,12 @@ def initialize(attributes = {}) self.redemptions = value end end + + if attributes.key?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -328,7 +328,6 @@ def ==(o) applied_discount_amount == o.applied_discount_amount && items_applied_discount_amount == o.items_applied_discount_amount && total_applied_discount_amount == o.total_applied_discount_amount && - items == o.items && metadata == o.metadata && object == o.object && created_at == o.created_at && @@ -337,7 +336,8 @@ def ==(o) referrer_id == o.referrer_id && customer == o.customer && referrer == o.referrer && - redemptions == o.redemptions + redemptions == o.redemptions && + items == o.items end # @see the `==` method @@ -349,7 +349,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, source_id, status, amount, initial_amount, discount_amount, items_discount_amount, total_discount_amount, total_amount, applied_discount_amount, items_applied_discount_amount, total_applied_discount_amount, items, metadata, object, created_at, updated_at, customer_id, referrer_id, customer, referrer, redemptions].hash + [id, source_id, status, amount, initial_amount, discount_amount, items_discount_amount, total_discount_amount, total_amount, applied_discount_amount, items_applied_discount_amount, total_applied_discount_amount, metadata, object, created_at, updated_at, customer_id, referrer_id, customer, referrer, redemptions, items].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/redemption_entry_voucher_loyalty_card.rb b/lib/VoucherifySdk/models/redemption_entry_voucher_loyalty_card.rb index 5449df97..6b9b89ed 100644 --- a/lib/VoucherifySdk/models/redemption_entry_voucher_loyalty_card.rb +++ b/lib/VoucherifySdk/models/redemption_entry_voucher_loyalty_card.rb @@ -15,7 +15,7 @@ module VoucherifySdk class RedemptionEntryVoucherLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -27,13 +27,17 @@ class RedemptionEntryVoucherLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -48,7 +52,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -58,7 +63,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -85,6 +91,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -110,7 +120,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -122,7 +133,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/redemption_voucher_loyalty_card.rb b/lib/VoucherifySdk/models/redemption_voucher_loyalty_card.rb index ba0114ea..b8c990b4 100644 --- a/lib/VoucherifySdk/models/redemption_voucher_loyalty_card.rb +++ b/lib/VoucherifySdk/models/redemption_voucher_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`. class RedemptionVoucherLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -28,13 +28,17 @@ class RedemptionVoucherLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -49,7 +53,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -59,7 +64,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -86,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -111,7 +121,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -123,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/redemptions_get_response_body_order.rb b/lib/VoucherifySdk/models/redemptions_get_response_body_order.rb index 4fbefd96..f38d7b54 100644 --- a/lib/VoucherifySdk/models/redemptions_get_response_body_order.rb +++ b/lib/VoucherifySdk/models/redemptions_get_response_body_order.rb @@ -24,36 +24,33 @@ class RedemptionsGetResponseBodyOrder # The order status. attr_accessor :status - # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. + # This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :amount - # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. + # This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :initial_amount - # Sum of all order-level discounts applied to the order. + # Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :discount_amount - # Sum of all product-specific discounts applied to the order. + # Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :items_discount_amount - # Sum of all order-level AND all product-specific discounts applied to the order. + # Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :total_discount_amount - # Order amount after undoing all the discounts through the rollback redemption. + # Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :total_amount - # This field shows the order-level discount applied. + # This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :applied_discount_amount - # Sum of all product-specific discounts applied in a particular request. `sum(items, i => i.applied_discount_amount)` + # Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `sum(items, i => i.applied_discount_amount)` attr_accessor :items_applied_discount_amount - # Sum of all order-level AND all product-specific discounts applied in a particular request. `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` + # Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` attr_accessor :total_applied_discount_amount - # Array of items applied to the order. It can include up 500 items. - attr_accessor :items - # A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. attr_accessor :metadata @@ -66,7 +63,7 @@ class RedemptionsGetResponseBodyOrder # Timestamp representing the date and time when the order was last updated in ISO 8601 format. attr_accessor :updated_at - # Unique customer ID of the customer making the purchase. + # Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify. attr_accessor :customer_id # Unique referrer ID. @@ -78,6 +75,9 @@ class RedemptionsGetResponseBodyOrder attr_accessor :redemptions + # Array of items applied to the order. It can include up 500 items. + attr_accessor :items + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -115,7 +115,6 @@ def self.attribute_map :'applied_discount_amount' => :'applied_discount_amount', :'items_applied_discount_amount' => :'items_applied_discount_amount', :'total_applied_discount_amount' => :'total_applied_discount_amount', - :'items' => :'items', :'metadata' => :'metadata', :'object' => :'object', :'created_at' => :'created_at', @@ -124,7 +123,8 @@ def self.attribute_map :'referrer_id' => :'referrer_id', :'customer' => :'customer', :'referrer' => :'referrer', - :'redemptions' => :'redemptions' + :'redemptions' => :'redemptions', + :'items' => :'items' } end @@ -148,7 +148,6 @@ def self.openapi_types :'applied_discount_amount' => :'Integer', :'items_applied_discount_amount' => :'Integer', :'total_applied_discount_amount' => :'Integer', - :'items' => :'Array', :'metadata' => :'Object', :'object' => :'String', :'created_at' => :'Time', @@ -157,7 +156,8 @@ def self.openapi_types :'referrer_id' => :'String', :'customer' => :'RedemptionsGetResponseBodyOrderCustomer', :'referrer' => :'RedemptionsGetResponseBodyOrderReferrer', - :'redemptions' => :'Hash' + :'redemptions' => :'Hash', + :'items' => :'Array' } end @@ -176,7 +176,6 @@ def self.openapi_nullable :'applied_discount_amount', :'items_applied_discount_amount', :'total_applied_discount_amount', - :'items', :'metadata', :'object', :'created_at', @@ -185,7 +184,8 @@ def self.openapi_nullable :'referrer_id', :'customer', :'referrer', - :'redemptions' + :'redemptions', + :'items' ]) end @@ -245,12 +245,6 @@ def initialize(attributes = {}) self.total_applied_discount_amount = attributes[:'total_applied_discount_amount'] end - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - if attributes.key?(:'metadata') self.metadata = attributes[:'metadata'] end @@ -290,6 +284,12 @@ def initialize(attributes = {}) self.redemptions = value end end + + if attributes.key?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -328,7 +328,6 @@ def ==(o) applied_discount_amount == o.applied_discount_amount && items_applied_discount_amount == o.items_applied_discount_amount && total_applied_discount_amount == o.total_applied_discount_amount && - items == o.items && metadata == o.metadata && object == o.object && created_at == o.created_at && @@ -337,7 +336,8 @@ def ==(o) referrer_id == o.referrer_id && customer == o.customer && referrer == o.referrer && - redemptions == o.redemptions + redemptions == o.redemptions && + items == o.items end # @see the `==` method @@ -349,7 +349,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, source_id, status, amount, initial_amount, discount_amount, items_discount_amount, total_discount_amount, total_amount, applied_discount_amount, items_applied_discount_amount, total_applied_discount_amount, items, metadata, object, created_at, updated_at, customer_id, referrer_id, customer, referrer, redemptions].hash + [id, source_id, status, amount, initial_amount, discount_amount, items_discount_amount, total_discount_amount, total_amount, applied_discount_amount, items_applied_discount_amount, total_applied_discount_amount, metadata, object, created_at, updated_at, customer_id, referrer_id, customer, referrer, redemptions, items].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/redemptions_get_response_body_voucher_loyalty_card.rb b/lib/VoucherifySdk/models/redemptions_get_response_body_voucher_loyalty_card.rb index ac8e6d38..2f473b85 100644 --- a/lib/VoucherifySdk/models/redemptions_get_response_body_voucher_loyalty_card.rb +++ b/lib/VoucherifySdk/models/redemptions_get_response_body_voucher_loyalty_card.rb @@ -15,7 +15,7 @@ module VoucherifySdk class RedemptionsGetResponseBodyVoucherLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -27,13 +27,17 @@ class RedemptionsGetResponseBodyVoucherLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -48,7 +52,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -58,7 +63,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -85,6 +91,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -110,7 +120,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -122,7 +133,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_order.rb b/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_order.rb index 174876b0..3bc292e7 100644 --- a/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_order.rb +++ b/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_order.rb @@ -24,36 +24,33 @@ class RedemptionsListResponseBodyRedemptionsItemOrder # The order status. attr_accessor :status - # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. + # This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :amount - # A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. + # This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :initial_amount - # Sum of all order-level discounts applied to the order. + # Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :discount_amount - # Sum of all product-specific discounts applied to the order. + # Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :items_discount_amount - # Sum of all order-level AND all product-specific discounts applied to the order. + # Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :total_discount_amount - # Order amount after undoing all the discounts through the rollback redemption. + # Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :total_amount - # This field shows the order-level discount applied. + # This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). attr_accessor :applied_discount_amount - # Sum of all product-specific discounts applied in a particular request. `sum(items, i => i.applied_discount_amount)` + # Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `sum(items, i => i.applied_discount_amount)` attr_accessor :items_applied_discount_amount - # Sum of all order-level AND all product-specific discounts applied in a particular request. `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` + # Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00). `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` attr_accessor :total_applied_discount_amount - # Array of items applied to the order. It can include up 500 items. - attr_accessor :items - # A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas. attr_accessor :metadata @@ -66,7 +63,7 @@ class RedemptionsListResponseBodyRedemptionsItemOrder # Timestamp representing the date and time when the order was last updated in ISO 8601 format. attr_accessor :updated_at - # Unique customer ID of the customer making the purchase. + # Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify. attr_accessor :customer_id # Unique referrer ID. @@ -78,6 +75,9 @@ class RedemptionsListResponseBodyRedemptionsItemOrder attr_accessor :redemptions + # Array of items applied to the order. It can include up 500 items. + attr_accessor :items + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -115,7 +115,6 @@ def self.attribute_map :'applied_discount_amount' => :'applied_discount_amount', :'items_applied_discount_amount' => :'items_applied_discount_amount', :'total_applied_discount_amount' => :'total_applied_discount_amount', - :'items' => :'items', :'metadata' => :'metadata', :'object' => :'object', :'created_at' => :'created_at', @@ -124,7 +123,8 @@ def self.attribute_map :'referrer_id' => :'referrer_id', :'customer' => :'customer', :'referrer' => :'referrer', - :'redemptions' => :'redemptions' + :'redemptions' => :'redemptions', + :'items' => :'items' } end @@ -148,7 +148,6 @@ def self.openapi_types :'applied_discount_amount' => :'Integer', :'items_applied_discount_amount' => :'Integer', :'total_applied_discount_amount' => :'Integer', - :'items' => :'Array', :'metadata' => :'Object', :'object' => :'String', :'created_at' => :'Time', @@ -157,7 +156,8 @@ def self.openapi_types :'referrer_id' => :'String', :'customer' => :'RedemptionsListResponseBodyRedemptionsItemOrderCustomer', :'referrer' => :'RedemptionsListResponseBodyRedemptionsItemOrderReferrer', - :'redemptions' => :'Hash' + :'redemptions' => :'Hash', + :'items' => :'Array' } end @@ -176,14 +176,13 @@ def self.openapi_nullable :'applied_discount_amount', :'items_applied_discount_amount', :'total_applied_discount_amount', - :'items', :'metadata', :'object', :'created_at', :'updated_at', :'customer_id', :'referrer_id', - :'redemptions' + :'redemptions', ]) end @@ -243,12 +242,6 @@ def initialize(attributes = {}) self.total_applied_discount_amount = attributes[:'total_applied_discount_amount'] end - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - if attributes.key?(:'metadata') self.metadata = attributes[:'metadata'] end @@ -288,6 +281,12 @@ def initialize(attributes = {}) self.redemptions = value end end + + if attributes.key?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -326,7 +325,6 @@ def ==(o) applied_discount_amount == o.applied_discount_amount && items_applied_discount_amount == o.items_applied_discount_amount && total_applied_discount_amount == o.total_applied_discount_amount && - items == o.items && metadata == o.metadata && object == o.object && created_at == o.created_at && @@ -335,7 +333,8 @@ def ==(o) referrer_id == o.referrer_id && customer == o.customer && referrer == o.referrer && - redemptions == o.redemptions + redemptions == o.redemptions && + items == o.items end # @see the `==` method @@ -347,7 +346,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, source_id, status, amount, initial_amount, discount_amount, items_discount_amount, total_discount_amount, total_amount, applied_discount_amount, items_applied_discount_amount, total_applied_discount_amount, items, metadata, object, created_at, updated_at, customer_id, referrer_id, customer, referrer, redemptions].hash + [id, source_id, status, amount, initial_amount, discount_amount, items_discount_amount, total_discount_amount, total_amount, applied_discount_amount, items_applied_discount_amount, total_applied_discount_amount, metadata, object, created_at, updated_at, customer_id, referrer_id, customer, referrer, redemptions, items].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_voucher_loyalty_card.rb b/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_voucher_loyalty_card.rb index 2b33c0cd..6cbe850f 100644 --- a/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_voucher_loyalty_card.rb +++ b/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_voucher_loyalty_card.rb @@ -15,7 +15,7 @@ module VoucherifySdk class RedemptionsListResponseBodyRedemptionsItemVoucherLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -27,13 +27,17 @@ class RedemptionsListResponseBodyRedemptionsItemVoucherLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -48,7 +52,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -58,7 +63,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -85,6 +91,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -110,7 +120,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -122,7 +133,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/simple_loyalty_card.rb b/lib/VoucherifySdk/models/simple_loyalty_card.rb index dac6655a..0375a661 100644 --- a/lib/VoucherifySdk/models/simple_loyalty_card.rb +++ b/lib/VoucherifySdk/models/simple_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Simplified loyalty card data. class SimpleLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -28,13 +28,17 @@ class SimpleLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -49,7 +53,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'String', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -59,7 +64,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -86,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -111,7 +121,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -123,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/templates_campaigns_campaign_setup_create_request_body.rb b/lib/VoucherifySdk/models/templates_campaigns_campaign_setup_create_request_body.rb index f638819c..a743b856 100644 --- a/lib/VoucherifySdk/models/templates_campaigns_campaign_setup_create_request_body.rb +++ b/lib/VoucherifySdk/models/templates_campaigns_campaign_setup_create_request_body.rb @@ -62,6 +62,8 @@ class TemplatesCampaignsCampaignSetupCreateRequestBody # The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format. attr_accessor :metadata + attr_accessor :access_settings + attr_accessor :voucher class EnumAttributeValidator @@ -105,6 +107,7 @@ def self.attribute_map :'category_id' => :'category_id', :'category' => :'category', :'metadata' => :'metadata', + :'access_settings' => :'access_settings', :'voucher' => :'voucher' } end @@ -133,6 +136,7 @@ def self.openapi_types :'category_id' => :'String', :'category' => :'String', :'metadata' => :'Object', + :'access_settings' => :'AccessSettings', :'voucher' => :'TemplatesCampaignsCampaignSetupCreateRequestBodyVoucher' } end @@ -231,6 +235,10 @@ def initialize(attributes = {}) self.metadata = attributes[:'metadata'] end + if attributes.key?(:'access_settings') + self.access_settings = attributes[:'access_settings'] + end + if attributes.key?(:'voucher') self.voucher = attributes[:'voucher'] end @@ -274,6 +282,7 @@ def ==(o) category_id == o.category_id && category == o.category && metadata == o.metadata && + access_settings == o.access_settings && voucher == o.voucher end @@ -286,7 +295,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [name, description, type, join_once, auto_join, use_voucher_metadata_schema, vouchers_count, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, activity_duration_after_publishing, category_id, category, metadata, voucher].hash + [name, description, type, join_once, auto_join, use_voucher_metadata_schema, vouchers_count, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, activity_duration_after_publishing, category_id, category, metadata, access_settings, voucher].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item_result_discount.rb b/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item_result_discount.rb index 65d96af8..9effad3e 100644 --- a/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item_result_discount.rb +++ b/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item_result_discount.rb @@ -33,6 +33,7 @@ class ValidationsValidateResponseBodyRedeemablesItemResultDiscount # Number of units to be granted a full value discount. attr_accessor :unit_off + # Formula used to calculate the number of units. attr_accessor :unit_off_formula # The product deemed as free, chosen from product inventory (e.g. time, items). diff --git a/lib/VoucherifySdk/models/voucher_loyalty_card.rb b/lib/VoucherifySdk/models/voucher_loyalty_card.rb index a52dba36..2f5672c7 100644 --- a/lib/VoucherifySdk/models/voucher_loyalty_card.rb +++ b/lib/VoucherifySdk/models/voucher_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`. class VoucherLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -28,13 +28,17 @@ class VoucherLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -49,7 +53,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -59,7 +64,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -86,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -111,7 +121,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -123,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/voucher_transaction.rb b/lib/VoucherifySdk/models/voucher_transaction.rb index 373779f1..fe3a039c 100644 --- a/lib/VoucherifySdk/models/voucher_transaction.rb +++ b/lib/VoucherifySdk/models/voucher_transaction.rb @@ -179,7 +179,7 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - type_validator = EnumAttributeValidator.new('String', ["CREDITS_REDEMPTION", "CREDITS_REFUND", "CREDITS_ADDITION", "CREDITS_REMOVAL", "POINTS_ACCRUAL", "POINTS_REDEMPTION", "POINTS_REFUND", "POINTS_ADDITION", "POINTS_REMOVAL", "POINTS_EXPIRATION", "POINTS_TRANSFER_IN", "POINTS_TRANSFER_OUT"]) + type_validator = EnumAttributeValidator.new('String', ["CREDITS_REDEMPTION", "CREDITS_REFUND", "CREDITS_ADDITION", "CREDITS_REMOVAL", "POINTS_PENDING_ACTIVATION", "POINTS_ACCRUAL", "POINTS_REDEMPTION", "POINTS_REFUND", "POINTS_ADDITION", "POINTS_REMOVAL", "POINTS_EXPIRATION", "POINTS_TRANSFER_IN", "POINTS_TRANSFER_OUT"]) return false unless type_validator.valid?(@type) true end diff --git a/lib/VoucherifySdk/models/voucher_transaction_details.rb b/lib/VoucherifySdk/models/voucher_transaction_details.rb index de1e1697..6998f552 100644 --- a/lib/VoucherifySdk/models/voucher_transaction_details.rb +++ b/lib/VoucherifySdk/models/voucher_transaction_details.rb @@ -36,6 +36,10 @@ class VoucherTransactionDetails attr_accessor :event_schema + attr_accessor :holder_loyalty_tier + + attr_accessor :pending_points + attr_accessor :reward attr_accessor :source_voucher @@ -55,6 +59,8 @@ def self.attribute_map :'rollback' => :'rollback', :'custom_event' => :'custom_event', :'event_schema' => :'event_schema', + :'holder_loyalty_tier' => :'holder_loyalty_tier', + :'pending_points' => :'pending_points', :'reward' => :'reward', :'source_voucher' => :'source_voucher', :'destination_voucher' => :'destination_voucher' @@ -79,6 +85,8 @@ def self.openapi_types :'rollback' => :'VoucherTransactionDetailsRollback', :'custom_event' => :'VoucherTransactionDetailsCustomEvent', :'event_schema' => :'VoucherTransactionDetailsEventSchema', + :'holder_loyalty_tier' => :'VoucherTransactionDetailsHolderLoyaltyTier', + :'pending_points' => :'LoyaltyPendingPoints', :'reward' => :'VoucherTransactionDetailsReward', :'source_voucher' => :'SimpleVoucher', :'destination_voucher' => :'SimpleVoucher' @@ -97,6 +105,7 @@ def self.openapi_nullable :'rollback', :'custom_event', :'event_schema', + :'holder_loyalty_tier', :'reward', ]) end @@ -149,6 +158,14 @@ def initialize(attributes = {}) self.event_schema = attributes[:'event_schema'] end + if attributes.key?(:'holder_loyalty_tier') + self.holder_loyalty_tier = attributes[:'holder_loyalty_tier'] + end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end + if attributes.key?(:'reward') self.reward = attributes[:'reward'] end @@ -192,6 +209,8 @@ def ==(o) rollback == o.rollback && custom_event == o.custom_event && event_schema == o.event_schema && + holder_loyalty_tier == o.holder_loyalty_tier && + pending_points == o.pending_points && reward == o.reward && source_voucher == o.source_voucher && destination_voucher == o.destination_voucher @@ -206,7 +225,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [balance, order, event, earning_rule, segment, loyalty_tier, redemption, rollback, custom_event, event_schema, reward, source_voucher, destination_voucher].hash + [balance, order, event, earning_rule, segment, loyalty_tier, redemption, rollback, custom_event, event_schema, holder_loyalty_tier, pending_points, reward, source_voucher, destination_voucher].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/voucher_transaction_details_custom_event.rb b/lib/VoucherifySdk/models/voucher_transaction_details_custom_event.rb index a2f87203..0088ab5e 100644 --- a/lib/VoucherifySdk/models/voucher_transaction_details_custom_event.rb +++ b/lib/VoucherifySdk/models/voucher_transaction_details_custom_event.rb @@ -16,10 +16,10 @@ module VoucherifySdk # Contains information about the custom event that triggers the point accrual. class VoucherTransactionDetailsCustomEvent - # Unique event ID. + # Unique identifier of the event. attr_accessor :id - # Type of custom event. + # Type of the custom event. attr_accessor :type # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/VoucherifySdk/models/voucher_transaction_details_earning_rule.rb b/lib/VoucherifySdk/models/voucher_transaction_details_earning_rule.rb index 85a1ab75..9e55321f 100644 --- a/lib/VoucherifySdk/models/voucher_transaction_details_earning_rule.rb +++ b/lib/VoucherifySdk/models/voucher_transaction_details_earning_rule.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Contains information about the earning rule. class VoucherTransactionDetailsEarningRule - # Unique earning rule ID. + # Unique identifier of an earning rule, assigned by Voucherify. attr_accessor :id attr_accessor :source diff --git a/lib/VoucherifySdk/models/voucher_transaction_details_event_schema.rb b/lib/VoucherifySdk/models/voucher_transaction_details_event_schema.rb index 1b27a3bd..710c5940 100644 --- a/lib/VoucherifySdk/models/voucher_transaction_details_event_schema.rb +++ b/lib/VoucherifySdk/models/voucher_transaction_details_event_schema.rb @@ -16,10 +16,10 @@ module VoucherifySdk # Contains information about the custom event metadata schema. class VoucherTransactionDetailsEventSchema - # Unique metadata schema ID. + # Unique identifier of the metadata schema. attr_accessor :id - # Type of custom event. + # Type of the custom event. attr_accessor :name # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/VoucherifySdk/models/voucher_transaction_details_holder_loyalty_tier.rb b/lib/VoucherifySdk/models/voucher_transaction_details_holder_loyalty_tier.rb new file mode 100644 index 00000000..6851b0bd --- /dev/null +++ b/lib/VoucherifySdk/models/voucher_transaction_details_holder_loyalty_tier.rb @@ -0,0 +1,221 @@ +=begin +#Voucherify API + +#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + +The version of the OpenAPI document: v2018-08-01 +Contact: support@voucherify.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1 + +=end + +require 'date' +require 'time' + +module VoucherifySdk + # 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. + class VoucherTransactionDetailsHolderLoyaltyTier + # Unique identifier of the loyalty tier, assigned by Voucherify. + attr_accessor :id + + # User-defined name of the loyalty tier. + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'id', + :'name' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = VoucherifySdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/VoucherifySdk/models/voucher_transaction_details_loyalty_tier.rb b/lib/VoucherifySdk/models/voucher_transaction_details_loyalty_tier.rb index 9e0e9917..d5976654 100644 --- a/lib/VoucherifySdk/models/voucher_transaction_details_loyalty_tier.rb +++ b/lib/VoucherifySdk/models/voucher_transaction_details_loyalty_tier.rb @@ -14,10 +14,12 @@ require 'time' module VoucherifySdk - # Contains information about the loyalty tier. + # Contains information about the loyalty tier that is mapped for the earning rule and used in the transaction. class VoucherTransactionDetailsLoyaltyTier + # Unique identifier of the loyalty tier, assigned by Voucherify. attr_accessor :id + # User-defined name of the loyalty tier. attr_accessor :name # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/VoucherifySdk/models/voucher_transaction_details_rollback.rb b/lib/VoucherifySdk/models/voucher_transaction_details_rollback.rb index 647a15f1..56fbfb54 100644 --- a/lib/VoucherifySdk/models/voucher_transaction_details_rollback.rb +++ b/lib/VoucherifySdk/models/voucher_transaction_details_rollback.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Contains information about the redemption rollback. class VoucherTransactionDetailsRollback - # Unique redemption rollback ID. + # Unique identifier of the redemption rollback. attr_accessor :id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/VoucherifySdk/models/voucher_transaction_details_segment.rb b/lib/VoucherifySdk/models/voucher_transaction_details_segment.rb index cae3f1ef..cfdb58d2 100644 --- a/lib/VoucherifySdk/models/voucher_transaction_details_segment.rb +++ b/lib/VoucherifySdk/models/voucher_transaction_details_segment.rb @@ -16,8 +16,10 @@ module VoucherifySdk # Contains information about the segment. class VoucherTransactionDetailsSegment + # Unique identifier of the segment. attr_accessor :id + # Name of the segment. attr_accessor :name # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/VoucherifySdk/models/voucher_with_categories_loyalty_card.rb b/lib/VoucherifySdk/models/voucher_with_categories_loyalty_card.rb index a75f3511..49b9842b 100644 --- a/lib/VoucherifySdk/models/voucher_with_categories_loyalty_card.rb +++ b/lib/VoucherifySdk/models/voucher_with_categories_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`. class VoucherWithCategoriesLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -28,13 +28,17 @@ class VoucherWithCategoriesLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -49,7 +53,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -59,7 +64,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -86,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -111,7 +121,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -123,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/vouchers_create_response_body_loyalty_card.rb b/lib/VoucherifySdk/models/vouchers_create_response_body_loyalty_card.rb index f9bacb25..06bae603 100644 --- a/lib/VoucherifySdk/models/vouchers_create_response_body_loyalty_card.rb +++ b/lib/VoucherifySdk/models/vouchers_create_response_body_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`. class VouchersCreateResponseBodyLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -28,13 +28,17 @@ class VouchersCreateResponseBodyLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -49,7 +53,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -59,7 +64,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -86,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -111,7 +121,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -123,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/vouchers_disable_response_body_loyalty_card.rb b/lib/VoucherifySdk/models/vouchers_disable_response_body_loyalty_card.rb index a68af866..ed509c1f 100644 --- a/lib/VoucherifySdk/models/vouchers_disable_response_body_loyalty_card.rb +++ b/lib/VoucherifySdk/models/vouchers_disable_response_body_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`. class VouchersDisableResponseBodyLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -28,13 +28,17 @@ class VouchersDisableResponseBodyLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -49,7 +53,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -59,7 +64,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -86,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -111,7 +121,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -123,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/vouchers_enable_response_body_loyalty_card.rb b/lib/VoucherifySdk/models/vouchers_enable_response_body_loyalty_card.rb index 2b4ff5a8..8e19480f 100644 --- a/lib/VoucherifySdk/models/vouchers_enable_response_body_loyalty_card.rb +++ b/lib/VoucherifySdk/models/vouchers_enable_response_body_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`. class VouchersEnableResponseBodyLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -28,13 +28,17 @@ class VouchersEnableResponseBodyLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -49,7 +53,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -59,7 +64,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -86,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -111,7 +121,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -123,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/vouchers_get_response_body_loyalty_card.rb b/lib/VoucherifySdk/models/vouchers_get_response_body_loyalty_card.rb index 334d4343..39aa61c0 100644 --- a/lib/VoucherifySdk/models/vouchers_get_response_body_loyalty_card.rb +++ b/lib/VoucherifySdk/models/vouchers_get_response_body_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`. class VouchersGetResponseBodyLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -28,13 +28,17 @@ class VouchersGetResponseBodyLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -49,7 +53,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -59,7 +64,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -86,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -111,7 +121,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -123,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/vouchers_update_response_body_loyalty_card.rb b/lib/VoucherifySdk/models/vouchers_update_response_body_loyalty_card.rb index 19a89162..4cb4dfa5 100644 --- a/lib/VoucherifySdk/models/vouchers_update_response_body_loyalty_card.rb +++ b/lib/VoucherifySdk/models/vouchers_update_response_body_loyalty_card.rb @@ -16,7 +16,7 @@ module VoucherifySdk # Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`. class VouchersUpdateResponseBodyLoyaltyCard - # Total points incurred over the lifespan of the loyalty card. + # Total points incurred over the lifespan of the loyalty card, minus the expired points. attr_accessor :points # Points available for reward redemption. @@ -28,13 +28,17 @@ class VouchersUpdateResponseBodyLoyaltyCard # The amount of points that are set to expire next. attr_accessor :next_expiration_points + # Determines the number of pending points that will be added to the loyalty card after the predefined time. + attr_accessor :pending_points + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'points' => :'points', :'balance' => :'balance', :'next_expiration_date' => :'next_expiration_date', - :'next_expiration_points' => :'next_expiration_points' + :'next_expiration_points' => :'next_expiration_points', + :'pending_points' => :'pending_points' } end @@ -49,7 +53,8 @@ def self.openapi_types :'points' => :'Integer', :'balance' => :'Integer', :'next_expiration_date' => :'Date', - :'next_expiration_points' => :'Integer' + :'next_expiration_points' => :'Integer', + :'pending_points' => :'Integer' } end @@ -59,7 +64,8 @@ def self.openapi_nullable :'points', :'balance', :'next_expiration_date', - :'next_expiration_points' + :'next_expiration_points', + :'pending_points' ]) end @@ -86,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'next_expiration_points') self.next_expiration_points = attributes[:'next_expiration_points'] end + + if attributes.key?(:'pending_points') + self.pending_points = attributes[:'pending_points'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -111,7 +121,8 @@ def ==(o) points == o.points && balance == o.balance && next_expiration_date == o.next_expiration_date && - next_expiration_points == o.next_expiration_points + next_expiration_points == o.next_expiration_points && + pending_points == o.pending_points end # @see the `==` method @@ -123,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [points, balance, next_expiration_date, next_expiration_points].hash + [points, balance, next_expiration_date, next_expiration_points, pending_points].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/version.rb b/lib/VoucherifySdk/version.rb index 501a09e7..4a6f8121 100644 --- a/lib/VoucherifySdk/version.rb +++ b/lib/VoucherifySdk/version.rb @@ -11,5 +11,5 @@ =end module VoucherifySdk - VERSION = '8.0.2' + VERSION = '8.0.3' end