Skip to content

Commit

Permalink
v7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
p-zielinski committed Oct 2, 2024
1 parent 060de80 commit f840547
Show file tree
Hide file tree
Showing 100 changed files with 2,683 additions and 741 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /app
COPY . .

RUN gem build VoucherifySdk.gemspec
RUN gem install voucherify-6.0.0.gem
RUN gem install voucherify-7.0.0.gem
RUN gem install dotenv
RUN gem install rspec

Expand Down
6 changes: 3 additions & 3 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ gem build VoucherifySdk.gemspec
Then either install the gem locally:

```shell
gem install ./VoucherifySdk-6.0.0.gem
gem install ./VoucherifySdk-7.0.0.gem
```

(for development, run `gem install --dev ./VoucherifySdk-6.0.0.gem` to install the development dependencies)
(for development, run `gem install --dev ./VoucherifySdk-7.0.0.gem` to install the development dependencies)

Add this to the Gemfile:

```shell
gem 'VoucherifySdk', '~> 6.0.0'
gem 'VoucherifySdk', '~> 7.0.0'
```

Then install dependencies with bundler
Expand Down
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ Remember that this SDK is auto generated (except of the tests) so changes made h

## 📅 Changelog

- **2024-10-02** - `7.0.0`
- Fix object parsing in query. For example `filters` while listing redemptions.
- !!! BREAKING CHANGES !!!
- Pagination changed on listing card transactions - NO `page` param is supported - use `starting_after_id` instead.
- Pagination changed on listing voucher transactions - NO `page` param is supported - use `starting_after_id` instead.
- ApplicableToEffect - changed - `EVERY` -> `TO_EVERY`, `CHEAPEST` -> `TO_CHEAPEST`, `MOST_EXPENSIVE` -> `TO_MOST_EXPENSIVE`, 2 new values introduced.
- `list_publications` parameter `filters` have changed - now uses `ParameterFiltersListPublications` instead of `String`
- `ParameterFiltersListRedemptions` and `ParameterFiltersListCustomerRedeemables` have been updated
- **2024-09-05** - `6.0.0` - The new version of the SKD includes coverage for all the most commonly used Voucherify endpoints and supports typed models.

