From 9f0347063edbfc618c1f5469baa2baeee39ce144 Mon Sep 17 00:00:00 2001 From: Talon-One SDK Generator Date: Wed, 24 Jun 2026 10:28:37 +0000 Subject: [PATCH] update to 26.13.0 --- .openapi-generator/FILES | 36 ++ README.md | 14 + docs/BaseBlock.md | 32 ++ docs/CustomerAchievement.md | 40 ++ docs/IntegrationApi.md | 113 +++++- docs/IntegrationCampaign.md | 2 + docs/IntegrationEventV2Response.md | 1 + docs/IntegrationEventV3Response.md | 1 + ...tyProfileBasedPointsChangedNotification.md | 1 + docs/IntegrationResponse.md | 1 + docs/IntegrationStateV2.md | 1 + docs/ManagementApi.md | 98 ++++- docs/PassthroughBlock.md | 32 ++ docs/PromotionGroupBlock.md | 35 ++ docs/PromotionRuleV2.md | 33 ++ docs/Reward.md | 2 +- docs/Risk.md | 44 +++ docs/RiskAffectedEntityItem.md | 34 ++ docs/RiskDetail.md | 45 +++ docs/RuleV2.md | 33 ++ docs/RulesetV2.md | 40 ++ docs/StrikethroughGroupBlock.md | 35 ++ docs/StrikethroughRuleV2.md | 33 ++ docs/UpdateReward.md | 2 +- pyproject.toml | 2 +- setup.py | 2 +- talon_one/__init__.py | 26 +- talon_one/api/integration_api.py | 355 ++++++++++++++++- talon_one/api/management_api.py | 361 ++++++++++++++++++ talon_one/api_client.py | 2 +- talon_one/configuration.py | 2 +- talon_one/models/__init__.py | 12 + talon_one/models/base_block.py | 92 +++++ talon_one/models/best_prior_price.py | 2 +- talon_one/models/best_prior_price_request.py | 2 +- talon_one/models/customer_achievement.py | 138 +++++++ ...customer_profile_integration_request_v2.py | 4 +- talon_one/models/integration_campaign.py | 8 +- .../models/integration_event_v2_request.py | 4 +- .../models/integration_event_v2_response.py | 12 +- .../models/integration_event_v3_response.py | 12 +- ...ofile_based_points_changed_notification.py | 4 +- talon_one/models/integration_request.py | 4 +- talon_one/models/integration_response.py | 14 +- talon_one/models/integration_state_v2.py | 12 +- talon_one/models/passthrough_block.py | 99 +++++ talon_one/models/price_history_request.py | 2 +- talon_one/models/price_history_response.py | 2 +- talon_one/models/promotion_group_block.py | 107 ++++++ talon_one/models/promotion_rule_v2.py | 96 +++++ talon_one/models/response_content_object.py | 4 +- talon_one/models/reward.py | 12 +- talon_one/models/risk.py | 152 ++++++++ talon_one/models/risk_affected_entity_item.py | 103 +++++ talon_one/models/risk_detail.py | 162 ++++++++ talon_one/models/rule_v2.py | 94 +++++ talon_one/models/ruleset_v2.py | 125 ++++++ talon_one/models/strikethrough_group_block.py | 107 ++++++ talon_one/models/strikethrough_rule_v2.py | 96 +++++ talon_one/models/update_reward.py | 12 +- test/test_base_block.py | 57 +++ test/test_best_prior_price.py | 4 +- test/test_best_prior_price_request.py | 4 +- test/test_customer_achievement.py | 74 ++++ test/test_integration_api.py | 7 + test/test_integration_campaign.py | 4 +- test/test_integration_event_v2_response.py | 19 + test/test_integration_event_v3_response.py | 19 + ...ofile_based_points_changed_notification.py | 1 + test/test_integration_response.py | 19 + test/test_integration_state_v2.py | 19 + test/test_management_api.py | 7 + test/test_passthrough_block.py | 60 +++ test/test_price_history_request.py | 4 +- test/test_price_history_response.py | 4 +- test/test_promotion_group_block.py | 73 ++++ test/test_promotion_rule_v2.py | 61 +++ test/test_reward.py | 2 +- test/test_risk.py | 78 ++++ test/test_risk_affected_entity_item.py | 60 +++ test/test_risk_detail.py | 94 +++++ test/test_rule_v2.py | 55 +++ test/test_ruleset_v2.py | 80 ++++ test/test_strikethrough_group_block.py | 73 ++++ test/test_strikethrough_rule_v2.py | 61 +++ test/test_update_reward.py | 2 +- 86 files changed, 3812 insertions(+), 80 deletions(-) create mode 100644 docs/BaseBlock.md create mode 100644 docs/CustomerAchievement.md create mode 100644 docs/PassthroughBlock.md create mode 100644 docs/PromotionGroupBlock.md create mode 100644 docs/PromotionRuleV2.md create mode 100644 docs/Risk.md create mode 100644 docs/RiskAffectedEntityItem.md create mode 100644 docs/RiskDetail.md create mode 100644 docs/RuleV2.md create mode 100644 docs/RulesetV2.md create mode 100644 docs/StrikethroughGroupBlock.md create mode 100644 docs/StrikethroughRuleV2.md create mode 100644 talon_one/models/base_block.py create mode 100644 talon_one/models/customer_achievement.py create mode 100644 talon_one/models/passthrough_block.py create mode 100644 talon_one/models/promotion_group_block.py create mode 100644 talon_one/models/promotion_rule_v2.py create mode 100644 talon_one/models/risk.py create mode 100644 talon_one/models/risk_affected_entity_item.py create mode 100644 talon_one/models/risk_detail.py create mode 100644 talon_one/models/rule_v2.py create mode 100644 talon_one/models/ruleset_v2.py create mode 100644 talon_one/models/strikethrough_group_block.py create mode 100644 talon_one/models/strikethrough_rule_v2.py create mode 100644 test/test_base_block.py create mode 100644 test/test_customer_achievement.py create mode 100644 test/test_passthrough_block.py create mode 100644 test/test_promotion_group_block.py create mode 100644 test/test_promotion_rule_v2.py create mode 100644 test/test_risk.py create mode 100644 test/test_risk_affected_entity_item.py create mode 100644 test/test_risk_detail.py create mode 100644 test/test_rule_v2.py create mode 100644 test/test_ruleset_v2.py create mode 100644 test/test_strikethrough_group_block.py create mode 100644 test/test_strikethrough_rule_v2.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index e61573c..f60d311 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -89,6 +89,7 @@ docs/AudienceIntegrationID.md docs/AudienceMembership.md docs/AudienceReference.md docs/AwardGiveawayEffectProps.md +docs/BaseBlock.md docs/BaseCampaign.md docs/BaseLoyaltyProgram.md docs/BaseNotification.md @@ -206,6 +207,7 @@ docs/CreateTemplateCampaign.md docs/CreateTemplateCampaignResponse.md docs/CustomEffect.md docs/CustomEffectProps.md +docs/CustomerAchievement.md docs/CustomerActivityReport.md docs/CustomerAnalytics.md docs/CustomerInventory.md @@ -546,6 +548,7 @@ docs/OutgoingIntegrationTemplateWithConfigurationDetails.md docs/OutgoingIntegrationTemplates.md docs/OutgoingIntegrationType.md docs/OutgoingIntegrationTypes.md +docs/PassthroughBlock.md docs/PatchItemCatalogAction.md docs/PatchManyItemsCatalogAction.md docs/PendingActivePointsData.md @@ -567,6 +570,8 @@ docs/ProductUnitAnalyticsTotals.md docs/ProfileAudiencesChanges.md docs/ProjectedTier.md docs/PromoteExperiment.md +docs/PromotionGroupBlock.md +docs/PromotionRuleV2.md docs/RedeemReferralEffectProps.md docs/Referral.md docs/ReferralConstraints.md @@ -588,6 +593,9 @@ docs/RevisionActivationRequest.md docs/RevisionVersion.md docs/Reward.md docs/RewardPointsRequired.md +docs/Risk.md +docs/RiskAffectedEntityItem.md +docs/RiskDetail.md docs/RiskNotification.md docs/Role.md docs/RoleAssign.md @@ -612,7 +620,9 @@ docs/RuleEligibilityFailureDetails.md docs/RuleFailureReason.md docs/RuleMetadata.md docs/RuleMetadataEligibility.md +docs/RuleV2.md docs/Ruleset.md +docs/RulesetV2.md docs/SSOConfig.md docs/SamlConnection.md docs/SamlConnectionInternal.md @@ -654,7 +664,9 @@ docs/StrikethroughChangedItem.md docs/StrikethroughCustomEffectPerItemProps.md docs/StrikethroughDebugResponse.md docs/StrikethroughEffect.md +docs/StrikethroughGroupBlock.md docs/StrikethroughLabelingNotification.md +docs/StrikethroughRuleV2.md docs/StrikethroughSetDiscountPerItemEffectProps.md docs/StrikethroughSetDiscountPerItemMemberEffectProps.md docs/StrikethroughTrigger.md @@ -825,6 +837,7 @@ talon_one/models/audience_integration_id.py talon_one/models/audience_membership.py talon_one/models/audience_reference.py talon_one/models/award_giveaway_effect_props.py +talon_one/models/base_block.py talon_one/models/base_campaign.py talon_one/models/base_loyalty_program.py talon_one/models/base_notification.py @@ -942,6 +955,7 @@ talon_one/models/create_template_campaign.py talon_one/models/create_template_campaign_response.py talon_one/models/custom_effect.py talon_one/models/custom_effect_props.py +talon_one/models/customer_achievement.py talon_one/models/customer_activity_report.py talon_one/models/customer_analytics.py talon_one/models/customer_inventory.py @@ -1280,6 +1294,7 @@ talon_one/models/outgoing_integration_template_with_configuration_details.py talon_one/models/outgoing_integration_templates.py talon_one/models/outgoing_integration_type.py talon_one/models/outgoing_integration_types.py +talon_one/models/passthrough_block.py talon_one/models/patch_item_catalog_action.py talon_one/models/patch_many_items_catalog_action.py talon_one/models/pending_active_points_data.py @@ -1301,6 +1316,8 @@ talon_one/models/product_unit_analytics_totals.py talon_one/models/profile_audiences_changes.py talon_one/models/projected_tier.py talon_one/models/promote_experiment.py +talon_one/models/promotion_group_block.py +talon_one/models/promotion_rule_v2.py talon_one/models/redeem_referral_effect_props.py talon_one/models/referral.py talon_one/models/referral_constraints.py @@ -1322,6 +1339,9 @@ talon_one/models/revision_activation_request.py talon_one/models/revision_version.py talon_one/models/reward.py talon_one/models/reward_points_required.py +talon_one/models/risk.py +talon_one/models/risk_affected_entity_item.py +talon_one/models/risk_detail.py talon_one/models/risk_notification.py talon_one/models/role.py talon_one/models/role_assign.py @@ -1346,7 +1366,9 @@ talon_one/models/rule_eligibility_failure_details.py talon_one/models/rule_failure_reason.py talon_one/models/rule_metadata.py talon_one/models/rule_metadata_eligibility.py +talon_one/models/rule_v2.py talon_one/models/ruleset.py +talon_one/models/ruleset_v2.py talon_one/models/saml_connection.py talon_one/models/saml_connection_internal.py talon_one/models/saml_connection_metadata.py @@ -1388,7 +1410,9 @@ talon_one/models/strikethrough_changed_item.py talon_one/models/strikethrough_custom_effect_per_item_props.py talon_one/models/strikethrough_debug_response.py talon_one/models/strikethrough_effect.py +talon_one/models/strikethrough_group_block.py talon_one/models/strikethrough_labeling_notification.py +talon_one/models/strikethrough_rule_v2.py talon_one/models/strikethrough_set_discount_per_item_effect_props.py talon_one/models/strikethrough_set_discount_per_item_member_effect_props.py talon_one/models/strikethrough_trigger.py @@ -1548,6 +1572,7 @@ test/test_audience_integration_id.py test/test_audience_membership.py test/test_audience_reference.py test/test_award_giveaway_effect_props.py +test/test_base_block.py test/test_base_campaign.py test/test_base_loyalty_program.py test/test_base_notification.py @@ -1665,6 +1690,7 @@ test/test_create_template_campaign.py test/test_create_template_campaign_response.py test/test_custom_effect.py test/test_custom_effect_props.py +test/test_customer_achievement.py test/test_customer_activity_report.py test/test_customer_analytics.py test/test_customer_inventory.py @@ -2005,6 +2031,7 @@ test/test_outgoing_integration_template_with_configuration_details.py test/test_outgoing_integration_templates.py test/test_outgoing_integration_type.py test/test_outgoing_integration_types.py +test/test_passthrough_block.py test/test_patch_item_catalog_action.py test/test_patch_many_items_catalog_action.py test/test_pending_active_points_data.py @@ -2026,6 +2053,8 @@ test/test_product_unit_analytics_totals.py test/test_profile_audiences_changes.py test/test_projected_tier.py test/test_promote_experiment.py +test/test_promotion_group_block.py +test/test_promotion_rule_v2.py test/test_redeem_referral_effect_props.py test/test_referral.py test/test_referral_constraints.py @@ -2047,6 +2076,9 @@ test/test_revision_activation_request.py test/test_revision_version.py test/test_reward.py test/test_reward_points_required.py +test/test_risk.py +test/test_risk_affected_entity_item.py +test/test_risk_detail.py test/test_risk_notification.py test/test_role.py test/test_role_assign.py @@ -2071,7 +2103,9 @@ test/test_rule_eligibility_failure_details.py test/test_rule_failure_reason.py test/test_rule_metadata.py test/test_rule_metadata_eligibility.py +test/test_rule_v2.py test/test_ruleset.py +test/test_ruleset_v2.py test/test_saml_connection.py test/test_saml_connection_internal.py test/test_saml_connection_metadata.py @@ -2113,7 +2147,9 @@ test/test_strikethrough_changed_item.py test/test_strikethrough_custom_effect_per_item_props.py test/test_strikethrough_debug_response.py test/test_strikethrough_effect.py +test/test_strikethrough_group_block.py test/test_strikethrough_labeling_notification.py +test/test_strikethrough_rule_v2.py test/test_strikethrough_set_discount_per_item_effect_props.py test/test_strikethrough_set_discount_per_item_member_effect_props.py test/test_strikethrough_trigger.py diff --git a/README.md b/README.md index 9ce0aa5..a698630 100644 --- a/README.md +++ b/README.md @@ -181,6 +181,7 @@ Class | Method | HTTP request | Description *IntegrationApi* | [**get_loyalty_program_profile_transactions**](docs/IntegrationApi.md#get_loyalty_program_profile_transactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/transactions | List customer's loyalty transactions *IntegrationApi* | [**get_reserved_customers**](docs/IntegrationApi.md#get_reserved_customers) | **GET** /v1/coupon_reservations/customerprofiles/{couponValue} | List customers that have this coupon reserved *IntegrationApi* | [**integration_get_all_campaigns**](docs/IntegrationApi.md#integration_get_all_campaigns) | **GET** /v1/integration/campaigns | List all running campaigns +*IntegrationApi* | [**join_loyalty_program**](docs/IntegrationApi.md#join_loyalty_program) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/join | Join customer profile to loyalty program *IntegrationApi* | [**link_loyalty_card_to_profile**](docs/IntegrationApi.md#link_loyalty_card_to_profile) | **POST** /v2/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/link_profile | Link customer profile to card *IntegrationApi* | [**reopen_customer_session**](docs/IntegrationApi.md#reopen_customer_session) | **PUT** /v2/customer_sessions/{customerSessionId}/reopen | Reopen customer session *IntegrationApi* | [**return_cart_items**](docs/IntegrationApi.md#return_cart_items) | **POST** /v2/customer_sessions/{customerSessionId}/returns | Return cart items @@ -313,6 +314,7 @@ Class | Method | HTTP request | Description *ManagementApi* | [**get_referrals_without_total_count**](docs/ManagementApi.md#get_referrals_without_total_count) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/no_total | List referrals *ManagementApi* | [**get_role_v2**](docs/ManagementApi.md#get_role_v2) | **GET** /v2/roles/{roleId} | Get role *ManagementApi* | [**get_ruleset**](docs/ManagementApi.md#get_ruleset) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId} | Get ruleset +*ManagementApi* | [**get_ruleset_v2**](docs/ManagementApi.md#get_ruleset_v2) | **GET** /v2/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId} | Get ruleset (V2) *ManagementApi* | [**get_rulesets**](docs/ManagementApi.md#get_rulesets) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets | List campaign rulesets *ManagementApi* | [**get_store**](docs/ManagementApi.md#get_store) | **GET** /v1/applications/{applicationId}/stores/{storeId} | Get store *ManagementApi* | [**get_user**](docs/ManagementApi.md#get_user) | **GET** /v1/users/{userId} | Get user @@ -461,6 +463,7 @@ Class | Method | HTTP request | Description - [AudienceMembership](docs/AudienceMembership.md) - [AudienceReference](docs/AudienceReference.md) - [AwardGiveawayEffectProps](docs/AwardGiveawayEffectProps.md) +- [BaseBlock](docs/BaseBlock.md) - [BaseCampaign](docs/BaseCampaign.md) - [BaseLoyaltyProgram](docs/BaseLoyaltyProgram.md) - [BaseNotification](docs/BaseNotification.md) @@ -578,6 +581,7 @@ Class | Method | HTTP request | Description - [CreateTemplateCampaignResponse](docs/CreateTemplateCampaignResponse.md) - [CustomEffect](docs/CustomEffect.md) - [CustomEffectProps](docs/CustomEffectProps.md) +- [CustomerAchievement](docs/CustomerAchievement.md) - [CustomerActivityReport](docs/CustomerActivityReport.md) - [CustomerAnalytics](docs/CustomerAnalytics.md) - [CustomerInventory](docs/CustomerInventory.md) @@ -916,6 +920,7 @@ Class | Method | HTTP request | Description - [OutgoingIntegrationTemplates](docs/OutgoingIntegrationTemplates.md) - [OutgoingIntegrationType](docs/OutgoingIntegrationType.md) - [OutgoingIntegrationTypes](docs/OutgoingIntegrationTypes.md) +- [PassthroughBlock](docs/PassthroughBlock.md) - [PatchItemCatalogAction](docs/PatchItemCatalogAction.md) - [PatchManyItemsCatalogAction](docs/PatchManyItemsCatalogAction.md) - [PendingActivePointsData](docs/PendingActivePointsData.md) @@ -937,6 +942,8 @@ Class | Method | HTTP request | Description - [ProfileAudiencesChanges](docs/ProfileAudiencesChanges.md) - [ProjectedTier](docs/ProjectedTier.md) - [PromoteExperiment](docs/PromoteExperiment.md) +- [PromotionGroupBlock](docs/PromotionGroupBlock.md) +- [PromotionRuleV2](docs/PromotionRuleV2.md) - [RedeemReferralEffectProps](docs/RedeemReferralEffectProps.md) - [Referral](docs/Referral.md) - [ReferralConstraints](docs/ReferralConstraints.md) @@ -958,6 +965,9 @@ Class | Method | HTTP request | Description - [RevisionVersion](docs/RevisionVersion.md) - [Reward](docs/Reward.md) - [RewardPointsRequired](docs/RewardPointsRequired.md) +- [Risk](docs/Risk.md) +- [RiskAffectedEntityItem](docs/RiskAffectedEntityItem.md) +- [RiskDetail](docs/RiskDetail.md) - [RiskNotification](docs/RiskNotification.md) - [Role](docs/Role.md) - [RoleAssign](docs/RoleAssign.md) @@ -982,7 +992,9 @@ Class | Method | HTTP request | Description - [RuleFailureReason](docs/RuleFailureReason.md) - [RuleMetadata](docs/RuleMetadata.md) - [RuleMetadataEligibility](docs/RuleMetadataEligibility.md) +- [RuleV2](docs/RuleV2.md) - [Ruleset](docs/Ruleset.md) +- [RulesetV2](docs/RulesetV2.md) - [SSOConfig](docs/SSOConfig.md) - [SamlConnection](docs/SamlConnection.md) - [SamlConnectionInternal](docs/SamlConnectionInternal.md) @@ -1024,7 +1036,9 @@ Class | Method | HTTP request | Description - [StrikethroughCustomEffectPerItemProps](docs/StrikethroughCustomEffectPerItemProps.md) - [StrikethroughDebugResponse](docs/StrikethroughDebugResponse.md) - [StrikethroughEffect](docs/StrikethroughEffect.md) +- [StrikethroughGroupBlock](docs/StrikethroughGroupBlock.md) - [StrikethroughLabelingNotification](docs/StrikethroughLabelingNotification.md) +- [StrikethroughRuleV2](docs/StrikethroughRuleV2.md) - [StrikethroughSetDiscountPerItemEffectProps](docs/StrikethroughSetDiscountPerItemEffectProps.md) - [StrikethroughSetDiscountPerItemMemberEffectProps](docs/StrikethroughSetDiscountPerItemMemberEffectProps.md) - [StrikethroughTrigger](docs/StrikethroughTrigger.md) diff --git a/docs/BaseBlock.md b/docs/BaseBlock.md new file mode 100644 index 0000000..6e9cb39 --- /dev/null +++ b/docs/BaseBlock.md @@ -0,0 +1,32 @@ +# BaseBlock + +Common properties shared by all block types. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier for this block. | +**type** | **str** | Identifies the block variant and determines which additional properties are present in it. | +**tags** | **List[str]** | Semantic labels attached to this block. | [optional] + +## Example + +```python +from talon_one.models.base_block import BaseBlock + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseBlock from a JSON string +base_block_instance = BaseBlock.from_json(json) +# print the JSON string representation of the object +print(BaseBlock.to_json()) + +# convert the object into a dict +base_block_dict = base_block_instance.to_dict() +# create an instance of BaseBlock from a dict +base_block_from_dict = BaseBlock.from_dict(base_block_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/CustomerAchievement.md b/docs/CustomerAchievement.md new file mode 100644 index 0000000..eeceee7 --- /dev/null +++ b/docs/CustomerAchievement.md @@ -0,0 +1,40 @@ +# CustomerAchievement + +A customer's progress in an achievement, together with the achievement definition. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The internal ID of the achievement. | +**name** | **str** | The internal name of the achievement used in API requests. | +**title** | **str** | The display name of the achievement in the Campaign Manager. | +**description** | **str** | The description of the achievement in the Campaign Manager. | +**target** | **float** | The required number of actions or the transactional milestone to complete the achievement. | +**recurrence_policy** | **str** | The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. | +**activation_policy** | **str** | The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. | +**fixed_start_date** | **datetime** | The achievement's start date when `activationPolicy` is equal to `fixed_schedule`. **Note:** It is an RFC3339 timestamp string. | [optional] +**end_date** | **datetime** | The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It is an RFC3339 timestamp string. | [optional] +**allow_rollback_after_completion** | **bool** | When `true`, customer progress can be rolled back in completed achievements. | +**current_progress** | [**AchievementProgress**](AchievementProgress.md) | | [optional] + +## Example + +```python +from talon_one.models.customer_achievement import CustomerAchievement + +# TODO update the JSON string below +json = "{}" +# create an instance of CustomerAchievement from a JSON string +customer_achievement_instance = CustomerAchievement.from_json(json) +# print the JSON string representation of the object +print(CustomerAchievement.to_json()) + +# convert the object into a dict +customer_achievement_dict = customer_achievement_instance.to_dict() +# create an instance of CustomerAchievement from a dict +customer_achievement_from_dict = CustomerAchievement.from_dict(customer_achievement_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/IntegrationApi.md b/docs/IntegrationApi.md index 7795f80..d39bd6a 100644 --- a/docs/IntegrationApi.md +++ b/docs/IntegrationApi.md @@ -29,6 +29,7 @@ Method | HTTP request | Description [**get_loyalty_program_profile_transactions**](IntegrationApi.md#get_loyalty_program_profile_transactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/transactions | List customer's loyalty transactions [**get_reserved_customers**](IntegrationApi.md#get_reserved_customers) | **GET** /v1/coupon_reservations/customerprofiles/{couponValue} | List customers that have this coupon reserved [**integration_get_all_campaigns**](IntegrationApi.md#integration_get_all_campaigns) | **GET** /v1/integration/campaigns | List all running campaigns +[**join_loyalty_program**](IntegrationApi.md#join_loyalty_program) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/join | Join customer profile to loyalty program [**link_loyalty_card_to_profile**](IntegrationApi.md#link_loyalty_card_to_profile) | **POST** /v2/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/link_profile | Link customer profile to card [**reopen_customer_session**](IntegrationApi.md#reopen_customer_session) | **PUT** /v2/customer_sessions/{customerSessionId}/reopen | Reopen customer session [**return_cart_items**](IntegrationApi.md#return_cart_items) | **POST** /v2/customer_sessions/{customerSessionId}/returns | Return cart items @@ -1478,7 +1479,7 @@ configuration.api_key['api_key_v1'] = os.environ["API_KEY"] with talon_one.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = talon_one.IntegrationApi(api_client) - customer_session_id = 'customer_session_id_example' # str | The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. + customer_session_id = 'customer_session_id_example' # str | The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). try: # Get customer session @@ -1496,7 +1497,7 @@ with talon_one.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **customer_session_id** | **str**| The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. | + **customer_session_id** | **str**| The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). | ### Return type @@ -2307,7 +2308,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **integration_get_all_campaigns** -> IntegrationGetAllCampaigns200Response integration_get_all_campaigns(page_size=page_size, skip=skip, campaign_ids=campaign_ids, start_after=start_after, start_before=start_before, end_after=end_after, end_before=end_before) +> IntegrationGetAllCampaigns200Response integration_get_all_campaigns(page_size=page_size, skip=skip, campaign_ids=campaign_ids, start_after=start_after, start_before=start_before, end_after=end_after, end_before=end_before, store_id=store_id, audience_id=audience_id) List all running campaigns @@ -2354,10 +2355,12 @@ with talon_one.ApiClient(configuration) as api_client: start_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results to only include campaigns that start on or before the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) end_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results to only include campaigns that end on or after the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) end_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results to only include campaigns that end on or before the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + store_id = 56 # int | Filter results to campaigns linked to the specified store ID. (optional) + audience_id = 56 # int | Filter results to campaigns linked to the specified audience ID. (optional) try: # List all running campaigns - api_response = api_instance.integration_get_all_campaigns(page_size=page_size, skip=skip, campaign_ids=campaign_ids, start_after=start_after, start_before=start_before, end_after=end_after, end_before=end_before) + api_response = api_instance.integration_get_all_campaigns(page_size=page_size, skip=skip, campaign_ids=campaign_ids, start_after=start_after, start_before=start_before, end_after=end_after, end_before=end_before, store_id=store_id, audience_id=audience_id) print("The response of IntegrationApi->integration_get_all_campaigns:\n") pprint(api_response) except Exception as e: @@ -2378,6 +2381,8 @@ Name | Type | Description | Notes **start_before** | **datetime**| Filter results to only include campaigns that start on or before the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] **end_after** | **datetime**| Filter results to only include campaigns that end on or after the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] **end_before** | **datetime**| Filter results to only include campaigns that end on or before the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] + **store_id** | **int**| Filter results to campaigns linked to the specified store ID. | [optional] + **audience_id** | **int**| Filter results to campaigns linked to the specified audience ID. | [optional] ### Return type @@ -2403,6 +2408,98 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **join_loyalty_program** +> join_loyalty_program(loyalty_program_id, integration_id) + +Join customer profile to loyalty program + +Join a customer profile to the specified loyalty program. + +If the customer profile does not exist, it will be created first using the +provided `integrationId`, then joined to the loyalty program. + +> [!note] This endpoint only works with profile-based loyalty programs. + +**Behavior**: +- If the loyalty program does not exist, the request fails. +- If the customer profile is already joined to the loyalty program, the request fails. +- If the customer profile does not exist, it is created and then joined to the loyalty program. + + +### Example + +* Api Key Authentication (api_key_v1): + +```python +import talon_one +from talon_one.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://yourbaseurl.talon.one +# See configuration.py for a list of all supported configuration parameters. +configuration = talon_one.Configuration( + host = "https://yourbaseurl.talon.one" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: api_key_v1 +configuration.api_key['api_key_v1'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_v1'] = 'Bearer' + +# Enter a context with an instance of the API client +with talon_one.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = talon_one.IntegrationApi(api_client) + loyalty_program_id = 56 # int | Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. + integration_id = 'integration_id_example' # str | 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. + + try: + # Join customer profile to loyalty program + api_instance.join_loyalty_program(loyalty_program_id, integration_id) + except Exception as e: + print("Exception when calling IntegrationApi->join_loyalty_program: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loyalty_program_id** | **int**| Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | + **integration_id** | **str**| 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. | + +### Return type + +void (empty response body) + +### Authorization + +[api_key_v1](../README.md#api_key_v1) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad request | - | +**401** | Unauthorized | - | +**404** | Not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **link_loyalty_card_to_profile** > LoyaltyCard link_loyalty_card_to_profile(loyalty_program_id, loyalty_card_id, loyalty_card_registration) @@ -3687,7 +3784,7 @@ configuration.api_key['api_key_v1'] = os.environ["API_KEY"] with talon_one.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = talon_one.IntegrationApi(api_client) - integration_id = 'integration_id_example' # str | 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. + integration_id = 'integration_id_example' # str | 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. **Note**: It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). customer_profile_integration_request_v2 = {"attributes":{"Name":"Chris Taylor","Email":"chris.taylor@example.com","SignupDate":"2026-01-21T15:04:05+07:00","PaymentMethod":"Bank transfer"}} # CustomerProfileIntegrationRequestV2 | body run_rule_engine = False # bool | Indicates whether to run the Rule Engine. If `true`, the response includes: - The effects generated by the triggered campaigns are returned in the `effects` property. - The created coupons and referral objects. If `false`: - The rules are not executed and the `effects` property is always empty. - The response time improves. - You cannot use `responseContent` in the body. (optional) (default to False) dry = True # bool | (Only works when `runRuleEngine=true`) Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`, you can use the `evaluableCampaignIds` body property to select specific campaigns to run. (optional) @@ -3708,7 +3805,7 @@ with talon_one.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **integration_id** | **str**| 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. | + **integration_id** | **str**| 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. **Note**: It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). | **customer_profile_integration_request_v2** | [**CustomerProfileIntegrationRequestV2**](CustomerProfileIntegrationRequestV2.md)| body | **run_rule_engine** | **bool**| Indicates whether to run the Rule Engine. If `true`, the response includes: - The effects generated by the triggered campaigns are returned in the `effects` property. - The created coupons and referral objects. If `false`: - The rules are not executed and the `effects` property is always empty. - The response time improves. - You cannot use `responseContent` in the body. | [optional] [default to False] **dry** | **bool**| (Only works when `runRuleEngine=true`) Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`, you can use the `evaluableCampaignIds` body property to select specific campaigns to run. | [optional] @@ -3920,7 +4017,7 @@ configuration.api_key['api_key_v1'] = os.environ["API_KEY"] with talon_one.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = talon_one.IntegrationApi(api_client) - customer_session_id = 'customer_session_id_example' # str | The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. + customer_session_id = 'customer_session_id_example' # str | The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). integration_request = {"customerSession":{"profileId":"382370BKDB946","cartItems":[{"name":"Wireless Bluetooth Headphones","sku":"AUDIO-WH350","quantity":1,"price":79.99,"weight":310},{"name":"USB-C Charging Cable","sku":"CABLE-USBC-2M","quantity":2,"price":15.99,"weight":40}]},"responseContent":["customerSession","customerProfile"]} # IntegrationRequest | body dry = True # bool | Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint considers **only** the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). (optional) now = '2013-10-20T19:20:30+01:00' # datetime | A timestamp value of a future date that acts as a current date when included in the query. Use this parameter, for example, to test campaigns that would be evaluated for this customer session in the future (say, [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule)). > [!note] **Note** > - It must be an RFC3339 timestamp string. > - It can **only** be a date in the future. > - It can **only** be used if the `dry` parameter in the query is set to `true`. (optional) @@ -3941,7 +4038,7 @@ with talon_one.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **customer_session_id** | **str**| The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. | + **customer_session_id** | **str**| The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). | **integration_request** | [**IntegrationRequest**](IntegrationRequest.md)| body | **dry** | **bool**| Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint considers **only** the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). | [optional] **now** | **datetime**| A timestamp value of a future date that acts as a current date when included in the query. Use this parameter, for example, to test campaigns that would be evaluated for this customer session in the future (say, [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule)). > [!note] **Note** > - It must be an RFC3339 timestamp string. > - It can **only** be a date in the future. > - It can **only** be used if the `dry` parameter in the query is set to `true`. | [optional] diff --git a/docs/IntegrationCampaign.md b/docs/IntegrationCampaign.md index 763f5f0..be224c8 100644 --- a/docs/IntegrationCampaign.md +++ b/docs/IntegrationCampaign.md @@ -16,6 +16,8 @@ Name | Type | Description | Notes **tags** | **List[str]** | A list of tags for the campaign. | **features** | **List[str]** | The features enabled in this campaign. | **rules** | [**List[RuleMetadata]**](RuleMetadata.md) | A list of rules containing customer-facing details of the rewards defined in the campaign. | +**linked_store_ids** | **List[int]** | A list of store IDs linked to this campaign. | [optional] +**linked_audience_ids** | **List[int]** | A list of audience IDs linked to this campaign. | [optional] ## Example diff --git a/docs/IntegrationEventV2Response.md b/docs/IntegrationEventV2Response.md index ae47f32..8472c3b 100644 --- a/docs/IntegrationEventV2Response.md +++ b/docs/IntegrationEventV2Response.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **created_coupons** | [**List[Coupon]**](Coupon.md) | The coupons that were created during the event processing. | **created_referrals** | [**List[Referral]**](Referral.md) | The referrals that were created during the event processing. | **awarded_giveaways** | [**List[Giveaway]**](Giveaway.md) | The giveaways that were awarded during the event processing. | [optional] +**achievements** | [**List[CustomerAchievement]**](CustomerAchievement.md) | The achievements progress of the customer. | [optional] **event** | [**Event**](Event.md) | The event that was processed. | [optional] ## Example diff --git a/docs/IntegrationEventV3Response.md b/docs/IntegrationEventV3Response.md index e8f0880..7aa3d77 100644 --- a/docs/IntegrationEventV3Response.md +++ b/docs/IntegrationEventV3Response.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **created_coupons** | [**List[Coupon]**](Coupon.md) | The coupons that were created during the event processing. | **created_referrals** | [**List[Referral]**](Referral.md) | The referrals that were created during the event processing. | **awarded_giveaways** | [**List[Giveaway]**](Giveaway.md) | The giveaways that were awarded during the event processing. | [optional] +**achievements** | [**List[CustomerAchievement]**](CustomerAchievement.md) | The achievements progress of the customer. | [optional] **advanced_event** | [**EventV3**](EventV3.md) | The advanced event that was processed. | [optional] ## Example diff --git a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md index 034d2e9..8a23e7f 100644 --- a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md +++ b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **subledger_id** | **str** | | **source_of_event** | **str** | | **current_tier** | **str** | The name of the customer's current tier. | +**session_integration_id** | **str** | The integration ID of the session through which the points were earned or lost. Only set when the change results from a rule engine execution; empty otherwise. | [optional] **employee_name** | **str** | | [optional] **user_id** | **int** | | [optional] **current_points** | **float** | | diff --git a/docs/IntegrationResponse.md b/docs/IntegrationResponse.md index 888dca1..da15a81 100644 --- a/docs/IntegrationResponse.md +++ b/docs/IntegrationResponse.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **created_coupons** | [**List[Coupon]**](Coupon.md) | The coupons that were created during the event processing. | **created_referrals** | [**List[Referral]**](Referral.md) | The referrals that were created during the event processing. | **awarded_giveaways** | [**List[Giveaway]**](Giveaway.md) | The giveaways that were awarded during the event processing. | [optional] +**achievements** | [**List[CustomerAchievement]**](CustomerAchievement.md) | The achievements progress of the customer. | [optional] ## Example diff --git a/docs/IntegrationStateV2.md b/docs/IntegrationStateV2.md index 291b0c0..9164343 100644 --- a/docs/IntegrationStateV2.md +++ b/docs/IntegrationStateV2.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **created_coupons** | [**List[Coupon]**](Coupon.md) | The coupons that were created during the event processing. | **created_referrals** | [**List[Referral]**](Referral.md) | The referrals that were created during the event processing. | **awarded_giveaways** | [**List[Giveaway]**](Giveaway.md) | The giveaways that were awarded during the event processing. | [optional] +**achievements** | [**List[CustomerAchievement]**](CustomerAchievement.md) | The achievements progress of the customer. | [optional] **referral** | [**InventoryReferral**](InventoryReferral.md) | The referral that was processed. | [optional] **coupons** | [**List[IntegrationCoupon]**](IntegrationCoupon.md) | The coupons that were processed. | [optional] **event** | [**Event**](Event.md) | The event that was processed. | [optional] diff --git a/docs/ManagementApi.md b/docs/ManagementApi.md index 2e922c4..68306bf 100644 --- a/docs/ManagementApi.md +++ b/docs/ManagementApi.md @@ -123,6 +123,7 @@ Method | HTTP request | Description [**get_referrals_without_total_count**](ManagementApi.md#get_referrals_without_total_count) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/no_total | List referrals [**get_role_v2**](ManagementApi.md#get_role_v2) | **GET** /v2/roles/{roleId} | Get role [**get_ruleset**](ManagementApi.md#get_ruleset) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId} | Get ruleset +[**get_ruleset_v2**](ManagementApi.md#get_ruleset_v2) | **GET** /v2/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId} | Get ruleset (V2) [**get_rulesets**](ManagementApi.md#get_rulesets) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets | List campaign rulesets [**get_store**](ManagementApi.md#get_store) | **GET** /v1/applications/{applicationId}/stores/{storeId} | Get store [**get_user**](ManagementApi.md#get_user) | **GET** /v1/users/{userId} | Get user @@ -4034,7 +4035,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **export_coupons** -> str export_coupons(application_id, campaign_id=campaign_id, sort=sort, value=value, created_before=created_before, created_after=created_after, valid=valid, usable=usable, referral_id=referral_id, recipient_integration_id=recipient_integration_id, batch_id=batch_id, exact_match=exact_match, date_format=date_format, campaign_state=campaign_state, values_only=values_only) +> str export_coupons(application_id, campaign_id=campaign_id, sort=sort, value=value, created_before=created_before, created_after=created_after, valid=valid, usable=usable, referral_id=referral_id, recipient_integration_id=recipient_integration_id, batch_id=batch_id, exact_match=exact_match, date_format=date_format, campaign_state=campaign_state, values_only=values_only, deleted_before=deleted_before, deleted_after=deleted_after) Export coupons @@ -4117,10 +4118,12 @@ with talon_one.ApiClient(configuration) as api_client: date_format = 'date_format_example' # str | Determines the format of dates in the export document. (optional) campaign_state = 'campaign_state_example' # str | Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) values_only = False # bool | Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional) (default to False) + deleted_before = '2013-10-20T19:20:30+01:00' # datetime | Timestamp that filters the results to only contain coupons deleted before this date. Must be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. **Note:** Only coupons deleted in the last 7 days will appear in the results. (optional) + deleted_after = '2013-10-20T19:20:30+01:00' # datetime | Timestamp that filters the results to only contain coupons deleted after this date. Must be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. **Note:** Only coupons deleted in the last 7 days will appear in the results. (optional) try: # Export coupons - api_response = api_instance.export_coupons(application_id, campaign_id=campaign_id, sort=sort, value=value, created_before=created_before, created_after=created_after, valid=valid, usable=usable, referral_id=referral_id, recipient_integration_id=recipient_integration_id, batch_id=batch_id, exact_match=exact_match, date_format=date_format, campaign_state=campaign_state, values_only=values_only) + api_response = api_instance.export_coupons(application_id, campaign_id=campaign_id, sort=sort, value=value, created_before=created_before, created_after=created_after, valid=valid, usable=usable, referral_id=referral_id, recipient_integration_id=recipient_integration_id, batch_id=batch_id, exact_match=exact_match, date_format=date_format, campaign_state=campaign_state, values_only=values_only, deleted_before=deleted_before, deleted_after=deleted_after) print("The response of ManagementApi->export_coupons:\n") pprint(api_response) except Exception as e: @@ -4149,6 +4152,8 @@ Name | Type | Description | Notes **date_format** | **str**| Determines the format of dates in the export document. | [optional] **campaign_state** | **str**| Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. | [optional] **values_only** | **bool**| Filter results to only return the coupon codes (`value` column) without the associated coupon data. | [optional] [default to False] + **deleted_before** | **datetime**| Timestamp that filters the results to only contain coupons deleted before this date. Must be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. **Note:** Only coupons deleted in the last 7 days will appear in the results. | [optional] + **deleted_after** | **datetime**| Timestamp that filters the results to only contain coupons deleted after this date. Must be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. **Note:** Only coupons deleted in the last 7 days will appear in the results. | [optional] ### Return type @@ -7220,7 +7225,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_attributes** -> GetAttributes200Response get_attributes(page_size=page_size, skip=skip, sort=sort, entity=entity, application_ids=application_ids, type=type, kind=kind, search=search) +> GetAttributes200Response get_attributes(page_size=page_size, skip=skip, sort=sort, entity=entity, application_ids=application_ids, loyalty_program_ids=loyalty_program_ids, type=type, kind=kind, search=search) List custom attributes @@ -7263,13 +7268,14 @@ with talon_one.ApiClient(configuration) as api_client: sort = 'sort_example' # str | The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. (optional) entity = 'entity_example' # str | Returned attributes will be filtered by supplied entity. (optional) application_ids = 'application_ids_example' # str | Returned attributes will be filtered by supplied application ids (optional) + loyalty_program_ids = 'loyalty_program_ids_example' # str | Returned attributes will be filtered by the specified loyalty program ids, separated by commas. You can only use this parameter when `entity` is `LoyaltyCard`. (optional) type = 'type_example' # str | Returned attributes will be filtered by supplied type (optional) kind = 'kind_example' # str | Returned attributes will be filtered by supplied kind (builtin or custom) (optional) search = 'search_example' # str | Returned attributes will be filtered by searching case insensitive through Attribute name, description and type (optional) try: # List custom attributes - api_response = api_instance.get_attributes(page_size=page_size, skip=skip, sort=sort, entity=entity, application_ids=application_ids, type=type, kind=kind, search=search) + api_response = api_instance.get_attributes(page_size=page_size, skip=skip, sort=sort, entity=entity, application_ids=application_ids, loyalty_program_ids=loyalty_program_ids, type=type, kind=kind, search=search) print("The response of ManagementApi->get_attributes:\n") pprint(api_response) except Exception as e: @@ -7288,6 +7294,7 @@ Name | Type | Description | Notes **sort** | **str**| The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. | [optional] **entity** | **str**| Returned attributes will be filtered by supplied entity. | [optional] **application_ids** | **str**| Returned attributes will be filtered by supplied application ids | [optional] + **loyalty_program_ids** | **str**| Returned attributes will be filtered by the specified loyalty program ids, separated by commas. You can only use this parameter when `entity` is `LoyaltyCard`. | [optional] **type** | **str**| Returned attributes will be filtered by supplied type | [optional] **kind** | **str**| Returned attributes will be filtered by supplied kind (builtin or custom) | [optional] **search** | **str**| Returned attributes will be filtered by searching case insensitive through Attribute name, description and type | [optional] @@ -10881,6 +10888,89 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_ruleset_v2** +> RulesetV2 get_ruleset_v2(application_id, campaign_id, ruleset_id) + +Get ruleset (V2) + +Retrieve the specified ruleset as a JSON object. + +### Example + +* Api Key Authentication (api_key_v1): + +```python +import talon_one +from talon_one.models.ruleset_v2 import RulesetV2 +from talon_one.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://yourbaseurl.talon.one +# See configuration.py for a list of all supported configuration parameters. +configuration = talon_one.Configuration( + host = "https://yourbaseurl.talon.one" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: api_key_v1 +configuration.api_key['api_key_v1'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_v1'] = 'Bearer' + +# Enter a context with an instance of the API client +with talon_one.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = talon_one.ManagementApi(api_client) + application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. + campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. + ruleset_id = 56 # int | The ID of the ruleset. + + try: + # Get ruleset (V2) + api_response = api_instance.get_ruleset_v2(application_id, campaign_id, ruleset_id) + print("The response of ManagementApi->get_ruleset_v2:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->get_ruleset_v2: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | + **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | + **ruleset_id** | **int**| The ID of the ruleset. | + +### Return type + +[**RulesetV2**](RulesetV2.md) + +### Authorization + +[api_key_v1](../README.md#api_key_v1) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_rulesets** > GetRulesets200Response get_rulesets(application_id, campaign_id, page_size=page_size, skip=skip, sort=sort) diff --git a/docs/PassthroughBlock.md b/docs/PassthroughBlock.md new file mode 100644 index 0000000..f2685a5 --- /dev/null +++ b/docs/PassthroughBlock.md @@ -0,0 +1,32 @@ +# PassthroughBlock + +A block representing a Talang expression that could not be mapped to a typed block. The expression is preserved in its raw Talang array form for diagnostic and round-trip purposes. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier for this block. | +**type** | **str** | The type discriminator for this block. | +**expression** | **List[object]** | The raw Talang expression as an array. The first element is the function name; subsequent elements are its arguments, which may themselves be nested expressions. | + +## Example + +```python +from talon_one.models.passthrough_block import PassthroughBlock + +# TODO update the JSON string below +json = "{}" +# create an instance of PassthroughBlock from a JSON string +passthrough_block_instance = PassthroughBlock.from_json(json) +# print the JSON string representation of the object +print(PassthroughBlock.to_json()) + +# convert the object into a dict +passthrough_block_dict = passthrough_block_instance.to_dict() +# create an instance of PassthroughBlock from a dict +passthrough_block_from_dict = PassthroughBlock.from_dict(passthrough_block_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/PromotionGroupBlock.md b/docs/PromotionGroupBlock.md new file mode 100644 index 0000000..6845497 --- /dev/null +++ b/docs/PromotionGroupBlock.md @@ -0,0 +1,35 @@ +# PromotionGroupBlock + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier for this block. | +**type** | **str** | Identifies the block variant and determines which additional properties are present in it. | +**tags** | **List[str]** | Semantic labels attached to this block. | [optional] +**operator** | **str** | Logical operator applied across child blocks. `all` requires every child to pass, `atLeastOne` requires at least one, `none` requires all to fail. | +**blocks** | **List[object]** | Child blocks evaluated according to the operator. | +**on_failure** | **List[object]** | Promotion blocks evaluated when this block fails or returns false. | [optional] +**on_error** | **Dict[str, List[object]]** | Named error handlers evaluated when a specific error occurs. | [optional] + +## Example + +```python +from talon_one.models.promotion_group_block import PromotionGroupBlock + +# TODO update the JSON string below +json = "{}" +# create an instance of PromotionGroupBlock from a JSON string +promotion_group_block_instance = PromotionGroupBlock.from_json(json) +# print the JSON string representation of the object +print(PromotionGroupBlock.to_json()) + +# convert the object into a dict +promotion_group_block_dict = promotion_group_block_instance.to_dict() +# create an instance of PromotionGroupBlock from a dict +promotion_group_block_from_dict = PromotionGroupBlock.from_dict(promotion_group_block_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/PromotionRuleV2.md b/docs/PromotionRuleV2.md new file mode 100644 index 0000000..a83abeb --- /dev/null +++ b/docs/PromotionRuleV2.md @@ -0,0 +1,33 @@ +# PromotionRuleV2 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the rule. | [optional] +**parent_id** | **str** | ID of the parent rule, if any. | [optional] +**title** | **str** | A short description of the rule. | +**description** | **str** | A longer description of the rule. | [optional] +**blocks** | **List[object]** | The condition and effect blocks that make up this promotion rule. | + +## Example + +```python +from talon_one.models.promotion_rule_v2 import PromotionRuleV2 + +# TODO update the JSON string below +json = "{}" +# create an instance of PromotionRuleV2 from a JSON string +promotion_rule_v2_instance = PromotionRuleV2.from_json(json) +# print the JSON string representation of the object +print(PromotionRuleV2.to_json()) + +# convert the object into a dict +promotion_rule_v2_dict = promotion_rule_v2_instance.to_dict() +# create an instance of PromotionRuleV2 from a dict +promotion_rule_v2_from_dict = PromotionRuleV2.from_dict(promotion_rule_v2_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/Reward.md b/docs/Reward.md index 97b7f78..2138b60 100644 --- a/docs/Reward.md +++ b/docs/Reward.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **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. | -**visibility_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] +**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] **modified** | **datetime** | The timestamp when the reward was last updated in RFC3339 format. | [optional] diff --git a/docs/Risk.md b/docs/Risk.md new file mode 100644 index 0000000..ac22ee6 --- /dev/null +++ b/docs/Risk.md @@ -0,0 +1,44 @@ +# Risk + +A risk detected by the anomaly detection service for one Application group. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The internal ID of this entity. | +**created** | **datetime** | The time this entity was created. | +**notification_id** | **int** | The ID of the risk notification rule that flagged this risk. | +**run_date** | **date** | The date of the ML pipeline run that detected this risk. | +**group_key** | **str** | The Application group this risk was detected in. Contains the Application ID, or `__GLOBAL__` for metrics that are not grouped by Application. | +**application_id** | **int** | The ID of the Application this risk belongs to. Absent for global metrics. | [optional] +**status** | **str** | The triage lifecycle status of this risk. | +**criticality** | **str** | The critical classification bucket of this risk. | +**entity** | **str** | The entity type the risk was detected in. | +**activity** | **str** | The activity metric the risk was detected in. | +**time_frame** | **str** | The rolling time window of the risk evaluation. | +**reported_date** | **datetime** | The time the ML service reported this risk. | +**affected_entity_count** | **int** | The total number of entities affected by this risk. | +**description** | **str** | Human-readable description of the detected anomaly. | [optional] +**modified** | **datetime** | Timestamp of the most recent update. | + +## Example + +```python +from talon_one.models.risk import Risk + +# TODO update the JSON string below +json = "{}" +# create an instance of Risk from a JSON string +risk_instance = Risk.from_json(json) +# print the JSON string representation of the object +print(Risk.to_json()) + +# convert the object into a dict +risk_dict = risk_instance.to_dict() +# create an instance of Risk from a dict +risk_from_dict = Risk.from_dict(risk_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/RiskAffectedEntityItem.md b/docs/RiskAffectedEntityItem.md new file mode 100644 index 0000000..dfa63fd --- /dev/null +++ b/docs/RiskAffectedEntityItem.md @@ -0,0 +1,34 @@ +# RiskAffectedEntityItem + +A single entity flagged as anomalous within a risk. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entity_id** | **str** | The integration ID of the affected entity. | +**activity_value** | **float** | The observed value of the monitored activity metric for this entity. | +**threshold** | **float** | The anomaly threshold computed for the entity's Application group. | +**severity_ratio** | **float** | The ratio of the observed value to the threshold. | +**criticality** | **str** | The critical classification bucket of this entity. | + +## Example + +```python +from talon_one.models.risk_affected_entity_item import RiskAffectedEntityItem + +# TODO update the JSON string below +json = "{}" +# create an instance of RiskAffectedEntityItem from a JSON string +risk_affected_entity_item_instance = RiskAffectedEntityItem.from_json(json) +# print the JSON string representation of the object +print(RiskAffectedEntityItem.to_json()) + +# convert the object into a dict +risk_affected_entity_item_dict = risk_affected_entity_item_instance.to_dict() +# create an instance of RiskAffectedEntityItem from a dict +risk_affected_entity_item_from_dict = RiskAffectedEntityItem.from_dict(risk_affected_entity_item_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/RiskDetail.md b/docs/RiskDetail.md new file mode 100644 index 0000000..6fdb4a0 --- /dev/null +++ b/docs/RiskDetail.md @@ -0,0 +1,45 @@ +# RiskDetail + +Details of a risk, including its most severely affected entities. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The internal ID of this entity. | +**created** | **datetime** | The time this entity was created. | +**notification_id** | **int** | The ID of the risk notification rule that flagged this risk. | +**run_date** | **date** | The date of the ML pipeline run that detected this risk. | +**group_key** | **str** | The Application group this risk was detected in. Contains the Application ID, or `__GLOBAL__` for metrics that are not grouped by Application. | +**application_id** | **int** | The ID of the Application this risk belongs to. Absent for global metrics. | [optional] +**status** | **str** | The triage lifecycle status of this risk. | +**criticality** | **str** | The critical classification bucket of this risk. | +**entity** | **str** | The entity type the risk was detected in. | +**activity** | **str** | The activity metric the risk was detected in. | +**time_frame** | **str** | The rolling time window of the risk evaluation. | +**reported_date** | **datetime** | The time the ML service reported this risk. | +**affected_entity_count** | **int** | The total number of entities affected by this risk. | +**description** | **str** | Human-readable description of the detected anomaly. | [optional] +**modified** | **datetime** | Timestamp of the most recent update. | +**affected_entities** | [**List[RiskAffectedEntityItem]**](RiskAffectedEntityItem.md) | The affected entities with the highest severity ratios, in descending order. | + +## Example + +```python +from talon_one.models.risk_detail import RiskDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of RiskDetail from a JSON string +risk_detail_instance = RiskDetail.from_json(json) +# print the JSON string representation of the object +print(RiskDetail.to_json()) + +# convert the object into a dict +risk_detail_dict = risk_detail_instance.to_dict() +# create an instance of RiskDetail from a dict +risk_detail_from_dict = RiskDetail.from_dict(risk_detail_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/RuleV2.md b/docs/RuleV2.md new file mode 100644 index 0000000..7f48aae --- /dev/null +++ b/docs/RuleV2.md @@ -0,0 +1,33 @@ +# RuleV2 + +Shared fields common to all V2 rule types. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the rule. | [optional] +**parent_id** | **str** | ID of the parent rule, if any. | [optional] +**title** | **str** | A short description of the rule. | +**description** | **str** | A longer description of the rule. | [optional] + +## Example + +```python +from talon_one.models.rule_v2 import RuleV2 + +# TODO update the JSON string below +json = "{}" +# create an instance of RuleV2 from a JSON string +rule_v2_instance = RuleV2.from_json(json) +# print the JSON string representation of the object +print(RuleV2.to_json()) + +# convert the object into a dict +rule_v2_dict = rule_v2_instance.to_dict() +# create an instance of RuleV2 from a dict +rule_v2_from_dict = RuleV2.from_dict(rule_v2_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/RulesetV2.md b/docs/RulesetV2.md new file mode 100644 index 0000000..f528b90 --- /dev/null +++ b/docs/RulesetV2.md @@ -0,0 +1,40 @@ +# RulesetV2 + +Ruleset in the V2 JSON block format. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Internal ID of this entity. | +**created** | **datetime** | The time this entity was created. | +**user_id** | **int** | The ID of the user that created this ruleset. | +**campaign_id** | **int** | The ID of the campaign that owns this entity. | [optional] +**template_id** | **int** | The ID of the campaign template that owns this entity. | [optional] +**activated_at** | **datetime** | Timestamp indicating when this ruleset was activated. | [optional] +**promotion_rules** | [**List[PromotionRuleV2]**](PromotionRuleV2.md) | Set of promotion rules. | +**strikethrough_rules** | [**List[StrikethroughRuleV2]**](StrikethroughRuleV2.md) | Set of strikethrough rules. | +**selectors** | **List[Dict[str, object]]** | Variable bindings of type selector. | [optional] +**bundles** | **List[Dict[str, object]]** | Variable bindings of type bundle. | [optional] +**parameters** | **List[Dict[str, object]]** | Variable bindings of type template parameter. | [optional] + +## Example + +```python +from talon_one.models.ruleset_v2 import RulesetV2 + +# TODO update the JSON string below +json = "{}" +# create an instance of RulesetV2 from a JSON string +ruleset_v2_instance = RulesetV2.from_json(json) +# print the JSON string representation of the object +print(RulesetV2.to_json()) + +# convert the object into a dict +ruleset_v2_dict = ruleset_v2_instance.to_dict() +# create an instance of RulesetV2 from a dict +ruleset_v2_from_dict = RulesetV2.from_dict(ruleset_v2_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/StrikethroughGroupBlock.md b/docs/StrikethroughGroupBlock.md new file mode 100644 index 0000000..17903d0 --- /dev/null +++ b/docs/StrikethroughGroupBlock.md @@ -0,0 +1,35 @@ +# StrikethroughGroupBlock + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier for this block. | +**type** | **str** | Identifies the block variant and determines which additional properties are present in it. | +**tags** | **List[str]** | Semantic labels attached to this block. | [optional] +**operator** | **str** | Logical operator applied across child blocks. `all` requires every child to pass, `atLeastOne` requires at least one, `none` requires all to fail. | +**blocks** | **List[object]** | Child blocks evaluated according to the operator. | +**on_failure** | **List[object]** | Strikethrough blocks evaluated when this block fails or returns false. | [optional] +**on_error** | **Dict[str, List[object]]** | Named error handlers evaluated when a specific error occurs. | [optional] + +## Example + +```python +from talon_one.models.strikethrough_group_block import StrikethroughGroupBlock + +# TODO update the JSON string below +json = "{}" +# create an instance of StrikethroughGroupBlock from a JSON string +strikethrough_group_block_instance = StrikethroughGroupBlock.from_json(json) +# print the JSON string representation of the object +print(StrikethroughGroupBlock.to_json()) + +# convert the object into a dict +strikethrough_group_block_dict = strikethrough_group_block_instance.to_dict() +# create an instance of StrikethroughGroupBlock from a dict +strikethrough_group_block_from_dict = StrikethroughGroupBlock.from_dict(strikethrough_group_block_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/StrikethroughRuleV2.md b/docs/StrikethroughRuleV2.md new file mode 100644 index 0000000..41f4c43 --- /dev/null +++ b/docs/StrikethroughRuleV2.md @@ -0,0 +1,33 @@ +# StrikethroughRuleV2 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the rule. | [optional] +**parent_id** | **str** | ID of the parent rule, if any. | [optional] +**title** | **str** | A short description of the rule. | +**description** | **str** | A longer description of the rule. | [optional] +**blocks** | **List[object]** | The condition and effect blocks that make up this strikethrough rule. | + +## Example + +```python +from talon_one.models.strikethrough_rule_v2 import StrikethroughRuleV2 + +# TODO update the JSON string below +json = "{}" +# create an instance of StrikethroughRuleV2 from a JSON string +strikethrough_rule_v2_instance = StrikethroughRuleV2.from_json(json) +# print the JSON string representation of the object +print(StrikethroughRuleV2.to_json()) + +# convert the object into a dict +strikethrough_rule_v2_dict = strikethrough_rule_v2_instance.to_dict() +# create an instance of StrikethroughRuleV2 from a dict +strikethrough_rule_v2_from_dict = StrikethroughRuleV2.from_dict(strikethrough_rule_v2_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/UpdateReward.md b/docs/UpdateReward.md index d0dbc10..ebd9e0c 100644 --- a/docs/UpdateReward.md +++ b/docs/UpdateReward.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **name** | **str** | The name of the reward. | **description** | **str** | A description of the reward. | [optional] **status** | **str** | The status of the reward. | -**visibility_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] +**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:** - Objects with an `id` are updated. - Objects without an `id` are created. - Existing objects omitted from the payload are deleted. | [optional] diff --git a/pyproject.toml b/pyproject.toml index 7915ef2..deee887 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "talon_one" -version = "26.12.0" +version = "26.13.0" description = "Talon.One API" authors = [ {name = "OpenAPI Generator Community",email = "team@openapitools.org"}, diff --git a/setup.py b/setup.py index 81eacdc..e72bfd2 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "talon_one" -VERSION = "26.12.0" +VERSION = "26.13.0" PYTHON_REQUIRES = ">= 3.10" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", diff --git a/talon_one/__init__.py b/talon_one/__init__.py index a9a15f9..6e153ab 100644 --- a/talon_one/__init__.py +++ b/talon_one/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "26.12.0" +__version__ = "26.13.0" # Define package exports __all__ = [ @@ -108,6 +108,7 @@ "AudienceMembership", "AudienceReference", "AwardGiveawayEffectProps", + "BaseBlock", "BaseCampaign", "BaseLoyaltyProgram", "BaseNotification", @@ -225,6 +226,7 @@ "CreateTemplateCampaignResponse", "CustomEffect", "CustomEffectProps", + "CustomerAchievement", "CustomerActivityReport", "CustomerAnalytics", "CustomerInventory", @@ -563,6 +565,7 @@ "OutgoingIntegrationTemplates", "OutgoingIntegrationType", "OutgoingIntegrationTypes", + "PassthroughBlock", "PatchItemCatalogAction", "PatchManyItemsCatalogAction", "PendingActivePointsData", @@ -584,6 +587,8 @@ "ProfileAudiencesChanges", "ProjectedTier", "PromoteExperiment", + "PromotionGroupBlock", + "PromotionRuleV2", "RedeemReferralEffectProps", "Referral", "ReferralConstraints", @@ -605,6 +610,9 @@ "RevisionVersion", "Reward", "RewardPointsRequired", + "Risk", + "RiskAffectedEntityItem", + "RiskDetail", "RiskNotification", "Role", "RoleAssign", @@ -629,7 +637,9 @@ "RuleFailureReason", "RuleMetadata", "RuleMetadataEligibility", + "RuleV2", "Ruleset", + "RulesetV2", "SSOConfig", "SamlConnection", "SamlConnectionInternal", @@ -671,7 +681,9 @@ "StrikethroughCustomEffectPerItemProps", "StrikethroughDebugResponse", "StrikethroughEffect", + "StrikethroughGroupBlock", "StrikethroughLabelingNotification", + "StrikethroughRuleV2", "StrikethroughSetDiscountPerItemEffectProps", "StrikethroughSetDiscountPerItemMemberEffectProps", "StrikethroughTrigger", @@ -845,6 +857,7 @@ from talon_one.models.audience_membership import AudienceMembership as AudienceMembership from talon_one.models.audience_reference import AudienceReference as AudienceReference from talon_one.models.award_giveaway_effect_props import AwardGiveawayEffectProps as AwardGiveawayEffectProps +from talon_one.models.base_block import BaseBlock as BaseBlock from talon_one.models.base_campaign import BaseCampaign as BaseCampaign from talon_one.models.base_loyalty_program import BaseLoyaltyProgram as BaseLoyaltyProgram from talon_one.models.base_notification import BaseNotification as BaseNotification @@ -962,6 +975,7 @@ from talon_one.models.create_template_campaign_response import CreateTemplateCampaignResponse as CreateTemplateCampaignResponse from talon_one.models.custom_effect import CustomEffect as CustomEffect from talon_one.models.custom_effect_props import CustomEffectProps as CustomEffectProps +from talon_one.models.customer_achievement import CustomerAchievement as CustomerAchievement from talon_one.models.customer_activity_report import CustomerActivityReport as CustomerActivityReport from talon_one.models.customer_analytics import CustomerAnalytics as CustomerAnalytics from talon_one.models.customer_inventory import CustomerInventory as CustomerInventory @@ -1300,6 +1314,7 @@ from talon_one.models.outgoing_integration_templates import OutgoingIntegrationTemplates as OutgoingIntegrationTemplates from talon_one.models.outgoing_integration_type import OutgoingIntegrationType as OutgoingIntegrationType from talon_one.models.outgoing_integration_types import OutgoingIntegrationTypes as OutgoingIntegrationTypes +from talon_one.models.passthrough_block import PassthroughBlock as PassthroughBlock from talon_one.models.patch_item_catalog_action import PatchItemCatalogAction as PatchItemCatalogAction from talon_one.models.patch_many_items_catalog_action import PatchManyItemsCatalogAction as PatchManyItemsCatalogAction from talon_one.models.pending_active_points_data import PendingActivePointsData as PendingActivePointsData @@ -1321,6 +1336,8 @@ from talon_one.models.profile_audiences_changes import ProfileAudiencesChanges as ProfileAudiencesChanges from talon_one.models.projected_tier import ProjectedTier as ProjectedTier from talon_one.models.promote_experiment import PromoteExperiment as PromoteExperiment +from talon_one.models.promotion_group_block import PromotionGroupBlock as PromotionGroupBlock +from talon_one.models.promotion_rule_v2 import PromotionRuleV2 as PromotionRuleV2 from talon_one.models.redeem_referral_effect_props import RedeemReferralEffectProps as RedeemReferralEffectProps from talon_one.models.referral import Referral as Referral from talon_one.models.referral_constraints import ReferralConstraints as ReferralConstraints @@ -1342,6 +1359,9 @@ from talon_one.models.revision_version import RevisionVersion as RevisionVersion from talon_one.models.reward import Reward as Reward from talon_one.models.reward_points_required import RewardPointsRequired as RewardPointsRequired +from talon_one.models.risk import Risk as Risk +from talon_one.models.risk_affected_entity_item import RiskAffectedEntityItem as RiskAffectedEntityItem +from talon_one.models.risk_detail import RiskDetail as RiskDetail from talon_one.models.risk_notification import RiskNotification as RiskNotification from talon_one.models.role import Role as Role from talon_one.models.role_assign import RoleAssign as RoleAssign @@ -1366,7 +1386,9 @@ from talon_one.models.rule_failure_reason import RuleFailureReason as RuleFailureReason from talon_one.models.rule_metadata import RuleMetadata as RuleMetadata from talon_one.models.rule_metadata_eligibility import RuleMetadataEligibility as RuleMetadataEligibility +from talon_one.models.rule_v2 import RuleV2 as RuleV2 from talon_one.models.ruleset import Ruleset as Ruleset +from talon_one.models.ruleset_v2 import RulesetV2 as RulesetV2 from talon_one.models.sso_config import SSOConfig as SSOConfig from talon_one.models.saml_connection import SamlConnection as SamlConnection from talon_one.models.saml_connection_internal import SamlConnectionInternal as SamlConnectionInternal @@ -1408,7 +1430,9 @@ from talon_one.models.strikethrough_custom_effect_per_item_props import StrikethroughCustomEffectPerItemProps as StrikethroughCustomEffectPerItemProps from talon_one.models.strikethrough_debug_response import StrikethroughDebugResponse as StrikethroughDebugResponse from talon_one.models.strikethrough_effect import StrikethroughEffect as StrikethroughEffect +from talon_one.models.strikethrough_group_block import StrikethroughGroupBlock as StrikethroughGroupBlock from talon_one.models.strikethrough_labeling_notification import StrikethroughLabelingNotification as StrikethroughLabelingNotification +from talon_one.models.strikethrough_rule_v2 import StrikethroughRuleV2 as StrikethroughRuleV2 from talon_one.models.strikethrough_set_discount_per_item_effect_props import StrikethroughSetDiscountPerItemEffectProps as StrikethroughSetDiscountPerItemEffectProps from talon_one.models.strikethrough_set_discount_per_item_member_effect_props import StrikethroughSetDiscountPerItemMemberEffectProps as StrikethroughSetDiscountPerItemMemberEffectProps from talon_one.models.strikethrough_trigger import StrikethroughTrigger as StrikethroughTrigger diff --git a/talon_one/api/integration_api.py b/talon_one/api/integration_api.py index fc0054e..45ff4b4 100644 --- a/talon_one/api/integration_api.py +++ b/talon_one/api/integration_api.py @@ -4663,7 +4663,7 @@ def _get_customer_inventory_serialize( @validate_call def get_customer_session( self, - customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. ")], + customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4681,7 +4681,7 @@ def get_customer_session( Get the details of the given customer session. You can get the same data via other endpoints that also apply changes, which can help you save requests and increase performance. See: - [Update customer session](#tag/Customer-sessions/operation/updateCustomerSessionV2) - [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) - :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) + :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). (required) :type customer_session_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -4732,7 +4732,7 @@ def get_customer_session( @validate_call def get_customer_session_with_http_info( self, - customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. ")], + customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4750,7 +4750,7 @@ def get_customer_session_with_http_info( Get the details of the given customer session. You can get the same data via other endpoints that also apply changes, which can help you save requests and increase performance. See: - [Update customer session](#tag/Customer-sessions/operation/updateCustomerSessionV2) - [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) - :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) + :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). (required) :type customer_session_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -4801,7 +4801,7 @@ def get_customer_session_with_http_info( @validate_call def get_customer_session_without_preload_content( self, - customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. ")], + customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4819,7 +4819,7 @@ def get_customer_session_without_preload_content( Get the details of the given customer session. You can get the same data via other endpoints that also apply changes, which can help you save requests and increase performance. See: - [Update customer session](#tag/Customer-sessions/operation/updateCustomerSessionV2) - [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) - :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) + :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). (required) :type customer_session_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -7893,6 +7893,8 @@ def integration_get_all_campaigns( start_before: Annotated[Optional[datetime], Field(description="Filter results to only include campaigns that start on or before the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, end_after: Annotated[Optional[datetime], Field(description="Filter results to only include campaigns that end on or after the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, end_before: Annotated[Optional[datetime], Field(description="Filter results to only include campaigns that end on or before the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + store_id: Annotated[Optional[StrictInt], Field(description="Filter results to campaigns linked to the specified store ID.")] = None, + audience_id: Annotated[Optional[StrictInt], Field(description="Filter results to campaigns linked to the specified audience ID.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7924,6 +7926,10 @@ def integration_get_all_campaigns( :type end_after: datetime :param end_before: Filter results to only include campaigns that end on or before the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. :type end_before: datetime + :param store_id: Filter results to campaigns linked to the specified store ID. + :type store_id: int + :param audience_id: Filter results to campaigns linked to the specified audience ID. + :type audience_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7954,6 +7960,8 @@ def integration_get_all_campaigns( start_before=start_before, end_after=end_after, end_before=end_before, + store_id=store_id, + audience_id=audience_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7987,6 +7995,8 @@ def integration_get_all_campaigns_with_http_info( start_before: Annotated[Optional[datetime], Field(description="Filter results to only include campaigns that start on or before the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, end_after: Annotated[Optional[datetime], Field(description="Filter results to only include campaigns that end on or after the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, end_before: Annotated[Optional[datetime], Field(description="Filter results to only include campaigns that end on or before the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + store_id: Annotated[Optional[StrictInt], Field(description="Filter results to campaigns linked to the specified store ID.")] = None, + audience_id: Annotated[Optional[StrictInt], Field(description="Filter results to campaigns linked to the specified audience ID.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8018,6 +8028,10 @@ def integration_get_all_campaigns_with_http_info( :type end_after: datetime :param end_before: Filter results to only include campaigns that end on or before the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. :type end_before: datetime + :param store_id: Filter results to campaigns linked to the specified store ID. + :type store_id: int + :param audience_id: Filter results to campaigns linked to the specified audience ID. + :type audience_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8048,6 +8062,8 @@ def integration_get_all_campaigns_with_http_info( start_before=start_before, end_after=end_after, end_before=end_before, + store_id=store_id, + audience_id=audience_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8081,6 +8097,8 @@ def integration_get_all_campaigns_without_preload_content( start_before: Annotated[Optional[datetime], Field(description="Filter results to only include campaigns that start on or before the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, end_after: Annotated[Optional[datetime], Field(description="Filter results to only include campaigns that end on or after the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, end_before: Annotated[Optional[datetime], Field(description="Filter results to only include campaigns that end on or before the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + store_id: Annotated[Optional[StrictInt], Field(description="Filter results to campaigns linked to the specified store ID.")] = None, + audience_id: Annotated[Optional[StrictInt], Field(description="Filter results to campaigns linked to the specified audience ID.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8112,6 +8130,10 @@ def integration_get_all_campaigns_without_preload_content( :type end_after: datetime :param end_before: Filter results to only include campaigns that end on or before the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. :type end_before: datetime + :param store_id: Filter results to campaigns linked to the specified store ID. + :type store_id: int + :param audience_id: Filter results to campaigns linked to the specified audience ID. + :type audience_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8142,6 +8164,8 @@ def integration_get_all_campaigns_without_preload_content( start_before=start_before, end_after=end_after, end_before=end_before, + store_id=store_id, + audience_id=audience_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8170,6 +8194,8 @@ def _integration_get_all_campaigns_serialize( start_before, end_after, end_before, + store_id, + audience_id, _request_auth, _content_type, _headers, @@ -8257,6 +8283,14 @@ def _integration_get_all_campaigns_serialize( else: _query_params.append(('endBefore', end_before)) + if store_id is not None: + + _query_params.append(('storeId', store_id)) + + if audience_id is not None: + + _query_params.append(('audienceId', audience_id)) + # process the header parameters # process the form parameters # process the body parameter @@ -8294,6 +8328,291 @@ def _integration_get_all_campaigns_serialize( + @validate_call + def join_loyalty_program( + self, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + integration_id: Annotated[StrictStr, Field(description="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. ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Join customer profile to loyalty program + + Join a customer profile to the specified loyalty program. If the customer profile does not exist, it will be created first using the provided `integrationId`, then joined to the loyalty program. > [!note] This endpoint only works with profile-based loyalty programs. **Behavior**: - If the loyalty program does not exist, the request fails. - If the customer profile is already joined to the loyalty program, the request fails. - If the customer profile does not exist, it is created and then joined to the loyalty program. + + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :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 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._join_loyalty_program_serialize( + loyalty_program_id=loyalty_program_id, + integration_id=integration_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def join_loyalty_program_with_http_info( + self, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + integration_id: Annotated[StrictStr, Field(description="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. ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Join customer profile to loyalty program + + Join a customer profile to the specified loyalty program. If the customer profile does not exist, it will be created first using the provided `integrationId`, then joined to the loyalty program. > [!note] This endpoint only works with profile-based loyalty programs. **Behavior**: - If the loyalty program does not exist, the request fails. - If the customer profile is already joined to the loyalty program, the request fails. - If the customer profile does not exist, it is created and then joined to the loyalty program. + + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :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 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._join_loyalty_program_serialize( + loyalty_program_id=loyalty_program_id, + integration_id=integration_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def join_loyalty_program_without_preload_content( + self, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + integration_id: Annotated[StrictStr, Field(description="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. ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Join customer profile to loyalty program + + Join a customer profile to the specified loyalty program. If the customer profile does not exist, it will be created first using the provided `integrationId`, then joined to the loyalty program. > [!note] This endpoint only works with profile-based loyalty programs. **Behavior**: - If the loyalty program does not exist, the request fails. - If the customer profile is already joined to the loyalty program, the request fails. - If the customer profile does not exist, it is created and then joined to the loyalty program. + + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :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 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._join_loyalty_program_serialize( + loyalty_program_id=loyalty_program_id, + integration_id=integration_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _join_loyalty_program_serialize( + self, + loyalty_program_id, + integration_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if loyalty_program_id is not None: + _path_params['loyaltyProgramId'] = loyalty_program_id + if integration_id is not None: + _path_params['integrationId'] = integration_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key_v1' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/join', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def link_loyalty_card_to_profile( self, @@ -11361,7 +11680,7 @@ def _update_customer_profile_audiences_serialize( @validate_call def update_customer_profile_v2( self, - integration_id: Annotated[StrictStr, Field(description="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. ")], + integration_id: Annotated[StrictStr, Field(description="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. **Note**: It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). ")], customer_profile_integration_request_v2: Annotated[CustomerProfileIntegrationRequestV2, Field(description="body")], run_rule_engine: Annotated[Optional[StrictBool], Field(description="Indicates whether to run the Rule Engine. If `true`, the response includes: - The effects generated by the triggered campaigns are returned in the `effects` property. - The created coupons and referral objects. If `false`: - The rules are not executed and the `effects` property is always empty. - The response time improves. - You cannot use `responseContent` in the body. ")] = None, dry: Annotated[Optional[StrictBool], Field(description="(Only works when `runRuleEngine=true`) Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`, you can use the `evaluableCampaignIds` body property to select specific campaigns to run. ")] = None, @@ -11382,7 +11701,7 @@ def update_customer_profile_v2( Update or create a [Customer Profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles). This endpoint triggers the Rule Builder. You can use this endpoint to: - Set attributes on the given customer profile. Ensure you create the attributes in the Campaign Manager, first. - Modify the audience the customer profile is a member of. > [!note] **Note** > - Updating a customer profile returns a response with the requested integration state. > - You can use the `responseContent` property to save yourself extra API calls. For example, you can get > the customer profile details directly without extra requests. > - We recommend sending requests sequentially. > See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation when `runRuleEngine` is `true`. - :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) + :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. **Note**: It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). (required) :type integration_id: str :param customer_profile_integration_request_v2: body (required) :type customer_profile_integration_request_v2: CustomerProfileIntegrationRequestV2 @@ -11443,7 +11762,7 @@ def update_customer_profile_v2( @validate_call def update_customer_profile_v2_with_http_info( self, - integration_id: Annotated[StrictStr, Field(description="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. ")], + integration_id: Annotated[StrictStr, Field(description="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. **Note**: It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). ")], customer_profile_integration_request_v2: Annotated[CustomerProfileIntegrationRequestV2, Field(description="body")], run_rule_engine: Annotated[Optional[StrictBool], Field(description="Indicates whether to run the Rule Engine. If `true`, the response includes: - The effects generated by the triggered campaigns are returned in the `effects` property. - The created coupons and referral objects. If `false`: - The rules are not executed and the `effects` property is always empty. - The response time improves. - You cannot use `responseContent` in the body. ")] = None, dry: Annotated[Optional[StrictBool], Field(description="(Only works when `runRuleEngine=true`) Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`, you can use the `evaluableCampaignIds` body property to select specific campaigns to run. ")] = None, @@ -11464,7 +11783,7 @@ def update_customer_profile_v2_with_http_info( Update or create a [Customer Profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles). This endpoint triggers the Rule Builder. You can use this endpoint to: - Set attributes on the given customer profile. Ensure you create the attributes in the Campaign Manager, first. - Modify the audience the customer profile is a member of. > [!note] **Note** > - Updating a customer profile returns a response with the requested integration state. > - You can use the `responseContent` property to save yourself extra API calls. For example, you can get > the customer profile details directly without extra requests. > - We recommend sending requests sequentially. > See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation when `runRuleEngine` is `true`. - :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) + :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. **Note**: It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). (required) :type integration_id: str :param customer_profile_integration_request_v2: body (required) :type customer_profile_integration_request_v2: CustomerProfileIntegrationRequestV2 @@ -11525,7 +11844,7 @@ def update_customer_profile_v2_with_http_info( @validate_call def update_customer_profile_v2_without_preload_content( self, - integration_id: Annotated[StrictStr, Field(description="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. ")], + integration_id: Annotated[StrictStr, Field(description="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. **Note**: It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). ")], customer_profile_integration_request_v2: Annotated[CustomerProfileIntegrationRequestV2, Field(description="body")], run_rule_engine: Annotated[Optional[StrictBool], Field(description="Indicates whether to run the Rule Engine. If `true`, the response includes: - The effects generated by the triggered campaigns are returned in the `effects` property. - The created coupons and referral objects. If `false`: - The rules are not executed and the `effects` property is always empty. - The response time improves. - You cannot use `responseContent` in the body. ")] = None, dry: Annotated[Optional[StrictBool], Field(description="(Only works when `runRuleEngine=true`) Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`, you can use the `evaluableCampaignIds` body property to select specific campaigns to run. ")] = None, @@ -11546,7 +11865,7 @@ def update_customer_profile_v2_without_preload_content( Update or create a [Customer Profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles). This endpoint triggers the Rule Builder. You can use this endpoint to: - Set attributes on the given customer profile. Ensure you create the attributes in the Campaign Manager, first. - Modify the audience the customer profile is a member of. > [!note] **Note** > - Updating a customer profile returns a response with the requested integration state. > - You can use the `responseContent` property to save yourself extra API calls. For example, you can get > the customer profile details directly without extra requests. > - We recommend sending requests sequentially. > See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation when `runRuleEngine` is `true`. - :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) + :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. **Note**: It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). (required) :type integration_id: str :param customer_profile_integration_request_v2: body (required) :type customer_profile_integration_request_v2: CustomerProfileIntegrationRequestV2 @@ -11993,7 +12312,7 @@ def _update_customer_profiles_v2_serialize( @validate_call def update_customer_session_v2( self, - customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. ")], + customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). ")], integration_request: Annotated[IntegrationRequest, Field(description="body")], dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint considers **only** the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). ")] = None, now: Annotated[Optional[datetime], Field(description="A timestamp value of a future date that acts as a current date when included in the query. Use this parameter, for example, to test campaigns that would be evaluated for this customer session in the future (say, [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule)). > [!note] **Note** > - It must be an RFC3339 timestamp string. > - It can **only** be a date in the future. > - It can **only** be used if the `dry` parameter in the query is set to `true`. ")] = None, @@ -12014,7 +12333,7 @@ def update_customer_session_v2( Update or create a [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). The endpoint responds with the potential promotion rule [effects](https://docs.talon.one/docs/dev/integration-api/api-effects) that match the current cart. For example, use this endpoint to share the contents of a customer's cart with Talon.One. > [!note] **Note** > - The currency for the session and the cart items in it is the currency set for the Application linked to this session. > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered for rule evaluation. ### Session management To use this endpoint, start by learning about [customer sessions](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions) and their states and refer to the `state` parameter documentation the request body schema docs below. ### Sessions and customer profiles - To link a session to a customer profile, set the `profileId` parameter in the request body to a customer profile's `integrationId`. - While you can create an anonymous session with `profileId=\"\"`, we recommend you use a guest ID instead. - A profile can be linked to simultaneous sessions in different Applications. Either: - Use unique session integration IDs or, - Use the same session integration ID across all of the Applications. > [!note] **Note** > - If the specified profile does not exist, an empty profile is **created automatically**. > You can update it with [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2). > - Updating a customer session returns a response with the new integration state. Use the `responseContent` property to save yourself extra API calls. > For example, you can get the customer profile details directly without extra requests. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). For more information, see: - The introductory video in [Getting started](https://docs.talon.one/docs/dev/getting-started/overview). - The [integration tutorial](https://docs.talon.one/docs/dev/tutorials/integrating-talon-one). - :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) + :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). (required) :type customer_session_id: str :param integration_request: body (required) :type integration_request: IntegrationRequest @@ -12075,7 +12394,7 @@ def update_customer_session_v2( @validate_call def update_customer_session_v2_with_http_info( self, - customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. ")], + customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). ")], integration_request: Annotated[IntegrationRequest, Field(description="body")], dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint considers **only** the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). ")] = None, now: Annotated[Optional[datetime], Field(description="A timestamp value of a future date that acts as a current date when included in the query. Use this parameter, for example, to test campaigns that would be evaluated for this customer session in the future (say, [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule)). > [!note] **Note** > - It must be an RFC3339 timestamp string. > - It can **only** be a date in the future. > - It can **only** be used if the `dry` parameter in the query is set to `true`. ")] = None, @@ -12096,7 +12415,7 @@ def update_customer_session_v2_with_http_info( Update or create a [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). The endpoint responds with the potential promotion rule [effects](https://docs.talon.one/docs/dev/integration-api/api-effects) that match the current cart. For example, use this endpoint to share the contents of a customer's cart with Talon.One. > [!note] **Note** > - The currency for the session and the cart items in it is the currency set for the Application linked to this session. > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered for rule evaluation. ### Session management To use this endpoint, start by learning about [customer sessions](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions) and their states and refer to the `state` parameter documentation the request body schema docs below. ### Sessions and customer profiles - To link a session to a customer profile, set the `profileId` parameter in the request body to a customer profile's `integrationId`. - While you can create an anonymous session with `profileId=\"\"`, we recommend you use a guest ID instead. - A profile can be linked to simultaneous sessions in different Applications. Either: - Use unique session integration IDs or, - Use the same session integration ID across all of the Applications. > [!note] **Note** > - If the specified profile does not exist, an empty profile is **created automatically**. > You can update it with [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2). > - Updating a customer session returns a response with the new integration state. Use the `responseContent` property to save yourself extra API calls. > For example, you can get the customer profile details directly without extra requests. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). For more information, see: - The introductory video in [Getting started](https://docs.talon.one/docs/dev/getting-started/overview). - The [integration tutorial](https://docs.talon.one/docs/dev/tutorials/integrating-talon-one). - :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) + :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). (required) :type customer_session_id: str :param integration_request: body (required) :type integration_request: IntegrationRequest @@ -12157,7 +12476,7 @@ def update_customer_session_v2_with_http_info( @validate_call def update_customer_session_v2_without_preload_content( self, - customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. ")], + customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). ")], integration_request: Annotated[IntegrationRequest, Field(description="body")], dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint considers **only** the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). ")] = None, now: Annotated[Optional[datetime], Field(description="A timestamp value of a future date that acts as a current date when included in the query. Use this parameter, for example, to test campaigns that would be evaluated for this customer session in the future (say, [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule)). > [!note] **Note** > - It must be an RFC3339 timestamp string. > - It can **only** be a date in the future. > - It can **only** be used if the `dry` parameter in the query is set to `true`. ")] = None, @@ -12178,7 +12497,7 @@ def update_customer_session_v2_without_preload_content( Update or create a [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). The endpoint responds with the potential promotion rule [effects](https://docs.talon.one/docs/dev/integration-api/api-effects) that match the current cart. For example, use this endpoint to share the contents of a customer's cart with Talon.One. > [!note] **Note** > - The currency for the session and the cart items in it is the currency set for the Application linked to this session. > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered for rule evaluation. ### Session management To use this endpoint, start by learning about [customer sessions](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions) and their states and refer to the `state` parameter documentation the request body schema docs below. ### Sessions and customer profiles - To link a session to a customer profile, set the `profileId` parameter in the request body to a customer profile's `integrationId`. - While you can create an anonymous session with `profileId=\"\"`, we recommend you use a guest ID instead. - A profile can be linked to simultaneous sessions in different Applications. Either: - Use unique session integration IDs or, - Use the same session integration ID across all of the Applications. > [!note] **Note** > - If the specified profile does not exist, an empty profile is **created automatically**. > You can update it with [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2). > - Updating a customer session returns a response with the new integration state. Use the `responseContent` property to save yourself extra API calls. > For example, you can get the customer profile details directly without extra requests. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). For more information, see: - The introductory video in [Getting started](https://docs.talon.one/docs/dev/getting-started/overview). - The [integration tutorial](https://docs.talon.one/docs/dev/tutorials/integrating-talon-one). - :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) + :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). (required) :type customer_session_id: str :param integration_request: body (required) :type integration_request: IntegrationRequest diff --git a/talon_one/api/management_api.py b/talon_one/api/management_api.py index 49d865b..980231a 100644 --- a/talon_one/api/management_api.py +++ b/talon_one/api/management_api.py @@ -127,6 +127,7 @@ from talon_one.models.role_v2 import RoleV2 from talon_one.models.role_v2_base import RoleV2Base from talon_one.models.ruleset import Ruleset +from talon_one.models.ruleset_v2 import RulesetV2 from talon_one.models.scim_base_group import ScimBaseGroup from talon_one.models.scim_group import ScimGroup from talon_one.models.scim_groups_list_response import ScimGroupsListResponse @@ -13483,6 +13484,8 @@ def export_coupons( date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = None, campaign_state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. ")] = None, values_only: Annotated[Optional[StrictBool], Field(description="Filter results to only return the coupon codes (`value` column) without the associated coupon data.")] = None, + deleted_before: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain coupons deleted before this date. Must be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. **Note:** Only coupons deleted in the last 7 days will appear in the results.")] = None, + deleted_after: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain coupons deleted after this date. Must be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. **Note:** Only coupons deleted in the last 7 days will appear in the results.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13530,6 +13533,10 @@ def export_coupons( :type campaign_state: str :param values_only: Filter results to only return the coupon codes (`value` column) without the associated coupon data. :type values_only: bool + :param deleted_before: Timestamp that filters the results to only contain coupons deleted before this date. Must be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. **Note:** Only coupons deleted in the last 7 days will appear in the results. + :type deleted_before: datetime + :param deleted_after: Timestamp that filters the results to only contain coupons deleted after this date. Must be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. **Note:** Only coupons deleted in the last 7 days will appear in the results. + :type deleted_after: datetime :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -13568,6 +13575,8 @@ def export_coupons( date_format=date_format, campaign_state=campaign_state, values_only=values_only, + deleted_before=deleted_before, + deleted_after=deleted_after, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13606,6 +13615,8 @@ def export_coupons_with_http_info( date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = None, campaign_state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. ")] = None, values_only: Annotated[Optional[StrictBool], Field(description="Filter results to only return the coupon codes (`value` column) without the associated coupon data.")] = None, + deleted_before: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain coupons deleted before this date. Must be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. **Note:** Only coupons deleted in the last 7 days will appear in the results.")] = None, + deleted_after: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain coupons deleted after this date. Must be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. **Note:** Only coupons deleted in the last 7 days will appear in the results.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13653,6 +13664,10 @@ def export_coupons_with_http_info( :type campaign_state: str :param values_only: Filter results to only return the coupon codes (`value` column) without the associated coupon data. :type values_only: bool + :param deleted_before: Timestamp that filters the results to only contain coupons deleted before this date. Must be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. **Note:** Only coupons deleted in the last 7 days will appear in the results. + :type deleted_before: datetime + :param deleted_after: Timestamp that filters the results to only contain coupons deleted after this date. Must be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. **Note:** Only coupons deleted in the last 7 days will appear in the results. + :type deleted_after: datetime :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -13691,6 +13706,8 @@ def export_coupons_with_http_info( date_format=date_format, campaign_state=campaign_state, values_only=values_only, + deleted_before=deleted_before, + deleted_after=deleted_after, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13729,6 +13746,8 @@ def export_coupons_without_preload_content( date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = None, campaign_state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. ")] = None, values_only: Annotated[Optional[StrictBool], Field(description="Filter results to only return the coupon codes (`value` column) without the associated coupon data.")] = None, + deleted_before: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain coupons deleted before this date. Must be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. **Note:** Only coupons deleted in the last 7 days will appear in the results.")] = None, + deleted_after: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain coupons deleted after this date. Must be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. **Note:** Only coupons deleted in the last 7 days will appear in the results.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13776,6 +13795,10 @@ def export_coupons_without_preload_content( :type campaign_state: str :param values_only: Filter results to only return the coupon codes (`value` column) without the associated coupon data. :type values_only: bool + :param deleted_before: Timestamp that filters the results to only contain coupons deleted before this date. Must be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. **Note:** Only coupons deleted in the last 7 days will appear in the results. + :type deleted_before: datetime + :param deleted_after: Timestamp that filters the results to only contain coupons deleted after this date. Must be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. **Note:** Only coupons deleted in the last 7 days will appear in the results. + :type deleted_after: datetime :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -13814,6 +13837,8 @@ def export_coupons_without_preload_content( date_format=date_format, campaign_state=campaign_state, values_only=values_only, + deleted_before=deleted_before, + deleted_after=deleted_after, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13847,6 +13872,8 @@ def _export_coupons_serialize( date_format, campaign_state, values_only, + deleted_before, + deleted_after, _request_auth, _content_type, _headers, @@ -13945,6 +13972,32 @@ def _export_coupons_serialize( _query_params.append(('valuesOnly', values_only)) + if deleted_before is not None: + if isinstance(deleted_before, datetime): + _query_params.append( + ( + 'deletedBefore', + deleted_before.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('deletedBefore', deleted_before)) + + if deleted_after is not None: + if isinstance(deleted_after, datetime): + _query_params.append( + ( + 'deletedAfter', + deleted_after.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('deletedAfter', deleted_after)) + # process the header parameters # process the form parameters # process the body parameter @@ -24648,6 +24701,7 @@ def get_attributes( sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. ")] = None, entity: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied entity.")] = None, application_ids: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied application ids")] = None, + loyalty_program_ids: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by the specified loyalty program ids, separated by commas. You can only use this parameter when `entity` is `LoyaltyCard`.")] = None, type: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied type")] = None, kind: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied kind (builtin or custom)")] = None, search: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by searching case insensitive through Attribute name, description and type")] = None, @@ -24678,6 +24732,8 @@ def get_attributes( :type entity: str :param application_ids: Returned attributes will be filtered by supplied application ids :type application_ids: str + :param loyalty_program_ids: Returned attributes will be filtered by the specified loyalty program ids, separated by commas. You can only use this parameter when `entity` is `LoyaltyCard`. + :type loyalty_program_ids: str :param type: Returned attributes will be filtered by supplied type :type type: str :param kind: Returned attributes will be filtered by supplied kind (builtin or custom) @@ -24712,6 +24768,7 @@ def get_attributes( sort=sort, entity=entity, application_ids=application_ids, + loyalty_program_ids=loyalty_program_ids, type=type, kind=kind, search=search, @@ -24743,6 +24800,7 @@ def get_attributes_with_http_info( sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. ")] = None, entity: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied entity.")] = None, application_ids: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied application ids")] = None, + loyalty_program_ids: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by the specified loyalty program ids, separated by commas. You can only use this parameter when `entity` is `LoyaltyCard`.")] = None, type: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied type")] = None, kind: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied kind (builtin or custom)")] = None, search: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by searching case insensitive through Attribute name, description and type")] = None, @@ -24773,6 +24831,8 @@ def get_attributes_with_http_info( :type entity: str :param application_ids: Returned attributes will be filtered by supplied application ids :type application_ids: str + :param loyalty_program_ids: Returned attributes will be filtered by the specified loyalty program ids, separated by commas. You can only use this parameter when `entity` is `LoyaltyCard`. + :type loyalty_program_ids: str :param type: Returned attributes will be filtered by supplied type :type type: str :param kind: Returned attributes will be filtered by supplied kind (builtin or custom) @@ -24807,6 +24867,7 @@ def get_attributes_with_http_info( sort=sort, entity=entity, application_ids=application_ids, + loyalty_program_ids=loyalty_program_ids, type=type, kind=kind, search=search, @@ -24838,6 +24899,7 @@ def get_attributes_without_preload_content( sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. ")] = None, entity: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied entity.")] = None, application_ids: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied application ids")] = None, + loyalty_program_ids: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by the specified loyalty program ids, separated by commas. You can only use this parameter when `entity` is `LoyaltyCard`.")] = None, type: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied type")] = None, kind: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied kind (builtin or custom)")] = None, search: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by searching case insensitive through Attribute name, description and type")] = None, @@ -24868,6 +24930,8 @@ def get_attributes_without_preload_content( :type entity: str :param application_ids: Returned attributes will be filtered by supplied application ids :type application_ids: str + :param loyalty_program_ids: Returned attributes will be filtered by the specified loyalty program ids, separated by commas. You can only use this parameter when `entity` is `LoyaltyCard`. + :type loyalty_program_ids: str :param type: Returned attributes will be filtered by supplied type :type type: str :param kind: Returned attributes will be filtered by supplied kind (builtin or custom) @@ -24902,6 +24966,7 @@ def get_attributes_without_preload_content( sort=sort, entity=entity, application_ids=application_ids, + loyalty_program_ids=loyalty_program_ids, type=type, kind=kind, search=search, @@ -24928,6 +24993,7 @@ def _get_attributes_serialize( sort, entity, application_ids, + loyalty_program_ids, type, kind, search, @@ -24973,6 +25039,10 @@ def _get_attributes_serialize( _query_params.append(('applicationIds', application_ids)) + if loyalty_program_ids is not None: + + _query_params.append(('loyaltyProgramIds', loyalty_program_ids)) + if type is not None: _query_params.append(('type', type)) @@ -38612,6 +38682,297 @@ def _get_ruleset_serialize( + @validate_call + def get_ruleset_v2( + self, + application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], + campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], + ruleset_id: Annotated[StrictInt, Field(description="The ID of the ruleset.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RulesetV2: + """Get ruleset (V2) + + Retrieve the specified ruleset as a JSON object. + + :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + :type application_id: int + :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + :type campaign_id: int + :param ruleset_id: The ID of the ruleset. (required) + :type ruleset_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ruleset_v2_serialize( + application_id=application_id, + campaign_id=campaign_id, + ruleset_id=ruleset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RulesetV2", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_ruleset_v2_with_http_info( + self, + application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], + campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], + ruleset_id: Annotated[StrictInt, Field(description="The ID of the ruleset.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RulesetV2]: + """Get ruleset (V2) + + Retrieve the specified ruleset as a JSON object. + + :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + :type application_id: int + :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + :type campaign_id: int + :param ruleset_id: The ID of the ruleset. (required) + :type ruleset_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ruleset_v2_serialize( + application_id=application_id, + campaign_id=campaign_id, + ruleset_id=ruleset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RulesetV2", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_ruleset_v2_without_preload_content( + self, + application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], + campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], + ruleset_id: Annotated[StrictInt, Field(description="The ID of the ruleset.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get ruleset (V2) + + Retrieve the specified ruleset as a JSON object. + + :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + :type application_id: int + :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + :type campaign_id: int + :param ruleset_id: The ID of the ruleset. (required) + :type ruleset_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ruleset_v2_serialize( + application_id=application_id, + campaign_id=campaign_id, + ruleset_id=ruleset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RulesetV2", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_ruleset_v2_serialize( + self, + application_id, + campaign_id, + ruleset_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if application_id is not None: + _path_params['applicationId'] = application_id + if campaign_id is not None: + _path_params['campaignId'] = campaign_id + if ruleset_id is not None: + _path_params['rulesetId'] = ruleset_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key_v1' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_rulesets( self, diff --git a/talon_one/api_client.py b/talon_one/api_client.py index 69e438e..8e46c6b 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.12.0/python' + self.user_agent = 'OpenAPI-Generator/26.13.0/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 dc123c4..e8a1f9e 100644 --- a/talon_one/configuration.py +++ b/talon_one/configuration.py @@ -554,7 +554,7 @@ def to_debug_report(self) -> str: "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: \n"\ - "SDK Package Version: 26.12.0".\ + "SDK Package Version: 26.13.0".\ 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 4a163bd..7c55e47 100644 --- a/talon_one/models/__init__.py +++ b/talon_one/models/__init__.py @@ -92,6 +92,7 @@ from talon_one.models.audience_membership import AudienceMembership from talon_one.models.audience_reference import AudienceReference from talon_one.models.award_giveaway_effect_props import AwardGiveawayEffectProps +from talon_one.models.base_block import BaseBlock from talon_one.models.base_campaign import BaseCampaign from talon_one.models.base_loyalty_program import BaseLoyaltyProgram from talon_one.models.base_notification import BaseNotification @@ -209,6 +210,7 @@ from talon_one.models.create_template_campaign_response import CreateTemplateCampaignResponse from talon_one.models.custom_effect import CustomEffect from talon_one.models.custom_effect_props import CustomEffectProps +from talon_one.models.customer_achievement import CustomerAchievement from talon_one.models.customer_activity_report import CustomerActivityReport from talon_one.models.customer_analytics import CustomerAnalytics from talon_one.models.customer_inventory import CustomerInventory @@ -547,6 +549,7 @@ from talon_one.models.outgoing_integration_templates import OutgoingIntegrationTemplates from talon_one.models.outgoing_integration_type import OutgoingIntegrationType from talon_one.models.outgoing_integration_types import OutgoingIntegrationTypes +from talon_one.models.passthrough_block import PassthroughBlock from talon_one.models.patch_item_catalog_action import PatchItemCatalogAction from talon_one.models.patch_many_items_catalog_action import PatchManyItemsCatalogAction from talon_one.models.pending_active_points_data import PendingActivePointsData @@ -568,6 +571,8 @@ from talon_one.models.profile_audiences_changes import ProfileAudiencesChanges from talon_one.models.projected_tier import ProjectedTier from talon_one.models.promote_experiment import PromoteExperiment +from talon_one.models.promotion_group_block import PromotionGroupBlock +from talon_one.models.promotion_rule_v2 import PromotionRuleV2 from talon_one.models.redeem_referral_effect_props import RedeemReferralEffectProps from talon_one.models.referral import Referral from talon_one.models.referral_constraints import ReferralConstraints @@ -589,6 +594,9 @@ from talon_one.models.revision_version import RevisionVersion from talon_one.models.reward import Reward from talon_one.models.reward_points_required import RewardPointsRequired +from talon_one.models.risk import Risk +from talon_one.models.risk_affected_entity_item import RiskAffectedEntityItem +from talon_one.models.risk_detail import RiskDetail from talon_one.models.risk_notification import RiskNotification from talon_one.models.role import Role from talon_one.models.role_assign import RoleAssign @@ -613,7 +621,9 @@ from talon_one.models.rule_failure_reason import RuleFailureReason from talon_one.models.rule_metadata import RuleMetadata from talon_one.models.rule_metadata_eligibility import RuleMetadataEligibility +from talon_one.models.rule_v2 import RuleV2 from talon_one.models.ruleset import Ruleset +from talon_one.models.ruleset_v2 import RulesetV2 from talon_one.models.sso_config import SSOConfig from talon_one.models.saml_connection import SamlConnection from talon_one.models.saml_connection_internal import SamlConnectionInternal @@ -655,7 +665,9 @@ from talon_one.models.strikethrough_custom_effect_per_item_props import StrikethroughCustomEffectPerItemProps from talon_one.models.strikethrough_debug_response import StrikethroughDebugResponse from talon_one.models.strikethrough_effect import StrikethroughEffect +from talon_one.models.strikethrough_group_block import StrikethroughGroupBlock from talon_one.models.strikethrough_labeling_notification import StrikethroughLabelingNotification +from talon_one.models.strikethrough_rule_v2 import StrikethroughRuleV2 from talon_one.models.strikethrough_set_discount_per_item_effect_props import StrikethroughSetDiscountPerItemEffectProps from talon_one.models.strikethrough_set_discount_per_item_member_effect_props import StrikethroughSetDiscountPerItemMemberEffectProps from talon_one.models.strikethrough_trigger import StrikethroughTrigger diff --git a/talon_one/models/base_block.py b/talon_one/models/base_block.py new file mode 100644 index 0000000..ee9e8ab --- /dev/null +++ b/talon_one/models/base_block.py @@ -0,0 +1,92 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class BaseBlock(BaseModel): + """ + Common properties shared by all block types. + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier for this block.", json_schema_extra={"examples": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}) + type: StrictStr = Field(description="Identifies the block variant and determines which additional properties are present in it.") + tags: Optional[List[StrictStr]] = Field(default=None, description="Semantic labels attached to this block.") + __properties: ClassVar[List[str]] = ["id", "type", "tags"] + + 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 BaseBlock 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BaseBlock 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"), + "type": obj.get("type"), + "tags": obj.get("tags") + }) + return _obj + + diff --git a/talon_one/models/best_prior_price.py b/talon_one/models/best_prior_price.py index e790f05..068a5a7 100644 --- a/talon_one/models/best_prior_price.py +++ b/talon_one/models/best_prior_price.py @@ -30,7 +30,7 @@ class BestPriorPrice(BaseModel): BestPriorPrice """ # noqa: E501 id: StrictInt = Field(description="The ID of the historical price.", json_schema_extra={"examples": [1]}) - sku: StrictStr = Field(description="sku", json_schema_extra={"examples": ["NVR-GN-GV-UUP"]}) + sku: StrictStr = Field(description="sku", json_schema_extra={"examples": ["SKU7345278"]}) observed_at: datetime = Field(description="The date and time when the price was observed.", alias="observedAt", json_schema_extra={"examples": ["2025-11-10T23:00:00Z"]}) context_ids: List[StrictStr] = Field(description="The identifiers of the relevant context at the time the price was observed. Includes the context IDs of any price adjustments and of the campaigns that influenced the final price. ", alias="contextIds", json_schema_extra={"examples": [["SpringSale", "SummerSale2025"]]}) context_id: Optional[StrictStr] = Field(default='', description="This property is **deprecated**. Use `contextIds` instead. Defaults to an empty string. ", alias="contextId", json_schema_extra={"examples": [""]}) diff --git a/talon_one/models/best_prior_price_request.py b/talon_one/models/best_prior_price_request.py index adfce32..067e253 100644 --- a/talon_one/models/best_prior_price_request.py +++ b/talon_one/models/best_prior_price_request.py @@ -30,7 +30,7 @@ class BestPriorPriceRequest(BaseModel): """ BestPriorPriceRequest """ # noqa: E501 - skus: Annotated[List[StrictStr], Field(min_length=1)] = Field(description="List of product SKUs to check when determining the best prior price.", json_schema_extra={"examples": [["comma", "period"]]}) + skus: Annotated[List[StrictStr], Field(min_length=1)] = Field(description="List of product SKUs to check when determining the best prior price.", json_schema_extra={"examples": [["SKU1241028", "SKU7345278"]]}) timeframe_end_date: datetime = Field(description="The end date and time that defines the latest time for retrieving historical SKU prices.", alias="timeframeEndDate", json_schema_extra={"examples": ["2020-11-10T23:00:00Z"]}) timeframe: StrictStr = Field(description="The number of days prior to the timeframeEndDate. Only prices within this look back period are considered for the best prior price evaluation.", json_schema_extra={"examples": ["30"]}) timeframe_end_date_type: StrictStr = Field(description="Sets the timeframe for retrieving historical pricing data. Can be one of the following values: - `strict`: The timeframe ends at the `timeframeEndDate` value. - `price`: The timeframe ends at the start of current price value and takes the prices prior to the start of the current price value into account. - `sale`: The timeframe ends at the start of current `contextId` and takes the prices prior to the start of the `contextId` into account. ", alias="timeframeEndDateType", json_schema_extra={"examples": ["sale"]}) diff --git a/talon_one/models/customer_achievement.py b/talon_one/models/customer_achievement.py new file mode 100644 index 0000000..9650e47 --- /dev/null +++ b/talon_one/models/customer_achievement.py @@ -0,0 +1,138 @@ +# 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from talon_one.models.achievement_progress import AchievementProgress +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CustomerAchievement(BaseModel): + """ + A customer's progress in an achievement, together with the achievement definition. + """ # noqa: E501 + id: StrictInt = Field(description="The internal ID of the achievement.", json_schema_extra={"examples": [3]}) + name: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The internal name of the achievement used in API requests. ", json_schema_extra={"examples": ["FreeCoffee10Orders"]}) + title: StrictStr = Field(description="The display name of the achievement in the Campaign Manager.", json_schema_extra={"examples": ["50% off on 50th purchase."]}) + description: StrictStr = Field(description="The description of the achievement in the Campaign Manager.", json_schema_extra={"examples": ["50% off for every 50th purchase in a year."]}) + target: Union[StrictFloat, StrictInt] = Field(description="The required number of actions or the transactional milestone to complete the achievement.", json_schema_extra={"examples": [10]}) + recurrence_policy: StrictStr = Field(description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy", json_schema_extra={"examples": ["no_recurrence"]}) + activation_policy: StrictStr = Field(description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy", json_schema_extra={"examples": ["fixed_schedule"]}) + fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is equal to `fixed_schedule`. **Note:** It is an RFC3339 timestamp string. ", alias="fixedStartDate", json_schema_extra={"examples": ["2024-01-15T15:04:05Z07:00"]}) + end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It is an RFC3339 timestamp string. ", alias="endDate", json_schema_extra={"examples": ["2024-02-15T15:04:05Z07:00"]}) + allow_rollback_after_completion: StrictBool = Field(description="When `true`, customer progress can be rolled back in completed achievements.", alias="allowRollbackAfterCompletion", json_schema_extra={"examples": [False]}) + current_progress: Optional[AchievementProgress] = Field(default=None, alias="currentProgress") + __properties: ClassVar[List[str]] = ["id", "name", "title", "description", "target", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "currentProgress"] + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not isinstance(value, str): + value = str(value) + + if not re.match(r"^[a-zA-Z]\w+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z]\w+$/") + return value + + @field_validator('recurrence_policy') + def recurrence_policy_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['no_recurrence', 'on_expiration', 'on_completion']): + raise ValueError("must be one of enum values ('no_recurrence', 'on_expiration', 'on_completion')") + return value + + @field_validator('activation_policy') + def activation_policy_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['user_action', 'fixed_schedule']): + raise ValueError("must be one of enum values ('user_action', 'fixed_schedule')") + 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 CustomerAchievement 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of current_progress + if self.current_progress: + _dict['currentProgress'] = self.current_progress.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CustomerAchievement 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"), + "name": obj.get("name"), + "title": obj.get("title"), + "description": obj.get("description"), + "target": obj.get("target"), + "recurrencePolicy": obj.get("recurrencePolicy"), + "activationPolicy": obj.get("activationPolicy"), + "fixedStartDate": obj.get("fixedStartDate"), + "endDate": obj.get("endDate"), + "allowRollbackAfterCompletion": obj.get("allowRollbackAfterCompletion"), + "currentProgress": AchievementProgress.from_dict(obj["currentProgress"]) if obj.get("currentProgress") is not None else None + }) + return _obj + + diff --git a/talon_one/models/customer_profile_integration_request_v2.py b/talon_one/models/customer_profile_integration_request_v2.py index 7494374..3da4474 100644 --- a/talon_one/models/customer_profile_integration_request_v2.py +++ b/talon_one/models/customer_profile_integration_request_v2.py @@ -41,8 +41,8 @@ def response_content_validate_enum(cls, value): return value for i in value: - if i not in set(['customerProfile', 'triggeredCampaigns', 'loyalty', 'event', 'awardedGiveaways', 'ruleFailureReasons', 'campaignEligibility']): - raise ValueError("each list item must be one of ('customerProfile', 'triggeredCampaigns', 'loyalty', 'event', 'awardedGiveaways', 'ruleFailureReasons', 'campaignEligibility')") + if i not in set(['customerProfile', 'triggeredCampaigns', 'loyalty', 'event', 'awardedGiveaways', 'ruleFailureReasons', 'campaignEligibility', 'achievements']): + raise ValueError("each list item must be one of ('customerProfile', 'triggeredCampaigns', 'loyalty', 'event', 'awardedGiveaways', 'ruleFailureReasons', 'campaignEligibility', 'achievements')") return value model_config = ConfigDict( diff --git a/talon_one/models/integration_campaign.py b/talon_one/models/integration_campaign.py index 3cfb7a3..155eb06 100644 --- a/talon_one/models/integration_campaign.py +++ b/talon_one/models/integration_campaign.py @@ -41,7 +41,9 @@ class IntegrationCampaign(BaseModel): tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)] = Field(description="A list of tags for the campaign.", json_schema_extra={"examples": [["summer"]]}) features: List[StrictStr] = Field(description="The features enabled in this campaign.", json_schema_extra={"examples": [["coupons", "referrals"]]}) rules: List[RuleMetadata] = Field(description="A list of rules containing customer-facing details of the rewards defined in the campaign.") - __properties: ClassVar[List[str]] = ["applicationId", "id", "name", "description", "startTime", "endTime", "attributes", "state", "tags", "features", "rules"] + linked_store_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of store IDs linked to this campaign.", alias="linkedStoreIds", json_schema_extra={"examples": [[1, 2]]}) + linked_audience_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of audience IDs linked to this campaign.", alias="linkedAudienceIds", json_schema_extra={"examples": [[3, 4]]}) + __properties: ClassVar[List[str]] = ["applicationId", "id", "name", "description", "startTime", "endTime", "attributes", "state", "tags", "features", "rules", "linkedStoreIds", "linkedAudienceIds"] @field_validator('state') def state_validate_enum(cls, value): @@ -126,7 +128,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "state": obj.get("state") if obj.get("state") is not None else 'enabled', "tags": obj.get("tags"), "features": obj.get("features"), - "rules": [RuleMetadata.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None + "rules": [RuleMetadata.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None, + "linkedStoreIds": obj.get("linkedStoreIds"), + "linkedAudienceIds": obj.get("linkedAudienceIds") }) return _obj diff --git a/talon_one/models/integration_event_v2_request.py b/talon_one/models/integration_event_v2_request.py index affd25a..36f0220 100644 --- a/talon_one/models/integration_event_v2_request.py +++ b/talon_one/models/integration_event_v2_request.py @@ -44,8 +44,8 @@ def response_content_validate_enum(cls, value): return value for i in value: - if i not in set(['customerProfile', 'triggeredCampaigns', 'loyalty', 'event', 'awardedGiveaways', 'ruleFailureReasons', 'campaignEligibility']): - raise ValueError("each list item must be one of ('customerProfile', 'triggeredCampaigns', 'loyalty', 'event', 'awardedGiveaways', 'ruleFailureReasons', 'campaignEligibility')") + if i not in set(['customerProfile', 'triggeredCampaigns', 'loyalty', 'event', 'awardedGiveaways', 'ruleFailureReasons', 'campaignEligibility', 'achievements']): + raise ValueError("each list item must be one of ('customerProfile', 'triggeredCampaigns', 'loyalty', 'event', 'awardedGiveaways', 'ruleFailureReasons', 'campaignEligibility', 'achievements')") return value model_config = ConfigDict( diff --git a/talon_one/models/integration_event_v2_response.py b/talon_one/models/integration_event_v2_response.py index 5fdf578..69897a0 100644 --- a/talon_one/models/integration_event_v2_response.py +++ b/talon_one/models/integration_event_v2_response.py @@ -22,6 +22,7 @@ from talon_one.models.campaign import Campaign from talon_one.models.campaign_eligibility import CampaignEligibility from talon_one.models.coupon import Coupon +from talon_one.models.customer_achievement import CustomerAchievement from talon_one.models.customer_profile import CustomerProfile from talon_one.models.effect import Effect from talon_one.models.event import Event @@ -46,8 +47,9 @@ class IntegrationEventV2Response(BaseModel): created_coupons: List[Coupon] = Field(description="The coupons that were created during the event processing.", alias="createdCoupons") created_referrals: List[Referral] = Field(description="The referrals that were created during the event processing.", alias="createdReferrals") awarded_giveaways: Optional[List[Giveaway]] = Field(default=None, description="The giveaways that were awarded during the event processing.", alias="awardedGiveaways") + achievements: Optional[List[CustomerAchievement]] = Field(default=None, description="The achievements progress of the customer.") event: Optional[Event] = Field(default=None, description="The event that was processed.") - __properties: ClassVar[List[str]] = ["customerProfile", "loyalty", "triggeredCampaigns", "campaignEligibility", "effects", "ruleFailureReasons", "createdCoupons", "createdReferrals", "awardedGiveaways", "event"] + __properties: ClassVar[List[str]] = ["customerProfile", "loyalty", "triggeredCampaigns", "campaignEligibility", "effects", "ruleFailureReasons", "createdCoupons", "createdReferrals", "awardedGiveaways", "achievements", "event"] model_config = ConfigDict( validate_by_name=True, @@ -143,6 +145,13 @@ def to_dict(self) -> Dict[str, Any]: if _item_awarded_giveaways: _items.append(_item_awarded_giveaways.to_dict()) _dict['awardedGiveaways'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in achievements (list) + _items = [] + if self.achievements: + for _item_achievements in self.achievements: + if _item_achievements: + _items.append(_item_achievements.to_dict()) + _dict['achievements'] = _items # override the default output from pydantic by calling `to_dict()` of event if self.event: _dict['event'] = self.event.to_dict() @@ -167,6 +176,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "createdCoupons": [Coupon.from_dict(_item) for _item in obj["createdCoupons"]] if obj.get("createdCoupons") is not None else None, "createdReferrals": [Referral.from_dict(_item) for _item in obj["createdReferrals"]] if obj.get("createdReferrals") is not None else None, "awardedGiveaways": [Giveaway.from_dict(_item) for _item in obj["awardedGiveaways"]] if obj.get("awardedGiveaways") is not None else None, + "achievements": [CustomerAchievement.from_dict(_item) for _item in obj["achievements"]] if obj.get("achievements") is not None else None, "event": Event.from_dict(obj["event"]) if obj.get("event") is not None else None }) return _obj diff --git a/talon_one/models/integration_event_v3_response.py b/talon_one/models/integration_event_v3_response.py index ecb5ab5..2d54f3c 100644 --- a/talon_one/models/integration_event_v3_response.py +++ b/talon_one/models/integration_event_v3_response.py @@ -22,6 +22,7 @@ from talon_one.models.campaign import Campaign from talon_one.models.campaign_eligibility import CampaignEligibility from talon_one.models.coupon import Coupon +from talon_one.models.customer_achievement import CustomerAchievement from talon_one.models.customer_profile import CustomerProfile from talon_one.models.effect import Effect from talon_one.models.event_v3 import EventV3 @@ -46,8 +47,9 @@ class IntegrationEventV3Response(BaseModel): created_coupons: List[Coupon] = Field(description="The coupons that were created during the event processing.", alias="createdCoupons") created_referrals: List[Referral] = Field(description="The referrals that were created during the event processing.", alias="createdReferrals") awarded_giveaways: Optional[List[Giveaway]] = Field(default=None, description="The giveaways that were awarded during the event processing.", alias="awardedGiveaways") + achievements: Optional[List[CustomerAchievement]] = Field(default=None, description="The achievements progress of the customer.") advanced_event: Optional[EventV3] = Field(default=None, description="The advanced event that was processed.", alias="advancedEvent") - __properties: ClassVar[List[str]] = ["customerProfile", "loyalty", "triggeredCampaigns", "campaignEligibility", "effects", "ruleFailureReasons", "createdCoupons", "createdReferrals", "awardedGiveaways", "advancedEvent"] + __properties: ClassVar[List[str]] = ["customerProfile", "loyalty", "triggeredCampaigns", "campaignEligibility", "effects", "ruleFailureReasons", "createdCoupons", "createdReferrals", "awardedGiveaways", "achievements", "advancedEvent"] model_config = ConfigDict( validate_by_name=True, @@ -143,6 +145,13 @@ def to_dict(self) -> Dict[str, Any]: if _item_awarded_giveaways: _items.append(_item_awarded_giveaways.to_dict()) _dict['awardedGiveaways'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in achievements (list) + _items = [] + if self.achievements: + for _item_achievements in self.achievements: + if _item_achievements: + _items.append(_item_achievements.to_dict()) + _dict['achievements'] = _items # override the default output from pydantic by calling `to_dict()` of advanced_event if self.advanced_event: _dict['advancedEvent'] = self.advanced_event.to_dict() @@ -167,6 +176,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "createdCoupons": [Coupon.from_dict(_item) for _item in obj["createdCoupons"]] if obj.get("createdCoupons") is not None else None, "createdReferrals": [Referral.from_dict(_item) for _item in obj["createdReferrals"]] if obj.get("createdReferrals") is not None else None, "awardedGiveaways": [Giveaway.from_dict(_item) for _item in obj["awardedGiveaways"]] if obj.get("awardedGiveaways") is not None else None, + "achievements": [CustomerAchievement.from_dict(_item) for _item in obj["achievements"]] if obj.get("achievements") is not None else None, "advancedEvent": EventV3.from_dict(obj["advancedEvent"]) if obj.get("advancedEvent") is not None else None }) return _obj diff --git a/talon_one/models/integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py index a28c38f..5b5295e 100644 --- a/talon_one/models/integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py +++ b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py @@ -35,12 +35,13 @@ class IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification(Bas subledger_id: StrictStr = Field(alias="SubledgerID") source_of_event: StrictStr = Field(alias="SourceOfEvent") current_tier: StrictStr = Field(description="The name of the customer's current tier.", alias="CurrentTier") + session_integration_id: Optional[StrictStr] = Field(default=None, description="The integration ID of the session through which the points were earned or lost. Only set when the change results from a rule engine execution; empty otherwise.", alias="SessionIntegrationID") employee_name: Optional[StrictStr] = Field(default=None, alias="EmployeeName") user_id: Optional[StrictInt] = Field(default=None, alias="UserID") current_points: Union[StrictFloat, StrictInt] = Field(alias="CurrentPoints") actions: Optional[List[IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction]] = Field(default=None, alias="Actions") published_at: datetime = Field(description="Timestamp when the event was published.", alias="PublishedAt") - __properties: ClassVar[List[str]] = ["ProfileIntegrationID", "LoyaltyProgramID", "LoyaltyProgramName", "SubledgerID", "SourceOfEvent", "CurrentTier", "EmployeeName", "UserID", "CurrentPoints", "Actions", "PublishedAt"] + __properties: ClassVar[List[str]] = ["ProfileIntegrationID", "LoyaltyProgramID", "LoyaltyProgramName", "SubledgerID", "SourceOfEvent", "CurrentTier", "SessionIntegrationID", "EmployeeName", "UserID", "CurrentPoints", "Actions", "PublishedAt"] model_config = ConfigDict( validate_by_name=True, @@ -106,6 +107,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "SubledgerID": obj.get("SubledgerID"), "SourceOfEvent": obj.get("SourceOfEvent"), "CurrentTier": obj.get("CurrentTier"), + "SessionIntegrationID": obj.get("SessionIntegrationID"), "EmployeeName": obj.get("EmployeeName"), "UserID": obj.get("UserID"), "CurrentPoints": obj.get("CurrentPoints"), diff --git a/talon_one/models/integration_request.py b/talon_one/models/integration_request.py index 3ee1b20..424ade4 100644 --- a/talon_one/models/integration_request.py +++ b/talon_one/models/integration_request.py @@ -39,8 +39,8 @@ def response_content_validate_enum(cls, value): return value for i in value: - if i not in set(['customerSession', 'customerProfile', 'coupons', 'triggeredCampaigns', 'referral', 'loyalty', 'event', 'awardedGiveaways', 'ruleFailureReasons', 'previousReturns', 'campaignEligibility']): - raise ValueError("each list item must be one of ('customerSession', 'customerProfile', 'coupons', 'triggeredCampaigns', 'referral', 'loyalty', 'event', 'awardedGiveaways', 'ruleFailureReasons', 'previousReturns', 'campaignEligibility')") + if i not in set(['customerSession', 'customerProfile', 'coupons', 'triggeredCampaigns', 'referral', 'loyalty', 'event', 'awardedGiveaways', 'ruleFailureReasons', 'previousReturns', 'campaignEligibility', 'achievements']): + raise ValueError("each list item must be one of ('customerSession', 'customerProfile', 'coupons', 'triggeredCampaigns', 'referral', 'loyalty', 'event', 'awardedGiveaways', 'ruleFailureReasons', 'previousReturns', 'campaignEligibility', 'achievements')") return value model_config = ConfigDict( diff --git a/talon_one/models/integration_response.py b/talon_one/models/integration_response.py index 568bf7c..d4fa4d0 100644 --- a/talon_one/models/integration_response.py +++ b/talon_one/models/integration_response.py @@ -22,6 +22,7 @@ from talon_one.models.campaign import Campaign from talon_one.models.campaign_eligibility import CampaignEligibility from talon_one.models.coupon import Coupon +from talon_one.models.customer_achievement import CustomerAchievement from talon_one.models.customer_profile import CustomerProfile from talon_one.models.effect import Effect from talon_one.models.giveaway import Giveaway @@ -45,7 +46,8 @@ class IntegrationResponse(BaseModel): created_coupons: List[Coupon] = Field(description="The coupons that were created during the event processing.", alias="createdCoupons") created_referrals: List[Referral] = Field(description="The referrals that were created during the event processing.", alias="createdReferrals") awarded_giveaways: Optional[List[Giveaway]] = Field(default=None, description="The giveaways that were awarded during the event processing.", alias="awardedGiveaways") - __properties: ClassVar[List[str]] = ["customerProfile", "loyalty", "triggeredCampaigns", "campaignEligibility", "effects", "ruleFailureReasons", "createdCoupons", "createdReferrals", "awardedGiveaways"] + achievements: Optional[List[CustomerAchievement]] = Field(default=None, description="The achievements progress of the customer.") + __properties: ClassVar[List[str]] = ["customerProfile", "loyalty", "triggeredCampaigns", "campaignEligibility", "effects", "ruleFailureReasons", "createdCoupons", "createdReferrals", "awardedGiveaways", "achievements"] model_config = ConfigDict( validate_by_name=True, @@ -141,6 +143,13 @@ def to_dict(self) -> Dict[str, Any]: if _item_awarded_giveaways: _items.append(_item_awarded_giveaways.to_dict()) _dict['awardedGiveaways'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in achievements (list) + _items = [] + if self.achievements: + for _item_achievements in self.achievements: + if _item_achievements: + _items.append(_item_achievements.to_dict()) + _dict['achievements'] = _items return _dict @classmethod @@ -161,7 +170,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "ruleFailureReasons": [RuleFailureReason.from_dict(_item) for _item in obj["ruleFailureReasons"]] if obj.get("ruleFailureReasons") is not None else None, "createdCoupons": [Coupon.from_dict(_item) for _item in obj["createdCoupons"]] if obj.get("createdCoupons") is not None else None, "createdReferrals": [Referral.from_dict(_item) for _item in obj["createdReferrals"]] if obj.get("createdReferrals") is not None else None, - "awardedGiveaways": [Giveaway.from_dict(_item) for _item in obj["awardedGiveaways"]] if obj.get("awardedGiveaways") is not None else None + "awardedGiveaways": [Giveaway.from_dict(_item) for _item in obj["awardedGiveaways"]] if obj.get("awardedGiveaways") is not None else None, + "achievements": [CustomerAchievement.from_dict(_item) for _item in obj["achievements"]] if obj.get("achievements") is not None else None }) return _obj diff --git a/talon_one/models/integration_state_v2.py b/talon_one/models/integration_state_v2.py index 1579f79..52fe742 100644 --- a/talon_one/models/integration_state_v2.py +++ b/talon_one/models/integration_state_v2.py @@ -22,6 +22,7 @@ from talon_one.models.campaign import Campaign from talon_one.models.campaign_eligibility import CampaignEligibility from talon_one.models.coupon import Coupon +from talon_one.models.customer_achievement import CustomerAchievement from talon_one.models.customer_profile import CustomerProfile from talon_one.models.customer_session_v2 import CustomerSessionV2 from talon_one.models.effect import Effect @@ -51,6 +52,7 @@ class IntegrationStateV2(BaseModel): created_coupons: List[Coupon] = Field(description="The coupons that were created during the event processing.", alias="createdCoupons") created_referrals: List[Referral] = Field(description="The referrals that were created during the event processing.", alias="createdReferrals") awarded_giveaways: Optional[List[Giveaway]] = Field(default=None, description="The giveaways that were awarded during the event processing.", alias="awardedGiveaways") + achievements: Optional[List[CustomerAchievement]] = Field(default=None, description="The achievements progress of the customer.") referral: Optional[InventoryReferral] = Field(default=None, description="The referral that was processed.") coupons: Optional[List[IntegrationCoupon]] = Field(default=None, description="The coupons that were processed.") event: Optional[Event] = Field(default=None, description="The event that was processed.") @@ -58,7 +60,7 @@ class IntegrationStateV2(BaseModel): customer_session: Optional[CustomerSessionV2] = Field(default=None, description="The session that was processed.", alias="customerSession") var_return: Optional[ModelReturn] = Field(default=None, description="The return that was processed.", alias="return") previous_returns: Optional[List[ModelReturn]] = Field(default=None, description="The previous returns associated with the event.", alias="previousReturns") - __properties: ClassVar[List[str]] = ["customerProfile", "loyalty", "triggeredCampaigns", "campaignEligibility", "effects", "ruleFailureReasons", "createdCoupons", "createdReferrals", "awardedGiveaways", "referral", "coupons", "event", "advancedEvent", "customerSession", "return", "previousReturns"] + __properties: ClassVar[List[str]] = ["customerProfile", "loyalty", "triggeredCampaigns", "campaignEligibility", "effects", "ruleFailureReasons", "createdCoupons", "createdReferrals", "awardedGiveaways", "achievements", "referral", "coupons", "event", "advancedEvent", "customerSession", "return", "previousReturns"] model_config = ConfigDict( validate_by_name=True, @@ -154,6 +156,13 @@ def to_dict(self) -> Dict[str, Any]: if _item_awarded_giveaways: _items.append(_item_awarded_giveaways.to_dict()) _dict['awardedGiveaways'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in achievements (list) + _items = [] + if self.achievements: + for _item_achievements in self.achievements: + if _item_achievements: + _items.append(_item_achievements.to_dict()) + _dict['achievements'] = _items # override the default output from pydantic by calling `to_dict()` of referral if self.referral: _dict['referral'] = self.referral.to_dict() @@ -204,6 +213,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "createdCoupons": [Coupon.from_dict(_item) for _item in obj["createdCoupons"]] if obj.get("createdCoupons") is not None else None, "createdReferrals": [Referral.from_dict(_item) for _item in obj["createdReferrals"]] if obj.get("createdReferrals") is not None else None, "awardedGiveaways": [Giveaway.from_dict(_item) for _item in obj["awardedGiveaways"]] if obj.get("awardedGiveaways") is not None else None, + "achievements": [CustomerAchievement.from_dict(_item) for _item in obj["achievements"]] if obj.get("achievements") is not None else None, "referral": InventoryReferral.from_dict(obj["referral"]) if obj.get("referral") is not None else None, "coupons": [IntegrationCoupon.from_dict(_item) for _item in obj["coupons"]] if obj.get("coupons") is not None else None, "event": Event.from_dict(obj["event"]) if obj.get("event") is not None else None, diff --git a/talon_one/models/passthrough_block.py b/talon_one/models/passthrough_block.py new file mode 100644 index 0000000..57bf7d9 --- /dev/null +++ b/talon_one/models/passthrough_block.py @@ -0,0 +1,99 @@ +# 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 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PassthroughBlock(BaseModel): + """ + A block representing a Talang expression that could not be mapped to a typed block. The expression is preserved in its raw Talang array form for diagnostic and round-trip purposes. + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier for this block.", json_schema_extra={"examples": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}) + type: StrictStr = Field(description="The type discriminator for this block.") + expression: List[Any] = Field(description="The raw Talang expression as an array. The first element is the function name; subsequent elements are its arguments, which may themselves be nested expressions.") + __properties: ClassVar[List[str]] = ["id", "type", "expression"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['passthrough']): + raise ValueError("must be one of enum values ('passthrough')") + 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 PassthroughBlock 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PassthroughBlock 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"), + "type": obj.get("type"), + "expression": obj.get("expression") + }) + return _obj + + diff --git a/talon_one/models/price_history_request.py b/talon_one/models/price_history_request.py index cea482d..a28b543 100644 --- a/talon_one/models/price_history_request.py +++ b/talon_one/models/price_history_request.py @@ -28,7 +28,7 @@ class PriceHistoryRequest(BaseModel): """ PriceHistoryRequest """ # noqa: E501 - sku: StrictStr = Field(description="The SKU of the item for which the historical prices are being retrieved.", json_schema_extra={"examples": [["sku-124"]]}) + sku: StrictStr = Field(description="The SKU of the item for which the historical prices are being retrieved.", json_schema_extra={"examples": ["SKU1241028"]}) start_date: datetime = Field(description="The start date of the period for which historical prices should be retrieved.", alias="startDate", json_schema_extra={"examples": ["2020-11-10T23:00:00Z"]}) end_date: datetime = Field(description="The end date of the period for which historical prices should be retrieved.", alias="endDate", json_schema_extra={"examples": ["2020-12-10T23:00:00Z"]}) __properties: ClassVar[List[str]] = ["sku", "startDate", "endDate"] diff --git a/talon_one/models/price_history_response.py b/talon_one/models/price_history_response.py index 827b0cb..1fe192f 100644 --- a/talon_one/models/price_history_response.py +++ b/talon_one/models/price_history_response.py @@ -28,7 +28,7 @@ class PriceHistoryResponse(BaseModel): """ PriceHistoryResponse """ # noqa: E501 - sku: StrictStr = Field(description="The SKU of the item for which historical prices should be retrieved.", json_schema_extra={"examples": [["SKU1241028"]]}) + sku: StrictStr = Field(description="The SKU of the item for which historical prices should be retrieved.", json_schema_extra={"examples": ["SKU1241028"]}) history: List[History] __properties: ClassVar[List[str]] = ["sku", "history"] diff --git a/talon_one/models/promotion_group_block.py b/talon_one/models/promotion_group_block.py new file mode 100644 index 0000000..b00893b --- /dev/null +++ b/talon_one/models/promotion_group_block.py @@ -0,0 +1,107 @@ +# 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 import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PromotionGroupBlock(BaseModel): + """ + PromotionGroupBlock + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier for this block.", json_schema_extra={"examples": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}) + type: StrictStr = Field(description="Identifies the block variant and determines which additional properties are present in it.") + tags: Optional[List[StrictStr]] = Field(default=None, description="Semantic labels attached to this block.") + operator: StrictStr = Field(description="Logical operator applied across child blocks. `all` requires every child to pass, `atLeastOne` requires at least one, `none` requires all to fail.") + blocks: List[Any] = Field(description="Child blocks evaluated according to the operator.") + on_failure: Optional[List[Any]] = Field(default=None, description="Promotion blocks evaluated when this block fails or returns false.", alias="onFailure") + on_error: Optional[Dict[str, List[Any]]] = Field(default=None, description="Named error handlers evaluated when a specific error occurs.", alias="onError") + __properties: ClassVar[List[str]] = ["id", "type", "tags", "operator", "blocks", "onFailure", "onError"] + + @field_validator('operator') + def operator_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['all', 'atLeastOne', 'none']): + raise ValueError("must be one of enum values ('all', 'atLeastOne', 'none')") + 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 PromotionGroupBlock 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PromotionGroupBlock 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"), + "type": obj.get("type"), + "tags": obj.get("tags"), + "operator": obj.get("operator"), + "blocks": obj.get("blocks"), + "onFailure": obj.get("onFailure"), + "onError": obj.get("onError") + }) + return _obj + + diff --git a/talon_one/models/promotion_rule_v2.py b/talon_one/models/promotion_rule_v2.py new file mode 100644 index 0000000..6976296 --- /dev/null +++ b/talon_one/models/promotion_rule_v2.py @@ -0,0 +1,96 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PromotionRuleV2(BaseModel): + """ + PromotionRuleV2 + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the rule.", json_schema_extra={"examples": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}) + parent_id: Optional[StrictStr] = Field(default=None, description="ID of the parent rule, if any.", alias="parentId") + title: StrictStr = Field(description="A short description of the rule.", json_schema_extra={"examples": ["10% off for loyalty members"]}) + description: Optional[StrictStr] = Field(default=None, description="A longer description of the rule.") + blocks: List[Any] = Field(description="The condition and effect blocks that make up this promotion rule.") + __properties: ClassVar[List[str]] = ["id", "parentId", "title", "description", "blocks"] + + 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 PromotionRuleV2 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PromotionRuleV2 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"), + "parentId": obj.get("parentId"), + "title": obj.get("title"), + "description": obj.get("description"), + "blocks": obj.get("blocks") + }) + return _obj + + diff --git a/talon_one/models/response_content_object.py b/talon_one/models/response_content_object.py index 8f24b6f..8201911 100644 --- a/talon_one/models/response_content_object.py +++ b/talon_one/models/response_content_object.py @@ -37,8 +37,8 @@ def response_content_validate_enum(cls, value): return value for i in value: - if i not in set(['customerProfile', 'triggeredCampaigns', 'loyalty', 'event', 'awardedGiveaways', 'ruleFailureReasons', 'campaignEligibility']): - raise ValueError("each list item must be one of ('customerProfile', 'triggeredCampaigns', 'loyalty', 'event', 'awardedGiveaways', 'ruleFailureReasons', 'campaignEligibility')") + if i not in set(['customerProfile', 'triggeredCampaigns', 'loyalty', 'event', 'awardedGiveaways', 'ruleFailureReasons', 'campaignEligibility', 'achievements']): + raise ValueError("each list item must be one of ('customerProfile', 'triggeredCampaigns', 'loyalty', 'event', 'awardedGiveaways', 'ruleFailureReasons', 'campaignEligibility', 'achievements')") return value model_config = ConfigDict( diff --git a/talon_one/models/reward.py b/talon_one/models/reward.py index 1b9b70e..0b7cb72 100644 --- a/talon_one/models/reward.py +++ b/talon_one/models/reward.py @@ -40,13 +40,13 @@ class Reward(BaseModel): 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]}) - visibility_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="visibilityConditions") + 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": [[]]}) 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"]}) points_required: Optional[List[RewardPointsRequired]] = Field(default=None, description="The loyalty points required to activate a reward.", alias="pointsRequired") - __properties: ClassVar[List[str]] = ["id", "created", "accountId", "name", "apiName", "description", "applicationIds", "sandbox", "visibilityConditions", "rule", "bindings", "modified", "status", "pointsRequired"] + __properties: ClassVar[List[str]] = ["id", "created", "accountId", "name", "apiName", "description", "applicationIds", "sandbox", "eligibilityConditions", "rule", "bindings", "modified", "status", "pointsRequired"] @field_validator('status') def status_validate_enum(cls, value): @@ -94,9 +94,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of visibility_conditions - if self.visibility_conditions: - _dict['visibilityConditions'] = self.visibility_conditions.to_dict() + # 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() @@ -134,7 +134,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "description": obj.get("description"), "applicationIds": obj.get("applicationIds"), "sandbox": obj.get("sandbox"), - "visibilityConditions": Rule.from_dict(obj["visibilityConditions"]) if obj.get("visibilityConditions") is not None else None, + "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, "modified": obj.get("modified"), diff --git a/talon_one/models/risk.py b/talon_one/models/risk.py new file mode 100644 index 0000000..31fd538 --- /dev/null +++ b/talon_one/models/risk.py @@ -0,0 +1,152 @@ +# 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 date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Risk(BaseModel): + """ + A risk detected by the anomaly detection service for one Application group. + """ # 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"]}) + notification_id: StrictInt = Field(description="The ID of the risk notification rule that flagged this risk.", alias="notificationId", json_schema_extra={"examples": [3]}) + run_date: date = Field(description="The date of the ML pipeline run that detected this risk.", alias="runDate", json_schema_extra={"examples": ["2026-06-05"]}) + group_key: StrictStr = Field(description="The Application group this risk was detected in. Contains the Application ID, or `__GLOBAL__` for metrics that are not grouped by Application. ", alias="groupKey", json_schema_extra={"examples": ["7"]}) + application_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application this risk belongs to. Absent for global metrics.", alias="applicationId", json_schema_extra={"examples": [7]}) + status: StrictStr = Field(description="The triage lifecycle status of this risk.", json_schema_extra={"examples": ["active"]}) + criticality: StrictStr = Field(description="The critical classification bucket of this risk.", json_schema_extra={"examples": ["critical"]}) + entity: StrictStr = Field(description="The entity type the risk was detected in.", json_schema_extra={"examples": ["customer_profile"]}) + activity: StrictStr = Field(description="The activity metric the risk was detected in.", json_schema_extra={"examples": ["discounted_amount"]}) + time_frame: StrictStr = Field(description="The rolling time window of the risk evaluation.", alias="timeFrame", json_schema_extra={"examples": ["1_week"]}) + reported_date: datetime = Field(description="The time the ML service reported this risk.", alias="reportedDate", json_schema_extra={"examples": ["2026-06-05T06:26:13.698884Z"]}) + affected_entity_count: StrictInt = Field(description="The total number of entities affected by this risk.", alias="affectedEntityCount", json_schema_extra={"examples": [4437]}) + description: Optional[StrictStr] = Field(default=None, description="Human-readable description of the detected anomaly.", json_schema_extra={"examples": ["Unusual discount usage detected for 4437 customer profiles."]}) + modified: datetime = Field(description="Timestamp of the most recent update.", json_schema_extra={"examples": ["2026-06-05T06:26:13.698884Z"]}) + __properties: ClassVar[List[str]] = ["id", "created", "notificationId", "runDate", "groupKey", "applicationId", "status", "criticality", "entity", "activity", "timeFrame", "reportedDate", "affectedEntityCount", "description", "modified"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['active', 'in_review', 'confirmed', 'discarded']): + raise ValueError("must be one of enum values ('active', 'in_review', 'confirmed', 'discarded')") + return value + + @field_validator('criticality') + def criticality_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['critical', 'not_critical']): + raise ValueError("must be one of enum values ('critical', 'not_critical')") + return value + + @field_validator('entity') + def entity_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['customer_profile', 'customer_session']): + raise ValueError("must be one of enum values ('customer_profile', 'customer_session')") + return value + + @field_validator('activity') + def activity_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['loyalty_points_earned', 'discounted_amount', 'completed_orders', 'coupon_attempts']): + raise ValueError("must be one of enum values ('loyalty_points_earned', 'discounted_amount', 'completed_orders', 'coupon_attempts')") + return value + + @field_validator('time_frame') + def time_frame_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1_day', '1_week', '1_month']): + raise ValueError("must be one of enum values ('1_day', '1_week', '1_month')") + 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 Risk 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Risk 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"), + "notificationId": obj.get("notificationId"), + "runDate": obj.get("runDate"), + "groupKey": obj.get("groupKey"), + "applicationId": obj.get("applicationId"), + "status": obj.get("status"), + "criticality": obj.get("criticality"), + "entity": obj.get("entity"), + "activity": obj.get("activity"), + "timeFrame": obj.get("timeFrame"), + "reportedDate": obj.get("reportedDate"), + "affectedEntityCount": obj.get("affectedEntityCount"), + "description": obj.get("description"), + "modified": obj.get("modified") + }) + return _obj + + diff --git a/talon_one/models/risk_affected_entity_item.py b/talon_one/models/risk_affected_entity_item.py new file mode 100644 index 0000000..e964aa6 --- /dev/null +++ b/talon_one/models/risk_affected_entity_item.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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RiskAffectedEntityItem(BaseModel): + """ + A single entity flagged as anomalous within a risk. + """ # noqa: E501 + entity_id: StrictStr = Field(description="The integration ID of the affected entity.", alias="entityId", json_schema_extra={"examples": ["174165415"]}) + activity_value: Union[StrictFloat, StrictInt] = Field(description="The observed value of the monitored activity metric for this entity.", alias="activityValue", json_schema_extra={"examples": [2898.2]}) + threshold: Union[StrictFloat, StrictInt] = Field(description="The anomaly threshold computed for the entity's Application group.", json_schema_extra={"examples": [60]}) + severity_ratio: Union[StrictFloat, StrictInt] = Field(description="The ratio of the observed value to the threshold.", alias="severityRatio", json_schema_extra={"examples": [48.3]}) + criticality: StrictStr = Field(description="The critical classification bucket of this entity.", json_schema_extra={"examples": ["critical"]}) + __properties: ClassVar[List[str]] = ["entityId", "activityValue", "threshold", "severityRatio", "criticality"] + + @field_validator('criticality') + def criticality_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['critical', 'not_critical']): + raise ValueError("must be one of enum values ('critical', 'not_critical')") + 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 RiskAffectedEntityItem 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RiskAffectedEntityItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "entityId": obj.get("entityId"), + "activityValue": obj.get("activityValue"), + "threshold": obj.get("threshold"), + "severityRatio": obj.get("severityRatio"), + "criticality": obj.get("criticality") + }) + return _obj + + diff --git a/talon_one/models/risk_detail.py b/talon_one/models/risk_detail.py new file mode 100644 index 0000000..1ab8415 --- /dev/null +++ b/talon_one/models/risk_detail.py @@ -0,0 +1,162 @@ +# 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 date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.risk_affected_entity_item import RiskAffectedEntityItem +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RiskDetail(BaseModel): + """ + Details of a risk, including its most severely affected entities. + """ # 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"]}) + notification_id: StrictInt = Field(description="The ID of the risk notification rule that flagged this risk.", alias="notificationId", json_schema_extra={"examples": [3]}) + run_date: date = Field(description="The date of the ML pipeline run that detected this risk.", alias="runDate", json_schema_extra={"examples": ["2026-06-05"]}) + group_key: StrictStr = Field(description="The Application group this risk was detected in. Contains the Application ID, or `__GLOBAL__` for metrics that are not grouped by Application. ", alias="groupKey", json_schema_extra={"examples": ["7"]}) + application_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application this risk belongs to. Absent for global metrics.", alias="applicationId", json_schema_extra={"examples": [7]}) + status: StrictStr = Field(description="The triage lifecycle status of this risk.", json_schema_extra={"examples": ["active"]}) + criticality: StrictStr = Field(description="The critical classification bucket of this risk.", json_schema_extra={"examples": ["critical"]}) + entity: StrictStr = Field(description="The entity type the risk was detected in.", json_schema_extra={"examples": ["customer_profile"]}) + activity: StrictStr = Field(description="The activity metric the risk was detected in.", json_schema_extra={"examples": ["discounted_amount"]}) + time_frame: StrictStr = Field(description="The rolling time window of the risk evaluation.", alias="timeFrame", json_schema_extra={"examples": ["1_week"]}) + reported_date: datetime = Field(description="The time the ML service reported this risk.", alias="reportedDate", json_schema_extra={"examples": ["2026-06-05T06:26:13.698884Z"]}) + affected_entity_count: StrictInt = Field(description="The total number of entities affected by this risk.", alias="affectedEntityCount", json_schema_extra={"examples": [4437]}) + description: Optional[StrictStr] = Field(default=None, description="Human-readable description of the detected anomaly.", json_schema_extra={"examples": ["Unusual discount usage detected for 4437 customer profiles."]}) + modified: datetime = Field(description="Timestamp of the most recent update.", json_schema_extra={"examples": ["2026-06-05T06:26:13.698884Z"]}) + affected_entities: List[RiskAffectedEntityItem] = Field(description="The affected entities with the highest severity ratios, in descending order.", alias="affectedEntities") + __properties: ClassVar[List[str]] = ["id", "created", "notificationId", "runDate", "groupKey", "applicationId", "status", "criticality", "entity", "activity", "timeFrame", "reportedDate", "affectedEntityCount", "description", "modified", "affectedEntities"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['active', 'in_review', 'confirmed', 'discarded']): + raise ValueError("must be one of enum values ('active', 'in_review', 'confirmed', 'discarded')") + return value + + @field_validator('criticality') + def criticality_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['critical', 'not_critical']): + raise ValueError("must be one of enum values ('critical', 'not_critical')") + return value + + @field_validator('entity') + def entity_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['customer_profile', 'customer_session']): + raise ValueError("must be one of enum values ('customer_profile', 'customer_session')") + return value + + @field_validator('activity') + def activity_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['loyalty_points_earned', 'discounted_amount', 'completed_orders', 'coupon_attempts']): + raise ValueError("must be one of enum values ('loyalty_points_earned', 'discounted_amount', 'completed_orders', 'coupon_attempts')") + return value + + @field_validator('time_frame') + def time_frame_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1_day', '1_week', '1_month']): + raise ValueError("must be one of enum values ('1_day', '1_week', '1_month')") + 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 RiskDetail 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 affected_entities (list) + _items = [] + if self.affected_entities: + for _item_affected_entities in self.affected_entities: + if _item_affected_entities: + _items.append(_item_affected_entities.to_dict()) + _dict['affectedEntities'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RiskDetail 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"), + "notificationId": obj.get("notificationId"), + "runDate": obj.get("runDate"), + "groupKey": obj.get("groupKey"), + "applicationId": obj.get("applicationId"), + "status": obj.get("status"), + "criticality": obj.get("criticality"), + "entity": obj.get("entity"), + "activity": obj.get("activity"), + "timeFrame": obj.get("timeFrame"), + "reportedDate": obj.get("reportedDate"), + "affectedEntityCount": obj.get("affectedEntityCount"), + "description": obj.get("description"), + "modified": obj.get("modified"), + "affectedEntities": [RiskAffectedEntityItem.from_dict(_item) for _item in obj["affectedEntities"]] if obj.get("affectedEntities") is not None else None + }) + return _obj + + diff --git a/talon_one/models/rule_v2.py b/talon_one/models/rule_v2.py new file mode 100644 index 0000000..d38b826 --- /dev/null +++ b/talon_one/models/rule_v2.py @@ -0,0 +1,94 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RuleV2(BaseModel): + """ + Shared fields common to all V2 rule types. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the rule.", json_schema_extra={"examples": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}) + parent_id: Optional[StrictStr] = Field(default=None, description="ID of the parent rule, if any.", alias="parentId") + title: StrictStr = Field(description="A short description of the rule.", json_schema_extra={"examples": ["10% off for loyalty members"]}) + description: Optional[StrictStr] = Field(default=None, description="A longer description of the rule.") + __properties: ClassVar[List[str]] = ["id", "parentId", "title", "description"] + + 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 RuleV2 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RuleV2 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"), + "parentId": obj.get("parentId"), + "title": obj.get("title"), + "description": obj.get("description") + }) + return _obj + + diff --git a/talon_one/models/ruleset_v2.py b/talon_one/models/ruleset_v2.py new file mode 100644 index 0000000..4df94dd --- /dev/null +++ b/talon_one/models/ruleset_v2.py @@ -0,0 +1,125 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.promotion_rule_v2 import PromotionRuleV2 +from talon_one.models.strikethrough_rule_v2 import StrikethroughRuleV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RulesetV2(BaseModel): + """ + Ruleset in the V2 JSON block format. + """ # noqa: E501 + id: StrictInt = Field(description="Internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.") + user_id: StrictInt = Field(description="The ID of the user that created this ruleset.", alias="userId", json_schema_extra={"examples": [385]}) + campaign_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign that owns this entity.", alias="campaignId", json_schema_extra={"examples": [320]}) + template_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign template that owns this entity.", alias="templateId", json_schema_extra={"examples": [3]}) + activated_at: Optional[datetime] = Field(default=None, description="Timestamp indicating when this ruleset was activated.", alias="activatedAt") + promotion_rules: List[PromotionRuleV2] = Field(description="Set of promotion rules.", alias="promotionRules") + strikethrough_rules: List[StrikethroughRuleV2] = Field(description="Set of strikethrough rules.", alias="strikethroughRules") + selectors: Optional[List[Dict[str, Any]]] = Field(default=None, description="Variable bindings of type selector.") + bundles: Optional[List[Dict[str, Any]]] = Field(default=None, description="Variable bindings of type bundle.") + parameters: Optional[List[Dict[str, Any]]] = Field(default=None, description="Variable bindings of type template parameter.") + __properties: ClassVar[List[str]] = ["id", "created", "userId", "campaignId", "templateId", "activatedAt", "promotionRules", "strikethroughRules", "selectors", "bundles", "parameters"] + + 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 RulesetV2 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 promotion_rules (list) + _items = [] + if self.promotion_rules: + for _item_promotion_rules in self.promotion_rules: + if _item_promotion_rules: + _items.append(_item_promotion_rules.to_dict()) + _dict['promotionRules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in strikethrough_rules (list) + _items = [] + if self.strikethrough_rules: + for _item_strikethrough_rules in self.strikethrough_rules: + if _item_strikethrough_rules: + _items.append(_item_strikethrough_rules.to_dict()) + _dict['strikethroughRules'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RulesetV2 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"), + "userId": obj.get("userId"), + "campaignId": obj.get("campaignId"), + "templateId": obj.get("templateId"), + "activatedAt": obj.get("activatedAt"), + "promotionRules": [PromotionRuleV2.from_dict(_item) for _item in obj["promotionRules"]] if obj.get("promotionRules") is not None else None, + "strikethroughRules": [StrikethroughRuleV2.from_dict(_item) for _item in obj["strikethroughRules"]] if obj.get("strikethroughRules") is not None else None, + "selectors": obj.get("selectors"), + "bundles": obj.get("bundles"), + "parameters": obj.get("parameters") + }) + return _obj + + diff --git a/talon_one/models/strikethrough_group_block.py b/talon_one/models/strikethrough_group_block.py new file mode 100644 index 0000000..66f36e8 --- /dev/null +++ b/talon_one/models/strikethrough_group_block.py @@ -0,0 +1,107 @@ +# 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 import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class StrikethroughGroupBlock(BaseModel): + """ + StrikethroughGroupBlock + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier for this block.", json_schema_extra={"examples": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}) + type: StrictStr = Field(description="Identifies the block variant and determines which additional properties are present in it.") + tags: Optional[List[StrictStr]] = Field(default=None, description="Semantic labels attached to this block.") + operator: StrictStr = Field(description="Logical operator applied across child blocks. `all` requires every child to pass, `atLeastOne` requires at least one, `none` requires all to fail.") + blocks: List[Any] = Field(description="Child blocks evaluated according to the operator.") + on_failure: Optional[List[Any]] = Field(default=None, description="Strikethrough blocks evaluated when this block fails or returns false.", alias="onFailure") + on_error: Optional[Dict[str, List[Any]]] = Field(default=None, description="Named error handlers evaluated when a specific error occurs.", alias="onError") + __properties: ClassVar[List[str]] = ["id", "type", "tags", "operator", "blocks", "onFailure", "onError"] + + @field_validator('operator') + def operator_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['all', 'atLeastOne', 'none']): + raise ValueError("must be one of enum values ('all', 'atLeastOne', 'none')") + 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 StrikethroughGroupBlock 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of StrikethroughGroupBlock 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"), + "type": obj.get("type"), + "tags": obj.get("tags"), + "operator": obj.get("operator"), + "blocks": obj.get("blocks"), + "onFailure": obj.get("onFailure"), + "onError": obj.get("onError") + }) + return _obj + + diff --git a/talon_one/models/strikethrough_rule_v2.py b/talon_one/models/strikethrough_rule_v2.py new file mode 100644 index 0000000..32941e6 --- /dev/null +++ b/talon_one/models/strikethrough_rule_v2.py @@ -0,0 +1,96 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class StrikethroughRuleV2(BaseModel): + """ + StrikethroughRuleV2 + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the rule.", json_schema_extra={"examples": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}) + parent_id: Optional[StrictStr] = Field(default=None, description="ID of the parent rule, if any.", alias="parentId") + title: StrictStr = Field(description="A short description of the rule.", json_schema_extra={"examples": ["10% off for loyalty members"]}) + description: Optional[StrictStr] = Field(default=None, description="A longer description of the rule.") + blocks: List[Any] = Field(description="The condition and effect blocks that make up this strikethrough rule.") + __properties: ClassVar[List[str]] = ["id", "parentId", "title", "description", "blocks"] + + 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 StrikethroughRuleV2 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of StrikethroughRuleV2 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"), + "parentId": obj.get("parentId"), + "title": obj.get("title"), + "description": obj.get("description"), + "blocks": obj.get("blocks") + }) + return _obj + + diff --git a/talon_one/models/update_reward.py b/talon_one/models/update_reward.py index b7a2245..0adc510 100644 --- a/talon_one/models/update_reward.py +++ b/talon_one/models/update_reward.py @@ -34,11 +34,11 @@ class UpdateReward(BaseModel): name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the reward.", 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."]}) status: StrictStr = Field(description="The status of the reward.", json_schema_extra={"examples": ["active"]}) - visibility_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="visibilityConditions") + 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:** - Objects with an `id` are updated. - Objects without an `id` are created. - Existing objects omitted from the payload are deleted. ", alias="pointsRequired") - __properties: ClassVar[List[str]] = ["name", "description", "status", "visibilityConditions", "rule", "bindings", "pointsRequired"] + __properties: ClassVar[List[str]] = ["name", "description", "status", "eligibilityConditions", "rule", "bindings", "pointsRequired"] @field_validator('status') def status_validate_enum(cls, value): @@ -86,9 +86,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of visibility_conditions - if self.visibility_conditions: - _dict['visibilityConditions'] = self.visibility_conditions.to_dict() + # 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() @@ -121,7 +121,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "description": obj.get("description"), "status": obj.get("status"), - "visibilityConditions": Rule.from_dict(obj["visibilityConditions"]) if obj.get("visibilityConditions") is not None else None, + "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 diff --git a/test/test_base_block.py b/test/test_base_block.py new file mode 100644 index 0000000..4fbdf9f --- /dev/null +++ b/test/test_base_block.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.base_block import BaseBlock + +class TestBaseBlock(unittest.TestCase): + """BaseBlock unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseBlock: + """Test BaseBlock + 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 `BaseBlock` + """ + model = BaseBlock() + if include_optional: + return BaseBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + tags = [ + '' + ] + ) + else: + return BaseBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + ) + """ + + def testBaseBlock(self): + """Test BaseBlock""" + # 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_best_prior_price.py b/test/test_best_prior_price.py index 12ce918..7c8046e 100644 --- a/test/test_best_prior_price.py +++ b/test/test_best_prior_price.py @@ -36,7 +36,7 @@ def make_instance(self, include_optional) -> BestPriorPrice: if include_optional: return BestPriorPrice( id = 1, - sku = 'NVR-GN-GV-UUP', + sku = 'SKU7345278', observed_at = '2025-11-10T23:00:00Z', context_ids = [SpringSale, SummerSale2025], context_id = '', @@ -53,7 +53,7 @@ def make_instance(self, include_optional) -> BestPriorPrice: else: return BestPriorPrice( id = 1, - sku = 'NVR-GN-GV-UUP', + sku = 'SKU7345278', observed_at = '2025-11-10T23:00:00Z', context_ids = [SpringSale, SummerSale2025], price = 99.99, diff --git a/test/test_best_prior_price_request.py b/test/test_best_prior_price_request.py index 4c6b61e..cf882cf 100644 --- a/test/test_best_prior_price_request.py +++ b/test/test_best_prior_price_request.py @@ -35,7 +35,7 @@ def make_instance(self, include_optional) -> BestPriorPriceRequest: model = BestPriorPriceRequest() if include_optional: return BestPriorPriceRequest( - skus = [comma, period], + skus = [SKU1241028, SKU7345278], timeframe_end_date = '2020-11-10T23:00:00Z', timeframe = '30', timeframe_end_date_type = 'sale', @@ -45,7 +45,7 @@ def make_instance(self, include_optional) -> BestPriorPriceRequest: ) else: return BestPriorPriceRequest( - skus = [comma, period], + skus = [SKU1241028, SKU7345278], timeframe_end_date = '2020-11-10T23:00:00Z', timeframe = '30', timeframe_end_date_type = 'sale', diff --git a/test/test_customer_achievement.py b/test/test_customer_achievement.py new file mode 100644 index 0000000..39bd3ec --- /dev/null +++ b/test/test_customer_achievement.py @@ -0,0 +1,74 @@ +# 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.customer_achievement import CustomerAchievement + +class TestCustomerAchievement(unittest.TestCase): + """CustomerAchievement unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CustomerAchievement: + """Test CustomerAchievement + 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 `CustomerAchievement` + """ + model = CustomerAchievement() + if include_optional: + return CustomerAchievement( + id = 3, + name = 'FreeCoffee10Orders', + title = '50% off on 50th purchase.', + description = '50% off for every 50th purchase in a year.', + target = 10, + recurrence_policy = 'no_recurrence', + activation_policy = 'fixed_schedule', + fixed_start_date = '2024-01-15T15:04:05Z07:00', + end_date = '2024-02-15T15:04:05Z07:00', + allow_rollback_after_completion = False, + current_progress = talon_one.models.achievement_progress.AchievementProgress( + status = 'completed', + progress = 10, + start_date = '2024-01-01T15:04:05Z07:00', + completion_date = '2024-01-15T15:04:05Z07:00', + end_date = '2024-02-01T15:04:05Z07:00', ) + ) + else: + return CustomerAchievement( + id = 3, + name = 'FreeCoffee10Orders', + title = '50% off on 50th purchase.', + description = '50% off for every 50th purchase in a year.', + target = 10, + recurrence_policy = 'no_recurrence', + activation_policy = 'fixed_schedule', + allow_rollback_after_completion = False, + ) + """ + + def testCustomerAchievement(self): + """Test CustomerAchievement""" + # 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_integration_api.py b/test/test_integration_api.py index 53a63d3..06b39b7 100644 --- a/test/test_integration_api.py +++ b/test/test_integration_api.py @@ -201,6 +201,13 @@ def test_integration_get_all_campaigns(self) -> None: """ pass + def test_join_loyalty_program(self) -> None: + """Test case for join_loyalty_program + + Join customer profile to loyalty program + """ + pass + def test_link_loyalty_card_to_profile(self) -> None: """Test case for link_loyalty_card_to_profile diff --git a/test/test_integration_campaign.py b/test/test_integration_campaign.py index 3b8be16..1b7b03d 100644 --- a/test/test_integration_campaign.py +++ b/test/test_integration_campaign.py @@ -51,7 +51,9 @@ def make_instance(self, include_optional) -> IntegrationCampaign: display_name = '20% off all shoes!', display_description = 'Get a 20% discount on all shoes during Thanksgiving! Offer valid till Dec 5 only.', related_data = 'https://example.com/discounts/20-off-shoes.png', ) - ] + ], + linked_store_ids = [1, 2], + linked_audience_ids = [3, 4] ) else: return IntegrationCampaign( diff --git a/test/test_integration_event_v2_response.py b/test/test_integration_event_v2_response.py index 08f2d80..e386b2e 100644 --- a/test/test_integration_event_v2_response.py +++ b/test/test_integration_event_v2_response.py @@ -86,6 +86,25 @@ def make_instance(self, include_optional) -> IntegrationEventV2Response: awarded_giveaways = [ null ], + achievements = [ + talon_one.models.customer_achievement.CustomerAchievement( + id = 3, + name = 'FreeCoffee10Orders', + title = '50% off on 50th purchase.', + description = '50% off for every 50th purchase in a year.', + target = 10, + recurrence_policy = 'no_recurrence', + activation_policy = 'fixed_schedule', + fixed_start_date = '2024-01-15T15:04:05Z07:00', + end_date = '2024-02-15T15:04:05Z07:00', + allow_rollback_after_completion = False, + current_progress = talon_one.models.achievement_progress.AchievementProgress( + status = 'completed', + progress = 10, + start_date = '2024-01-01T15:04:05Z07:00', + completion_date = '2024-01-15T15:04:05Z07:00', + end_date = '2024-02-01T15:04:05Z07:00', ), ) + ], event = None ) else: diff --git a/test/test_integration_event_v3_response.py b/test/test_integration_event_v3_response.py index 1b74b33..59494f9 100644 --- a/test/test_integration_event_v3_response.py +++ b/test/test_integration_event_v3_response.py @@ -86,6 +86,25 @@ def make_instance(self, include_optional) -> IntegrationEventV3Response: awarded_giveaways = [ null ], + achievements = [ + talon_one.models.customer_achievement.CustomerAchievement( + id = 3, + name = 'FreeCoffee10Orders', + title = '50% off on 50th purchase.', + description = '50% off for every 50th purchase in a year.', + target = 10, + recurrence_policy = 'no_recurrence', + activation_policy = 'fixed_schedule', + fixed_start_date = '2024-01-15T15:04:05Z07:00', + end_date = '2024-02-15T15:04:05Z07:00', + allow_rollback_after_completion = False, + current_progress = talon_one.models.achievement_progress.AchievementProgress( + status = 'completed', + progress = 10, + start_date = '2024-01-01T15:04:05Z07:00', + completion_date = '2024-01-15T15:04:05Z07:00', + end_date = '2024-02-01T15:04:05Z07:00', ), ) + ], advanced_event = None ) else: diff --git a/test/test_integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py b/test/test_integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py index c6cff7d..a4fcbc1 100644 --- a/test/test_integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py +++ b/test/test_integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py @@ -41,6 +41,7 @@ def make_instance(self, include_optional) -> IntegrationHubEventPayloadLoyaltyPr subledger_id = '', source_of_event = '', current_tier = '', + session_integration_id = '', employee_name = '', user_id = 56, current_points = 1.337, diff --git a/test/test_integration_response.py b/test/test_integration_response.py index 5be3d65..9078881 100644 --- a/test/test_integration_response.py +++ b/test/test_integration_response.py @@ -85,6 +85,25 @@ def make_instance(self, include_optional) -> IntegrationResponse: ], awarded_giveaways = [ null + ], + achievements = [ + talon_one.models.customer_achievement.CustomerAchievement( + id = 3, + name = 'FreeCoffee10Orders', + title = '50% off on 50th purchase.', + description = '50% off for every 50th purchase in a year.', + target = 10, + recurrence_policy = 'no_recurrence', + activation_policy = 'fixed_schedule', + fixed_start_date = '2024-01-15T15:04:05Z07:00', + end_date = '2024-02-15T15:04:05Z07:00', + allow_rollback_after_completion = False, + current_progress = talon_one.models.achievement_progress.AchievementProgress( + status = 'completed', + progress = 10, + start_date = '2024-01-01T15:04:05Z07:00', + completion_date = '2024-01-15T15:04:05Z07:00', + end_date = '2024-02-01T15:04:05Z07:00', ), ) ] ) else: diff --git a/test/test_integration_state_v2.py b/test/test_integration_state_v2.py index 2ee0d7a..c3eeca5 100644 --- a/test/test_integration_state_v2.py +++ b/test/test_integration_state_v2.py @@ -86,6 +86,25 @@ def make_instance(self, include_optional) -> IntegrationStateV2: awarded_giveaways = [ null ], + achievements = [ + talon_one.models.customer_achievement.CustomerAchievement( + id = 3, + name = 'FreeCoffee10Orders', + title = '50% off on 50th purchase.', + description = '50% off for every 50th purchase in a year.', + target = 10, + recurrence_policy = 'no_recurrence', + activation_policy = 'fixed_schedule', + fixed_start_date = '2024-01-15T15:04:05Z07:00', + end_date = '2024-02-15T15:04:05Z07:00', + allow_rollback_after_completion = False, + current_progress = talon_one.models.achievement_progress.AchievementProgress( + status = 'completed', + progress = 10, + start_date = '2024-01-01T15:04:05Z07:00', + completion_date = '2024-01-15T15:04:05Z07:00', + end_date = '2024-02-01T15:04:05Z07:00', ), ) + ], referral = None, coupons = [ null diff --git a/test/test_management_api.py b/test/test_management_api.py index ca12447..a70987c 100644 --- a/test/test_management_api.py +++ b/test/test_management_api.py @@ -859,6 +859,13 @@ def test_get_ruleset(self) -> None: """ pass + def test_get_ruleset_v2(self) -> None: + """Test case for get_ruleset_v2 + + Get ruleset (V2) + """ + pass + def test_get_rulesets(self) -> None: """Test case for get_rulesets diff --git a/test/test_passthrough_block.py b/test/test_passthrough_block.py new file mode 100644 index 0000000..69a0654 --- /dev/null +++ b/test/test_passthrough_block.py @@ -0,0 +1,60 @@ +# 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.passthrough_block import PassthroughBlock + +class TestPassthroughBlock(unittest.TestCase): + """PassthroughBlock unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PassthroughBlock: + """Test PassthroughBlock + 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 `PassthroughBlock` + """ + model = PassthroughBlock() + if include_optional: + return PassthroughBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = 'passthrough', + expression = [ + null + ] + ) + else: + return PassthroughBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = 'passthrough', + expression = [ + null + ], + ) + """ + + def testPassthroughBlock(self): + """Test PassthroughBlock""" + # 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_price_history_request.py b/test/test_price_history_request.py index 927544f..67c08a1 100644 --- a/test/test_price_history_request.py +++ b/test/test_price_history_request.py @@ -35,13 +35,13 @@ def make_instance(self, include_optional) -> PriceHistoryRequest: model = PriceHistoryRequest() if include_optional: return PriceHistoryRequest( - sku = '[sku-124]', + sku = 'SKU1241028', start_date = '2020-11-10T23:00:00Z', end_date = '2020-12-10T23:00:00Z' ) else: return PriceHistoryRequest( - sku = '[sku-124]', + sku = 'SKU1241028', start_date = '2020-11-10T23:00:00Z', end_date = '2020-12-10T23:00:00Z', ) diff --git a/test/test_price_history_response.py b/test/test_price_history_response.py index 91ede9f..5b6df16 100644 --- a/test/test_price_history_response.py +++ b/test/test_price_history_response.py @@ -35,7 +35,7 @@ def make_instance(self, include_optional) -> PriceHistoryResponse: model = PriceHistoryResponse() if include_optional: return PriceHistoryResponse( - sku = '[SKU1241028]', + sku = 'SKU1241028', history = [ talon_one.models.history.History( id = 1, @@ -55,7 +55,7 @@ def make_instance(self, include_optional) -> PriceHistoryResponse: ) else: return PriceHistoryResponse( - sku = '[SKU1241028]', + sku = 'SKU1241028', history = [ talon_one.models.history.History( id = 1, diff --git a/test/test_promotion_group_block.py b/test/test_promotion_group_block.py new file mode 100644 index 0000000..57ac1f2 --- /dev/null +++ b/test/test_promotion_group_block.py @@ -0,0 +1,73 @@ +# 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.promotion_group_block import PromotionGroupBlock + +class TestPromotionGroupBlock(unittest.TestCase): + """PromotionGroupBlock unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PromotionGroupBlock: + """Test PromotionGroupBlock + 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 `PromotionGroupBlock` + """ + model = PromotionGroupBlock() + if include_optional: + return PromotionGroupBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + tags = [ + '' + ], + operator = 'all', + blocks = [ + null + ], + on_failure = [ + null + ], + on_error = { + 'key' : [ + null + ] + } + ) + else: + return PromotionGroupBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + operator = 'all', + blocks = [ + null + ], + ) + """ + + def testPromotionGroupBlock(self): + """Test PromotionGroupBlock""" + # 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_promotion_rule_v2.py b/test/test_promotion_rule_v2.py new file mode 100644 index 0000000..ab20e4b --- /dev/null +++ b/test/test_promotion_rule_v2.py @@ -0,0 +1,61 @@ +# 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.promotion_rule_v2 import PromotionRuleV2 + +class TestPromotionRuleV2(unittest.TestCase): + """PromotionRuleV2 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PromotionRuleV2: + """Test PromotionRuleV2 + 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 `PromotionRuleV2` + """ + model = PromotionRuleV2() + if include_optional: + return PromotionRuleV2( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + parent_id = '', + title = '10% off for loyalty members', + description = '', + blocks = [ + null + ] + ) + else: + return PromotionRuleV2( + title = '10% off for loyalty members', + blocks = [ + null + ], + ) + """ + + def testPromotionRuleV2(self): + """Test PromotionRuleV2""" + # 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.py b/test/test_reward.py index 9f7a990..04b3d0b 100644 --- a/test/test_reward.py +++ b/test/test_reward.py @@ -43,7 +43,7 @@ def make_instance(self, include_optional) -> Reward: description = 'This reward gets you one free coffee.', application_ids = [1, 2, 3], sandbox = True, - visibility_conditions = talon_one.models.rule.Rule( + 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', diff --git a/test/test_risk.py b/test/test_risk.py new file mode 100644 index 0000000..ce71296 --- /dev/null +++ b/test/test_risk.py @@ -0,0 +1,78 @@ +# 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.risk import Risk + +class TestRisk(unittest.TestCase): + """Risk unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Risk: + """Test Risk + 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 `Risk` + """ + model = Risk() + if include_optional: + return Risk( + id = 6, + created = '2020-06-10T09:05:27.993483Z', + notification_id = 3, + run_date = '2026-06-05', + group_key = '7', + application_id = 7, + status = 'active', + criticality = 'critical', + entity = 'customer_profile', + activity = 'discounted_amount', + time_frame = '1_week', + reported_date = '2026-06-05T06:26:13.698884Z', + affected_entity_count = 4437, + description = 'Unusual discount usage detected for 4437 customer profiles.', + modified = '2026-06-05T06:26:13.698884Z' + ) + else: + return Risk( + id = 6, + created = '2020-06-10T09:05:27.993483Z', + notification_id = 3, + run_date = '2026-06-05', + group_key = '7', + status = 'active', + criticality = 'critical', + entity = 'customer_profile', + activity = 'discounted_amount', + time_frame = '1_week', + reported_date = '2026-06-05T06:26:13.698884Z', + affected_entity_count = 4437, + modified = '2026-06-05T06:26:13.698884Z', + ) + """ + + def testRisk(self): + """Test Risk""" + # 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_risk_affected_entity_item.py b/test/test_risk_affected_entity_item.py new file mode 100644 index 0000000..7438f48 --- /dev/null +++ b/test/test_risk_affected_entity_item.py @@ -0,0 +1,60 @@ +# 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.risk_affected_entity_item import RiskAffectedEntityItem + +class TestRiskAffectedEntityItem(unittest.TestCase): + """RiskAffectedEntityItem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RiskAffectedEntityItem: + """Test RiskAffectedEntityItem + 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 `RiskAffectedEntityItem` + """ + model = RiskAffectedEntityItem() + if include_optional: + return RiskAffectedEntityItem( + entity_id = '174165415', + activity_value = 2898.2, + threshold = 60, + severity_ratio = 48.3, + criticality = 'critical' + ) + else: + return RiskAffectedEntityItem( + entity_id = '174165415', + activity_value = 2898.2, + threshold = 60, + severity_ratio = 48.3, + criticality = 'critical', + ) + """ + + def testRiskAffectedEntityItem(self): + """Test RiskAffectedEntityItem""" + # 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_risk_detail.py b/test/test_risk_detail.py new file mode 100644 index 0000000..2fe8b5a --- /dev/null +++ b/test/test_risk_detail.py @@ -0,0 +1,94 @@ +# 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.risk_detail import RiskDetail + +class TestRiskDetail(unittest.TestCase): + """RiskDetail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RiskDetail: + """Test RiskDetail + 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 `RiskDetail` + """ + model = RiskDetail() + if include_optional: + return RiskDetail( + id = 6, + created = '2020-06-10T09:05:27.993483Z', + notification_id = 3, + run_date = '2026-06-05', + group_key = '7', + application_id = 7, + status = 'active', + criticality = 'critical', + entity = 'customer_profile', + activity = 'discounted_amount', + time_frame = '1_week', + reported_date = '2026-06-05T06:26:13.698884Z', + affected_entity_count = 4437, + description = 'Unusual discount usage detected for 4437 customer profiles.', + modified = '2026-06-05T06:26:13.698884Z', + affected_entities = [ + talon_one.models.risk_affected_entity_item.RiskAffectedEntityItem( + entity_id = '174165415', + activity_value = 2898.2, + threshold = 60, + severity_ratio = 48.3, + criticality = 'critical', ) + ] + ) + else: + return RiskDetail( + id = 6, + created = '2020-06-10T09:05:27.993483Z', + notification_id = 3, + run_date = '2026-06-05', + group_key = '7', + status = 'active', + criticality = 'critical', + entity = 'customer_profile', + activity = 'discounted_amount', + time_frame = '1_week', + reported_date = '2026-06-05T06:26:13.698884Z', + affected_entity_count = 4437, + modified = '2026-06-05T06:26:13.698884Z', + affected_entities = [ + talon_one.models.risk_affected_entity_item.RiskAffectedEntityItem( + entity_id = '174165415', + activity_value = 2898.2, + threshold = 60, + severity_ratio = 48.3, + criticality = 'critical', ) + ], + ) + """ + + def testRiskDetail(self): + """Test RiskDetail""" + # 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_rule_v2.py b/test/test_rule_v2.py new file mode 100644 index 0000000..cd751a2 --- /dev/null +++ b/test/test_rule_v2.py @@ -0,0 +1,55 @@ +# 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.rule_v2 import RuleV2 + +class TestRuleV2(unittest.TestCase): + """RuleV2 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RuleV2: + """Test RuleV2 + 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 `RuleV2` + """ + model = RuleV2() + if include_optional: + return RuleV2( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + parent_id = '', + title = '10% off for loyalty members', + description = '' + ) + else: + return RuleV2( + title = '10% off for loyalty members', + ) + """ + + def testRuleV2(self): + """Test RuleV2""" + # 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_ruleset_v2.py b/test/test_ruleset_v2.py new file mode 100644 index 0000000..ea70928 --- /dev/null +++ b/test/test_ruleset_v2.py @@ -0,0 +1,80 @@ +# 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.ruleset_v2 import RulesetV2 + +class TestRulesetV2(unittest.TestCase): + """RulesetV2 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RulesetV2: + """Test RulesetV2 + 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 `RulesetV2` + """ + model = RulesetV2() + if include_optional: + return RulesetV2( + id = 6, + created = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user_id = 385, + campaign_id = 320, + template_id = 3, + activated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + promotion_rules = [ + null + ], + strikethrough_rules = [ + null + ], + selectors = [ + { } + ], + bundles = [ + { } + ], + parameters = [ + { } + ] + ) + else: + return RulesetV2( + id = 6, + created = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user_id = 385, + promotion_rules = [ + null + ], + strikethrough_rules = [ + null + ], + ) + """ + + def testRulesetV2(self): + """Test RulesetV2""" + # 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_strikethrough_group_block.py b/test/test_strikethrough_group_block.py new file mode 100644 index 0000000..c55afbe --- /dev/null +++ b/test/test_strikethrough_group_block.py @@ -0,0 +1,73 @@ +# 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.strikethrough_group_block import StrikethroughGroupBlock + +class TestStrikethroughGroupBlock(unittest.TestCase): + """StrikethroughGroupBlock unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StrikethroughGroupBlock: + """Test StrikethroughGroupBlock + 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 `StrikethroughGroupBlock` + """ + model = StrikethroughGroupBlock() + if include_optional: + return StrikethroughGroupBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + tags = [ + '' + ], + operator = 'all', + blocks = [ + null + ], + on_failure = [ + null + ], + on_error = { + 'key' : [ + null + ] + } + ) + else: + return StrikethroughGroupBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + operator = 'all', + blocks = [ + null + ], + ) + """ + + def testStrikethroughGroupBlock(self): + """Test StrikethroughGroupBlock""" + # 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_strikethrough_rule_v2.py b/test/test_strikethrough_rule_v2.py new file mode 100644 index 0000000..4bf22ed --- /dev/null +++ b/test/test_strikethrough_rule_v2.py @@ -0,0 +1,61 @@ +# 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.strikethrough_rule_v2 import StrikethroughRuleV2 + +class TestStrikethroughRuleV2(unittest.TestCase): + """StrikethroughRuleV2 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StrikethroughRuleV2: + """Test StrikethroughRuleV2 + 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 `StrikethroughRuleV2` + """ + model = StrikethroughRuleV2() + if include_optional: + return StrikethroughRuleV2( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + parent_id = '', + title = '10% off for loyalty members', + description = '', + blocks = [ + null + ] + ) + else: + return StrikethroughRuleV2( + title = '10% off for loyalty members', + blocks = [ + null + ], + ) + """ + + def testStrikethroughRuleV2(self): + """Test StrikethroughRuleV2""" + # 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_update_reward.py b/test/test_update_reward.py index 4ed40ed..96898cd 100644 --- a/test/test_update_reward.py +++ b/test/test_update_reward.py @@ -38,7 +38,7 @@ def make_instance(self, include_optional) -> UpdateReward: name = 'Free Coffee', description = 'This reward gets you one free coffee.', status = 'active', - visibility_conditions = talon_one.models.rule.Rule( + 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',