diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 4be100e..612b9d5 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -164,6 +164,7 @@ docs/CardLedgerTransactionLogEntryIntegrationAPI.md docs/CartItem.md docs/CartItemFilterTemplate.md docs/Catalog.md +docs/CatalogAction.md docs/CatalogActionFilter.md docs/CatalogItem.md docs/CatalogRule.md @@ -243,6 +244,9 @@ docs/EventAttributesEntity.md docs/EventType.md docs/EventV2.md docs/EventV3.md +docs/EventV3Connections.md +docs/EventV3Entity.md +docs/EventV3RequestEntity.md docs/Experiment.md docs/ExperimentCampaignCopy.md docs/ExperimentCopy.md @@ -367,6 +371,7 @@ docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationActio docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md docs/IntegrationHubEventRecord.md +docs/IntegrationHubEventStatusUpdate.md docs/IntegrationHubFlow.md docs/IntegrationHubFlowConfig.md docs/IntegrationHubFlowConfigResponse.md @@ -483,6 +488,7 @@ docs/NewCustomerSession.md docs/NewCustomerSessionV2.md docs/NewEvent.md docs/NewEventType.md +docs/NewEventV3Entity.md docs/NewExperiment.md docs/NewExperimentVariant.md docs/NewExperimentVariantArray.md @@ -578,6 +584,7 @@ docs/RevisionActivation.md docs/RevisionActivationRequest.md docs/RevisionVersion.md docs/Reward.md +docs/RewardPointsRequired.md docs/RiskNotification.md docs/Role.md docs/RoleAssign.md @@ -652,6 +659,8 @@ docs/StrikethroughSetDiscountPerItemMemberEffectProps.md docs/StrikethroughTrigger.md docs/SummarizeCampaignStoreBudget200Response.md docs/SummaryCampaignStoreBudget.md +docs/SupportRequest.md +docs/SupportRequestInput.md docs/TalangAttribute.md docs/TalangAttributeVisibility.md docs/TemplateArgDef.md @@ -709,6 +718,7 @@ docs/UpdateReferralBatch.md docs/UpdateReward.md docs/UpdateRole.md docs/UpdateStore.md +docs/UpdateSupportRequest.md docs/UpdateUser.md docs/User.md docs/UserEntity.md @@ -889,6 +899,7 @@ talon_one/models/card_ledger_transaction_log_entry_integration_api.py talon_one/models/cart_item.py talon_one/models/cart_item_filter_template.py talon_one/models/catalog.py +talon_one/models/catalog_action.py talon_one/models/catalog_action_filter.py talon_one/models/catalog_item.py talon_one/models/catalog_rule.py @@ -968,6 +979,9 @@ talon_one/models/event_attributes_entity.py talon_one/models/event_type.py talon_one/models/event_v2.py talon_one/models/event_v3.py +talon_one/models/event_v3_connections.py +talon_one/models/event_v3_entity.py +talon_one/models/event_v3_request_entity.py talon_one/models/experiment.py talon_one/models/experiment_campaign_copy.py talon_one/models/experiment_copy.py @@ -1091,6 +1105,7 @@ talon_one/models/integration_hub_event_payload_loyalty_profile_based_points_chan talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py talon_one/models/integration_hub_event_record.py +talon_one/models/integration_hub_event_status_update.py talon_one/models/integration_hub_flow.py talon_one/models/integration_hub_flow_config.py talon_one/models/integration_hub_flow_config_response.py @@ -1206,6 +1221,7 @@ talon_one/models/new_customer_session.py talon_one/models/new_customer_session_v2.py talon_one/models/new_event.py talon_one/models/new_event_type.py +talon_one/models/new_event_v3_entity.py talon_one/models/new_experiment.py talon_one/models/new_experiment_variant.py talon_one/models/new_experiment_variant_array.py @@ -1301,6 +1317,7 @@ talon_one/models/revision_activation.py talon_one/models/revision_activation_request.py talon_one/models/revision_version.py talon_one/models/reward.py +talon_one/models/reward_points_required.py talon_one/models/risk_notification.py talon_one/models/role.py talon_one/models/role_assign.py @@ -1375,6 +1392,8 @@ talon_one/models/strikethrough_set_discount_per_item_member_effect_props.py talon_one/models/strikethrough_trigger.py talon_one/models/summarize_campaign_store_budget200_response.py talon_one/models/summary_campaign_store_budget.py +talon_one/models/support_request.py +talon_one/models/support_request_input.py talon_one/models/talang_attribute.py talon_one/models/talang_attribute_visibility.py talon_one/models/template_arg_def.py @@ -1432,6 +1451,7 @@ talon_one/models/update_referral_batch.py talon_one/models/update_reward.py talon_one/models/update_role.py talon_one/models/update_store.py +talon_one/models/update_support_request.py talon_one/models/update_user.py talon_one/models/user.py talon_one/models/user_entity.py @@ -1601,6 +1621,7 @@ test/test_card_ledger_transaction_log_entry_integration_api.py test/test_cart_item.py test/test_cart_item_filter_template.py test/test_catalog.py +test/test_catalog_action.py test/test_catalog_action_filter.py test/test_catalog_item.py test/test_catalog_rule.py @@ -1680,6 +1701,9 @@ test/test_event_attributes_entity.py test/test_event_type.py test/test_event_v2.py test/test_event_v3.py +test/test_event_v3_connections.py +test/test_event_v3_entity.py +test/test_event_v3_request_entity.py test/test_experiment.py test/test_experiment_campaign_copy.py test/test_experiment_copy.py @@ -1804,6 +1828,7 @@ test/test_integration_hub_event_payload_loyalty_profile_based_points_changed_not test/test_integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py test/test_integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py test/test_integration_hub_event_record.py +test/test_integration_hub_event_status_update.py test/test_integration_hub_flow.py test/test_integration_hub_flow_config.py test/test_integration_hub_flow_config_response.py @@ -1920,6 +1945,7 @@ test/test_new_customer_session.py test/test_new_customer_session_v2.py test/test_new_event.py test/test_new_event_type.py +test/test_new_event_v3_entity.py test/test_new_experiment.py test/test_new_experiment_variant.py test/test_new_experiment_variant_array.py @@ -2015,6 +2041,7 @@ test/test_revision_activation.py test/test_revision_activation_request.py test/test_revision_version.py test/test_reward.py +test/test_reward_points_required.py test/test_risk_notification.py test/test_role.py test/test_role_assign.py @@ -2089,6 +2116,8 @@ test/test_strikethrough_set_discount_per_item_member_effect_props.py test/test_strikethrough_trigger.py test/test_summarize_campaign_store_budget200_response.py test/test_summary_campaign_store_budget.py +test/test_support_request.py +test/test_support_request_input.py test/test_talang_attribute.py test/test_talang_attribute_visibility.py test/test_template_arg_def.py @@ -2146,6 +2175,7 @@ test/test_update_referral_batch.py test/test_update_reward.py test/test_update_role.py test/test_update_store.py +test/test_update_support_request.py test/test_update_user.py test/test_user.py test/test_user_entity.py diff --git a/README.md b/README.md index 1b58312..e8aaf4c 100644 --- a/README.md +++ b/README.md @@ -533,6 +533,7 @@ Class | Method | HTTP request | Description - [CartItem](docs/CartItem.md) - [CartItemFilterTemplate](docs/CartItemFilterTemplate.md) - [Catalog](docs/Catalog.md) +- [CatalogAction](docs/CatalogAction.md) - [CatalogActionFilter](docs/CatalogActionFilter.md) - [CatalogItem](docs/CatalogItem.md) - [CatalogRule](docs/CatalogRule.md) @@ -612,6 +613,9 @@ Class | Method | HTTP request | Description - [EventType](docs/EventType.md) - [EventV2](docs/EventV2.md) - [EventV3](docs/EventV3.md) +- [EventV3Connections](docs/EventV3Connections.md) +- [EventV3Entity](docs/EventV3Entity.md) +- [EventV3RequestEntity](docs/EventV3RequestEntity.md) - [Experiment](docs/Experiment.md) - [ExperimentCampaignCopy](docs/ExperimentCampaignCopy.md) - [ExperimentCopy](docs/ExperimentCopy.md) @@ -735,6 +739,7 @@ Class | Method | HTTP request | Description - [IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification](docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md) - [IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification](docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md) - [IntegrationHubEventRecord](docs/IntegrationHubEventRecord.md) +- [IntegrationHubEventStatusUpdate](docs/IntegrationHubEventStatusUpdate.md) - [IntegrationHubFlow](docs/IntegrationHubFlow.md) - [IntegrationHubFlowConfig](docs/IntegrationHubFlowConfig.md) - [IntegrationHubFlowConfigResponse](docs/IntegrationHubFlowConfigResponse.md) @@ -850,6 +855,7 @@ Class | Method | HTTP request | Description - [NewCustomerSessionV2](docs/NewCustomerSessionV2.md) - [NewEvent](docs/NewEvent.md) - [NewEventType](docs/NewEventType.md) +- [NewEventV3Entity](docs/NewEventV3Entity.md) - [NewExperiment](docs/NewExperiment.md) - [NewExperimentVariant](docs/NewExperimentVariant.md) - [NewExperimentVariantArray](docs/NewExperimentVariantArray.md) @@ -945,6 +951,7 @@ Class | Method | HTTP request | Description - [RevisionActivationRequest](docs/RevisionActivationRequest.md) - [RevisionVersion](docs/RevisionVersion.md) - [Reward](docs/Reward.md) +- [RewardPointsRequired](docs/RewardPointsRequired.md) - [RiskNotification](docs/RiskNotification.md) - [Role](docs/Role.md) - [RoleAssign](docs/RoleAssign.md) @@ -1019,6 +1026,8 @@ Class | Method | HTTP request | Description - [StrikethroughTrigger](docs/StrikethroughTrigger.md) - [SummarizeCampaignStoreBudget200Response](docs/SummarizeCampaignStoreBudget200Response.md) - [SummaryCampaignStoreBudget](docs/SummaryCampaignStoreBudget.md) +- [SupportRequest](docs/SupportRequest.md) +- [SupportRequestInput](docs/SupportRequestInput.md) - [TalangAttribute](docs/TalangAttribute.md) - [TalangAttributeVisibility](docs/TalangAttributeVisibility.md) - [TemplateArgDef](docs/TemplateArgDef.md) @@ -1076,6 +1085,7 @@ Class | Method | HTTP request | Description - [UpdateReward](docs/UpdateReward.md) - [UpdateRole](docs/UpdateRole.md) - [UpdateStore](docs/UpdateStore.md) +- [UpdateSupportRequest](docs/UpdateSupportRequest.md) - [UpdateUser](docs/UpdateUser.md) - [User](docs/User.md) - [UserEntity](docs/UserEntity.md) diff --git a/docs/AchievementBaseV2.md b/docs/AchievementBaseV2.md index 870cc05..bb0da22 100644 --- a/docs/AchievementBaseV2.md +++ b/docs/AchievementBaseV2.md @@ -15,9 +15,7 @@ Name | Type | Description | Notes **fixed_start_date** | **datetime** | The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be 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 must be an RFC3339 timestamp string. | [optional] **allow_rollback_after_completion** | **bool** | When `true`, customer progress can be rolled back in completed achievements. | [optional] -**sandbox** | **bool** | Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. | [optional] **subscribed_applications** | **List[int]** | A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement. | [optional] -**timezone** | **str** | A string containing an IANA timezone descriptor. | [optional] ## Example diff --git a/docs/AchievementV2.md b/docs/AchievementV2.md index 51f7abe..c07ace2 100644 --- a/docs/AchievementV2.md +++ b/docs/AchievementV2.md @@ -17,13 +17,13 @@ Name | Type | Description | Notes **fixed_start_date** | **datetime** | The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be 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 must be an RFC3339 timestamp string. | [optional] **allow_rollback_after_completion** | **bool** | When `true`, customer progress can be rolled back in completed achievements. | [optional] -**sandbox** | **bool** | Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. | **subscribed_applications** | **List[int]** | A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement. | -**timezone** | **str** | A string containing an IANA timezone descriptor. | **user_id** | **int** | The ID of the user that created this achievement. | **created_by** | **str** | Name of the user that created the achievement. **Note**: This is not available if the user has been deleted. | [optional] **has_progress** | **bool** | Indicates if a customer has made progress in the achievement. | [optional] **status** | **str** | The status of the achievement. | [optional] +**sandbox** | **bool** | Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. | +**timezone** | **str** | A string containing an IANA timezone descriptor. | ## Example diff --git a/docs/ApplicationEvent.md b/docs/ApplicationEvent.md index cdb4132..fddec51 100644 --- a/docs/ApplicationEvent.md +++ b/docs/ApplicationEvent.md @@ -11,8 +11,9 @@ Name | Type | Description | Notes **profile_id** | **int** | The globally unique Talon.One ID of the customer that created this entity. | [optional] **store_id** | **int** | The ID of the store. | [optional] **store_integration_id** | **str** | The integration ID of the store. You choose this ID when you create a store. | [optional] +**integration_id** | **str** | The unique ID of the event. Only one event with this ID can be registered. | [optional] **session_id** | **int** | The globally unique Talon.One ID of the session that contains this event. | [optional] -**type** | **str** | A string representing the event. Must not be a reserved event name. | +**type** | **str** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | **attributes** | **object** | Additional JSON serialized data associated with the event. | **effects** | [**List[Effect]**](Effect.md) | An array containing the effects that were applied as a result of this event. | **rule_failure_reasons** | [**List[RuleFailureReason]**](RuleFailureReason.md) | An array containing the rule failure reasons which happened during this event. | [optional] diff --git a/docs/BestPriorPrice.md b/docs/BestPriorPrice.md index 3ca8dab..2d5318e 100644 --- a/docs/BestPriorPrice.md +++ b/docs/BestPriorPrice.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **id** | **int** | The ID of the historical price. | **sku** | **str** | sku | **observed_at** | **datetime** | The date and time when the price was observed. | -**context_id** | **str** | The context ID of the context active at the time of observation. | +**context_ids** | **List[str]** | 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. | +**context_id** | **str** | This property is **deprecated**. Use `contextIds` instead. Defaults to an empty string. | [optional] [default to ''] **price** | **float** | Price of the item. | **metadata** | [**BestPriorPriceMetadata**](BestPriorPriceMetadata.md) | | **target** | **object** | | diff --git a/docs/CatalogAction.md b/docs/CatalogAction.md new file mode 100644 index 0000000..aa1cf4b --- /dev/null +++ b/docs/CatalogAction.md @@ -0,0 +1,31 @@ +# CatalogAction + +Definition of all the properties that are needed for a single catalog sync action. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | The type of sync action. | +**payload** | **object** | | + +## Example + +```python +from talon_one.models.catalog_action import CatalogAction + +# TODO update the JSON string below +json = "{}" +# create an instance of CatalogAction from a JSON string +catalog_action_instance = CatalogAction.from_json(json) +# print the JSON string representation of the object +print(CatalogAction.to_json()) + +# convert the object into a dict +catalog_action_dict = catalog_action_instance.to_dict() +# create an instance of CatalogAction from a dict +catalog_action_from_dict = CatalogAction.from_dict(catalog_action_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/CatalogSyncRequest.md b/docs/CatalogSyncRequest.md index ff9bd6d..114b2f1 100644 --- a/docs/CatalogSyncRequest.md +++ b/docs/CatalogSyncRequest.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**actions** | **List[object]** | | +**actions** | [**List[CatalogAction]**](CatalogAction.md) | | **version** | **int** | The version number of the catalog to apply the actions on. | [optional] ## Example diff --git a/docs/CreateAchievementV2.md b/docs/CreateAchievementV2.md index 91c8ab3..7e50549 100644 --- a/docs/CreateAchievementV2.md +++ b/docs/CreateAchievementV2.md @@ -15,8 +15,8 @@ Name | Type | Description | Notes **fixed_start_date** | **datetime** | The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be 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 must be an RFC3339 timestamp string. | [optional] **allow_rollback_after_completion** | **bool** | When `true`, customer progress can be rolled back in completed achievements. | [optional] -**sandbox** | **bool** | Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. | **subscribed_applications** | **List[int]** | A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement. | [optional] +**sandbox** | **bool** | Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. | **timezone** | **str** | A string containing an IANA timezone descriptor. | ## Example diff --git a/docs/CustomerSessionV2.md b/docs/CustomerSessionV2.md index 3cd3fc9..7acbf66 100644 --- a/docs/CustomerSessionV2.md +++ b/docs/CustomerSessionV2.md @@ -26,6 +26,7 @@ Name | Type | Description | Notes **total** | **float** | The total value of cart items and additional costs in the session, before any discounts are applied. | **cart_item_total** | **float** | The total value of cart items, before any discounts are applied. | **additional_cost_total** | **float** | The total value of additional costs, before any discounts are applied. | +**cart_item_additional_cost_total** | **float** | The total value of additional costs applied to individual items, before any discounts are applied. | [readonly] **updated** | **datetime** | Timestamp of the most recent event received on this session. | ## Example diff --git a/docs/Event.md b/docs/Event.md index da1bf39..a93c1df 100644 --- a/docs/Event.md +++ b/docs/Event.md @@ -10,8 +10,9 @@ Name | Type | Description | Notes **application_id** | **int** | The ID of the Application that owns this entity. | **profile_id** | **str** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | [optional] **store_integration_id** | **str** | The integration ID of the store. You choose this ID when you create a store. | [optional] -**type** | **str** | A string representing the event. Must not be a reserved event name. | +**type** | **str** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | **attributes** | **object** | Arbitrary additional JSON data associated with the event. | +**integration_id** | **str** | The unique ID of the event. Only one event with this ID can be registered. | [optional] **session_id** | **str** | The ID of the session that this event occurred in. | [optional] **effects** | **List[object]** | An array of effects generated by the rules of the enabled campaigns of the Application. You decide how to apply them in your system. See the list of [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects). | **ledger_entries** | [**List[LedgerEntry]**](LedgerEntry.md) | Ledger entries for the event. | [optional] diff --git a/docs/EventAttributesEntity.md b/docs/EventAttributesEntity.md index 35a7317..2d8fe07 100644 --- a/docs/EventAttributesEntity.md +++ b/docs/EventAttributesEntity.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **str** | A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. | +**type** | **str** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | **attributes** | **object** | Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute). | [optional] ## Example diff --git a/docs/EventV2.md b/docs/EventV2.md index 0a19ded..ad1c8dd 100644 --- a/docs/EventV2.md +++ b/docs/EventV2.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **profile_id** | **str** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | [optional] **store_integration_id** | **str** | The integration ID of the store. You choose this ID when you create a store. | [optional] **evaluable_campaign_ids** | **List[int]** | When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. | [optional] -**type** | **str** | A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. | +**type** | **str** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | **attributes** | **object** | Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute). | [optional] ## Example diff --git a/docs/EventV3.md b/docs/EventV3.md index 523cce7..8ba02d0 100644 --- a/docs/EventV3.md +++ b/docs/EventV3.md @@ -5,14 +5,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**profile_id** | **str** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | +**connected_session_id** | **str** | The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail. | [optional] +**id** | **int** | The internal ID of this entity. | +**created** | **datetime** | The time this entity was created. | +**application_id** | **int** | The ID of the Application that owns this entity. | +**profile_id** | **str** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | [optional] **store_integration_id** | **str** | The integration ID of the store. You choose this ID when you create a store. | [optional] -**evaluable_campaign_ids** | **List[int]** | When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. | [optional] -**integration_id** | **str** | The unique ID of the current event. Only one event with this ID could be activated, duplicated events are forbidden. | -**type** | **str** | A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. | -**attributes** | **object** | Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute). | [optional] -**connected_session_id** | **str** | The ID of the session that happened in the past. | [optional] -**previous_event_id** | **str** | The unique identifier of the event that happened in the past. | [optional] +**type** | **str** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | +**attributes** | **object** | Arbitrary additional JSON data associated with the event. | +**integration_id** | **str** | The unique ID of the event. Only one event with this ID can be registered. | [optional] +**effects** | **List[object]** | An array of effects generated by the rules of the enabled campaigns of the Application. You decide how to apply them in your system. See the list of [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects). | ## Example diff --git a/docs/EventV3Connections.md b/docs/EventV3Connections.md new file mode 100644 index 0000000..cd0a72f --- /dev/null +++ b/docs/EventV3Connections.md @@ -0,0 +1,29 @@ +# EventV3Connections + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**connected_session_id** | **str** | The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail. | [optional] + +## Example + +```python +from talon_one.models.event_v3_connections import EventV3Connections + +# TODO update the JSON string below +json = "{}" +# create an instance of EventV3Connections from a JSON string +event_v3_connections_instance = EventV3Connections.from_json(json) +# print the JSON string representation of the object +print(EventV3Connections.to_json()) + +# convert the object into a dict +event_v3_connections_dict = event_v3_connections_instance.to_dict() +# create an instance of EventV3Connections from a dict +event_v3_connections_from_dict = EventV3Connections.from_dict(event_v3_connections_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/EventV3Entity.md b/docs/EventV3Entity.md new file mode 100644 index 0000000..b5f3fc6 --- /dev/null +++ b/docs/EventV3Entity.md @@ -0,0 +1,29 @@ +# EventV3Entity + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integration_id** | **str** | The unique ID of the event. Only one event with this ID can be registered. | [optional] + +## Example + +```python +from talon_one.models.event_v3_entity import EventV3Entity + +# TODO update the JSON string below +json = "{}" +# create an instance of EventV3Entity from a JSON string +event_v3_entity_instance = EventV3Entity.from_json(json) +# print the JSON string representation of the object +print(EventV3Entity.to_json()) + +# convert the object into a dict +event_v3_entity_dict = event_v3_entity_instance.to_dict() +# create an instance of EventV3Entity from a dict +event_v3_entity_from_dict = EventV3Entity.from_dict(event_v3_entity_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/EventV3RequestEntity.md b/docs/EventV3RequestEntity.md new file mode 100644 index 0000000..b09463c --- /dev/null +++ b/docs/EventV3RequestEntity.md @@ -0,0 +1,35 @@ +# EventV3RequestEntity + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**profile_id** | **str** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | +**store_integration_id** | **str** | The integration ID of the store. You choose this ID when you create a store. | [optional] +**evaluable_campaign_ids** | **List[int]** | When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. | [optional] +**type** | **str** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | +**attributes** | **object** | Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute). | [optional] +**integration_id** | **str** | The unique ID of the event. Only one event with this ID can be registered. | +**connected_session_id** | **str** | The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail. | [optional] + +## Example + +```python +from talon_one.models.event_v3_request_entity import EventV3RequestEntity + +# TODO update the JSON string below +json = "{}" +# create an instance of EventV3RequestEntity from a JSON string +event_v3_request_entity_instance = EventV3RequestEntity.from_json(json) +# print the JSON string representation of the object +print(EventV3RequestEntity.to_json()) + +# convert the object into a dict +event_v3_request_entity_dict = event_v3_request_entity_instance.to_dict() +# create an instance of EventV3RequestEntity from a dict +event_v3_request_entity_from_dict = EventV3RequestEntity.from_dict(event_v3_request_entity_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/ExperimentCopyExperiment.md b/docs/ExperimentCopyExperiment.md index bad1b8a..9300501 100644 --- a/docs/ExperimentCopyExperiment.md +++ b/docs/ExperimentCopyExperiment.md @@ -7,6 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **is_variant_assignment_external** | **bool** | The source of the assignment. - false - The variant assignment is handled internally by Talon.One. - true - The variant assignment is handled externally. | **campaign** | [**ExperimentCampaignCopy**](ExperimentCampaignCopy.md) | | +**goal_type** | **str** | The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. If omitted, the value from the source experiment is used. | [optional] +**goal_description** | **str** | A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. If omitted, the value from the source experiment is used. | [optional] ## Example diff --git a/docs/History.md b/docs/History.md index 0d1d1c5..aaf55ef 100644 --- a/docs/History.md +++ b/docs/History.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | The ID of the historical price. | **observed_at** | **datetime** | The date and time when the price was observed. | -**context_id** | **str** | Identifier of the relevant context at the time the price was observed (e.g. summer sale). | +**context_ids** | **List[str]** | 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. | +**context_id** | **str** | This property is **deprecated**. Use `contextIds` instead. Defaults to an empty string. | [optional] [default to ''] **price** | **float** | Price of the item. | **metadata** | [**BestPriorPriceMetadata**](BestPriorPriceMetadata.md) | | **target** | **object** | | diff --git a/docs/IntegrationApi.md b/docs/IntegrationApi.md index 64badb7..877bfaf 100644 --- a/docs/IntegrationApi.md +++ b/docs/IntegrationApi.md @@ -2993,21 +2993,15 @@ Triggers a custom event. To use this endpoint: -1. Define a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) +1. [Create a custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. -1. Update or create a rule to check for this event. -1. Trigger the event with this endpoint. After you have successfully sent an -event to Talon.One, you can list the received events in the **Events** view -in the Campaign Manager. - -Talon.One also offers a set of [built-in -events](https://docs.talon.one/docs/dev/concepts/entities/events). Ensure -you do not create a custom event when you can use a built-in event. +1. In a rule, add the **Check for event types** [condition](https://docs.talon.one/docs/dev/concepts/entities/events#use-an-event-in-a-rule) and select the event you created. +1. Trigger the event with this endpoint. -For example, use this endpoint to trigger an event when a customer shares a -link to a product. +You can [list](https://docs.talon.one/docs/product/applications/display-events#list-events) the received events in the **Events** view of the Campaign Manager. -See the [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). +For example, you can use this endpoint to trigger an event when a customer shares a +link to a product. See our [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. diff --git a/docs/IntegrationEvent.md b/docs/IntegrationEvent.md index e1a8322..414667a 100644 --- a/docs/IntegrationEvent.md +++ b/docs/IntegrationEvent.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **profile_id** | **str** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | [optional] **store_integration_id** | **str** | The integration ID of the store. You choose this ID when you create a store. | [optional] -**type** | **str** | A string representing the event. Must not be a reserved event name. | +**type** | **str** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | **attributes** | **object** | Arbitrary additional JSON data associated with the event. | ## Example diff --git a/docs/IntegrationEventV2Request.md b/docs/IntegrationEventV2Request.md index f7be1fb..973e233 100644 --- a/docs/IntegrationEventV2Request.md +++ b/docs/IntegrationEventV2Request.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **profile_id** | **str** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | [optional] **store_integration_id** | **str** | The integration ID of the store. You choose this ID when you create a store. | [optional] **evaluable_campaign_ids** | **List[int]** | When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. | [optional] -**type** | **str** | A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. | +**type** | **str** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | **attributes** | **object** | Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute). | [optional] **response_content** | **List[str]** | Extends the response with the chosen data entities. Use this property to get as much data back as needed from one request instead of sending extra requests to other endpoints. | [optional] **loyalty_cards** | **List[str]** | Identifiers of the loyalty cards used during this event. | [optional] diff --git a/docs/IntegrationEventV3Request.md b/docs/IntegrationEventV3Request.md index f53f366..6a07da3 100644 --- a/docs/IntegrationEventV3Request.md +++ b/docs/IntegrationEventV3Request.md @@ -8,11 +8,10 @@ Name | Type | Description | Notes **profile_id** | **str** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | **store_integration_id** | **str** | The integration ID of the store. You choose this ID when you create a store. | [optional] **evaluable_campaign_ids** | **List[int]** | When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. | [optional] -**integration_id** | **str** | The unique ID of the current event. Only one event with this ID could be activated, duplicated events are forbidden. | -**type** | **str** | A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. | +**type** | **str** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | **attributes** | **object** | Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute). | [optional] -**connected_session_id** | **str** | The ID of the session that happened in the past. | [optional] -**previous_event_id** | **str** | The unique identifier of the event that happened in the past. | [optional] +**integration_id** | **str** | The unique ID of the event. Only one event with this ID can be registered. | +**connected_session_id** | **str** | The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail. | [optional] **loyalty_cards** | **List[str]** | Identifiers of the loyalty cards used during this event. | [optional] **response_content** | **List[str]** | Optional list of requested information to be present on the response related to the tracking custom event. | [optional] diff --git a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md index 4952da1..637fd3e 100644 --- a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md +++ b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md @@ -7,14 +7,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **profile_integration_id** | **str** | | **loyalty_program_id** | **int** | | +**loyalty_program_name** | **str** | The name of the loyalty program. | **subledger_id** | **str** | | **source_of_event** | **str** | | +**current_tier** | **str** | The name of the customer's current tier. | **employee_name** | **str** | | [optional] **user_id** | **int** | | [optional] **current_points** | **float** | | **actions** | [**List[IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction]**](IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md) | | [optional] **published_at** | **datetime** | Timestamp when the event was published. | -**current_tier** | **str** | | [optional] **old_tier** | **str** | | [optional] **tier_expiration_date** | **datetime** | | [optional] **timestamp_of_tier_change** | **datetime** | | [optional] diff --git a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md index 5e38de1..034d2e9 100644 --- a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md +++ b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md @@ -7,8 +7,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **profile_integration_id** | **str** | | **loyalty_program_id** | **int** | | +**loyalty_program_name** | **str** | The name of the loyalty program. | **subledger_id** | **str** | | **source_of_event** | **str** | | +**current_tier** | **str** | The name of the customer's current tier. | **employee_name** | **str** | | [optional] **user_id** | **int** | | [optional] **current_points** | **float** | | diff --git a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md index 3a4ed30..4da1663 100644 --- a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md +++ b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md @@ -7,9 +7,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **profile_integration_id** | **str** | | **loyalty_program_id** | **int** | | +**loyalty_program_name** | **str** | The name of the loyalty program. | **subledger_id** | **str** | | **source_of_event** | **str** | | -**current_tier** | **str** | | [optional] +**current_tier** | **str** | The name of the customer's current tier, or null if the customer was downgraded below all tiers. | [optional] **current_points** | **float** | | **old_tier** | **str** | | [optional] **tier_expiration_date** | **datetime** | | [optional] diff --git a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md index 3ed9122..ccdc45b 100644 --- a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md +++ b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md @@ -7,9 +7,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **profile_integration_id** | **str** | | **loyalty_program_id** | **int** | | +**loyalty_program_name** | **str** | The name of the loyalty program. | **subledger_id** | **str** | | **source_of_event** | **str** | | -**current_tier** | **str** | | [optional] +**current_tier** | **str** | The name of the customer's current tier. | **current_points** | **float** | | **old_tier** | **str** | | [optional] **points_required_to_the_next_tier** | **float** | | [optional] diff --git a/docs/IntegrationHubEventRecord.md b/docs/IntegrationHubEventRecord.md index 4b89d1b..4d9ca9b 100644 --- a/docs/IntegrationHubEventRecord.md +++ b/docs/IntegrationHubEventRecord.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **event_data** | **object** | | **published_at** | **datetime** | | **processed_at** | **datetime** | | [optional] +**delivered_at** | **datetime** | | [optional] **process_after** | **datetime** | | **retry** | **int** | | diff --git a/docs/IntegrationHubEventStatusUpdate.md b/docs/IntegrationHubEventStatusUpdate.md new file mode 100644 index 0000000..8313a55 --- /dev/null +++ b/docs/IntegrationHubEventStatusUpdate.md @@ -0,0 +1,30 @@ +# IntegrationHubEventStatusUpdate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**event_id** | **int** | The ID of the integration hub event. | +**status** | **str** | The delivery outcome for the event. | + +## Example + +```python +from talon_one.models.integration_hub_event_status_update import IntegrationHubEventStatusUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of IntegrationHubEventStatusUpdate from a JSON string +integration_hub_event_status_update_instance = IntegrationHubEventStatusUpdate.from_json(json) +# print the JSON string representation of the object +print(IntegrationHubEventStatusUpdate.to_json()) + +# convert the object into a dict +integration_hub_event_status_update_dict = integration_hub_event_status_update_instance.to_dict() +# create an instance of IntegrationHubEventStatusUpdate from a dict +integration_hub_event_status_update_from_dict = IntegrationHubEventStatusUpdate.from_dict(integration_hub_event_status_update_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/ManagementApi.md b/docs/ManagementApi.md index b073db3..3661e59 100644 --- a/docs/ManagementApi.md +++ b/docs/ManagementApi.md @@ -12139,7 +12139,7 @@ which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). -> [!note] We recommend limiting your file size to 500MB. +> [!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds. ## Example @@ -12245,7 +12245,7 @@ the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. -- `expirydate`: The expiration date of the tier when the tier is +- `expirydate`: The expiry date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: @@ -12253,9 +12253,11 @@ About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, -only the expiration date is updated. +only the expiry date is updated. -> [!note] We recommend not using this endpoint to update the tier of a customer. +> [!note] We recommend importing customers into the tier that matches their +> current balance. If a customer is imported into a lower tier, any session +> or points update automatically upgrades them to the tier they qualify for. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or diff --git a/docs/NewEvent.md b/docs/NewEvent.md index 582c852..09189f9 100644 --- a/docs/NewEvent.md +++ b/docs/NewEvent.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **profile_id** | **str** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | [optional] **store_integration_id** | **str** | The integration ID of the store. You choose this ID when you create a store. | [optional] -**type** | **str** | A string representing the event. Must not be a reserved event name. | +**type** | **str** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | **attributes** | **object** | Arbitrary additional JSON data associated with the event. | **session_id** | **str** | The ID of the session that this event occurred in. | diff --git a/docs/NewEventV3Entity.md b/docs/NewEventV3Entity.md new file mode 100644 index 0000000..bb236b2 --- /dev/null +++ b/docs/NewEventV3Entity.md @@ -0,0 +1,29 @@ +# NewEventV3Entity + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integration_id** | **str** | The unique ID of the event. Only one event with this ID can be registered. | + +## Example + +```python +from talon_one.models.new_event_v3_entity import NewEventV3Entity + +# TODO update the JSON string below +json = "{}" +# create an instance of NewEventV3Entity from a JSON string +new_event_v3_entity_instance = NewEventV3Entity.from_json(json) +# print the JSON string representation of the object +print(NewEventV3Entity.to_json()) + +# convert the object into a dict +new_event_v3_entity_dict = new_event_v3_entity_instance.to_dict() +# create an instance of NewEventV3Entity from a dict +new_event_v3_entity_from_dict = NewEventV3Entity.from_dict(new_event_v3_entity_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/NewExperiment.md b/docs/NewExperiment.md index ea5e2bc..cba7a86 100644 --- a/docs/NewExperiment.md +++ b/docs/NewExperiment.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **is_variant_assignment_external** | **bool** | The source of the assignment. - false - The variant assignment is handled internally by Talon.One. - true - The variant assignment is handled externally. | **campaign** | [**NewCampaign**](NewCampaign.md) | | -**goal_type** | **str** | The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. | +**goal_type** | **str** | The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. | [default to 'other'] **goal_description** | **str** | A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. | [optional] ## Example diff --git a/docs/Reward.md b/docs/Reward.md index 309c920..97b7f78 100644 --- a/docs/Reward.md +++ b/docs/Reward.md @@ -18,6 +18,7 @@ Name | Type | Description | Notes **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] **status** | **str** | The status of the reward. | +**points_required** | [**List[RewardPointsRequired]**](RewardPointsRequired.md) | The loyalty points required to activate a reward. | [optional] ## Example diff --git a/docs/RewardPointsRequired.md b/docs/RewardPointsRequired.md new file mode 100644 index 0000000..8a97ed2 --- /dev/null +++ b/docs/RewardPointsRequired.md @@ -0,0 +1,33 @@ +# RewardPointsRequired + +The loyalty points required to activate a reward. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the `pointsRequired` entry. When updating a reward, include this property to update an existing entry. Omit it to create a new one. | [optional] +**amount** | **float** | The number of loyalty points required to activate the reward. | +**loyalty_program_id** | **int** | The ID of the associated loyalty program. | +**subledger_id** | **str** | The ID of the subledger within the loyalty program from which points are deducted when activating the reward. To specify the main ledger, provide an empty string (\"\"). | + +## Example + +```python +from talon_one.models.reward_points_required import RewardPointsRequired + +# TODO update the JSON string below +json = "{}" +# create an instance of RewardPointsRequired from a JSON string +reward_points_required_instance = RewardPointsRequired.from_json(json) +# print the JSON string representation of the object +print(RewardPointsRequired.to_json()) + +# convert the object into a dict +reward_points_required_dict = reward_points_required_instance.to_dict() +# create an instance of RewardPointsRequired from a dict +reward_points_required_from_dict = RewardPointsRequired.from_dict(reward_points_required_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/SupportRequest.md b/docs/SupportRequest.md new file mode 100644 index 0000000..e39323d --- /dev/null +++ b/docs/SupportRequest.md @@ -0,0 +1,44 @@ +# SupportRequest + +Summary of a support request created by a customer support agent. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Identifier of the support request. | +**application_id** | **int** | Identifier of the Application connected to the loyalty program or the campaign. It is displayed in your Talon.One deployment URL. | +**campaign_id** | **int** | Identifier of the campaign where the coupon or gift card is created. | [optional] +**loyalty_program_id** | **int** | Identifier of the loyalty program where the points are added or deducted. | [optional] +**subledger_id** | **int** | Identifier of the subledger the points are added to or deducted from. If there is no existing subledger with this ID, the subledger is created automatically. | [optional] +**created_by_user** | **str** | Email address of the customer support agent who created the support request. | +**created_at** | **datetime** | Timestamp when the request was made. | +**customer_profile_id** | **str** | Integration ID of the customer profile linked to the support request. | +**request_type** | **str** | Type of reward requested, including gift cards, personal coupons, and loyalty point additions or deductions. | +**request_value** | **float** | Requested monetary balance of the gift card or the number of loyalty points to be added or deducted. | [optional] +**request_note** | **str** | Notes attached to the support request. | +**request_status** | **str** | Current status of the support request. | +**processed_at** | **datetime** | Timestamp when the request was approved or rejected. | [optional] +**processing_note** | **str** | Notes attached by the admin when rejecting or approving a request. | [optional] +**processed_by_user** | **str** | Email address of the admin who approved or rejected the support request. | [optional] + +## Example + +```python +from talon_one.models.support_request import SupportRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of SupportRequest from a JSON string +support_request_instance = SupportRequest.from_json(json) +# print the JSON string representation of the object +print(SupportRequest.to_json()) + +# convert the object into a dict +support_request_dict = support_request_instance.to_dict() +# create an instance of SupportRequest from a dict +support_request_from_dict = SupportRequest.from_dict(support_request_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/SupportRequestInput.md b/docs/SupportRequestInput.md new file mode 100644 index 0000000..87a3db3 --- /dev/null +++ b/docs/SupportRequestInput.md @@ -0,0 +1,36 @@ +# SupportRequestInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**application_id** | **int** | Identifier of the Application connected to the loyalty program or the campaign. It is displayed in your Talon.One deployment URL. | +**campaign_id** | **int** | Identifier of the campaign where the coupon or gift card is created. | [optional] +**loyalty_program_id** | **int** | Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | [optional] +**subledger_id** | **int** | Identifier of the subledger the points are added to or deducted from. If there is no existing subledger with this ID, the subledger is created automatically. | [optional] +**customer_profile_id** | **str** | Integration ID of the customer profile linked to the support request. | +**request_type** | **str** | Type of reward requested, including gift cards, personal coupons, and loyalty point additions or deductions. | +**request_value** | **float** | Requested monetary balance of the gift card or the number of loyalty points to be added or deducted. | [optional] +**request_note** | **str** | Notes attached to the support request. | + +## Example + +```python +from talon_one.models.support_request_input import SupportRequestInput + +# TODO update the JSON string below +json = "{}" +# create an instance of SupportRequestInput from a JSON string +support_request_input_instance = SupportRequestInput.from_json(json) +# print the JSON string representation of the object +print(SupportRequestInput.to_json()) + +# convert the object into a dict +support_request_input_dict = support_request_input_instance.to_dict() +# create an instance of SupportRequestInput from a dict +support_request_input_from_dict = SupportRequestInput.from_dict(support_request_input_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/UpdateAchievementV2.md b/docs/UpdateAchievementV2.md index c65cf3c..4109894 100644 --- a/docs/UpdateAchievementV2.md +++ b/docs/UpdateAchievementV2.md @@ -5,19 +5,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **str** | The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. | [optional] -**title** | **str** | The display name for the achievement in the Campaign Manager. | [optional] -**description** | **str** | A description of the achievement. | [optional] -**target** | **float** | The required number of actions or the transactional milestone to complete the achievement. | [optional] +**name** | **str** | The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. | +**title** | **str** | The display name for the achievement in the Campaign Manager. | +**description** | **str** | A description of the achievement. | +**target** | **float** | The required number of actions or the transactional milestone to complete the achievement. | **period** | **str** | The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. | [optional] **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. | [optional] **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. | [optional] **fixed_start_date** | **datetime** | The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be 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 must be an RFC3339 timestamp string. | [optional] **allow_rollback_after_completion** | **bool** | When `true`, customer progress can be rolled back in completed achievements. | [optional] -**sandbox** | **bool** | Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. | [optional] -**subscribed_applications** | **List[int]** | A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement. | [optional] -**timezone** | **str** | A string containing an IANA timezone descriptor. | [optional] +**subscribed_applications** | **List[int]** | A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement. | ## Example diff --git a/docs/UpdateExperiment.md b/docs/UpdateExperiment.md index 07495ca..5e51dd2 100644 --- a/docs/UpdateExperiment.md +++ b/docs/UpdateExperiment.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **is_variant_assignment_external** | **bool** | The source of the assignment. - false - The variant assignment is handled internally by Talon.One. - true - The variant assignment is handled externally. | **campaign** | [**UpdateCampaign**](UpdateCampaign.md) | | -**goal_type** | **str** | The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. | [optional] -**goal_description** | **str** | A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. | [optional] +**goal_type** | **str** | The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. If omitted, the current value is preserved. | [optional] +**goal_description** | **str** | A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. If omitted, the current value is preserved. | [optional] ## Example diff --git a/docs/UpdateReward.md b/docs/UpdateReward.md index d1987d7..d0dbc10 100644 --- a/docs/UpdateReward.md +++ b/docs/UpdateReward.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **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] **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] ## Example diff --git a/docs/UpdateSupportRequest.md b/docs/UpdateSupportRequest.md new file mode 100644 index 0000000..969d224 --- /dev/null +++ b/docs/UpdateSupportRequest.md @@ -0,0 +1,30 @@ +# UpdateSupportRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_status** | **str** | Current status of the support request. | +**processing_note** | **str** | Notes attached by the admin when rejecting or approving a request. | [optional] + +## Example + +```python +from talon_one.models.update_support_request import UpdateSupportRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateSupportRequest from a JSON string +update_support_request_instance = UpdateSupportRequest.from_json(json) +# print the JSON string representation of the object +print(UpdateSupportRequest.to_json()) + +# convert the object into a dict +update_support_request_dict = update_support_request_instance.to_dict() +# create an instance of UpdateSupportRequest from a dict +update_support_request_from_dict = UpdateSupportRequest.from_dict(update_support_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyproject.toml b/pyproject.toml index 283b03b..73524dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] -name = "talon-one-sdk" -version = "26.10.0" +name = "talon_one" +version = "26.11.0" description = "Talon.One API" authors = [ {name = "OpenAPI Generator Community",email = "team@openapitools.org"}, @@ -12,7 +12,7 @@ requires-python = ">=3.9" dependencies = [ "urllib3 (>=2.1.0,<3.0.0)", "python-dateutil (>=2.8.2)", - "pydantic (>=2)", + "pydantic (>=2.11)", "typing-extensions (>=4.7.1)", ] diff --git a/setup.py b/setup.py index 8607535..b39481f 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,16 @@ -# coding: utf-8 +""" + Talon.One API -from setuptools import setup, find_packages -import pathlib + 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 setuptools import setup, find_packages # noqa: H301 # To install the library, run the following # @@ -9,19 +18,14 @@ # # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools - -NAME = "talon-one-sdk" -VERSION = "26.10.0" - -# Get the long description from the README.md file -here = pathlib.Path(__file__).parent.resolve() -long_description = (here / 'README.md').read_text(encoding='utf-8') - +NAME = "talon_one" +VERSION = "26.11.0" +PYTHON_REQUIRES = ">= 3.10" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", "python-dateutil >= 2.8.2", - "pydantic >= 2", - "typing-extensions >= 4.7.1" + "pydantic >= 2.11", + "typing-extensions >= 4.7.1", ] setup( @@ -33,9 +37,12 @@ url="https://github.com/talon-one/talon-one-python-sdk/", keywords=["talon","one","sdk"], install_requires=REQUIRES, - license="MIT", packages=find_packages(exclude=["test", "tests"]), include_package_data=True, - long_description=long_description, - long_description_content_type='text/markdown' + license="MIT", + long_description_content_type='text/markdown', + long_description="""\ + 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}`. + """, # noqa: E501 + package_data={"talon_one": ["py.typed"]}, ) diff --git a/talon_one/__init__.py b/talon_one/__init__.py index 46d49f4..70a0d8c 100644 --- a/talon_one/__init__.py +++ b/talon_one/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "26.10.0" +__version__ = "26.11.0" # Define package exports __all__ = [ @@ -183,6 +183,7 @@ "CartItem", "CartItemFilterTemplate", "Catalog", + "CatalogAction", "CatalogActionFilter", "CatalogItem", "CatalogRule", @@ -262,6 +263,9 @@ "EventType", "EventV2", "EventV3", + "EventV3Connections", + "EventV3Entity", + "EventV3RequestEntity", "Experiment", "ExperimentCampaignCopy", "ExperimentCopy", @@ -385,6 +389,7 @@ "IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification", "IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification", "IntegrationHubEventRecord", + "IntegrationHubEventStatusUpdate", "IntegrationHubFlow", "IntegrationHubFlowConfig", "IntegrationHubFlowConfigResponse", @@ -500,6 +505,7 @@ "NewCustomerSessionV2", "NewEvent", "NewEventType", + "NewEventV3Entity", "NewExperiment", "NewExperimentVariant", "NewExperimentVariantArray", @@ -595,6 +601,7 @@ "RevisionActivationRequest", "RevisionVersion", "Reward", + "RewardPointsRequired", "RiskNotification", "Role", "RoleAssign", @@ -669,6 +676,8 @@ "StrikethroughTrigger", "SummarizeCampaignStoreBudget200Response", "SummaryCampaignStoreBudget", + "SupportRequest", + "SupportRequestInput", "TalangAttribute", "TalangAttributeVisibility", "TemplateArgDef", @@ -726,6 +735,7 @@ "UpdateReward", "UpdateRole", "UpdateStore", + "UpdateSupportRequest", "UpdateUser", "User", "UserEntity", @@ -909,6 +919,7 @@ from talon_one.models.cart_item import CartItem as CartItem from talon_one.models.cart_item_filter_template import CartItemFilterTemplate as CartItemFilterTemplate from talon_one.models.catalog import Catalog as Catalog +from talon_one.models.catalog_action import CatalogAction as CatalogAction from talon_one.models.catalog_action_filter import CatalogActionFilter as CatalogActionFilter from talon_one.models.catalog_item import CatalogItem as CatalogItem from talon_one.models.catalog_rule import CatalogRule as CatalogRule @@ -988,6 +999,9 @@ from talon_one.models.event_type import EventType as EventType from talon_one.models.event_v2 import EventV2 as EventV2 from talon_one.models.event_v3 import EventV3 as EventV3 +from talon_one.models.event_v3_connections import EventV3Connections as EventV3Connections +from talon_one.models.event_v3_entity import EventV3Entity as EventV3Entity +from talon_one.models.event_v3_request_entity import EventV3RequestEntity as EventV3RequestEntity from talon_one.models.experiment import Experiment as Experiment from talon_one.models.experiment_campaign_copy import ExperimentCampaignCopy as ExperimentCampaignCopy from talon_one.models.experiment_copy import ExperimentCopy as ExperimentCopy @@ -1111,6 +1125,7 @@ from talon_one.models.integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification import IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification as IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification from talon_one.models.integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification import IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification as IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification from talon_one.models.integration_hub_event_record import IntegrationHubEventRecord as IntegrationHubEventRecord +from talon_one.models.integration_hub_event_status_update import IntegrationHubEventStatusUpdate as IntegrationHubEventStatusUpdate from talon_one.models.integration_hub_flow import IntegrationHubFlow as IntegrationHubFlow from talon_one.models.integration_hub_flow_config import IntegrationHubFlowConfig as IntegrationHubFlowConfig from talon_one.models.integration_hub_flow_config_response import IntegrationHubFlowConfigResponse as IntegrationHubFlowConfigResponse @@ -1226,6 +1241,7 @@ from talon_one.models.new_customer_session_v2 import NewCustomerSessionV2 as NewCustomerSessionV2 from talon_one.models.new_event import NewEvent as NewEvent from talon_one.models.new_event_type import NewEventType as NewEventType +from talon_one.models.new_event_v3_entity import NewEventV3Entity as NewEventV3Entity from talon_one.models.new_experiment import NewExperiment as NewExperiment from talon_one.models.new_experiment_variant import NewExperimentVariant as NewExperimentVariant from talon_one.models.new_experiment_variant_array import NewExperimentVariantArray as NewExperimentVariantArray @@ -1321,6 +1337,7 @@ from talon_one.models.revision_activation_request import RevisionActivationRequest as RevisionActivationRequest from talon_one.models.revision_version import RevisionVersion as RevisionVersion from talon_one.models.reward import Reward as Reward +from talon_one.models.reward_points_required import RewardPointsRequired as RewardPointsRequired 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 @@ -1395,6 +1412,8 @@ from talon_one.models.strikethrough_trigger import StrikethroughTrigger as StrikethroughTrigger from talon_one.models.summarize_campaign_store_budget200_response import SummarizeCampaignStoreBudget200Response as SummarizeCampaignStoreBudget200Response from talon_one.models.summary_campaign_store_budget import SummaryCampaignStoreBudget as SummaryCampaignStoreBudget +from talon_one.models.support_request import SupportRequest as SupportRequest +from talon_one.models.support_request_input import SupportRequestInput as SupportRequestInput from talon_one.models.talang_attribute import TalangAttribute as TalangAttribute from talon_one.models.talang_attribute_visibility import TalangAttributeVisibility as TalangAttributeVisibility from talon_one.models.template_arg_def import TemplateArgDef as TemplateArgDef @@ -1452,6 +1471,7 @@ from talon_one.models.update_reward import UpdateReward as UpdateReward from talon_one.models.update_role import UpdateRole as UpdateRole from talon_one.models.update_store import UpdateStore as UpdateStore +from talon_one.models.update_support_request import UpdateSupportRequest as UpdateSupportRequest from talon_one.models.update_user import UpdateUser as UpdateUser from talon_one.models.user import User as User from talon_one.models.user_entity import UserEntity as UserEntity diff --git a/talon_one/api/integration_api.py b/talon_one/api/integration_api.py index a0aceb9..a597118 100644 --- a/talon_one/api/integration_api.py +++ b/talon_one/api/integration_api.py @@ -9255,7 +9255,7 @@ def track_event_v2( ) -> IntegrationEventV2Response: """Track event - Triggers a custom event. To use this endpoint: 1. Define a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. Update or create a rule to check for this event. 1. Trigger the event with this endpoint. After you have successfully sent an event to Talon.One, you can list the received events in the **Events** view in the Campaign Manager. Talon.One also offers a set of [built-in events](https://docs.talon.one/docs/dev/concepts/entities/events). Ensure you do not create a custom event when you can use a built-in event. For example, use this endpoint to trigger an event when a customer shares a link to a product. See the [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - 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. + Triggers a custom event. To use this endpoint: 1. [Create a custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. In a rule, add the **Check for event types** [condition](https://docs.talon.one/docs/dev/concepts/entities/events#use-an-event-in-a-rule) and select the event you created. 1. Trigger the event with this endpoint. You can [list](https://docs.talon.one/docs/product/applications/display-events#list-events) the received events in the **Events** view of the Campaign Manager. For example, you can use this endpoint to trigger an event when a customer shares a link to a product. See our [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - 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. :param integration_event_v2_request: body (required) :type integration_event_v2_request: IntegrationEventV2Request @@ -9338,7 +9338,7 @@ def track_event_v2_with_http_info( ) -> ApiResponse[IntegrationEventV2Response]: """Track event - Triggers a custom event. To use this endpoint: 1. Define a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. Update or create a rule to check for this event. 1. Trigger the event with this endpoint. After you have successfully sent an event to Talon.One, you can list the received events in the **Events** view in the Campaign Manager. Talon.One also offers a set of [built-in events](https://docs.talon.one/docs/dev/concepts/entities/events). Ensure you do not create a custom event when you can use a built-in event. For example, use this endpoint to trigger an event when a customer shares a link to a product. See the [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - 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. + Triggers a custom event. To use this endpoint: 1. [Create a custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. In a rule, add the **Check for event types** [condition](https://docs.talon.one/docs/dev/concepts/entities/events#use-an-event-in-a-rule) and select the event you created. 1. Trigger the event with this endpoint. You can [list](https://docs.talon.one/docs/product/applications/display-events#list-events) the received events in the **Events** view of the Campaign Manager. For example, you can use this endpoint to trigger an event when a customer shares a link to a product. See our [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - 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. :param integration_event_v2_request: body (required) :type integration_event_v2_request: IntegrationEventV2Request @@ -9421,7 +9421,7 @@ def track_event_v2_without_preload_content( ) -> RESTResponseType: """Track event - Triggers a custom event. To use this endpoint: 1. Define a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. Update or create a rule to check for this event. 1. Trigger the event with this endpoint. After you have successfully sent an event to Talon.One, you can list the received events in the **Events** view in the Campaign Manager. Talon.One also offers a set of [built-in events](https://docs.talon.one/docs/dev/concepts/entities/events). Ensure you do not create a custom event when you can use a built-in event. For example, use this endpoint to trigger an event when a customer shares a link to a product. See the [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - 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. + Triggers a custom event. To use this endpoint: 1. [Create a custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. In a rule, add the **Check for event types** [condition](https://docs.talon.one/docs/dev/concepts/entities/events#use-an-event-in-a-rule) and select the event you created. 1. Trigger the event with this endpoint. You can [list](https://docs.talon.one/docs/product/applications/display-events#list-events) the received events in the **Events** view of the Campaign Manager. For example, you can use this endpoint to trigger an event when a customer shares a link to a product. See our [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - 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. :param integration_event_v2_request: body (required) :type integration_event_v2_request: IntegrationEventV2Request diff --git a/talon_one/api/management_api.py b/talon_one/api/management_api.py index 865716a..40a54c7 100644 --- a/talon_one/api/management_api.py +++ b/talon_one/api/management_api.py @@ -42575,7 +42575,7 @@ def import_loyalty_cards( ) -> ModelImport: """Import loyalty cards - Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] We recommend limiting your file size to 500MB. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` + Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. 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 @@ -42648,7 +42648,7 @@ def import_loyalty_cards_with_http_info( ) -> ApiResponse[ModelImport]: """Import loyalty cards - Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] We recommend limiting your file size to 500MB. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` + Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. 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 @@ -42721,7 +42721,7 @@ def import_loyalty_cards_without_preload_content( ) -> RESTResponseType: """Import loyalty cards - Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] We recommend limiting your file size to 500MB. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` + Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. 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 @@ -42870,7 +42870,7 @@ def import_loyalty_customers_tiers( ) -> ModelImport: """Import customers into loyalty tiers - Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. > [!important] This endpoint only works with loyalty programs with advanced > tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiration date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiration date is updated. > [!note] We recommend not using this endpoint to update the tier of a customer. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` + Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. > [!important] This endpoint only works with loyalty programs with advanced > tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiry date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiry date is updated. > [!note] We recommend importing customers into the tier that matches their > current balance. If a customer is imported into a lower tier, any session > or points update automatically upgrades them to the tier they qualify for. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` :param loyalty_program_id: Identifier of the 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 @@ -42944,7 +42944,7 @@ def import_loyalty_customers_tiers_with_http_info( ) -> ApiResponse[ModelImport]: """Import customers into loyalty tiers - Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. > [!important] This endpoint only works with loyalty programs with advanced > tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiration date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiration date is updated. > [!note] We recommend not using this endpoint to update the tier of a customer. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` + Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. > [!important] This endpoint only works with loyalty programs with advanced > tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiry date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiry date is updated. > [!note] We recommend importing customers into the tier that matches their > current balance. If a customer is imported into a lower tier, any session > or points update automatically upgrades them to the tier they qualify for. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` :param loyalty_program_id: Identifier of the 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 @@ -43018,7 +43018,7 @@ def import_loyalty_customers_tiers_without_preload_content( ) -> RESTResponseType: """Import customers into loyalty tiers - Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. > [!important] This endpoint only works with loyalty programs with advanced > tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiration date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiration date is updated. > [!note] We recommend not using this endpoint to update the tier of a customer. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` + Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. > [!important] This endpoint only works with loyalty programs with advanced > tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiry date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiry date is updated. > [!note] We recommend importing customers into the tier that matches their > current balance. If a customer is imported into a lower tier, any session > or points update automatically upgrades them to the tier they qualify for. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` :param loyalty_program_id: Identifier of the 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 diff --git a/talon_one/api_client.py b/talon_one/api_client.py index fe67c92..de52636 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.10.0/python' + self.user_agent = 'OpenAPI-Generator/26.11.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 0a39eb3..4272fdb 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.10.0".\ + "SDK Package Version: 26.11.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 d5ca8ec..ee4c4d4 100644 --- a/talon_one/models/__init__.py +++ b/talon_one/models/__init__.py @@ -167,6 +167,7 @@ from talon_one.models.cart_item import CartItem from talon_one.models.cart_item_filter_template import CartItemFilterTemplate from talon_one.models.catalog import Catalog +from talon_one.models.catalog_action import CatalogAction from talon_one.models.catalog_action_filter import CatalogActionFilter from talon_one.models.catalog_item import CatalogItem from talon_one.models.catalog_rule import CatalogRule @@ -246,6 +247,9 @@ from talon_one.models.event_type import EventType from talon_one.models.event_v2 import EventV2 from talon_one.models.event_v3 import EventV3 +from talon_one.models.event_v3_connections import EventV3Connections +from talon_one.models.event_v3_entity import EventV3Entity +from talon_one.models.event_v3_request_entity import EventV3RequestEntity from talon_one.models.experiment import Experiment from talon_one.models.experiment_campaign_copy import ExperimentCampaignCopy from talon_one.models.experiment_copy import ExperimentCopy @@ -369,6 +373,7 @@ from talon_one.models.integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification import IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification from talon_one.models.integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification import IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification from talon_one.models.integration_hub_event_record import IntegrationHubEventRecord +from talon_one.models.integration_hub_event_status_update import IntegrationHubEventStatusUpdate from talon_one.models.integration_hub_flow import IntegrationHubFlow from talon_one.models.integration_hub_flow_config import IntegrationHubFlowConfig from talon_one.models.integration_hub_flow_config_response import IntegrationHubFlowConfigResponse @@ -484,6 +489,7 @@ from talon_one.models.new_customer_session_v2 import NewCustomerSessionV2 from talon_one.models.new_event import NewEvent from talon_one.models.new_event_type import NewEventType +from talon_one.models.new_event_v3_entity import NewEventV3Entity from talon_one.models.new_experiment import NewExperiment from talon_one.models.new_experiment_variant import NewExperimentVariant from talon_one.models.new_experiment_variant_array import NewExperimentVariantArray @@ -579,6 +585,7 @@ from talon_one.models.revision_activation_request import RevisionActivationRequest from talon_one.models.revision_version import RevisionVersion from talon_one.models.reward import Reward +from talon_one.models.reward_points_required import RewardPointsRequired from talon_one.models.risk_notification import RiskNotification from talon_one.models.role import Role from talon_one.models.role_assign import RoleAssign @@ -653,6 +660,8 @@ from talon_one.models.strikethrough_trigger import StrikethroughTrigger from talon_one.models.summarize_campaign_store_budget200_response import SummarizeCampaignStoreBudget200Response from talon_one.models.summary_campaign_store_budget import SummaryCampaignStoreBudget +from talon_one.models.support_request import SupportRequest +from talon_one.models.support_request_input import SupportRequestInput from talon_one.models.talang_attribute import TalangAttribute from talon_one.models.talang_attribute_visibility import TalangAttributeVisibility from talon_one.models.template_arg_def import TemplateArgDef @@ -710,6 +719,7 @@ from talon_one.models.update_reward import UpdateReward from talon_one.models.update_role import UpdateRole from talon_one.models.update_store import UpdateStore +from talon_one.models.update_support_request import UpdateSupportRequest from talon_one.models.update_user import UpdateUser from talon_one.models.user import User from talon_one.models.user_entity import UserEntity diff --git a/talon_one/models/achievement_base_v2.py b/talon_one/models/achievement_base_v2.py index 1964882..20f8e65 100644 --- a/talon_one/models/achievement_base_v2.py +++ b/talon_one/models/achievement_base_v2.py @@ -39,10 +39,8 @@ class AchievementBaseV2(BaseModel): fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate") 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 must be an RFC3339 timestamp string. ", alias="endDate") allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="allowRollbackAfterCompletion") - sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type.") subscribed_applications: Optional[Annotated[List[StrictInt], Field(min_length=0)]] = Field(default=None, description="A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement.", alias="subscribedApplications") - timezone: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="A string containing an IANA timezone descriptor.") - __properties: ClassVar[List[str]] = ["name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "sandbox", "subscribedApplications", "timezone"] + __properties: ClassVar[List[str]] = ["name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "subscribedApplications"] @field_validator('name') def name_validate_regular_expression(cls, value): @@ -138,9 +136,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "fixedStartDate": obj.get("fixedStartDate"), "endDate": obj.get("endDate"), "allowRollbackAfterCompletion": obj.get("allowRollbackAfterCompletion"), - "sandbox": obj.get("sandbox"), - "subscribedApplications": obj.get("subscribedApplications"), - "timezone": obj.get("timezone") + "subscribedApplications": obj.get("subscribedApplications") }) return _obj diff --git a/talon_one/models/achievement_v2.py b/talon_one/models/achievement_v2.py index a99c41f..5294596 100644 --- a/talon_one/models/achievement_v2.py +++ b/talon_one/models/achievement_v2.py @@ -41,14 +41,14 @@ class AchievementV2(BaseModel): fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate") 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 must be an RFC3339 timestamp string. ", alias="endDate") allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="allowRollbackAfterCompletion") - sandbox: StrictBool = Field(description="Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type.") subscribed_applications: Annotated[List[StrictInt], Field(min_length=0)] = Field(description="A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement.", alias="subscribedApplications") - timezone: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string containing an IANA timezone descriptor.") user_id: StrictInt = Field(description="The ID of the user that created this achievement.", alias="userId") created_by: Optional[StrictStr] = Field(default=None, description="Name of the user that created the achievement. **Note**: This is not available if the user has been deleted. ", alias="createdBy") has_progress: Optional[StrictBool] = Field(default=None, description="Indicates if a customer has made progress in the achievement.", alias="hasProgress") status: Optional[StrictStr] = Field(default=None, description="The status of the achievement.") - __properties: ClassVar[List[str]] = ["id", "created", "name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "sandbox", "subscribedApplications", "timezone", "userId", "createdBy", "hasProgress", "status"] + sandbox: StrictBool = Field(description="Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type.") + timezone: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string containing an IANA timezone descriptor.") + __properties: ClassVar[List[str]] = ["id", "created", "name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "subscribedApplications", "userId", "createdBy", "hasProgress", "status", "sandbox", "timezone"] @field_validator('name') def name_validate_regular_expression(cls, value): @@ -147,13 +147,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "fixedStartDate": obj.get("fixedStartDate"), "endDate": obj.get("endDate"), "allowRollbackAfterCompletion": obj.get("allowRollbackAfterCompletion"), - "sandbox": obj.get("sandbox"), "subscribedApplications": obj.get("subscribedApplications"), - "timezone": obj.get("timezone"), "userId": obj.get("userId"), "createdBy": obj.get("createdBy"), "hasProgress": obj.get("hasProgress"), - "status": obj.get("status") + "status": obj.get("status"), + "sandbox": obj.get("sandbox"), + "timezone": obj.get("timezone") }) return _obj diff --git a/talon_one/models/application_event.py b/talon_one/models/application_event.py index f11a07c..cdd0d7e 100644 --- a/talon_one/models/application_event.py +++ b/talon_one/models/application_event.py @@ -37,12 +37,13 @@ class ApplicationEvent(BaseModel): profile_id: Optional[StrictInt] = Field(default=None, description="The globally unique Talon.One ID of the customer that created this entity.", alias="profileId") store_id: Optional[StrictInt] = Field(default=None, description="The ID of the store.", alias="storeId") store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") + integration_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The unique ID of the event. Only one event with this ID can be registered. ", alias="integrationId") session_id: Optional[StrictInt] = Field(default=None, description="The globally unique Talon.One ID of the session that contains this event.", alias="sessionId") - type: StrictStr = Field(description="A string representing the event. Must not be a reserved event name.") + type: StrictStr = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") attributes: Dict[str, Any] = Field(description="Additional JSON serialized data associated with the event.") effects: List[Effect] = Field(description="An array containing the effects that were applied as a result of this event.") rule_failure_reasons: Optional[List[RuleFailureReason]] = Field(default=None, description="An array containing the rule failure reasons which happened during this event.", alias="ruleFailureReasons") - __properties: ClassVar[List[str]] = ["id", "created", "applicationId", "profileId", "storeId", "storeIntegrationId", "sessionId", "type", "attributes", "effects", "ruleFailureReasons"] + __properties: ClassVar[List[str]] = ["id", "created", "applicationId", "profileId", "storeId", "storeIntegrationId", "integrationId", "sessionId", "type", "attributes", "effects", "ruleFailureReasons"] model_config = ConfigDict( validate_by_name=True, @@ -115,6 +116,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "profileId": obj.get("profileId"), "storeId": obj.get("storeId"), "storeIntegrationId": obj.get("storeIntegrationId"), + "integrationId": obj.get("integrationId"), "sessionId": obj.get("sessionId"), "type": obj.get("type"), "attributes": obj.get("attributes"), diff --git a/talon_one/models/base_campaign.py b/talon_one/models/base_campaign.py index 1ccc00c..0a23b46 100644 --- a/talon_one/models/base_campaign.py +++ b/talon_one/models/base_campaign.py @@ -61,8 +61,8 @@ def state_validate_enum(cls, value): def features_validate_enum(cls, value): """Validates the enum""" for i in value: - if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements']): - raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements')") + if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents']): + raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents')") return value @field_validator('type') diff --git a/talon_one/models/best_prior_price.py b/talon_one/models/best_prior_price.py index 8d23a9c..b57a732 100644 --- a/talon_one/models/best_prior_price.py +++ b/talon_one/models/best_prior_price.py @@ -19,7 +19,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Union +from typing import Any, ClassVar, Dict, List, Optional, Union from talon_one.models.best_prior_price_metadata import BestPriorPriceMetadata from typing import Optional, Set from typing_extensions import Self @@ -32,11 +32,12 @@ class BestPriorPrice(BaseModel): id: StrictInt = Field(description="The ID of the historical price.") sku: StrictStr = Field(description="sku") observed_at: datetime = Field(description="The date and time when the price was observed.", alias="observedAt") - context_id: StrictStr = Field(description="The context ID of the context active at the time of observation. ", alias="contextId") + 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") + context_id: Optional[StrictStr] = Field(default='', description="This property is **deprecated**. Use `contextIds` instead. Defaults to an empty string. ", alias="contextId") price: Union[StrictFloat, StrictInt] = Field(description="Price of the item.") metadata: BestPriorPriceMetadata target: Dict[str, Any] - __properties: ClassVar[List[str]] = ["id", "sku", "observedAt", "contextId", "price", "metadata", "target"] + __properties: ClassVar[List[str]] = ["id", "sku", "observedAt", "contextIds", "contextId", "price", "metadata", "target"] model_config = ConfigDict( validate_by_name=True, @@ -95,7 +96,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "id": obj.get("id"), "sku": obj.get("sku"), "observedAt": obj.get("observedAt"), - "contextId": obj.get("contextId"), + "contextIds": obj.get("contextIds"), + "contextId": obj.get("contextId") if obj.get("contextId") is not None else '', "price": obj.get("price"), "metadata": BestPriorPriceMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, "target": obj.get("target") diff --git a/talon_one/models/campaign.py b/talon_one/models/campaign.py index f192216..ea7d93b 100644 --- a/talon_one/models/campaign.py +++ b/talon_one/models/campaign.py @@ -98,8 +98,8 @@ def state_validate_enum(cls, value): def features_validate_enum(cls, value): """Validates the enum""" for i in value: - if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements']): - raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements')") + if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents']): + raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents')") return value @field_validator('type') diff --git a/talon_one/models/campaign_template.py b/talon_one/models/campaign_template.py index f694797..17f66aa 100644 --- a/talon_one/models/campaign_template.py +++ b/talon_one/models/campaign_template.py @@ -78,8 +78,8 @@ def features_validate_enum(cls, value): return value for i in value: - if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements']): - raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements')") + if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents']): + raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents')") return value @field_validator('campaign_type') diff --git a/talon_one/models/catalog_action.py b/talon_one/models/catalog_action.py new file mode 100644 index 0000000..91eff45 --- /dev/null +++ b/talon_one/models/catalog_action.py @@ -0,0 +1,97 @@ +# 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 CatalogAction(BaseModel): + """ + Definition of all the properties that are needed for a single catalog sync action. + """ # noqa: E501 + type: StrictStr = Field(description="The type of sync action.") + payload: Dict[str, Any] + __properties: ClassVar[List[str]] = ["type", "payload"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ADD', 'PATCH', 'PATCH_MANY', 'REMOVE', 'REMOVE_MANY', 'ADD_PRICE_ADJUSTMENT']): + raise ValueError("must be one of enum values ('ADD', 'PATCH', 'PATCH_MANY', 'REMOVE', 'REMOVE_MANY', 'ADD_PRICE_ADJUSTMENT')") + 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 CatalogAction 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 CatalogAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "payload": obj.get("payload") + }) + return _obj + + diff --git a/talon_one/models/catalog_sync_request.py b/talon_one/models/catalog_sync_request.py index 8f7bc98..56da4e7 100644 --- a/talon_one/models/catalog_sync_request.py +++ b/talon_one/models/catalog_sync_request.py @@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from talon_one.models.catalog_action import CatalogAction from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -28,7 +29,7 @@ class CatalogSyncRequest(BaseModel): """ CatalogSyncRequest """ # noqa: E501 - actions: Annotated[List[Dict[str, Any]], Field(min_length=1, max_length=1000)] + actions: Annotated[List[CatalogAction], Field(min_length=1, max_length=1000)] version: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="The version number of the catalog to apply the actions on.") __properties: ClassVar[List[str]] = ["actions", "version"] @@ -71,6 +72,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in actions (list) + _items = [] + if self.actions: + for _item_actions in self.actions: + if _item_actions: + _items.append(_item_actions.to_dict()) + _dict['actions'] = _items return _dict @classmethod @@ -83,7 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "actions": obj.get("actions"), + "actions": [CatalogAction.from_dict(_item) for _item in obj["actions"]] if obj.get("actions") is not None else None, "version": obj.get("version") }) return _obj diff --git a/talon_one/models/create_achievement_v2.py b/talon_one/models/create_achievement_v2.py index d6fb17d..479f441 100644 --- a/talon_one/models/create_achievement_v2.py +++ b/talon_one/models/create_achievement_v2.py @@ -39,10 +39,10 @@ class CreateAchievementV2(BaseModel): fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate") 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 must be an RFC3339 timestamp string. ", alias="endDate") allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="allowRollbackAfterCompletion") - sandbox: StrictBool = Field(description="Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type.") subscribed_applications: Optional[Annotated[List[StrictInt], Field(min_length=0)]] = Field(default=None, description="A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement.", alias="subscribedApplications") + sandbox: StrictBool = Field(description="Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type.") timezone: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string containing an IANA timezone descriptor.") - __properties: ClassVar[List[str]] = ["name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "sandbox", "subscribedApplications", "timezone"] + __properties: ClassVar[List[str]] = ["name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "subscribedApplications", "sandbox", "timezone"] @field_validator('name') def name_validate_regular_expression(cls, value): @@ -135,8 +135,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "fixedStartDate": obj.get("fixedStartDate"), "endDate": obj.get("endDate"), "allowRollbackAfterCompletion": obj.get("allowRollbackAfterCompletion"), - "sandbox": obj.get("sandbox"), "subscribedApplications": obj.get("subscribedApplications"), + "sandbox": obj.get("sandbox"), "timezone": obj.get("timezone") }) return _obj diff --git a/talon_one/models/customer_session_v2.py b/talon_one/models/customer_session_v2.py index a89cd45..0346425 100644 --- a/talon_one/models/customer_session_v2.py +++ b/talon_one/models/customer_session_v2.py @@ -53,8 +53,9 @@ class CustomerSessionV2(BaseModel): total: Union[StrictFloat, StrictInt] = Field(description="The total value of cart items and additional costs in the session, before any discounts are applied.") cart_item_total: Union[StrictFloat, StrictInt] = Field(description="The total value of cart items, before any discounts are applied.", alias="cartItemTotal") additional_cost_total: Union[StrictFloat, StrictInt] = Field(description="The total value of additional costs, before any discounts are applied.", alias="additionalCostTotal") + cart_item_additional_cost_total: Union[StrictFloat, StrictInt] = Field(description="The total value of additional costs applied to individual items, before any discounts are applied.", alias="cartItemAdditionalCostTotal") updated: datetime = Field(description="Timestamp of the most recent event received on this session.") - __properties: ClassVar[List[str]] = ["id", "created", "integrationId", "applicationId", "profileId", "storeIntegrationId", "evaluableCampaignIds", "couponCodes", "referralCode", "loyaltyCards", "state", "cartItems", "experimentVariantAllocations", "additionalCosts", "identifiers", "attributes", "firstSession", "updateCount", "total", "cartItemTotal", "additionalCostTotal", "updated"] + __properties: ClassVar[List[str]] = ["id", "created", "integrationId", "applicationId", "profileId", "storeIntegrationId", "evaluableCampaignIds", "couponCodes", "referralCode", "loyaltyCards", "state", "cartItems", "experimentVariantAllocations", "additionalCosts", "identifiers", "attributes", "firstSession", "updateCount", "total", "cartItemTotal", "additionalCostTotal", "cartItemAdditionalCostTotal", "updated"] @field_validator('state') def state_validate_enum(cls, value): @@ -96,8 +97,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ + "cart_item_additional_cost_total", ]) _dict = self.model_dump( @@ -164,6 +167,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "total": obj.get("total"), "cartItemTotal": obj.get("cartItemTotal"), "additionalCostTotal": obj.get("additionalCostTotal"), + "cartItemAdditionalCostTotal": obj.get("cartItemAdditionalCostTotal"), "updated": obj.get("updated") }) return _obj diff --git a/talon_one/models/event.py b/talon_one/models/event.py index 244bb75..0eacb6f 100644 --- a/talon_one/models/event.py +++ b/talon_one/models/event.py @@ -36,13 +36,14 @@ class Event(BaseModel): application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") - type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string representing the event. Must not be a reserved event name.") + type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") attributes: Dict[str, Any] = Field(description="Arbitrary additional JSON data associated with the event.") + integration_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The unique ID of the event. Only one event with this ID can be registered. ", alias="integrationId") session_id: Optional[StrictStr] = Field(default=None, description="The ID of the session that this event occurred in.", alias="sessionId") effects: List[Dict[str, Any]] = Field(description="An array of effects generated by the rules of the enabled campaigns of the Application. You decide how to apply them in your system. See the list of [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects). ") ledger_entries: Optional[List[LedgerEntry]] = Field(default=None, description="Ledger entries for the event.", alias="ledgerEntries") meta: Optional[Meta] = None - __properties: ClassVar[List[str]] = ["id", "created", "applicationId", "profileId", "storeIntegrationId", "type", "attributes", "sessionId", "effects", "ledgerEntries", "meta"] + __properties: ClassVar[List[str]] = ["id", "created", "applicationId", "profileId", "storeIntegrationId", "type", "attributes", "integrationId", "sessionId", "effects", "ledgerEntries", "meta"] model_config = ConfigDict( validate_by_name=True, @@ -112,6 +113,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "storeIntegrationId": obj.get("storeIntegrationId"), "type": obj.get("type"), "attributes": obj.get("attributes"), + "integrationId": obj.get("integrationId"), "sessionId": obj.get("sessionId"), "effects": obj.get("effects"), "ledgerEntries": [LedgerEntry.from_dict(_item) for _item in obj["ledgerEntries"]] if obj.get("ledgerEntries") is not None else None, diff --git a/talon_one/models/event_attributes_entity.py b/talon_one/models/event_attributes_entity.py index 2bc1a17..3ab0711 100644 --- a/talon_one/models/event_attributes_entity.py +++ b/talon_one/models/event_attributes_entity.py @@ -28,7 +28,7 @@ class EventAttributesEntity(BaseModel): """ EventAttributesEntity """ # noqa: E501 - type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. ") + type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute).") __properties: ClassVar[List[str]] = ["type", "attributes"] diff --git a/talon_one/models/event_v2.py b/talon_one/models/event_v2.py index ce054ac..44c83aa 100644 --- a/talon_one/models/event_v2.py +++ b/talon_one/models/event_v2.py @@ -31,7 +31,7 @@ class EventV2(BaseModel): profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds") - type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. ") + type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute).") __properties: ClassVar[List[str]] = ["profileId", "storeIntegrationId", "evaluableCampaignIds", "type", "attributes"] diff --git a/talon_one/models/event_v3.py b/talon_one/models/event_v3.py index dae0cbb..718c2cb 100644 --- a/talon_one/models/event_v3.py +++ b/talon_one/models/event_v3.py @@ -17,6 +17,7 @@ import re # noqa: F401 import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated @@ -28,15 +29,17 @@ class EventV3(BaseModel): """ EventV3 """ # noqa: E501 - profile_id: StrictStr = Field(description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") + connected_session_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail.", alias="connectedSessionId") + id: StrictInt = Field(description="The internal ID of this entity.") + created: datetime = Field(description="The time this entity was created.") + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") + profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") - evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds") - integration_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The unique ID of the current event. Only one event with this ID could be activated, duplicated events are forbidden. ", alias="integrationId") - type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. ") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute).") - connected_session_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The ID of the session that happened in the past.", alias="connectedSessionID") - previous_event_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The unique identifier of the event that happened in the past.", alias="previousEventID") - __properties: ClassVar[List[str]] = ["profileId", "storeIntegrationId", "evaluableCampaignIds", "integrationId", "type", "attributes", "connectedSessionID", "previousEventID"] + type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") + attributes: Dict[str, Any] = Field(description="Arbitrary additional JSON data associated with the event.") + integration_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The unique ID of the event. Only one event with this ID can be registered. ", alias="integrationId") + effects: List[Dict[str, Any]] = Field(description="An array of effects generated by the rules of the enabled campaigns of the Application. You decide how to apply them in your system. See the list of [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects). ") + __properties: ClassVar[List[str]] = ["connectedSessionId", "id", "created", "applicationId", "profileId", "storeIntegrationId", "type", "attributes", "integrationId", "effects"] model_config = ConfigDict( validate_by_name=True, @@ -89,14 +92,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "connectedSessionId": obj.get("connectedSessionId"), + "id": obj.get("id"), + "created": obj.get("created"), + "applicationId": obj.get("applicationId"), "profileId": obj.get("profileId"), "storeIntegrationId": obj.get("storeIntegrationId"), - "evaluableCampaignIds": obj.get("evaluableCampaignIds"), - "integrationId": obj.get("integrationId"), "type": obj.get("type"), "attributes": obj.get("attributes"), - "connectedSessionID": obj.get("connectedSessionID"), - "previousEventID": obj.get("previousEventID") + "integrationId": obj.get("integrationId"), + "effects": obj.get("effects") }) return _obj diff --git a/talon_one/models/event_v3_connections.py b/talon_one/models/event_v3_connections.py new file mode 100644 index 0000000..5bbc96b --- /dev/null +++ b/talon_one/models/event_v3_connections.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EventV3Connections(BaseModel): + """ + EventV3Connections + """ # noqa: E501 + connected_session_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail.", alias="connectedSessionId") + __properties: ClassVar[List[str]] = ["connectedSessionId"] + + 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 EventV3Connections 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 EventV3Connections from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "connectedSessionId": obj.get("connectedSessionId") + }) + return _obj + + diff --git a/talon_one/models/event_v3_entity.py b/talon_one/models/event_v3_entity.py new file mode 100644 index 0000000..f8f4ac7 --- /dev/null +++ b/talon_one/models/event_v3_entity.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EventV3Entity(BaseModel): + """ + EventV3Entity + """ # noqa: E501 + integration_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The unique ID of the event. Only one event with this ID can be registered. ", alias="integrationId") + __properties: ClassVar[List[str]] = ["integrationId"] + + 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 EventV3Entity 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 EventV3Entity from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "integrationId": obj.get("integrationId") + }) + return _obj + + diff --git a/talon_one/models/event_v3_request_entity.py b/talon_one/models/event_v3_request_entity.py new file mode 100644 index 0000000..e76bfed --- /dev/null +++ b/talon_one/models/event_v3_request_entity.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EventV3RequestEntity(BaseModel): + """ + EventV3RequestEntity + """ # noqa: E501 + profile_id: StrictStr = Field(description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") + store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") + evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds") + type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute).") + integration_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The unique ID of the event. Only one event with this ID can be registered. ", alias="integrationId") + connected_session_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail.", alias="connectedSessionId") + __properties: ClassVar[List[str]] = ["profileId", "storeIntegrationId", "evaluableCampaignIds", "type", "attributes", "integrationId", "connectedSessionId"] + + 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 EventV3RequestEntity 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 EventV3RequestEntity from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "profileId": obj.get("profileId"), + "storeIntegrationId": obj.get("storeIntegrationId"), + "evaluableCampaignIds": obj.get("evaluableCampaignIds"), + "type": obj.get("type"), + "attributes": obj.get("attributes"), + "integrationId": obj.get("integrationId"), + "connectedSessionId": obj.get("connectedSessionId") + }) + return _obj + + diff --git a/talon_one/models/experiment_copy_experiment.py b/talon_one/models/experiment_copy_experiment.py index ee6679a..6905de9 100644 --- a/talon_one/models/experiment_copy_experiment.py +++ b/talon_one/models/experiment_copy_experiment.py @@ -17,8 +17,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, List +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional from talon_one.models.experiment_campaign_copy import ExperimentCampaignCopy from typing import Optional, Set from typing_extensions import Self @@ -30,7 +30,19 @@ class ExperimentCopyExperiment(BaseModel): """ # noqa: E501 is_variant_assignment_external: StrictBool = Field(description="The source of the assignment. - false - The variant assignment is handled internally by Talon.One. - true - The variant assignment is handled externally. ", alias="isVariantAssignmentExternal") campaign: ExperimentCampaignCopy - __properties: ClassVar[List[str]] = ["isVariantAssignmentExternal", "campaign"] + goal_type: Optional[StrictStr] = Field(default=None, description="The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. If omitted, the value from the source experiment is used. ", alias="goalType") + goal_description: Optional[StrictStr] = Field(default=None, description="A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. If omitted, the value from the source experiment is used. ", alias="goalDescription") + __properties: ClassVar[List[str]] = ["isVariantAssignmentExternal", "campaign", "goalType", "goalDescription"] + + @field_validator('goal_type') + def goal_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['other', 'maximize_revenue', 'maximize_items_sold', 'optimize_discount_efficiency']): + raise ValueError("must be one of enum values ('other', 'maximize_revenue', 'maximize_items_sold', 'optimize_discount_efficiency')") + return value model_config = ConfigDict( validate_by_name=True, @@ -87,7 +99,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "isVariantAssignmentExternal": obj.get("isVariantAssignmentExternal"), - "campaign": ExperimentCampaignCopy.from_dict(obj["campaign"]) if obj.get("campaign") is not None else None + "campaign": ExperimentCampaignCopy.from_dict(obj["campaign"]) if obj.get("campaign") is not None else None, + "goalType": obj.get("goalType"), + "goalDescription": obj.get("goalDescription") }) return _obj diff --git a/talon_one/models/history.py b/talon_one/models/history.py index 13700d3..d57935f 100644 --- a/talon_one/models/history.py +++ b/talon_one/models/history.py @@ -19,7 +19,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Union +from typing import Any, ClassVar, Dict, List, Optional, Union from talon_one.models.best_prior_price_metadata import BestPriorPriceMetadata from typing import Optional, Set from typing_extensions import Self @@ -31,11 +31,12 @@ class History(BaseModel): """ # noqa: E501 id: StrictInt = Field(description="The ID of the historical price.") observed_at: datetime = Field(description="The date and time when the price was observed.", alias="observedAt") - context_id: StrictStr = Field(description="Identifier of the relevant context at the time the price was observed (e.g. summer sale). ", alias="contextId") + 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") + context_id: Optional[StrictStr] = Field(default='', description="This property is **deprecated**. Use `contextIds` instead. Defaults to an empty string. ", alias="contextId") price: Union[StrictFloat, StrictInt] = Field(description="Price of the item.") metadata: BestPriorPriceMetadata target: Dict[str, Any] - __properties: ClassVar[List[str]] = ["id", "observedAt", "contextId", "price", "metadata", "target"] + __properties: ClassVar[List[str]] = ["id", "observedAt", "contextIds", "contextId", "price", "metadata", "target"] model_config = ConfigDict( validate_by_name=True, @@ -93,7 +94,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "id": obj.get("id"), "observedAt": obj.get("observedAt"), - "contextId": obj.get("contextId"), + "contextIds": obj.get("contextIds"), + "contextId": obj.get("contextId") if obj.get("contextId") is not None else '', "price": obj.get("price"), "metadata": BestPriorPriceMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, "target": obj.get("target") diff --git a/talon_one/models/integration_event.py b/talon_one/models/integration_event.py index c452514..d1ddddc 100644 --- a/talon_one/models/integration_event.py +++ b/talon_one/models/integration_event.py @@ -30,7 +30,7 @@ class IntegrationEvent(BaseModel): """ # noqa: E501 profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") - type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string representing the event. Must not be a reserved event name.") + type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") attributes: Dict[str, Any] = Field(description="Arbitrary additional JSON data associated with the event.") __properties: ClassVar[List[str]] = ["profileId", "storeIntegrationId", "type", "attributes"] diff --git a/talon_one/models/integration_event_v2_request.py b/talon_one/models/integration_event_v2_request.py index fceef02..14099b7 100644 --- a/talon_one/models/integration_event_v2_request.py +++ b/talon_one/models/integration_event_v2_request.py @@ -31,7 +31,7 @@ class IntegrationEventV2Request(BaseModel): profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds") - type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. ") + type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute).") response_content: Optional[List[StrictStr]] = Field(default=None, description="Extends the response with the chosen data entities. Use this property to get as much data back as needed from one request instead of sending extra requests to other endpoints. ", alias="responseContent") loyalty_cards: Optional[Annotated[List[StrictStr], Field(max_length=1)]] = Field(default=None, description="Identifiers of the loyalty cards used during this event.", alias="loyaltyCards") diff --git a/talon_one/models/integration_event_v3_request.py b/talon_one/models/integration_event_v3_request.py index 8def776..935effa 100644 --- a/talon_one/models/integration_event_v3_request.py +++ b/talon_one/models/integration_event_v3_request.py @@ -31,14 +31,13 @@ class IntegrationEventV3Request(BaseModel): profile_id: StrictStr = Field(description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds") - integration_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The unique ID of the current event. Only one event with this ID could be activated, duplicated events are forbidden. ", alias="integrationId") - type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. ") + type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute).") - connected_session_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The ID of the session that happened in the past.", alias="connectedSessionID") - previous_event_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The unique identifier of the event that happened in the past.", alias="previousEventID") + integration_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The unique ID of the event. Only one event with this ID can be registered. ", alias="integrationId") + connected_session_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail.", alias="connectedSessionId") loyalty_cards: Optional[Annotated[List[StrictStr], Field(max_length=1)]] = Field(default=None, description="Identifiers of the loyalty cards used during this event.", alias="loyaltyCards") response_content: Optional[List[StrictStr]] = Field(default=None, description="Optional list of requested information to be present on the response related to the tracking custom event. ", alias="responseContent") - __properties: ClassVar[List[str]] = ["profileId", "storeIntegrationId", "evaluableCampaignIds", "integrationId", "type", "attributes", "connectedSessionID", "previousEventID", "loyaltyCards", "responseContent"] + __properties: ClassVar[List[str]] = ["profileId", "storeIntegrationId", "evaluableCampaignIds", "type", "attributes", "integrationId", "connectedSessionId", "loyaltyCards", "responseContent"] @field_validator('response_content') def response_content_validate_enum(cls, value): @@ -105,11 +104,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "profileId": obj.get("profileId"), "storeIntegrationId": obj.get("storeIntegrationId"), "evaluableCampaignIds": obj.get("evaluableCampaignIds"), - "integrationId": obj.get("integrationId"), "type": obj.get("type"), "attributes": obj.get("attributes"), - "connectedSessionID": obj.get("connectedSessionID"), - "previousEventID": obj.get("previousEventID"), + "integrationId": obj.get("integrationId"), + "connectedSessionId": obj.get("connectedSessionId"), "loyaltyCards": obj.get("loyaltyCards"), "responseContent": obj.get("responseContent") }) diff --git a/talon_one/models/integration_hub_event_payload_loyalty_profile_based_notification.py b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_notification.py index ff766e4..c48a8ae 100644 --- a/talon_one/models/integration_hub_event_payload_loyalty_profile_based_notification.py +++ b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_notification.py @@ -31,20 +31,21 @@ class IntegrationHubEventPayloadLoyaltyProfileBasedNotification(BaseModel): """ # noqa: E501 profile_integration_id: StrictStr = Field(alias="ProfileIntegrationID") loyalty_program_id: StrictInt = Field(alias="LoyaltyProgramID") + loyalty_program_name: StrictStr = Field(description="The name of the loyalty program.", alias="LoyaltyProgramName") 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") 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") - current_tier: Optional[StrictStr] = Field(default=None, alias="CurrentTier") old_tier: Optional[StrictStr] = Field(default=None, alias="OldTier") tier_expiration_date: Optional[datetime] = Field(default=None, alias="TierExpirationDate") timestamp_of_tier_change: Optional[datetime] = Field(default=None, alias="TimestampOfTierChange") points_required_to_the_next_tier: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="PointsRequiredToTheNextTier") next_tier: Optional[StrictStr] = Field(default=None, alias="NextTier") - __properties: ClassVar[List[str]] = ["ProfileIntegrationID", "LoyaltyProgramID", "SubledgerID", "SourceOfEvent", "EmployeeName", "UserID", "CurrentPoints", "Actions", "PublishedAt", "CurrentTier", "OldTier", "TierExpirationDate", "TimestampOfTierChange", "PointsRequiredToTheNextTier", "NextTier"] + __properties: ClassVar[List[str]] = ["ProfileIntegrationID", "LoyaltyProgramID", "LoyaltyProgramName", "SubledgerID", "SourceOfEvent", "CurrentTier", "EmployeeName", "UserID", "CurrentPoints", "Actions", "PublishedAt", "OldTier", "TierExpirationDate", "TimestampOfTierChange", "PointsRequiredToTheNextTier", "NextTier"] model_config = ConfigDict( validate_by_name=True, @@ -106,14 +107,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "ProfileIntegrationID": obj.get("ProfileIntegrationID"), "LoyaltyProgramID": obj.get("LoyaltyProgramID"), + "LoyaltyProgramName": obj.get("LoyaltyProgramName"), "SubledgerID": obj.get("SubledgerID"), "SourceOfEvent": obj.get("SourceOfEvent"), + "CurrentTier": obj.get("CurrentTier"), "EmployeeName": obj.get("EmployeeName"), "UserID": obj.get("UserID"), "CurrentPoints": obj.get("CurrentPoints"), "Actions": [IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.from_dict(_item) for _item in obj["Actions"]] if obj.get("Actions") is not None else None, "PublishedAt": obj.get("PublishedAt"), - "CurrentTier": obj.get("CurrentTier"), "OldTier": obj.get("OldTier"), "TierExpirationDate": obj.get("TierExpirationDate"), "TimestampOfTierChange": obj.get("TimestampOfTierChange"), 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 1bcee00..a28c38f 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 @@ -31,14 +31,16 @@ class IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification(Bas """ # noqa: E501 profile_integration_id: StrictStr = Field(alias="ProfileIntegrationID") loyalty_program_id: StrictInt = Field(alias="LoyaltyProgramID") + loyalty_program_name: StrictStr = Field(description="The name of the loyalty program.", alias="LoyaltyProgramName") 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") 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", "SubledgerID", "SourceOfEvent", "EmployeeName", "UserID", "CurrentPoints", "Actions", "PublishedAt"] + __properties: ClassVar[List[str]] = ["ProfileIntegrationID", "LoyaltyProgramID", "LoyaltyProgramName", "SubledgerID", "SourceOfEvent", "CurrentTier", "EmployeeName", "UserID", "CurrentPoints", "Actions", "PublishedAt"] model_config = ConfigDict( validate_by_name=True, @@ -100,8 +102,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "ProfileIntegrationID": obj.get("ProfileIntegrationID"), "LoyaltyProgramID": obj.get("LoyaltyProgramID"), + "LoyaltyProgramName": obj.get("LoyaltyProgramName"), "SubledgerID": obj.get("SubledgerID"), "SourceOfEvent": obj.get("SourceOfEvent"), + "CurrentTier": obj.get("CurrentTier"), "EmployeeName": obj.get("EmployeeName"), "UserID": obj.get("UserID"), "CurrentPoints": obj.get("CurrentPoints"), diff --git a/talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py index 64ea7fb..adeeb37 100644 --- a/talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py +++ b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py @@ -30,15 +30,16 @@ class IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification(Bas """ # noqa: E501 profile_integration_id: StrictStr = Field(alias="ProfileIntegrationID") loyalty_program_id: StrictInt = Field(alias="LoyaltyProgramID") + loyalty_program_name: StrictStr = Field(description="The name of the loyalty program.", alias="LoyaltyProgramName") subledger_id: StrictStr = Field(alias="SubledgerID") source_of_event: StrictStr = Field(alias="SourceOfEvent") - current_tier: Optional[StrictStr] = Field(default=None, alias="CurrentTier") + current_tier: Optional[StrictStr] = Field(default=None, description="The name of the customer's current tier, or null if the customer was downgraded below all tiers.", alias="CurrentTier") current_points: Union[StrictFloat, StrictInt] = Field(alias="CurrentPoints") old_tier: Optional[StrictStr] = Field(default=None, alias="OldTier") tier_expiration_date: Optional[datetime] = Field(default=None, alias="TierExpirationDate") timestamp_of_tier_change: Optional[datetime] = Field(default=None, alias="TimestampOfTierChange") published_at: datetime = Field(description="Timestamp when the event was published.", alias="PublishedAt") - __properties: ClassVar[List[str]] = ["ProfileIntegrationID", "LoyaltyProgramID", "SubledgerID", "SourceOfEvent", "CurrentTier", "CurrentPoints", "OldTier", "TierExpirationDate", "TimestampOfTierChange", "PublishedAt"] + __properties: ClassVar[List[str]] = ["ProfileIntegrationID", "LoyaltyProgramID", "LoyaltyProgramName", "SubledgerID", "SourceOfEvent", "CurrentTier", "CurrentPoints", "OldTier", "TierExpirationDate", "TimestampOfTierChange", "PublishedAt"] model_config = ConfigDict( validate_by_name=True, @@ -93,6 +94,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "ProfileIntegrationID": obj.get("ProfileIntegrationID"), "LoyaltyProgramID": obj.get("LoyaltyProgramID"), + "LoyaltyProgramName": obj.get("LoyaltyProgramName"), "SubledgerID": obj.get("SubledgerID"), "SourceOfEvent": obj.get("SourceOfEvent"), "CurrentTier": obj.get("CurrentTier"), diff --git a/talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py index 66b8269..1521999 100644 --- a/talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py +++ b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py @@ -30,9 +30,10 @@ class IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification(BaseM """ # noqa: E501 profile_integration_id: StrictStr = Field(alias="ProfileIntegrationID") loyalty_program_id: StrictInt = Field(alias="LoyaltyProgramID") + loyalty_program_name: StrictStr = Field(description="The name of the loyalty program.", alias="LoyaltyProgramName") subledger_id: StrictStr = Field(alias="SubledgerID") source_of_event: StrictStr = Field(alias="SourceOfEvent") - current_tier: Optional[StrictStr] = Field(default=None, alias="CurrentTier") + current_tier: StrictStr = Field(description="The name of the customer's current tier.", alias="CurrentTier") current_points: Union[StrictFloat, StrictInt] = Field(alias="CurrentPoints") old_tier: Optional[StrictStr] = Field(default=None, alias="OldTier") points_required_to_the_next_tier: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="PointsRequiredToTheNextTier") @@ -40,7 +41,7 @@ class IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification(BaseM tier_expiration_date: Optional[datetime] = Field(default=None, alias="TierExpirationDate") timestamp_of_tier_change: Optional[datetime] = Field(default=None, alias="TimestampOfTierChange") published_at: datetime = Field(description="Timestamp when the event was published.", alias="PublishedAt") - __properties: ClassVar[List[str]] = ["ProfileIntegrationID", "LoyaltyProgramID", "SubledgerID", "SourceOfEvent", "CurrentTier", "CurrentPoints", "OldTier", "PointsRequiredToTheNextTier", "NextTier", "TierExpirationDate", "TimestampOfTierChange", "PublishedAt"] + __properties: ClassVar[List[str]] = ["ProfileIntegrationID", "LoyaltyProgramID", "LoyaltyProgramName", "SubledgerID", "SourceOfEvent", "CurrentTier", "CurrentPoints", "OldTier", "PointsRequiredToTheNextTier", "NextTier", "TierExpirationDate", "TimestampOfTierChange", "PublishedAt"] model_config = ConfigDict( validate_by_name=True, @@ -95,6 +96,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "ProfileIntegrationID": obj.get("ProfileIntegrationID"), "LoyaltyProgramID": obj.get("LoyaltyProgramID"), + "LoyaltyProgramName": obj.get("LoyaltyProgramName"), "SubledgerID": obj.get("SubledgerID"), "SourceOfEvent": obj.get("SourceOfEvent"), "CurrentTier": obj.get("CurrentTier"), diff --git a/talon_one/models/integration_hub_event_record.py b/talon_one/models/integration_hub_event_record.py index 95f408e..ce0255c 100644 --- a/talon_one/models/integration_hub_event_record.py +++ b/talon_one/models/integration_hub_event_record.py @@ -34,9 +34,10 @@ class IntegrationHubEventRecord(BaseModel): event_data: Optional[Any] = Field(alias="EventData") published_at: datetime = Field(alias="PublishedAt") processed_at: Optional[datetime] = Field(default=None, alias="ProcessedAt") + delivered_at: Optional[datetime] = Field(default=None, alias="DeliveredAt") process_after: datetime = Field(alias="ProcessAfter") retry: StrictInt = Field(alias="Retry") - __properties: ClassVar[List[str]] = ["Id", "FlowId", "EventType", "EventData", "PublishedAt", "ProcessedAt", "ProcessAfter", "Retry"] + __properties: ClassVar[List[str]] = ["Id", "FlowId", "EventType", "EventData", "PublishedAt", "ProcessedAt", "DeliveredAt", "ProcessAfter", "Retry"] model_config = ConfigDict( validate_by_name=True, @@ -100,6 +101,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "EventData": obj.get("EventData"), "PublishedAt": obj.get("PublishedAt"), "ProcessedAt": obj.get("ProcessedAt"), + "DeliveredAt": obj.get("DeliveredAt"), "ProcessAfter": obj.get("ProcessAfter"), "Retry": obj.get("Retry") }) diff --git a/talon_one/models/integration_hub_event_status_update.py b/talon_one/models/integration_hub_event_status_update.py new file mode 100644 index 0000000..d0108c6 --- /dev/null +++ b/talon_one/models/integration_hub_event_status_update.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, 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 IntegrationHubEventStatusUpdate(BaseModel): + """ + IntegrationHubEventStatusUpdate + """ # noqa: E501 + event_id: StrictInt = Field(description="The ID of the integration hub event.", alias="EventId") + status: StrictStr = Field(description="The delivery outcome for the event.", alias="Status") + __properties: ClassVar[List[str]] = ["EventId", "Status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['delivered', 'failed']): + raise ValueError("must be one of enum values ('delivered', 'failed')") + 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 IntegrationHubEventStatusUpdate 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 IntegrationHubEventStatusUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "EventId": obj.get("EventId"), + "Status": obj.get("Status") + }) + return _obj + + diff --git a/talon_one/models/new_campaign.py b/talon_one/models/new_campaign.py index 1418073..acc431c 100644 --- a/talon_one/models/new_campaign.py +++ b/talon_one/models/new_campaign.py @@ -62,8 +62,8 @@ def state_validate_enum(cls, value): def features_validate_enum(cls, value): """Validates the enum""" for i in value: - if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements']): - raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements')") + if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents']): + raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents')") return value @field_validator('type') diff --git a/talon_one/models/new_campaign_template.py b/talon_one/models/new_campaign_template.py index 27d65b5..7016651 100644 --- a/talon_one/models/new_campaign_template.py +++ b/talon_one/models/new_campaign_template.py @@ -66,8 +66,8 @@ def features_validate_enum(cls, value): return value for i in value: - if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements']): - raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements')") + if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents']): + raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents')") return value @field_validator('campaign_type') diff --git a/talon_one/models/new_event.py b/talon_one/models/new_event.py index 6a6f162..a55ed37 100644 --- a/talon_one/models/new_event.py +++ b/talon_one/models/new_event.py @@ -30,7 +30,7 @@ class NewEvent(BaseModel): """ # noqa: E501 profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") - type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string representing the event. Must not be a reserved event name.") + type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") attributes: Dict[str, Any] = Field(description="Arbitrary additional JSON data associated with the event.") session_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The ID of the session that this event occurred in.", alias="sessionId") __properties: ClassVar[List[str]] = ["profileId", "storeIntegrationId", "type", "attributes", "sessionId"] diff --git a/talon_one/models/new_event_v3_entity.py b/talon_one/models/new_event_v3_entity.py new file mode 100644 index 0000000..0b956ff --- /dev/null +++ b/talon_one/models/new_event_v3_entity.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class NewEventV3Entity(BaseModel): + """ + NewEventV3Entity + """ # noqa: E501 + integration_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The unique ID of the event. Only one event with this ID can be registered. ", alias="integrationId") + __properties: ClassVar[List[str]] = ["integrationId"] + + 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 NewEventV3Entity 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 NewEventV3Entity from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "integrationId": obj.get("integrationId") + }) + return _obj + + diff --git a/talon_one/models/new_experiment.py b/talon_one/models/new_experiment.py index ec0102a..98f0640 100644 --- a/talon_one/models/new_experiment.py +++ b/talon_one/models/new_experiment.py @@ -37,8 +37,8 @@ class NewExperiment(BaseModel): @field_validator('goal_type') def goal_type_validate_enum(cls, value): """Validates the enum""" - if value not in set(['other', 'maximize_revenue', 'optimize_discount_efficiency', 'maximize_items_sold']): - raise ValueError("must be one of enum values ('other', 'maximize_revenue', 'optimize_discount_efficiency', 'maximize_items_sold')") + if value not in set(['other', 'maximize_revenue', 'maximize_items_sold', 'optimize_discount_efficiency']): + raise ValueError("must be one of enum values ('other', 'maximize_revenue', 'maximize_items_sold', 'optimize_discount_efficiency')") return value model_config = ConfigDict( @@ -97,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "isVariantAssignmentExternal": obj.get("isVariantAssignmentExternal"), "campaign": NewCampaign.from_dict(obj["campaign"]) if obj.get("campaign") is not None else None, - "goalType": obj.get("goalType"), + "goalType": obj.get("goalType") if obj.get("goalType") is not None else 'other', "goalDescription": obj.get("goalDescription") }) return _obj diff --git a/talon_one/models/new_revision_version.py b/talon_one/models/new_revision_version.py index 1c2c6d8..b62a299 100644 --- a/talon_one/models/new_revision_version.py +++ b/talon_one/models/new_revision_version.py @@ -53,8 +53,8 @@ def features_validate_enum(cls, value): return value for i in value: - if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements']): - raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements')") + if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents']): + raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents')") return value model_config = ConfigDict( diff --git a/talon_one/models/revision_version.py b/talon_one/models/revision_version.py index be1657e..46686c6 100644 --- a/talon_one/models/revision_version.py +++ b/talon_one/models/revision_version.py @@ -61,8 +61,8 @@ def features_validate_enum(cls, value): return value for i in value: - if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements']): - raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements')") + if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents']): + raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents')") return value model_config = ConfigDict( diff --git a/talon_one/models/reward.py b/talon_one/models/reward.py index bcef714..4012442 100644 --- a/talon_one/models/reward.py +++ b/talon_one/models/reward.py @@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from talon_one.models.binding import Binding +from talon_one.models.reward_points_required import RewardPointsRequired from talon_one.models.rule import Rule from typing import Optional, Set from typing_extensions import Self @@ -44,7 +45,8 @@ class Reward(BaseModel): 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.") 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.") - __properties: ClassVar[List[str]] = ["id", "created", "accountId", "name", "apiName", "description", "applicationIds", "sandbox", "visibilityConditions", "rule", "bindings", "modified", "status"] + 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"] @field_validator('status') def status_validate_enum(cls, value): @@ -105,6 +107,13 @@ def to_dict(self) -> Dict[str, Any]: if _item_bindings: _items.append(_item_bindings.to_dict()) _dict['bindings'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in points_required (list) + _items = [] + if self.points_required: + for _item_points_required in self.points_required: + if _item_points_required: + _items.append(_item_points_required.to_dict()) + _dict['pointsRequired'] = _items return _dict @classmethod @@ -129,7 +138,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "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"), - "status": obj.get("status") + "status": obj.get("status"), + "pointsRequired": [RewardPointsRequired.from_dict(_item) for _item in obj["pointsRequired"]] if obj.get("pointsRequired") is not None else None }) return _obj diff --git a/talon_one/models/reward_points_required.py b/talon_one/models/reward_points_required.py new file mode 100644 index 0000000..136add3 --- /dev/null +++ b/talon_one/models/reward_points_required.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RewardPointsRequired(BaseModel): + """ + The loyalty points required to activate a reward. + """ # noqa: E501 + id: Optional[StrictInt] = Field(default=None, description="The ID of the `pointsRequired` entry. When updating a reward, include this property to update an existing entry. Omit it to create a new one. ") + amount: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="The number of loyalty points required to activate the reward.") + loyalty_program_id: StrictInt = Field(description="The ID of the associated loyalty program.", alias="loyaltyProgramId") + subledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program from which points are deducted when activating the reward. To specify the main ledger, provide an empty string (\"\"). ", alias="subledgerId") + __properties: ClassVar[List[str]] = ["id", "amount", "loyaltyProgramId", "subledgerId"] + + 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 RewardPointsRequired 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 RewardPointsRequired 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"), + "amount": obj.get("amount"), + "loyaltyProgramId": obj.get("loyaltyProgramId"), + "subledgerId": obj.get("subledgerId") + }) + return _obj + + diff --git a/talon_one/models/support_request.py b/talon_one/models/support_request.py new file mode 100644 index 0000000..c589bf0 --- /dev/null +++ b/talon_one/models/support_request.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SupportRequest(BaseModel): + """ + Summary of a support request created by a customer support agent. + """ # noqa: E501 + id: StrictInt = Field(description="Identifier of the support request.") + application_id: StrictInt = Field(description="Identifier of the Application connected to the loyalty program or the campaign. It is displayed in your Talon.One deployment URL.", alias="applicationId") + campaign_id: Optional[StrictInt] = Field(default=None, description="Identifier of the campaign where the coupon or gift card is created.", alias="campaignId") + loyalty_program_id: Optional[StrictInt] = Field(default=None, description="Identifier of the loyalty program where the points are added or deducted.", alias="loyaltyProgramId") + subledger_id: Optional[StrictInt] = Field(default=None, description="Identifier of the subledger the points are added to or deducted from. If there is no existing subledger with this ID, the subledger is created automatically.", alias="subledgerId") + created_by_user: StrictStr = Field(description="Email address of the customer support agent who created the support request.", alias="createdByUser") + created_at: datetime = Field(description="Timestamp when the request was made.", alias="createdAt") + customer_profile_id: StrictStr = Field(description="Integration ID of the customer profile linked to the support request.", alias="customerProfileId") + request_type: StrictStr = Field(description="Type of reward requested, including gift cards, personal coupons, and loyalty point additions or deductions.", alias="requestType") + request_value: Optional[Union[Annotated[float, Field(strict=True, gt=0)], Annotated[int, Field(strict=True, gt=0)]]] = Field(default=None, description="Requested monetary balance of the gift card or the number of loyalty points to be added or deducted.", alias="requestValue") + request_note: StrictStr = Field(description="Notes attached to the support request.", alias="requestNote") + request_status: StrictStr = Field(description="Current status of the support request.", alias="requestStatus") + processed_at: Optional[datetime] = Field(default=None, description="Timestamp when the request was approved or rejected.", alias="processedAt") + processing_note: Optional[StrictStr] = Field(default=None, description="Notes attached by the admin when rejecting or approving a request.", alias="processingNote") + processed_by_user: Optional[StrictStr] = Field(default=None, description="Email address of the admin who approved or rejected the support request.", alias="processedByUser") + __properties: ClassVar[List[str]] = ["id", "applicationId", "campaignId", "loyaltyProgramId", "subledgerId", "createdByUser", "createdAt", "customerProfileId", "requestType", "requestValue", "requestNote", "requestStatus", "processedAt", "processingNote", "processedByUser"] + + @field_validator('request_type') + def request_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['gift_card', 'personal_coupon', 'loyalty_points_added', 'loyalty_points_deducted']): + raise ValueError("must be one of enum values ('gift_card', 'personal_coupon', 'loyalty_points_added', 'loyalty_points_deducted')") + return value + + @field_validator('request_status') + def request_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending_approval', 'approved', 'rejected']): + raise ValueError("must be one of enum values ('pending_approval', 'approved', 'rejected')") + 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 SupportRequest 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 SupportRequest 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"), + "applicationId": obj.get("applicationId"), + "campaignId": obj.get("campaignId"), + "loyaltyProgramId": obj.get("loyaltyProgramId"), + "subledgerId": obj.get("subledgerId"), + "createdByUser": obj.get("createdByUser"), + "createdAt": obj.get("createdAt"), + "customerProfileId": obj.get("customerProfileId"), + "requestType": obj.get("requestType"), + "requestValue": obj.get("requestValue"), + "requestNote": obj.get("requestNote"), + "requestStatus": obj.get("requestStatus"), + "processedAt": obj.get("processedAt"), + "processingNote": obj.get("processingNote"), + "processedByUser": obj.get("processedByUser") + }) + return _obj + + diff --git a/talon_one/models/support_request_input.py b/talon_one/models/support_request_input.py new file mode 100644 index 0000000..458e728 --- /dev/null +++ b/talon_one/models/support_request_input.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SupportRequestInput(BaseModel): + """ + SupportRequestInput + """ # noqa: E501 + application_id: StrictInt = Field(description="Identifier of the Application connected to the loyalty program or the campaign. It is displayed in your Talon.One deployment URL.", alias="applicationId") + campaign_id: Optional[StrictInt] = Field(default=None, description="Identifier of the campaign where the coupon or gift card is created.", alias="campaignId") + loyalty_program_id: Optional[StrictInt] = Field(default=None, description="Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.", alias="loyaltyProgramId") + subledger_id: Optional[StrictInt] = Field(default=None, description="Identifier of the subledger the points are added to or deducted from. If there is no existing subledger with this ID, the subledger is created automatically.", alias="subledgerId") + customer_profile_id: StrictStr = Field(description="Integration ID of the customer profile linked to the support request.", alias="customerProfileId") + request_type: StrictStr = Field(description="Type of reward requested, including gift cards, personal coupons, and loyalty point additions or deductions.", alias="requestType") + request_value: Optional[Union[Annotated[float, Field(strict=True, gt=0)], Annotated[int, Field(strict=True, gt=0)]]] = Field(default=None, description="Requested monetary balance of the gift card or the number of loyalty points to be added or deducted.", alias="requestValue") + request_note: StrictStr = Field(description="Notes attached to the support request.", alias="requestNote") + __properties: ClassVar[List[str]] = ["applicationId", "campaignId", "loyaltyProgramId", "subledgerId", "customerProfileId", "requestType", "requestValue", "requestNote"] + + @field_validator('request_type') + def request_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['gift_card', 'personal_coupon', 'loyalty_points_added', 'loyalty_points_deducted']): + raise ValueError("must be one of enum values ('gift_card', 'personal_coupon', 'loyalty_points_added', 'loyalty_points_deducted')") + 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 SupportRequestInput 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 SupportRequestInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "applicationId": obj.get("applicationId"), + "campaignId": obj.get("campaignId"), + "loyaltyProgramId": obj.get("loyaltyProgramId"), + "subledgerId": obj.get("subledgerId"), + "customerProfileId": obj.get("customerProfileId"), + "requestType": obj.get("requestType"), + "requestValue": obj.get("requestValue"), + "requestNote": obj.get("requestNote") + }) + return _obj + + diff --git a/talon_one/models/talang_attribute.py b/talon_one/models/talang_attribute.py index 2c05a41..9188e6e 100644 --- a/talon_one/models/talang_attribute.py +++ b/talon_one/models/talang_attribute.py @@ -44,8 +44,8 @@ def entity_validate_enum(cls, value): if value is None: return value - if value not in set(['AdvocateProfile', 'Account', 'Application', 'AwardedGiveaway', 'Bundle', 'Campaign', 'CartItem', 'Coupon', 'CustomerProfile', 'CustomerSession', 'Event', 'Item', 'Loyalty', 'LoyaltyCard', 'Profile', 'Giveaway', 'Referral', 'Session', 'Store', 'Achievements']): - raise ValueError("must be one of enum values ('AdvocateProfile', 'Account', 'Application', 'AwardedGiveaway', 'Bundle', 'Campaign', 'CartItem', 'Coupon', 'CustomerProfile', 'CustomerSession', 'Event', 'Item', 'Loyalty', 'LoyaltyCard', 'Profile', 'Giveaway', 'Referral', 'Session', 'Store', 'Achievements')") + if value not in set(['AdvocateProfile', 'Account', 'Application', 'AwardedGiveaway', 'Bundle', 'Campaign', 'CartItem', 'Coupon', 'CustomerProfile', 'CustomerSession', 'Event', 'Item', 'Loyalty', 'LoyaltyCard', 'Profile', 'Giveaway', 'Referral', 'Session', 'Store', 'Achievements', 'AdvancedEvent', 'AdvancedEventConnectedSession']): + raise ValueError("must be one of enum values ('AdvocateProfile', 'Account', 'Application', 'AwardedGiveaway', 'Bundle', 'Campaign', 'CartItem', 'Coupon', 'CustomerProfile', 'CustomerSession', 'Event', 'Item', 'Loyalty', 'LoyaltyCard', 'Profile', 'Giveaway', 'Referral', 'Session', 'Store', 'Achievements', 'AdvancedEvent', 'AdvancedEventConnectedSession')") return value @field_validator('kind') diff --git a/talon_one/models/update_achievement_v2.py b/talon_one/models/update_achievement_v2.py index 053c28f..0fdf4ba 100644 --- a/talon_one/models/update_achievement_v2.py +++ b/talon_one/models/update_achievement_v2.py @@ -29,27 +29,22 @@ class UpdateAchievementV2(BaseModel): """ UpdateAchievementV2 """ # noqa: E501 - name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ") - title: Optional[StrictStr] = Field(default=None, description="The display name for the achievement in the Campaign Manager.") - description: Optional[StrictStr] = Field(default=None, description="A description of the achievement.") - target: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The required number of actions or the transactional milestone to complete the achievement.") + name: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ") + title: StrictStr = Field(description="The display name for the achievement in the Campaign Manager.") + description: StrictStr = Field(description="A description of the achievement.") + target: Union[StrictFloat, StrictInt] = Field(description="The required number of actions or the transactional milestone to complete the achievement.") period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ") recurrence_policy: Optional[StrictStr] = Field(default=None, 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") activation_policy: Optional[StrictStr] = Field(default=None, 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") fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate") 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 must be an RFC3339 timestamp string. ", alias="endDate") allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="allowRollbackAfterCompletion") - sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type.") - subscribed_applications: Optional[Annotated[List[StrictInt], Field(min_length=0)]] = Field(default=None, description="A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement.", alias="subscribedApplications") - timezone: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="A string containing an IANA timezone descriptor.") - __properties: ClassVar[List[str]] = ["name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "sandbox", "subscribedApplications", "timezone"] + subscribed_applications: Annotated[List[StrictInt], Field(min_length=0)] = Field(description="A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement.", alias="subscribedApplications") + __properties: ClassVar[List[str]] = ["name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "subscribedApplications"] @field_validator('name') def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if value is None: - return value - if not isinstance(value, str): value = str(value) @@ -138,9 +133,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "fixedStartDate": obj.get("fixedStartDate"), "endDate": obj.get("endDate"), "allowRollbackAfterCompletion": obj.get("allowRollbackAfterCompletion"), - "sandbox": obj.get("sandbox"), - "subscribedApplications": obj.get("subscribedApplications"), - "timezone": obj.get("timezone") + "subscribedApplications": obj.get("subscribedApplications") }) return _obj diff --git a/talon_one/models/update_campaign.py b/talon_one/models/update_campaign.py index 73d81cd..da1eb5a 100644 --- a/talon_one/models/update_campaign.py +++ b/talon_one/models/update_campaign.py @@ -65,8 +65,8 @@ def state_validate_enum(cls, value): def features_validate_enum(cls, value): """Validates the enum""" for i in value: - if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements']): - raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements')") + if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents']): + raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents')") return value @field_validator('type') diff --git a/talon_one/models/update_campaign_template.py b/talon_one/models/update_campaign_template.py index 5c33197..147a189 100644 --- a/talon_one/models/update_campaign_template.py +++ b/talon_one/models/update_campaign_template.py @@ -68,8 +68,8 @@ def features_validate_enum(cls, value): return value for i in value: - if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements']): - raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements')") + if i not in set(['coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents']): + raise ValueError("each list item must be one of ('coupons', 'referrals', 'loyalty', 'giveaways', 'strikethrough', 'achievements', 'advancedEvents')") return value @field_validator('campaign_type') diff --git a/talon_one/models/update_experiment.py b/talon_one/models/update_experiment.py index b66da2d..b341ada 100644 --- a/talon_one/models/update_experiment.py +++ b/talon_one/models/update_experiment.py @@ -30,8 +30,8 @@ class UpdateExperiment(BaseModel): """ # noqa: E501 is_variant_assignment_external: StrictBool = Field(description="The source of the assignment. - false - The variant assignment is handled internally by Talon.One. - true - The variant assignment is handled externally. ", alias="isVariantAssignmentExternal") campaign: UpdateCampaign - goal_type: Optional[StrictStr] = Field(default=None, description="The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. ", alias="goalType") - goal_description: Optional[StrictStr] = Field(default=None, description="A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. ", alias="goalDescription") + goal_type: Optional[StrictStr] = Field(default=None, description="The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. If omitted, the current value is preserved. ", alias="goalType") + goal_description: Optional[StrictStr] = Field(default=None, description="A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. If omitted, the current value is preserved. ", alias="goalDescription") __properties: ClassVar[List[str]] = ["isVariantAssignmentExternal", "campaign", "goalType", "goalDescription"] @field_validator('goal_type') @@ -40,8 +40,8 @@ def goal_type_validate_enum(cls, value): if value is None: return value - if value not in set(['other', 'maximize_revenue', 'optimize_discount_efficiency', 'maximize_items_sold']): - raise ValueError("must be one of enum values ('other', 'maximize_revenue', 'optimize_discount_efficiency', 'maximize_items_sold')") + if value not in set(['other', 'maximize_revenue', 'maximize_items_sold', 'optimize_discount_efficiency']): + raise ValueError("must be one of enum values ('other', 'maximize_revenue', 'maximize_items_sold', 'optimize_discount_efficiency')") return value model_config = ConfigDict( diff --git a/talon_one/models/update_reward.py b/talon_one/models/update_reward.py index f985148..ec5a70e 100644 --- a/talon_one/models/update_reward.py +++ b/talon_one/models/update_reward.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from talon_one.models.binding import Binding +from talon_one.models.reward_points_required import RewardPointsRequired from talon_one.models.rule import Rule from typing import Optional, Set from typing_extensions import Self @@ -36,7 +37,8 @@ class UpdateReward(BaseModel): 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") 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.") - __properties: ClassVar[List[str]] = ["name", "description", "status", "visibilityConditions", "rule", "bindings"] + 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"] @field_validator('status') def status_validate_enum(cls, value): @@ -97,6 +99,13 @@ def to_dict(self) -> Dict[str, Any]: if _item_bindings: _items.append(_item_bindings.to_dict()) _dict['bindings'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in points_required (list) + _items = [] + if self.points_required: + for _item_points_required in self.points_required: + if _item_points_required: + _items.append(_item_points_required.to_dict()) + _dict['pointsRequired'] = _items return _dict @classmethod @@ -114,7 +123,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "status": obj.get("status"), "visibilityConditions": Rule.from_dict(obj["visibilityConditions"]) if obj.get("visibilityConditions") 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 + "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 }) return _obj diff --git a/talon_one/models/update_support_request.py b/talon_one/models/update_support_request.py new file mode 100644 index 0000000..f51ea99 --- /dev/null +++ b/talon_one/models/update_support_request.py @@ -0,0 +1,97 @@ +# 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 UpdateSupportRequest(BaseModel): + """ + UpdateSupportRequest + """ # noqa: E501 + request_status: StrictStr = Field(description="Current status of the support request.", alias="requestStatus") + processing_note: Optional[StrictStr] = Field(default=None, description="Notes attached by the admin when rejecting or approving a request.", alias="processingNote") + __properties: ClassVar[List[str]] = ["requestStatus", "processingNote"] + + @field_validator('request_status') + def request_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['approved', 'rejected']): + raise ValueError("must be one of enum values ('approved', 'rejected')") + 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 UpdateSupportRequest 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 UpdateSupportRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "requestStatus": obj.get("requestStatus"), + "processingNote": obj.get("processingNote") + }) + return _obj + + diff --git a/test/test_achievement_base_v2.py b/test/test_achievement_base_v2.py index 644cc79..6df8684 100644 --- a/test/test_achievement_base_v2.py +++ b/test/test_achievement_base_v2.py @@ -45,9 +45,7 @@ def make_instance(self, include_optional) -> AchievementBaseV2: fixed_start_date = '2024-01-15T15:04:05+07:00', end_date = '2024-01-15T15:04:05+07:00', allow_rollback_after_completion = False, - sandbox = True, - subscribed_applications = [132, 97], - timezone = 'Europe/Berlin' + subscribed_applications = [132, 97] ) else: return AchievementBaseV2( diff --git a/test/test_achievement_v2.py b/test/test_achievement_v2.py index 5639b78..10b7495 100644 --- a/test/test_achievement_v2.py +++ b/test/test_achievement_v2.py @@ -47,13 +47,13 @@ def make_instance(self, include_optional) -> AchievementV2: fixed_start_date = '2024-01-15T15:04:05+07:00', end_date = '2024-01-15T15:04:05+07:00', allow_rollback_after_completion = False, - sandbox = True, subscribed_applications = [132, 97], - timezone = 'Europe/Berlin', user_id = 1234, created_by = 'John Doe', has_progress = True, - status = 'inprogress' + status = 'inprogress', + sandbox = True, + timezone = 'Europe/Berlin' ) else: return AchievementV2( @@ -65,10 +65,10 @@ def make_instance(self, include_optional) -> AchievementV2: target = 50, recurrence_policy = 'no_recurrence', activation_policy = 'fixed_schedule', - sandbox = True, subscribed_applications = [132, 97], - timezone = 'Europe/Berlin', user_id = 1234, + sandbox = True, + timezone = 'Europe/Berlin', ) """ diff --git a/test/test_application_event.py b/test/test_application_event.py index 9f89d85..70e544e 100644 --- a/test/test_application_event.py +++ b/test/test_application_event.py @@ -41,6 +41,7 @@ def make_instance(self, include_optional) -> ApplicationEvent: profile_id = 138, store_id = 56, store_integration_id = 'STORE-001', + integration_id = '175KJPS947296', session_id = 56, type = '', attributes = None, diff --git a/test/test_best_prior_price.py b/test/test_best_prior_price.py index 4a1f652..12ce918 100644 --- a/test/test_best_prior_price.py +++ b/test/test_best_prior_price.py @@ -37,8 +37,9 @@ def make_instance(self, include_optional) -> BestPriorPrice: return BestPriorPrice( id = 1, sku = 'NVR-GN-GV-UUP', - observed_at = '2020-11-10T23:00:00Z', - context_id = 'Summer Sale 2025', + observed_at = '2025-11-10T23:00:00Z', + context_ids = [SpringSale, SummerSale2025], + context_id = '', price = 99.99, metadata = talon_one.models.best_prior_price_metadata.BestPriorPriceMetadata( influencing_campaign_details = [ @@ -53,8 +54,8 @@ def make_instance(self, include_optional) -> BestPriorPrice: return BestPriorPrice( id = 1, sku = 'NVR-GN-GV-UUP', - observed_at = '2020-11-10T23:00:00Z', - context_id = 'Summer Sale 2025', + observed_at = '2025-11-10T23:00:00Z', + context_ids = [SpringSale, SummerSale2025], price = 99.99, metadata = talon_one.models.best_prior_price_metadata.BestPriorPriceMetadata( influencing_campaign_details = [ diff --git a/test/test_catalog_action.py b/test/test_catalog_action.py new file mode 100644 index 0000000..c6c2be4 --- /dev/null +++ b/test/test_catalog_action.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.catalog_action import CatalogAction + +class TestCatalogAction(unittest.TestCase): + """CatalogAction unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CatalogAction: + """Test CatalogAction + 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 `CatalogAction` + """ + model = CatalogAction() + if include_optional: + return CatalogAction( + type = 'ADD', + payload = None + ) + else: + return CatalogAction( + type = 'ADD', + payload = None, + ) + """ + + def testCatalogAction(self): + """Test CatalogAction""" + # 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_catalog_sync_request.py b/test/test_catalog_sync_request.py index 4e8e878..8c6eabb 100644 --- a/test/test_catalog_sync_request.py +++ b/test/test_catalog_sync_request.py @@ -36,14 +36,18 @@ def make_instance(self, include_optional) -> CatalogSyncRequest: if include_optional: return CatalogSyncRequest( actions = [ - talon_one.models.catalog_action.CatalogAction() + talon_one.models.catalog_action.CatalogAction( + type = 'ADD', + payload = talon_one.models.payload.payload(), ) ], version = 244 ) else: return CatalogSyncRequest( actions = [ - talon_one.models.catalog_action.CatalogAction() + talon_one.models.catalog_action.CatalogAction( + type = 'ADD', + payload = talon_one.models.payload.payload(), ) ], ) """ diff --git a/test/test_create_achievement_v2.py b/test/test_create_achievement_v2.py index 04e0f07..4fc221e 100644 --- a/test/test_create_achievement_v2.py +++ b/test/test_create_achievement_v2.py @@ -45,8 +45,8 @@ def make_instance(self, include_optional) -> CreateAchievementV2: fixed_start_date = '2024-01-15T15:04:05+07:00', end_date = '2024-01-15T15:04:05+07:00', allow_rollback_after_completion = False, - sandbox = True, subscribed_applications = [132, 97], + sandbox = True, timezone = 'Europe/Berlin' ) else: diff --git a/test/test_customer_session_v2.py b/test/test_customer_session_v2.py index 5ead26f..88ecce9 100644 --- a/test/test_customer_session_v2.py +++ b/test/test_customer_session_v2.py @@ -80,9 +80,10 @@ def make_instance(self, include_optional) -> CustomerSessionV2: attributes = {ShippingCity=Berlin}, first_session = True, update_count = 3, - total = 119.99, + total = 134.99, cart_item_total = 99.99, additional_cost_total = 20, + cart_item_additional_cost_total = 15, updated = '2020-02-08T14:15:22Z' ) else: @@ -93,9 +94,10 @@ def make_instance(self, include_optional) -> CustomerSessionV2: application_id = 322, first_session = True, update_count = 3, - total = 119.99, + total = 134.99, cart_item_total = 99.99, additional_cost_total = 20, + cart_item_additional_cost_total = 15, updated = '2020-02-08T14:15:22Z', ) """ diff --git a/test/test_event.py b/test/test_event.py index f59664d..8f98b71 100644 --- a/test/test_event.py +++ b/test/test_event.py @@ -42,6 +42,7 @@ def make_instance(self, include_optional) -> Event: store_integration_id = 'STORE-001', type = 'pageViewed', attributes = {myAttribute=myValue}, + integration_id = '175KJPS947296', session_id = '175KJPS947296', effects = [ None diff --git a/test/test_event_v3.py b/test/test_event_v3.py index eb1a852..285de00 100644 --- a/test/test_event_v3.py +++ b/test/test_event_v3.py @@ -35,20 +35,29 @@ def make_instance(self, include_optional) -> EventV3: model = EventV3() if include_optional: return EventV3( + connected_session_id = '175KJPS947296', + id = 6, + created = '2020-06-10T09:05:27.993483Z', + application_id = 322, profile_id = 'URNGV8294NV', store_integration_id = 'STORE-001', - evaluable_campaign_ids = [10, 12], - integration_id = '175KJPS947296', type = 'pageViewed', attributes = {myAttribute=myValue}, - connected_session_id = '175KJPS947296', - previous_event_id = '175KJPS947296' + integration_id = '175KJPS947296', + effects = [ + None + ] ) else: return EventV3( - profile_id = 'URNGV8294NV', - integration_id = '175KJPS947296', + id = 6, + created = '2020-06-10T09:05:27.993483Z', + application_id = 322, type = 'pageViewed', + attributes = {myAttribute=myValue}, + effects = [ + None + ], ) """ diff --git a/test/test_event_v3_connections.py b/test/test_event_v3_connections.py new file mode 100644 index 0000000..8246fa3 --- /dev/null +++ b/test/test_event_v3_connections.py @@ -0,0 +1,51 @@ +# 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.event_v3_connections import EventV3Connections + +class TestEventV3Connections(unittest.TestCase): + """EventV3Connections unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EventV3Connections: + """Test EventV3Connections + 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 `EventV3Connections` + """ + model = EventV3Connections() + if include_optional: + return EventV3Connections( + connected_session_id = '175KJPS947296' + ) + else: + return EventV3Connections( + ) + """ + + def testEventV3Connections(self): + """Test EventV3Connections""" + # 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_event_v3_entity.py b/test/test_event_v3_entity.py new file mode 100644 index 0000000..d0fe681 --- /dev/null +++ b/test/test_event_v3_entity.py @@ -0,0 +1,51 @@ +# 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.event_v3_entity import EventV3Entity + +class TestEventV3Entity(unittest.TestCase): + """EventV3Entity unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EventV3Entity: + """Test EventV3Entity + 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 `EventV3Entity` + """ + model = EventV3Entity() + if include_optional: + return EventV3Entity( + integration_id = '175KJPS947296' + ) + else: + return EventV3Entity( + ) + """ + + def testEventV3Entity(self): + """Test EventV3Entity""" + # 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_event_v3_request_entity.py b/test/test_event_v3_request_entity.py new file mode 100644 index 0000000..514094f --- /dev/null +++ b/test/test_event_v3_request_entity.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.event_v3_request_entity import EventV3RequestEntity + +class TestEventV3RequestEntity(unittest.TestCase): + """EventV3RequestEntity unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EventV3RequestEntity: + """Test EventV3RequestEntity + 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 `EventV3RequestEntity` + """ + model = EventV3RequestEntity() + if include_optional: + return EventV3RequestEntity( + profile_id = 'URNGV8294NV', + store_integration_id = 'STORE-001', + evaluable_campaign_ids = [10, 12], + type = 'pageViewed', + attributes = {myAttribute=myValue}, + integration_id = '175KJPS947296', + connected_session_id = '175KJPS947296' + ) + else: + return EventV3RequestEntity( + profile_id = 'URNGV8294NV', + type = 'pageViewed', + integration_id = '175KJPS947296', + ) + """ + + def testEventV3RequestEntity(self): + """Test EventV3RequestEntity""" + # 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_experiment_copy.py b/test/test_experiment_copy.py index dbfb0dd..cc0afc4 100644 --- a/test/test_experiment_copy.py +++ b/test/test_experiment_copy.py @@ -44,7 +44,9 @@ def make_instance(self, include_optional) -> ExperimentCopy: start_time = '2021-06-01T09:00:27.993483Z', end_time = '2021-09-10T01:00:00.993483Z', tags = [Summer, Shoes], - evaluation_group_id = 2, ), ) + evaluation_group_id = 2, ), + goal_type = 'other', + goal_description = '', ) ) else: return ExperimentCopy( @@ -57,7 +59,9 @@ def make_instance(self, include_optional) -> ExperimentCopy: start_time = '2021-06-01T09:00:27.993483Z', end_time = '2021-09-10T01:00:00.993483Z', tags = [Summer, Shoes], - evaluation_group_id = 2, ), ), + evaluation_group_id = 2, ), + goal_type = 'other', + goal_description = '', ), ) """ diff --git a/test/test_experiment_copy_experiment.py b/test/test_experiment_copy_experiment.py index 9b34152..f795d23 100644 --- a/test/test_experiment_copy_experiment.py +++ b/test/test_experiment_copy_experiment.py @@ -42,7 +42,9 @@ def make_instance(self, include_optional) -> ExperimentCopyExperiment: start_time = '2021-06-01T09:00:27.993483Z', end_time = '2021-09-10T01:00:00.993483Z', tags = [Summer, Shoes], - evaluation_group_id = 2, ) + evaluation_group_id = 2, ), + goal_type = 'other', + goal_description = '' ) else: return ExperimentCopyExperiment( diff --git a/test/test_history.py b/test/test_history.py index aa0ed56..5c96891 100644 --- a/test/test_history.py +++ b/test/test_history.py @@ -36,8 +36,9 @@ def make_instance(self, include_optional) -> History: if include_optional: return History( id = 1, - observed_at = '2020-11-10T23:00:00Z', - context_id = 'Summer Sale 2025', + observed_at = '2025-11-10T23:00:00Z', + context_ids = [SpringSale, SummerSale2025], + context_id = '', price = 99.99, metadata = talon_one.models.best_prior_price_metadata.BestPriorPriceMetadata( influencing_campaign_details = [ @@ -51,8 +52,8 @@ def make_instance(self, include_optional) -> History: else: return History( id = 1, - observed_at = '2020-11-10T23:00:00Z', - context_id = 'Summer Sale 2025', + observed_at = '2025-11-10T23:00:00Z', + context_ids = [SpringSale, SummerSale2025], price = 99.99, metadata = talon_one.models.best_prior_price_metadata.BestPriorPriceMetadata( influencing_campaign_details = [ diff --git a/test/test_integration_event_v3_request.py b/test/test_integration_event_v3_request.py index 9818473..aa02778 100644 --- a/test/test_integration_event_v3_request.py +++ b/test/test_integration_event_v3_request.py @@ -38,19 +38,18 @@ def make_instance(self, include_optional) -> IntegrationEventV3Request: profile_id = 'URNGV8294NV', store_integration_id = 'STORE-001', evaluable_campaign_ids = [10, 12], - integration_id = '175KJPS947296', type = 'pageViewed', attributes = {myAttribute=myValue}, + integration_id = '175KJPS947296', connected_session_id = '175KJPS947296', - previous_event_id = '175KJPS947296', loyalty_cards = [loyalty-card-1], response_content = [triggeredCampaigns, customerProfile] ) else: return IntegrationEventV3Request( profile_id = 'URNGV8294NV', - integration_id = '175KJPS947296', type = 'pageViewed', + integration_id = '175KJPS947296', ) """ diff --git a/test/test_integration_hub_event_payload_loyalty_profile_based_notification.py b/test/test_integration_hub_event_payload_loyalty_profile_based_notification.py index 4570455..f8b5381 100644 --- a/test/test_integration_hub_event_payload_loyalty_profile_based_notification.py +++ b/test/test_integration_hub_event_payload_loyalty_profile_based_notification.py @@ -37,8 +37,10 @@ def make_instance(self, include_optional) -> IntegrationHubEventPayloadLoyaltyPr return IntegrationHubEventPayloadLoyaltyProfileBasedNotification( profile_integration_id = '', loyalty_program_id = 56, + loyalty_program_name = '', subledger_id = '', source_of_event = '', + current_tier = '', employee_name = '', user_id = 56, current_points = 1.337, @@ -46,7 +48,6 @@ def make_instance(self, include_optional) -> IntegrationHubEventPayloadLoyaltyPr null ], published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - current_tier = '', old_tier = '', tier_expiration_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timestamp_of_tier_change = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), @@ -57,8 +58,10 @@ def make_instance(self, include_optional) -> IntegrationHubEventPayloadLoyaltyPr return IntegrationHubEventPayloadLoyaltyProfileBasedNotification( profile_integration_id = '', loyalty_program_id = 56, + loyalty_program_name = '', subledger_id = '', source_of_event = '', + current_tier = '', current_points = 1.337, published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) 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 39b5bd5..c6cff7d 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 @@ -37,8 +37,10 @@ def make_instance(self, include_optional) -> IntegrationHubEventPayloadLoyaltyPr return IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification( profile_integration_id = '', loyalty_program_id = 56, + loyalty_program_name = '', subledger_id = '', source_of_event = '', + current_tier = '', employee_name = '', user_id = 56, current_points = 1.337, @@ -51,8 +53,10 @@ def make_instance(self, include_optional) -> IntegrationHubEventPayloadLoyaltyPr return IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification( profile_integration_id = '', loyalty_program_id = 56, + loyalty_program_name = '', subledger_id = '', source_of_event = '', + current_tier = '', current_points = 1.337, published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) diff --git a/test/test_integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py b/test/test_integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py index a0e944a..d03f0c9 100644 --- a/test/test_integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py +++ b/test/test_integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py @@ -37,6 +37,7 @@ def make_instance(self, include_optional) -> IntegrationHubEventPayloadLoyaltyPr return IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification( profile_integration_id = '', loyalty_program_id = 56, + loyalty_program_name = '', subledger_id = '', source_of_event = '', current_tier = '', @@ -50,6 +51,7 @@ def make_instance(self, include_optional) -> IntegrationHubEventPayloadLoyaltyPr return IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification( profile_integration_id = '', loyalty_program_id = 56, + loyalty_program_name = '', subledger_id = '', source_of_event = '', current_points = 1.337, diff --git a/test/test_integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py b/test/test_integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py index 8e52c76..77ca2ec 100644 --- a/test/test_integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py +++ b/test/test_integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py @@ -37,6 +37,7 @@ def make_instance(self, include_optional) -> IntegrationHubEventPayloadLoyaltyPr return IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification( profile_integration_id = '', loyalty_program_id = 56, + loyalty_program_name = '', subledger_id = '', source_of_event = '', current_tier = '', @@ -52,8 +53,10 @@ def make_instance(self, include_optional) -> IntegrationHubEventPayloadLoyaltyPr return IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification( profile_integration_id = '', loyalty_program_id = 56, + loyalty_program_name = '', subledger_id = '', source_of_event = '', + current_tier = '', current_points = 1.337, published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) diff --git a/test/test_integration_hub_event_record.py b/test/test_integration_hub_event_record.py index c2c9891..9a1e0a8 100644 --- a/test/test_integration_hub_event_record.py +++ b/test/test_integration_hub_event_record.py @@ -41,6 +41,7 @@ def make_instance(self, include_optional) -> IntegrationHubEventRecord: event_data = None, published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), processed_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + delivered_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), process_after = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), retry = 56 ) diff --git a/test/test_integration_hub_event_status_update.py b/test/test_integration_hub_event_status_update.py new file mode 100644 index 0000000..bd43202 --- /dev/null +++ b/test/test_integration_hub_event_status_update.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.integration_hub_event_status_update import IntegrationHubEventStatusUpdate + +class TestIntegrationHubEventStatusUpdate(unittest.TestCase): + """IntegrationHubEventStatusUpdate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IntegrationHubEventStatusUpdate: + """Test IntegrationHubEventStatusUpdate + 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 `IntegrationHubEventStatusUpdate` + """ + model = IntegrationHubEventStatusUpdate() + if include_optional: + return IntegrationHubEventStatusUpdate( + event_id = 123, + status = 'delivered' + ) + else: + return IntegrationHubEventStatusUpdate( + event_id = 123, + status = 'delivered', + ) + """ + + def testIntegrationHubEventStatusUpdate(self): + """Test IntegrationHubEventStatusUpdate""" + # 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_new_event_v3_entity.py b/test/test_new_event_v3_entity.py new file mode 100644 index 0000000..fbaa71d --- /dev/null +++ b/test/test_new_event_v3_entity.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.new_event_v3_entity import NewEventV3Entity + +class TestNewEventV3Entity(unittest.TestCase): + """NewEventV3Entity unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NewEventV3Entity: + """Test NewEventV3Entity + 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 `NewEventV3Entity` + """ + model = NewEventV3Entity() + if include_optional: + return NewEventV3Entity( + integration_id = '175KJPS947296' + ) + else: + return NewEventV3Entity( + integration_id = '175KJPS947296', + ) + """ + + def testNewEventV3Entity(self): + """Test NewEventV3Entity""" + # 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_response.py b/test/test_price_history_response.py index cd7ddbf..91ede9f 100644 --- a/test/test_price_history_response.py +++ b/test/test_price_history_response.py @@ -39,8 +39,9 @@ def make_instance(self, include_optional) -> PriceHistoryResponse: history = [ talon_one.models.history.History( id = 1, - observed_at = '2020-11-10T23:00:00Z', - context_id = 'Summer Sale 2025', + observed_at = '2025-11-10T23:00:00Z', + context_ids = [SpringSale, SummerSale2025], + context_id = '', price = 99.99, metadata = talon_one.models.best_prior_price_metadata.BestPriorPriceMetadata( influencing_campaign_details = [ @@ -58,8 +59,9 @@ def make_instance(self, include_optional) -> PriceHistoryResponse: history = [ talon_one.models.history.History( id = 1, - observed_at = '2020-11-10T23:00:00Z', - context_id = 'Summer Sale 2025', + observed_at = '2025-11-10T23:00:00Z', + context_ids = [SpringSale, SummerSale2025], + context_id = '', price = 99.99, metadata = talon_one.models.best_prior_price_metadata.BestPriorPriceMetadata( influencing_campaign_details = [ diff --git a/test/test_reward.py b/test/test_reward.py index 340e5b5..9f7a990 100644 --- a/test/test_reward.py +++ b/test/test_reward.py @@ -81,7 +81,14 @@ def make_instance(self, include_optional) -> Reward: effects = [catch, [noop], [setDiscount, 10% off, [*, [., Session, Total], [/, 10, 100]]]], ), bindings = [], modified = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - status = 'active' + status = 'active', + points_required = [ + talon_one.models.reward_points_required.RewardPointsRequired( + id = 1, + amount = 500, + loyalty_program_id = 10, + subledger_id = 'mysubledger', ) + ] ) else: return Reward( diff --git a/test/test_reward_points_required.py b/test/test_reward_points_required.py new file mode 100644 index 0000000..bf7a53b --- /dev/null +++ b/test/test_reward_points_required.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.reward_points_required import RewardPointsRequired + +class TestRewardPointsRequired(unittest.TestCase): + """RewardPointsRequired unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RewardPointsRequired: + """Test RewardPointsRequired + 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 `RewardPointsRequired` + """ + model = RewardPointsRequired() + if include_optional: + return RewardPointsRequired( + id = 1, + amount = 500, + loyalty_program_id = 10, + subledger_id = 'mysubledger' + ) + else: + return RewardPointsRequired( + amount = 500, + loyalty_program_id = 10, + subledger_id = 'mysubledger', + ) + """ + + def testRewardPointsRequired(self): + """Test RewardPointsRequired""" + # 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_support_request.py b/test/test_support_request.py new file mode 100644 index 0000000..3dc192d --- /dev/null +++ b/test/test_support_request.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.support_request import SupportRequest + +class TestSupportRequest(unittest.TestCase): + """SupportRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SupportRequest: + """Test SupportRequest + 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 `SupportRequest` + """ + model = SupportRequest() + if include_optional: + return SupportRequest( + id = 1, + application_id = 322, + campaign_id = 100, + loyalty_program_id = 8, + subledger_id = 123, + created_by_user = 'support.agent.name@company.com', + created_at = '2025-07-20T22:00:00Z', + customer_profile_id = 'URNGV8294NV', + request_type = 'personal_coupon', + request_value = 20.5, + request_note = 'Support request for coupon failure.', + request_status = 'approved', + processed_at = '2025-07-20T22:10:00Z', + processing_note = 'Rejected as the customer was awarded points already.', + processed_by_user = 'admin.name@company.com' + ) + else: + return SupportRequest( + id = 1, + application_id = 322, + created_by_user = 'support.agent.name@company.com', + created_at = '2025-07-20T22:00:00Z', + customer_profile_id = 'URNGV8294NV', + request_type = 'personal_coupon', + request_note = 'Support request for coupon failure.', + request_status = 'approved', + ) + """ + + def testSupportRequest(self): + """Test SupportRequest""" + # 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_support_request_input.py b/test/test_support_request_input.py new file mode 100644 index 0000000..3d1b197 --- /dev/null +++ b/test/test_support_request_input.py @@ -0,0 +1,62 @@ +# 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.support_request_input import SupportRequestInput + +class TestSupportRequestInput(unittest.TestCase): + """SupportRequestInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SupportRequestInput: + """Test SupportRequestInput + 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 `SupportRequestInput` + """ + model = SupportRequestInput() + if include_optional: + return SupportRequestInput( + application_id = 322, + campaign_id = 100, + loyalty_program_id = 8, + subledger_id = 123, + customer_profile_id = 'URNGV8294NV', + request_type = 'personal_coupon', + request_value = 20.5, + request_note = 'Support request for coupon failure.' + ) + else: + return SupportRequestInput( + application_id = 322, + customer_profile_id = 'URNGV8294NV', + request_type = 'personal_coupon', + request_note = 'Support request for coupon failure.', + ) + """ + + def testSupportRequestInput(self): + """Test SupportRequestInput""" + # 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_achievement_v2.py b/test/test_update_achievement_v2.py index 74a213f..50132cd 100644 --- a/test/test_update_achievement_v2.py +++ b/test/test_update_achievement_v2.py @@ -45,12 +45,15 @@ def make_instance(self, include_optional) -> UpdateAchievementV2: fixed_start_date = '2024-01-15T15:04:05+07:00', end_date = '2024-01-15T15:04:05+07:00', allow_rollback_after_completion = False, - sandbox = True, - subscribed_applications = [132, 97], - timezone = 'Europe/Berlin' + subscribed_applications = [132, 97] ) else: return UpdateAchievementV2( + name = 'Order50Discount', + title = '50% off on 50th purchase.', + description = '50% off for every 50th purchase in a year.', + target = 50, + subscribed_applications = [132, 97], ) """ diff --git a/test/test_update_reward.py b/test/test_update_reward.py index 1c321ab..4ed40ed 100644 --- a/test/test_update_reward.py +++ b/test/test_update_reward.py @@ -74,7 +74,14 @@ def make_instance(self, include_optional) -> UpdateReward: ], condition = [and, [couponValid]], effects = [catch, [noop], [setDiscount, 10% off, [*, [., Session, Total], [/, 10, 100]]]], ), - bindings = [] + bindings = [], + points_required = [ + talon_one.models.reward_points_required.RewardPointsRequired( + id = 1, + amount = 500, + loyalty_program_id = 10, + subledger_id = 'mysubledger', ) + ] ) else: return UpdateReward( diff --git a/test/test_update_support_request.py b/test/test_update_support_request.py new file mode 100644 index 0000000..6c6c2b4 --- /dev/null +++ b/test/test_update_support_request.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.update_support_request import UpdateSupportRequest + +class TestUpdateSupportRequest(unittest.TestCase): + """UpdateSupportRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateSupportRequest: + """Test UpdateSupportRequest + 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 `UpdateSupportRequest` + """ + model = UpdateSupportRequest() + if include_optional: + return UpdateSupportRequest( + request_status = 'approved', + processing_note = 'Rejected as the customer was awarded points already.' + ) + else: + return UpdateSupportRequest( + request_status = 'approved', + ) + """ + + def testUpdateSupportRequest(self): + """Test UpdateSupportRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()