*Previous versions of the SDK are no longer supported, and we highly recommend upgrading to version 6.0.0, which is now designated as Long-Term Support (LTS).*
Expand Down Expand Up @@ -493,6 +501,8 @@ Class | Method | HTTP request | Description
- [VoucherifySdk::ExportsGetResponseBodyResult](docs/ExportsGetResponseBodyResult.md)
- [VoucherifySdk::ExportsListResponseBody](docs/ExportsListResponseBody.md)
- [VoucherifySdk::FieldConditions](docs/FieldConditions.md)
- [VoucherifySdk::FilterConditionsDateTime](docs/FilterConditionsDateTime.md)
- [VoucherifySdk::FilterConditionsDateTimeConditions](docs/FilterConditionsDateTimeConditions.md)
- [VoucherifySdk::FilterConditionsString](docs/FilterConditionsString.md)
- [VoucherifySdk::FiltersCondition](docs/FiltersCondition.md)
- [VoucherifySdk::Gift](docs/Gift.md)
Expand Down Expand Up @@ -790,8 +800,6 @@ Class | Method | HTTP request | Description
- [VoucherifySdk::ParameterFiltersListCustomerRedeemablesCampaignId](docs/ParameterFiltersListCustomerRedeemablesCampaignId.md)
- [VoucherifySdk::ParameterFiltersListCustomerRedeemablesCampaignType](docs/ParameterFiltersListCustomerRedeemablesCampaignType.md)
- [VoucherifySdk::ParameterFiltersListCustomerRedeemablesCampaignTypeConditions](docs/ParameterFiltersListCustomerRedeemablesCampaignTypeConditions.md)
- [VoucherifySdk::ParameterFiltersListCustomerRedeemablesCreatedAt](docs/ParameterFiltersListCustomerRedeemablesCreatedAt.md)
- [VoucherifySdk::ParameterFiltersListCustomerRedeemablesCreatedAtConditions](docs/ParameterFiltersListCustomerRedeemablesCreatedAtConditions.md)
- [VoucherifySdk::ParameterFiltersListCustomerRedeemablesHolderRole](docs/ParameterFiltersListCustomerRedeemablesHolderRole.md)
- [VoucherifySdk::ParameterFiltersListCustomerRedeemablesHolderRoleConditions](docs/ParameterFiltersListCustomerRedeemablesHolderRoleConditions.md)
- [VoucherifySdk::ParameterFiltersListCustomerRedeemablesId](docs/ParameterFiltersListCustomerRedeemablesId.md)
Expand All @@ -800,6 +808,16 @@ Class | Method | HTTP request | Description
- [VoucherifySdk::ParameterFiltersListCustomerRedeemablesRedeemableObjectConditions](docs/ParameterFiltersListCustomerRedeemablesRedeemableObjectConditions.md)
- [VoucherifySdk::ParameterFiltersListCustomerRedeemablesVoucherType](docs/ParameterFiltersListCustomerRedeemablesVoucherType.md)
- [VoucherifySdk::ParameterFiltersListCustomerRedeemablesVoucherTypeConditions](docs/ParameterFiltersListCustomerRedeemablesVoucherTypeConditions.md)
- [VoucherifySdk::ParameterFiltersListPublications](docs/ParameterFiltersListPublications.md)
- [VoucherifySdk::ParameterFiltersListPublicationsCampaignName](docs/ParameterFiltersListPublicationsCampaignName.md)
- [VoucherifySdk::ParameterFiltersListPublicationsCustomerId](docs/ParameterFiltersListPublicationsCustomerId.md)
- [VoucherifySdk::ParameterFiltersListPublicationsFailureCode](docs/ParameterFiltersListPublicationsFailureCode.md)
- [VoucherifySdk::ParameterFiltersListPublicationsIsReferralCode](docs/ParameterFiltersListPublicationsIsReferralCode.md)
- [VoucherifySdk::ParameterFiltersListPublicationsParentObjectId](docs/ParameterFiltersListPublicationsParentObjectId.md)
- [VoucherifySdk::ParameterFiltersListPublicationsRelatedObjectId](docs/ParameterFiltersListPublicationsRelatedObjectId.md)
- [VoucherifySdk::ParameterFiltersListPublicationsResult](docs/ParameterFiltersListPublicationsResult.md)
- [VoucherifySdk::ParameterFiltersListPublicationsSourceId](docs/ParameterFiltersListPublicationsSourceId.md)
- [VoucherifySdk::ParameterFiltersListPublicationsVoucherType](docs/ParameterFiltersListPublicationsVoucherType.md)
- [VoucherifySdk::ParameterFiltersListRedemptions](docs/ParameterFiltersListRedemptions.md)
- [VoucherifySdk::ParameterFiltersListRedemptionsCampaignName](docs/ParameterFiltersListRedemptionsCampaignName.md)
- [VoucherifySdk::ParameterFiltersListRedemptionsCustomerId](docs/ParameterFiltersListRedemptionsCustomerId.md)
Expand All @@ -825,6 +843,7 @@ Class | Method | HTTP request | Description
- [VoucherifySdk::ParameterOrderListPublications](docs/ParameterOrderListPublications.md)
- [VoucherifySdk::ParameterOrderListRedeemables](docs/ParameterOrderListRedeemables.md)
- [VoucherifySdk::ParameterOrderListRedemptions](docs/ParameterOrderListRedemptions.md)
- [VoucherifySdk::ParameterOrderListTransactions](docs/ParameterOrderListTransactions.md)
- [VoucherifySdk::ParameterOrderListValidationRuleAssignments](docs/ParameterOrderListValidationRuleAssignments.md)
- [VoucherifySdk::ParameterOrderListValidationRules](docs/ParameterOrderListValidationRules.md)
- [VoucherifySdk::ParameterOrderVouchers](docs/ParameterOrderVouchers.md)
Expand Down
18 changes: 18 additions & 0 deletions __tests__/lib/stackables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,21 @@ def redeem_stacked_discounts(redemptions_api_instance, voucher_ids)
return nil;
end
end

def list_redemptions(redemptions_api_instance)
begin
redemptions = @redemptions_api_instance.list_redemptions({
filters: VoucherifySdk::ParameterFiltersListRedemptions.new({
voucher_code: VoucherifySdk::ParameterFiltersListRedemptionsVoucherCode.new({
conditions: VoucherifySdk::FilterConditionsString.new({
not_in: ["123"]
})
})
})
})

expect(redemptions).not_to be_nil
rescue VoucherifySdk::ApiError => e
return nil
end
end
5 changes: 5 additions & 0 deletions __tests__/spec/09_redemptions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,10 @@
# expect(validate_deep_match(filtered_snapshot, result)).to be true
end

it 'should list redemptions', :order => :third do
redemptions = list_redemptions(@redemptions_api_instance)

expect(redemptions).not_to be_nil
end

