diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 43530b54..86f9243b 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -6,6 +6,7 @@ .gitignore .gitlab-ci.yml .travis.yml +LICENSE MIGRATION.md Makefile README.md @@ -693,6 +694,7 @@ docs/NewReferralsForMultipleAdvocates.md docs/NewReturn.md docs/NewRevisionVersion.md docs/NewReward.md +docs/NewRewardBudget.md docs/NewRiskNotification.md docs/NewRole.md docs/NewRoleV2.md @@ -789,11 +791,15 @@ docs/RevisionActivation.md docs/RevisionActivationRequest.md docs/RevisionVersion.md docs/Reward.md +docs/RewardBudget.md +docs/RewardBudgetLimitCounter.md +docs/RewardBudgetWithLimitCounter.md docs/RewardCatalogItem.md docs/RewardEligibility.md docs/RewardEligibilityFailureDetails.md docs/RewardPointsRequired.md docs/RewardUnlockRejection.md +docs/RewardWithBudgets.md docs/RewardWithUnlocks.md docs/Risk.md docs/RiskAffectedEntityItem.md @@ -962,6 +968,7 @@ docs/UpdatePriceType.md docs/UpdateReferral.md docs/UpdateReferralBatch.md docs/UpdateReward.md +docs/UpdateRewardBudget.md docs/UpdateRiskNotification.md docs/UpdateRole.md docs/UpdateStore.md @@ -1682,6 +1689,7 @@ talon_one/models/new_referrals_for_multiple_advocates.py talon_one/models/new_return.py talon_one/models/new_revision_version.py talon_one/models/new_reward.py +talon_one/models/new_reward_budget.py talon_one/models/new_risk_notification.py talon_one/models/new_role.py talon_one/models/new_role_v2.py @@ -1778,11 +1786,15 @@ talon_one/models/revision_activation.py talon_one/models/revision_activation_request.py talon_one/models/revision_version.py talon_one/models/reward.py +talon_one/models/reward_budget.py +talon_one/models/reward_budget_limit_counter.py +talon_one/models/reward_budget_with_limit_counter.py talon_one/models/reward_catalog_item.py talon_one/models/reward_eligibility.py talon_one/models/reward_eligibility_failure_details.py talon_one/models/reward_points_required.py talon_one/models/reward_unlock_rejection.py +talon_one/models/reward_with_budgets.py talon_one/models/reward_with_unlocks.py talon_one/models/risk.py talon_one/models/risk_affected_entity_item.py @@ -1951,6 +1963,7 @@ talon_one/models/update_price_type.py talon_one/models/update_referral.py talon_one/models/update_referral_batch.py talon_one/models/update_reward.py +talon_one/models/update_reward_budget.py talon_one/models/update_risk_notification.py talon_one/models/update_role.py talon_one/models/update_store.py @@ -2662,6 +2675,7 @@ test/test_new_referrals_for_multiple_advocates.py test/test_new_return.py test/test_new_revision_version.py test/test_new_reward.py +test/test_new_reward_budget.py test/test_new_risk_notification.py test/test_new_role.py test/test_new_role_v2.py @@ -2758,11 +2772,15 @@ test/test_revision_activation.py test/test_revision_activation_request.py test/test_revision_version.py test/test_reward.py +test/test_reward_budget.py +test/test_reward_budget_limit_counter.py +test/test_reward_budget_with_limit_counter.py test/test_reward_catalog_item.py test/test_reward_eligibility.py test/test_reward_eligibility_failure_details.py test/test_reward_points_required.py test/test_reward_unlock_rejection.py +test/test_reward_with_budgets.py test/test_reward_with_unlocks.py test/test_risk.py test/test_risk_affected_entity_item.py @@ -2931,6 +2949,7 @@ test/test_update_price_type.py test/test_update_referral.py test/test_update_referral_batch.py test/test_update_reward.py +test/test_update_reward_budget.py test/test_update_risk_notification.py test/test_update_role.py test/test_update_store.py diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..833949e6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Talon.One GmbH + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 9fb131c5..33508759 100644 --- a/README.md +++ b/README.md @@ -1082,6 +1082,7 @@ Class | Method | HTTP request | Description - [NewReturn](docs/NewReturn.md) - [NewRevisionVersion](docs/NewRevisionVersion.md) - [NewReward](docs/NewReward.md) +- [NewRewardBudget](docs/NewRewardBudget.md) - [NewRiskNotification](docs/NewRiskNotification.md) - [NewRole](docs/NewRole.md) - [NewRoleV2](docs/NewRoleV2.md) @@ -1178,11 +1179,15 @@ Class | Method | HTTP request | Description - [RevisionActivationRequest](docs/RevisionActivationRequest.md) - [RevisionVersion](docs/RevisionVersion.md) - [Reward](docs/Reward.md) +- [RewardBudget](docs/RewardBudget.md) +- [RewardBudgetLimitCounter](docs/RewardBudgetLimitCounter.md) +- [RewardBudgetWithLimitCounter](docs/RewardBudgetWithLimitCounter.md) - [RewardCatalogItem](docs/RewardCatalogItem.md) - [RewardEligibility](docs/RewardEligibility.md) - [RewardEligibilityFailureDetails](docs/RewardEligibilityFailureDetails.md) - [RewardPointsRequired](docs/RewardPointsRequired.md) - [RewardUnlockRejection](docs/RewardUnlockRejection.md) +- [RewardWithBudgets](docs/RewardWithBudgets.md) - [RewardWithUnlocks](docs/RewardWithUnlocks.md) - [Risk](docs/Risk.md) - [RiskAffectedEntityItem](docs/RiskAffectedEntityItem.md) @@ -1351,6 +1356,7 @@ Class | Method | HTTP request | Description - [UpdateReferral](docs/UpdateReferral.md) - [UpdateReferralBatch](docs/UpdateReferralBatch.md) - [UpdateReward](docs/UpdateReward.md) +- [UpdateRewardBudget](docs/UpdateRewardBudget.md) - [UpdateRiskNotification](docs/UpdateRiskNotification.md) - [UpdateRole](docs/UpdateRole.md) - [UpdateStore](docs/UpdateStore.md) diff --git a/docs/AwardDiscountBlock.md b/docs/AwardDiscountBlock.md index df450e6d..f7db812e 100644 --- a/docs/AwardDiscountBlock.md +++ b/docs/AwardDiscountBlock.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **value** | [**AwardDiscountBlock1Value**](AwardDiscountBlock1Value.md) | | **partial** | **bool** | Whether to apply a partial discount when the requested value exceeds the configured budget. | **target** | [**AwardDiscountTarget**](AwardDiscountTarget.md) | | +**excluded_from_price_history** | **bool** | When set to `true`, the applied discount is excluded from the item's [price history](https://docs.talon.one/docs/dev/integration-guides/best-prior-price#price-history). | [optional] ## Example diff --git a/docs/Block.md b/docs/Block.md index 6eaf9701..96ddfd9b 100644 --- a/docs/Block.md +++ b/docs/Block.md @@ -17,6 +17,7 @@ Name | Type | Description | Notes **value** | [**RedeemLoyaltyPointsBlock1Value**](RedeemLoyaltyPointsBlock1Value.md) | | **partial** | **bool** | When `true`, applies a partial points reward when the requested value exceeds the configured budget. | **target** | [**AwardLoyaltyPointsTarget**](AwardLoyaltyPointsTarget.md) | | +**excluded_from_price_history** | **bool** | When set to `true`, the applied discount is excluded from the item's [price history](https://docs.talon.one/docs/dev/integration-guides/best-prior-price#price-history). | [optional] **expression** | **List[object]** | The raw Talang expression as an array. For a function call, the first element is the function name and subsequent elements are its arguments. For any other expression (for example a bare attribute path or a literal value), this is a single-element array containing that value. | **notification_type** | **str** | The type of notification to display. | **title** | **str** | The notification heading shown to the customer. | diff --git a/docs/CatalogActionFilter.md b/docs/CatalogActionFilter.md index 54c32f76..236d1fdf 100644 --- a/docs/CatalogActionFilter.md +++ b/docs/CatalogActionFilter.md @@ -6,9 +6,9 @@ The properties for a single filtering condition in a catalog sync action. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**attr** | **str** | The name of the attribute to filter on. | +**attr** | **str** | The name of the attribute to filter on. The attribute must exist in the catalog. For the `LT`, `LE`, `GT`, and `GE` comparison operators, the attribute must be of type `number`. | **op** | **str** | The filtering operator. | -**value** | **object** | The value to filter for. | +**value** | **object** | The value to filter for. For the `LT`, `LE`, `GT`, and `GE` comparison operators, the value must be a number or a numeric string. | ## Example diff --git a/docs/CustomerInventory.md b/docs/CustomerInventory.md index 64abb988..9dbf2494 100644 --- a/docs/CustomerInventory.md +++ b/docs/CustomerInventory.md @@ -10,8 +10,8 @@ Name | Type | Description | Notes **referrals** | [**List[InventoryReferral]**](InventoryReferral.md) | | [optional] **coupons** | [**List[InventoryCoupon]**](InventoryCoupon.md) | The coupons reserved by this profile. This array includes hard and soft reservations. | [optional] **giveaways** | [**List[Giveaway]**](Giveaway.md) | | [optional] -**achievements** | [**List[AchievementProgressWithDefinition]**](AchievementProgressWithDefinition.md) | | [optional] -**rewards** | [**List[RewardWithUnlocks]**](RewardWithUnlocks.md) | The customer rewards that are `unlocked` and not yet `used`. | [optional] +**achievements** | [**List[AchievementProgressWithDefinition]**](AchievementProgressWithDefinition.md) | The customer's progress in each achievement they have participated in. Only achievements the customer has started are included, whether they are in progress, completed, or expired. Recurring achievements can appear more than once, once per iteration. | [optional] +**rewards** | [**List[RewardWithUnlocks]**](RewardWithUnlocks.md) | The rewards that the customer has unlocked but not used. Expired customer rewards are not returned. | [optional] ## Example diff --git a/docs/CustomerProfileReward.md b/docs/CustomerProfileReward.md index f7b70a34..df0c083a 100644 --- a/docs/CustomerProfileReward.md +++ b/docs/CustomerProfileReward.md @@ -13,9 +13,10 @@ Name | Type | Description | Notes **reward_name** | **str** | The name of the reward. | **description** | **str** | The customer-facing description of the reward. | [optional] **rule** | [**RuleMetadata**](RuleMetadata.md) | Customer-facing rule metadata for the reward. Only returned when the reward defines a rule. | [optional] -**status** | **str** | The status of the customer reward: - `unlocked`: The reward is available for use. - `used`: The reward has been used. | +**status** | **str** | The status of the customer reward: - `unlocked`: The reward is available for use. - `used`: The reward has been used. - `expired`: The reward was not used before its expiry date. | **unlocked_at** | **datetime** | The date and time when the reward was unlocked. | **unlocked_by_profile_integration_id** | **str** | The integration ID of the customer profile that unlocked the reward. For rewards unlocked with a loyalty card, this can be any customer profile linked to that loyalty card. | [optional] +**expiry_date** | **datetime** | The date and time when the customer reward expires, based on the `validityDuration` or `expiryDate` of the reward when the reward was unlocked. If the reward does not specify either property, the customer reward has unlimited validity and this field is omitted. **Note**: The expiry date is calculated using the time zone of the Application connected to the reward. | [optional] **used_at** | **datetime** | The date and time when the reward was used. | [optional] **used_by_profile_integration_id** | **str** | The integration ID of the customer profile that used the reward. For rewards unlocked with a loyalty card, this can be any customer profile linked to that loyalty card. Only returned when the reward has been used. | [optional] **loyalty_program_id** | **int** | The ID of the loyalty program that the loyalty card belongs to. Only returned for rewards unlocked with a loyalty card. | [optional] diff --git a/docs/CustomerReward.md b/docs/CustomerReward.md index 3ff384f0..c4f8742a 100644 --- a/docs/CustomerReward.md +++ b/docs/CustomerReward.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **profile_integration_id** | **str** | The integration ID of the customer profile that unlocked this reward. | **integration_id** | **str** | The integration ID assigned to this reward unlock. | **unlocked_at** | **datetime** | The date and time when the reward was unlocked. | +**expiry_date** | **datetime** | The date and time when the customer reward expires, based on the `validityDuration` or `expiryDate` of the reward when the reward was unlocked. If the reward does not specify either property, the customer reward has unlimited validity and this field is omitted. **Note**: The expiry date is calculated using the time zone of the Application connected to the reward. | [optional] **used_at** | **datetime** | The date and time when the reward was used. | [optional] ## Example diff --git a/docs/DigitalPass.md b/docs/DigitalPass.md index 0f2cd5c4..a30cf503 100644 --- a/docs/DigitalPass.md +++ b/docs/DigitalPass.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pass_id** | **str** | The ID of the generated digital pass. | -**pass_template_id** | **str** | The ID of the digital pass template used to generate the pass. | +**pass_id** | **UUID** | The ID of the generated digital pass. | +**pass_template_id** | **UUID** | The ID of the digital pass template used to generate the pass. | **status** | **str** | The status of the digital pass. `created` indicates that the pass was generated and is ready to be added to a wallet. | -**pass_url** | **str** | The URL you can use to let the customer add the digital pass to their wallet. | +**pass_url** | **str** | The URL you can use to let the customer add the digital pass to their wallet. **Note**: For Google Wallet, the URL is valid for 30 days. After 30 days, create the pass again to get a new URL. | ## Example diff --git a/docs/IntegrationApi.md b/docs/IntegrationApi.md index 80098ee4..7b3b1ef7 100644 --- a/docs/IntegrationApi.md +++ b/docs/IntegrationApi.md @@ -1259,7 +1259,28 @@ Name | Type | Description | Notes List customer's available achievements -Retrieve all the achievements available to a given customer and their progress in them. +Retrieve all the achievements available to a given customer and their progress +in them. Use this endpoint to build an achievements page where customers can +browse the achievements they can participate in and see the details of each one. + + +The response contains one entry for each active achievement connected to +the Application, whether or not the customer has started it. Each entry +includes the achievement's details such as `target` and `period`, and the +customer's progress in the achievement. If the customer has not started +the achievement, `currentProgress.status` is `not_started`. + + +> [!note] The [List customer data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) +> endpoint also returns achievement data when `achievements=true`, but with a +> different scope and structure: +> - It returns only the achievements the customer has started, completed, or +> that have expired for them, one entry per progress record. Achievements the +> customer has not started are not returned. +> - The results cannot be filtered or paginated. +> +> Use this endpoint when you need the customer's achievement progress +> together with other customer data, such as loyalty or coupons, in a single request. ### Example @@ -1354,10 +1375,22 @@ Name | Type | Description | Notes List customer data -Return the customer inventory regarding entities referencing this customer profile's `integrationId`. +Return a snapshot of the customer profile including the entities referencing this customer +profile's `integrationId`. Typical entities returned are: customer profile information, referral codes, +loyalty points, loyalty cards, reserved coupons and achievements. -Typical entities returned are: customer profile information, referral codes, loyalty points, loyalty cards and reserved coupons. -Reserved coupons also include redeemed coupons. +> [!note] Reserved coupons also include redeemed coupons. + +When `achievements=true`, the `achievements` array contains the customer's progress +in the achievements they have participated in. Only achievements the customer +has started are returned, whether they are in progress, completed, or expired. + +Recurring achievements can appear more than once, once per iteration. The +achievements cannot be filtered or paginated. + +> [!note] To list all the achievements available to the customer, including the ones +> they have not started, and to filter or paginate the results, use the [List customer's available achievements](https://docs.talon.one/integration-api#tag/Achievements/operation/getCustomerAchievements) +> endpoint. ### Example @@ -1397,8 +1430,8 @@ with talon_one.ApiClient(configuration) as api_client: coupons = True # bool | Set to `true` to include coupon information in the response. (optional) loyalty = True # bool | Set to `true` to include loyalty information in the response. (optional) giveaways = True # bool | Set to `true` to include giveaways information in the response. (optional) - achievements = True # bool | Set to `true` to include achievement information in the response. (optional) - unlocked_rewards = True # bool | Set to `true` to include `unlocked` rewards that have not been `used` in the response. (optional) + achievements = True # bool | Set to `true` to include the customer's progress in achievements in the response. Only achievements the customer has started are returned, whether they are in progress, completed, or expired. Recurring achievements can appear more than once, once per iteration. The achievements cannot be filtered or paginated. (optional) + unlocked_rewards = True # bool | The instances of this reward that the customer has unlocked but not used. Expired customer rewards are not returned. (optional) try: # List customer data @@ -1422,8 +1455,8 @@ Name | Type | Description | Notes **coupons** | **bool**| Set to `true` to include coupon information in the response. | [optional] **loyalty** | **bool**| Set to `true` to include loyalty information in the response. | [optional] **giveaways** | **bool**| Set to `true` to include giveaways information in the response. | [optional] - **achievements** | **bool**| Set to `true` to include achievement information in the response. | [optional] - **unlocked_rewards** | **bool**| Set to `true` to include `unlocked` rewards that have not been `used` in the response. | [optional] + **achievements** | **bool**| Set to `true` to include the customer's progress in achievements in the response. Only achievements the customer has started are returned, whether they are in progress, completed, or expired. Recurring achievements can appear more than once, once per iteration. The achievements cannot be filtered or paginated. | [optional] + **unlocked_rewards** | **bool**| The instances of this reward that the customer has unlocked but not used. Expired customer rewards are not returned. | [optional] ### Return type diff --git a/docs/NewDigitalPass.md b/docs/NewDigitalPass.md index 58cb258f..99e29701 100644 --- a/docs/NewDigitalPass.md +++ b/docs/NewDigitalPass.md @@ -6,11 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **loyalty_program_id** | **int** | The ID of the associated loyalty program. | -**pass_template_id** | **str** | The ID of the digital pass template used to generate the pass. | -**profile_id** | **str** | The integration ID of the customer profile the pass is issued for. | +**pass_template_id** | **UUID** | The ID of the digital pass template used to generate the pass. | +**profile_integration_id** | **str** | The integration ID of the customer profile the pass is issued for. | **loyalty_card_id** | **str** | The identifier of the loyalty card the pass is issued for. **Note**: Only applicable for card-based loyalty programs. | [optional] **platform** | **str** | The wallet platform the pass is generated for. Possible values: - `apple`: The digital pass is generated for Apple Wallet. - `google`: The digital pass is generated for Google Wallet. | -**attributes** | **Dict[str, str]** | A map of placeholder values that you provide to fill in the pass template. These values are not validated against the template. | [optional] +**attributes** | **Dict[str, str]** | A map of placeholder values that you provide to fill in the pass template. Pass templates reference each value as `CustomerProfile.Attributes.<key>`. Each key must start with a letter or an underscore and can contain only letters, digits, and underscores. If the template requires a value that is missing, the request fails with a `422` error. | [optional] ## Example diff --git a/docs/NewRewardBudget.md b/docs/NewRewardBudget.md new file mode 100644 index 00000000..0c96642b --- /dev/null +++ b/docs/NewRewardBudget.md @@ -0,0 +1,32 @@ +# NewRewardBudget + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metric** | **str** | The customer action that counts towards the budget. | [optional] [default to 'unlocks'] +**scope** | **str** | The type of count that the budget keeps of how many times the reward has been unlocked. - `perReward`: Counts how many times the reward has been unlocked by all customers. - `perProfile`: Counts how many times each customer profile has unlocked the reward. | +**period** | **str** | The time frame after which the budget count resets to `0`. If you select `overall`, the budget never resets. The count resets at the start of each calendar time frame, not on the day the budget was created. For example, a `monthly` budget created on 20 October counts the unlocks from 20 to 31 October. On 1 November, the count resets to `0`. | +**limit** | **int** | The maximum number of times the reward can be unlocked in the time frame. | + +## Example + +```python +from talon_one.models.new_reward_budget import NewRewardBudget + +# TODO update the JSON string below +json = "{}" +# create an instance of NewRewardBudget from a JSON string +new_reward_budget_instance = NewRewardBudget.from_json(json) +# print the JSON string representation of the object +print(NewRewardBudget.to_json()) + +# convert the object into a dict +new_reward_budget_dict = new_reward_budget_instance.to_dict() +# create an instance of NewRewardBudget from a dict +new_reward_budget_from_dict = NewRewardBudget.from_dict(new_reward_budget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OutboundLogStreamErrorEntry.md b/docs/OutboundLogStreamErrorEntry.md index caff2d30..f38c2249 100644 --- a/docs/OutboundLogStreamErrorEntry.md +++ b/docs/OutboundLogStreamErrorEntry.md @@ -1,6 +1,6 @@ # OutboundLogStreamErrorEntry -An error that ended an `ndjson` stream, such as a log entry that couldn't be read. It is the last entry and the response is incomplete. +An error that ended a stream of outbound logs, such as a log entry that couldn't be read. It is the last entry and the response is incomplete. ## Properties diff --git a/docs/OutboundLogStreamLogEntry.md b/docs/OutboundLogStreamLogEntry.md index 3badf21f..16314908 100644 --- a/docs/OutboundLogStreamLogEntry.md +++ b/docs/OutboundLogStreamLogEntry.md @@ -1,6 +1,6 @@ # OutboundLogStreamLogEntry -An outbound log entry in an `ndjson` stream. +An outbound log entry in a stream of outbound logs. ## Properties diff --git a/docs/OutboundLogs.md b/docs/OutboundLogs.md index 66611390..aec3e886 100644 --- a/docs/OutboundLogs.md +++ b/docs/OutboundLogs.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **next_cursor** | **bytes** | Cursor for the next page of results. Omitted when there are no more results. | [optional] -**data** | [**List[OutboundLogsDataInner]**](OutboundLogsDataInner.md) | List of outbound logs. When an error ends the response, an `OutboundLogStreamError` is the last item and the response is incomplete. | +**data** | [**List[OutboundLogsDataInner]**](OutboundLogsDataInner.md) | List of outbound log entries. The `type` field determines the kind of entry. When an error ends the response, an `OutboundLogStreamErrorEntry` is the last item and the response is incomplete. | ## Example diff --git a/docs/OutboundLogsDataInner.md b/docs/OutboundLogsDataInner.md index 628a34f1..b0f53cf5 100644 --- a/docs/OutboundLogsDataInner.md +++ b/docs/OutboundLogsDataInner.md @@ -5,20 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**uuid** | **UUID** | UUID of the outbound message. | -**notification_id** | **int** | ID of the notification that triggered the outbound message. | [optional] -**notification_name** | **str** | Name of the notification that triggered the outbound message. | [optional] -**webhook_id** | **int** | ID of the webhook that triggered the outbound message. | [optional] -**webhook_name** | **str** | Name of the webhook that triggered the outbound message. | [optional] -**notification_type** | **str** | Type of notification that triggered the outbound message. | -**application_id** | **int** | ID of the Application associated with the outbound message. | [optional] -**loyalty_program_id** | **int** | ID of the loyalty program associated with the outbound message. | [optional] -**request** | [**OutboundLogRequest**](OutboundLogRequest.md) | | [optional] -**created_at** | **datetime** | Timestamp when the log was created. | -**processing_time_ms** | **int** | Time in milliseconds between sending the outbound request and receiving the response. | -**response** | [**OutboundLogResponse**](OutboundLogResponse.md) | | [optional] -**error** | **str** | Reason the stream ended. | -**id** | **UUID** | ID of the error. Include it when reporting the error. | [optional] +**type** | [**OutboundLogStreamEntryType**](OutboundLogStreamEntryType.md) | | +**data** | [**OutboundLogStreamError**](OutboundLogStreamError.md) | | ## Example diff --git a/docs/RewardBudget.md b/docs/RewardBudget.md new file mode 100644 index 00000000..4c80c0a9 --- /dev/null +++ b/docs/RewardBudget.md @@ -0,0 +1,35 @@ +# RewardBudget + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The internal ID of this entity. | +**created** | **datetime** | The time this entity was created. | +**reward_id** | **int** | The ID of the reward this budget applies to. | +**metric** | **str** | The customer action that counts towards the budget. | +**scope** | **str** | The type of count that the budget keeps of how many times the reward has been unlocked. - `perReward`: Counts how many times the reward has been unlocked by all customers. - `perProfile`: Counts how many times each customer profile has unlocked the reward. | +**period** | **str** | The time frame after which the budget count resets to `0`. If you select `overall`, the budget never resets. The count resets at the start of each calendar time frame, not on the day the budget was created. For example, a `monthly` budget created on 20 October counts each time the reward is unlocked from 20 to 31 October. On 1 November, resets to `0`. | +**limit** | **int** | The maximum number of times the reward can be unlocked in the time frame. | + +## Example + +```python +from talon_one.models.reward_budget import RewardBudget + +# TODO update the JSON string below +json = "{}" +# create an instance of RewardBudget from a JSON string +reward_budget_instance = RewardBudget.from_json(json) +# print the JSON string representation of the object +print(RewardBudget.to_json()) + +# convert the object into a dict +reward_budget_dict = reward_budget_instance.to_dict() +# create an instance of RewardBudget from a dict +reward_budget_from_dict = RewardBudget.from_dict(reward_budget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RewardBudgetLimitCounter.md b/docs/RewardBudgetLimitCounter.md new file mode 100644 index 00000000..3b9f0c58 --- /dev/null +++ b/docs/RewardBudgetLimitCounter.md @@ -0,0 +1,31 @@ +# RewardBudgetLimitCounter + +The count of times the reward has been unlocked in the current period, and how many times it can still be unlocked. It is shown when the budget scope is `perReward`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**counter** | **int** | The number of times the reward has been unlocked in the current period. It is `0` if the reward has not been unlocked by any profile yet. | +**remaining** | **int** | The number of times the reward can still be unlocked. It is never negative. | + +## Example + +```python +from talon_one.models.reward_budget_limit_counter import RewardBudgetLimitCounter + +# TODO update the JSON string below +json = "{}" +# create an instance of RewardBudgetLimitCounter from a JSON string +reward_budget_limit_counter_instance = RewardBudgetLimitCounter.from_json(json) +# print the JSON string representation of the object +print(RewardBudgetLimitCounter.to_json()) + +# convert the object into a dict +reward_budget_limit_counter_dict = reward_budget_limit_counter_instance.to_dict() +# create an instance of RewardBudgetLimitCounter from a dict +reward_budget_limit_counter_from_dict = RewardBudgetLimitCounter.from_dict(reward_budget_limit_counter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RewardBudgetWithLimitCounter.md b/docs/RewardBudgetWithLimitCounter.md new file mode 100644 index 00000000..1f84180b --- /dev/null +++ b/docs/RewardBudgetWithLimitCounter.md @@ -0,0 +1,36 @@ +# RewardBudgetWithLimitCounter + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The internal ID of this entity. | +**created** | **datetime** | The time this entity was created. | +**reward_id** | **int** | The ID of the reward this budget applies to. | +**metric** | **str** | The customer action that counts towards the budget. | +**scope** | **str** | The type of count that the budget keeps of how many times the reward has been unlocked. - `perReward`: Counts how many times the reward has been unlocked by all customers. - `perProfile`: Counts how many times each customer profile has unlocked the reward. | +**period** | **str** | The time frame after which the budget count resets to `0`. If you select `overall`, the budget never resets. The count resets at the start of each calendar time frame, not on the day the budget was created. For example, a `monthly` budget created on 20 October counts each time the reward is unlocked from 20 to 31 October. On 1 November, resets to `0`. | +**limit** | **int** | The maximum number of times the reward can be unlocked in the time frame. | +**limit_counter** | [**List[RewardBudgetLimitCounter]**](RewardBudgetLimitCounter.md) | The count of times the reward has been unlocked in the current period, and how many times it can still be unlocked before the limit is reached. It is only returned for budgets with the `perReward` scope, because every customer profile has their own count in a `perProfile` budget. The count is stored for each Application. A reward is connected to one Application, so the list always has exactly one item. | [optional] + +## Example + +```python +from talon_one.models.reward_budget_with_limit_counter import RewardBudgetWithLimitCounter + +# TODO update the JSON string below +json = "{}" +# create an instance of RewardBudgetWithLimitCounter from a JSON string +reward_budget_with_limit_counter_instance = RewardBudgetWithLimitCounter.from_json(json) +# print the JSON string representation of the object +print(RewardBudgetWithLimitCounter.to_json()) + +# convert the object into a dict +reward_budget_with_limit_counter_dict = reward_budget_with_limit_counter_instance.to_dict() +# create an instance of RewardBudgetWithLimitCounter from a dict +reward_budget_with_limit_counter_from_dict = RewardBudgetWithLimitCounter.from_dict(reward_budget_with_limit_counter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RewardWithBudgets.md b/docs/RewardWithBudgets.md new file mode 100644 index 00000000..4ac1d112 --- /dev/null +++ b/docs/RewardWithBudgets.md @@ -0,0 +1,45 @@ +# RewardWithBudgets + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The internal ID of this entity. | +**created** | **datetime** | The time this entity was created. | +**account_id** | **int** | The ID of the account that owns this entity. | +**name** | **str** | The name of the reward. | +**api_name** | **str** | A unique identifier used to reference the reward in API integrations. | +**description** | **str** | A description of the reward. | [optional] +**application_ids** | **List[int]** | The IDs of the Applications this reward is connected to. **Note**: Currently, a reward can only be connected to one Application. | +**sandbox** | **bool** | Indicates if this is a live or sandbox reward. Rewards of a given type can only be connected to Applications of the same type. | +**eligibility_conditions** | [**Rule**](Rule.md) | An optional rule that manages who can see this reward. If not specified, the reward is visible to all customers. **Note:** Only the `condition` field is evaluated within this rule. The `effects` field must be an empty array, and `bindings` are not supported. | [optional] +**rule** | [**Rule**](Rule.md) | Rule to apply. **Note**: The `bindings` field inside the rule must not be used in this endpoint. All bindings should be defined at the reward level via the top-level `bindings` field. | [optional] +**bindings** | [**List[Binding]**](Binding.md) | A list of named variables created before the reward's rules are evaluated. Each binding pairs a name with a talang expression. The expression is evaluated once and its result is available by name in any rule condition or effect. Bindings must be defined outside of individual rules. | [optional] +**points_required** | [**List[RewardPointsRequired]**](RewardPointsRequired.md) | The loyalty points required to activate the reward. Each object defines the specific loyalty program and subledger from which points are deducted when activating the reward. **Note:** When creating a reward, the `id` of each entry is ignored and a new entry is always created. | [optional] +**validity_duration** | **str** | The duration for which the customer rewards unlocked from this reward remain active, relative to when the customer reward was unlocked. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. This field cannot be used in combination with `expiryDate`. If both `validityDuration` and `expiryDate` are not set, customer rewards have unlimited validity. | [optional] +**expiry_date** | **datetime** | Expiry date of the customer rewards unlocked from this reward. Customer rewards never expire if this is omitted and `validityDuration` is not set. **Note:** - The date must be in the future. - This field cannot be used in combination with `validityDuration`. | [optional] +**modified** | **datetime** | The timestamp when the reward was last updated in RFC3339 format. | [optional] +**status** | **str** | The status of the reward. | +**budgets** | [**List[RewardBudgetWithLimitCounter]**](RewardBudgetWithLimitCounter.md) | The budgets associated with the reward. This property is returned only when `includeBudgets` is `true`. | [optional] + +## Example + +```python +from talon_one.models.reward_with_budgets import RewardWithBudgets + +# TODO update the JSON string below +json = "{}" +# create an instance of RewardWithBudgets from a JSON string +reward_with_budgets_instance = RewardWithBudgets.from_json(json) +# print the JSON string representation of the object +print(RewardWithBudgets.to_json()) + +# convert the object into a dict +reward_with_budgets_dict = reward_with_budgets_instance.to_dict() +# create an instance of RewardWithBudgets from a dict +reward_with_budgets_from_dict = RewardWithBudgets.from_dict(reward_with_budgets_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RewardWithUnlocks.md b/docs/RewardWithUnlocks.md index 4ccff05a..4381dc01 100644 --- a/docs/RewardWithUnlocks.md +++ b/docs/RewardWithUnlocks.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **name** | **str** | The customer-facing name of the reward. | **description** | **str** | Customer-facing description of the reward. | [optional] **rule** | [**RuleMetadata**](RuleMetadata.md) | Customer-facing rule metadata for the reward. | -**unlocked** | [**List[CustomerReward]**](CustomerReward.md) | The customer profile's unlocks of this reward that are not yet `used`. | [optional] +**unlocked** | [**List[CustomerReward]**](CustomerReward.md) | The instances of this reward that the customer has unlocked but not used. Expired customer rewards are not returned. | [optional] ## Example diff --git a/docs/UpdateRewardBudget.md b/docs/UpdateRewardBudget.md new file mode 100644 index 00000000..06f16c42 --- /dev/null +++ b/docs/UpdateRewardBudget.md @@ -0,0 +1,29 @@ +# UpdateRewardBudget + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**limit** | **int** | The new limit for the maximum number of times the reward can be unlocked in the given period. | + +## Example + +```python +from talon_one.models.update_reward_budget import UpdateRewardBudget + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateRewardBudget from a JSON string +update_reward_budget_instance = UpdateRewardBudget.from_json(json) +# print the JSON string representation of the object +print(UpdateRewardBudget.to_json()) + +# convert the object into a dict +update_reward_budget_dict = update_reward_budget_instance.to_dict() +# create an instance of UpdateRewardBudget from a dict +update_reward_budget_from_dict = UpdateRewardBudget.from_dict(update_reward_budget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyproject.toml b/pyproject.toml index 9672a452..b6453346 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,11 @@ [project] name = "talon_one" -version = "26.23.0" +version = "99.99.98" description = "Talon.One API" authors = [ {name = "OpenAPI Generator Community",email = "team@openapitools.org"}, ] +license = { text = "MIT" } readme = "README.md" keywords = ["OpenAPI", "OpenAPI-Generator", "Talon.One API"] requires-python = ">=3.11" diff --git a/setup.py b/setup.py index ac38efd8..f4551446 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "talon_one" -VERSION = "26.23.0" +VERSION = "99.99.98" PYTHON_REQUIRES = ">= 3.10" REQUIRES = [ "urllib3 >= 2.7.0, < 3.0.0", diff --git a/talon_one/__init__.py b/talon_one/__init__.py index c9fcbc3d..bcca9433 100644 --- a/talon_one/__init__.py +++ b/talon_one/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "26.23.0" +__version__ = "99.99.98" # Define package exports __all__ = [ @@ -710,6 +710,7 @@ "NewReturn", "NewRevisionVersion", "NewReward", + "NewRewardBudget", "NewRiskNotification", "NewRole", "NewRoleV2", @@ -806,11 +807,15 @@ "RevisionActivationRequest", "RevisionVersion", "Reward", + "RewardBudget", + "RewardBudgetLimitCounter", + "RewardBudgetWithLimitCounter", "RewardCatalogItem", "RewardEligibility", "RewardEligibilityFailureDetails", "RewardPointsRequired", "RewardUnlockRejection", + "RewardWithBudgets", "RewardWithUnlocks", "Risk", "RiskAffectedEntityItem", @@ -979,6 +984,7 @@ "UpdateReferral", "UpdateReferralBatch", "UpdateReward", + "UpdateRewardBudget", "UpdateRiskNotification", "UpdateRole", "UpdateStore", @@ -1702,6 +1708,7 @@ from talon_one.models.new_return import NewReturn as NewReturn from talon_one.models.new_revision_version import NewRevisionVersion as NewRevisionVersion from talon_one.models.new_reward import NewReward as NewReward +from talon_one.models.new_reward_budget import NewRewardBudget as NewRewardBudget from talon_one.models.new_risk_notification import NewRiskNotification as NewRiskNotification from talon_one.models.new_role import NewRole as NewRole from talon_one.models.new_role_v2 import NewRoleV2 as NewRoleV2 @@ -1798,11 +1805,15 @@ from talon_one.models.revision_activation_request import RevisionActivationRequest as RevisionActivationRequest from talon_one.models.revision_version import RevisionVersion as RevisionVersion from talon_one.models.reward import Reward as Reward +from talon_one.models.reward_budget import RewardBudget as RewardBudget +from talon_one.models.reward_budget_limit_counter import RewardBudgetLimitCounter as RewardBudgetLimitCounter +from talon_one.models.reward_budget_with_limit_counter import RewardBudgetWithLimitCounter as RewardBudgetWithLimitCounter from talon_one.models.reward_catalog_item import RewardCatalogItem as RewardCatalogItem from talon_one.models.reward_eligibility import RewardEligibility as RewardEligibility from talon_one.models.reward_eligibility_failure_details import RewardEligibilityFailureDetails as RewardEligibilityFailureDetails from talon_one.models.reward_points_required import RewardPointsRequired as RewardPointsRequired from talon_one.models.reward_unlock_rejection import RewardUnlockRejection as RewardUnlockRejection +from talon_one.models.reward_with_budgets import RewardWithBudgets as RewardWithBudgets from talon_one.models.reward_with_unlocks import RewardWithUnlocks as RewardWithUnlocks from talon_one.models.risk import Risk as Risk from talon_one.models.risk_affected_entity_item import RiskAffectedEntityItem as RiskAffectedEntityItem @@ -1971,6 +1982,7 @@ from talon_one.models.update_referral import UpdateReferral as UpdateReferral from talon_one.models.update_referral_batch import UpdateReferralBatch as UpdateReferralBatch from talon_one.models.update_reward import UpdateReward as UpdateReward +from talon_one.models.update_reward_budget import UpdateRewardBudget as UpdateRewardBudget from talon_one.models.update_risk_notification import UpdateRiskNotification as UpdateRiskNotification from talon_one.models.update_role import UpdateRole as UpdateRole from talon_one.models.update_store import UpdateStore as UpdateStore diff --git a/talon_one/api/integration_api.py b/talon_one/api/integration_api.py index d216c36a..639e9478 100644 --- a/talon_one/api/integration_api.py +++ b/talon_one/api/integration_api.py @@ -3948,7 +3948,7 @@ def get_customer_achievements( ) -> GetCustomerAchievements200Response: """List customer's available achievements - Retrieve all the achievements available to a given customer and their progress in them. + Retrieve all the achievements available to a given customer and their progress in them. Use this endpoint to build an achievements page where customers can browse the achievements they can participate in and see the details of each one. The response contains one entry for each active achievement connected to the Application, whether or not the customer has started it. Each entry includes the achievement's details such as `target` and `period`, and the customer's progress in the achievement. If the customer has not started the achievement, `currentProgress.status` is `not_started`. > [!note] The [List customer data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) > endpoint also returns achievement data when `achievements=true`, but with a > different scope and structure: > - It returns only the achievements the customer has started, completed, or > that have expired for them, one entry per progress record. Achievements the > customer has not started are not returned. > - The results cannot be filtered or paginated. > > Use this endpoint when you need the customer's achievement progress > together with other customer data, such as loyalty or coupons, in a single request. :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) :type integration_id: str @@ -4042,7 +4042,7 @@ def get_customer_achievements_with_http_info( ) -> ApiResponse[GetCustomerAchievements200Response]: """List customer's available achievements - Retrieve all the achievements available to a given customer and their progress in them. + Retrieve all the achievements available to a given customer and their progress in them. Use this endpoint to build an achievements page where customers can browse the achievements they can participate in and see the details of each one. The response contains one entry for each active achievement connected to the Application, whether or not the customer has started it. Each entry includes the achievement's details such as `target` and `period`, and the customer's progress in the achievement. If the customer has not started the achievement, `currentProgress.status` is `not_started`. > [!note] The [List customer data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) > endpoint also returns achievement data when `achievements=true`, but with a > different scope and structure: > - It returns only the achievements the customer has started, completed, or > that have expired for them, one entry per progress record. Achievements the > customer has not started are not returned. > - The results cannot be filtered or paginated. > > Use this endpoint when you need the customer's achievement progress > together with other customer data, such as loyalty or coupons, in a single request. :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) :type integration_id: str @@ -4136,7 +4136,7 @@ def get_customer_achievements_without_preload_content( ) -> RESTResponseType: """List customer's available achievements - Retrieve all the achievements available to a given customer and their progress in them. + Retrieve all the achievements available to a given customer and their progress in them. Use this endpoint to build an achievements page where customers can browse the achievements they can participate in and see the details of each one. The response contains one entry for each active achievement connected to the Application, whether or not the customer has started it. Each entry includes the achievement's details such as `target` and `period`, and the customer's progress in the achievement. If the customer has not started the achievement, `currentProgress.status` is `not_started`. > [!note] The [List customer data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) > endpoint also returns achievement data when `achievements=true`, but with a > different scope and structure: > - It returns only the achievements the customer has started, completed, or > that have expired for them, one entry per progress record. Achievements the > customer has not started are not returned. > - The results cannot be filtered or paginated. > > Use this endpoint when you need the customer's achievement progress > together with other customer data, such as loyalty or coupons, in a single request. :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) :type integration_id: str @@ -4308,8 +4308,8 @@ def get_customer_inventory( coupons: Annotated[Optional[StrictBool], Field(description="Set to `true` to include coupon information in the response.")] = None, loyalty: Annotated[Optional[StrictBool], Field(description="Set to `true` to include loyalty information in the response.")] = None, giveaways: Annotated[Optional[StrictBool], Field(description="Set to `true` to include giveaways information in the response.")] = None, - achievements: Annotated[Optional[StrictBool], Field(description="Set to `true` to include achievement information in the response.")] = None, - unlocked_rewards: Annotated[Optional[StrictBool], Field(description="Set to `true` to include `unlocked` rewards that have not been `used` in the response.")] = None, + achievements: Annotated[Optional[StrictBool], Field(description="Set to `true` to include the customer's progress in achievements in the response. Only achievements the customer has started are returned, whether they are in progress, completed, or expired. Recurring achievements can appear more than once, once per iteration. The achievements cannot be filtered or paginated. ")] = None, + unlocked_rewards: Annotated[Optional[StrictBool], Field(description="The instances of this reward that the customer has unlocked but not used. Expired customer rewards are not returned.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4325,7 +4325,7 @@ def get_customer_inventory( ) -> CustomerInventory: """List customer data - Return the customer inventory regarding entities referencing this customer profile's `integrationId`. Typical entities returned are: customer profile information, referral codes, loyalty points, loyalty cards and reserved coupons. Reserved coupons also include redeemed coupons. + Return a snapshot of the customer profile including the entities referencing this customer profile's `integrationId`. Typical entities returned are: customer profile information, referral codes, loyalty points, loyalty cards, reserved coupons and achievements. > [!note] Reserved coupons also include redeemed coupons. When `achievements=true`, the `achievements` array contains the customer's progress in the achievements they have participated in. Only achievements the customer has started are returned, whether they are in progress, completed, or expired. Recurring achievements can appear more than once, once per iteration. The achievements cannot be filtered or paginated. > [!note] To list all the achievements available to the customer, including the ones > they have not started, and to filter or paginate the results, use the [List customer's available achievements](https://docs.talon.one/integration-api#tag/Achievements/operation/getCustomerAchievements) > endpoint. :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationCustomers) endpoint. (required) :type integration_id: str @@ -4339,9 +4339,9 @@ def get_customer_inventory( :type loyalty: bool :param giveaways: Set to `true` to include giveaways information in the response. :type giveaways: bool - :param achievements: Set to `true` to include achievement information in the response. + :param achievements: Set to `true` to include the customer's progress in achievements in the response. Only achievements the customer has started are returned, whether they are in progress, completed, or expired. Recurring achievements can appear more than once, once per iteration. The achievements cannot be filtered or paginated. :type achievements: bool - :param unlocked_rewards: Set to `true` to include `unlocked` rewards that have not been `used` in the response. + :param unlocked_rewards: The instances of this reward that the customer has unlocked but not used. Expired customer rewards are not returned. :type unlocked_rewards: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -4405,8 +4405,8 @@ def get_customer_inventory_with_http_info( coupons: Annotated[Optional[StrictBool], Field(description="Set to `true` to include coupon information in the response.")] = None, loyalty: Annotated[Optional[StrictBool], Field(description="Set to `true` to include loyalty information in the response.")] = None, giveaways: Annotated[Optional[StrictBool], Field(description="Set to `true` to include giveaways information in the response.")] = None, - achievements: Annotated[Optional[StrictBool], Field(description="Set to `true` to include achievement information in the response.")] = None, - unlocked_rewards: Annotated[Optional[StrictBool], Field(description="Set to `true` to include `unlocked` rewards that have not been `used` in the response.")] = None, + achievements: Annotated[Optional[StrictBool], Field(description="Set to `true` to include the customer's progress in achievements in the response. Only achievements the customer has started are returned, whether they are in progress, completed, or expired. Recurring achievements can appear more than once, once per iteration. The achievements cannot be filtered or paginated. ")] = None, + unlocked_rewards: Annotated[Optional[StrictBool], Field(description="The instances of this reward that the customer has unlocked but not used. Expired customer rewards are not returned.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4422,7 +4422,7 @@ def get_customer_inventory_with_http_info( ) -> ApiResponse[CustomerInventory]: """List customer data - Return the customer inventory regarding entities referencing this customer profile's `integrationId`. Typical entities returned are: customer profile information, referral codes, loyalty points, loyalty cards and reserved coupons. Reserved coupons also include redeemed coupons. + Return a snapshot of the customer profile including the entities referencing this customer profile's `integrationId`. Typical entities returned are: customer profile information, referral codes, loyalty points, loyalty cards, reserved coupons and achievements. > [!note] Reserved coupons also include redeemed coupons. When `achievements=true`, the `achievements` array contains the customer's progress in the achievements they have participated in. Only achievements the customer has started are returned, whether they are in progress, completed, or expired. Recurring achievements can appear more than once, once per iteration. The achievements cannot be filtered or paginated. > [!note] To list all the achievements available to the customer, including the ones > they have not started, and to filter or paginate the results, use the [List customer's available achievements](https://docs.talon.one/integration-api#tag/Achievements/operation/getCustomerAchievements) > endpoint. :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationCustomers) endpoint. (required) :type integration_id: str @@ -4436,9 +4436,9 @@ def get_customer_inventory_with_http_info( :type loyalty: bool :param giveaways: Set to `true` to include giveaways information in the response. :type giveaways: bool - :param achievements: Set to `true` to include achievement information in the response. + :param achievements: Set to `true` to include the customer's progress in achievements in the response. Only achievements the customer has started are returned, whether they are in progress, completed, or expired. Recurring achievements can appear more than once, once per iteration. The achievements cannot be filtered or paginated. :type achievements: bool - :param unlocked_rewards: Set to `true` to include `unlocked` rewards that have not been `used` in the response. + :param unlocked_rewards: The instances of this reward that the customer has unlocked but not used. Expired customer rewards are not returned. :type unlocked_rewards: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -4502,8 +4502,8 @@ def get_customer_inventory_without_preload_content( coupons: Annotated[Optional[StrictBool], Field(description="Set to `true` to include coupon information in the response.")] = None, loyalty: Annotated[Optional[StrictBool], Field(description="Set to `true` to include loyalty information in the response.")] = None, giveaways: Annotated[Optional[StrictBool], Field(description="Set to `true` to include giveaways information in the response.")] = None, - achievements: Annotated[Optional[StrictBool], Field(description="Set to `true` to include achievement information in the response.")] = None, - unlocked_rewards: Annotated[Optional[StrictBool], Field(description="Set to `true` to include `unlocked` rewards that have not been `used` in the response.")] = None, + achievements: Annotated[Optional[StrictBool], Field(description="Set to `true` to include the customer's progress in achievements in the response. Only achievements the customer has started are returned, whether they are in progress, completed, or expired. Recurring achievements can appear more than once, once per iteration. The achievements cannot be filtered or paginated. ")] = None, + unlocked_rewards: Annotated[Optional[StrictBool], Field(description="The instances of this reward that the customer has unlocked but not used. Expired customer rewards are not returned.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4519,7 +4519,7 @@ def get_customer_inventory_without_preload_content( ) -> RESTResponseType: """List customer data - Return the customer inventory regarding entities referencing this customer profile's `integrationId`. Typical entities returned are: customer profile information, referral codes, loyalty points, loyalty cards and reserved coupons. Reserved coupons also include redeemed coupons. + Return a snapshot of the customer profile including the entities referencing this customer profile's `integrationId`. Typical entities returned are: customer profile information, referral codes, loyalty points, loyalty cards, reserved coupons and achievements. > [!note] Reserved coupons also include redeemed coupons. When `achievements=true`, the `achievements` array contains the customer's progress in the achievements they have participated in. Only achievements the customer has started are returned, whether they are in progress, completed, or expired. Recurring achievements can appear more than once, once per iteration. The achievements cannot be filtered or paginated. > [!note] To list all the achievements available to the customer, including the ones > they have not started, and to filter or paginate the results, use the [List customer's available achievements](https://docs.talon.one/integration-api#tag/Achievements/operation/getCustomerAchievements) > endpoint. :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationCustomers) endpoint. (required) :type integration_id: str @@ -4533,9 +4533,9 @@ def get_customer_inventory_without_preload_content( :type loyalty: bool :param giveaways: Set to `true` to include giveaways information in the response. :type giveaways: bool - :param achievements: Set to `true` to include achievement information in the response. + :param achievements: Set to `true` to include the customer's progress in achievements in the response. Only achievements the customer has started are returned, whether they are in progress, completed, or expired. Recurring achievements can appear more than once, once per iteration. The achievements cannot be filtered or paginated. :type achievements: bool - :param unlocked_rewards: Set to `true` to include `unlocked` rewards that have not been `used` in the response. + :param unlocked_rewards: The instances of this reward that the customer has unlocked but not used. Expired customer rewards are not returned. :type unlocked_rewards: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request diff --git a/talon_one/api_client.py b/talon_one/api_client.py index 15e0404f..8f20c4a9 100644 --- a/talon_one/api_client.py +++ b/talon_one/api_client.py @@ -91,7 +91,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/26.23.0/python' + self.user_agent = 'OpenAPI-Generator/99.99.98/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/talon_one/configuration.py b/talon_one/configuration.py index 89c1014a..277e83ce 100644 --- a/talon_one/configuration.py +++ b/talon_one/configuration.py @@ -583,7 +583,7 @@ def to_debug_report(self) -> str: "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: \n"\ - "SDK Package Version: 26.23.0".\ + "SDK Package Version: 99.99.98".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/talon_one/models/__init__.py b/talon_one/models/__init__.py index ffb48053..77c67028 100644 --- a/talon_one/models/__init__.py +++ b/talon_one/models/__init__.py @@ -694,6 +694,7 @@ from talon_one.models.new_return import NewReturn from talon_one.models.new_revision_version import NewRevisionVersion from talon_one.models.new_reward import NewReward +from talon_one.models.new_reward_budget import NewRewardBudget from talon_one.models.new_risk_notification import NewRiskNotification from talon_one.models.new_role import NewRole from talon_one.models.new_role_v2 import NewRoleV2 @@ -790,11 +791,15 @@ from talon_one.models.revision_activation_request import RevisionActivationRequest from talon_one.models.revision_version import RevisionVersion from talon_one.models.reward import Reward +from talon_one.models.reward_budget import RewardBudget +from talon_one.models.reward_budget_limit_counter import RewardBudgetLimitCounter +from talon_one.models.reward_budget_with_limit_counter import RewardBudgetWithLimitCounter from talon_one.models.reward_catalog_item import RewardCatalogItem from talon_one.models.reward_eligibility import RewardEligibility from talon_one.models.reward_eligibility_failure_details import RewardEligibilityFailureDetails from talon_one.models.reward_points_required import RewardPointsRequired from talon_one.models.reward_unlock_rejection import RewardUnlockRejection +from talon_one.models.reward_with_budgets import RewardWithBudgets from talon_one.models.reward_with_unlocks import RewardWithUnlocks from talon_one.models.risk import Risk from talon_one.models.risk_affected_entity_item import RiskAffectedEntityItem @@ -963,6 +968,7 @@ from talon_one.models.update_referral import UpdateReferral from talon_one.models.update_referral_batch import UpdateReferralBatch from talon_one.models.update_reward import UpdateReward +from talon_one.models.update_reward_budget import UpdateRewardBudget from talon_one.models.update_risk_notification import UpdateRiskNotification from talon_one.models.update_role import UpdateRole from talon_one.models.update_store import UpdateStore diff --git a/talon_one/models/award_discount_block.py b/talon_one/models/award_discount_block.py index 8a4b8e5c..49a951e9 100644 --- a/talon_one/models/award_discount_block.py +++ b/talon_one/models/award_discount_block.py @@ -36,8 +36,9 @@ class AwardDiscountBlock(BaseModel): value: AwardDiscountBlock1Value partial: StrictBool = Field(description="Whether to apply a partial discount when the requested value exceeds the configured budget.", json_schema_extra={"examples": [False]}) target: AwardDiscountTarget + excluded_from_price_history: Optional[StrictBool] = Field(default=None, description="When set to `true`, the applied discount is excluded from the item's [price history](https://docs.talon.one/docs/dev/integration-guides/best-prior-price#price-history).", alias="excludedFromPriceHistory", json_schema_extra={"examples": [False]}) additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "type", "tags", "name", "value", "partial", "target"] + __properties: ClassVar[List[str]] = ["id", "type", "tags", "name", "value", "partial", "target", "excludedFromPriceHistory"] model_config = ConfigDict( validate_by_name=True, @@ -113,7 +114,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "value": AwardDiscountBlock1Value.from_dict(obj["value"]) if obj.get("value") is not None else None, "partial": obj.get("partial"), - "target": AwardDiscountTarget.from_dict(obj["target"]) if obj.get("target") is not None else None + "target": AwardDiscountTarget.from_dict(obj["target"]) if obj.get("target") is not None else None, + "excludedFromPriceHistory": obj.get("excludedFromPriceHistory") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/talon_one/models/catalog_action_filter.py b/talon_one/models/catalog_action_filter.py index 2c76bcf0..607edd6b 100644 --- a/talon_one/models/catalog_action_filter.py +++ b/talon_one/models/catalog_action_filter.py @@ -27,9 +27,9 @@ class CatalogActionFilter(BaseModel): """ The properties for a single filtering condition in a catalog sync action. """ # noqa: E501 - attr: StrictStr = Field(description="The name of the attribute to filter on.") - op: StrictStr = Field(description="The filtering operator.") - value: Optional[Any] = Field(description="The value to filter for.") + attr: StrictStr = Field(description="The name of the attribute to filter on. The attribute must exist in the catalog. For the `LT`, `LE`, `GT`, and `GE` comparison operators, the attribute must be of type `number`.", json_schema_extra={"examples": ["color"]}) + op: StrictStr = Field(description="The filtering operator.", json_schema_extra={"examples": ["EQ"]}) + value: Optional[Any] = Field(description="The value to filter for. For the `LT`, `LE`, `GT`, and `GE` comparison operators, the value must be a number or a numeric string.", json_schema_extra={"examples": ["blue"]}) additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["attr", "op", "value"] diff --git a/talon_one/models/check_achievement_block.py b/talon_one/models/check_achievement_block.py index d5202d9f..ce2a9365 100644 --- a/talon_one/models/check_achievement_block.py +++ b/talon_one/models/check_achievement_block.py @@ -40,8 +40,8 @@ class CheckAchievementBlock(BaseModel): @field_validator('operator') def operator_validate_enum(cls, value): """Validates the enum""" - if value not in set(['justCompleted', 'started', 'not(started)', 'inProgress', 'not(inProgress)', 'completed', 'not(completed)']): - raise ValueError("must be one of enum values ('justCompleted', 'started', 'not(started)', 'inProgress', 'not(inProgress)', 'completed', 'not(completed)')") + if value not in set(['justCompleted', 'started', 'not(started)', 'inProgress', 'not(inProgress)', 'completed', 'not(completed)', 'expired', 'not(expired)']): + raise ValueError("must be one of enum values ('justCompleted', 'started', 'not(started)', 'inProgress', 'not(inProgress)', 'completed', 'not(completed)', 'expired', 'not(expired)')") return value model_config = ConfigDict( diff --git a/talon_one/models/customer_inventory.py b/talon_one/models/customer_inventory.py index 6601f88e..e5d23a0f 100644 --- a/talon_one/models/customer_inventory.py +++ b/talon_one/models/customer_inventory.py @@ -39,8 +39,8 @@ class CustomerInventory(BaseModel): referrals: Optional[List[InventoryReferral]] = None coupons: Optional[List[InventoryCoupon]] = Field(default=None, description="The coupons reserved by this profile. This array includes hard and soft reservations. ") giveaways: Optional[List[Giveaway]] = None - achievements: Optional[List[AchievementProgressWithDefinition]] = None - rewards: Optional[List[RewardWithUnlocks]] = Field(default=None, description="The customer rewards that are `unlocked` and not yet `used`.") + achievements: Optional[List[AchievementProgressWithDefinition]] = Field(default=None, description="The customer's progress in each achievement they have participated in. Only achievements the customer has started are included, whether they are in progress, completed, or expired. Recurring achievements can appear more than once, once per iteration. ") + rewards: Optional[List[RewardWithUnlocks]] = Field(default=None, description="The rewards that the customer has unlocked but not used. Expired customer rewards are not returned.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["profile", "loyalty", "referrals", "coupons", "giveaways", "achievements", "rewards"] diff --git a/talon_one/models/customer_profile_reward.py b/talon_one/models/customer_profile_reward.py index 319e568d..f4d9e0da 100644 --- a/talon_one/models/customer_profile_reward.py +++ b/talon_one/models/customer_profile_reward.py @@ -37,21 +37,22 @@ class CustomerProfileReward(BaseModel): reward_name: StrictStr = Field(description="The name of the reward.", alias="rewardName", json_schema_extra={"examples": ["Free coffee"]}) description: Optional[StrictStr] = Field(default=None, description="The customer-facing description of the reward.", json_schema_extra={"examples": ["One free coffee of any size"]}) rule: Optional[RuleMetadata] = Field(default=None, description="Customer-facing rule metadata for the reward. Only returned when the reward defines a rule.") - status: StrictStr = Field(description="The status of the customer reward: - `unlocked`: The reward is available for use. - `used`: The reward has been used. ", json_schema_extra={"examples": ["unlocked"]}) + status: StrictStr = Field(description="The status of the customer reward: - `unlocked`: The reward is available for use. - `used`: The reward has been used. - `expired`: The reward was not used before its expiry date. ", json_schema_extra={"examples": ["unlocked"]}) unlocked_at: datetime = Field(description="The date and time when the reward was unlocked.", alias="unlockedAt", json_schema_extra={"examples": ["2026-07-01T09:00:00Z"]}) unlocked_by_profile_integration_id: Optional[StrictStr] = Field(default=None, description="The integration ID of the customer profile that unlocked the reward. For rewards unlocked with a loyalty card, this can be any customer profile linked to that loyalty card. ", alias="unlockedByProfileIntegrationId", json_schema_extra={"examples": ["customer2839"]}) + expiry_date: Optional[datetime] = Field(default=None, description="The date and time when the customer reward expires, based on the `validityDuration` or `expiryDate` of the reward when the reward was unlocked. If the reward does not specify either property, the customer reward has unlimited validity and this field is omitted. **Note**: The expiry date is calculated using the time zone of the Application connected to the reward. ", alias="expiryDate", json_schema_extra={"examples": ["2026-08-31T23:59:59Z"]}) used_at: Optional[datetime] = Field(default=None, description="The date and time when the reward was used.", alias="usedAt", json_schema_extra={"examples": ["2026-07-02T10:30:00Z"]}) used_by_profile_integration_id: Optional[StrictStr] = Field(default=None, description="The integration ID of the customer profile that used the reward. For rewards unlocked with a loyalty card, this can be any customer profile linked to that loyalty card. Only returned when the reward has been used. ", alias="usedByProfileIntegrationId", json_schema_extra={"examples": ["customer2840"]}) loyalty_program_id: Optional[StrictInt] = Field(default=None, description="The ID of the loyalty program that the loyalty card belongs to. Only returned for rewards unlocked with a loyalty card.", alias="loyaltyProgramId", json_schema_extra={"examples": [9]}) loyalty_card_id: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=108)]] = Field(default=None, description="The identifier of the loyalty card that the reward was unlocked with. Only returned for rewards unlocked with a loyalty card.", alias="loyaltyCardId", json_schema_extra={"examples": ["summer-loyalty-card-0543"]}) additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "integrationId", "rewardId", "rewardIntegrationId", "rewardName", "description", "rule", "status", "unlockedAt", "unlockedByProfileIntegrationId", "usedAt", "usedByProfileIntegrationId", "loyaltyProgramId", "loyaltyCardId"] + __properties: ClassVar[List[str]] = ["id", "integrationId", "rewardId", "rewardIntegrationId", "rewardName", "description", "rule", "status", "unlockedAt", "unlockedByProfileIntegrationId", "expiryDate", "usedAt", "usedByProfileIntegrationId", "loyaltyProgramId", "loyaltyCardId"] @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" - if value not in set(['unlocked', 'used']): - raise ValueError("must be one of enum values ('unlocked', 'used')") + if value not in set(['unlocked', 'used', 'expired']): + raise ValueError("must be one of enum values ('unlocked', 'used', 'expired')") return value @field_validator('loyalty_card_id', mode="before") @@ -135,6 +136,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "status": obj.get("status"), "unlockedAt": obj.get("unlockedAt"), "unlockedByProfileIntegrationId": obj.get("unlockedByProfileIntegrationId"), + "expiryDate": obj.get("expiryDate"), "usedAt": obj.get("usedAt"), "usedByProfileIntegrationId": obj.get("usedByProfileIntegrationId"), "loyaltyProgramId": obj.get("loyaltyProgramId"), diff --git a/talon_one/models/customer_reward.py b/talon_one/models/customer_reward.py index 91f68087..c034c5fa 100644 --- a/talon_one/models/customer_reward.py +++ b/talon_one/models/customer_reward.py @@ -32,9 +32,10 @@ class CustomerReward(BaseModel): profile_integration_id: StrictStr = Field(description="The integration ID of the customer profile that unlocked this reward.", alias="profileIntegrationId", json_schema_extra={"examples": ["customer1"]}) integration_id: StrictStr = Field(description="The integration ID assigned to this reward unlock.", alias="integrationId", json_schema_extra={"examples": ["reward-unlock-123"]}) unlocked_at: datetime = Field(description="The date and time when the reward was unlocked.", alias="unlockedAt", json_schema_extra={"examples": ["2024-01-01T00:00:00Z"]}) + expiry_date: Optional[datetime] = Field(default=None, description="The date and time when the customer reward expires, based on the `validityDuration` or `expiryDate` of the reward when the reward was unlocked. If the reward does not specify either property, the customer reward has unlimited validity and this field is omitted. **Note**: The expiry date is calculated using the time zone of the Application connected to the reward. ", alias="expiryDate", json_schema_extra={"examples": ["2024-03-31T23:59:59Z"]}) used_at: Optional[datetime] = Field(default=None, description="The date and time when the reward was used.", alias="usedAt", json_schema_extra={"examples": ["2024-01-02T00:00:00Z"]}) additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["applicationId", "profileIntegrationId", "integrationId", "unlockedAt", "usedAt"] + __properties: ClassVar[List[str]] = ["applicationId", "profileIntegrationId", "integrationId", "unlockedAt", "expiryDate", "usedAt"] model_config = ConfigDict( validate_by_name=True, @@ -98,6 +99,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "profileIntegrationId": obj.get("profileIntegrationId"), "integrationId": obj.get("integrationId"), "unlockedAt": obj.get("unlockedAt"), + "expiryDate": obj.get("expiryDate"), "usedAt": obj.get("usedAt") }) # store additional fields in additional_properties diff --git a/talon_one/models/digital_pass.py b/talon_one/models/digital_pass.py index 7c2e8557..8fd84984 100644 --- a/talon_one/models/digital_pass.py +++ b/talon_one/models/digital_pass.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List +from uuid import UUID from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -27,10 +28,10 @@ class DigitalPass(BaseModel): """ DigitalPass """ # noqa: E501 - pass_id: StrictStr = Field(description="The ID of the generated digital pass.", alias="passId", json_schema_extra={"examples": ["pass_9c3f1a2b"]}) - pass_template_id: StrictStr = Field(description="The ID of the digital pass template used to generate the pass.", alias="passTemplateId", json_schema_extra={"examples": ["tmpl_summer_loyalty"]}) + pass_id: UUID = Field(description="The ID of the generated digital pass.", alias="passId", json_schema_extra={"examples": ["9c3f1a2b-4d5e-4f60-8a71-b2c3d4e5f607"]}) + pass_template_id: UUID = Field(description="The ID of the digital pass template used to generate the pass.", alias="passTemplateId", json_schema_extra={"examples": ["3fa85f64-5717-4562-b3fc-2c963f66afa6"]}) status: StrictStr = Field(description="The status of the digital pass. `created` indicates that the pass was generated and is ready to be added to a wallet. ", json_schema_extra={"examples": ["created"]}) - pass_url: StrictStr = Field(description="The URL you can use to let the customer add the digital pass to their wallet.", alias="passUrl", json_schema_extra={"examples": ["https://wallet.example.com/passes/pass_9c3f1a2b"]}) + pass_url: StrictStr = Field(description="The URL you can use to let the customer add the digital pass to their wallet. **Note**: For Google Wallet, the URL is valid for 30 days. After 30 days, create the pass again to get a new URL. ", alias="passUrl", json_schema_extra={"examples": ["https://wallet.example.com/passes/9c3f1a2b-4d5e-4f60-8a71-b2c3d4e5f607"]}) additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["passId", "passTemplateId", "status", "passUrl"] diff --git a/talon_one/models/new_digital_pass.py b/talon_one/models/new_digital_pass.py index 6987d17d..a4af0997 100644 --- a/talon_one/models/new_digital_pass.py +++ b/talon_one/models/new_digital_pass.py @@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from uuid import UUID from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -29,13 +30,13 @@ class NewDigitalPass(BaseModel): NewDigitalPass """ # noqa: E501 loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the associated loyalty program.", alias="loyaltyProgramId", json_schema_extra={"examples": [42]}) - pass_template_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The ID of the digital pass template used to generate the pass. ", alias="passTemplateId", json_schema_extra={"examples": ["tmpl_summer_loyalty"]}) - profile_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The integration ID of the customer profile the pass is issued for.", alias="profileId", json_schema_extra={"examples": ["12412412421"]}) + pass_template_id: UUID = Field(description="The ID of the digital pass template used to generate the pass.", alias="passTemplateId", json_schema_extra={"examples": ["3fa85f64-5717-4562-b3fc-2c963f66afa6"]}) + profile_integration_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The integration ID of the customer profile the pass is issued for.", alias="profileIntegrationId", json_schema_extra={"examples": ["12412412421"]}) loyalty_card_id: Optional[StrictStr] = Field(default=None, description="The identifier of the loyalty card the pass is issued for. **Note**: Only applicable for card-based loyalty programs. ", alias="loyaltyCardId", json_schema_extra={"examples": ["summer-loyalty-0e2f"]}) platform: StrictStr = Field(description="The wallet platform the pass is generated for. Possible values: - `apple`: The digital pass is generated for Apple Wallet. - `google`: The digital pass is generated for Google Wallet. ", json_schema_extra={"examples": ["google"]}) - attributes: Optional[Dict[str, StrictStr]] = Field(default=None, description="A map of placeholder values that you provide to fill in the pass template. These values are not validated against the template. ", json_schema_extra={"examples": [{"hm_member_name": "Jane Doe"}]}) + attributes: Optional[Dict[str, StrictStr]] = Field(default=None, description="A map of placeholder values that you provide to fill in the pass template. Pass templates reference each value as `CustomerProfile.Attributes.`. Each key must start with a letter or an underscore and can contain only letters, digits, and underscores. If the template requires a value that is missing, the request fails with a `422` error. ", json_schema_extra={"examples": [{"hm_member_name": "Jane Doe"}]}) additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["loyaltyProgramId", "passTemplateId", "profileId", "loyaltyCardId", "platform", "attributes"] + __properties: ClassVar[List[str]] = ["loyaltyProgramId", "passTemplateId", "profileIntegrationId", "loyaltyCardId", "platform", "attributes"] @field_validator('platform') def platform_validate_enum(cls, value): @@ -104,7 +105,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "loyaltyProgramId": obj.get("loyaltyProgramId"), "passTemplateId": obj.get("passTemplateId"), - "profileId": obj.get("profileId"), + "profileIntegrationId": obj.get("profileIntegrationId"), "loyaltyCardId": obj.get("loyaltyCardId"), "platform": obj.get("platform"), "attributes": obj.get("attributes") diff --git a/talon_one/models/new_reward_budget.py b/talon_one/models/new_reward_budget.py new file mode 100644 index 00000000..52148e93 --- /dev/null +++ b/talon_one/models/new_reward_budget.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class NewRewardBudget(BaseModel): + """ + NewRewardBudget + """ # noqa: E501 + metric: Optional[StrictStr] = Field(default='unlocks', description="The customer action that counts towards the budget.", json_schema_extra={"examples": ["unlocks"]}) + scope: StrictStr = Field(description="The type of count that the budget keeps of how many times the reward has been unlocked. - `perReward`: Counts how many times the reward has been unlocked by all customers. - `perProfile`: Counts how many times each customer profile has unlocked the reward. ", json_schema_extra={"examples": ["perReward"]}) + period: StrictStr = Field(description="The time frame after which the budget count resets to `0`. If you select `overall`, the budget never resets. The count resets at the start of each calendar time frame, not on the day the budget was created. For example, a `monthly` budget created on 20 October counts the unlocks from 20 to 31 October. On 1 November, the count resets to `0`. ", json_schema_extra={"examples": ["monthly"]}) + limit: Annotated[int, Field(strict=True, ge=1)] = Field(description="The maximum number of times the reward can be unlocked in the time frame.", json_schema_extra={"examples": [5000]}) + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["metric", "scope", "period", "limit"] + + @field_validator('metric') + def metric_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['unlocks']): + raise ValueError("must be one of enum values ('unlocks')") + return value + + @field_validator('scope') + def scope_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['perReward', 'perProfile']): + raise ValueError("must be one of enum values ('perReward', 'perProfile')") + return value + + @field_validator('period') + def period_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['overall', 'daily', 'weekly', 'monthly', 'yearly']): + raise ValueError("must be one of enum values ('overall', 'daily', 'weekly', 'monthly', 'yearly')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NewRewardBudget from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NewRewardBudget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "metric": obj.get("metric") if obj.get("metric") is not None else 'unlocks', + "scope": obj.get("scope"), + "period": obj.get("period"), + "limit": obj.get("limit") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/talon_one/models/outbound_log_stream_error_entry.py b/talon_one/models/outbound_log_stream_error_entry.py index 8631a062..22fdf2bb 100644 --- a/talon_one/models/outbound_log_stream_error_entry.py +++ b/talon_one/models/outbound_log_stream_error_entry.py @@ -27,7 +27,7 @@ class OutboundLogStreamErrorEntry(BaseModel): """ - An error that ended an `ndjson` stream, such as a log entry that couldn't be read. It is the last entry and the response is incomplete. + An error that ended a stream of outbound logs, such as a log entry that couldn't be read. It is the last entry and the response is incomplete. """ # noqa: E501 type: OutboundLogStreamEntryType data: OutboundLogStreamError diff --git a/talon_one/models/outbound_log_stream_log_entry.py b/talon_one/models/outbound_log_stream_log_entry.py index 184e5bd4..85914272 100644 --- a/talon_one/models/outbound_log_stream_log_entry.py +++ b/talon_one/models/outbound_log_stream_log_entry.py @@ -27,7 +27,7 @@ class OutboundLogStreamLogEntry(BaseModel): """ - An outbound log entry in an `ndjson` stream. + An outbound log entry in a stream of outbound logs. """ # noqa: E501 type: OutboundLogStreamEntryType data: OutboundLog diff --git a/talon_one/models/outbound_logs.py b/talon_one/models/outbound_logs.py index 181641e2..83b1b3ae 100644 --- a/talon_one/models/outbound_logs.py +++ b/talon_one/models/outbound_logs.py @@ -29,7 +29,7 @@ class OutboundLogs(BaseModel): OutboundLogs """ # noqa: E501 next_cursor: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="Cursor for the next page of results. Omitted when there are no more results.", alias="nextCursor", json_schema_extra={"examples": ["SmJlNERRMHdyNWFsTmRDZDVYU0c="]}) - data: List[OutboundLogsDataInner] = Field(description="List of outbound logs. When an error ends the response, an `OutboundLogStreamError` is the last item and the response is incomplete.") + data: List[OutboundLogsDataInner] = Field(description="List of outbound log entries. The `type` field determines the kind of entry. When an error ends the response, an `OutboundLogStreamErrorEntry` is the last item and the response is incomplete.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["nextCursor", "data"] diff --git a/talon_one/models/outbound_logs_data_inner.py b/talon_one/models/outbound_logs_data_inner.py index bcc6940c..e7554126 100644 --- a/talon_one/models/outbound_logs_data_inner.py +++ b/talon_one/models/outbound_logs_data_inner.py @@ -17,24 +17,24 @@ import pprint from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from talon_one.models.outbound_log import OutboundLog -from talon_one.models.outbound_log_stream_error import OutboundLogStreamError +from talon_one.models.outbound_log_stream_error_entry import OutboundLogStreamErrorEntry +from talon_one.models.outbound_log_stream_log_entry import OutboundLogStreamLogEntry from pydantic import StrictStr, Field from typing import Union, List, Set, Optional, Dict from typing_extensions import Literal, Self -OUTBOUNDLOGSDATAINNER_ONE_OF_SCHEMAS = ["OutboundLog", "OutboundLogStreamError"] +OUTBOUNDLOGSDATAINNER_ONE_OF_SCHEMAS = ["OutboundLogStreamErrorEntry", "OutboundLogStreamLogEntry"] class OutboundLogsDataInner(BaseModel): """ OutboundLogsDataInner """ - # data type: OutboundLog - oneof_schema_1_validator: Optional[OutboundLog] = None - # data type: OutboundLogStreamError - oneof_schema_2_validator: Optional[OutboundLogStreamError] = None - actual_instance: Optional[Union[OutboundLog, OutboundLogStreamError]] = None - one_of_schemas: Set[str] = { "OutboundLog", "OutboundLogStreamError" } + # data type: OutboundLogStreamLogEntry + oneof_schema_1_validator: Optional[OutboundLogStreamLogEntry] = None + # data type: OutboundLogStreamErrorEntry + oneof_schema_2_validator: Optional[OutboundLogStreamErrorEntry] = None + actual_instance: Optional[Union[OutboundLogStreamErrorEntry, OutboundLogStreamLogEntry]] = None + one_of_schemas: Set[str] = { "OutboundLogStreamErrorEntry", "OutboundLogStreamLogEntry" } model_config = ConfigDict( validate_assignment=True, @@ -42,6 +42,9 @@ class OutboundLogsDataInner(BaseModel): ) + discriminator_value_class_map: Dict[str, str] = { + } + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: @@ -57,22 +60,22 @@ def actual_instance_must_validate_oneof(cls, v): instance = OutboundLogsDataInner.model_construct() error_messages = [] match = 0 - # validate data type: OutboundLog - if not isinstance(v, OutboundLog): - error_messages.append(f"Error! Input type `{type(v)}` is not `OutboundLog`") + # validate data type: OutboundLogStreamLogEntry + if not isinstance(v, OutboundLogStreamLogEntry): + error_messages.append(f"Error! Input type `{type(v)}` is not `OutboundLogStreamLogEntry`") else: match += 1 - # validate data type: OutboundLogStreamError - if not isinstance(v, OutboundLogStreamError): - error_messages.append(f"Error! Input type `{type(v)}` is not `OutboundLogStreamError`") + # validate data type: OutboundLogStreamErrorEntry + if not isinstance(v, OutboundLogStreamErrorEntry): + error_messages.append(f"Error! Input type `{type(v)}` is not `OutboundLogStreamErrorEntry`") else: match += 1 if match > 1: # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in OutboundLogsDataInner with oneOf schemas: OutboundLog, OutboundLogStreamError. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in OutboundLogsDataInner with oneOf schemas: OutboundLogStreamErrorEntry, OutboundLogStreamLogEntry. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when setting `actual_instance` in OutboundLogsDataInner with oneOf schemas: OutboundLog, OutboundLogStreamError. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in OutboundLogsDataInner with oneOf schemas: OutboundLogStreamErrorEntry, OutboundLogStreamLogEntry. Details: " + ", ".join(error_messages)) else: return v @@ -87,25 +90,41 @@ def from_json(cls, json_str: str) -> Self: error_messages = [] match = 0 - # deserialize data into OutboundLog + # use oneOf discriminator to lookup the data type + _discriminator_property = "type" + _data_type = json.loads(json_str).get(_discriminator_property) + if not _data_type: + raise ValueError(f"Failed to lookup data type from the field `{_discriminator_property}` in the input.") + + # check if data type is `OutboundLogStreamErrorEntry` + if _data_type == "error": + instance.actual_instance = OutboundLogStreamErrorEntry.from_json(json_str) + return instance + + # check if data type is `OutboundLogStreamLogEntry` + if _data_type == "log": + instance.actual_instance = OutboundLogStreamLogEntry.from_json(json_str) + return instance + + # deserialize data into OutboundLogStreamLogEntry try: - instance.actual_instance = OutboundLog.from_json(json_str) + instance.actual_instance = OutboundLogStreamLogEntry.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into OutboundLogStreamError + # deserialize data into OutboundLogStreamErrorEntry try: - instance.actual_instance = OutboundLogStreamError.from_json(json_str) + instance.actual_instance = OutboundLogStreamErrorEntry.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into OutboundLogsDataInner with oneOf schemas: OutboundLog, OutboundLogStreamError. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when deserializing the JSON string into OutboundLogsDataInner with oneOf schemas: OutboundLogStreamErrorEntry, OutboundLogStreamLogEntry. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into OutboundLogsDataInner with oneOf schemas: OutboundLog, OutboundLogStreamError. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into OutboundLogsDataInner with oneOf schemas: OutboundLogStreamErrorEntry, OutboundLogStreamLogEntry. Details: " + ", ".join(error_messages)) else: return instance @@ -119,7 +138,7 @@ def to_json(self) -> str: else: return json.dumps(self.to_dict()) - def to_dict(self) -> Optional[Union[Dict[str, Any], OutboundLog, OutboundLogStreamError]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], OutboundLogStreamErrorEntry, OutboundLogStreamLogEntry]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/talon_one/models/reward_budget.py b/talon_one/models/reward_budget.py new file mode 100644 index 00000000..ee28ba82 --- /dev/null +++ b/talon_one/models/reward_budget.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RewardBudget(BaseModel): + """ + RewardBudget + """ # noqa: E501 + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + reward_id: StrictInt = Field(description="The ID of the reward this budget applies to.", alias="rewardId", json_schema_extra={"examples": [34]}) + metric: StrictStr = Field(description="The customer action that counts towards the budget.", json_schema_extra={"examples": ["unlocks"]}) + scope: StrictStr = Field(description="The type of count that the budget keeps of how many times the reward has been unlocked. - `perReward`: Counts how many times the reward has been unlocked by all customers. - `perProfile`: Counts how many times each customer profile has unlocked the reward. ", json_schema_extra={"examples": ["perReward"]}) + period: StrictStr = Field(description="The time frame after which the budget count resets to `0`. If you select `overall`, the budget never resets. The count resets at the start of each calendar time frame, not on the day the budget was created. For example, a `monthly` budget created on 20 October counts each time the reward is unlocked from 20 to 31 October. On 1 November, resets to `0`. ", json_schema_extra={"examples": ["monthly"]}) + limit: StrictInt = Field(description="The maximum number of times the reward can be unlocked in the time frame.", json_schema_extra={"examples": [5000]}) + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "created", "rewardId", "metric", "scope", "period", "limit"] + + @field_validator('metric') + def metric_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['unlocks']): + raise ValueError("must be one of enum values ('unlocks')") + return value + + @field_validator('scope') + def scope_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['perReward', 'perProfile']): + raise ValueError("must be one of enum values ('perReward', 'perProfile')") + return value + + @field_validator('period') + def period_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['overall', 'daily', 'weekly', 'monthly', 'yearly']): + raise ValueError("must be one of enum values ('overall', 'daily', 'weekly', 'monthly', 'yearly')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RewardBudget from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RewardBudget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "created": obj.get("created"), + "rewardId": obj.get("rewardId"), + "metric": obj.get("metric"), + "scope": obj.get("scope"), + "period": obj.get("period"), + "limit": obj.get("limit") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/talon_one/models/reward_budget_limit_counter.py b/talon_one/models/reward_budget_limit_counter.py new file mode 100644 index 00000000..6260a45f --- /dev/null +++ b/talon_one/models/reward_budget_limit_counter.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RewardBudgetLimitCounter(BaseModel): + """ + The count of times the reward has been unlocked in the current period, and how many times it can still be unlocked. It is shown when the budget scope is `perReward`. + """ # noqa: E501 + counter: StrictInt = Field(description="The number of times the reward has been unlocked in the current period. It is `0` if the reward has not been unlocked by any profile yet.", json_schema_extra={"examples": [120]}) + remaining: StrictInt = Field(description="The number of times the reward can still be unlocked. It is never negative.", json_schema_extra={"examples": [4880]}) + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["counter", "remaining"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RewardBudgetLimitCounter from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RewardBudgetLimitCounter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "counter": obj.get("counter"), + "remaining": obj.get("remaining") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/talon_one/models/reward_budget_with_limit_counter.py b/talon_one/models/reward_budget_with_limit_counter.py new file mode 100644 index 00000000..1dd85398 --- /dev/null +++ b/talon_one/models/reward_budget_with_limit_counter.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from talon_one.models.reward_budget_limit_counter import RewardBudgetLimitCounter +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RewardBudgetWithLimitCounter(BaseModel): + """ + RewardBudgetWithLimitCounter + """ # noqa: E501 + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + reward_id: StrictInt = Field(description="The ID of the reward this budget applies to.", alias="rewardId", json_schema_extra={"examples": [34]}) + metric: StrictStr = Field(description="The customer action that counts towards the budget.", json_schema_extra={"examples": ["unlocks"]}) + scope: StrictStr = Field(description="The type of count that the budget keeps of how many times the reward has been unlocked. - `perReward`: Counts how many times the reward has been unlocked by all customers. - `perProfile`: Counts how many times each customer profile has unlocked the reward. ", json_schema_extra={"examples": ["perReward"]}) + period: StrictStr = Field(description="The time frame after which the budget count resets to `0`. If you select `overall`, the budget never resets. The count resets at the start of each calendar time frame, not on the day the budget was created. For example, a `monthly` budget created on 20 October counts each time the reward is unlocked from 20 to 31 October. On 1 November, resets to `0`. ", json_schema_extra={"examples": ["monthly"]}) + limit: StrictInt = Field(description="The maximum number of times the reward can be unlocked in the time frame.", json_schema_extra={"examples": [5000]}) + limit_counter: Optional[Annotated[List[RewardBudgetLimitCounter], Field(min_length=1, max_length=1)]] = Field(default=None, description="The count of times the reward has been unlocked in the current period, and how many times it can still be unlocked before the limit is reached. It is only returned for budgets with the `perReward` scope, because every customer profile has their own count in a `perProfile` budget. The count is stored for each Application. A reward is connected to one Application, so the list always has exactly one item. ", alias="limitCounter") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "created", "rewardId", "metric", "scope", "period", "limit", "limitCounter"] + + @field_validator('metric') + def metric_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['unlocks']): + raise ValueError("must be one of enum values ('unlocks')") + return value + + @field_validator('scope') + def scope_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['perReward', 'perProfile']): + raise ValueError("must be one of enum values ('perReward', 'perProfile')") + return value + + @field_validator('period') + def period_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['overall', 'daily', 'weekly', 'monthly', 'yearly']): + raise ValueError("must be one of enum values ('overall', 'daily', 'weekly', 'monthly', 'yearly')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RewardBudgetWithLimitCounter from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in limit_counter (list) + _items = [] + if self.limit_counter: + for _item_limit_counter in self.limit_counter: + _items.append(_item_limit_counter.to_dict() if _item_limit_counter is not None else None) + _dict['limitCounter'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RewardBudgetWithLimitCounter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "created": obj.get("created"), + "rewardId": obj.get("rewardId"), + "metric": obj.get("metric"), + "scope": obj.get("scope"), + "period": obj.get("period"), + "limit": obj.get("limit"), + "limitCounter": [RewardBudgetLimitCounter.from_dict(_item) for _item in obj["limitCounter"]] if obj.get("limitCounter") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/talon_one/models/reward_with_budgets.py b/talon_one/models/reward_with_budgets.py new file mode 100644 index 00000000..b216bb07 --- /dev/null +++ b/talon_one/models/reward_with_budgets.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from talon_one.models.binding import Binding +from talon_one.models.reward_budget_with_limit_counter import RewardBudgetWithLimitCounter +from talon_one.models.reward_points_required import RewardPointsRequired +from talon_one.models.rule import Rule +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RewardWithBudgets(BaseModel): + """ + RewardWithBudgets + """ # noqa: E501 + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the reward.", json_schema_extra={"examples": ["Free Coffee"]}) + api_name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A unique identifier used to reference the reward in API integrations.", alias="apiName", json_schema_extra={"examples": ["free-coffee"]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the reward.", json_schema_extra={"examples": ["This reward gets you one free coffee."]}) + application_ids: List[StrictInt] = Field(description="The IDs of the Applications this reward is connected to. **Note**: Currently, a reward can only be connected to one Application. ", alias="applicationIds", json_schema_extra={"examples": [[1, 2, 3]]}) + sandbox: StrictBool = Field(description="Indicates if this is a live or sandbox reward. Rewards of a given type can only be connected to Applications of the same type.", json_schema_extra={"examples": [True]}) + eligibility_conditions: Optional[Rule] = Field(default=None, description="An optional rule that manages who can see this reward. If not specified, the reward is visible to all customers. **Note:** Only the `condition` field is evaluated within this rule. The `effects` field must be an empty array, and `bindings` are not supported. ", alias="eligibilityConditions") + rule: Optional[Rule] = Field(default=None, description="Rule to apply. **Note**: The `bindings` field inside the rule must not be used in this endpoint. All bindings should be defined at the reward level via the top-level `bindings` field. ") + bindings: Optional[List[Binding]] = Field(default=None, description="A list of named variables created before the reward's rules are evaluated. Each binding pairs a name with a talang expression. The expression is evaluated once and its result is available by name in any rule condition or effect. Bindings must be defined outside of individual rules.", json_schema_extra={"examples": [[]]}) + points_required: Optional[List[RewardPointsRequired]] = Field(default=None, description="The loyalty points required to activate the reward. Each object defines the specific loyalty program and subledger from which points are deducted when activating the reward. **Note:** When creating a reward, the `id` of each entry is ignored and a new entry is always created. ", alias="pointsRequired") + validity_duration: Optional[StrictStr] = Field(default=None, description="The duration for which the customer rewards unlocked from this reward remain active, relative to when the customer reward was unlocked. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. This field cannot be used in combination with `expiryDate`. If both `validityDuration` and `expiryDate` are not set, customer rewards have unlimited validity. ", alias="validityDuration", json_schema_extra={"examples": ["3M_U"]}) + expiry_date: Optional[datetime] = Field(default=None, description="Expiry date of the customer rewards unlocked from this reward. Customer rewards never expire if this is omitted and `validityDuration` is not set. **Note:** - The date must be in the future. - This field cannot be used in combination with `validityDuration`. ", alias="expiryDate", json_schema_extra={"examples": ["2026-12-31T00:00:00Z"]}) + modified: Optional[datetime] = Field(default=None, description="The timestamp when the reward was last updated in RFC3339 format.") + status: StrictStr = Field(description="The status of the reward.", json_schema_extra={"examples": ["active"]}) + budgets: Optional[List[RewardBudgetWithLimitCounter]] = Field(default=None, description="The budgets associated with the reward. This property is returned only when `includeBudgets` is `true`.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "created", "accountId", "name", "apiName", "description", "applicationIds", "sandbox", "eligibilityConditions", "rule", "bindings", "pointsRequired", "validityDuration", "expiryDate", "modified", "status", "budgets"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['active', 'inactive']): + raise ValueError("must be one of enum values ('active', 'inactive')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RewardWithBudgets from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of eligibility_conditions + if self.eligibility_conditions: + _dict['eligibilityConditions'] = self.eligibility_conditions.to_dict() + # override the default output from pydantic by calling `to_dict()` of rule + if self.rule: + _dict['rule'] = self.rule.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in bindings (list) + _items = [] + if self.bindings: + for _item_bindings in self.bindings: + _items.append(_item_bindings.to_dict() if _item_bindings is not None else None) + _dict['bindings'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in points_required (list) + _items = [] + if self.points_required: + for _item_points_required in self.points_required: + _items.append(_item_points_required.to_dict() if _item_points_required is not None else None) + _dict['pointsRequired'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in budgets (list) + _items = [] + if self.budgets: + for _item_budgets in self.budgets: + _items.append(_item_budgets.to_dict() if _item_budgets is not None else None) + _dict['budgets'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RewardWithBudgets from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "created": obj.get("created"), + "accountId": obj.get("accountId"), + "name": obj.get("name"), + "apiName": obj.get("apiName"), + "description": obj.get("description"), + "applicationIds": obj.get("applicationIds"), + "sandbox": obj.get("sandbox"), + "eligibilityConditions": Rule.from_dict(obj["eligibilityConditions"]) if obj.get("eligibilityConditions") is not None else None, + "rule": Rule.from_dict(obj["rule"]) if obj.get("rule") is not None else None, + "bindings": [Binding.from_dict(_item) for _item in obj["bindings"]] if obj.get("bindings") is not None else None, + "pointsRequired": [RewardPointsRequired.from_dict(_item) for _item in obj["pointsRequired"]] if obj.get("pointsRequired") is not None else None, + "validityDuration": obj.get("validityDuration"), + "expiryDate": obj.get("expiryDate"), + "modified": obj.get("modified"), + "status": obj.get("status"), + "budgets": [RewardBudgetWithLimitCounter.from_dict(_item) for _item in obj["budgets"]] if obj.get("budgets") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/talon_one/models/reward_with_unlocks.py b/talon_one/models/reward_with_unlocks.py index e5b5fcd6..23334e9b 100644 --- a/talon_one/models/reward_with_unlocks.py +++ b/talon_one/models/reward_with_unlocks.py @@ -34,7 +34,7 @@ class RewardWithUnlocks(BaseModel): name: StrictStr = Field(description="The customer-facing name of the reward.", json_schema_extra={"examples": ["10% Off Coupon"]}) description: Optional[StrictStr] = Field(default=None, description="Customer-facing description of the reward.", json_schema_extra={"examples": ["Applies to next order"]}) rule: RuleMetadata = Field(description="Customer-facing rule metadata for the reward.") - unlocked: Optional[List[CustomerReward]] = Field(default=None, description="The customer profile's unlocks of this reward that are not yet `used`.") + unlocked: Optional[List[CustomerReward]] = Field(default=None, description="The instances of this reward that the customer has unlocked but not used. Expired customer rewards are not returned.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "integrationId", "name", "description", "rule", "unlocked"] diff --git a/talon_one/models/update_reward_budget.py b/talon_one/models/update_reward_budget.py new file mode 100644 index 00000000..50abc814 --- /dev/null +++ b/talon_one/models/update_reward_budget.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UpdateRewardBudget(BaseModel): + """ + UpdateRewardBudget + """ # noqa: E501 + limit: Annotated[int, Field(strict=True, ge=1)] = Field(description="The new limit for the maximum number of times the reward can be unlocked in the given period.", json_schema_extra={"examples": [8000]}) + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["limit"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateRewardBudget from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateRewardBudget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "limit": obj.get("limit") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/test/test_award_discount_block.py b/test/test_award_discount_block.py index 412fc0ac..82634d76 100644 --- a/test/test_award_discount_block.py +++ b/test/test_award_discount_block.py @@ -43,7 +43,8 @@ def make_instance(self, include_optional) -> AwardDiscountBlock: name = '10% Off', value = None, partial = False, - target = None + target = None, + excluded_from_price_history = False ) else: return AwardDiscountBlock( diff --git a/test/test_block.py b/test/test_block.py index cd4532fe..0f49303e 100644 --- a/test/test_block.py +++ b/test/test_block.py @@ -56,6 +56,7 @@ def make_instance(self, include_optional) -> Block: value = None, partial = False, target = None, + excluded_from_price_history = False, expression = [ null ], diff --git a/test/test_catalog_action_filter.py b/test/test_catalog_action_filter.py index 6e6b6baa..8ece60a1 100644 --- a/test/test_catalog_action_filter.py +++ b/test/test_catalog_action_filter.py @@ -35,15 +35,15 @@ def make_instance(self, include_optional) -> CatalogActionFilter: model = CatalogActionFilter() if include_optional: return CatalogActionFilter( - attr = '', + attr = 'color', op = 'EQ', - value = None + value = blue ) else: return CatalogActionFilter( - attr = '', + attr = 'color', op = 'EQ', - value = None, + value = blue, ) """ diff --git a/test/test_catalog_action_patch_many.py b/test/test_catalog_action_patch_many.py index 10190717..ce5b5976 100644 --- a/test/test_catalog_action_patch_many.py +++ b/test/test_catalog_action_patch_many.py @@ -40,9 +40,9 @@ def make_instance(self, include_optional) -> CatalogActionPatchMany: price = 99.99, filters = [ talon_one.models.catalog_action_filter.CatalogActionFilter( - attr = '', + attr = 'color', op = 'EQ', - value = null, ) + value = blue, ) ], attributes = { }, ) ) @@ -53,9 +53,9 @@ def make_instance(self, include_optional) -> CatalogActionPatchMany: price = 99.99, filters = [ talon_one.models.catalog_action_filter.CatalogActionFilter( - attr = '', + attr = 'color', op = 'EQ', - value = null, ) + value = blue, ) ], attributes = { }, ), ) diff --git a/test/test_catalog_action_remove_many.py b/test/test_catalog_action_remove_many.py index bcddf313..bcacb6cf 100644 --- a/test/test_catalog_action_remove_many.py +++ b/test/test_catalog_action_remove_many.py @@ -39,9 +39,9 @@ def make_instance(self, include_optional) -> CatalogActionRemoveMany: payload = talon_one.models.remove_many_items_catalog_action.RemoveManyItemsCatalogAction( filters = [ talon_one.models.catalog_action_filter.CatalogActionFilter( - attr = '', + attr = 'color', op = 'EQ', - value = null, ) + value = blue, ) ], ) ) else: @@ -50,9 +50,9 @@ def make_instance(self, include_optional) -> CatalogActionRemoveMany: payload = talon_one.models.remove_many_items_catalog_action.RemoveManyItemsCatalogAction( filters = [ talon_one.models.catalog_action_filter.CatalogActionFilter( - attr = '', + attr = 'color', op = 'EQ', - value = null, ) + value = blue, ) ], ), ) """ diff --git a/test/test_customer_inventory.py b/test/test_customer_inventory.py index 39175aa2..07c49b6e 100644 --- a/test/test_customer_inventory.py +++ b/test/test_customer_inventory.py @@ -76,6 +76,7 @@ def make_instance(self, include_optional) -> CustomerInventory: profile_integration_id = 'customer1', integration_id = 'reward-unlock-123', unlocked_at = '2024-01-01T00:00:00Z', + expiry_date = '2024-03-31T23:59:59Z', used_at = '2024-01-02T00:00:00Z', ) ], ) ] diff --git a/test/test_customer_profile_integration_response_v2.py b/test/test_customer_profile_integration_response_v2.py index 56789c00..8fff0277 100644 --- a/test/test_customer_profile_integration_response_v2.py +++ b/test/test_customer_profile_integration_response_v2.py @@ -93,6 +93,7 @@ def make_instance(self, include_optional) -> CustomerProfileIntegrationResponseV profile_integration_id = 'customer1', integration_id = 'reward-unlock-123', unlocked_at = '2024-01-01T00:00:00Z', + expiry_date = '2024-03-31T23:59:59Z', used_at = '2024-01-02T00:00:00Z', ) ], ) ], diff --git a/test/test_customer_profile_reward.py b/test/test_customer_profile_reward.py index e0fcfefb..7fde775a 100644 --- a/test/test_customer_profile_reward.py +++ b/test/test_customer_profile_reward.py @@ -49,6 +49,7 @@ def make_instance(self, include_optional) -> CustomerProfileReward: status = 'unlocked', unlocked_at = '2026-07-01T09:00:00Z', unlocked_by_profile_integration_id = 'customer2839', + expiry_date = '2026-08-31T23:59:59Z', used_at = '2026-07-02T10:30:00Z', used_by_profile_integration_id = 'customer2840', loyalty_program_id = 9, diff --git a/test/test_customer_reward.py b/test/test_customer_reward.py index cc0a78af..75640c90 100644 --- a/test/test_customer_reward.py +++ b/test/test_customer_reward.py @@ -39,6 +39,7 @@ def make_instance(self, include_optional) -> CustomerReward: profile_integration_id = 'customer1', integration_id = 'reward-unlock-123', unlocked_at = '2024-01-01T00:00:00Z', + expiry_date = '2024-03-31T23:59:59Z', used_at = '2024-01-02T00:00:00Z' ) else: diff --git a/test/test_digital_pass.py b/test/test_digital_pass.py index c50815f1..edfb856a 100644 --- a/test/test_digital_pass.py +++ b/test/test_digital_pass.py @@ -35,17 +35,17 @@ def make_instance(self, include_optional) -> DigitalPass: model = DigitalPass() if include_optional: return DigitalPass( - pass_id = 'pass_9c3f1a2b', - pass_template_id = 'tmpl_summer_loyalty', + pass_id = '9c3f1a2b-4d5e-4f60-8a71-b2c3d4e5f607', + pass_template_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6', status = 'created', - pass_url = 'https://wallet.example.com/passes/pass_9c3f1a2b' + pass_url = 'https://wallet.example.com/passes/9c3f1a2b-4d5e-4f60-8a71-b2c3d4e5f607' ) else: return DigitalPass( - pass_id = 'pass_9c3f1a2b', - pass_template_id = 'tmpl_summer_loyalty', + pass_id = '9c3f1a2b-4d5e-4f60-8a71-b2c3d4e5f607', + pass_template_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6', status = 'created', - pass_url = 'https://wallet.example.com/passes/pass_9c3f1a2b', + pass_url = 'https://wallet.example.com/passes/9c3f1a2b-4d5e-4f60-8a71-b2c3d4e5f607', ) """ diff --git a/test/test_get_customer_rewards200_response.py b/test/test_get_customer_rewards200_response.py index 8afb7a25..9e1be2a8 100644 --- a/test/test_get_customer_rewards200_response.py +++ b/test/test_get_customer_rewards200_response.py @@ -49,6 +49,7 @@ def make_instance(self, include_optional) -> GetCustomerRewards200Response: status = 'unlocked', unlocked_at = '2026-07-01T09:00:00Z', unlocked_by_profile_integration_id = 'customer2839', + expiry_date = '2026-08-31T23:59:59Z', used_at = '2026-07-02T10:30:00Z', used_by_profile_integration_id = 'customer2840', loyalty_program_id = 9, @@ -69,6 +70,7 @@ def make_instance(self, include_optional) -> GetCustomerRewards200Response: status = 'unlocked', unlocked_at = '2026-07-01T09:00:00Z', unlocked_by_profile_integration_id = 'customer2839', + expiry_date = '2026-08-31T23:59:59Z', used_at = '2026-07-02T10:30:00Z', used_by_profile_integration_id = 'customer2840', loyalty_program_id = 9, diff --git a/test/test_integration_event_v2_response.py b/test/test_integration_event_v2_response.py index 59895f8e..10bfc4d3 100644 --- a/test/test_integration_event_v2_response.py +++ b/test/test_integration_event_v2_response.py @@ -127,6 +127,7 @@ def make_instance(self, include_optional) -> IntegrationEventV2Response: profile_integration_id = 'customer1', integration_id = 'reward-unlock-123', unlocked_at = '2024-01-01T00:00:00Z', + expiry_date = '2024-03-31T23:59:59Z', used_at = '2024-01-02T00:00:00Z', ) ], ) ], diff --git a/test/test_integration_event_v3_response.py b/test/test_integration_event_v3_response.py index b2430edb..4cb14979 100644 --- a/test/test_integration_event_v3_response.py +++ b/test/test_integration_event_v3_response.py @@ -127,6 +127,7 @@ def make_instance(self, include_optional) -> IntegrationEventV3Response: profile_integration_id = 'customer1', integration_id = 'reward-unlock-123', unlocked_at = '2024-01-01T00:00:00Z', + expiry_date = '2024-03-31T23:59:59Z', used_at = '2024-01-02T00:00:00Z', ) ], ) ], diff --git a/test/test_integration_response.py b/test/test_integration_response.py index 52ffd0a0..8157b33d 100644 --- a/test/test_integration_response.py +++ b/test/test_integration_response.py @@ -127,6 +127,7 @@ def make_instance(self, include_optional) -> IntegrationResponse: profile_integration_id = 'customer1', integration_id = 'reward-unlock-123', unlocked_at = '2024-01-01T00:00:00Z', + expiry_date = '2024-03-31T23:59:59Z', used_at = '2024-01-02T00:00:00Z', ) ], ) ] diff --git a/test/test_integration_state_v2.py b/test/test_integration_state_v2.py index e61b6f8e..e2cfe499 100644 --- a/test/test_integration_state_v2.py +++ b/test/test_integration_state_v2.py @@ -127,6 +127,7 @@ def make_instance(self, include_optional) -> IntegrationStateV2: profile_integration_id = 'customer1', integration_id = 'reward-unlock-123', unlocked_at = '2024-01-01T00:00:00Z', + expiry_date = '2024-03-31T23:59:59Z', used_at = '2024-01-02T00:00:00Z', ) ], ) ], diff --git a/test/test_new_digital_pass.py b/test/test_new_digital_pass.py index 6609bdb8..626b16e2 100644 --- a/test/test_new_digital_pass.py +++ b/test/test_new_digital_pass.py @@ -36,8 +36,8 @@ def make_instance(self, include_optional) -> NewDigitalPass: if include_optional: return NewDigitalPass( loyalty_program_id = 42, - pass_template_id = 'tmpl_summer_loyalty', - profile_id = '12412412421', + pass_template_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6', + profile_integration_id = '12412412421', loyalty_card_id = 'summer-loyalty-0e2f', platform = 'google', attributes = {hm_member_name=Jane Doe} @@ -45,8 +45,8 @@ def make_instance(self, include_optional) -> NewDigitalPass: else: return NewDigitalPass( loyalty_program_id = 42, - pass_template_id = 'tmpl_summer_loyalty', - profile_id = '12412412421', + pass_template_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6', + profile_integration_id = '12412412421', platform = 'google', ) """ diff --git a/test/test_new_reward_budget.py b/test/test_new_reward_budget.py new file mode 100644 index 00000000..77c71c33 --- /dev/null +++ b/test/test_new_reward_budget.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.new_reward_budget import NewRewardBudget + +class TestNewRewardBudget(unittest.TestCase): + """NewRewardBudget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NewRewardBudget: + """Test NewRewardBudget + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NewRewardBudget` + """ + model = NewRewardBudget() + if include_optional: + return NewRewardBudget( + metric = 'unlocks', + scope = 'perReward', + period = 'monthly', + limit = 5000 + ) + else: + return NewRewardBudget( + scope = 'perReward', + period = 'monthly', + limit = 5000, + ) + """ + + def testNewRewardBudget(self): + """Test NewRewardBudget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_outbound_logs_data_inner.py b/test/test_outbound_logs_data_inner.py index dddb0c84..fec32e73 100644 --- a/test/test_outbound_logs_data_inner.py +++ b/test/test_outbound_logs_data_inner.py @@ -35,37 +35,17 @@ def make_instance(self, include_optional) -> OutboundLogsDataInner: model = OutboundLogsDataInner() if include_optional: return OutboundLogsDataInner( - uuid = '67e55044-10b1-426f-9247-bb680e5fe0c8', - notification_id = 1, - notification_name = 'Notification name', - webhook_id = 101, - webhook_name = 'My webhook', - notification_type = 'CampaignNotification', - application_id = 1, - loyalty_program_id = 2, - request = talon_one.models.outbound_log_request.OutboundLogRequest( - method = 'POST', - url = 'https://example.com/webhook', - headers = [content-type: application/json], - body = {ProfileIntegrationID=URNGV8294NV, LoyaltyProgramID=5, SubledgerID=sub-123, Amount=10.99, Reason=Compensation, TypeOfChange=campaign_manager, EmployeeName=Franziska Schneider, UserID=25, Operation=addition, StartDate=2023-01-24T14:15:22Z, ExpiryDate=2024-01-24T14:15:22Z, SessionIntegrationID=cc53e4fa-547f-4f5e-8333-76e05c381f67, NotificationType=LoyaltyPointsDeducted, TransactionUUID=1a6a7599-2622-4489-9034-5a62da3944e0}, ), - created_at = '2026-08-17T14:32:05Z', - processing_time_ms = 180, - response = talon_one.models.outbound_log_response.OutboundLogResponse( - status_code = 200, - raw_body = 'HTTP/1.1 200 OK -Content-Type: application/json - -{}', ), - error = 'internal server error', - id = '67e55044-10b1-426f-9247-bb680e5fe0c8' + type = 'log', + data = talon_one.models.outbound_log_stream_error.OutboundLogStreamError( + error = 'internal server error', + id = '67e55044-10b1-426f-9247-bb680e5fe0c8', ) ) else: return OutboundLogsDataInner( - uuid = '67e55044-10b1-426f-9247-bb680e5fe0c8', - notification_type = 'CampaignNotification', - created_at = '2026-08-17T14:32:05Z', - processing_time_ms = 180, - error = 'internal server error', + type = 'log', + data = talon_one.models.outbound_log_stream_error.OutboundLogStreamError( + error = 'internal server error', + id = '67e55044-10b1-426f-9247-bb680e5fe0c8', ), ) """ diff --git a/test/test_patch_many_items_catalog_action.py b/test/test_patch_many_items_catalog_action.py index cee207eb..5ef880e7 100644 --- a/test/test_patch_many_items_catalog_action.py +++ b/test/test_patch_many_items_catalog_action.py @@ -38,9 +38,9 @@ def make_instance(self, include_optional) -> PatchManyItemsCatalogAction: price = 99.99, filters = [ talon_one.models.catalog_action_filter.CatalogActionFilter( - attr = '', + attr = 'color', op = 'EQ', - value = null, ) + value = blue, ) ], attributes = { } ) diff --git a/test/test_remove_many_items_catalog_action.py b/test/test_remove_many_items_catalog_action.py index 20b10c4f..30d9b87c 100644 --- a/test/test_remove_many_items_catalog_action.py +++ b/test/test_remove_many_items_catalog_action.py @@ -37,9 +37,9 @@ def make_instance(self, include_optional) -> RemoveManyItemsCatalogAction: return RemoveManyItemsCatalogAction( filters = [ talon_one.models.catalog_action_filter.CatalogActionFilter( - attr = '', + attr = 'color', op = 'EQ', - value = null, ) + value = blue, ) ] ) else: diff --git a/test/test_reward_budget.py b/test/test_reward_budget.py new file mode 100644 index 00000000..8968bed0 --- /dev/null +++ b/test/test_reward_budget.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.reward_budget import RewardBudget + +class TestRewardBudget(unittest.TestCase): + """RewardBudget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RewardBudget: + """Test RewardBudget + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RewardBudget` + """ + model = RewardBudget() + if include_optional: + return RewardBudget( + id = 6, + created = '2020-06-10T09:05:27.993483Z', + reward_id = 34, + metric = 'unlocks', + scope = 'perReward', + period = 'monthly', + limit = 5000 + ) + else: + return RewardBudget( + id = 6, + created = '2020-06-10T09:05:27.993483Z', + reward_id = 34, + metric = 'unlocks', + scope = 'perReward', + period = 'monthly', + limit = 5000, + ) + """ + + def testRewardBudget(self): + """Test RewardBudget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_reward_budget_limit_counter.py b/test/test_reward_budget_limit_counter.py new file mode 100644 index 00000000..e91b54f8 --- /dev/null +++ b/test/test_reward_budget_limit_counter.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.reward_budget_limit_counter import RewardBudgetLimitCounter + +class TestRewardBudgetLimitCounter(unittest.TestCase): + """RewardBudgetLimitCounter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RewardBudgetLimitCounter: + """Test RewardBudgetLimitCounter + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RewardBudgetLimitCounter` + """ + model = RewardBudgetLimitCounter() + if include_optional: + return RewardBudgetLimitCounter( + counter = 120, + remaining = 4880 + ) + else: + return RewardBudgetLimitCounter( + counter = 120, + remaining = 4880, + ) + """ + + def testRewardBudgetLimitCounter(self): + """Test RewardBudgetLimitCounter""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_reward_budget_with_limit_counter.py b/test/test_reward_budget_with_limit_counter.py new file mode 100644 index 00000000..62a1f6a6 --- /dev/null +++ b/test/test_reward_budget_with_limit_counter.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.reward_budget_with_limit_counter import RewardBudgetWithLimitCounter + +class TestRewardBudgetWithLimitCounter(unittest.TestCase): + """RewardBudgetWithLimitCounter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RewardBudgetWithLimitCounter: + """Test RewardBudgetWithLimitCounter + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RewardBudgetWithLimitCounter` + """ + model = RewardBudgetWithLimitCounter() + if include_optional: + return RewardBudgetWithLimitCounter( + id = 6, + created = '2020-06-10T09:05:27.993483Z', + reward_id = 34, + metric = 'unlocks', + scope = 'perReward', + period = 'monthly', + limit = 5000, + limit_counter = [ + talon_one.models.reward_budget_limit_counter.RewardBudgetLimitCounter( + counter = 120, + remaining = 4880, ) + ] + ) + else: + return RewardBudgetWithLimitCounter( + id = 6, + created = '2020-06-10T09:05:27.993483Z', + reward_id = 34, + metric = 'unlocks', + scope = 'perReward', + period = 'monthly', + limit = 5000, + ) + """ + + def testRewardBudgetWithLimitCounter(self): + """Test RewardBudgetWithLimitCounter""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_reward_with_budgets.py b/test/test_reward_with_budgets.py new file mode 100644 index 00000000..f5f8639b --- /dev/null +++ b/test/test_reward_with_budgets.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.reward_with_budgets import RewardWithBudgets + +class TestRewardWithBudgets(unittest.TestCase): + """RewardWithBudgets unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RewardWithBudgets: + """Test RewardWithBudgets + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RewardWithBudgets` + """ + model = RewardWithBudgets() + if include_optional: + return RewardWithBudgets( + id = 6, + created = '2020-06-10T09:05:27.993483Z', + account_id = 3886, + name = 'Free Coffee', + api_name = 'free-coffee', + description = 'This reward gets you one free coffee.', + application_ids = [1, 2, 3], + sandbox = True, + eligibility_conditions = talon_one.models.rule.Rule( + id = '7fa800a8-ac8d-4792-85dc-c4650dcc8f23', + parent_id = '7fa800a8-ac8d-4792-85dc-c4650dcc8f23', + title = 'Give discount via coupon', + description = 'Creates a discount when a coupon is valid', + bindings = [ + talon_one.models.binding.Binding( + name = 'Discount percentage', + type = 'templateParameter', + expression = [identity, 10], + value_type = 'number', + min_value = 0, + max_value = 19.9, + attribute_id = 100, + description = 'The percentage discount applied to the cart total.', ) + ], + condition = [and, [couponValid]], + effects = [catch, [noop], [setDiscount, 10% off, [*, [., Session, Total], [/, 10, 100]]]], ), + rule = talon_one.models.rule.Rule( + id = '7fa800a8-ac8d-4792-85dc-c4650dcc8f23', + parent_id = '7fa800a8-ac8d-4792-85dc-c4650dcc8f23', + title = 'Give discount via coupon', + description = 'Creates a discount when a coupon is valid', + bindings = [ + talon_one.models.binding.Binding( + name = 'Discount percentage', + type = 'templateParameter', + expression = [identity, 10], + value_type = 'number', + min_value = 0, + max_value = 19.9, + attribute_id = 100, + description = 'The percentage discount applied to the cart total.', ) + ], + condition = [and, [couponValid]], + effects = [catch, [noop], [setDiscount, 10% off, [*, [., Session, Total], [/, 10, 100]]]], ), + bindings = [], + points_required = [ + talon_one.models.reward_points_required.RewardPointsRequired( + id = 1, + amount = 500, + loyalty_program_id = 10, + subledger_id = 'mysubledger', ) + ], + validity_duration = '3M_U', + expiry_date = '2026-12-31T00:00:00Z', + modified = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + status = 'active', + budgets = [ + null + ] + ) + else: + return RewardWithBudgets( + id = 6, + created = '2020-06-10T09:05:27.993483Z', + account_id = 3886, + name = 'Free Coffee', + api_name = 'free-coffee', + application_ids = [1, 2, 3], + sandbox = True, + status = 'active', + ) + """ + + def testRewardWithBudgets(self): + """Test RewardWithBudgets""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_reward_with_unlocks.py b/test/test_reward_with_unlocks.py index 2c637fa7..d4ae25b8 100644 --- a/test/test_reward_with_unlocks.py +++ b/test/test_reward_with_unlocks.py @@ -50,6 +50,7 @@ def make_instance(self, include_optional) -> RewardWithUnlocks: profile_integration_id = 'customer1', integration_id = 'reward-unlock-123', unlocked_at = '2024-01-01T00:00:00Z', + expiry_date = '2024-03-31T23:59:59Z', used_at = '2024-01-02T00:00:00Z', ) ] ) diff --git a/test/test_update_reward_budget.py b/test/test_update_reward_budget.py new file mode 100644 index 00000000..b8ef730d --- /dev/null +++ b/test/test_update_reward_budget.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.update_reward_budget import UpdateRewardBudget + +class TestUpdateRewardBudget(unittest.TestCase): + """UpdateRewardBudget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateRewardBudget: + """Test UpdateRewardBudget + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateRewardBudget` + """ + model = UpdateRewardBudget() + if include_optional: + return UpdateRewardBudget( + limit = 8000 + ) + else: + return UpdateRewardBudget( + limit = 8000, + ) + """ + + def testUpdateRewardBudget(self): + """Test UpdateRewardBudget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()