From ebad6b5ea6582760fea871e09f4dd58b6256972e Mon Sep 17 00:00:00 2001 From: p-zielinski Date: Mon, 28 Oct 2024 14:07:18 +0100 Subject: [PATCH] v8.0.0 --- Dockerfile | 2 +- EXAMPLES.md | 6 +- README.md | 15 +- docs/CampaignsCreateRequestBody.md | 2 +- docs/CampaignsImportVoucherItem.md | 2 +- docs/CampaignsUpdateRequestBody.md | 2 +- ...ionsValidateResponseBodyRedeemablesItem.md | 2 +- ...esponseBodyRedeemablesItemResultDetails.md | 2 +- docs/Discount.md | 2 +- docs/DiscountProduct.md | 10 + docs/EarningRuleLoyalty.md | 2 +- docs/ExportParameters.md | 2 +- docs/ExportParametersFilters.md | 11 - docs/ExportsCreateRequestBodyParameters.md | 2 +- ...portsCreateRequestBodyParametersFilters.md | 11 - docs/ExportsCreateResponseBodyParameters.md | 2 +- ...ortsCreateResponseBodyParametersFilters.md | 11 - docs/ExportsGetResponseBodyParameters.md | 2 +- ...ExportsGetResponseBodyParametersFilters.md | 11 - ...altiesEarningRulesCreateRequestBodyItem.md | 2 +- ...arningRulesCreateRequestBodyItemLoyalty.md | 4 +- ...esEarningRulesCreateResponseBodyLoyalty.md | 2 +- ...sEarningRulesDisableResponseBodyLoyalty.md | 2 +- ...esEarningRulesEnableResponseBodyLoyalty.md | 2 +- ...ltiesEarningRulesGetResponseBodyLoyalty.md | 2 +- ...iesEarningRulesUpdateRequestBodyLoyalty.md | 2 +- ...esEarningRulesUpdateResponseBodyLoyalty.md | 2 +- ...ectionsProductsListResponseBodyDataItem.md | 2 +- docs/PublicationsCreateRequestBody.md | 2 +- docs/PublicationsCreateResponseBody.md | 2 +- docs/RedemptionEntry.md | 2 +- docs/RedemptionEntryCustomer.md | 2 +- docs/RedemptionEntryOrder.md | 4 +- docs/RedemptionEntryPromotionTier.md | 2 +- docs/RedemptionEntryVoucher.md | 2 +- docs/RedemptionsGetResponseBody.md | 2 +- docs/RedemptionsGetResponseBodyCustomer.md | 2 +- docs/RedemptionsGetResponseBodyOrder.md | 4 +- ...RedemptionsGetResponseBodyPromotionTier.md | 2 +- docs/RedemptionsGetResponseBodyVoucher.md | 2 +- ...emptionsListResponseBodyRedemptionsItem.md | 2 +- ...ListResponseBodyRedemptionsItemCustomer.md | 2 +- ...onsListResponseBodyRedemptionsItemOrder.md | 4 +- ...esponseBodyRedemptionsItemPromotionTier.md | 2 +- ...sListResponseBodyRedemptionsItemVoucher.md | 2 +- docs/RewardsCreateRequestBody.md | 2 +- docs/RewardsUpdateRequestBody.md | 2 +- ...ionsValidateResponseBodyRedeemablesItem.md | 2 +- ...esponseBodyRedeemablesItemResultDetails.md | 2 +- docs/VouchersApi.md | 4 +- docs/VouchersCreateRequestBody.md | 27 ++ docs/VouchersCreateRequestBodyRedemption.md | 8 + ...uchersCreateWithSpecificCodeRequestBody.md | 2 +- docs/VouchersImportCreateItemRequestBody.md | 2 +- docs/VouchersUpdateRequestBody.md | 2 +- lib/VoucherifySdk.rb | 7 +- lib/VoucherifySdk/api/vouchers_api.rb | 6 +- .../models/campaigns_create_request_body.rb | 1 + .../models/campaigns_import_voucher_item.rb | 1 + .../models/campaigns_update_request_body.rb | 1 + ...validate_response_body_redeemables_item.rb | 2 + ...se_body_redeemables_item_result_details.rb | 26 +- lib/VoucherifySdk/models/discount.rb | 3 +- ...ameters_filters.rb => discount_product.rb} | 77 ++-- .../models/earning_rule_loyalty.rb | 34 +- lib/VoucherifySdk/models/export_parameters.rb | 5 +- .../exports_create_request_body_parameters.rb | 5 +- ..._create_request_body_parameters_filters.rb | 256 ----------- ...exports_create_response_body_parameters.rb | 5 +- ...create_response_body_parameters_filters.rb | 256 ----------- .../exports_get_response_body_parameters.rb | 5 +- ..._earning_rules_create_request_body_item.rb | 2 + ..._rules_create_request_body_item_loyalty.rb | 44 +- ...ning_rules_create_response_body_loyalty.rb | 34 +- ...ing_rules_disable_response_body_loyalty.rb | 34 +- ...ning_rules_enable_response_body_loyalty.rb | 34 +- ...earning_rules_get_response_body_loyalty.rb | 34 +- ...rning_rules_update_request_body_loyalty.rb | 34 +- ...ning_rules_update_response_body_loyalty.rb | 34 +- ...s_products_list_response_body_data_item.rb | 1 + .../publications_create_request_body.rb | 1 + .../publications_create_response_body.rb | 1 + lib/VoucherifySdk/models/redemption_entry.rb | 1 + .../models/redemption_entry_customer.rb | 1 + .../models/redemption_entry_order.rb | 7 +- .../models/redemption_entry_promotion_tier.rb | 1 + .../models/redemption_entry_voucher.rb | 1 + .../models/redemptions_get_response_body.rb | 1 + .../redemptions_get_response_body_customer.rb | 1 + .../redemptions_get_response_body_order.rb | 7 +- ...ptions_get_response_body_promotion_tier.rb | 1 + .../redemptions_get_response_body_voucher.rb | 1 + ...ons_list_response_body_redemptions_item.rb | 2 + ...response_body_redemptions_item_customer.rb | 2 + ...st_response_body_redemptions_item_order.rb | 9 +- ...se_body_redemptions_item_promotion_tier.rb | 2 + ..._response_body_redemptions_item_voucher.rb | 2 + .../models/rewards_create_request_body.rb | 1 + .../models/rewards_update_request_body.rb | 1 + ...validate_response_body_redeemables_item.rb | 2 + ...se_body_redeemables_item_result_details.rb | 26 +- .../models/vouchers_create_request_body.rb | 431 ++++++++++++++++++ ...ouchers_create_request_body_redemption.rb} | 67 +-- ..._create_with_specific_code_request_body.rb | 1 + ...ouchers_import_create_item_request_body.rb | 1 + .../models/vouchers_update_request_body.rb | 1 + lib/VoucherifySdk/version.rb | 2 +- 107 files changed, 814 insertions(+), 913 deletions(-) create mode 100644 docs/DiscountProduct.md delete mode 100644 docs/ExportParametersFilters.md delete mode 100644 docs/ExportsCreateRequestBodyParametersFilters.md delete mode 100644 docs/ExportsCreateResponseBodyParametersFilters.md delete mode 100644 docs/ExportsGetResponseBodyParametersFilters.md create mode 100644 docs/VouchersCreateRequestBody.md create mode 100644 docs/VouchersCreateRequestBodyRedemption.md rename lib/VoucherifySdk/models/{export_parameters_filters.rb => discount_product.rb} (78%) delete mode 100644 lib/VoucherifySdk/models/exports_create_request_body_parameters_filters.rb delete mode 100644 lib/VoucherifySdk/models/exports_create_response_body_parameters_filters.rb create mode 100644 lib/VoucherifySdk/models/vouchers_create_request_body.rb rename lib/VoucherifySdk/models/{exports_get_response_body_parameters_filters.rb => vouchers_create_request_body_redemption.rb} (78%) diff --git a/Dockerfile b/Dockerfile index cd3e4ece..fd9c11ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ WORKDIR /app COPY . . RUN gem build VoucherifySdk.gemspec -RUN gem install voucherify-7.0.0.gem +RUN gem install voucherify-8.0.0.gem RUN gem install dotenv RUN gem install rspec diff --git a/EXAMPLES.md b/EXAMPLES.md index 6c0151cd..cb9d95fc 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -67,15 +67,15 @@ gem build VoucherifySdk.gemspec Then either install the gem locally: ```shell -gem install ./VoucherifySdk-7.0.0.gem +gem install ./VoucherifySdk-8.0.0.gem ``` -(for development, run `gem install --dev ./VoucherifySdk-7.0.0.gem` to install the development dependencies) +(for development, run `gem install --dev ./VoucherifySdk-8.0.0.gem` to install the development dependencies) Add this to the Gemfile: ```shell -gem 'VoucherifySdk', '~> 7.0.0' +gem 'VoucherifySdk', '~> 8.0.0' ``` Then install dependencies with bundler diff --git a/README.md b/README.md index dd712284..527b82d2 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,13 @@ Remember that this SDK is auto generated (except of the tests) so changes made h ## 📅 Changelog -- **2024-10-28** - `7.0.0` +- **2024-10-28** - `8.0.0` + - Added missing `enums` in few filters models + - !!! BREAKING CHANGES !!! + - VouchersApi.generateRandomCode now requires `VouchersCreateResponseBody` instead of plain `object` + - property `product` in model `Discount` now uses `DiscountProduct` instead of `SimpleProductDiscountUnit` + - property `filters` of model `ExportsCreateRequestBodyParameters` now uses plain `object` instead of `ExportsCreateRequestBodyParametersFilters` +- **2024-10-25** - `7.0.0` - Fix object parsing in query. For example `filters` while listing redemptions. - !!! BREAKING CHANGES !!! - Remove support for `/v1/customers/{customerId}/consents` - put `Update Customer's consents [Deprecated]` @@ -589,6 +595,7 @@ Class | Method | HTTP request | Description - [VoucherifySdk::CustomersUpdateResponseBodyAddress](docs/CustomersUpdateResponseBodyAddress.md) - [VoucherifySdk::CustomersUpdateResponseBodyAssets](docs/CustomersUpdateResponseBodyAssets.md) - [VoucherifySdk::Discount](docs/Discount.md) + - [VoucherifySdk::DiscountProduct](docs/DiscountProduct.md) - [VoucherifySdk::DiscountUnitMultipleOneUnit](docs/DiscountUnitMultipleOneUnit.md) - [VoucherifySdk::EarningRule](docs/EarningRule.md) - [VoucherifySdk::EarningRuleCustomEvent](docs/EarningRuleCustomEvent.md) @@ -617,20 +624,16 @@ Class | Method | HTTP request | Description - [VoucherifySdk::ExportOrderFields](docs/ExportOrderFields.md) - [VoucherifySdk::ExportOrderOrder](docs/ExportOrderOrder.md) - [VoucherifySdk::ExportParameters](docs/ExportParameters.md) - - [VoucherifySdk::ExportParametersFilters](docs/ExportParametersFilters.md) - [VoucherifySdk::ExportResult](docs/ExportResult.md) - [VoucherifySdk::ExportVoucherTransactionsFields](docs/ExportVoucherTransactionsFields.md) - [VoucherifySdk::ExportVoucherTransactionsFilters](docs/ExportVoucherTransactionsFilters.md) - [VoucherifySdk::ExportVoucherTransactionsOrder](docs/ExportVoucherTransactionsOrder.md) - [VoucherifySdk::ExportsCreateRequestBody](docs/ExportsCreateRequestBody.md) - [VoucherifySdk::ExportsCreateRequestBodyParameters](docs/ExportsCreateRequestBodyParameters.md) - - [VoucherifySdk::ExportsCreateRequestBodyParametersFilters](docs/ExportsCreateRequestBodyParametersFilters.md) - [VoucherifySdk::ExportsCreateResponseBody](docs/ExportsCreateResponseBody.md) - [VoucherifySdk::ExportsCreateResponseBodyParameters](docs/ExportsCreateResponseBodyParameters.md) - - [VoucherifySdk::ExportsCreateResponseBodyParametersFilters](docs/ExportsCreateResponseBodyParametersFilters.md) - [VoucherifySdk::ExportsGetResponseBody](docs/ExportsGetResponseBody.md) - [VoucherifySdk::ExportsGetResponseBodyParameters](docs/ExportsGetResponseBodyParameters.md) - - [VoucherifySdk::ExportsGetResponseBodyParametersFilters](docs/ExportsGetResponseBodyParametersFilters.md) - [VoucherifySdk::ExportsGetResponseBodyResult](docs/ExportsGetResponseBodyResult.md) - [VoucherifySdk::ExportsListResponseBody](docs/ExportsListResponseBody.md) - [VoucherifySdk::FieldConditions](docs/FieldConditions.md) @@ -1547,6 +1550,8 @@ Class | Method | HTTP request | Description - [VoucherifySdk::VouchersBalanceUpdateRequestBody](docs/VouchersBalanceUpdateRequestBody.md) - [VoucherifySdk::VouchersBalanceUpdateResponseBody](docs/VouchersBalanceUpdateResponseBody.md) - [VoucherifySdk::VouchersBalanceUpdateResponseBodyRelatedObject](docs/VouchersBalanceUpdateResponseBodyRelatedObject.md) + - [VoucherifySdk::VouchersCreateRequestBody](docs/VouchersCreateRequestBody.md) + - [VoucherifySdk::VouchersCreateRequestBodyRedemption](docs/VouchersCreateRequestBodyRedemption.md) - [VoucherifySdk::VouchersCreateResponseBody](docs/VouchersCreateResponseBody.md) - [VoucherifySdk::VouchersCreateResponseBodyGift](docs/VouchersCreateResponseBodyGift.md) - [VoucherifySdk::VouchersCreateResponseBodyLoyaltyCard](docs/VouchersCreateResponseBodyLoyaltyCard.md) diff --git a/docs/CampaignsCreateRequestBody.md b/docs/CampaignsCreateRequestBody.md index 27805c5c..35e2cb23 100644 --- a/docs/CampaignsCreateRequestBody.md +++ b/docs/CampaignsCreateRequestBody.md @@ -19,7 +19,7 @@ | **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] | | **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** | | [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] | | **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/CampaignsImportVoucherItem.md b/docs/CampaignsImportVoucherItem.md index a33c547e..0ca20419 100644 --- a/docs/CampaignsImportVoucherItem.md +++ b/docs/CampaignsImportVoucherItem.md @@ -7,7 +7,7 @@ | **code** | **String** | Value representing the imported code. | [optional] | | **redemption** | [**CampaignsImportVoucherItemRedemption**](CampaignsImportVoucherItemRedemption.md) | | [optional] | | **active** | **Boolean** | A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. - `true` indicates an *active* voucher - `false` indicates an *inactive* voucher | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. | [optional] | | **category** | **String** | Tag defining the category that this voucher belongs to. Useful when listing vouchers using the [List Vouchers](ref:list-vouchers) endpoint. | [optional] | | **start_date** | **Time** | Activation timestamp presented in the ISO 8601 format. Voucher is *inactive before* this date. Start date defines when the code starts to be active. Allowed date formats are: - YYYY-MM-DD - YYYY-MM-DDTHH - YYYY-MM-DDTHH:mm - YYYY-MM-DDTHH:mm:ss - YYYY-MM-DDTHH:mm:ssZ - YYYY-MM-DDTHH:mm:ss.SSSZ | [optional] | | **expiration_date** | **Time** | Expiration date defines when the code expires. Expiration timestamp is presented in the ISO 8601 format. Voucher is *inactive after* this date. Allowed date formats are: - YYYY-MM-DD - YYYY-MM-DDTHH - YYYY-MM-DDTHH:mm - YYYY-MM-DDTHH:mm:ss - YYYY-MM-DDTHH:mm:ssZ - YYYY-MM-DDTHH:mm:ss.SSSZ | [optional] | diff --git a/docs/CampaignsUpdateRequestBody.md b/docs/CampaignsUpdateRequestBody.md index 6a18d1bb..618f5a25 100644 --- a/docs/CampaignsUpdateRequestBody.md +++ b/docs/CampaignsUpdateRequestBody.md @@ -11,7 +11,7 @@ | **validity_hours** | [**ValidityHours**](ValidityHours.md) | | [optional] | | **description** | **String** | An optional field to keep any extra textual information about the campaign such as a campaign description and details. | [optional] | | **category** | **String** | The category assigned to the campaign. Either pass this parameter OR the `category_id`. | [optional] | -| **metadata** | **Object** | | [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] | | **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] | | **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] | diff --git a/docs/ClientValidationsValidateResponseBodyRedeemablesItem.md b/docs/ClientValidationsValidateResponseBodyRedeemablesItem.md index a42a8e85..ef84d30d 100644 --- a/docs/ClientValidationsValidateResponseBodyRedeemablesItem.md +++ b/docs/ClientValidationsValidateResponseBodyRedeemablesItem.md @@ -11,6 +11,6 @@ | **applicable_to** | [**ApplicableToResultList**](ApplicableToResultList.md) | | [optional] | | **inapplicable_to** | [**InapplicableToResultList**](InapplicableToResultList.md) | | [optional] | | **result** | [**ClientValidationsValidateResponseBodyRedeemablesItemResult**](ClientValidationsValidateResponseBodyRedeemablesItemResult.md) | | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable. | [optional] | | **categories** | [**Array<CategoryWithStackingRulesType>**](CategoryWithStackingRulesType.md) | | [optional] | diff --git a/docs/ClientValidationsValidateResponseBodyRedeemablesItemResultDetails.md b/docs/ClientValidationsValidateResponseBodyRedeemablesItemResultDetails.md index 6aa32b61..8ce6e2a9 100644 --- a/docs/ClientValidationsValidateResponseBodyRedeemablesItemResultDetails.md +++ b/docs/ClientValidationsValidateResponseBodyRedeemablesItemResultDetails.md @@ -4,6 +4,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **key** | **String** | | [optional] | | **message** | **String** | | [optional] | +| **key** | **String** | | [optional] | diff --git a/docs/Discount.md b/docs/Discount.md index 6dd7efdc..8834b261 100644 --- a/docs/Discount.md +++ b/docs/Discount.md @@ -13,7 +13,7 @@ | **unit_off** | **Integer** | Number of units to be granted a full value discount. | [optional] | | **unit_off_formula** | **String** | | [optional] | | **unit_type** | **String** | The product deemed as free, chosen from product inventory (e.g. time, items). | [optional] | -| **product** | [**SimpleProductDiscountUnit**](SimpleProductDiscountUnit.md) | | [optional] | +| **product** | [**DiscountProduct**](DiscountProduct.md) | | [optional] | | **sku** | [**SimpleSkuDiscountUnit**](SimpleSkuDiscountUnit.md) | | [optional] | | **units** | [**Array<DiscountUnitMultipleOneUnit>**](DiscountUnitMultipleOneUnit.md) | | [optional] | | **percent_off** | **Float** | The percent discount that the customer will receive. | [optional] | diff --git a/docs/DiscountProduct.md b/docs/DiscountProduct.md new file mode 100644 index 00000000..08e793ed --- /dev/null +++ b/docs/DiscountProduct.md @@ -0,0 +1,10 @@ +# VoucherifySdk::DiscountProduct + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique product ID, assigned by Voucherify. | [optional] | +| **source_id** | **String** | Product's source ID. | [optional] | +| **name** | **String** | Product name. | [optional] | + diff --git a/docs/EarningRuleLoyalty.md b/docs/EarningRuleLoyalty.md index 275c1282..89fe4890 100644 --- a/docs/EarningRuleLoyalty.md +++ b/docs/EarningRuleLoyalty.md @@ -5,10 +5,10 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **type** | **String** | | [optional] | +| **points** | **Integer** | Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. | [optional] | | **calculation_type** | **String** | | [optional] | | **order** | [**EarningRuleLoyaltyOrder**](EarningRuleLoyaltyOrder.md) | | [optional] | | **order_items** | [**EarningRuleLoyaltyOrderItems**](EarningRuleLoyaltyOrderItems.md) | | [optional] | | **customer** | [**EarningRuleLoyaltyCustomer**](EarningRuleLoyaltyCustomer.md) | | [optional] | | **custom_event** | [**EarningRuleLoyaltyCustomEvent**](EarningRuleLoyaltyCustomEvent.md) | | [optional] | -| **points** | **Integer** | Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. | [optional] | diff --git a/docs/ExportParameters.md b/docs/ExportParameters.md index fd49a444..277ed861 100644 --- a/docs/ExportParameters.md +++ b/docs/ExportParameters.md @@ -6,5 +6,5 @@ | ---- | ---- | ----------- | ----- | | **order** | **String** | | [optional] | | **fields** | **Array<String>** | Array of strings containing the data in the export. These fields define the headers in the CSV file. | [optional] | -| **filters** | [**ExportParametersFilters**](ExportParametersFilters.md) | | [optional] | +| **filters** | **Object** | Allowed additional properties must start with \"metadata.\" or \"redemption.\" and Allowed additional properties must start with \"metadata.\" and Allowed additional properties must start with \"metadata.\" or \"address.\" or \"summary.\" or \"loyalty.\" or \"loyalty_tier.\" or \"loyalty_points.\" or \"system_metadata.\" | [optional] | diff --git a/docs/ExportParametersFilters.md b/docs/ExportParametersFilters.md deleted file mode 100644 index 66575ee3..00000000 --- a/docs/ExportParametersFilters.md +++ /dev/null @@ -1,11 +0,0 @@ -# VoucherifySdk::ExportParametersFilters - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **junction** | [**Junction**](Junction.md) | | [optional] | -| **campaign_id** | [**FieldConditions**](FieldConditions.md) | | [optional] | -| **voucher_id** | [**FieldConditions**](FieldConditions.md) | | [optional] | -| **created_at** | [**FieldConditions**](FieldConditions.md) | | [optional] | - diff --git a/docs/ExportsCreateRequestBodyParameters.md b/docs/ExportsCreateRequestBodyParameters.md index 658cf29b..fda36b81 100644 --- a/docs/ExportsCreateRequestBodyParameters.md +++ b/docs/ExportsCreateRequestBodyParameters.md @@ -6,5 +6,5 @@ | ---- | ---- | ----------- | ----- | | **order** | **String** | | [optional] | | **fields** | **Array<String>** | Array of strings containing the data in the export. These fields define the headers in the CSV file. | [optional] | -| **filters** | [**ExportsCreateRequestBodyParametersFilters**](ExportsCreateRequestBodyParametersFilters.md) | | [optional] | +| **filters** | **Object** | Allowed additional properties must start with \"metadata.\" or \"redemption.\" and Allowed additional properties must start with \"metadata.\" and Allowed additional properties must start with \"metadata.\" or \"address.\" or \"summary.\" or \"loyalty.\" or \"loyalty_tier.\" or \"loyalty_points.\" or \"system_metadata.\" | [optional] | diff --git a/docs/ExportsCreateRequestBodyParametersFilters.md b/docs/ExportsCreateRequestBodyParametersFilters.md deleted file mode 100644 index 3667cdf3..00000000 --- a/docs/ExportsCreateRequestBodyParametersFilters.md +++ /dev/null @@ -1,11 +0,0 @@ -# VoucherifySdk::ExportsCreateRequestBodyParametersFilters - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **junction** | [**Junction**](Junction.md) | | [optional] | -| **campaign_id** | [**FieldConditions**](FieldConditions.md) | | [optional] | -| **voucher_id** | [**FieldConditions**](FieldConditions.md) | | [optional] | -| **created_at** | [**FieldConditions**](FieldConditions.md) | | [optional] | - diff --git a/docs/ExportsCreateResponseBodyParameters.md b/docs/ExportsCreateResponseBodyParameters.md index bb86e280..f5450e58 100644 --- a/docs/ExportsCreateResponseBodyParameters.md +++ b/docs/ExportsCreateResponseBodyParameters.md @@ -6,5 +6,5 @@ | ---- | ---- | ----------- | ----- | | **order** | **String** | | [optional] | | **fields** | **Array<String>** | Array of strings containing the data in the export. These fields define the headers in the CSV file. | [optional] | -| **filters** | [**ExportsCreateResponseBodyParametersFilters**](ExportsCreateResponseBodyParametersFilters.md) | | [optional] | +| **filters** | **Object** | Allowed additional properties must start with \"metadata.\" or \"redemption.\" and Allowed additional properties must start with \"metadata.\" and Allowed additional properties must start with \"metadata.\" or \"address.\" or \"summary.\" or \"loyalty.\" or \"loyalty_tier.\" or \"loyalty_points.\" or \"system_metadata.\" | [optional] | diff --git a/docs/ExportsCreateResponseBodyParametersFilters.md b/docs/ExportsCreateResponseBodyParametersFilters.md deleted file mode 100644 index e647aacb..00000000 --- a/docs/ExportsCreateResponseBodyParametersFilters.md +++ /dev/null @@ -1,11 +0,0 @@ -# VoucherifySdk::ExportsCreateResponseBodyParametersFilters - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **junction** | [**Junction**](Junction.md) | | [optional] | -| **campaign_id** | [**FieldConditions**](FieldConditions.md) | | [optional] | -| **voucher_id** | [**FieldConditions**](FieldConditions.md) | | [optional] | -| **created_at** | [**FieldConditions**](FieldConditions.md) | | [optional] | - diff --git a/docs/ExportsGetResponseBodyParameters.md b/docs/ExportsGetResponseBodyParameters.md index 1b1e7aa6..a7b0ad78 100644 --- a/docs/ExportsGetResponseBodyParameters.md +++ b/docs/ExportsGetResponseBodyParameters.md @@ -6,5 +6,5 @@ | ---- | ---- | ----------- | ----- | | **order** | **String** | | [optional] | | **fields** | **Array<String>** | Array of strings containing the data in the export. These fields define the headers in the CSV file. | [optional] | -| **filters** | [**ExportsGetResponseBodyParametersFilters**](ExportsGetResponseBodyParametersFilters.md) | | [optional] | +| **filters** | **Object** | Allowed additional properties must start with \"metadata.\" or \"redemption.\" and Allowed additional properties must start with \"metadata.\" and Allowed additional properties must start with \"metadata.\" or \"address.\" or \"summary.\" or \"loyalty.\" or \"loyalty_tier.\" or \"loyalty_points.\" or \"system_metadata.\" | [optional] | diff --git a/docs/ExportsGetResponseBodyParametersFilters.md b/docs/ExportsGetResponseBodyParametersFilters.md deleted file mode 100644 index 19b59729..00000000 --- a/docs/ExportsGetResponseBodyParametersFilters.md +++ /dev/null @@ -1,11 +0,0 @@ -# VoucherifySdk::ExportsGetResponseBodyParametersFilters - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **junction** | [**Junction**](Junction.md) | | [optional] | -| **campaign_id** | [**FieldConditions**](FieldConditions.md) | | [optional] | -| **voucher_id** | [**FieldConditions**](FieldConditions.md) | | [optional] | -| **created_at** | [**FieldConditions**](FieldConditions.md) | | [optional] | - diff --git a/docs/LoyaltiesEarningRulesCreateRequestBodyItem.md b/docs/LoyaltiesEarningRulesCreateRequestBodyItem.md index ea3fc8d0..29754d35 100644 --- a/docs/LoyaltiesEarningRulesCreateRequestBodyItem.md +++ b/docs/LoyaltiesEarningRulesCreateRequestBodyItem.md @@ -14,7 +14,7 @@ | **validity_timeframe** | [**ValidityTimeframe**](ValidityTimeframe.md) | | [optional] | | **validity_day_of_week** | **Array<Integer>** | Integer array corresponding to the particular days of the week in which the voucher is valid. - `0` Sunday - `1` Monday - `2` Tuesday - `3` Wednesday - `4` Thursday - `5` Friday - `6` Saturday | [optional] | | **validity_hours** | [**ValidityHours**](ValidityHours.md) | | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format. | [optional] | | **segment** | [**LoyaltiesEarningRulesCreateRequestBodyItemSegment**](LoyaltiesEarningRulesCreateRequestBodyItemSegment.md) | | [optional] | | **custom_event** | [**LoyaltiesEarningRulesCreateRequestBodyItemCustomEvent**](LoyaltiesEarningRulesCreateRequestBodyItemCustomEvent.md) | | [optional] | | **loyalty_tier** | [**LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyTier**](LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyTier.md) | | [optional] | diff --git a/docs/LoyaltiesEarningRulesCreateRequestBodyItemLoyalty.md b/docs/LoyaltiesEarningRulesCreateRequestBodyItemLoyalty.md index 6f186836..24b5ad50 100644 --- a/docs/LoyaltiesEarningRulesCreateRequestBodyItemLoyalty.md +++ b/docs/LoyaltiesEarningRulesCreateRequestBodyItemLoyalty.md @@ -7,8 +7,8 @@ | **type** | **String** | | [optional] | | **points** | **Integer** | Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. | [optional] | | **calculation_type** | **String** | | [optional] | -| **custom_event** | [**LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyCustomEvent**](LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyCustomEvent.md) | | [optional] | -| **order_items** | [**LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyOrderItems**](LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyOrderItems.md) | | [optional] | | **order** | [**LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyOrder**](LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyOrder.md) | | [optional] | +| **order_items** | [**LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyOrderItems**](LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyOrderItems.md) | | [optional] | | **customer** | [**LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyCustomer**](LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyCustomer.md) | | [optional] | +| **custom_event** | [**LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyCustomEvent**](LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyCustomEvent.md) | | [optional] | diff --git a/docs/LoyaltiesEarningRulesCreateResponseBodyLoyalty.md b/docs/LoyaltiesEarningRulesCreateResponseBodyLoyalty.md index 4390ce29..325c0512 100644 --- a/docs/LoyaltiesEarningRulesCreateResponseBodyLoyalty.md +++ b/docs/LoyaltiesEarningRulesCreateResponseBodyLoyalty.md @@ -5,10 +5,10 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **type** | **String** | | [optional] | +| **points** | **Integer** | Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. | [optional] | | **calculation_type** | **String** | | [optional] | | **order** | [**LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrder**](LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrder.md) | | [optional] | | **order_items** | [**LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrderItems**](LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrderItems.md) | | [optional] | | **customer** | [**LoyaltiesEarningRulesCreateResponseBodyLoyaltyCustomer**](LoyaltiesEarningRulesCreateResponseBodyLoyaltyCustomer.md) | | [optional] | | **custom_event** | [**LoyaltiesEarningRulesCreateResponseBodyLoyaltyCustomEvent**](LoyaltiesEarningRulesCreateResponseBodyLoyaltyCustomEvent.md) | | [optional] | -| **points** | **Integer** | Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. | [optional] | diff --git a/docs/LoyaltiesEarningRulesDisableResponseBodyLoyalty.md b/docs/LoyaltiesEarningRulesDisableResponseBodyLoyalty.md index c6946cfc..b7b86950 100644 --- a/docs/LoyaltiesEarningRulesDisableResponseBodyLoyalty.md +++ b/docs/LoyaltiesEarningRulesDisableResponseBodyLoyalty.md @@ -5,10 +5,10 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **type** | **String** | | [optional] | +| **points** | **Integer** | Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. | [optional] | | **calculation_type** | **String** | | [optional] | | **order** | [**LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrder**](LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrder.md) | | [optional] | | **order_items** | [**LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrderItems**](LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrderItems.md) | | [optional] | | **customer** | [**LoyaltiesEarningRulesDisableResponseBodyLoyaltyCustomer**](LoyaltiesEarningRulesDisableResponseBodyLoyaltyCustomer.md) | | [optional] | | **custom_event** | [**LoyaltiesEarningRulesDisableResponseBodyLoyaltyCustomEvent**](LoyaltiesEarningRulesDisableResponseBodyLoyaltyCustomEvent.md) | | [optional] | -| **points** | **Integer** | Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. | [optional] | diff --git a/docs/LoyaltiesEarningRulesEnableResponseBodyLoyalty.md b/docs/LoyaltiesEarningRulesEnableResponseBodyLoyalty.md index 0a64fcf6..f9536c79 100644 --- a/docs/LoyaltiesEarningRulesEnableResponseBodyLoyalty.md +++ b/docs/LoyaltiesEarningRulesEnableResponseBodyLoyalty.md @@ -5,10 +5,10 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **type** | **String** | | [optional] | +| **points** | **Integer** | Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. | [optional] | | **calculation_type** | **String** | | [optional] | | **order** | [**LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrder**](LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrder.md) | | [optional] | | **order_items** | [**LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrderItems**](LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrderItems.md) | | [optional] | | **customer** | [**LoyaltiesEarningRulesEnableResponseBodyLoyaltyCustomer**](LoyaltiesEarningRulesEnableResponseBodyLoyaltyCustomer.md) | | [optional] | | **custom_event** | [**LoyaltiesEarningRulesEnableResponseBodyLoyaltyCustomEvent**](LoyaltiesEarningRulesEnableResponseBodyLoyaltyCustomEvent.md) | | [optional] | -| **points** | **Integer** | Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. | [optional] | diff --git a/docs/LoyaltiesEarningRulesGetResponseBodyLoyalty.md b/docs/LoyaltiesEarningRulesGetResponseBodyLoyalty.md index 1481ea17..d32f60dc 100644 --- a/docs/LoyaltiesEarningRulesGetResponseBodyLoyalty.md +++ b/docs/LoyaltiesEarningRulesGetResponseBodyLoyalty.md @@ -5,10 +5,10 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **type** | **String** | | [optional] | +| **points** | **Integer** | Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. | [optional] | | **calculation_type** | **String** | | [optional] | | **order** | [**LoyaltiesEarningRulesGetResponseBodyLoyaltyOrder**](LoyaltiesEarningRulesGetResponseBodyLoyaltyOrder.md) | | [optional] | | **order_items** | [**LoyaltiesEarningRulesGetResponseBodyLoyaltyOrderItems**](LoyaltiesEarningRulesGetResponseBodyLoyaltyOrderItems.md) | | [optional] | | **customer** | [**LoyaltiesEarningRulesGetResponseBodyLoyaltyCustomer**](LoyaltiesEarningRulesGetResponseBodyLoyaltyCustomer.md) | | [optional] | | **custom_event** | [**LoyaltiesEarningRulesGetResponseBodyLoyaltyCustomEvent**](LoyaltiesEarningRulesGetResponseBodyLoyaltyCustomEvent.md) | | [optional] | -| **points** | **Integer** | Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. | [optional] | diff --git a/docs/LoyaltiesEarningRulesUpdateRequestBodyLoyalty.md b/docs/LoyaltiesEarningRulesUpdateRequestBodyLoyalty.md index e9485d91..73beed59 100644 --- a/docs/LoyaltiesEarningRulesUpdateRequestBodyLoyalty.md +++ b/docs/LoyaltiesEarningRulesUpdateRequestBodyLoyalty.md @@ -5,10 +5,10 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **type** | **String** | | [optional] | +| **points** | **Integer** | Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. | [optional] | | **calculation_type** | **String** | | [optional] | | **order** | [**LoyaltiesEarningRulesUpdateRequestBodyLoyaltyOrder**](LoyaltiesEarningRulesUpdateRequestBodyLoyaltyOrder.md) | | [optional] | | **order_items** | [**LoyaltiesEarningRulesUpdateRequestBodyLoyaltyOrderItems**](LoyaltiesEarningRulesUpdateRequestBodyLoyaltyOrderItems.md) | | [optional] | | **customer** | [**LoyaltiesEarningRulesUpdateRequestBodyLoyaltyCustomer**](LoyaltiesEarningRulesUpdateRequestBodyLoyaltyCustomer.md) | | [optional] | | **custom_event** | [**LoyaltiesEarningRulesUpdateRequestBodyLoyaltyCustomEvent**](LoyaltiesEarningRulesUpdateRequestBodyLoyaltyCustomEvent.md) | | [optional] | -| **points** | **Integer** | Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. | [optional] | diff --git a/docs/LoyaltiesEarningRulesUpdateResponseBodyLoyalty.md b/docs/LoyaltiesEarningRulesUpdateResponseBodyLoyalty.md index c6f2b127..63b384c6 100644 --- a/docs/LoyaltiesEarningRulesUpdateResponseBodyLoyalty.md +++ b/docs/LoyaltiesEarningRulesUpdateResponseBodyLoyalty.md @@ -5,10 +5,10 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **type** | **String** | | [optional] | +| **points** | **Integer** | Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. | [optional] | | **calculation_type** | **String** | | [optional] | | **order** | [**LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrder**](LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrder.md) | | [optional] | | **order_items** | [**LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrderItems**](LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrderItems.md) | | [optional] | | **customer** | [**LoyaltiesEarningRulesUpdateResponseBodyLoyaltyCustomer**](LoyaltiesEarningRulesUpdateResponseBodyLoyaltyCustomer.md) | | [optional] | | **custom_event** | [**LoyaltiesEarningRulesUpdateResponseBodyLoyaltyCustomEvent**](LoyaltiesEarningRulesUpdateResponseBodyLoyaltyCustomEvent.md) | | [optional] | -| **points** | **Integer** | Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. | [optional] | diff --git a/docs/ProductCollectionsProductsListResponseBodyDataItem.md b/docs/ProductCollectionsProductsListResponseBodyDataItem.md index d4b9aef6..2ef0e561 100644 --- a/docs/ProductCollectionsProductsListResponseBodyDataItem.md +++ b/docs/ProductCollectionsProductsListResponseBodyDataItem.md @@ -9,7 +9,7 @@ | **name** | **String** | Unique user-defined product name. | [optional] | | **price** | **Integer** | Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as `$100.00` being expressed as `10000`. | [optional] | | **attributes** | **Array<String>** | A list of product attributes whose values you can customize for given SKUs: `[\"color\",\"size\",\"ranking\"]`. Each child SKU can have a unique value for a given attribute. | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the product. A set of key/value pairs that you can attach to a product object. It can be useful for storing additional information about the product in a structured format. and The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format. | [optional] | | **image_url** | **String** | | [optional] | | **created_at** | **String** | | [optional] | | **updated_at** | **String** | | [optional] | diff --git a/docs/PublicationsCreateRequestBody.md b/docs/PublicationsCreateRequestBody.md index 20da9f49..13d05f47 100644 --- a/docs/PublicationsCreateRequestBody.md +++ b/docs/PublicationsCreateRequestBody.md @@ -7,7 +7,7 @@ | **voucher** | **String** | Code of the voucher being published. | [optional] | | **source_id** | **String** | The merchant's publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. If `source_id` is provided only 1 voucher can be published per request. | [optional] | | **customer** | [**Customer**](Customer.md) | | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format. | [optional] | | **channel** | **String** | Specify the distribution channel. | [optional] | | **campaign** | [**CreatePublicationCampaign**](CreatePublicationCampaign.md) | | [optional] | diff --git a/docs/PublicationsCreateResponseBody.md b/docs/PublicationsCreateResponseBody.md index d63901e0..a5b79854 100644 --- a/docs/PublicationsCreateResponseBody.md +++ b/docs/PublicationsCreateResponseBody.md @@ -9,7 +9,7 @@ | **created_at** | **Time** | Timestamp representing the date and time when the publication was created. The value is shown in the ISO 8601 format. | [optional] | | **customer_id** | **String** | Unique customer ID of the customer receiving the publication. | [optional] | | **tracking_id** | **String** | Customer's `source_id`. | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format. | [optional] | | **channel** | **String** | How the publication was originated. It can be your own custom channel or an example value provided here. | [optional][default to 'API'] | | **source_id** | **String** | The merchant's publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. | [optional] | | **result** | **String** | Status of the publication attempt. | [optional][default to 'SUCCESS'] | diff --git a/docs/RedemptionEntry.md b/docs/RedemptionEntry.md index 95e536f8..2e56d9fd 100644 --- a/docs/RedemptionEntry.md +++ b/docs/RedemptionEntry.md @@ -9,7 +9,7 @@ | **date** | **Time** | Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format. | [optional] | | **customer_id** | **String** | Unique customer ID of the redeeming customer. | [optional] | | **tracking_id** | **String** | Hashed customer source ID. | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the redemption. | [optional] | | **amount** | **Integer** | For gift cards, this is a positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the number of redeemed credits. For loyalty cards, this is the number of loyalty points used in the transaction. and For gift cards, this represents the number of the credits restored to the card in the rolledback redemption. The number is a negative integer in the smallest currency unit, e.g. -100 cents for $1.00 added back to the card. For loyalty cards, this represents the number of loyalty points restored to the card in the rolledback redemption. The number is a negative integer. | [optional] | | **redemption** | **String** | Unique redemption ID of the parent redemption. | [optional] | | **result** | **String** | Redemption result. | [optional] | diff --git a/docs/RedemptionEntryCustomer.md b/docs/RedemptionEntryCustomer.md index 24bc1259..d815fbf0 100644 --- a/docs/RedemptionEntryCustomer.md +++ b/docs/RedemptionEntryCustomer.md @@ -8,6 +8,6 @@ | **name** | **String** | Customer's first and last name. | [optional] | | **email** | **String** | Customer's email address. | [optional] | | **source_id** | **String** | A unique identifier of the customer. It can be a customer ID or email from a CRM system, database, or a third-party service. | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | A set of custom key/value pairs that are attached to the customer. It stores all custom attributes assigned to the customer. | [optional] | | **object** | **String** | The type of the object represented by JSON. | [optional][default to 'customer'] | diff --git a/docs/RedemptionEntryOrder.md b/docs/RedemptionEntryOrder.md index 1d6c4484..a26b6200 100644 --- a/docs/RedemptionEntryOrder.md +++ b/docs/RedemptionEntryOrder.md @@ -17,7 +17,7 @@ | **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] | -| **metadata** | **Object** | | [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. | [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] | @@ -25,5 +25,5 @@ | **referrer_id** | **String** | Unique referrer ID. | [optional] | | **customer** | [**RedemptionEntryOrderCustomer**](RedemptionEntryOrderCustomer.md) | | [optional] | | **referrer** | [**RedemptionEntryOrderReferrer**](RedemptionEntryOrderReferrer.md) | | [optional] | -| **redemptions** | **Object** | | [optional] | +| **redemptions** | [**Hash<String, OrderRedemptionsEntry>**](OrderRedemptionsEntry.md) | | [optional] | diff --git a/docs/RedemptionEntryPromotionTier.md b/docs/RedemptionEntryPromotionTier.md index 16e8ba34..30ca97b8 100644 --- a/docs/RedemptionEntryPromotionTier.md +++ b/docs/RedemptionEntryPromotionTier.md @@ -10,7 +10,7 @@ | **name** | **String** | Name of the promotion tier. | [optional] | | **banner** | **String** | Text to be displayed to your customers on your website. | [optional] | | **action** | [**RedemptionEntryPromotionTierAction**](RedemptionEntryPromotionTierAction.md) | | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format. | [optional] | | **hierarchy** | **Integer** | The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy. | [optional] | | **promotion_id** | **String** | Promotion unique ID. | [optional] | | **campaign** | [**RedemptionEntryPromotionTierCampaign**](RedemptionEntryPromotionTierCampaign.md) | | [optional] | diff --git a/docs/RedemptionEntryVoucher.md b/docs/RedemptionEntryVoucher.md index fdab5639..90978a9c 100644 --- a/docs/RedemptionEntryVoucher.md +++ b/docs/RedemptionEntryVoucher.md @@ -21,7 +21,7 @@ | **validity_hours** | [**ValidityHours**](ValidityHours.md) | | [optional] | | **active** | **Boolean** | A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. - `true` indicates an *active* voucher - `false` indicates an *inactive* voucher | [optional] | | **additional_info** | **String** | An optional field to keep any extra textual information about the code such as a code description and details. | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. | [optional] | | **assets** | [**VoucherAssets**](VoucherAssets.md) | | [optional] | | **is_referral_code** | **Boolean** | Flag indicating whether this voucher is a referral code; `true` for campaign type `REFERRAL_PROGRAM`. | [optional] | | **created_at** | **Time** | Timestamp representing the date and time when the voucher was created. The value is shown in the ISO 8601 format. | [optional] | diff --git a/docs/RedemptionsGetResponseBody.md b/docs/RedemptionsGetResponseBody.md index 4e78447f..7779ac6c 100644 --- a/docs/RedemptionsGetResponseBody.md +++ b/docs/RedemptionsGetResponseBody.md @@ -9,7 +9,7 @@ | **date** | **Time** | Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format. | [optional] | | **customer_id** | **String** | Unique customer ID of the redeeming customer. | [optional] | | **tracking_id** | **String** | Hashed customer source ID. | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the redemption. | [optional] | | **amount** | **Integer** | For gift cards, this is a positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the number of redeemed credits. For loyalty cards, this is the number of loyalty points used in the transaction. and For gift cards, this represents the number of the credits restored to the card in the rolledback redemption. The number is a negative integer in the smallest currency unit, e.g. -100 cents for $1.00 added back to the card. For loyalty cards, this represents the number of loyalty points restored to the card in the rolledback redemption. The number is a negative integer. | [optional] | | **redemption** | **String** | Unique redemption ID of the parent redemption. | [optional] | | **result** | **String** | Redemption result. | [optional] | diff --git a/docs/RedemptionsGetResponseBodyCustomer.md b/docs/RedemptionsGetResponseBodyCustomer.md index 295e8d11..cc508a03 100644 --- a/docs/RedemptionsGetResponseBodyCustomer.md +++ b/docs/RedemptionsGetResponseBodyCustomer.md @@ -8,6 +8,6 @@ | **name** | **String** | Customer's first and last name. | [optional] | | **email** | **String** | Customer's email address. | [optional] | | **source_id** | **String** | A unique identifier of the customer. It can be a customer ID or email from a CRM system, database, or a third-party service. | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | A set of custom key/value pairs that are attached to the customer. It stores all custom attributes assigned to the customer. | [optional] | | **object** | **String** | The type of the object represented by JSON. | [optional][default to 'customer'] | diff --git a/docs/RedemptionsGetResponseBodyOrder.md b/docs/RedemptionsGetResponseBodyOrder.md index cd8e280f..dcbdd4db 100644 --- a/docs/RedemptionsGetResponseBodyOrder.md +++ b/docs/RedemptionsGetResponseBodyOrder.md @@ -17,7 +17,7 @@ | **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] | -| **metadata** | **Object** | | [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. | [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] | @@ -25,5 +25,5 @@ | **referrer_id** | **String** | Unique referrer ID. | [optional] | | **customer** | [**RedemptionsGetResponseBodyOrderCustomer**](RedemptionsGetResponseBodyOrderCustomer.md) | | [optional] | | **referrer** | [**RedemptionsGetResponseBodyOrderReferrer**](RedemptionsGetResponseBodyOrderReferrer.md) | | [optional] | -| **redemptions** | **Object** | | [optional] | +| **redemptions** | [**Hash<String, OrderRedemptionsEntry>**](OrderRedemptionsEntry.md) | | [optional] | diff --git a/docs/RedemptionsGetResponseBodyPromotionTier.md b/docs/RedemptionsGetResponseBodyPromotionTier.md index 44713ddc..8cff6fad 100644 --- a/docs/RedemptionsGetResponseBodyPromotionTier.md +++ b/docs/RedemptionsGetResponseBodyPromotionTier.md @@ -10,7 +10,7 @@ | **name** | **String** | Name of the promotion tier. | [optional] | | **banner** | **String** | Text to be displayed to your customers on your website. | [optional] | | **action** | [**RedemptionsGetResponseBodyPromotionTierAction**](RedemptionsGetResponseBodyPromotionTierAction.md) | | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format. | [optional] | | **hierarchy** | **Integer** | The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy. | [optional] | | **promotion_id** | **String** | Promotion unique ID. | [optional] | | **campaign** | [**RedemptionsGetResponseBodyPromotionTierCampaign**](RedemptionsGetResponseBodyPromotionTierCampaign.md) | | [optional] | diff --git a/docs/RedemptionsGetResponseBodyVoucher.md b/docs/RedemptionsGetResponseBodyVoucher.md index 8451c9e3..4306c4c2 100644 --- a/docs/RedemptionsGetResponseBodyVoucher.md +++ b/docs/RedemptionsGetResponseBodyVoucher.md @@ -21,7 +21,7 @@ | **validity_hours** | [**ValidityHours**](ValidityHours.md) | | [optional] | | **active** | **Boolean** | A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. - `true` indicates an *active* voucher - `false` indicates an *inactive* voucher | [optional] | | **additional_info** | **String** | An optional field to keep any extra textual information about the code such as a code description and details. | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. | [optional] | | **assets** | [**VoucherAssets**](VoucherAssets.md) | | [optional] | | **is_referral_code** | **Boolean** | Flag indicating whether this voucher is a referral code; `true` for campaign type `REFERRAL_PROGRAM`. | [optional] | | **created_at** | **Time** | Timestamp representing the date and time when the voucher was created. The value is shown in the ISO 8601 format. | [optional] | diff --git a/docs/RedemptionsListResponseBodyRedemptionsItem.md b/docs/RedemptionsListResponseBodyRedemptionsItem.md index 7bf94fab..3d4efef9 100644 --- a/docs/RedemptionsListResponseBodyRedemptionsItem.md +++ b/docs/RedemptionsListResponseBodyRedemptionsItem.md @@ -9,7 +9,7 @@ | **date** | **Time** | Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format. | [optional] | | **customer_id** | **String** | Unique customer ID of the redeeming customer. | [optional] | | **tracking_id** | **String** | Hashed customer source ID. | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the redemption. | [optional] | | **amount** | **Integer** | For gift cards, this is a positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the number of redeemed credits. For loyalty cards, this is the number of loyalty points used in the transaction. and For gift cards, this represents the number of the credits restored to the card in the rolledback redemption. The number is a negative integer in the smallest currency unit, e.g. -100 cents for $1.00 added back to the card. For loyalty cards, this represents the number of loyalty points restored to the card in the rolledback redemption. The number is a negative integer. | [optional] | | **redemption** | **String** | Unique redemption ID of the parent redemption. | [optional] | | **result** | **String** | Redemption result. | [optional] | diff --git a/docs/RedemptionsListResponseBodyRedemptionsItemCustomer.md b/docs/RedemptionsListResponseBodyRedemptionsItemCustomer.md index 125d2bf6..6f3e3ef4 100644 --- a/docs/RedemptionsListResponseBodyRedemptionsItemCustomer.md +++ b/docs/RedemptionsListResponseBodyRedemptionsItemCustomer.md @@ -8,6 +8,6 @@ | **name** | **String** | Customer's first and last name. | [optional] | | **email** | **String** | Customer's email address. | [optional] | | **source_id** | **String** | A unique identifier of the customer. It can be a customer ID or email from a CRM system, database, or a third-party service. | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | A set of custom key/value pairs that are attached to the customer. It stores all custom attributes assigned to the customer. | [optional] | | **object** | **String** | The type of the object represented by JSON. | [optional][default to 'customer'] | diff --git a/docs/RedemptionsListResponseBodyRedemptionsItemOrder.md b/docs/RedemptionsListResponseBodyRedemptionsItemOrder.md index b78e634b..081c8379 100644 --- a/docs/RedemptionsListResponseBodyRedemptionsItemOrder.md +++ b/docs/RedemptionsListResponseBodyRedemptionsItemOrder.md @@ -17,7 +17,7 @@ | **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] | -| **metadata** | **Object** | | [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. | [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] | @@ -25,5 +25,5 @@ | **referrer_id** | **String** | Unique referrer ID. | [optional] | | **customer** | [**RedemptionsListResponseBodyRedemptionsItemOrderCustomer**](RedemptionsListResponseBodyRedemptionsItemOrderCustomer.md) | | [optional] | | **referrer** | [**RedemptionsListResponseBodyRedemptionsItemOrderReferrer**](RedemptionsListResponseBodyRedemptionsItemOrderReferrer.md) | | [optional] | -| **redemptions** | **Object** | | [optional] | +| **redemptions** | [**Hash<String, OrderRedemptionsEntry>**](OrderRedemptionsEntry.md) | | [optional] | diff --git a/docs/RedemptionsListResponseBodyRedemptionsItemPromotionTier.md b/docs/RedemptionsListResponseBodyRedemptionsItemPromotionTier.md index 48634d09..c1477ef4 100644 --- a/docs/RedemptionsListResponseBodyRedemptionsItemPromotionTier.md +++ b/docs/RedemptionsListResponseBodyRedemptionsItemPromotionTier.md @@ -10,7 +10,7 @@ | **name** | **String** | Name of the promotion tier. | [optional] | | **banner** | **String** | Text to be displayed to your customers on your website. | [optional] | | **action** | [**RedemptionsListResponseBodyRedemptionsItemPromotionTierAction**](RedemptionsListResponseBodyRedemptionsItemPromotionTierAction.md) | | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format. | [optional] | | **hierarchy** | **Integer** | The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy. | [optional] | | **promotion_id** | **String** | Promotion unique ID. | [optional] | | **campaign** | [**RedemptionsListResponseBodyRedemptionsItemPromotionTierCampaign**](RedemptionsListResponseBodyRedemptionsItemPromotionTierCampaign.md) | | [optional] | diff --git a/docs/RedemptionsListResponseBodyRedemptionsItemVoucher.md b/docs/RedemptionsListResponseBodyRedemptionsItemVoucher.md index 07c604c5..91d6d59a 100644 --- a/docs/RedemptionsListResponseBodyRedemptionsItemVoucher.md +++ b/docs/RedemptionsListResponseBodyRedemptionsItemVoucher.md @@ -21,7 +21,7 @@ | **validity_hours** | [**ValidityHours**](ValidityHours.md) | | [optional] | | **active** | **Boolean** | A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. - `true` indicates an *active* voucher - `false` indicates an *inactive* voucher | [optional] | | **additional_info** | **String** | An optional field to keep any extra textual information about the code such as a code description and details. | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. | [optional] | | **assets** | [**VoucherAssets**](VoucherAssets.md) | | [optional] | | **is_referral_code** | **Boolean** | Flag indicating whether this voucher is a referral code; `true` for campaign type `REFERRAL_PROGRAM`. | [optional] | | **created_at** | **Time** | Timestamp representing the date and time when the voucher was created. The value is shown in the ISO 8601 format. | [optional] | diff --git a/docs/RewardsCreateRequestBody.md b/docs/RewardsCreateRequestBody.md index f788416e..d9ddada4 100644 --- a/docs/RewardsCreateRequestBody.md +++ b/docs/RewardsCreateRequestBody.md @@ -6,7 +6,7 @@ | ---- | ---- | ----------- | ----- | | **name** | **String** | Reward name. | [optional] | | **parameters** | [**RewardsCreateRequestBodyParameters**](RewardsCreateRequestBodyParameters.md) | | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the reward. A set of key/value pairs that you can attach to a reward object. It can be useful for storing additional information about the reward in a structured format. | [optional] | | **stock** | **Integer** | The number of units of the product that you want to share as a reward. | [optional] | | **attributes** | [**RewardsCreateRequestBodyAttributes**](RewardsCreateRequestBodyAttributes.md) | | [optional] | diff --git a/docs/RewardsUpdateRequestBody.md b/docs/RewardsUpdateRequestBody.md index a2effeb6..13b9eb83 100644 --- a/docs/RewardsUpdateRequestBody.md +++ b/docs/RewardsUpdateRequestBody.md @@ -6,7 +6,7 @@ | ---- | ---- | ----------- | ----- | | **name** | **String** | Reward name. | [optional] | | **parameters** | [**RewardsUpdateRequestBodyParameters**](RewardsUpdateRequestBodyParameters.md) | | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the reward. A set of key/value pairs that you can attach to a reward object. It can be useful for storing additional information about the reward in a structured format. | [optional] | | **stock** | **Integer** | The number of units of the product that you want to share as a reward. | [optional] | | **attributes** | [**RewardsUpdateRequestBodyAttributes**](RewardsUpdateRequestBodyAttributes.md) | | [optional] | diff --git a/docs/ValidationsValidateResponseBodyRedeemablesItem.md b/docs/ValidationsValidateResponseBodyRedeemablesItem.md index 75797936..3b489dc4 100644 --- a/docs/ValidationsValidateResponseBodyRedeemablesItem.md +++ b/docs/ValidationsValidateResponseBodyRedeemablesItem.md @@ -11,6 +11,6 @@ | **applicable_to** | [**ApplicableToResultList**](ApplicableToResultList.md) | | [optional] | | **inapplicable_to** | [**InapplicableToResultList**](InapplicableToResultList.md) | | [optional] | | **result** | [**ValidationsValidateResponseBodyRedeemablesItemResult**](ValidationsValidateResponseBodyRedeemablesItemResult.md) | | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable. | [optional] | | **categories** | [**Array<CategoryWithStackingRulesType>**](CategoryWithStackingRulesType.md) | | [optional] | diff --git a/docs/ValidationsValidateResponseBodyRedeemablesItemResultDetails.md b/docs/ValidationsValidateResponseBodyRedeemablesItemResultDetails.md index b5271414..3bc20b2c 100644 --- a/docs/ValidationsValidateResponseBodyRedeemablesItemResultDetails.md +++ b/docs/ValidationsValidateResponseBodyRedeemablesItemResultDetails.md @@ -4,6 +4,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **key** | **String** | | [optional] | | **message** | **String** | | [optional] | +| **key** | **String** | | [optional] | diff --git a/docs/VouchersApi.md b/docs/VouchersApi.md index f66ecf9f..dc698633 100644 --- a/docs/VouchersApi.md +++ b/docs/VouchersApi.md @@ -351,7 +351,7 @@ end api_instance = VoucherifySdk::VouchersApi.new opts = { - body: { ... } # Object | Specify the details of the voucher that you would like to create. + vouchers_create_request_body: VoucherifySdk::VouchersCreateRequestBody.new # VouchersCreateRequestBody | Specify the details of the voucher that you would like to create. } begin @@ -367,7 +367,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **body** | **Object** | Specify the details of the voucher that you would like to create. | [optional] | +| **vouchers_create_request_body** | [**VouchersCreateRequestBody**](VouchersCreateRequestBody.md) | Specify the details of the voucher that you would like to create. | [optional] | ### Return type diff --git a/docs/VouchersCreateRequestBody.md b/docs/VouchersCreateRequestBody.md new file mode 100644 index 00000000..3b2fa726 --- /dev/null +++ b/docs/VouchersCreateRequestBody.md @@ -0,0 +1,27 @@ +# VoucherifySdk::VouchersCreateRequestBody + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **code** | **String** | Code that identifies a voucher. The pattern can use all the letters of the English alphabet, Arabic numerals, and special characters. Pass this attribute in the request body to create a distinct code. Otherwise, either use the `code_config` object to set the rules that the Voucherify API will use to create a random code, or don't pass any code and Voucherify will generate a random code. | [optional] | +| **campaign** | **String** | Identifies the voucher's parent campaign using a unique campaign name. | [optional] | +| **campaign_id** | **String** | Identifies the voucher's parent campaign using a unique campaign ID assigned by the Voucherify API. | [optional] | +| **category** | **String** | The name of the category that this voucher belongs to. Useful when listing vouchers with the [List Vouchers](ref:list-vouchers) endpoint. | [optional] | +| **category_id** | **String** | Unique identifier assigned by Voucherify to the name of the category that this voucher belongs to. Useful when listing vouchers with the [List Vouchers](ref:list-vouchers) endpoint. | [optional] | +| **start_date** | **Time** | Start date defines when the code starts to be active. Activation timestamp is presented in the ISO 8601 format. Voucher is *inactive before* this date. | [optional] | +| **expiration_date** | **Time** | Expiration date defines when the code expires. Expiration timestamp is presented in the ISO 8601 format. Voucher is *inactive after* this date. | [optional] | +| **validity_timeframe** | [**ValidityTimeframe**](ValidityTimeframe.md) | | [optional] | +| **validity_day_of_week** | **Array<Integer>** | Integer array corresponding to the particular days of the week in which the voucher is valid. - `0` Sunday - `1` Monday - `2` Tuesday - `3` Wednesday - `4` Thursday - `5` Friday - `6` Saturday | [optional] | +| **validity_hours** | [**ValidityHours**](ValidityHours.md) | | [optional] | +| **active** | **Boolean** | A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. - `true` indicates an *active* voucher - `false` indicates an *inactive* voucher | [optional] | +| **additional_info** | **String** | An optional field to keep any extra textual information about the code such as a code description and details. | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. | [optional] | +| **validation_rules** | **Array<String>** | Array containing the ID of the validation rule associated with the voucher. | [optional] | +| **redemption** | [**VouchersCreateRequestBodyRedemption**](VouchersCreateRequestBodyRedemption.md) | | [optional] | +| **type** | **String** | | [optional] | +| **loyalty_card** | [**SimpleLoyaltyCard**](SimpleLoyaltyCard.md) | | [optional] | +| **code_config** | [**CodeConfig**](CodeConfig.md) | | [optional] | +| **gift** | [**Gift**](Gift.md) | | [optional] | +| **discount** | [**Discount**](Discount.md) | | [optional] | + diff --git a/docs/VouchersCreateRequestBodyRedemption.md b/docs/VouchersCreateRequestBodyRedemption.md new file mode 100644 index 00000000..df38803f --- /dev/null +++ b/docs/VouchersCreateRequestBodyRedemption.md @@ -0,0 +1,8 @@ +# VoucherifySdk::VouchersCreateRequestBodyRedemption + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **quantity** | **Integer** | How many times a voucher can be redeemed. A `null` value means unlimited. | [optional] | + diff --git a/docs/VouchersCreateWithSpecificCodeRequestBody.md b/docs/VouchersCreateWithSpecificCodeRequestBody.md index fe7f7e55..72589620 100644 --- a/docs/VouchersCreateWithSpecificCodeRequestBody.md +++ b/docs/VouchersCreateWithSpecificCodeRequestBody.md @@ -15,7 +15,7 @@ | **validity_hours** | [**ValidityHours**](ValidityHours.md) | | [optional] | | **active** | **Boolean** | A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. - `true` indicates an *active* voucher - `false` indicates an *inactive* voucher | [optional] | | **additional_info** | **String** | An optional field to keep any extra textual information about the code such as a code description and details. | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. | [optional] | | **validation_rules** | **Array<String>** | Array containing the ID of the validation rule associated with the voucher. | [optional] | | **redemption** | [**VouchersCreateWithSpecificCodeRequestBodyRedemption**](VouchersCreateWithSpecificCodeRequestBodyRedemption.md) | | [optional] | | **type** | **String** | | [optional] | diff --git a/docs/VouchersImportCreateItemRequestBody.md b/docs/VouchersImportCreateItemRequestBody.md index e3b8a346..df3bb35c 100644 --- a/docs/VouchersImportCreateItemRequestBody.md +++ b/docs/VouchersImportCreateItemRequestBody.md @@ -7,7 +7,7 @@ | **code** | **String** | Value representing the imported code. | [optional] | | **redemption** | [**VouchersImportCreateItemRequestBodyRedemption**](VouchersImportCreateItemRequestBodyRedemption.md) | | [optional] | | **active** | **Boolean** | A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. - `true` indicates an *active* voucher - `false` indicates an *inactive* voucher | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. | [optional] | | **category** | **String** | Tag defining the category that this voucher belongs to. Useful when listing vouchers using the [List Vouchers](ref:list-vouchers) endpoint. | [optional] | | **start_date** | **Time** | Activation timestamp presented in the ISO 8601 format. Voucher is *inactive before* this date. Start date defines when the code starts to be active. Allowed date formats are: - YYYY-MM-DD - YYYY-MM-DDTHH - YYYY-MM-DDTHH:mm - YYYY-MM-DDTHH:mm:ss - YYYY-MM-DDTHH:mm:ssZ - YYYY-MM-DDTHH:mm:ss.SSSZ | [optional] | | **expiration_date** | **Time** | Expiration date defines when the code expires. Expiration timestamp is presented in the ISO 8601 format. Voucher is *inactive after* this date. Allowed date formats are: - YYYY-MM-DD - YYYY-MM-DDTHH - YYYY-MM-DDTHH:mm - YYYY-MM-DDTHH:mm:ss - YYYY-MM-DDTHH:mm:ssZ - YYYY-MM-DDTHH:mm:ss.SSSZ | [optional] | diff --git a/docs/VouchersUpdateRequestBody.md b/docs/VouchersUpdateRequestBody.md index 56139e2b..987b27ba 100644 --- a/docs/VouchersUpdateRequestBody.md +++ b/docs/VouchersUpdateRequestBody.md @@ -13,7 +13,7 @@ | **validity_hours** | [**ValidityHours**](ValidityHours.md) | | [optional] | | **active** | **Boolean** | A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. - `true` indicates an *active* voucher - `false` indicates an *inactive* voucher | [optional] | | **additional_info** | **String** | An optional field to keep any extra textual information about the code such as a code description and details. | [optional] | -| **metadata** | **Object** | | [optional] | +| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. | [optional] | | **type** | **String** | | [optional] | | **loyalty_card** | [**SimpleLoyaltyCard**](SimpleLoyaltyCard.md) | | [optional] | | **gift** | [**Gift**](Gift.md) | | [optional] | diff --git a/lib/VoucherifySdk.rb b/lib/VoucherifySdk.rb index 670e5879..0056630b 100644 --- a/lib/VoucherifySdk.rb +++ b/lib/VoucherifySdk.rb @@ -145,6 +145,7 @@ require 'VoucherifySdk/models/customers_update_response_body_address' require 'VoucherifySdk/models/customers_update_response_body_assets' require 'VoucherifySdk/models/discount' +require 'VoucherifySdk/models/discount_product' require 'VoucherifySdk/models/discount_unit_multiple_one_unit' require 'VoucherifySdk/models/earning_rule' require 'VoucherifySdk/models/earning_rule_custom_event' @@ -173,20 +174,16 @@ require 'VoucherifySdk/models/export_order_fields' require 'VoucherifySdk/models/export_order_order' require 'VoucherifySdk/models/export_parameters' -require 'VoucherifySdk/models/export_parameters_filters' require 'VoucherifySdk/models/export_result' require 'VoucherifySdk/models/export_voucher_transactions_fields' require 'VoucherifySdk/models/export_voucher_transactions_filters' require 'VoucherifySdk/models/export_voucher_transactions_order' require 'VoucherifySdk/models/exports_create_request_body' require 'VoucherifySdk/models/exports_create_request_body_parameters' -require 'VoucherifySdk/models/exports_create_request_body_parameters_filters' require 'VoucherifySdk/models/exports_create_response_body' require 'VoucherifySdk/models/exports_create_response_body_parameters' -require 'VoucherifySdk/models/exports_create_response_body_parameters_filters' require 'VoucherifySdk/models/exports_get_response_body' require 'VoucherifySdk/models/exports_get_response_body_parameters' -require 'VoucherifySdk/models/exports_get_response_body_parameters_filters' require 'VoucherifySdk/models/exports_get_response_body_result' require 'VoucherifySdk/models/exports_list_response_body' require 'VoucherifySdk/models/field_conditions' @@ -1103,6 +1100,8 @@ require 'VoucherifySdk/models/vouchers_balance_update_request_body' require 'VoucherifySdk/models/vouchers_balance_update_response_body' require 'VoucherifySdk/models/vouchers_balance_update_response_body_related_object' +require 'VoucherifySdk/models/vouchers_create_request_body' +require 'VoucherifySdk/models/vouchers_create_request_body_redemption' require 'VoucherifySdk/models/vouchers_create_response_body' require 'VoucherifySdk/models/vouchers_create_response_body_gift' require 'VoucherifySdk/models/vouchers_create_response_body_loyalty_card' diff --git a/lib/VoucherifySdk/api/vouchers_api.rb b/lib/VoucherifySdk/api/vouchers_api.rb index 76fecc2d..370bd86e 100644 --- a/lib/VoucherifySdk/api/vouchers_api.rb +++ b/lib/VoucherifySdk/api/vouchers_api.rb @@ -332,7 +332,7 @@ def export_voucher_transactions(code, opts = {}) # Generate Random Code # Create a standalone voucher. You can choose to create a GIFT_VOUCHER, a DISCOUNT_VOUCHER, or a LOYALTY_CARD. When you create a new voucher, you can specify a type to create it. Creating a new voucher will create a new stand alone voucher if no campaign name or campaign_id is provided. In case of the loyalty card, a campaign name is required. You can optionally use the code parameter to define a specific code or the code_config parameter to design rules for Voucherify API to create a random code. If neither of the two parameters are passed, then a random code is generated by the Voucherify API. This method will return an error when trying to create a voucher that already exists. # @param [Hash] opts the optional parameters - # @option opts [Object] :body Specify the details of the voucher that you would like to create. + # @option opts [VouchersCreateRequestBody] :vouchers_create_request_body Specify the details of the voucher that you would like to create. # @return [VouchersCreateResponseBody] def generate_random_code(opts = {}) data, _status_code, _headers = generate_random_code_with_http_info(opts) @@ -342,7 +342,7 @@ def generate_random_code(opts = {}) # Generate Random Code # Create a standalone voucher. You can choose to create a GIFT_VOUCHER, a DISCOUNT_VOUCHER, or a LOYALTY_CARD. When you create a new voucher, you can specify a type to create it. Creating a new voucher will create a new stand alone voucher if no campaign name or campaign_id is provided. In case of the loyalty card, a campaign name is required. You can optionally use the code parameter to define a specific code or the code_config parameter to design rules for Voucherify API to create a random code. If neither of the two parameters are passed, then a random code is generated by the Voucherify API. This method will return an error when trying to create a voucher that already exists. # @param [Hash] opts the optional parameters - # @option opts [Object] :body Specify the details of the voucher that you would like to create. + # @option opts [VouchersCreateRequestBody] :vouchers_create_request_body Specify the details of the voucher that you would like to create. # @return [Array<(VouchersCreateResponseBody, Integer, Hash)>] VouchersCreateResponseBody data, response status code and response headers private def generate_random_code_with_http_info(opts = {}) if @api_client.config.debugging @@ -368,7 +368,7 @@ def generate_random_code(opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body']) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'vouchers_create_request_body']) # return_type return_type = opts[:debug_return_type] || 'VouchersCreateResponseBody' diff --git a/lib/VoucherifySdk/models/campaigns_create_request_body.rb b/lib/VoucherifySdk/models/campaigns_create_request_body.rb index aa28d4c1..09901216 100644 --- a/lib/VoucherifySdk/models/campaigns_create_request_body.rb +++ b/lib/VoucherifySdk/models/campaigns_create_request_body.rb @@ -58,6 +58,7 @@ class CampaignsCreateRequestBody # The category assigned to the campaign. Either pass this parameter OR the `category_id`. attr_accessor :category + # 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 # Array containing the ID of the validation rule associated with the promotion tier. diff --git a/lib/VoucherifySdk/models/campaigns_import_voucher_item.rb b/lib/VoucherifySdk/models/campaigns_import_voucher_item.rb index b666c41d..23dba0a2 100644 --- a/lib/VoucherifySdk/models/campaigns_import_voucher_item.rb +++ b/lib/VoucherifySdk/models/campaigns_import_voucher_item.rb @@ -23,6 +23,7 @@ class CampaignsImportVoucherItem # A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. - `true` indicates an *active* voucher - `false` indicates an *inactive* voucher attr_accessor :active + # The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. attr_accessor :metadata # Tag defining the category that this voucher belongs to. Useful when listing vouchers using the [List Vouchers](ref:list-vouchers) endpoint. diff --git a/lib/VoucherifySdk/models/campaigns_update_request_body.rb b/lib/VoucherifySdk/models/campaigns_update_request_body.rb index 650c36f4..d65c576d 100644 --- a/lib/VoucherifySdk/models/campaigns_update_request_body.rb +++ b/lib/VoucherifySdk/models/campaigns_update_request_body.rb @@ -34,6 +34,7 @@ class CampaignsUpdateRequestBody # The category assigned to the campaign. Either pass this parameter OR the `category_id`. attr_accessor :category + # 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 # Determine which metadata should be removed from campaign. diff --git a/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item.rb b/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item.rb index ff01e241..3ca98531 100644 --- a/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item.rb +++ b/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item.rb @@ -31,6 +31,7 @@ class ClientValidationsValidateResponseBodyRedeemablesItem attr_accessor :result + # The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable. attr_accessor :metadata attr_accessor :categories @@ -97,6 +98,7 @@ def self.openapi_nullable Set.new([ :'id', :'object', + :'metadata', :'categories' ]) end diff --git a/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item_result_details.rb b/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item_result_details.rb index e48601e7..39c10af3 100644 --- a/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item_result_details.rb +++ b/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item_result_details.rb @@ -15,15 +15,15 @@ module VoucherifySdk class ClientValidationsValidateResponseBodyRedeemablesItemResultDetails - attr_accessor :key - attr_accessor :message + attr_accessor :key + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'key' => :'key', - :'message' => :'message' + :'message' => :'message', + :'key' => :'key' } end @@ -35,8 +35,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'key' => :'String', - :'message' => :'String' + :'message' => :'String', + :'key' => :'String' } end @@ -54,13 +54,13 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - if attributes.key?(:'message') self.message = attributes[:'message'] end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -83,8 +83,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - key == o.key && - message == o.message + message == o.message && + key == o.key end # @see the `==` method @@ -96,7 +96,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [key, message].hash + [message, key].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/discount.rb b/lib/VoucherifySdk/models/discount.rb index 5a3f9bb2..d1e12e9f 100644 --- a/lib/VoucherifySdk/models/discount.rb +++ b/lib/VoucherifySdk/models/discount.rb @@ -119,7 +119,7 @@ def self.openapi_types :'unit_off' => :'Integer', :'unit_off_formula' => :'String', :'unit_type' => :'String', - :'product' => :'SimpleProductDiscountUnit', + :'product' => :'DiscountProduct', :'sku' => :'SimpleSkuDiscountUnit', :'units' => :'Array', :'percent_off' => :'Float', @@ -142,6 +142,7 @@ def self.openapi_nullable :'unit_off', :'unit_off_formula', :'unit_type', + :'product', :'units', :'percent_off', :'percent_off_formula', diff --git a/lib/VoucherifySdk/models/export_parameters_filters.rb b/lib/VoucherifySdk/models/discount_product.rb similarity index 78% rename from lib/VoucherifySdk/models/export_parameters_filters.rb rename to lib/VoucherifySdk/models/discount_product.rb index 50f0c72d..90cd9c99 100644 --- a/lib/VoucherifySdk/models/export_parameters_filters.rb +++ b/lib/VoucherifySdk/models/discount_product.rb @@ -14,44 +14,22 @@ require 'time' module VoucherifySdk - class ExportParametersFilters - attr_accessor :junction + class DiscountProduct + # Unique product ID, assigned by Voucherify. + attr_accessor :id - attr_accessor :campaign_id + # Product's source ID. + attr_accessor :source_id - attr_accessor :voucher_id - - attr_accessor :created_at - - 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 + # Product name. + attr_accessor :name # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'junction' => :'junction', - :'campaign_id' => :'campaign_id', - :'voucher_id' => :'voucher_id', - :'created_at' => :'created_at' + :'id' => :'id', + :'source_id' => :'source_id', + :'name' => :'name' } end @@ -63,16 +41,18 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'junction' => :'Junction', - :'campaign_id' => :'FieldConditions', - :'voucher_id' => :'FieldConditions', - :'created_at' => :'FieldConditions' + :'id' => :'String', + :'source_id' => :'String', + :'name' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'id', + :'source_id', + :'name' ]) end @@ -84,20 +64,16 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'junction') - self.junction = attributes[:'junction'] - end - - if attributes.key?(:'campaign_id') - self.campaign_id = attributes[:'campaign_id'] + if attributes.key?(:'id') + self.id = attributes[:'id'] end - if attributes.key?(:'voucher_id') - self.voucher_id = attributes[:'voucher_id'] + if attributes.key?(:'source_id') + self.source_id = attributes[:'source_id'] end - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] + if attributes.key?(:'name') + self.name = attributes[:'name'] end end @@ -121,10 +97,9 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - junction == o.junction && - campaign_id == o.campaign_id && - voucher_id == o.voucher_id && - created_at == o.created_at + id == o.id && + source_id == o.source_id && + name == o.name end # @see the `==` method @@ -136,7 +111,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [junction, campaign_id, voucher_id, created_at].hash + [id, source_id, name].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/earning_rule_loyalty.rb b/lib/VoucherifySdk/models/earning_rule_loyalty.rb index 0616def9..254794ab 100644 --- a/lib/VoucherifySdk/models/earning_rule_loyalty.rb +++ b/lib/VoucherifySdk/models/earning_rule_loyalty.rb @@ -17,6 +17,9 @@ module VoucherifySdk class EarningRuleLoyalty attr_accessor :type + # Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. + attr_accessor :points + attr_accessor :calculation_type attr_accessor :order @@ -27,9 +30,6 @@ class EarningRuleLoyalty attr_accessor :custom_event - # Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. - attr_accessor :points - class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -56,12 +56,12 @@ def valid?(value) def self.attribute_map { :'type' => :'type', + :'points' => :'points', :'calculation_type' => :'calculation_type', :'order' => :'order', :'order_items' => :'order_items', :'customer' => :'customer', - :'custom_event' => :'custom_event', - :'points' => :'points' + :'custom_event' => :'custom_event' } end @@ -74,12 +74,12 @@ def self.acceptable_attributes def self.openapi_types { :'type' => :'String', + :'points' => :'Integer', :'calculation_type' => :'String', :'order' => :'EarningRuleLoyaltyOrder', :'order_items' => :'EarningRuleLoyaltyOrderItems', :'customer' => :'EarningRuleLoyaltyCustomer', - :'custom_event' => :'EarningRuleLoyaltyCustomEvent', - :'points' => :'Integer' + :'custom_event' => :'EarningRuleLoyaltyCustomEvent' } end @@ -87,12 +87,12 @@ def self.openapi_types def self.openapi_nullable Set.new([ :'type', + :'points', :'calculation_type', :'order', :'order_items', :'customer', - :'custom_event', - :'points' + :'custom_event' ]) end @@ -108,6 +108,10 @@ def initialize(attributes = {}) self.type = attributes[:'type'] end + if attributes.key?(:'points') + self.points = attributes[:'points'] + end + if attributes.key?(:'calculation_type') self.calculation_type = attributes[:'calculation_type'] end @@ -127,10 +131,6 @@ def initialize(attributes = {}) if attributes.key?(:'custom_event') self.custom_event = attributes[:'custom_event'] end - - if attributes.key?(:'points') - self.points = attributes[:'points'] - end end # Show invalid properties with the reasons. Usually used together with valid? @@ -145,7 +145,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', ["PROPORTIONAL", "FIXED"]) + type_validator = EnumAttributeValidator.new('String', ["FIXED", "PROPORTIONAL"]) return false unless type_validator.valid?(@type) calculation_type_validator = EnumAttributeValidator.new('String', ["ORDER_AMOUNT", "ORDER_TOTAL_AMOUNT", "ORDER_METADATA", "ORDER_ITEMS_QUANTITY", "ORDER_ITEMS_AMOUNT", "ORDER_ITEMS_SUBTOTAL_AMOUNT", "CUSTOMER_METADATA", "CUSTOM_EVENT_METADATA"]) return false unless calculation_type_validator.valid?(@calculation_type) @@ -158,12 +158,12 @@ def ==(o) return true if self.equal?(o) self.class == o.class && type == o.type && + points == o.points && calculation_type == o.calculation_type && order == o.order && order_items == o.order_items && customer == o.customer && - custom_event == o.custom_event && - points == o.points + custom_event == o.custom_event end # @see the `==` method @@ -175,7 +175,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type, calculation_type, order, order_items, customer, custom_event, points].hash + [type, points, calculation_type, order, order_items, customer, custom_event].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/export_parameters.rb b/lib/VoucherifySdk/models/export_parameters.rb index 970835bc..5f506a2d 100644 --- a/lib/VoucherifySdk/models/export_parameters.rb +++ b/lib/VoucherifySdk/models/export_parameters.rb @@ -20,6 +20,7 @@ class ExportParameters # Array of strings containing the data in the export. These fields define the headers in the CSV file. attr_accessor :fields + # Allowed additional properties must start with \"metadata.\" or \"redemption.\" and Allowed additional properties must start with \"metadata.\" and Allowed additional properties must start with \"metadata.\" or \"address.\" or \"summary.\" or \"loyalty.\" or \"loyalty_tier.\" or \"loyalty_points.\" or \"system_metadata.\" attr_accessor :filters class EnumAttributeValidator @@ -63,7 +64,7 @@ def self.openapi_types { :'order' => :'String', :'fields' => :'Array', - :'filters' => :'ExportParametersFilters' + :'filters' => :'Object' } end @@ -111,7 +112,7 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - order_validator = EnumAttributeValidator.new('String', ["-created_at", "created_at", "-updated_at", "updated_at", "-code", "code", "-id", "id", "-voucher_code", "voucher_code", "-tracking_id", "tracking_id", "-customer_id", "customer_id"]) + order_validator = EnumAttributeValidator.new('String', ["-created_at", "created_at", "-updated_at", "updated_at", "-code", "code", "-id", "id", "-voucher_code", "voucher_code", "-tracking_id", "tracking_id", "-customer_id", "customer_id", "-name", "name", "-email", "email", "-source_id", "source_id", "-channel", "channel", "-status", "status", "-expires_at", "expires_at"]) return false unless order_validator.valid?(@order) true end diff --git a/lib/VoucherifySdk/models/exports_create_request_body_parameters.rb b/lib/VoucherifySdk/models/exports_create_request_body_parameters.rb index 56dab875..3516146b 100644 --- a/lib/VoucherifySdk/models/exports_create_request_body_parameters.rb +++ b/lib/VoucherifySdk/models/exports_create_request_body_parameters.rb @@ -20,6 +20,7 @@ class ExportsCreateRequestBodyParameters # Array of strings containing the data in the export. These fields define the headers in the CSV file. attr_accessor :fields + # Allowed additional properties must start with \"metadata.\" or \"redemption.\" and Allowed additional properties must start with \"metadata.\" and Allowed additional properties must start with \"metadata.\" or \"address.\" or \"summary.\" or \"loyalty.\" or \"loyalty_tier.\" or \"loyalty_points.\" or \"system_metadata.\" attr_accessor :filters class EnumAttributeValidator @@ -63,7 +64,7 @@ def self.openapi_types { :'order' => :'String', :'fields' => :'Array', - :'filters' => :'ExportsCreateRequestBodyParametersFilters' + :'filters' => :'Object' } end @@ -111,7 +112,7 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - order_validator = EnumAttributeValidator.new('String', ["-created_at", "created_at", "-updated_at", "updated_at", "-code", "code", "-id", "id", "-voucher_code", "voucher_code", "-tracking_id", "tracking_id", "-customer_id", "customer_id"]) + order_validator = EnumAttributeValidator.new('String', ["-created_at", "created_at", "-updated_at", "updated_at", "-code", "code", "-id", "id", "-voucher_code", "voucher_code", "-tracking_id", "tracking_id", "-customer_id", "customer_id", "-name", "name", "-email", "email", "-source_id", "source_id", "-channel", "channel", "-status", "status", "-expires_at", "expires_at"]) return false unless order_validator.valid?(@order) true end diff --git a/lib/VoucherifySdk/models/exports_create_request_body_parameters_filters.rb b/lib/VoucherifySdk/models/exports_create_request_body_parameters_filters.rb deleted file mode 100644 index e9e60091..00000000 --- a/lib/VoucherifySdk/models/exports_create_request_body_parameters_filters.rb +++ /dev/null @@ -1,256 +0,0 @@ -=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 ExportsCreateRequestBodyParametersFilters - attr_accessor :junction - - attr_accessor :campaign_id - - attr_accessor :voucher_id - - attr_accessor :created_at - - 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 - { - :'junction' => :'junction', - :'campaign_id' => :'campaign_id', - :'voucher_id' => :'voucher_id', - :'created_at' => :'created_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 - { - :'junction' => :'Junction', - :'campaign_id' => :'FieldConditions', - :'voucher_id' => :'FieldConditions', - :'created_at' => :'FieldConditions' - } - 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?(:'junction') - self.junction = attributes[:'junction'] - end - - if attributes.key?(:'campaign_id') - self.campaign_id = attributes[:'campaign_id'] - end - - if attributes.key?(:'voucher_id') - self.voucher_id = attributes[:'voucher_id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_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 - 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 && - junction == o.junction && - campaign_id == o.campaign_id && - voucher_id == o.voucher_id && - created_at == o.created_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 - [junction, campaign_id, voucher_id, created_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/exports_create_response_body_parameters.rb b/lib/VoucherifySdk/models/exports_create_response_body_parameters.rb index 17a5e52a..9f5e8c01 100644 --- a/lib/VoucherifySdk/models/exports_create_response_body_parameters.rb +++ b/lib/VoucherifySdk/models/exports_create_response_body_parameters.rb @@ -20,6 +20,7 @@ class ExportsCreateResponseBodyParameters # Array of strings containing the data in the export. These fields define the headers in the CSV file. attr_accessor :fields + # Allowed additional properties must start with \"metadata.\" or \"redemption.\" and Allowed additional properties must start with \"metadata.\" and Allowed additional properties must start with \"metadata.\" or \"address.\" or \"summary.\" or \"loyalty.\" or \"loyalty_tier.\" or \"loyalty_points.\" or \"system_metadata.\" attr_accessor :filters class EnumAttributeValidator @@ -63,7 +64,7 @@ def self.openapi_types { :'order' => :'String', :'fields' => :'Array', - :'filters' => :'ExportsCreateResponseBodyParametersFilters' + :'filters' => :'Object' } end @@ -111,7 +112,7 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - order_validator = EnumAttributeValidator.new('String', ["-created_at", "created_at", "-updated_at", "updated_at", "-code", "code", "-id", "id", "-voucher_code", "voucher_code", "-tracking_id", "tracking_id", "-customer_id", "customer_id"]) + order_validator = EnumAttributeValidator.new('String', ["-created_at", "created_at", "-updated_at", "updated_at", "-code", "code", "-id", "id", "-voucher_code", "voucher_code", "-tracking_id", "tracking_id", "-customer_id", "customer_id", "-name", "name", "-email", "email", "-source_id", "source_id", "-channel", "channel", "-status", "status", "-expires_at", "expires_at"]) return false unless order_validator.valid?(@order) true end diff --git a/lib/VoucherifySdk/models/exports_create_response_body_parameters_filters.rb b/lib/VoucherifySdk/models/exports_create_response_body_parameters_filters.rb deleted file mode 100644 index 37346568..00000000 --- a/lib/VoucherifySdk/models/exports_create_response_body_parameters_filters.rb +++ /dev/null @@ -1,256 +0,0 @@ -=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 ExportsCreateResponseBodyParametersFilters - attr_accessor :junction - - attr_accessor :campaign_id - - attr_accessor :voucher_id - - attr_accessor :created_at - - 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 - { - :'junction' => :'junction', - :'campaign_id' => :'campaign_id', - :'voucher_id' => :'voucher_id', - :'created_at' => :'created_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 - { - :'junction' => :'Junction', - :'campaign_id' => :'FieldConditions', - :'voucher_id' => :'FieldConditions', - :'created_at' => :'FieldConditions' - } - 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?(:'junction') - self.junction = attributes[:'junction'] - end - - if attributes.key?(:'campaign_id') - self.campaign_id = attributes[:'campaign_id'] - end - - if attributes.key?(:'voucher_id') - self.voucher_id = attributes[:'voucher_id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_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 - 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 && - junction == o.junction && - campaign_id == o.campaign_id && - voucher_id == o.voucher_id && - created_at == o.created_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 - [junction, campaign_id, voucher_id, created_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/exports_get_response_body_parameters.rb b/lib/VoucherifySdk/models/exports_get_response_body_parameters.rb index 524692e3..a5c95cf4 100644 --- a/lib/VoucherifySdk/models/exports_get_response_body_parameters.rb +++ b/lib/VoucherifySdk/models/exports_get_response_body_parameters.rb @@ -20,6 +20,7 @@ class ExportsGetResponseBodyParameters # Array of strings containing the data in the export. These fields define the headers in the CSV file. attr_accessor :fields + # Allowed additional properties must start with \"metadata.\" or \"redemption.\" and Allowed additional properties must start with \"metadata.\" and Allowed additional properties must start with \"metadata.\" or \"address.\" or \"summary.\" or \"loyalty.\" or \"loyalty_tier.\" or \"loyalty_points.\" or \"system_metadata.\" attr_accessor :filters class EnumAttributeValidator @@ -63,7 +64,7 @@ def self.openapi_types { :'order' => :'String', :'fields' => :'Array', - :'filters' => :'ExportsGetResponseBodyParametersFilters' + :'filters' => :'Object' } end @@ -111,7 +112,7 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - order_validator = EnumAttributeValidator.new('String', ["-created_at", "created_at", "-updated_at", "updated_at", "-code", "code", "-id", "id", "-voucher_code", "voucher_code", "-tracking_id", "tracking_id", "-customer_id", "customer_id"]) + order_validator = EnumAttributeValidator.new('String', ["-created_at", "created_at", "-updated_at", "updated_at", "-code", "code", "-id", "id", "-voucher_code", "voucher_code", "-tracking_id", "tracking_id", "-customer_id", "customer_id", "-name", "name", "-email", "email", "-source_id", "source_id", "-channel", "channel", "-status", "status", "-expires_at", "expires_at"]) return false unless order_validator.valid?(@order) true end diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item.rb index 6951d30e..414c1d49 100644 --- a/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item.rb +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item.rb @@ -40,6 +40,7 @@ class LoyaltiesEarningRulesCreateRequestBodyItem attr_accessor :validity_hours + # The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format. attr_accessor :metadata attr_accessor :segment @@ -122,6 +123,7 @@ def self.openapi_nullable :'active', :'start_date', :'expiration_date', + :'metadata', :'segment', :'custom_event', :'loyalty_tier' diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_loyalty.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_loyalty.rb index 6caab300..08ad39c5 100644 --- a/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_loyalty.rb +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_loyalty.rb @@ -22,14 +22,14 @@ class LoyaltiesEarningRulesCreateRequestBodyItemLoyalty attr_accessor :calculation_type - attr_accessor :custom_event + attr_accessor :order attr_accessor :order_items - attr_accessor :order - attr_accessor :customer + attr_accessor :custom_event + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -58,10 +58,10 @@ def self.attribute_map :'type' => :'type', :'points' => :'points', :'calculation_type' => :'calculation_type', - :'custom_event' => :'custom_event', - :'order_items' => :'order_items', :'order' => :'order', - :'customer' => :'customer' + :'order_items' => :'order_items', + :'customer' => :'customer', + :'custom_event' => :'custom_event' } end @@ -76,10 +76,10 @@ def self.openapi_types :'type' => :'String', :'points' => :'Integer', :'calculation_type' => :'String', - :'custom_event' => :'LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyCustomEvent', - :'order_items' => :'LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyOrderItems', :'order' => :'LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyOrder', - :'customer' => :'LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyCustomer' + :'order_items' => :'LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyOrderItems', + :'customer' => :'LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyCustomer', + :'custom_event' => :'LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyCustomEvent' } end @@ -87,8 +87,8 @@ def self.openapi_types def self.openapi_nullable Set.new([ :'points', - :'custom_event', - :'customer' + :'customer', + :'custom_event' ]) end @@ -112,21 +112,21 @@ def initialize(attributes = {}) self.calculation_type = attributes[:'calculation_type'] end - if attributes.key?(:'custom_event') - self.custom_event = attributes[:'custom_event'] + if attributes.key?(:'order') + self.order = attributes[:'order'] end if attributes.key?(:'order_items') self.order_items = attributes[:'order_items'] end - if attributes.key?(:'order') - self.order = attributes[:'order'] - end - if attributes.key?(:'customer') self.customer = attributes[:'customer'] end + + if attributes.key?(:'custom_event') + self.custom_event = attributes[:'custom_event'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -143,7 +143,7 @@ def valid? warn '[DEPRECATED] the `valid?` method is obsolete' type_validator = EnumAttributeValidator.new('String', ["FIXED", "PROPORTIONAL"]) return false unless type_validator.valid?(@type) - calculation_type_validator = EnumAttributeValidator.new('String', ["CUSTOM_EVENT_METADATA", "ORDER_ITEMS_QUANTITY", "ORDER_ITEMS_AMOUNT", "ORDER_ITEMS_SUBTOTAL_AMOUNT", "ORDER_AMOUNT", "ORDER_TOTAL_AMOUNT", "ORDER_METADATA", "CUSTOMER_METADATA"]) + calculation_type_validator = EnumAttributeValidator.new('String', ["ORDER_AMOUNT", "ORDER_TOTAL_AMOUNT", "ORDER_METADATA", "ORDER_ITEMS_QUANTITY", "ORDER_ITEMS_AMOUNT", "ORDER_ITEMS_SUBTOTAL_AMOUNT", "CUSTOMER_METADATA", "CUSTOM_EVENT_METADATA"]) return false unless calculation_type_validator.valid?(@calculation_type) true end @@ -156,10 +156,10 @@ def ==(o) type == o.type && points == o.points && calculation_type == o.calculation_type && - custom_event == o.custom_event && - order_items == o.order_items && order == o.order && - customer == o.customer + order_items == o.order_items && + customer == o.customer && + custom_event == o.custom_event end # @see the `==` method @@ -171,7 +171,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type, points, calculation_type, custom_event, order_items, order, customer].hash + [type, points, calculation_type, order, order_items, customer, custom_event].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty.rb index e2d38629..000f48aa 100644 --- a/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty.rb +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty.rb @@ -17,6 +17,9 @@ module VoucherifySdk class LoyaltiesEarningRulesCreateResponseBodyLoyalty attr_accessor :type + # Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. + attr_accessor :points + attr_accessor :calculation_type attr_accessor :order @@ -27,9 +30,6 @@ class LoyaltiesEarningRulesCreateResponseBodyLoyalty attr_accessor :custom_event - # Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. - attr_accessor :points - class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -56,12 +56,12 @@ def valid?(value) def self.attribute_map { :'type' => :'type', + :'points' => :'points', :'calculation_type' => :'calculation_type', :'order' => :'order', :'order_items' => :'order_items', :'customer' => :'customer', - :'custom_event' => :'custom_event', - :'points' => :'points' + :'custom_event' => :'custom_event' } end @@ -74,12 +74,12 @@ def self.acceptable_attributes def self.openapi_types { :'type' => :'String', + :'points' => :'Integer', :'calculation_type' => :'String', :'order' => :'LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrder', :'order_items' => :'LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrderItems', :'customer' => :'LoyaltiesEarningRulesCreateResponseBodyLoyaltyCustomer', - :'custom_event' => :'LoyaltiesEarningRulesCreateResponseBodyLoyaltyCustomEvent', - :'points' => :'Integer' + :'custom_event' => :'LoyaltiesEarningRulesCreateResponseBodyLoyaltyCustomEvent' } end @@ -87,12 +87,12 @@ def self.openapi_types def self.openapi_nullable Set.new([ :'type', + :'points', :'calculation_type', :'order', :'order_items', :'customer', - :'custom_event', - :'points' + :'custom_event' ]) end @@ -108,6 +108,10 @@ def initialize(attributes = {}) self.type = attributes[:'type'] end + if attributes.key?(:'points') + self.points = attributes[:'points'] + end + if attributes.key?(:'calculation_type') self.calculation_type = attributes[:'calculation_type'] end @@ -127,10 +131,6 @@ def initialize(attributes = {}) if attributes.key?(:'custom_event') self.custom_event = attributes[:'custom_event'] end - - if attributes.key?(:'points') - self.points = attributes[:'points'] - end end # Show invalid properties with the reasons. Usually used together with valid? @@ -145,7 +145,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', ["PROPORTIONAL", "FIXED"]) + type_validator = EnumAttributeValidator.new('String', ["FIXED", "PROPORTIONAL"]) return false unless type_validator.valid?(@type) calculation_type_validator = EnumAttributeValidator.new('String', ["ORDER_AMOUNT", "ORDER_TOTAL_AMOUNT", "ORDER_METADATA", "ORDER_ITEMS_QUANTITY", "ORDER_ITEMS_AMOUNT", "ORDER_ITEMS_SUBTOTAL_AMOUNT", "CUSTOMER_METADATA", "CUSTOM_EVENT_METADATA"]) return false unless calculation_type_validator.valid?(@calculation_type) @@ -158,12 +158,12 @@ def ==(o) return true if self.equal?(o) self.class == o.class && type == o.type && + points == o.points && calculation_type == o.calculation_type && order == o.order && order_items == o.order_items && customer == o.customer && - custom_event == o.custom_event && - points == o.points + custom_event == o.custom_event end # @see the `==` method @@ -175,7 +175,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type, calculation_type, order, order_items, customer, custom_event, points].hash + [type, points, calculation_type, order, order_items, customer, custom_event].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty.rb index bab92008..ed2f4e61 100644 --- a/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty.rb +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty.rb @@ -17,6 +17,9 @@ module VoucherifySdk class LoyaltiesEarningRulesDisableResponseBodyLoyalty attr_accessor :type + # Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. + attr_accessor :points + attr_accessor :calculation_type attr_accessor :order @@ -27,9 +30,6 @@ class LoyaltiesEarningRulesDisableResponseBodyLoyalty attr_accessor :custom_event - # Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. - attr_accessor :points - class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -56,12 +56,12 @@ def valid?(value) def self.attribute_map { :'type' => :'type', + :'points' => :'points', :'calculation_type' => :'calculation_type', :'order' => :'order', :'order_items' => :'order_items', :'customer' => :'customer', - :'custom_event' => :'custom_event', - :'points' => :'points' + :'custom_event' => :'custom_event' } end @@ -74,12 +74,12 @@ def self.acceptable_attributes def self.openapi_types { :'type' => :'String', + :'points' => :'Integer', :'calculation_type' => :'String', :'order' => :'LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrder', :'order_items' => :'LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrderItems', :'customer' => :'LoyaltiesEarningRulesDisableResponseBodyLoyaltyCustomer', - :'custom_event' => :'LoyaltiesEarningRulesDisableResponseBodyLoyaltyCustomEvent', - :'points' => :'Integer' + :'custom_event' => :'LoyaltiesEarningRulesDisableResponseBodyLoyaltyCustomEvent' } end @@ -87,12 +87,12 @@ def self.openapi_types def self.openapi_nullable Set.new([ :'type', + :'points', :'calculation_type', :'order', :'order_items', :'customer', - :'custom_event', - :'points' + :'custom_event' ]) end @@ -108,6 +108,10 @@ def initialize(attributes = {}) self.type = attributes[:'type'] end + if attributes.key?(:'points') + self.points = attributes[:'points'] + end + if attributes.key?(:'calculation_type') self.calculation_type = attributes[:'calculation_type'] end @@ -127,10 +131,6 @@ def initialize(attributes = {}) if attributes.key?(:'custom_event') self.custom_event = attributes[:'custom_event'] end - - if attributes.key?(:'points') - self.points = attributes[:'points'] - end end # Show invalid properties with the reasons. Usually used together with valid? @@ -145,7 +145,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', ["PROPORTIONAL", "FIXED"]) + type_validator = EnumAttributeValidator.new('String', ["FIXED", "PROPORTIONAL"]) return false unless type_validator.valid?(@type) calculation_type_validator = EnumAttributeValidator.new('String', ["ORDER_AMOUNT", "ORDER_TOTAL_AMOUNT", "ORDER_METADATA", "ORDER_ITEMS_QUANTITY", "ORDER_ITEMS_AMOUNT", "ORDER_ITEMS_SUBTOTAL_AMOUNT", "CUSTOMER_METADATA", "CUSTOM_EVENT_METADATA"]) return false unless calculation_type_validator.valid?(@calculation_type) @@ -158,12 +158,12 @@ def ==(o) return true if self.equal?(o) self.class == o.class && type == o.type && + points == o.points && calculation_type == o.calculation_type && order == o.order && order_items == o.order_items && customer == o.customer && - custom_event == o.custom_event && - points == o.points + custom_event == o.custom_event end # @see the `==` method @@ -175,7 +175,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type, calculation_type, order, order_items, customer, custom_event, points].hash + [type, points, calculation_type, order, order_items, customer, custom_event].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty.rb index 75722c08..590cf0bf 100644 --- a/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty.rb +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty.rb @@ -17,6 +17,9 @@ module VoucherifySdk class LoyaltiesEarningRulesEnableResponseBodyLoyalty attr_accessor :type + # Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. + attr_accessor :points + attr_accessor :calculation_type attr_accessor :order @@ -27,9 +30,6 @@ class LoyaltiesEarningRulesEnableResponseBodyLoyalty attr_accessor :custom_event - # Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. - attr_accessor :points - class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -56,12 +56,12 @@ def valid?(value) def self.attribute_map { :'type' => :'type', + :'points' => :'points', :'calculation_type' => :'calculation_type', :'order' => :'order', :'order_items' => :'order_items', :'customer' => :'customer', - :'custom_event' => :'custom_event', - :'points' => :'points' + :'custom_event' => :'custom_event' } end @@ -74,12 +74,12 @@ def self.acceptable_attributes def self.openapi_types { :'type' => :'String', + :'points' => :'Integer', :'calculation_type' => :'String', :'order' => :'LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrder', :'order_items' => :'LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrderItems', :'customer' => :'LoyaltiesEarningRulesEnableResponseBodyLoyaltyCustomer', - :'custom_event' => :'LoyaltiesEarningRulesEnableResponseBodyLoyaltyCustomEvent', - :'points' => :'Integer' + :'custom_event' => :'LoyaltiesEarningRulesEnableResponseBodyLoyaltyCustomEvent' } end @@ -87,12 +87,12 @@ def self.openapi_types def self.openapi_nullable Set.new([ :'type', + :'points', :'calculation_type', :'order', :'order_items', :'customer', - :'custom_event', - :'points' + :'custom_event' ]) end @@ -108,6 +108,10 @@ def initialize(attributes = {}) self.type = attributes[:'type'] end + if attributes.key?(:'points') + self.points = attributes[:'points'] + end + if attributes.key?(:'calculation_type') self.calculation_type = attributes[:'calculation_type'] end @@ -127,10 +131,6 @@ def initialize(attributes = {}) if attributes.key?(:'custom_event') self.custom_event = attributes[:'custom_event'] end - - if attributes.key?(:'points') - self.points = attributes[:'points'] - end end # Show invalid properties with the reasons. Usually used together with valid? @@ -145,7 +145,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', ["PROPORTIONAL", "FIXED"]) + type_validator = EnumAttributeValidator.new('String', ["FIXED", "PROPORTIONAL"]) return false unless type_validator.valid?(@type) calculation_type_validator = EnumAttributeValidator.new('String', ["ORDER_AMOUNT", "ORDER_TOTAL_AMOUNT", "ORDER_METADATA", "ORDER_ITEMS_QUANTITY", "ORDER_ITEMS_AMOUNT", "ORDER_ITEMS_SUBTOTAL_AMOUNT", "CUSTOMER_METADATA", "CUSTOM_EVENT_METADATA"]) return false unless calculation_type_validator.valid?(@calculation_type) @@ -158,12 +158,12 @@ def ==(o) return true if self.equal?(o) self.class == o.class && type == o.type && + points == o.points && calculation_type == o.calculation_type && order == o.order && order_items == o.order_items && customer == o.customer && - custom_event == o.custom_event && - points == o.points + custom_event == o.custom_event end # @see the `==` method @@ -175,7 +175,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type, calculation_type, order, order_items, customer, custom_event, points].hash + [type, points, calculation_type, order, order_items, customer, custom_event].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty.rb index 23ce0fd0..7dbffbd3 100644 --- a/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty.rb +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty.rb @@ -17,6 +17,9 @@ module VoucherifySdk class LoyaltiesEarningRulesGetResponseBodyLoyalty attr_accessor :type + # Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. + attr_accessor :points + attr_accessor :calculation_type attr_accessor :order @@ -27,9 +30,6 @@ class LoyaltiesEarningRulesGetResponseBodyLoyalty attr_accessor :custom_event - # Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. - attr_accessor :points - class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -56,12 +56,12 @@ def valid?(value) def self.attribute_map { :'type' => :'type', + :'points' => :'points', :'calculation_type' => :'calculation_type', :'order' => :'order', :'order_items' => :'order_items', :'customer' => :'customer', - :'custom_event' => :'custom_event', - :'points' => :'points' + :'custom_event' => :'custom_event' } end @@ -74,12 +74,12 @@ def self.acceptable_attributes def self.openapi_types { :'type' => :'String', + :'points' => :'Integer', :'calculation_type' => :'String', :'order' => :'LoyaltiesEarningRulesGetResponseBodyLoyaltyOrder', :'order_items' => :'LoyaltiesEarningRulesGetResponseBodyLoyaltyOrderItems', :'customer' => :'LoyaltiesEarningRulesGetResponseBodyLoyaltyCustomer', - :'custom_event' => :'LoyaltiesEarningRulesGetResponseBodyLoyaltyCustomEvent', - :'points' => :'Integer' + :'custom_event' => :'LoyaltiesEarningRulesGetResponseBodyLoyaltyCustomEvent' } end @@ -87,12 +87,12 @@ def self.openapi_types def self.openapi_nullable Set.new([ :'type', + :'points', :'calculation_type', :'order', :'order_items', :'customer', - :'custom_event', - :'points' + :'custom_event' ]) end @@ -108,6 +108,10 @@ def initialize(attributes = {}) self.type = attributes[:'type'] end + if attributes.key?(:'points') + self.points = attributes[:'points'] + end + if attributes.key?(:'calculation_type') self.calculation_type = attributes[:'calculation_type'] end @@ -127,10 +131,6 @@ def initialize(attributes = {}) if attributes.key?(:'custom_event') self.custom_event = attributes[:'custom_event'] end - - if attributes.key?(:'points') - self.points = attributes[:'points'] - end end # Show invalid properties with the reasons. Usually used together with valid? @@ -145,7 +145,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', ["PROPORTIONAL", "FIXED"]) + type_validator = EnumAttributeValidator.new('String', ["FIXED", "PROPORTIONAL"]) return false unless type_validator.valid?(@type) calculation_type_validator = EnumAttributeValidator.new('String', ["ORDER_AMOUNT", "ORDER_TOTAL_AMOUNT", "ORDER_METADATA", "ORDER_ITEMS_QUANTITY", "ORDER_ITEMS_AMOUNT", "ORDER_ITEMS_SUBTOTAL_AMOUNT", "CUSTOMER_METADATA", "CUSTOM_EVENT_METADATA"]) return false unless calculation_type_validator.valid?(@calculation_type) @@ -158,12 +158,12 @@ def ==(o) return true if self.equal?(o) self.class == o.class && type == o.type && + points == o.points && calculation_type == o.calculation_type && order == o.order && order_items == o.order_items && customer == o.customer && - custom_event == o.custom_event && - points == o.points + custom_event == o.custom_event end # @see the `==` method @@ -175,7 +175,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type, calculation_type, order, order_items, customer, custom_event, points].hash + [type, points, calculation_type, order, order_items, customer, custom_event].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_loyalty.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_loyalty.rb index 35d5e142..b05020b2 100644 --- a/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_loyalty.rb +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_loyalty.rb @@ -17,6 +17,9 @@ module VoucherifySdk class LoyaltiesEarningRulesUpdateRequestBodyLoyalty attr_accessor :type + # Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. + attr_accessor :points + attr_accessor :calculation_type attr_accessor :order @@ -27,9 +30,6 @@ class LoyaltiesEarningRulesUpdateRequestBodyLoyalty attr_accessor :custom_event - # Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. - attr_accessor :points - class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -56,12 +56,12 @@ def valid?(value) def self.attribute_map { :'type' => :'type', + :'points' => :'points', :'calculation_type' => :'calculation_type', :'order' => :'order', :'order_items' => :'order_items', :'customer' => :'customer', - :'custom_event' => :'custom_event', - :'points' => :'points' + :'custom_event' => :'custom_event' } end @@ -74,12 +74,12 @@ def self.acceptable_attributes def self.openapi_types { :'type' => :'String', + :'points' => :'Integer', :'calculation_type' => :'String', :'order' => :'LoyaltiesEarningRulesUpdateRequestBodyLoyaltyOrder', :'order_items' => :'LoyaltiesEarningRulesUpdateRequestBodyLoyaltyOrderItems', :'customer' => :'LoyaltiesEarningRulesUpdateRequestBodyLoyaltyCustomer', - :'custom_event' => :'LoyaltiesEarningRulesUpdateRequestBodyLoyaltyCustomEvent', - :'points' => :'Integer' + :'custom_event' => :'LoyaltiesEarningRulesUpdateRequestBodyLoyaltyCustomEvent' } end @@ -87,12 +87,12 @@ def self.openapi_types def self.openapi_nullable Set.new([ :'type', + :'points', :'calculation_type', :'order', :'order_items', :'customer', - :'custom_event', - :'points' + :'custom_event' ]) end @@ -108,6 +108,10 @@ def initialize(attributes = {}) self.type = attributes[:'type'] end + if attributes.key?(:'points') + self.points = attributes[:'points'] + end + if attributes.key?(:'calculation_type') self.calculation_type = attributes[:'calculation_type'] end @@ -127,10 +131,6 @@ def initialize(attributes = {}) if attributes.key?(:'custom_event') self.custom_event = attributes[:'custom_event'] end - - if attributes.key?(:'points') - self.points = attributes[:'points'] - end end # Show invalid properties with the reasons. Usually used together with valid? @@ -145,7 +145,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', ["PROPORTIONAL", "FIXED"]) + type_validator = EnumAttributeValidator.new('String', ["FIXED", "PROPORTIONAL"]) return false unless type_validator.valid?(@type) calculation_type_validator = EnumAttributeValidator.new('String', ["ORDER_AMOUNT", "ORDER_TOTAL_AMOUNT", "ORDER_METADATA", "ORDER_ITEMS_QUANTITY", "ORDER_ITEMS_AMOUNT", "ORDER_ITEMS_SUBTOTAL_AMOUNT", "CUSTOMER_METADATA", "CUSTOM_EVENT_METADATA"]) return false unless calculation_type_validator.valid?(@calculation_type) @@ -158,12 +158,12 @@ def ==(o) return true if self.equal?(o) self.class == o.class && type == o.type && + points == o.points && calculation_type == o.calculation_type && order == o.order && order_items == o.order_items && customer == o.customer && - custom_event == o.custom_event && - points == o.points + custom_event == o.custom_event end # @see the `==` method @@ -175,7 +175,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type, calculation_type, order, order_items, customer, custom_event, points].hash + [type, points, calculation_type, order, order_items, customer, custom_event].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty.rb b/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty.rb index 79b4ee2e..b2256516 100644 --- a/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty.rb +++ b/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty.rb @@ -17,6 +17,9 @@ module VoucherifySdk class LoyaltiesEarningRulesUpdateResponseBodyLoyalty attr_accessor :type + # Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. + attr_accessor :points + attr_accessor :calculation_type attr_accessor :order @@ -27,9 +30,6 @@ class LoyaltiesEarningRulesUpdateResponseBodyLoyalty attr_accessor :custom_event - # Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points. - attr_accessor :points - class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -56,12 +56,12 @@ def valid?(value) def self.attribute_map { :'type' => :'type', + :'points' => :'points', :'calculation_type' => :'calculation_type', :'order' => :'order', :'order_items' => :'order_items', :'customer' => :'customer', - :'custom_event' => :'custom_event', - :'points' => :'points' + :'custom_event' => :'custom_event' } end @@ -74,12 +74,12 @@ def self.acceptable_attributes def self.openapi_types { :'type' => :'String', + :'points' => :'Integer', :'calculation_type' => :'String', :'order' => :'LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrder', :'order_items' => :'LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrderItems', :'customer' => :'LoyaltiesEarningRulesUpdateResponseBodyLoyaltyCustomer', - :'custom_event' => :'LoyaltiesEarningRulesUpdateResponseBodyLoyaltyCustomEvent', - :'points' => :'Integer' + :'custom_event' => :'LoyaltiesEarningRulesUpdateResponseBodyLoyaltyCustomEvent' } end @@ -87,12 +87,12 @@ def self.openapi_types def self.openapi_nullable Set.new([ :'type', + :'points', :'calculation_type', :'order', :'order_items', :'customer', - :'custom_event', - :'points' + :'custom_event' ]) end @@ -108,6 +108,10 @@ def initialize(attributes = {}) self.type = attributes[:'type'] end + if attributes.key?(:'points') + self.points = attributes[:'points'] + end + if attributes.key?(:'calculation_type') self.calculation_type = attributes[:'calculation_type'] end @@ -127,10 +131,6 @@ def initialize(attributes = {}) if attributes.key?(:'custom_event') self.custom_event = attributes[:'custom_event'] end - - if attributes.key?(:'points') - self.points = attributes[:'points'] - end end # Show invalid properties with the reasons. Usually used together with valid? @@ -145,7 +145,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', ["PROPORTIONAL", "FIXED"]) + type_validator = EnumAttributeValidator.new('String', ["FIXED", "PROPORTIONAL"]) return false unless type_validator.valid?(@type) calculation_type_validator = EnumAttributeValidator.new('String', ["ORDER_AMOUNT", "ORDER_TOTAL_AMOUNT", "ORDER_METADATA", "ORDER_ITEMS_QUANTITY", "ORDER_ITEMS_AMOUNT", "ORDER_ITEMS_SUBTOTAL_AMOUNT", "CUSTOMER_METADATA", "CUSTOM_EVENT_METADATA"]) return false unless calculation_type_validator.valid?(@calculation_type) @@ -158,12 +158,12 @@ def ==(o) return true if self.equal?(o) self.class == o.class && type == o.type && + points == o.points && calculation_type == o.calculation_type && order == o.order && order_items == o.order_items && customer == o.customer && - custom_event == o.custom_event && - points == o.points + custom_event == o.custom_event end # @see the `==` method @@ -175,7 +175,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type, calculation_type, order, order_items, customer, custom_event, points].hash + [type, points, calculation_type, order, order_items, customer, custom_event].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/product_collections_products_list_response_body_data_item.rb b/lib/VoucherifySdk/models/product_collections_products_list_response_body_data_item.rb index b343f07f..21af704f 100644 --- a/lib/VoucherifySdk/models/product_collections_products_list_response_body_data_item.rb +++ b/lib/VoucherifySdk/models/product_collections_products_list_response_body_data_item.rb @@ -28,6 +28,7 @@ class ProductCollectionsProductsListResponseBodyDataItem # A list of product attributes whose values you can customize for given SKUs: `[\"color\",\"size\",\"ranking\"]`. Each child SKU can have a unique value for a given attribute. attr_accessor :attributes + # The metadata object stores all custom attributes assigned to the product. A set of key/value pairs that you can attach to a product object. It can be useful for storing additional information about the product in a structured format. and The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format. attr_accessor :metadata attr_accessor :image_url diff --git a/lib/VoucherifySdk/models/publications_create_request_body.rb b/lib/VoucherifySdk/models/publications_create_request_body.rb index 4b15126a..1ad4cdc9 100644 --- a/lib/VoucherifySdk/models/publications_create_request_body.rb +++ b/lib/VoucherifySdk/models/publications_create_request_body.rb @@ -23,6 +23,7 @@ class PublicationsCreateRequestBody attr_accessor :customer + # The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format. attr_accessor :metadata # Specify the distribution channel. diff --git a/lib/VoucherifySdk/models/publications_create_response_body.rb b/lib/VoucherifySdk/models/publications_create_response_body.rb index a40230f5..3cc2e60b 100644 --- a/lib/VoucherifySdk/models/publications_create_response_body.rb +++ b/lib/VoucherifySdk/models/publications_create_response_body.rb @@ -30,6 +30,7 @@ class PublicationsCreateResponseBody # Customer's `source_id`. attr_accessor :tracking_id + # The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format. attr_accessor :metadata # How the publication was originated. It can be your own custom channel or an example value provided here. diff --git a/lib/VoucherifySdk/models/redemption_entry.rb b/lib/VoucherifySdk/models/redemption_entry.rb index 02898813..c22991f3 100644 --- a/lib/VoucherifySdk/models/redemption_entry.rb +++ b/lib/VoucherifySdk/models/redemption_entry.rb @@ -28,6 +28,7 @@ class RedemptionEntry # Hashed customer source ID. attr_accessor :tracking_id + # The metadata object stores all custom attributes assigned to the redemption. attr_accessor :metadata # For gift cards, this is a positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the number of redeemed credits. For loyalty cards, this is the number of loyalty points used in the transaction. and For gift cards, this represents the number of the credits restored to the card in the rolledback redemption. The number is a negative integer in the smallest currency unit, e.g. -100 cents for $1.00 added back to the card. For loyalty cards, this represents the number of loyalty points restored to the card in the rolledback redemption. The number is a negative integer. diff --git a/lib/VoucherifySdk/models/redemption_entry_customer.rb b/lib/VoucherifySdk/models/redemption_entry_customer.rb index ec6ec4ae..a01b81c0 100644 --- a/lib/VoucherifySdk/models/redemption_entry_customer.rb +++ b/lib/VoucherifySdk/models/redemption_entry_customer.rb @@ -27,6 +27,7 @@ class RedemptionEntryCustomer # A unique identifier of the customer. It can be a customer ID or email from a CRM system, database, or a third-party service. attr_accessor :source_id + # A set of custom key/value pairs that are attached to the customer. It stores all custom attributes assigned to the customer. attr_accessor :metadata # The type of the object represented by JSON. diff --git a/lib/VoucherifySdk/models/redemption_entry_order.rb b/lib/VoucherifySdk/models/redemption_entry_order.rb index 4951a7dd..e8fc8001 100644 --- a/lib/VoucherifySdk/models/redemption_entry_order.rb +++ b/lib/VoucherifySdk/models/redemption_entry_order.rb @@ -54,6 +54,7 @@ class RedemptionEntryOrder # 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. attr_accessor :metadata # The type of the object represented by JSON. @@ -156,7 +157,7 @@ def self.openapi_types :'referrer_id' => :'String', :'customer' => :'RedemptionEntryOrderCustomer', :'referrer' => :'RedemptionEntryOrderReferrer', - :'redemptions' => :'Object' + :'redemptions' => :'Hash' } end @@ -285,7 +286,9 @@ def initialize(attributes = {}) end if attributes.key?(:'redemptions') - self.redemptions = attributes[:'redemptions'] + if (value = attributes[:'redemptions']).is_a?(Hash) + self.redemptions = value + end end end diff --git a/lib/VoucherifySdk/models/redemption_entry_promotion_tier.rb b/lib/VoucherifySdk/models/redemption_entry_promotion_tier.rb index ecbc6722..2f3d8934 100644 --- a/lib/VoucherifySdk/models/redemption_entry_promotion_tier.rb +++ b/lib/VoucherifySdk/models/redemption_entry_promotion_tier.rb @@ -32,6 +32,7 @@ class RedemptionEntryPromotionTier attr_accessor :action + # The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format. attr_accessor :metadata # The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy. diff --git a/lib/VoucherifySdk/models/redemption_entry_voucher.rb b/lib/VoucherifySdk/models/redemption_entry_voucher.rb index 5dd2bd62..e51d67ef 100644 --- a/lib/VoucherifySdk/models/redemption_entry_voucher.rb +++ b/lib/VoucherifySdk/models/redemption_entry_voucher.rb @@ -61,6 +61,7 @@ class RedemptionEntryVoucher # An optional field to keep any extra textual information about the code such as a code description and details. attr_accessor :additional_info + # The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. attr_accessor :metadata attr_accessor :assets diff --git a/lib/VoucherifySdk/models/redemptions_get_response_body.rb b/lib/VoucherifySdk/models/redemptions_get_response_body.rb index 67d2e0cd..e36916d0 100644 --- a/lib/VoucherifySdk/models/redemptions_get_response_body.rb +++ b/lib/VoucherifySdk/models/redemptions_get_response_body.rb @@ -28,6 +28,7 @@ class RedemptionsGetResponseBody # Hashed customer source ID. attr_accessor :tracking_id + # The metadata object stores all custom attributes assigned to the redemption. attr_accessor :metadata # For gift cards, this is a positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the number of redeemed credits. For loyalty cards, this is the number of loyalty points used in the transaction. and For gift cards, this represents the number of the credits restored to the card in the rolledback redemption. The number is a negative integer in the smallest currency unit, e.g. -100 cents for $1.00 added back to the card. For loyalty cards, this represents the number of loyalty points restored to the card in the rolledback redemption. The number is a negative integer. diff --git a/lib/VoucherifySdk/models/redemptions_get_response_body_customer.rb b/lib/VoucherifySdk/models/redemptions_get_response_body_customer.rb index f2282ede..aebe8001 100644 --- a/lib/VoucherifySdk/models/redemptions_get_response_body_customer.rb +++ b/lib/VoucherifySdk/models/redemptions_get_response_body_customer.rb @@ -27,6 +27,7 @@ class RedemptionsGetResponseBodyCustomer # A unique identifier of the customer. It can be a customer ID or email from a CRM system, database, or a third-party service. attr_accessor :source_id + # A set of custom key/value pairs that are attached to the customer. It stores all custom attributes assigned to the customer. attr_accessor :metadata # The type of the object represented by JSON. diff --git a/lib/VoucherifySdk/models/redemptions_get_response_body_order.rb b/lib/VoucherifySdk/models/redemptions_get_response_body_order.rb index 886baf85..c8d10967 100644 --- a/lib/VoucherifySdk/models/redemptions_get_response_body_order.rb +++ b/lib/VoucherifySdk/models/redemptions_get_response_body_order.rb @@ -54,6 +54,7 @@ class RedemptionsGetResponseBodyOrder # 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. attr_accessor :metadata # The type of the object represented by JSON. @@ -156,7 +157,7 @@ def self.openapi_types :'referrer_id' => :'String', :'customer' => :'RedemptionsGetResponseBodyOrderCustomer', :'referrer' => :'RedemptionsGetResponseBodyOrderReferrer', - :'redemptions' => :'Object' + :'redemptions' => :'Hash' } end @@ -285,7 +286,9 @@ def initialize(attributes = {}) end if attributes.key?(:'redemptions') - self.redemptions = attributes[:'redemptions'] + if (value = attributes[:'redemptions']).is_a?(Hash) + self.redemptions = value + end end end diff --git a/lib/VoucherifySdk/models/redemptions_get_response_body_promotion_tier.rb b/lib/VoucherifySdk/models/redemptions_get_response_body_promotion_tier.rb index 3762c005..785402e8 100644 --- a/lib/VoucherifySdk/models/redemptions_get_response_body_promotion_tier.rb +++ b/lib/VoucherifySdk/models/redemptions_get_response_body_promotion_tier.rb @@ -32,6 +32,7 @@ class RedemptionsGetResponseBodyPromotionTier attr_accessor :action + # The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format. attr_accessor :metadata # The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy. diff --git a/lib/VoucherifySdk/models/redemptions_get_response_body_voucher.rb b/lib/VoucherifySdk/models/redemptions_get_response_body_voucher.rb index 9f939597..72f0fa2e 100644 --- a/lib/VoucherifySdk/models/redemptions_get_response_body_voucher.rb +++ b/lib/VoucherifySdk/models/redemptions_get_response_body_voucher.rb @@ -61,6 +61,7 @@ class RedemptionsGetResponseBodyVoucher # An optional field to keep any extra textual information about the code such as a code description and details. attr_accessor :additional_info + # The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. attr_accessor :metadata attr_accessor :assets diff --git a/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item.rb b/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item.rb index 70d115d9..a5f1505a 100644 --- a/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item.rb +++ b/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item.rb @@ -28,6 +28,7 @@ class RedemptionsListResponseBodyRedemptionsItem # Hashed customer source ID. attr_accessor :tracking_id + # The metadata object stores all custom attributes assigned to the redemption. attr_accessor :metadata # For gift cards, this is a positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the number of redeemed credits. For loyalty cards, this is the number of loyalty points used in the transaction. and For gift cards, this represents the number of the credits restored to the card in the rolledback redemption. The number is a negative integer in the smallest currency unit, e.g. -100 cents for $1.00 added back to the card. For loyalty cards, this represents the number of loyalty points restored to the card in the rolledback redemption. The number is a negative integer. @@ -166,6 +167,7 @@ def self.openapi_nullable :'date', :'customer_id', :'tracking_id', + :'metadata', :'redemption', :'result', :'failure_code', diff --git a/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_customer.rb b/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_customer.rb index a77d7ffc..13efc838 100644 --- a/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_customer.rb +++ b/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_customer.rb @@ -27,6 +27,7 @@ class RedemptionsListResponseBodyRedemptionsItemCustomer # A unique identifier of the customer. It can be a customer ID or email from a CRM system, database, or a third-party service. attr_accessor :source_id + # A set of custom key/value pairs that are attached to the customer. It stores all custom attributes assigned to the customer. attr_accessor :metadata # The type of the object represented by JSON. @@ -90,6 +91,7 @@ def self.openapi_nullable :'name', :'email', :'source_id', + :'metadata', :'object' ]) end 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 edbb5d0b..b949f1fe 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 @@ -54,6 +54,7 @@ class RedemptionsListResponseBodyRedemptionsItemOrder # 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. attr_accessor :metadata # The type of the object represented by JSON. @@ -156,7 +157,7 @@ def self.openapi_types :'referrer_id' => :'String', :'customer' => :'RedemptionsListResponseBodyRedemptionsItemOrderCustomer', :'referrer' => :'RedemptionsListResponseBodyRedemptionsItemOrderReferrer', - :'redemptions' => :'Object' + :'redemptions' => :'Hash' } end @@ -176,11 +177,13 @@ def self.openapi_nullable :'items_applied_discount_amount', :'total_applied_discount_amount', :'items', + :'metadata', :'object', :'created_at', :'updated_at', :'customer_id', :'referrer_id', + :'redemptions' ]) end @@ -281,7 +284,9 @@ def initialize(attributes = {}) end if attributes.key?(:'redemptions') - self.redemptions = attributes[:'redemptions'] + if (value = attributes[:'redemptions']).is_a?(Hash) + self.redemptions = value + end end end diff --git a/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_promotion_tier.rb b/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_promotion_tier.rb index 735dd315..6c2382da 100644 --- a/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_promotion_tier.rb +++ b/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_promotion_tier.rb @@ -32,6 +32,7 @@ class RedemptionsListResponseBodyRedemptionsItemPromotionTier attr_accessor :action + # The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format. attr_accessor :metadata # The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy. @@ -164,6 +165,7 @@ def self.openapi_nullable :'updated_at', :'name', :'banner', + :'metadata', :'hierarchy', :'promotion_id', :'campaign_id', diff --git a/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_voucher.rb b/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_voucher.rb index 0d2f4678..ab89870d 100644 --- a/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_voucher.rb +++ b/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_voucher.rb @@ -61,6 +61,7 @@ class RedemptionsListResponseBodyRedemptionsItemVoucher # An optional field to keep any extra textual information about the code such as a code description and details. attr_accessor :additional_info + # The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. attr_accessor :metadata attr_accessor :assets @@ -207,6 +208,7 @@ def self.openapi_nullable :'expiration_date', :'active', :'additional_info', + :'metadata', :'is_referral_code', :'created_at', :'updated_at', diff --git a/lib/VoucherifySdk/models/rewards_create_request_body.rb b/lib/VoucherifySdk/models/rewards_create_request_body.rb index 4f575ea9..d6a10feb 100644 --- a/lib/VoucherifySdk/models/rewards_create_request_body.rb +++ b/lib/VoucherifySdk/models/rewards_create_request_body.rb @@ -20,6 +20,7 @@ class RewardsCreateRequestBody attr_accessor :parameters + # The metadata object stores all custom attributes assigned to the reward. A set of key/value pairs that you can attach to a reward object. It can be useful for storing additional information about the reward in a structured format. attr_accessor :metadata # The number of units of the product that you want to share as a reward. diff --git a/lib/VoucherifySdk/models/rewards_update_request_body.rb b/lib/VoucherifySdk/models/rewards_update_request_body.rb index 2e4103c0..5c2828d6 100644 --- a/lib/VoucherifySdk/models/rewards_update_request_body.rb +++ b/lib/VoucherifySdk/models/rewards_update_request_body.rb @@ -20,6 +20,7 @@ class RewardsUpdateRequestBody attr_accessor :parameters + # The metadata object stores all custom attributes assigned to the reward. A set of key/value pairs that you can attach to a reward object. It can be useful for storing additional information about the reward in a structured format. attr_accessor :metadata # The number of units of the product that you want to share as a reward. diff --git a/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item.rb b/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item.rb index e99db62a..72453786 100644 --- a/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item.rb +++ b/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item.rb @@ -31,6 +31,7 @@ class ValidationsValidateResponseBodyRedeemablesItem attr_accessor :result + # The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable. attr_accessor :metadata attr_accessor :categories @@ -97,6 +98,7 @@ def self.openapi_nullable Set.new([ :'id', :'object', + :'metadata', :'categories' ]) end diff --git a/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item_result_details.rb b/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item_result_details.rb index 00413265..8321c855 100644 --- a/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item_result_details.rb +++ b/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item_result_details.rb @@ -15,15 +15,15 @@ module VoucherifySdk class ValidationsValidateResponseBodyRedeemablesItemResultDetails - attr_accessor :key - attr_accessor :message + attr_accessor :key + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'key' => :'key', - :'message' => :'message' + :'message' => :'message', + :'key' => :'key' } end @@ -35,8 +35,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'key' => :'String', - :'message' => :'String' + :'message' => :'String', + :'key' => :'String' } end @@ -54,13 +54,13 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - if attributes.key?(:'message') self.message = attributes[:'message'] end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -83,8 +83,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - key == o.key && - message == o.message + message == o.message && + key == o.key end # @see the `==` method @@ -96,7 +96,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [key, message].hash + [message, key].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/vouchers_create_request_body.rb b/lib/VoucherifySdk/models/vouchers_create_request_body.rb new file mode 100644 index 00000000..dd248b1e --- /dev/null +++ b/lib/VoucherifySdk/models/vouchers_create_request_body.rb @@ -0,0 +1,431 @@ +=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 VouchersCreateRequestBody + # Code that identifies a voucher. The pattern can use all the letters of the English alphabet, Arabic numerals, and special characters. Pass this attribute in the request body to create a distinct code. Otherwise, either use the `code_config` object to set the rules that the Voucherify API will use to create a random code, or don't pass any code and Voucherify will generate a random code. + attr_accessor :code + + # Identifies the voucher's parent campaign using a unique campaign name. + attr_accessor :campaign + + # Identifies the voucher's parent campaign using a unique campaign ID assigned by the Voucherify API. + attr_accessor :campaign_id + + # The name of the category that this voucher belongs to. Useful when listing vouchers with the [List Vouchers](ref:list-vouchers) endpoint. + attr_accessor :category + + # Unique identifier assigned by Voucherify to the name of the category that this voucher belongs to. Useful when listing vouchers with the [List Vouchers](ref:list-vouchers) endpoint. + attr_accessor :category_id + + # Start date defines when the code starts to be active. Activation timestamp is presented in the ISO 8601 format. Voucher is *inactive before* this date. + attr_accessor :start_date + + # Expiration date defines when the code expires. Expiration timestamp is presented in the ISO 8601 format. Voucher is *inactive after* this date. + attr_accessor :expiration_date + + attr_accessor :validity_timeframe + + # Integer array corresponding to the particular days of the week in which the voucher is valid. - `0` Sunday - `1` Monday - `2` Tuesday - `3` Wednesday - `4` Thursday - `5` Friday - `6` Saturday + attr_accessor :validity_day_of_week + + attr_accessor :validity_hours + + # A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. - `true` indicates an *active* voucher - `false` indicates an *inactive* voucher + attr_accessor :active + + # An optional field to keep any extra textual information about the code such as a code description and details. + attr_accessor :additional_info + + # The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. + attr_accessor :metadata + + # Array containing the ID of the validation rule associated with the voucher. + attr_accessor :validation_rules + + attr_accessor :redemption + + attr_accessor :type + + attr_accessor :loyalty_card + + attr_accessor :code_config + + attr_accessor :gift + + attr_accessor :discount + + 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 + { + :'code' => :'code', + :'campaign' => :'campaign', + :'campaign_id' => :'campaign_id', + :'category' => :'category', + :'category_id' => :'category_id', + :'start_date' => :'start_date', + :'expiration_date' => :'expiration_date', + :'validity_timeframe' => :'validity_timeframe', + :'validity_day_of_week' => :'validity_day_of_week', + :'validity_hours' => :'validity_hours', + :'active' => :'active', + :'additional_info' => :'additional_info', + :'metadata' => :'metadata', + :'validation_rules' => :'validation_rules', + :'redemption' => :'redemption', + :'type' => :'type', + :'loyalty_card' => :'loyalty_card', + :'code_config' => :'code_config', + :'gift' => :'gift', + :'discount' => :'discount' + } + 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 + { + :'code' => :'String', + :'campaign' => :'String', + :'campaign_id' => :'String', + :'category' => :'String', + :'category_id' => :'String', + :'start_date' => :'Time', + :'expiration_date' => :'Time', + :'validity_timeframe' => :'ValidityTimeframe', + :'validity_day_of_week' => :'Array', + :'validity_hours' => :'ValidityHours', + :'active' => :'Boolean', + :'additional_info' => :'String', + :'metadata' => :'Object', + :'validation_rules' => :'Array', + :'redemption' => :'VouchersCreateRequestBodyRedemption', + :'type' => :'String', + :'loyalty_card' => :'SimpleLoyaltyCard', + :'code_config' => :'CodeConfig', + :'gift' => :'Gift', + :'discount' => :'Discount' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'code', + :'campaign', + :'campaign_id', + :'category', + :'category_id', + :'start_date', + :'expiration_date', + :'active', + :'additional_info', + :'metadata', + :'validation_rules', + :'redemption', + :'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?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'campaign') + self.campaign = attributes[:'campaign'] + end + + if attributes.key?(:'campaign_id') + self.campaign_id = attributes[:'campaign_id'] + end + + if attributes.key?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'category_id') + self.category_id = attributes[:'category_id'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'expiration_date') + self.expiration_date = attributes[:'expiration_date'] + end + + if attributes.key?(:'validity_timeframe') + self.validity_timeframe = attributes[:'validity_timeframe'] + end + + if attributes.key?(:'validity_day_of_week') + if (value = attributes[:'validity_day_of_week']).is_a?(Array) + self.validity_day_of_week = value + end + end + + if attributes.key?(:'validity_hours') + self.validity_hours = attributes[:'validity_hours'] + end + + if attributes.key?(:'active') + self.active = attributes[:'active'] + end + + if attributes.key?(:'additional_info') + self.additional_info = attributes[:'additional_info'] + end + + if attributes.key?(:'metadata') + self.metadata = attributes[:'metadata'] + end + + if attributes.key?(:'validation_rules') + if (value = attributes[:'validation_rules']).is_a?(Array) + self.validation_rules = value + end + end + + if attributes.key?(:'redemption') + self.redemption = attributes[:'redemption'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'loyalty_card') + self.loyalty_card = attributes[:'loyalty_card'] + end + + if attributes.key?(:'code_config') + self.code_config = attributes[:'code_config'] + end + + if attributes.key?(:'gift') + self.gift = attributes[:'gift'] + end + + if attributes.key?(:'discount') + self.discount = attributes[:'discount'] + 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", "GIFT_VOUCHER", "DISCOUNT_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 && + code == o.code && + campaign == o.campaign && + campaign_id == o.campaign_id && + category == o.category && + category_id == o.category_id && + start_date == o.start_date && + expiration_date == o.expiration_date && + validity_timeframe == o.validity_timeframe && + validity_day_of_week == o.validity_day_of_week && + validity_hours == o.validity_hours && + active == o.active && + additional_info == o.additional_info && + metadata == o.metadata && + validation_rules == o.validation_rules && + redemption == o.redemption && + type == o.type && + loyalty_card == o.loyalty_card && + code_config == o.code_config && + gift == o.gift && + discount == o.discount + 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 + [code, campaign, campaign_id, category, category_id, start_date, expiration_date, validity_timeframe, validity_day_of_week, validity_hours, active, additional_info, metadata, validation_rules, redemption, type, loyalty_card, code_config, gift, discount].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/exports_get_response_body_parameters_filters.rb b/lib/VoucherifySdk/models/vouchers_create_request_body_redemption.rb similarity index 78% rename from lib/VoucherifySdk/models/exports_get_response_body_parameters_filters.rb rename to lib/VoucherifySdk/models/vouchers_create_request_body_redemption.rb index ab048747..9c33aebc 100644 --- a/lib/VoucherifySdk/models/exports_get_response_body_parameters_filters.rb +++ b/lib/VoucherifySdk/models/vouchers_create_request_body_redemption.rb @@ -14,44 +14,14 @@ require 'time' module VoucherifySdk - class ExportsGetResponseBodyParametersFilters - attr_accessor :junction - - attr_accessor :campaign_id - - attr_accessor :voucher_id - - attr_accessor :created_at - - 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 + class VouchersCreateRequestBodyRedemption + # How many times a voucher can be redeemed. A `null` value means unlimited. + attr_accessor :quantity # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'junction' => :'junction', - :'campaign_id' => :'campaign_id', - :'voucher_id' => :'voucher_id', - :'created_at' => :'created_at' + :'quantity' => :'quantity' } end @@ -63,16 +33,14 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'junction' => :'Junction', - :'campaign_id' => :'FieldConditions', - :'voucher_id' => :'FieldConditions', - :'created_at' => :'FieldConditions' + :'quantity' => :'Integer' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'quantity' ]) end @@ -84,20 +52,8 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'junction') - self.junction = attributes[:'junction'] - end - - if attributes.key?(:'campaign_id') - self.campaign_id = attributes[:'campaign_id'] - end - - if attributes.key?(:'voucher_id') - self.voucher_id = attributes[:'voucher_id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] + if attributes.key?(:'quantity') + self.quantity = attributes[:'quantity'] end end @@ -121,10 +77,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - junction == o.junction && - campaign_id == o.campaign_id && - voucher_id == o.voucher_id && - created_at == o.created_at + quantity == o.quantity end # @see the `==` method @@ -136,7 +89,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [junction, campaign_id, voucher_id, created_at].hash + [quantity].hash end # Builds the object from hash diff --git a/lib/VoucherifySdk/models/vouchers_create_with_specific_code_request_body.rb b/lib/VoucherifySdk/models/vouchers_create_with_specific_code_request_body.rb index d142e2c3..dc7ca0b6 100644 --- a/lib/VoucherifySdk/models/vouchers_create_with_specific_code_request_body.rb +++ b/lib/VoucherifySdk/models/vouchers_create_with_specific_code_request_body.rb @@ -46,6 +46,7 @@ class VouchersCreateWithSpecificCodeRequestBody # An optional field to keep any extra textual information about the code such as a code description and details. attr_accessor :additional_info + # The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. attr_accessor :metadata # Array containing the ID of the validation rule associated with the voucher. diff --git a/lib/VoucherifySdk/models/vouchers_import_create_item_request_body.rb b/lib/VoucherifySdk/models/vouchers_import_create_item_request_body.rb index 11c0a283..065bc8bd 100644 --- a/lib/VoucherifySdk/models/vouchers_import_create_item_request_body.rb +++ b/lib/VoucherifySdk/models/vouchers_import_create_item_request_body.rb @@ -23,6 +23,7 @@ class VouchersImportCreateItemRequestBody # A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. - `true` indicates an *active* voucher - `false` indicates an *inactive* voucher attr_accessor :active + # The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. attr_accessor :metadata # Tag defining the category that this voucher belongs to. Useful when listing vouchers using the [List Vouchers](ref:list-vouchers) endpoint. diff --git a/lib/VoucherifySdk/models/vouchers_update_request_body.rb b/lib/VoucherifySdk/models/vouchers_update_request_body.rb index 545b863a..6e96445f 100644 --- a/lib/VoucherifySdk/models/vouchers_update_request_body.rb +++ b/lib/VoucherifySdk/models/vouchers_update_request_body.rb @@ -40,6 +40,7 @@ class VouchersUpdateRequestBody # An optional field to keep any extra textual information about the code such as a code description and details. attr_accessor :additional_info + # The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. attr_accessor :metadata attr_accessor :type diff --git a/lib/VoucherifySdk/version.rb b/lib/VoucherifySdk/version.rb index 2031b9f1..547fd8ba 100644 --- a/lib/VoucherifySdk/version.rb +++ b/lib/VoucherifySdk/version.rb @@ -11,5 +11,5 @@ =end module VoucherifySdk - VERSION = '7.0.0' + VERSION = '8.0.0' end