end
14 changes: 7 additions & 7 deletions docs/ApplicableTo.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **object** | **String** | This object stores information about the product collection. | [optional] |
| **id** | **String** | Unique product collection ID assigned by Voucherify. | [optional] |
| **source_id** | **String** | The source ID from your inventory system. | [optional] |
| **object** | **String** | This object stores information about the resource to which the discount is applicable. | [optional] |
| **id** | **String** | Unique product collection, product, or SKU identifier assigned by Voucherify. | [optional] |
| **source_id** | **String** | The source identifier from your inventory system. | [optional] |
| **product_id** | **String** | Parent product's unique ID assigned by Voucherify. | [optional] |
| **product_source_id** | **String** | Parent product's source ID from your inventory system. | [optional] |
| **strict** | **Boolean** | | [optional] |
Expand All @@ -17,8 +17,8 @@
| **aggregated_quantity_limit** | **Integer** | The maximum number of units allowed to be discounted combined across all matched order line items. | [optional] |
| **amount_limit** | **Integer** | Upper limit allowed to be applied as a discount per order line item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600. | [optional] |
| **aggregated_amount_limit** | **Integer** | Maximum discount amount per order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects: - `APPLY_TO_ITEMS` (each item subtotal is discounted equally) - `APPLY_TO_ITEMS_BY_QUANTITY` (each unit of matched products has the same discount value) | [optional] |
| **order_item_indices** | **Array<Integer>** | | [optional] |
| **repeat** | **Integer** | | [optional] |
| **skip_initially** | **Integer** | | [optional] |
| **target** | **String** | | [optional] |
| **order_item_indices** | **Array<Integer>** | Determines the order in which the discount is applied to the products or SKUs sent in the `order` object in the request. The counting begins from `0`. | [optional] |
| **repeat** | **Integer** | Determines the recurrence of the discount, e.g. `\"repeat\": 3` means that the discount is applied to every third item. | [optional] |
| **skip_initially** | **Integer** | Determines how many items are skipped before the discount is applied. | [optional] |
| **target** | **String** | Determines to which kinds of objects the discount is applicable. `\"ITEM\"` includes products and SKUs. | [optional] |

2 changes: 1 addition & 1 deletion docs/ClientPromotionsTiersListResponseBody.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
| **data_ref** | **String** | Identifies the name of the attribute that contains the array of promotion tier objects. | [optional][default to 'tiers'] |
| **tiers** | [**Array<PromotionTier>**](PromotionTier.md) | Contains array of promotion tier objects. | [optional] |
| **total** | **Integer** | Total number of promotion tiers. | [optional] |
| **has_more** | **Boolean** | As query results are always limited (by the limit parameter), the `has_more` flag indicates if there are more records for given filter parameters. This lets you know if you can run another request (with a different page or a different start date filter) to get more records returned in the results. | [optional] |
| **has_more** | **Boolean** | As query results are always limited (by the limit parameter), the `has_more` flag indicates if there are more records for given filter parameters. This lets you know if you can run another request to get more records returned in the results. | [optional] |

2 changes: 1 addition & 1 deletion docs/CustomersActivityListResponseBody.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
| **data_ref** | **String** | Identifies the name of the attribute that contains the array of customer activity objects. | [optional][default to 'data'] |
| **data** | [**Array<CustomerActivity>**](CustomerActivity.md) | Array of customer activity objects. | [optional] |
| **has_more** | **Boolean** | As query results are always limited (by the limit parameter), the `has_more` flag indicates if there are more records for given filter parameters. This lets you know if you can run another request with a `starting_after_id` query or a different limit to get more records returned in the results. | [optional] |
| **more_starting_after** | **String** | Returns an ID that can be used to return another page of results. Use the event id in the `starting_after_id` query parameter to display another page of the results starting after the event with that ID. | [optional] |
| **more_starting_after** | **String** | Returns an ID that can be used to return another page of results. Use the event ID in the `starting_after_id` query parameter to display another page of the results starting after the event with that ID. | [optional] |

2 changes: 1 addition & 1 deletion docs/Error.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| ---- | ---- | ----------- | ----- |
| **code** | **Integer** | Error's HTTP status code. | [optional] |
| **key** | **String** | Short string describing the kind of error which occurred. | [optional] |
| **message** | **String** | A human-readable message providing a short description about the error. | [optional] |
| **message** | **String** | A human-readable message providing a short description of the error. | [optional] |
| **details** | **String** | A human-readable message providing more details about the error. | [optional] |
| **request_id** | **String** | This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team. | [optional] |
| **resource_id** | **String** | Unique resource ID that can be used in another endpoint to get more details. | [optional] |
Expand Down
8 changes: 8 additions & 0 deletions docs/FilterConditionsDateTime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# VoucherifySdk::FilterConditionsDateTime

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **conditions** | [**FilterConditionsDateTimeConditions**](FilterConditionsDateTimeConditions.md) | | [optional] |

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# VoucherifySdk::ParameterFiltersListCustomerRedeemablesCreatedAtConditions
# VoucherifySdk::FilterConditionsDateTimeConditions

