voucherify 7.0.0 → 8.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile +1 -1
- data/EXAMPLES.md +3 -3
- data/Gemfile.lock +2 -2
- data/README.md +12 -5
- data/docs/CampaignsCreateRequestBody.md +1 -1
- data/docs/CampaignsImportVoucherItem.md +1 -1
- data/docs/CampaignsUpdateRequestBody.md +1 -1
- data/docs/ClientValidationsValidateResponseBodyRedeemablesItem.md +3 -1
- data/docs/ClientValidationsValidateResponseBodyRedeemablesItemResultDetails.md +1 -1
- data/docs/Discount.md +1 -1
- data/docs/DiscountProduct.md +10 -0
- data/docs/EarningRuleLoyalty.md +1 -1
- data/docs/ExportParameters.md +1 -1
- data/docs/ExportsCreateRequestBodyParameters.md +1 -1
- data/docs/ExportsCreateResponseBodyParameters.md +1 -1
- data/docs/ExportsGetResponseBodyParameters.md +1 -1
- data/docs/LoyaltiesEarningRulesCreateRequestBodyItem.md +1 -1
- data/docs/LoyaltiesEarningRulesCreateRequestBodyItemLoyalty.md +2 -2
- data/docs/LoyaltiesEarningRulesCreateResponseBodyLoyalty.md +1 -1
- data/docs/LoyaltiesEarningRulesDisableResponseBodyLoyalty.md +1 -1
- data/docs/LoyaltiesEarningRulesEnableResponseBodyLoyalty.md +1 -1
- data/docs/LoyaltiesEarningRulesGetResponseBodyLoyalty.md +1 -1
- data/docs/LoyaltiesEarningRulesUpdateRequestBodyLoyalty.md +1 -1
- data/docs/LoyaltiesEarningRulesUpdateResponseBodyLoyalty.md +1 -1
- data/docs/ProductCollectionsProductsListResponseBodyDataItem.md +1 -1
- data/docs/PublicationsCreateRequestBody.md +1 -1
- data/docs/PublicationsCreateResponseBody.md +1 -1
- data/docs/RedemptionEntry.md +1 -1
- data/docs/RedemptionEntryCustomer.md +1 -1
- data/docs/RedemptionEntryOrder.md +2 -2
- data/docs/RedemptionEntryPromotionTier.md +1 -1
- data/docs/RedemptionEntryVoucher.md +1 -1
- data/docs/RedemptionsGetResponseBody.md +1 -1
- data/docs/RedemptionsGetResponseBodyCustomer.md +1 -1
- data/docs/RedemptionsGetResponseBodyOrder.md +2 -2
- data/docs/RedemptionsGetResponseBodyPromotionTier.md +1 -1
- data/docs/RedemptionsGetResponseBodyVoucher.md +1 -1
- data/docs/RedemptionsListResponseBodyRedemptionsItem.md +1 -1
- data/docs/RedemptionsListResponseBodyRedemptionsItemCustomer.md +1 -1
- data/docs/RedemptionsListResponseBodyRedemptionsItemOrder.md +2 -2
- data/docs/RedemptionsListResponseBodyRedemptionsItemPromotionTier.md +1 -1
- data/docs/RedemptionsListResponseBodyRedemptionsItemVoucher.md +1 -1
- data/docs/RewardsCreateRequestBody.md +1 -1
- data/docs/RewardsUpdateRequestBody.md +1 -1
- data/docs/ValidationsRedeemableInapplicable.md +2 -0
- data/docs/ValidationsRedeemableSkipped.md +2 -0
- data/docs/ValidationsValidateResponseBodyRedeemablesItem.md +3 -1
- data/docs/ValidationsValidateResponseBodyRedeemablesItemResultDetails.md +1 -1
- data/docs/VouchersApi.md +2 -2
- data/docs/VouchersCreateRequestBody.md +27 -0
- data/docs/VouchersCreateRequestBodyRedemption.md +8 -0
- data/docs/VouchersCreateWithSpecificCodeRequestBody.md +1 -1
- data/docs/VouchersImportCreateItemRequestBody.md +1 -1
- data/docs/VouchersUpdateRequestBody.md +1 -1
- data/lib/VoucherifySdk/api/vouchers_api.rb +3 -3
- data/lib/VoucherifySdk/models/campaigns_create_request_body.rb +1 -0
- data/lib/VoucherifySdk/models/campaigns_import_voucher_item.rb +1 -0
- data/lib/VoucherifySdk/models/campaigns_update_request_body.rb +1 -0
- data/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item.rb +29 -5
- data/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item_result_details.rb +13 -13
- data/lib/VoucherifySdk/models/discount.rb +2 -1
- data/lib/VoucherifySdk/models/{export_parameters_filters.rb → discount_product.rb} +26 -51
- data/lib/VoucherifySdk/models/earning_rule_loyalty.rb +17 -17
- data/lib/VoucherifySdk/models/export_parameters.rb +3 -2
- data/lib/VoucherifySdk/models/exports_create_request_body_parameters.rb +3 -2
- data/lib/VoucherifySdk/models/exports_create_response_body_parameters.rb +3 -2
- data/lib/VoucherifySdk/models/exports_get_response_body_parameters.rb +3 -2
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item.rb +2 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_loyalty.rb +22 -22
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty.rb +17 -17
- data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty.rb +17 -17
- data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty.rb +17 -17
- data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty.rb +17 -17
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_loyalty.rb +17 -17
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty.rb +17 -17
- data/lib/VoucherifySdk/models/product_collections_products_list_response_body_data_item.rb +1 -0
- data/lib/VoucherifySdk/models/publications_create_request_body.rb +1 -0
- data/lib/VoucherifySdk/models/publications_create_response_body.rb +1 -0
- data/lib/VoucherifySdk/models/redemption_entry.rb +1 -0
- data/lib/VoucherifySdk/models/redemption_entry_customer.rb +1 -0
- data/lib/VoucherifySdk/models/redemption_entry_order.rb +5 -2
- data/lib/VoucherifySdk/models/redemption_entry_promotion_tier.rb +1 -0
- data/lib/VoucherifySdk/models/redemption_entry_voucher.rb +1 -0
- data/lib/VoucherifySdk/models/redemptions_get_response_body.rb +1 -0
- data/lib/VoucherifySdk/models/redemptions_get_response_body_customer.rb +1 -0
- data/lib/VoucherifySdk/models/redemptions_get_response_body_order.rb +5 -2
- data/lib/VoucherifySdk/models/redemptions_get_response_body_promotion_tier.rb +1 -0
- data/lib/VoucherifySdk/models/redemptions_get_response_body_voucher.rb +1 -0
- data/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item.rb +2 -0
- data/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_customer.rb +2 -0
- data/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_order.rb +7 -2
- data/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_promotion_tier.rb +2 -0
- data/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_voucher.rb +2 -0
- data/lib/VoucherifySdk/models/rewards_create_request_body.rb +1 -0
- data/lib/VoucherifySdk/models/rewards_update_request_body.rb +1 -0
- data/lib/VoucherifySdk/models/validations_redeemable_inapplicable.rb +27 -5
- data/lib/VoucherifySdk/models/validations_redeemable_skipped.rb +27 -5
- data/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item.rb +29 -5
- data/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item_result_details.rb +13 -13
- data/lib/VoucherifySdk/models/vouchers_create_request_body.rb +431 -0
- data/lib/VoucherifySdk/models/{exports_get_response_body_parameters_filters.rb → vouchers_create_request_body_redemption.rb} +10 -57
- data/lib/VoucherifySdk/models/vouchers_create_with_specific_code_request_body.rb +1 -0
- data/lib/VoucherifySdk/models/vouchers_import_create_item_request_body.rb +1 -0
- data/lib/VoucherifySdk/models/vouchers_update_request_body.rb +1 -0
- data/lib/VoucherifySdk/version.rb +1 -1
- data/lib/VoucherifySdk.rb +3 -4
- metadata +8 -10
- data/docs/ExportParametersFilters.md +0 -11
- data/docs/ExportsCreateRequestBodyParametersFilters.md +0 -11
- data/docs/ExportsCreateResponseBodyParametersFilters.md +0 -11
- data/docs/ExportsGetResponseBodyParametersFilters.md +0 -11
- data/lib/VoucherifySdk/models/exports_create_request_body_parameters_filters.rb +0 -256
- data/lib/VoucherifySdk/models/exports_create_response_body_parameters_filters.rb +0 -256
@@ -10,4 +10,6 @@
|
|
10
10
|
| **result** | [**ValidationsRedeemableInapplicableResult**](ValidationsRedeemableInapplicableResult.md) | | [optional] |
|
11
11
|
| **metadata** | **Object** | The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable. | [optional] |
|
12
12
|
| **categories** | [**Array<CategoryWithStackingRulesType>**](CategoryWithStackingRulesType.md) | | [optional] |
|
13
|
+
| **campaign_name** | **String** | Campaign name | [optional] |
|
14
|
+
| **campaign_id** | **String** | Unique campaign ID assigned by Voucherify. | [optional] |
|
13
15
|
|
@@ -10,4 +10,6 @@
|
|
10
10
|
| **result** | [**ValidationsRedeemableSkippedResult**](ValidationsRedeemableSkippedResult.md) | | [optional] |
|
11
11
|
| **metadata** | **Object** | The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable. | [optional] |
|
12
12
|
| **categories** | [**Array<CategoryWithStackingRulesType>**](CategoryWithStackingRulesType.md) | | [optional] |
|
13
|
+
| **campaign_name** | **String** | Campaign name | [optional] |
|
14
|
+
| **campaign_id** | **String** | Unique campaign ID assigned by Voucherify. | [optional] |
|
13
15
|
|
@@ -11,6 +11,8 @@
|
|
11
11
|
| **applicable_to** | [**ApplicableToResultList**](ApplicableToResultList.md) | | [optional] |
|
12
12
|
| **inapplicable_to** | [**InapplicableToResultList**](InapplicableToResultList.md) | | [optional] |
|
13
13
|
| **result** | [**ValidationsValidateResponseBodyRedeemablesItemResult**](ValidationsValidateResponseBodyRedeemablesItemResult.md) | | [optional] |
|
14
|
-
| **metadata** | **Object** |
|
14
|
+
| **metadata** | **Object** | The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable. | [optional] |
|
15
15
|
| **categories** | [**Array<CategoryWithStackingRulesType>**](CategoryWithStackingRulesType.md) | | [optional] |
|
16
|
+
| **campaign_name** | **String** | Campaign name | [optional] |
|
17
|
+
| **campaign_id** | **String** | Unique campaign ID assigned by Voucherify. | [optional] |
|
16
18
|
|
data/docs/VouchersApi.md
CHANGED
@@ -351,7 +351,7 @@ end
|
|
351
351
|
|
352
352
|
api_instance = VoucherifySdk::VouchersApi.new
|
353
353
|
opts = {
|
354
|
-
|
354
|
+
vouchers_create_request_body: VoucherifySdk::VouchersCreateRequestBody.new # VouchersCreateRequestBody | Specify the details of the voucher that you would like to create.
|
355
355
|
}
|
356
356
|
|
357
357
|
begin
|
@@ -367,7 +367,7 @@ end
|
|
367
367
|
|
368
368
|
| Name | Type | Description | Notes |
|
369
369
|
| ---- | ---- | ----------- | ----- |
|
370
|
-
| **
|
370
|
+
| **vouchers_create_request_body** | [**VouchersCreateRequestBody**](VouchersCreateRequestBody.md) | Specify the details of the voucher that you would like to create. | [optional] |
|
371
371
|
|
372
372
|
### Return type
|
373
373
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# VoucherifySdk::VouchersCreateRequestBody
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **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] |
|
8
|
+
| **campaign** | **String** | Identifies the voucher's parent campaign using a unique campaign name. | [optional] |
|
9
|
+
| **campaign_id** | **String** | Identifies the voucher's parent campaign using a unique campaign ID assigned by the Voucherify API. | [optional] |
|
10
|
+
| **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] |
|
11
|
+
| **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] |
|
12
|
+
| **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] |
|
13
|
+
| **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] |
|
14
|
+
| **validity_timeframe** | [**ValidityTimeframe**](ValidityTimeframe.md) | | [optional] |
|
15
|
+
| **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] |
|
16
|
+
| **validity_hours** | [**ValidityHours**](ValidityHours.md) | | [optional] |
|
17
|
+
| **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] |
|
18
|
+
| **additional_info** | **String** | An optional field to keep any extra textual information about the code such as a code description and details. | [optional] |
|
19
|
+
| **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] |
|
20
|
+
| **validation_rules** | **Array<String>** | Array containing the ID of the validation rule associated with the voucher. | [optional] |
|
21
|
+
| **redemption** | [**VouchersCreateRequestBodyRedemption**](VouchersCreateRequestBodyRedemption.md) | | [optional] |
|
22
|
+
| **type** | **String** | | [optional] |
|
23
|
+
| **loyalty_card** | [**SimpleLoyaltyCard**](SimpleLoyaltyCard.md) | | [optional] |
|
24
|
+
| **code_config** | [**CodeConfig**](CodeConfig.md) | | [optional] |
|
25
|
+
| **gift** | [**Gift**](Gift.md) | | [optional] |
|
26
|
+
| **discount** | [**Discount**](Discount.md) | | [optional] |
|
27
|
+
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# VoucherifySdk::VouchersCreateRequestBodyRedemption
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **quantity** | **Integer** | How many times a voucher can be redeemed. A `null` value means unlimited. | [optional] |
|
8
|
+
|
@@ -15,7 +15,7 @@
|
|
15
15
|
| **validity_hours** | [**ValidityHours**](ValidityHours.md) | | [optional] |
|
16
16
|
| **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] |
|
17
17
|
| **additional_info** | **String** | An optional field to keep any extra textual information about the code such as a code description and details. | [optional] |
|
18
|
-
| **metadata** | **Object** |
|
18
|
+
| **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] |
|
19
19
|
| **validation_rules** | **Array<String>** | Array containing the ID of the validation rule associated with the voucher. | [optional] |
|
20
20
|
| **redemption** | [**VouchersCreateWithSpecificCodeRequestBodyRedemption**](VouchersCreateWithSpecificCodeRequestBodyRedemption.md) | | [optional] |
|
21
21
|
| **type** | **String** | | [optional] |
|
@@ -7,7 +7,7 @@
|
|
7
7
|
| **code** | **String** | Value representing the imported code. | [optional] |
|
8
8
|
| **redemption** | [**VouchersImportCreateItemRequestBodyRedemption**](VouchersImportCreateItemRequestBodyRedemption.md) | | [optional] |
|
9
9
|
| **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] |
|
10
|
-
| **metadata** | **Object** |
|
10
|
+
| **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] |
|
11
11
|
| **category** | **String** | Tag defining the category that this voucher belongs to. Useful when listing vouchers using the [List Vouchers](ref:list-vouchers) endpoint. | [optional] |
|
12
12
|
| **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] |
|
13
13
|
| **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] |
|
@@ -13,7 +13,7 @@
|
|
13
13
|
| **validity_hours** | [**ValidityHours**](ValidityHours.md) | | [optional] |
|
14
14
|
| **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] |
|
15
15
|
| **additional_info** | **String** | An optional field to keep any extra textual information about the code such as a code description and details. | [optional] |
|
16
|
-
| **metadata** | **Object** |
|
16
|
+
| **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] |
|
17
17
|
| **type** | **String** | | [optional] |
|
18
18
|
| **loyalty_card** | [**SimpleLoyaltyCard**](SimpleLoyaltyCard.md) | | [optional] |
|
19
19
|
| **gift** | [**Gift**](Gift.md) | | [optional] |
|
@@ -332,7 +332,7 @@ module VoucherifySdk
|
|
332
332
|
# Generate Random Code
|
333
333
|
# 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.
|
334
334
|
# @param [Hash] opts the optional parameters
|
335
|
-
# @option opts [
|
335
|
+
# @option opts [VouchersCreateRequestBody] :vouchers_create_request_body Specify the details of the voucher that you would like to create.
|
336
336
|
# @return [VouchersCreateResponseBody]
|
337
337
|
def generate_random_code(opts = {})
|
338
338
|
data, _status_code, _headers = generate_random_code_with_http_info(opts)
|
@@ -342,7 +342,7 @@ module VoucherifySdk
|
|
342
342
|
# Generate Random Code
|
343
343
|
# 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.
|
344
344
|
# @param [Hash] opts the optional parameters
|
345
|
-
# @option opts [
|
345
|
+
# @option opts [VouchersCreateRequestBody] :vouchers_create_request_body Specify the details of the voucher that you would like to create.
|
346
346
|
# @return [Array<(VouchersCreateResponseBody, Integer, Hash)>] VouchersCreateResponseBody data, response status code and response headers
|
347
347
|
private def generate_random_code_with_http_info(opts = {})
|
348
348
|
if @api_client.config.debugging
|
@@ -368,7 +368,7 @@ module VoucherifySdk
|
|
368
368
|
form_params = opts[:form_params] || {}
|
369
369
|
|
370
370
|
# http body (model)
|
371
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'
|
371
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'vouchers_create_request_body'])
|
372
372
|
|
373
373
|
# return_type
|
374
374
|
return_type = opts[:debug_return_type] || 'VouchersCreateResponseBody'
|
@@ -58,6 +58,7 @@ module VoucherifySdk
|
|
58
58
|
# The category assigned to the campaign. Either pass this parameter OR the `category_id`.
|
59
59
|
attr_accessor :category
|
60
60
|
|
61
|
+
# 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.
|
61
62
|
attr_accessor :metadata
|
62
63
|
|
63
64
|
# Array containing the ID of the validation rule associated with the promotion tier.
|
@@ -23,6 +23,7 @@ module VoucherifySdk
|
|
23
23
|
# 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
|
24
24
|
attr_accessor :active
|
25
25
|
|
26
|
+
# 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.
|
26
27
|
attr_accessor :metadata
|
27
28
|
|
28
29
|
# Tag defining the category that this voucher belongs to. Useful when listing vouchers using the [List Vouchers](ref:list-vouchers) endpoint.
|
@@ -34,6 +34,7 @@ module VoucherifySdk
|
|
34
34
|
# The category assigned to the campaign. Either pass this parameter OR the `category_id`.
|
35
35
|
attr_accessor :category
|
36
36
|
|
37
|
+
# 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.
|
37
38
|
attr_accessor :metadata
|
38
39
|
|
39
40
|
# Determine which metadata should be removed from campaign.
|
@@ -31,10 +31,17 @@ module VoucherifySdk
|
|
31
31
|
|
32
32
|
attr_accessor :result
|
33
33
|
|
34
|
+
# The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable.
|
34
35
|
attr_accessor :metadata
|
35
36
|
|
36
37
|
attr_accessor :categories
|
37
38
|
|
39
|
+
# Campaign name
|
40
|
+
attr_accessor :campaign_name
|
41
|
+
|
42
|
+
# Unique campaign ID assigned by Voucherify.
|
43
|
+
attr_accessor :campaign_id
|
44
|
+
|
38
45
|
class EnumAttributeValidator
|
39
46
|
attr_reader :datatype
|
40
47
|
attr_reader :allowable_values
|
@@ -68,7 +75,9 @@ module VoucherifySdk
|
|
68
75
|
:'inapplicable_to' => :'inapplicable_to',
|
69
76
|
:'result' => :'result',
|
70
77
|
:'metadata' => :'metadata',
|
71
|
-
:'categories' => :'categories'
|
78
|
+
:'categories' => :'categories',
|
79
|
+
:'campaign_name' => :'campaign_name',
|
80
|
+
:'campaign_id' => :'campaign_id'
|
72
81
|
}
|
73
82
|
end
|
74
83
|
|
@@ -88,7 +97,9 @@ module VoucherifySdk
|
|
88
97
|
:'inapplicable_to' => :'InapplicableToResultList',
|
89
98
|
:'result' => :'ClientValidationsValidateResponseBodyRedeemablesItemResult',
|
90
99
|
:'metadata' => :'Object',
|
91
|
-
:'categories' => :'Array<CategoryWithStackingRulesType>'
|
100
|
+
:'categories' => :'Array<CategoryWithStackingRulesType>',
|
101
|
+
:'campaign_name' => :'String',
|
102
|
+
:'campaign_id' => :'String'
|
92
103
|
}
|
93
104
|
end
|
94
105
|
|
@@ -97,7 +108,10 @@ module VoucherifySdk
|
|
97
108
|
Set.new([
|
98
109
|
:'id',
|
99
110
|
:'object',
|
100
|
-
:'
|
111
|
+
:'metadata',
|
112
|
+
:'categories',
|
113
|
+
:'campaign_name',
|
114
|
+
:'campaign_id'
|
101
115
|
])
|
102
116
|
end
|
103
117
|
|
@@ -146,6 +160,14 @@ module VoucherifySdk
|
|
146
160
|
self.categories = value
|
147
161
|
end
|
148
162
|
end
|
163
|
+
|
164
|
+
if attributes.key?(:'campaign_name')
|
165
|
+
self.campaign_name = attributes[:'campaign_name']
|
166
|
+
end
|
167
|
+
|
168
|
+
if attributes.key?(:'campaign_id')
|
169
|
+
self.campaign_id = attributes[:'campaign_id']
|
170
|
+
end
|
149
171
|
end
|
150
172
|
|
151
173
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -180,7 +202,9 @@ module VoucherifySdk
|
|
180
202
|
inapplicable_to == o.inapplicable_to &&
|
181
203
|
result == o.result &&
|
182
204
|
metadata == o.metadata &&
|
183
|
-
categories == o.categories
|
205
|
+
categories == o.categories &&
|
206
|
+
campaign_name == o.campaign_name &&
|
207
|
+
campaign_id == o.campaign_id
|
184
208
|
end
|
185
209
|
|
186
210
|
# @see the `==` method
|
@@ -192,7 +216,7 @@ module VoucherifySdk
|
|
192
216
|
# Calculates hash code according to all attributes.
|
193
217
|
# @return [Integer] Hash code
|
194
218
|
def hash
|
195
|
-
[status, id, object, order, applicable_to, inapplicable_to, result, metadata, categories].hash
|
219
|
+
[status, id, object, order, applicable_to, inapplicable_to, result, metadata, categories, campaign_name, campaign_id].hash
|
196
220
|
end
|
197
221
|
|
198
222
|
# Builds the object from hash
|
@@ -15,15 +15,15 @@ require 'time'
|
|
15
15
|
|
16
16
|
module VoucherifySdk
|
17
17
|
class ClientValidationsValidateResponseBodyRedeemablesItemResultDetails
|
18
|
-
attr_accessor :key
|
19
|
-
|
20
18
|
attr_accessor :message
|
21
19
|
|
20
|
+
attr_accessor :key
|
21
|
+
|
22
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
23
23
|
def self.attribute_map
|
24
24
|
{
|
25
|
-
:'
|
26
|
-
:'
|
25
|
+
:'message' => :'message',
|
26
|
+
:'key' => :'key'
|
27
27
|
}
|
28
28
|
end
|
29
29
|
|
@@ -35,8 +35,8 @@ module VoucherifySdk
|
|
35
35
|
# Attribute type mapping.
|
36
36
|
def self.openapi_types
|
37
37
|
{
|
38
|
-
:'
|
39
|
-
:'
|
38
|
+
:'message' => :'String',
|
39
|
+
:'key' => :'String'
|
40
40
|
}
|
41
41
|
end
|
42
42
|
|
@@ -54,13 +54,13 @@ module VoucherifySdk
|
|
54
54
|
h[k.to_sym] = v
|
55
55
|
}
|
56
56
|
|
57
|
-
if attributes.key?(:'key')
|
58
|
-
self.key = attributes[:'key']
|
59
|
-
end
|
60
|
-
|
61
57
|
if attributes.key?(:'message')
|
62
58
|
self.message = attributes[:'message']
|
63
59
|
end
|
60
|
+
|
61
|
+
if attributes.key?(:'key')
|
62
|
+
self.key = attributes[:'key']
|
63
|
+
end
|
64
64
|
end
|
65
65
|
|
66
66
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -83,8 +83,8 @@ module VoucherifySdk
|
|
83
83
|
def ==(o)
|
84
84
|
return true if self.equal?(o)
|
85
85
|
self.class == o.class &&
|
86
|
-
|
87
|
-
|
86
|
+
message == o.message &&
|
87
|
+
key == o.key
|
88
88
|
end
|
89
89
|
|
90
90
|
# @see the `==` method
|
@@ -96,7 +96,7 @@ module VoucherifySdk
|
|
96
96
|
# Calculates hash code according to all attributes.
|
97
97
|
# @return [Integer] Hash code
|
98
98
|
def hash
|
99
|
-
[
|
99
|
+
[message, key].hash
|
100
100
|
end
|
101
101
|
|
102
102
|
# Builds the object from hash
|
@@ -119,7 +119,7 @@ module VoucherifySdk
|
|
119
119
|
:'unit_off' => :'Integer',
|
120
120
|
:'unit_off_formula' => :'String',
|
121
121
|
:'unit_type' => :'String',
|
122
|
-
:'product' => :'
|
122
|
+
:'product' => :'DiscountProduct',
|
123
123
|
:'sku' => :'SimpleSkuDiscountUnit',
|
124
124
|
:'units' => :'Array<DiscountUnitMultipleOneUnit>',
|
125
125
|
:'percent_off' => :'Float',
|
@@ -142,6 +142,7 @@ module VoucherifySdk
|
|
142
142
|
:'unit_off',
|
143
143
|
:'unit_off_formula',
|
144
144
|
:'unit_type',
|
145
|
+
:'product',
|
145
146
|
:'units',
|
146
147
|
:'percent_off',
|
147
148
|
:'percent_off_formula',
|
@@ -14,44 +14,22 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module VoucherifySdk
|
17
|
-
class
|
18
|
-
|
17
|
+
class DiscountProduct
|
18
|
+
# Unique product ID, assigned by Voucherify.
|
19
|
+
attr_accessor :id
|
19
20
|
|
20
|
-
|
21
|
+
# Product's source ID.
|
22
|
+
attr_accessor :source_id
|
21
23
|
|
22
|
-
|
23
|
-
|
24
|
-
attr_accessor :created_at
|
25
|
-
|
26
|
-
class EnumAttributeValidator
|
27
|
-
attr_reader :datatype
|
28
|
-
attr_reader :allowable_values
|
29
|
-
|
30
|
-
def initialize(datatype, allowable_values)
|
31
|
-
@allowable_values = allowable_values.map do |value|
|
32
|
-
case datatype.to_s
|
33
|
-
when /Integer/i
|
34
|
-
value.to_i
|
35
|
-
when /Float/i
|
36
|
-
value.to_f
|
37
|
-
else
|
38
|
-
value
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def valid?(value)
|
44
|
-
!value || allowable_values.include?(value)
|
45
|
-
end
|
46
|
-
end
|
24
|
+
# Product name.
|
25
|
+
attr_accessor :name
|
47
26
|
|
48
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
49
28
|
def self.attribute_map
|
50
29
|
{
|
51
|
-
:'
|
52
|
-
:'
|
53
|
-
:'
|
54
|
-
:'created_at' => :'created_at'
|
30
|
+
:'id' => :'id',
|
31
|
+
:'source_id' => :'source_id',
|
32
|
+
:'name' => :'name'
|
55
33
|
}
|
56
34
|
end
|
57
35
|
|
@@ -63,16 +41,18 @@ module VoucherifySdk
|
|
63
41
|
# Attribute type mapping.
|
64
42
|
def self.openapi_types
|
65
43
|
{
|
66
|
-
:'
|
67
|
-
:'
|
68
|
-
:'
|
69
|
-
:'created_at' => :'FieldConditions'
|
44
|
+
:'id' => :'String',
|
45
|
+
:'source_id' => :'String',
|
46
|
+
:'name' => :'String'
|
70
47
|
}
|
71
48
|
end
|
72
49
|
|
73
50
|
# List of attributes with nullable: true
|
74
51
|
def self.openapi_nullable
|
75
52
|
Set.new([
|
53
|
+
:'id',
|
54
|
+
:'source_id',
|
55
|
+
:'name'
|
76
56
|
])
|
77
57
|
end
|
78
58
|
|
@@ -84,20 +64,16 @@ module VoucherifySdk
|
|
84
64
|
h[k.to_sym] = v
|
85
65
|
}
|
86
66
|
|
87
|
-
if attributes.key?(:'
|
88
|
-
self.
|
89
|
-
end
|
90
|
-
|
91
|
-
if attributes.key?(:'campaign_id')
|
92
|
-
self.campaign_id = attributes[:'campaign_id']
|
67
|
+
if attributes.key?(:'id')
|
68
|
+
self.id = attributes[:'id']
|
93
69
|
end
|
94
70
|
|
95
|
-
if attributes.key?(:'
|
96
|
-
self.
|
71
|
+
if attributes.key?(:'source_id')
|
72
|
+
self.source_id = attributes[:'source_id']
|
97
73
|
end
|
98
74
|
|
99
|
-
if attributes.key?(:'
|
100
|
-
self.
|
75
|
+
if attributes.key?(:'name')
|
76
|
+
self.name = attributes[:'name']
|
101
77
|
end
|
102
78
|
end
|
103
79
|
|
@@ -121,10 +97,9 @@ module VoucherifySdk
|
|
121
97
|
def ==(o)
|
122
98
|
return true if self.equal?(o)
|
123
99
|
self.class == o.class &&
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
created_at == o.created_at
|
100
|
+
id == o.id &&
|
101
|
+
source_id == o.source_id &&
|
102
|
+
name == o.name
|
128
103
|
end
|
129
104
|
|
130
105
|
# @see the `==` method
|
@@ -136,7 +111,7 @@ module VoucherifySdk
|
|
136
111
|
# Calculates hash code according to all attributes.
|
137
112
|
# @return [Integer] Hash code
|
138
113
|
def hash
|
139
|
-
[
|
114
|
+
[id, source_id, name].hash
|
140
115
|
end
|
141
116
|
|
142
117
|
# Builds the object from hash
|
@@ -17,6 +17,9 @@ module VoucherifySdk
|
|
17
17
|
class EarningRuleLoyalty
|
18
18
|
attr_accessor :type
|
19
19
|
|
20
|
+
# Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points.
|
21
|
+
attr_accessor :points
|
22
|
+
|
20
23
|
attr_accessor :calculation_type
|
21
24
|
|
22
25
|
attr_accessor :order
|
@@ -27,9 +30,6 @@ module VoucherifySdk
|
|
27
30
|
|
28
31
|
attr_accessor :custom_event
|
29
32
|
|
30
|
-
# Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points.
|
31
|
-
attr_accessor :points
|
32
|
-
|
33
33
|
class EnumAttributeValidator
|
34
34
|
attr_reader :datatype
|
35
35
|
attr_reader :allowable_values
|
@@ -56,12 +56,12 @@ module VoucherifySdk
|
|
56
56
|
def self.attribute_map
|
57
57
|
{
|
58
58
|
:'type' => :'type',
|
59
|
+
:'points' => :'points',
|
59
60
|
:'calculation_type' => :'calculation_type',
|
60
61
|
:'order' => :'order',
|
61
62
|
:'order_items' => :'order_items',
|
62
63
|
:'customer' => :'customer',
|
63
|
-
:'custom_event' => :'custom_event'
|
64
|
-
:'points' => :'points'
|
64
|
+
:'custom_event' => :'custom_event'
|
65
65
|
}
|
66
66
|
end
|
67
67
|
|
@@ -74,12 +74,12 @@ module VoucherifySdk
|
|
74
74
|
def self.openapi_types
|
75
75
|
{
|
76
76
|
:'type' => :'String',
|
77
|
+
:'points' => :'Integer',
|
77
78
|
:'calculation_type' => :'String',
|
78
79
|
:'order' => :'EarningRuleLoyaltyOrder',
|
79
80
|
:'order_items' => :'EarningRuleLoyaltyOrderItems',
|
80
81
|
:'customer' => :'EarningRuleLoyaltyCustomer',
|
81
|
-
:'custom_event' => :'EarningRuleLoyaltyCustomEvent'
|
82
|
-
:'points' => :'Integer'
|
82
|
+
:'custom_event' => :'EarningRuleLoyaltyCustomEvent'
|
83
83
|
}
|
84
84
|
end
|
85
85
|
|
@@ -87,12 +87,12 @@ module VoucherifySdk
|
|
87
87
|
def self.openapi_nullable
|
88
88
|
Set.new([
|
89
89
|
:'type',
|
90
|
+
:'points',
|
90
91
|
:'calculation_type',
|
91
92
|
:'order',
|
92
93
|
:'order_items',
|
93
94
|
:'customer',
|
94
|
-
:'custom_event'
|
95
|
-
:'points'
|
95
|
+
:'custom_event'
|
96
96
|
])
|
97
97
|
end
|
98
98
|
|
@@ -108,6 +108,10 @@ module VoucherifySdk
|
|
108
108
|
self.type = attributes[:'type']
|
109
109
|
end
|
110
110
|
|
111
|
+
if attributes.key?(:'points')
|
112
|
+
self.points = attributes[:'points']
|
113
|
+
end
|
114
|
+
|
111
115
|
if attributes.key?(:'calculation_type')
|
112
116
|
self.calculation_type = attributes[:'calculation_type']
|
113
117
|
end
|
@@ -127,10 +131,6 @@ module VoucherifySdk
|
|
127
131
|
if attributes.key?(:'custom_event')
|
128
132
|
self.custom_event = attributes[:'custom_event']
|
129
133
|
end
|
130
|
-
|
131
|
-
if attributes.key?(:'points')
|
132
|
-
self.points = attributes[:'points']
|
133
|
-
end
|
134
134
|
end
|
135
135
|
|
136
136
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -145,7 +145,7 @@ module VoucherifySdk
|
|
145
145
|
# @return true if the model is valid
|
146
146
|
def valid?
|
147
147
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
148
|
-
type_validator = EnumAttributeValidator.new('String', ["
|
148
|
+
type_validator = EnumAttributeValidator.new('String', ["FIXED", "PROPORTIONAL"])
|
149
149
|
return false unless type_validator.valid?(@type)
|
150
150
|
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"])
|
151
151
|
return false unless calculation_type_validator.valid?(@calculation_type)
|
@@ -158,12 +158,12 @@ module VoucherifySdk
|
|
158
158
|
return true if self.equal?(o)
|
159
159
|
self.class == o.class &&
|
160
160
|
type == o.type &&
|
161
|
+
points == o.points &&
|
161
162
|
calculation_type == o.calculation_type &&
|
162
163
|
order == o.order &&
|
163
164
|
order_items == o.order_items &&
|
164
165
|
customer == o.customer &&
|
165
|
-
custom_event == o.custom_event
|
166
|
-
points == o.points
|
166
|
+
custom_event == o.custom_event
|
167
167
|
end
|
168
168
|
|
169
169
|
# @see the `==` method
|
@@ -175,7 +175,7 @@ module VoucherifySdk
|
|
175
175
|
# Calculates hash code according to all attributes.
|
176
176
|
# @return [Integer] Hash code
|
177
177
|
def hash
|
178
|
-
[type, calculation_type, order, order_items, customer, custom_event
|
178
|
+
[type, points, calculation_type, order, order_items, customer, custom_event].hash
|
179
179
|
end
|
180
180
|
|
181
181
|
# Builds the object from hash
|
@@ -20,6 +20,7 @@ module VoucherifySdk
|
|
20
20
|
# Array of strings containing the data in the export. These fields define the headers in the CSV file.
|
21
21
|
attr_accessor :fields
|
22
22
|
|
23
|
+
# 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.\"
|
23
24
|
attr_accessor :filters
|
24
25
|
|
25
26
|
class EnumAttributeValidator
|
@@ -63,7 +64,7 @@ module VoucherifySdk
|
|
63
64
|
{
|
64
65
|
:'order' => :'String',
|
65
66
|
:'fields' => :'Array<String>',
|
66
|
-
:'filters' => :'
|
67
|
+
:'filters' => :'Object'
|
67
68
|
}
|
68
69
|
end
|
69
70
|
|
@@ -111,7 +112,7 @@ module VoucherifySdk
|
|
111
112
|
# @return true if the model is valid
|
112
113
|
def valid?
|
113
114
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
114
|
-
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"])
|
115
|
+
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"])
|
115
116
|
return false unless order_validator.valid?(@order)
|
116
117
|
true
|
117
118
|
end
|