## Properties

Expand Down
14 changes: 7 additions & 7 deletions docs/InapplicableTo.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **object** | **String** | This object stores information about the product collection. | [optional] |
| **id** | **String** | Unique product collection ID assigned by Voucherify. | [optional] |
| **source_id** | **String** | The source ID from your inventory system. | [optional] |
| **object** | **String** | This object stores information about the resource to which the discount is applicable. | [optional] |
| **id** | **String** | Unique product collection, product, or SKU identifier assigned by Voucherify. | [optional] |
| **source_id** | **String** | The source identifier from your inventory system. | [optional] |
| **product_id** | **String** | Parent product's unique ID assigned by Voucherify. | [optional] |
| **product_source_id** | **String** | Parent product's source ID from your inventory system. | [optional] |
| **strict** | **Boolean** | | [optional] |
Expand All @@ -17,8 +17,8 @@
| **aggregated_quantity_limit** | **Integer** | The maximum number of units allowed to be discounted combined across all matched order line items. | [optional] |
| **amount_limit** | **Integer** | Upper limit allowed to be applied as a discount per order line item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600. | [optional] |
| **aggregated_amount_limit** | **Integer** | Maximum discount amount per order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects: - `APPLY_TO_ITEMS` (each item subtotal is discounted equally) - `APPLY_TO_ITEMS_BY_QUANTITY` (each unit of matched products has the same discount value) | [optional] |
| **order_item_indices** | **Array<Integer>** | | [optional] |
| **repeat** | **Integer** | | [optional] |
| **skip_initially** | **Integer** | | [optional] |
| **target** | **String** | | [optional] |
| **order_item_indices** | **Array<Integer>** | Determines the order in which the discount is applied to the products or SKUs sent in the `order` object in the request. The counting begins from `0`. | [optional] |
| **repeat** | **Integer** | Determines the recurrence of the discount, e.g. `\"repeat\": 3` means that the discount is applied to every third item. | [optional] |
| **skip_initially** | **Integer** | Determines how many items are skipped before the discount is applied. | [optional] |
| **target** | **String** | Determines to which kinds of objects the discount is applicable. `\"ITEM\"` includes products and SKUs. | [optional] |

12 changes: 9 additions & 3 deletions docs/LoyaltiesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,9 @@ end
api_instance = VoucherifySdk::LoyaltiesApi.new
member_id = 'member_id_example' # String | A unique code identifying the loyalty card that you are looking to retrieve transaction data for.
opts = {
limit: 56 # Integer | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.
limit: 56, # Integer | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.
order: VoucherifySdk::ParameterOrderListTransactions::ID, # ParameterOrderListTransactions | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.
starting_after_id: 'starting_after_id_example' # String | A cursor for pagination. It retrieves the transactions starting after a transaction with the given ID.
}

begin
Expand All @@ -1435,6 +1437,8 @@ end
| ---- | ---- | ----------- | ----- |
| **member_id** | **String** | A unique code identifying the loyalty card that you are looking to retrieve transaction data for. | |
| **limit** | **Integer** | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. | [optional] |
| **order** | [**ParameterOrderListTransactions**](.md) | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. | [optional] |
| **starting_after_id** | **String** | A cursor for pagination. It retrieves the transactions starting after a transaction with the given ID. | [optional] |

### Return type

Expand Down Expand Up @@ -1481,7 +1485,8 @@ campaign_id = 'campaign_id_example' # String | A unique identifier of the loyalt
member_id = 'member_id_example' # String | A unique code identifying the loyalty card that you are looking to retrieve transaction data for.
opts = {
limit: 56, # Integer | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.
page: 56 # Integer | Which page of results to return. The lowest value is 1.
order: VoucherifySdk::ParameterOrderListTransactions::ID, # ParameterOrderListTransactions | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.
starting_after_id: 'starting_after_id_example' # String | A cursor for pagination. It retrieves the transactions starting after a transaction with the given ID.
}

begin
Expand All @@ -1500,7 +1505,8 @@ end
| **campaign_id** | **String** | A unique identifier of the loyalty campaign containing the voucher whose transactions you would like to return. | |
| **member_id** | **String** | A unique code identifying the loyalty card that you are looking to retrieve transaction data for. | |
| **limit** | **Integer** | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. | [optional] |
| **page** | **Integer** | Which page of results to return. The lowest value is 1. | [optional] |
| **order** | [**ParameterOrderListTransactions**](.md) | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. | [optional] |
| **starting_after_id** | **String** | A cursor for pagination. It retrieves the transactions starting after a transaction with the given ID. | [optional] |

### Return type

Expand Down
Loading

0 comments on commit f840547

Please sign in to comment.