From f09fee8f2c22e8070ce90ce79b480a632436da20 Mon Sep 17 00:00:00 2001 From: Talon-One SDK Generator Date: Wed, 22 Jul 2026 10:41:11 +0000 Subject: [PATCH] update to 26.15.0 --- .openapi-generator/FILES | 138 +++- .openapi-generator/VERSION | 2 +- README.md | 46 +- docs/ApplicationEvent.md | 2 +- docs/ApplicationNotification.md | 29 - docs/ApplicationSession.md | 2 +- docs/AwardGiveawayBlock.md | 4 +- docs/AwardItemBlock.md | 4 +- docs/BaseNotification.md | 2 +- docs/BaseNotificationEntity.md | 2 +- docs/BaseNotificationPolicy.md | 36 ++ docs/BestPriorPrice.md | 2 +- docs/BetweenCheckAttributeBlock.md | 32 - docs/BulkApplicationNotification.md | 2 +- docs/CampaignEvaluationTreeChangedMessage.md | 2 +- docs/CampaignSetNode.md | 9 + docs/CatalogAction.md | 4 +- docs/CatalogActionOneOf.md | 30 + docs/CatalogActionOneOf1.md | 30 + docs/CatalogActionOneOf2.md | 30 + docs/CatalogActionOneOf3.md | 30 + docs/CatalogActionOneOf4.md | 30 + docs/CatalogActionOneOf5.md | 30 + docs/Change.md | 4 +- ...uteBlock.md => CheckAttributeBlockBase.md} | 16 +- docs/CheckAudienceBlock.md | 2 +- docs/CheckCouponBlock.md | 2 +- docs/CheckReferralBlock.md | 2 +- docs/ConfirmRisksRequest.md | 30 + docs/CouponCreationJob.md | 2 +- docs/CustomerProfileReward.md | 39 ++ docs/CustomerSession.md | 2 +- docs/DigitalPass.md | 32 + docs/DiscardRisksRequest.md | 31 + docs/Effect.md | 2 +- docs/EffectAllOfProps.md | 98 +++ docs/EffectProps.md | 99 +++ docs/Event.md | 2 +- docs/EventV3.md | 2 +- docs/Export.md | 2 +- docs/Giveaway.md | 2 +- docs/History.md | 2 +- docs/IntegrationApi.md | 33 +- docs/IntegrationEvent.md | 2 +- ...HubEventPayloadCouponBasedNotifications.md | 2 +- docs/IntegrationHubPaginatedEventPayload.md | 2 +- ...rationHubPaginatedEventPayloadDataInner.md | 63 ++ docs/InventoryReferral.md | 2 +- docs/LabelTarget.md | 30 + docs/ListCheckAttributeBlock.md | 31 - docs/ListWithCountCheckAttributeBlock.md | 32 - docs/MCPOAuthProtectedResource.md | 30 + docs/MCPOAuthServerMetadata.md | 35 + docs/NewBaseNotification.md | 2 +- docs/NewCouponCreationJob.md | 2 +- docs/NewCoupons.md | 4 +- docs/NewCouponsForMultipleRecipients.md | 2 +- docs/NewCustomerSession.md | 2 +- docs/NewDigitalPass.md | 34 + docs/NewEvent.md | 2 +- docs/NewReferral.md | 2 +- docs/NewReferralsForMultipleAdvocates.md | 2 +- docs/OutgoingIntegrationConfiguration.md | 2 +- .../OutgoingIntegrationConfigurationPolicy.md | 36 ++ ...grationTemplateWithConfigurationDetails.md | 2 +- docs/PassthroughBlock.md | 2 +- docs/PromotionBlock.md | 56 ++ docs/PromotionCheckAttributeBlock.md | 12 +- docs/PromotionGroupBlock.md | 6 +- docs/PromotionRuleV2.md | 2 +- docs/Referral.md | 2 +- docs/ReviewRisksRequest.md | 29 + docs/Risk.md | 4 + docs/RiskCriticalityUpdate.md | 30 + docs/RiskDetail.md | 4 + docs/ScalarCheckAttributeBlock.md | 31 - docs/ScimServiceProviderConfigResponse.md | 4 +- .../ScimServiceProviderConfigResponsePatch.md | 30 + docs/ScimServiceProviderConfigResponseSort.md | 30 + docs/ShowNotificationBlock.md | 4 +- docs/StrikethroughBlock.md | 43 ++ docs/StrikethroughCheckAttributeBlock.md | 12 +- docs/StrikethroughEffect.md | 4 +- docs/StrikethroughEffectProps.md | 33 + docs/StrikethroughGroupBlock.md | 6 +- docs/StrikethroughRuleV2.md | 2 +- docs/SupportRequest.md | 1 + docs/TemplateArgDef.md | 2 +- docs/UnaryCheckAttributeBlock.md | 30 - docs/UpdateAchievementProgressBlock.md | 34 + ...ateAchievementProgressBlock1Achievement.md | 33 + docs/UpdateAttributeValueBlock.md | 35 + docs/UpdateAttributeValueBlock1Attribute.md | 34 + docs/UpdateAttributeValueBlock1Target.md | 30 + docs/UpdateAudienceMembershipBlock.md | 34 + .../UpdateAudienceMembershipBlock1Audience.md | 33 + docs/UpdateCoupon.md | 2 +- docs/UpdateCouponBatch.md | 2 +- docs/UpdateCustomerProfileV2409Response.md | 31 + docs/User.md | 4 +- docs/WebhookAuthentication.md | 2 +- docs/WebhookAuthenticationAllOfData.md | 31 + docs/WebhookAuthenticationBase.md | 31 + docs/WebhookAuthenticationBaseOneOf.md | 31 + docs/WebhookAuthenticationBaseOneOf1.md | 31 + pyproject.toml | 6 +- requirements.txt | 2 +- setup.py | 4 +- talon_one/__init__.py | 94 ++- talon_one/api/integration_api.py | 48 +- talon_one/api_client.py | 19 +- talon_one/configuration.py | 25 +- talon_one/models/__init__.py | 46 +- talon_one/models/account_additional_cost.py | 14 +- talon_one/models/achievement.py | 7 +- talon_one/models/achievement_base.py | 7 +- talon_one/models/achievement_base_v2.py | 7 +- .../achievement_progress_with_definition.py | 7 +- talon_one/models/achievement_status_entry.py | 7 +- talon_one/models/achievement_v2.py | 7 +- .../models/add_loyalty_points_effect_props.py | 7 +- talon_one/models/application_event.py | 2 +- talon_one/models/application_session.py | 2 +- talon_one/models/attribute.py | 14 +- talon_one/models/award_giveaway_block.py | 32 +- talon_one/models/award_item_block.py | 32 +- talon_one/models/base_notification.py | 8 +- talon_one/models/base_notification_entity.py | 8 +- talon_one/models/base_notification_policy.py | 305 +++++++++ talon_one/models/best_prior_price.py | 8 +- .../models/bulk_application_notification.py | 6 +- talon_one/models/campaign_collection.py | 7 +- .../campaign_collection_without_payload.py | 7 +- ...ampaign_evaluation_tree_changed_message.py | 6 +- talon_one/models/campaign_set_branch_node.py | 4 +- talon_one/models/campaign_set_node.py | 153 +++-- .../models/campaign_template_collection.py | 7 +- .../card_ledger_transaction_log_entry.py | 7 +- ...r_transaction_log_entry_integration_api.py | 7 +- talon_one/models/catalog_action.py | 218 +++++-- talon_one/models/catalog_action_one_of.py | 99 +++ talon_one/models/catalog_action_one_of1.py | 99 +++ talon_one/models/catalog_action_one_of2.py | 99 +++ talon_one/models/catalog_action_one_of3.py | 99 +++ talon_one/models/catalog_action_one_of4.py | 99 +++ talon_one/models/catalog_action_one_of5.py | 99 +++ talon_one/models/change.py | 4 +- talon_one/models/check_attribute_block.py | 233 ------- .../models/check_attribute_block_base.py | 138 ++++ talon_one/models/check_audience_block.py | 14 +- talon_one/models/check_coupon_block.py | 14 +- talon_one/models/check_referral_block.py | 14 +- talon_one/models/code_generator_settings.py | 7 +- talon_one/models/collection.py | 7 +- .../models/collection_without_payload.py | 7 +- talon_one/models/confirm_risks_request.py | 91 +++ talon_one/models/coupon_creation_job.py | 2 +- talon_one/models/create_achievement.py | 7 +- talon_one/models/create_achievement_v2.py | 7 +- talon_one/models/custom_effect.py | 14 +- talon_one/models/customer_achievement.py | 7 +- talon_one/models/customer_profile_reward.py | 125 ++++ talon_one/models/customer_session.py | 2 +- .../deduct_loyalty_points_effect_props.py | 7 +- ...eck_attribute_block.py => digital_pass.py} | 49 +- ...bute_block.py => discard_risks_request.py} | 46 +- talon_one/models/effect.py | 13 +- talon_one/models/effect_all_of_props.py | 599 ++++++++++++++++++ talon_one/models/effect_props.py | 599 ++++++++++++++++++ talon_one/models/event.py | 2 +- talon_one/models/event_v3.py | 2 +- talon_one/models/export.py | 2 +- talon_one/models/generate_loyalty_card.py | 7 +- talon_one/models/giveaway.py | 2 +- talon_one/models/history.py | 8 +- talon_one/models/integration_event.py | 2 +- ...vent_payload_coupon_based_notifications.py | 2 +- ...integration_hub_paginated_event_payload.py | 12 +- ..._hub_paginated_event_payload_data_inner.py | 168 +++++ talon_one/models/inventory_referral.py | 2 +- talon_one/models/label_target.py | 137 ++++ talon_one/models/loyalty_card.py | 21 +- talon_one/models/loyalty_card_batch.py | 7 +- .../models/loyalty_program_transaction.py | 7 +- .../models/mcpo_auth_protected_resource.py | 90 +++ talon_one/models/mcpo_auth_server_metadata.py | 100 +++ talon_one/models/new_additional_cost.py | 14 +- talon_one/models/new_application.py | 7 +- talon_one/models/new_attribute.py | 14 +- talon_one/models/new_base_notification.py | 8 +- talon_one/models/new_campaign_collection.py | 7 +- talon_one/models/new_collection.py | 7 +- talon_one/models/new_coupon_creation_job.py | 2 +- talon_one/models/new_coupons.py | 10 +- .../new_coupons_for_multiple_recipients.py | 2 +- talon_one/models/new_custom_effect.py | 14 +- talon_one/models/new_customer_session.py | 2 +- talon_one/models/new_digital_pass.py | 106 ++++ talon_one/models/new_event.py | 2 +- talon_one/models/new_price_type.py | 7 +- talon_one/models/new_referral.py | 2 +- .../new_referrals_for_multiple_advocates.py | 2 +- talon_one/models/new_secondary_deployment.py | 7 +- talon_one/models/new_webhook.py | 7 +- .../outgoing_integration_configuration.py | 8 +- ...tgoing_integration_configuration_policy.py | 165 +++++ ...ion_template_with_configuration_details.py | 8 +- talon_one/models/passthrough_block.py | 2 +- talon_one/models/price_type.py | 7 +- talon_one/models/promotion_block.py | 282 +++++++++ .../models/promotion_check_attribute_block.py | 36 +- talon_one/models/promotion_group_block.py | 43 +- talon_one/models/promotion_rule_v2.py | 12 +- talon_one/models/referral.py | 2 +- ...otification.py => review_risks_request.py} | 17 +- talon_one/models/risk.py | 20 +- talon_one/models/risk_criticality_update.py | 98 +++ talon_one/models/risk_detail.py | 20 +- ...lback_added_loyalty_points_effect_props.py | 7 +- ...ck_deducted_loyalty_points_effect_props.py | 7 +- .../scim_service_provider_config_response.py | 10 +- ..._service_provider_config_response_patch.py | 88 +++ ...m_service_provider_config_response_sort.py | 88 +++ talon_one/models/secondary_deployment.py | 7 +- talon_one/models/show_notification_block.py | 32 +- talon_one/models/strikethrough_block.py | 156 +++++ .../strikethrough_check_attribute_block.py | 36 +- talon_one/models/strikethrough_effect.py | 20 +- .../models/strikethrough_effect_props.py | 151 +++++ talon_one/models/strikethrough_group_block.py | 43 +- talon_one/models/strikethrough_rule_v2.py | 12 +- talon_one/models/support_request.py | 10 +- talon_one/models/template_arg_def.py | 2 +- talon_one/models/transfer_loyalty_card.py | 7 +- talon_one/models/update_achievement.py | 7 +- .../update_achievement_progress_block.py | 109 ++++ ...achievement_progress_block1_achievement.py | 94 +++ talon_one/models/update_achievement_v2.py | 7 +- .../models/update_attribute_value_block.py | 120 ++++ ...update_attribute_value_block1_attribute.py | 96 +++ ...> update_attribute_value_block1_target.py} | 27 +- .../update_audience_membership_block.py | 116 ++++ ...te_audience_membership_block1_audience.py} | 39 +- talon_one/models/update_coupon.py | 2 +- talon_one/models/update_coupon_batch.py | 2 +- talon_one/models/update_custom_effect.py | 14 +- .../update_customer_profile_v2409_response.py | 92 +++ talon_one/models/update_support_request.py | 4 +- talon_one/models/user.py | 4 +- talon_one/models/webhook.py | 7 +- talon_one/models/webhook_authentication.py | 15 +- .../webhook_authentication_all_of_data.py | 137 ++++ .../models/webhook_authentication_base.py | 137 ++++ ... => webhook_authentication_base_one_of.py} | 42 +- .../webhook_authentication_base_one_of1.py | 101 +++ .../webhook_authentication_webhook_ref.py | 7 +- ...bhook_with_outgoing_integration_details.py | 7 +- talon_one/rest.py | 58 +- test-requirements.txt | 2 +- test/test_add_item_catalog_action.py | 2 +- test/test_base_notification.py | 4 +- test/test_base_notification_entity.py | 4 +- test/test_base_notification_policy.py | 72 +++ test/test_bulk_application_notification.py | 12 +- ...ampaign_evaluation_tree_changed_message.py | 6 +- test/test_campaign_set_node.py | 25 +- test/test_catalog_action.py | 30 +- test/test_catalog_action_one_of.py | 66 ++ test/test_catalog_action_one_of1.py | 66 ++ test/test_catalog_action_one_of2.py | 70 ++ test/test_catalog_action_one_of3.py | 56 ++ test/test_catalog_action_one_of4.py | 66 ++ test/test_catalog_action_one_of5.py | 76 +++ test/test_catalog_sync_request.py | 8 +- test/test_change.py | 4 +- ....py => test_check_attribute_block_base.py} | 22 +- test/test_confirm_risks_request.py | 54 ++ test/test_customer_profile_reward.py | 65 ++ ...ttribute_block.py => test_digital_pass.py} | 35 +- ...block.py => test_discard_risks_request.py} | 32 +- test/test_effect_all_of_props.py | 177 ++++++ test/test_effect_props.py | 177 ++++++ test/test_event.py | 4 +- test/test_event_v3.py | 4 +- test/test_integration_event.py | 4 +- ..._hub_paginated_event_payload_data_inner.py | 110 ++++ test/test_inventory_referral.py | 2 +- ...ttribute_block.py => test_label_target.py} | 27 +- test/test_ledger_info.py | 7 +- test/test_loyalty_balance_with_tier.py | 7 +- test/test_loyalty_card.py | 4 +- test/test_mcpo_auth_protected_resource.py | 54 ++ test/test_mcpo_auth_server_metadata.py | 64 ++ test/test_new_base_notification.py | 4 +- test/test_new_coupons.py | 6 +- ...est_new_coupons_for_multiple_recipients.py | 2 +- test/test_new_digital_pass.py | 60 ++ test/test_new_event.py | 4 +- test/test_new_referral.py | 2 +- ...st_new_referrals_for_multiple_advocates.py | 2 +- test/test_okta_event_payload.py | 24 +- ...test_outgoing_integration_configuration.py | 4 +- ...tgoing_integration_configuration_policy.py | 64 ++ ...ion_template_with_configuration_details.py | 4 +- test/test_promotion_block.py | 143 +++++ test/test_promotion_check_attribute_block.py | 16 + test/test_referral.py | 2 +- ...cation.py => test_review_risks_request.py} | 26 +- test/test_risk.py | 4 + ...ock.py => test_risk_criticality_update.py} | 29 +- test/test_risk_detail.py | 4 + ...t_scim_service_provider_config_response.py | 4 +- ..._service_provider_config_response_patch.py | 51 ++ ...m_service_provider_config_response_sort.py | 51 ++ test/test_strikethrough_block.py | 86 +++ ...est_strikethrough_check_attribute_block.py | 16 + test/test_strikethrough_effect.py | 4 +- test/test_strikethrough_effect_props.py | 59 ++ test/test_support_request.py | 3 +- .../test_update_achievement_progress_block.py | 71 +++ ...achievement_progress_block1_achievement.py | 58 ++ test/test_update_attribute_value_block.py | 76 +++ ...update_attribute_value_block1_attribute.py | 60 ++ ...t_update_attribute_value_block1_target.py} | 27 +- test/test_update_audience_membership_block.py | 71 +++ ...ate_audience_membership_block1_audience.py | 56 ++ ..._update_customer_profile_v2409_response.py | 55 ++ test/test_user.py | 4 +- ...test_webhook_authentication_all_of_data.py | 60 ++ test/test_webhook_authentication_base.py | 62 ++ ...test_webhook_authentication_base_one_of.py | 55 ++ ...est_webhook_authentication_base_one_of1.py | 56 ++ 332 files changed, 10560 insertions(+), 1414 deletions(-) delete mode 100644 docs/ApplicationNotification.md create mode 100644 docs/BaseNotificationPolicy.md delete mode 100644 docs/BetweenCheckAttributeBlock.md create mode 100644 docs/CatalogActionOneOf.md create mode 100644 docs/CatalogActionOneOf1.md create mode 100644 docs/CatalogActionOneOf2.md create mode 100644 docs/CatalogActionOneOf3.md create mode 100644 docs/CatalogActionOneOf4.md create mode 100644 docs/CatalogActionOneOf5.md rename docs/{CheckAttributeBlock.md => CheckAttributeBlockBase.md} (66%) create mode 100644 docs/ConfirmRisksRequest.md create mode 100644 docs/CustomerProfileReward.md create mode 100644 docs/DigitalPass.md create mode 100644 docs/DiscardRisksRequest.md create mode 100644 docs/EffectAllOfProps.md create mode 100644 docs/EffectProps.md create mode 100644 docs/IntegrationHubPaginatedEventPayloadDataInner.md create mode 100644 docs/LabelTarget.md delete mode 100644 docs/ListCheckAttributeBlock.md delete mode 100644 docs/ListWithCountCheckAttributeBlock.md create mode 100644 docs/MCPOAuthProtectedResource.md create mode 100644 docs/MCPOAuthServerMetadata.md create mode 100644 docs/NewDigitalPass.md create mode 100644 docs/OutgoingIntegrationConfigurationPolicy.md create mode 100644 docs/PromotionBlock.md create mode 100644 docs/ReviewRisksRequest.md create mode 100644 docs/RiskCriticalityUpdate.md delete mode 100644 docs/ScalarCheckAttributeBlock.md create mode 100644 docs/ScimServiceProviderConfigResponsePatch.md create mode 100644 docs/ScimServiceProviderConfigResponseSort.md create mode 100644 docs/StrikethroughBlock.md create mode 100644 docs/StrikethroughEffectProps.md delete mode 100644 docs/UnaryCheckAttributeBlock.md create mode 100644 docs/UpdateAchievementProgressBlock.md create mode 100644 docs/UpdateAchievementProgressBlock1Achievement.md create mode 100644 docs/UpdateAttributeValueBlock.md create mode 100644 docs/UpdateAttributeValueBlock1Attribute.md create mode 100644 docs/UpdateAttributeValueBlock1Target.md create mode 100644 docs/UpdateAudienceMembershipBlock.md create mode 100644 docs/UpdateAudienceMembershipBlock1Audience.md create mode 100644 docs/UpdateCustomerProfileV2409Response.md create mode 100644 docs/WebhookAuthenticationAllOfData.md create mode 100644 docs/WebhookAuthenticationBase.md create mode 100644 docs/WebhookAuthenticationBaseOneOf.md create mode 100644 docs/WebhookAuthenticationBaseOneOf1.md create mode 100644 talon_one/models/base_notification_policy.py create mode 100644 talon_one/models/catalog_action_one_of.py create mode 100644 talon_one/models/catalog_action_one_of1.py create mode 100644 talon_one/models/catalog_action_one_of2.py create mode 100644 talon_one/models/catalog_action_one_of3.py create mode 100644 talon_one/models/catalog_action_one_of4.py create mode 100644 talon_one/models/catalog_action_one_of5.py delete mode 100644 talon_one/models/check_attribute_block.py create mode 100644 talon_one/models/check_attribute_block_base.py create mode 100644 talon_one/models/confirm_risks_request.py create mode 100644 talon_one/models/customer_profile_reward.py rename talon_one/models/{between_check_attribute_block.py => digital_pass.py} (67%) rename talon_one/models/{list_with_count_check_attribute_block.py => discard_risks_request.py} (65%) create mode 100644 talon_one/models/effect_all_of_props.py create mode 100644 talon_one/models/effect_props.py create mode 100644 talon_one/models/integration_hub_paginated_event_payload_data_inner.py create mode 100644 talon_one/models/label_target.py create mode 100644 talon_one/models/mcpo_auth_protected_resource.py create mode 100644 talon_one/models/mcpo_auth_server_metadata.py create mode 100644 talon_one/models/new_digital_pass.py create mode 100644 talon_one/models/outgoing_integration_configuration_policy.py create mode 100644 talon_one/models/promotion_block.py rename talon_one/models/{application_notification.py => review_risks_request.py} (81%) create mode 100644 talon_one/models/risk_criticality_update.py create mode 100644 talon_one/models/scim_service_provider_config_response_patch.py create mode 100644 talon_one/models/scim_service_provider_config_response_sort.py create mode 100644 talon_one/models/strikethrough_block.py create mode 100644 talon_one/models/strikethrough_effect_props.py create mode 100644 talon_one/models/update_achievement_progress_block.py create mode 100644 talon_one/models/update_achievement_progress_block1_achievement.py create mode 100644 talon_one/models/update_attribute_value_block.py create mode 100644 talon_one/models/update_attribute_value_block1_attribute.py rename talon_one/models/{unary_check_attribute_block.py => update_attribute_value_block1_target.py} (74%) create mode 100644 talon_one/models/update_audience_membership_block.py rename talon_one/models/{scalar_check_attribute_block.py => update_audience_membership_block1_audience.py} (63%) create mode 100644 talon_one/models/update_customer_profile_v2409_response.py create mode 100644 talon_one/models/webhook_authentication_all_of_data.py create mode 100644 talon_one/models/webhook_authentication_base.py rename talon_one/models/{list_check_attribute_block.py => webhook_authentication_base_one_of.py} (70%) create mode 100644 talon_one/models/webhook_authentication_base_one_of1.py create mode 100644 test/test_base_notification_policy.py create mode 100644 test/test_catalog_action_one_of.py create mode 100644 test/test_catalog_action_one_of1.py create mode 100644 test/test_catalog_action_one_of2.py create mode 100644 test/test_catalog_action_one_of3.py create mode 100644 test/test_catalog_action_one_of4.py create mode 100644 test/test_catalog_action_one_of5.py rename test/{test_check_attribute_block.py => test_check_attribute_block_base.py} (82%) create mode 100644 test/test_confirm_risks_request.py create mode 100644 test/test_customer_profile_reward.py rename test/{test_list_with_count_check_attribute_block.py => test_digital_pass.py} (63%) rename test/{test_between_check_attribute_block.py => test_discard_risks_request.py} (65%) create mode 100644 test/test_effect_all_of_props.py create mode 100644 test/test_effect_props.py create mode 100644 test/test_integration_hub_paginated_event_payload_data_inner.py rename test/{test_unary_check_attribute_block.py => test_label_target.py} (70%) create mode 100644 test/test_mcpo_auth_protected_resource.py create mode 100644 test/test_mcpo_auth_server_metadata.py create mode 100644 test/test_new_digital_pass.py create mode 100644 test/test_outgoing_integration_configuration_policy.py create mode 100644 test/test_promotion_block.py rename test/{test_application_notification.py => test_review_risks_request.py} (69%) rename test/{test_scalar_check_attribute_block.py => test_risk_criticality_update.py} (67%) create mode 100644 test/test_scim_service_provider_config_response_patch.py create mode 100644 test/test_scim_service_provider_config_response_sort.py create mode 100644 test/test_strikethrough_block.py create mode 100644 test/test_strikethrough_effect_props.py create mode 100644 test/test_update_achievement_progress_block.py create mode 100644 test/test_update_achievement_progress_block1_achievement.py create mode 100644 test/test_update_attribute_value_block.py create mode 100644 test/test_update_attribute_value_block1_attribute.py rename test/{test_list_check_attribute_block.py => test_update_attribute_value_block1_target.py} (66%) create mode 100644 test/test_update_audience_membership_block.py create mode 100644 test/test_update_audience_membership_block1_audience.py create mode 100644 test/test_update_customer_profile_v2409_response.py create mode 100644 test/test_webhook_authentication_all_of_data.py create mode 100644 test/test_webhook_authentication_base.py create mode 100644 test/test_webhook_authentication_base_one_of.py create mode 100644 test/test_webhook_authentication_base_one_of1.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 8fe5663..8026c15 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -71,7 +71,6 @@ docs/ApplicationCustomer.md docs/ApplicationCustomerEntity.md docs/ApplicationEntity.md docs/ApplicationEvent.md -docs/ApplicationNotification.md docs/ApplicationReferee.md docs/ApplicationSession.md docs/ApplicationSessionEntity.md @@ -97,6 +96,7 @@ docs/BaseCampaign.md docs/BaseLoyaltyProgram.md docs/BaseNotification.md docs/BaseNotificationEntity.md +docs/BaseNotificationPolicy.md docs/BaseNotificationWebhook.md docs/BaseNotifications.md docs/BaseSamlConnection.md @@ -105,7 +105,6 @@ docs/BestPriorPriceMetadata.md docs/BestPriorPriceRequest.md docs/BestPriorPriceSettings.md docs/BestPriorTarget.md -docs/BetweenCheckAttributeBlock.md docs/Binding.md docs/Blueprint.md docs/BulkApplicationNotification.md @@ -173,6 +172,12 @@ docs/CartItemFilterTemplate.md docs/Catalog.md docs/CatalogAction.md docs/CatalogActionFilter.md +docs/CatalogActionOneOf.md +docs/CatalogActionOneOf1.md +docs/CatalogActionOneOf2.md +docs/CatalogActionOneOf3.md +docs/CatalogActionOneOf4.md +docs/CatalogActionOneOf5.md docs/CatalogItem.md docs/CatalogRule.md docs/CatalogSyncRequest.md @@ -180,7 +185,7 @@ docs/CatalogsStrikethroughNotificationPolicy.md docs/Change.md docs/ChangeLoyaltyTierLevelEffectProps.md docs/ChangeProfilePassword.md -docs/CheckAttributeBlock.md +docs/CheckAttributeBlockBase.md docs/CheckAudienceBlock.md docs/CheckAudienceBlock1Audience.md docs/CheckCouponBlock.md @@ -189,6 +194,7 @@ docs/CodeGeneratorSettings.md docs/Collection.md docs/CollectionItem.md docs/CollectionWithoutPayload.md +docs/ConfirmRisksRequest.md docs/Coupon.md docs/CouponConstraints.md docs/CouponCreatedEffectProps.md @@ -227,6 +233,7 @@ docs/CustomerProfileAudienceRequestItem.md docs/CustomerProfileEntity.md docs/CustomerProfileIntegrationRequestV2.md docs/CustomerProfileIntegrationResponseV2.md +docs/CustomerProfileReward.md docs/CustomerProfileSearchQuery.md docs/CustomerProfileUpdateV2Response.md docs/CustomerSession.md @@ -237,8 +244,12 @@ docs/DeductLoyaltyPointsEffectProps.md docs/DeleteCouponsData.md docs/DeleteLoyaltyTransactionsRequest.md docs/DeleteUserRequest.md +docs/DigitalPass.md +docs/DiscardRisksRequest.md docs/Effect.md +docs/EffectAllOfProps.md docs/EffectEntity.md +docs/EffectProps.md docs/EmailEntity.md docs/EmbeddedAnalyticsConfiguration.md docs/EmbeddedAnalyticsConfigurationDashboards.md @@ -394,6 +405,7 @@ docs/IntegrationHubFlowConfigResponse.md docs/IntegrationHubFlowResponse.md docs/IntegrationHubFlowWithConfig.md docs/IntegrationHubPaginatedEventPayload.md +docs/IntegrationHubPaginatedEventPayloadDataInner.md docs/IntegrationProfileEntity.md docs/IntegrationProfileEntityV3.md docs/IntegrationRequest.md @@ -404,6 +416,7 @@ docs/IntegrationStoreEntity.md docs/InventoryCoupon.md docs/InventoryReferral.md docs/ItemAttribute.md +docs/LabelTarget.md docs/LabelTargetAudience.md docs/LabelTargetNone.md docs/LedgerEntry.md @@ -421,10 +434,8 @@ docs/ListCampaignStoreBudgetLimits200Response.md docs/ListCampaignStoreBudgets.md docs/ListCampaignStoreBudgetsStore.md docs/ListCatalogItems200Response.md -docs/ListCheckAttributeBlock.md docs/ListExperiments200Response.md docs/ListStores200Response.md -docs/ListWithCountCheckAttributeBlock.md docs/LoginParams.md docs/Loyalty.md docs/LoyaltyBalance.md @@ -453,6 +464,8 @@ docs/LoyaltyProgramTransaction.md docs/LoyaltySubLedger.md docs/LoyaltyTier.md docs/MCPKey.md +docs/MCPOAuthProtectedResource.md +docs/MCPOAuthServerMetadata.md docs/ManagementApi.md docs/ManagementKey.md docs/ManagerConfig.md @@ -504,6 +517,7 @@ docs/NewCustomEffect.md docs/NewCustomerProfile.md docs/NewCustomerSession.md docs/NewCustomerSessionV2.md +docs/NewDigitalPass.md docs/NewEvent.md docs/NewEventType.md docs/NewEventV3Entity.md @@ -554,6 +568,7 @@ docs/OneTimeCode.md docs/OutgoingIntegrationBrazePolicy.md docs/OutgoingIntegrationCleverTapPolicy.md docs/OutgoingIntegrationConfiguration.md +docs/OutgoingIntegrationConfigurationPolicy.md docs/OutgoingIntegrationIterablePolicy.md docs/OutgoingIntegrationMoEngagePolicy.md docs/OutgoingIntegrationTemplate.md @@ -583,6 +598,7 @@ docs/ProductUnitAnalyticsTotals.md docs/ProfileAudiencesChanges.md docs/ProjectedTier.md docs/PromoteExperiment.md +docs/PromotionBlock.md docs/PromotionCheckAttributeBlock.md docs/PromotionGroupBlock.md docs/PromotionRuleV2.md @@ -601,6 +617,7 @@ docs/ReserveCouponEffectProps.md docs/ResponseContentObject.md docs/ReturnIntegrationRequest.md docs/ReturnedCartItem.md +docs/ReviewRisksRequest.md docs/Revision.md docs/RevisionActivation.md docs/RevisionActivationRequest.md @@ -609,6 +626,7 @@ docs/Reward.md docs/RewardPointsRequired.md docs/Risk.md docs/RiskAffectedEntityItem.md +docs/RiskCriticalityUpdate.md docs/RiskDetail.md docs/RiskNotification.md docs/Role.md @@ -642,7 +660,6 @@ docs/SamlConnection.md docs/SamlConnectionInternal.md docs/SamlConnectionMetadata.md docs/SamlLoginEndpoint.md -docs/ScalarCheckAttributeBlock.md docs/ScimBaseGroup.md docs/ScimBaseUser.md docs/ScimBaseUserName.md @@ -660,6 +677,8 @@ docs/ScimServiceProviderConfigResponse.md docs/ScimServiceProviderConfigResponseBulk.md docs/ScimServiceProviderConfigResponseChangePassword.md docs/ScimServiceProviderConfigResponseFilter.md +docs/ScimServiceProviderConfigResponsePatch.md +docs/ScimServiceProviderConfigResponseSort.md docs/ScimUser.md docs/ScimUsersListResponse.md docs/SecondaryDeployment.md @@ -676,11 +695,13 @@ docs/SkuUnitAnalytics.md docs/SkuUnitAnalyticsDataPoint.md docs/SlotDef.md docs/Store.md +docs/StrikethroughBlock.md docs/StrikethroughChangedItem.md docs/StrikethroughCheckAttributeBlock.md docs/StrikethroughCustomEffectPerItemProps.md docs/StrikethroughDebugResponse.md docs/StrikethroughEffect.md +docs/StrikethroughEffectProps.md docs/StrikethroughGroupBlock.md docs/StrikethroughLabelingNotification.md docs/StrikethroughRuleV2.md @@ -711,15 +732,21 @@ docs/TimePoint.md docs/TransferLoyaltyCard.md docs/TriggerWebhookEffectProps.md docs/TwoFAConfig.md -docs/UnaryCheckAttributeBlock.md docs/UpdateAccount.md docs/UpdateAchievement.md +docs/UpdateAchievementProgressBlock.md +docs/UpdateAchievementProgressBlock1Achievement.md docs/UpdateAchievementV2.md docs/UpdateApplication.md docs/UpdateApplicationAPIKey.md docs/UpdateApplicationCIF.md docs/UpdateAttributeEffectProps.md +docs/UpdateAttributeValueBlock.md +docs/UpdateAttributeValueBlock1Attribute.md +docs/UpdateAttributeValueBlock1Target.md docs/UpdateAudience.md +docs/UpdateAudienceMembershipBlock.md +docs/UpdateAudienceMembershipBlock1Audience.md docs/UpdateBlueprint.md docs/UpdateCampaign.md docs/UpdateCampaignCollection.md @@ -732,6 +759,7 @@ docs/UpdateCoupon.md docs/UpdateCouponBatch.md docs/UpdateCouponsData.md docs/UpdateCustomEffect.md +docs/UpdateCustomerProfileV2409Response.md docs/UpdateCustomerSessionV2409Response.md docs/UpdateExperiment.md docs/UpdateExperimentVariant.md @@ -756,6 +784,10 @@ docs/UserEntity.md docs/ValueMap.md docs/Webhook.md docs/WebhookAuthentication.md +docs/WebhookAuthenticationAllOfData.md +docs/WebhookAuthenticationBase.md +docs/WebhookAuthenticationBaseOneOf.md +docs/WebhookAuthenticationBaseOneOf1.md docs/WebhookAuthenticationDataBasic.md docs/WebhookAuthenticationDataCustom.md docs/WebhookAuthenticationWebhookRef.md @@ -837,7 +869,6 @@ talon_one/models/application_customer.py talon_one/models/application_customer_entity.py talon_one/models/application_entity.py talon_one/models/application_event.py -talon_one/models/application_notification.py talon_one/models/application_referee.py talon_one/models/application_session.py talon_one/models/application_session_entity.py @@ -863,6 +894,7 @@ talon_one/models/base_campaign.py talon_one/models/base_loyalty_program.py talon_one/models/base_notification.py talon_one/models/base_notification_entity.py +talon_one/models/base_notification_policy.py talon_one/models/base_notification_webhook.py talon_one/models/base_notifications.py talon_one/models/base_saml_connection.py @@ -871,7 +903,6 @@ talon_one/models/best_prior_price_metadata.py talon_one/models/best_prior_price_request.py talon_one/models/best_prior_price_settings.py talon_one/models/best_prior_target.py -talon_one/models/between_check_attribute_block.py talon_one/models/binding.py talon_one/models/blueprint.py talon_one/models/bulk_application_notification.py @@ -939,6 +970,12 @@ 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_action_one_of.py +talon_one/models/catalog_action_one_of1.py +talon_one/models/catalog_action_one_of2.py +talon_one/models/catalog_action_one_of3.py +talon_one/models/catalog_action_one_of4.py +talon_one/models/catalog_action_one_of5.py talon_one/models/catalog_item.py talon_one/models/catalog_rule.py talon_one/models/catalog_sync_request.py @@ -946,7 +983,7 @@ talon_one/models/catalogs_strikethrough_notification_policy.py talon_one/models/change.py talon_one/models/change_loyalty_tier_level_effect_props.py talon_one/models/change_profile_password.py -talon_one/models/check_attribute_block.py +talon_one/models/check_attribute_block_base.py talon_one/models/check_audience_block.py talon_one/models/check_audience_block1_audience.py talon_one/models/check_coupon_block.py @@ -955,6 +992,7 @@ talon_one/models/code_generator_settings.py talon_one/models/collection.py talon_one/models/collection_item.py talon_one/models/collection_without_payload.py +talon_one/models/confirm_risks_request.py talon_one/models/coupon.py talon_one/models/coupon_constraints.py talon_one/models/coupon_created_effect_props.py @@ -993,6 +1031,7 @@ talon_one/models/customer_profile_audience_request_item.py talon_one/models/customer_profile_entity.py talon_one/models/customer_profile_integration_request_v2.py talon_one/models/customer_profile_integration_response_v2.py +talon_one/models/customer_profile_reward.py talon_one/models/customer_profile_search_query.py talon_one/models/customer_profile_update_v2_response.py talon_one/models/customer_session.py @@ -1003,8 +1042,12 @@ talon_one/models/deduct_loyalty_points_effect_props.py talon_one/models/delete_coupons_data.py talon_one/models/delete_loyalty_transactions_request.py talon_one/models/delete_user_request.py +talon_one/models/digital_pass.py +talon_one/models/discard_risks_request.py talon_one/models/effect.py +talon_one/models/effect_all_of_props.py talon_one/models/effect_entity.py +talon_one/models/effect_props.py talon_one/models/email_entity.py talon_one/models/embedded_analytics_configuration.py talon_one/models/embedded_analytics_configuration_dashboards.py @@ -1159,6 +1202,7 @@ talon_one/models/integration_hub_flow_config_response.py talon_one/models/integration_hub_flow_response.py talon_one/models/integration_hub_flow_with_config.py talon_one/models/integration_hub_paginated_event_payload.py +talon_one/models/integration_hub_paginated_event_payload_data_inner.py talon_one/models/integration_profile_entity.py talon_one/models/integration_profile_entity_v3.py talon_one/models/integration_request.py @@ -1169,6 +1213,7 @@ talon_one/models/integration_store_entity.py talon_one/models/inventory_coupon.py talon_one/models/inventory_referral.py talon_one/models/item_attribute.py +talon_one/models/label_target.py talon_one/models/label_target_audience.py talon_one/models/label_target_none.py talon_one/models/ledger_entry.py @@ -1186,10 +1231,8 @@ talon_one/models/list_campaign_store_budget_limits200_response.py talon_one/models/list_campaign_store_budgets.py talon_one/models/list_campaign_store_budgets_store.py talon_one/models/list_catalog_items200_response.py -talon_one/models/list_check_attribute_block.py talon_one/models/list_experiments200_response.py talon_one/models/list_stores200_response.py -talon_one/models/list_with_count_check_attribute_block.py talon_one/models/login_params.py talon_one/models/loyalty.py talon_one/models/loyalty_balance.py @@ -1220,6 +1263,8 @@ talon_one/models/loyalty_tier.py talon_one/models/management_key.py talon_one/models/manager_config.py talon_one/models/mcp_key.py +talon_one/models/mcpo_auth_protected_resource.py +talon_one/models/mcpo_auth_server_metadata.py talon_one/models/message_log_entries.py talon_one/models/message_log_entry.py talon_one/models/message_log_request.py @@ -1268,6 +1313,7 @@ talon_one/models/new_custom_effect.py talon_one/models/new_customer_profile.py talon_one/models/new_customer_session.py talon_one/models/new_customer_session_v2.py +talon_one/models/new_digital_pass.py talon_one/models/new_event.py talon_one/models/new_event_type.py talon_one/models/new_event_v3_entity.py @@ -1318,6 +1364,7 @@ talon_one/models/one_time_code.py talon_one/models/outgoing_integration_braze_policy.py talon_one/models/outgoing_integration_clever_tap_policy.py talon_one/models/outgoing_integration_configuration.py +talon_one/models/outgoing_integration_configuration_policy.py talon_one/models/outgoing_integration_iterable_policy.py talon_one/models/outgoing_integration_mo_engage_policy.py talon_one/models/outgoing_integration_template.py @@ -1347,6 +1394,7 @@ talon_one/models/product_unit_analytics_totals.py talon_one/models/profile_audiences_changes.py talon_one/models/projected_tier.py talon_one/models/promote_experiment.py +talon_one/models/promotion_block.py talon_one/models/promotion_check_attribute_block.py talon_one/models/promotion_group_block.py talon_one/models/promotion_rule_v2.py @@ -1365,6 +1413,7 @@ talon_one/models/reserve_coupon_effect_props.py talon_one/models/response_content_object.py talon_one/models/return_integration_request.py talon_one/models/returned_cart_item.py +talon_one/models/review_risks_request.py talon_one/models/revision.py talon_one/models/revision_activation.py talon_one/models/revision_activation_request.py @@ -1373,6 +1422,7 @@ talon_one/models/reward.py talon_one/models/reward_points_required.py talon_one/models/risk.py talon_one/models/risk_affected_entity_item.py +talon_one/models/risk_criticality_update.py talon_one/models/risk_detail.py talon_one/models/risk_notification.py talon_one/models/role.py @@ -1405,7 +1455,6 @@ talon_one/models/saml_connection.py talon_one/models/saml_connection_internal.py talon_one/models/saml_connection_metadata.py talon_one/models/saml_login_endpoint.py -talon_one/models/scalar_check_attribute_block.py talon_one/models/scim_base_group.py talon_one/models/scim_base_user.py talon_one/models/scim_base_user_name.py @@ -1423,6 +1472,8 @@ talon_one/models/scim_service_provider_config_response.py talon_one/models/scim_service_provider_config_response_bulk.py talon_one/models/scim_service_provider_config_response_change_password.py talon_one/models/scim_service_provider_config_response_filter.py +talon_one/models/scim_service_provider_config_response_patch.py +talon_one/models/scim_service_provider_config_response_sort.py talon_one/models/scim_user.py talon_one/models/scim_users_list_response.py talon_one/models/secondary_deployment.py @@ -1440,11 +1491,13 @@ talon_one/models/sku_unit_analytics_data_point.py talon_one/models/slot_def.py talon_one/models/sso_config.py talon_one/models/store.py +talon_one/models/strikethrough_block.py talon_one/models/strikethrough_changed_item.py talon_one/models/strikethrough_check_attribute_block.py talon_one/models/strikethrough_custom_effect_per_item_props.py talon_one/models/strikethrough_debug_response.py talon_one/models/strikethrough_effect.py +talon_one/models/strikethrough_effect_props.py talon_one/models/strikethrough_group_block.py talon_one/models/strikethrough_labeling_notification.py talon_one/models/strikethrough_rule_v2.py @@ -1475,15 +1528,21 @@ talon_one/models/time_point.py talon_one/models/transfer_loyalty_card.py talon_one/models/trigger_webhook_effect_props.py talon_one/models/two_fa_config.py -talon_one/models/unary_check_attribute_block.py talon_one/models/update_account.py talon_one/models/update_achievement.py +talon_one/models/update_achievement_progress_block.py +talon_one/models/update_achievement_progress_block1_achievement.py talon_one/models/update_achievement_v2.py talon_one/models/update_application.py talon_one/models/update_application_api_key.py talon_one/models/update_application_cif.py talon_one/models/update_attribute_effect_props.py +talon_one/models/update_attribute_value_block.py +talon_one/models/update_attribute_value_block1_attribute.py +talon_one/models/update_attribute_value_block1_target.py talon_one/models/update_audience.py +talon_one/models/update_audience_membership_block.py +talon_one/models/update_audience_membership_block1_audience.py talon_one/models/update_blueprint.py talon_one/models/update_campaign.py talon_one/models/update_campaign_collection.py @@ -1496,6 +1555,7 @@ talon_one/models/update_coupon.py talon_one/models/update_coupon_batch.py talon_one/models/update_coupons_data.py talon_one/models/update_custom_effect.py +talon_one/models/update_customer_profile_v2409_response.py talon_one/models/update_customer_session_v2409_response.py talon_one/models/update_experiment.py talon_one/models/update_experiment_variant.py @@ -1520,6 +1580,10 @@ talon_one/models/user_entity.py talon_one/models/value_map.py talon_one/models/webhook.py talon_one/models/webhook_authentication.py +talon_one/models/webhook_authentication_all_of_data.py +talon_one/models/webhook_authentication_base.py +talon_one/models/webhook_authentication_base_one_of.py +talon_one/models/webhook_authentication_base_one_of1.py talon_one/models/webhook_authentication_data_basic.py talon_one/models/webhook_authentication_data_custom.py talon_one/models/webhook_authentication_webhook_ref.py @@ -1590,7 +1654,6 @@ test/test_application_customer.py test/test_application_customer_entity.py test/test_application_entity.py test/test_application_event.py -test/test_application_notification.py test/test_application_referee.py test/test_application_session.py test/test_application_session_entity.py @@ -1616,6 +1679,7 @@ test/test_base_campaign.py test/test_base_loyalty_program.py test/test_base_notification.py test/test_base_notification_entity.py +test/test_base_notification_policy.py test/test_base_notification_webhook.py test/test_base_notifications.py test/test_base_saml_connection.py @@ -1624,7 +1688,6 @@ test/test_best_prior_price_metadata.py test/test_best_prior_price_request.py test/test_best_prior_price_settings.py test/test_best_prior_target.py -test/test_between_check_attribute_block.py test/test_binding.py test/test_blueprint.py test/test_bulk_application_notification.py @@ -1692,6 +1755,12 @@ 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_action_one_of.py +test/test_catalog_action_one_of1.py +test/test_catalog_action_one_of2.py +test/test_catalog_action_one_of3.py +test/test_catalog_action_one_of4.py +test/test_catalog_action_one_of5.py test/test_catalog_item.py test/test_catalog_rule.py test/test_catalog_sync_request.py @@ -1699,7 +1768,7 @@ test/test_catalogs_strikethrough_notification_policy.py test/test_change.py test/test_change_loyalty_tier_level_effect_props.py test/test_change_profile_password.py -test/test_check_attribute_block.py +test/test_check_attribute_block_base.py test/test_check_audience_block.py test/test_check_audience_block1_audience.py test/test_check_coupon_block.py @@ -1708,6 +1777,7 @@ test/test_code_generator_settings.py test/test_collection.py test/test_collection_item.py test/test_collection_without_payload.py +test/test_confirm_risks_request.py test/test_coupon.py test/test_coupon_constraints.py test/test_coupon_created_effect_props.py @@ -1746,6 +1816,7 @@ test/test_customer_profile_audience_request_item.py test/test_customer_profile_entity.py test/test_customer_profile_integration_request_v2.py test/test_customer_profile_integration_response_v2.py +test/test_customer_profile_reward.py test/test_customer_profile_search_query.py test/test_customer_profile_update_v2_response.py test/test_customer_session.py @@ -1756,8 +1827,12 @@ test/test_deduct_loyalty_points_effect_props.py test/test_delete_coupons_data.py test/test_delete_loyalty_transactions_request.py test/test_delete_user_request.py +test/test_digital_pass.py +test/test_discard_risks_request.py test/test_effect.py +test/test_effect_all_of_props.py test/test_effect_entity.py +test/test_effect_props.py test/test_email_entity.py test/test_embedded_analytics_configuration.py test/test_embedded_analytics_configuration_dashboards.py @@ -1913,6 +1988,7 @@ test/test_integration_hub_flow_config_response.py test/test_integration_hub_flow_response.py test/test_integration_hub_flow_with_config.py test/test_integration_hub_paginated_event_payload.py +test/test_integration_hub_paginated_event_payload_data_inner.py test/test_integration_profile_entity.py test/test_integration_profile_entity_v3.py test/test_integration_request.py @@ -1923,6 +1999,7 @@ test/test_integration_store_entity.py test/test_inventory_coupon.py test/test_inventory_referral.py test/test_item_attribute.py +test/test_label_target.py test/test_label_target_audience.py test/test_label_target_none.py test/test_ledger_entry.py @@ -1940,10 +2017,8 @@ test/test_list_campaign_store_budget_limits200_response.py test/test_list_campaign_store_budgets.py test/test_list_campaign_store_budgets_store.py test/test_list_catalog_items200_response.py -test/test_list_check_attribute_block.py test/test_list_experiments200_response.py test/test_list_stores200_response.py -test/test_list_with_count_check_attribute_block.py test/test_login_params.py test/test_loyalty.py test/test_loyalty_balance.py @@ -1975,6 +2050,8 @@ test/test_management_api.py test/test_management_key.py test/test_manager_config.py test/test_mcp_key.py +test/test_mcpo_auth_protected_resource.py +test/test_mcpo_auth_server_metadata.py test/test_message_log_entries.py test/test_message_log_entry.py test/test_message_log_request.py @@ -2023,6 +2100,7 @@ test/test_new_custom_effect.py test/test_new_customer_profile.py test/test_new_customer_session.py test/test_new_customer_session_v2.py +test/test_new_digital_pass.py test/test_new_event.py test/test_new_event_type.py test/test_new_event_v3_entity.py @@ -2073,6 +2151,7 @@ test/test_one_time_code.py test/test_outgoing_integration_braze_policy.py test/test_outgoing_integration_clever_tap_policy.py test/test_outgoing_integration_configuration.py +test/test_outgoing_integration_configuration_policy.py test/test_outgoing_integration_iterable_policy.py test/test_outgoing_integration_mo_engage_policy.py test/test_outgoing_integration_template.py @@ -2102,6 +2181,7 @@ test/test_product_unit_analytics_totals.py test/test_profile_audiences_changes.py test/test_projected_tier.py test/test_promote_experiment.py +test/test_promotion_block.py test/test_promotion_check_attribute_block.py test/test_promotion_group_block.py test/test_promotion_rule_v2.py @@ -2120,6 +2200,7 @@ test/test_reserve_coupon_effect_props.py test/test_response_content_object.py test/test_return_integration_request.py test/test_returned_cart_item.py +test/test_review_risks_request.py test/test_revision.py test/test_revision_activation.py test/test_revision_activation_request.py @@ -2128,6 +2209,7 @@ test/test_reward.py test/test_reward_points_required.py test/test_risk.py test/test_risk_affected_entity_item.py +test/test_risk_criticality_update.py test/test_risk_detail.py test/test_risk_notification.py test/test_role.py @@ -2160,7 +2242,6 @@ test/test_saml_connection.py test/test_saml_connection_internal.py test/test_saml_connection_metadata.py test/test_saml_login_endpoint.py -test/test_scalar_check_attribute_block.py test/test_scim_base_group.py test/test_scim_base_user.py test/test_scim_base_user_name.py @@ -2178,6 +2259,8 @@ test/test_scim_service_provider_config_response.py test/test_scim_service_provider_config_response_bulk.py test/test_scim_service_provider_config_response_change_password.py test/test_scim_service_provider_config_response_filter.py +test/test_scim_service_provider_config_response_patch.py +test/test_scim_service_provider_config_response_sort.py test/test_scim_user.py test/test_scim_users_list_response.py test/test_secondary_deployment.py @@ -2195,11 +2278,13 @@ test/test_sku_unit_analytics_data_point.py test/test_slot_def.py test/test_sso_config.py test/test_store.py +test/test_strikethrough_block.py test/test_strikethrough_changed_item.py test/test_strikethrough_check_attribute_block.py test/test_strikethrough_custom_effect_per_item_props.py test/test_strikethrough_debug_response.py test/test_strikethrough_effect.py +test/test_strikethrough_effect_props.py test/test_strikethrough_group_block.py test/test_strikethrough_labeling_notification.py test/test_strikethrough_rule_v2.py @@ -2230,15 +2315,21 @@ test/test_time_point.py test/test_transfer_loyalty_card.py test/test_trigger_webhook_effect_props.py test/test_two_fa_config.py -test/test_unary_check_attribute_block.py test/test_update_account.py test/test_update_achievement.py +test/test_update_achievement_progress_block.py +test/test_update_achievement_progress_block1_achievement.py test/test_update_achievement_v2.py test/test_update_application.py test/test_update_application_api_key.py test/test_update_application_cif.py test/test_update_attribute_effect_props.py +test/test_update_attribute_value_block.py +test/test_update_attribute_value_block1_attribute.py +test/test_update_attribute_value_block1_target.py test/test_update_audience.py +test/test_update_audience_membership_block.py +test/test_update_audience_membership_block1_audience.py test/test_update_blueprint.py test/test_update_campaign.py test/test_update_campaign_collection.py @@ -2251,6 +2342,7 @@ test/test_update_coupon.py test/test_update_coupon_batch.py test/test_update_coupons_data.py test/test_update_custom_effect.py +test/test_update_customer_profile_v2409_response.py test/test_update_customer_session_v2409_response.py test/test_update_experiment.py test/test_update_experiment_variant.py @@ -2275,6 +2367,10 @@ test/test_user_entity.py test/test_value_map.py test/test_webhook.py test/test_webhook_authentication.py +test/test_webhook_authentication_all_of_data.py +test/test_webhook_authentication_base.py +test/test_webhook_authentication_base_one_of.py +test/test_webhook_authentication_base_one_of1.py test/test_webhook_authentication_data_basic.py test/test_webhook_authentication_data_custom.py test/test_webhook_authentication_webhook_ref.py diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 14d6b5d..0783219 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -7.23.0 +7.24.0 diff --git a/README.md b/README.md index e228bea..391f40b 100644 --- a/README.md +++ b/README.md @@ -446,7 +446,6 @@ Class | Method | HTTP request | Description - [ApplicationCustomerEntity](docs/ApplicationCustomerEntity.md) - [ApplicationEntity](docs/ApplicationEntity.md) - [ApplicationEvent](docs/ApplicationEvent.md) -- [ApplicationNotification](docs/ApplicationNotification.md) - [ApplicationReferee](docs/ApplicationReferee.md) - [ApplicationSession](docs/ApplicationSession.md) - [ApplicationSessionEntity](docs/ApplicationSessionEntity.md) @@ -472,6 +471,7 @@ Class | Method | HTTP request | Description - [BaseLoyaltyProgram](docs/BaseLoyaltyProgram.md) - [BaseNotification](docs/BaseNotification.md) - [BaseNotificationEntity](docs/BaseNotificationEntity.md) +- [BaseNotificationPolicy](docs/BaseNotificationPolicy.md) - [BaseNotificationWebhook](docs/BaseNotificationWebhook.md) - [BaseNotifications](docs/BaseNotifications.md) - [BaseSamlConnection](docs/BaseSamlConnection.md) @@ -480,7 +480,6 @@ Class | Method | HTTP request | Description - [BestPriorPriceRequest](docs/BestPriorPriceRequest.md) - [BestPriorPriceSettings](docs/BestPriorPriceSettings.md) - [BestPriorTarget](docs/BestPriorTarget.md) -- [BetweenCheckAttributeBlock](docs/BetweenCheckAttributeBlock.md) - [Binding](docs/Binding.md) - [Blueprint](docs/Blueprint.md) - [BulkApplicationNotification](docs/BulkApplicationNotification.md) @@ -548,6 +547,12 @@ Class | Method | HTTP request | Description - [Catalog](docs/Catalog.md) - [CatalogAction](docs/CatalogAction.md) - [CatalogActionFilter](docs/CatalogActionFilter.md) +- [CatalogActionOneOf](docs/CatalogActionOneOf.md) +- [CatalogActionOneOf1](docs/CatalogActionOneOf1.md) +- [CatalogActionOneOf2](docs/CatalogActionOneOf2.md) +- [CatalogActionOneOf3](docs/CatalogActionOneOf3.md) +- [CatalogActionOneOf4](docs/CatalogActionOneOf4.md) +- [CatalogActionOneOf5](docs/CatalogActionOneOf5.md) - [CatalogItem](docs/CatalogItem.md) - [CatalogRule](docs/CatalogRule.md) - [CatalogSyncRequest](docs/CatalogSyncRequest.md) @@ -555,7 +560,7 @@ Class | Method | HTTP request | Description - [Change](docs/Change.md) - [ChangeLoyaltyTierLevelEffectProps](docs/ChangeLoyaltyTierLevelEffectProps.md) - [ChangeProfilePassword](docs/ChangeProfilePassword.md) -- [CheckAttributeBlock](docs/CheckAttributeBlock.md) +- [CheckAttributeBlockBase](docs/CheckAttributeBlockBase.md) - [CheckAudienceBlock](docs/CheckAudienceBlock.md) - [CheckAudienceBlock1Audience](docs/CheckAudienceBlock1Audience.md) - [CheckCouponBlock](docs/CheckCouponBlock.md) @@ -564,6 +569,7 @@ Class | Method | HTTP request | Description - [Collection](docs/Collection.md) - [CollectionItem](docs/CollectionItem.md) - [CollectionWithoutPayload](docs/CollectionWithoutPayload.md) +- [ConfirmRisksRequest](docs/ConfirmRisksRequest.md) - [Coupon](docs/Coupon.md) - [CouponConstraints](docs/CouponConstraints.md) - [CouponCreatedEffectProps](docs/CouponCreatedEffectProps.md) @@ -602,6 +608,7 @@ Class | Method | HTTP request | Description - [CustomerProfileEntity](docs/CustomerProfileEntity.md) - [CustomerProfileIntegrationRequestV2](docs/CustomerProfileIntegrationRequestV2.md) - [CustomerProfileIntegrationResponseV2](docs/CustomerProfileIntegrationResponseV2.md) +- [CustomerProfileReward](docs/CustomerProfileReward.md) - [CustomerProfileSearchQuery](docs/CustomerProfileSearchQuery.md) - [CustomerProfileUpdateV2Response](docs/CustomerProfileUpdateV2Response.md) - [CustomerSession](docs/CustomerSession.md) @@ -612,8 +619,12 @@ Class | Method | HTTP request | Description - [DeleteCouponsData](docs/DeleteCouponsData.md) - [DeleteLoyaltyTransactionsRequest](docs/DeleteLoyaltyTransactionsRequest.md) - [DeleteUserRequest](docs/DeleteUserRequest.md) +- [DigitalPass](docs/DigitalPass.md) +- [DiscardRisksRequest](docs/DiscardRisksRequest.md) - [Effect](docs/Effect.md) +- [EffectAllOfProps](docs/EffectAllOfProps.md) - [EffectEntity](docs/EffectEntity.md) +- [EffectProps](docs/EffectProps.md) - [EmailEntity](docs/EmailEntity.md) - [EmbeddedAnalyticsConfiguration](docs/EmbeddedAnalyticsConfiguration.md) - [EmbeddedAnalyticsConfigurationDashboards](docs/EmbeddedAnalyticsConfigurationDashboards.md) @@ -768,6 +779,7 @@ Class | Method | HTTP request | Description - [IntegrationHubFlowResponse](docs/IntegrationHubFlowResponse.md) - [IntegrationHubFlowWithConfig](docs/IntegrationHubFlowWithConfig.md) - [IntegrationHubPaginatedEventPayload](docs/IntegrationHubPaginatedEventPayload.md) +- [IntegrationHubPaginatedEventPayloadDataInner](docs/IntegrationHubPaginatedEventPayloadDataInner.md) - [IntegrationProfileEntity](docs/IntegrationProfileEntity.md) - [IntegrationProfileEntityV3](docs/IntegrationProfileEntityV3.md) - [IntegrationRequest](docs/IntegrationRequest.md) @@ -778,6 +790,7 @@ Class | Method | HTTP request | Description - [InventoryCoupon](docs/InventoryCoupon.md) - [InventoryReferral](docs/InventoryReferral.md) - [ItemAttribute](docs/ItemAttribute.md) +- [LabelTarget](docs/LabelTarget.md) - [LabelTargetAudience](docs/LabelTargetAudience.md) - [LabelTargetNone](docs/LabelTargetNone.md) - [LedgerEntry](docs/LedgerEntry.md) @@ -795,10 +808,8 @@ Class | Method | HTTP request | Description - [ListCampaignStoreBudgets](docs/ListCampaignStoreBudgets.md) - [ListCampaignStoreBudgetsStore](docs/ListCampaignStoreBudgetsStore.md) - [ListCatalogItems200Response](docs/ListCatalogItems200Response.md) -- [ListCheckAttributeBlock](docs/ListCheckAttributeBlock.md) - [ListExperiments200Response](docs/ListExperiments200Response.md) - [ListStores200Response](docs/ListStores200Response.md) -- [ListWithCountCheckAttributeBlock](docs/ListWithCountCheckAttributeBlock.md) - [LoginParams](docs/LoginParams.md) - [Loyalty](docs/Loyalty.md) - [LoyaltyBalance](docs/LoyaltyBalance.md) @@ -827,6 +838,8 @@ Class | Method | HTTP request | Description - [LoyaltySubLedger](docs/LoyaltySubLedger.md) - [LoyaltyTier](docs/LoyaltyTier.md) - [MCPKey](docs/MCPKey.md) +- [MCPOAuthProtectedResource](docs/MCPOAuthProtectedResource.md) +- [MCPOAuthServerMetadata](docs/MCPOAuthServerMetadata.md) - [ManagementKey](docs/ManagementKey.md) - [ManagerConfig](docs/ManagerConfig.md) - [MessageLogEntries](docs/MessageLogEntries.md) @@ -877,6 +890,7 @@ Class | Method | HTTP request | Description - [NewCustomerProfile](docs/NewCustomerProfile.md) - [NewCustomerSession](docs/NewCustomerSession.md) - [NewCustomerSessionV2](docs/NewCustomerSessionV2.md) +- [NewDigitalPass](docs/NewDigitalPass.md) - [NewEvent](docs/NewEvent.md) - [NewEventType](docs/NewEventType.md) - [NewEventV3Entity](docs/NewEventV3Entity.md) @@ -927,6 +941,7 @@ Class | Method | HTTP request | Description - [OutgoingIntegrationBrazePolicy](docs/OutgoingIntegrationBrazePolicy.md) - [OutgoingIntegrationCleverTapPolicy](docs/OutgoingIntegrationCleverTapPolicy.md) - [OutgoingIntegrationConfiguration](docs/OutgoingIntegrationConfiguration.md) +- [OutgoingIntegrationConfigurationPolicy](docs/OutgoingIntegrationConfigurationPolicy.md) - [OutgoingIntegrationIterablePolicy](docs/OutgoingIntegrationIterablePolicy.md) - [OutgoingIntegrationMoEngagePolicy](docs/OutgoingIntegrationMoEngagePolicy.md) - [OutgoingIntegrationTemplate](docs/OutgoingIntegrationTemplate.md) @@ -956,6 +971,7 @@ Class | Method | HTTP request | Description - [ProfileAudiencesChanges](docs/ProfileAudiencesChanges.md) - [ProjectedTier](docs/ProjectedTier.md) - [PromoteExperiment](docs/PromoteExperiment.md) +- [PromotionBlock](docs/PromotionBlock.md) - [PromotionCheckAttributeBlock](docs/PromotionCheckAttributeBlock.md) - [PromotionGroupBlock](docs/PromotionGroupBlock.md) - [PromotionRuleV2](docs/PromotionRuleV2.md) @@ -974,6 +990,7 @@ Class | Method | HTTP request | Description - [ResponseContentObject](docs/ResponseContentObject.md) - [ReturnIntegrationRequest](docs/ReturnIntegrationRequest.md) - [ReturnedCartItem](docs/ReturnedCartItem.md) +- [ReviewRisksRequest](docs/ReviewRisksRequest.md) - [Revision](docs/Revision.md) - [RevisionActivation](docs/RevisionActivation.md) - [RevisionActivationRequest](docs/RevisionActivationRequest.md) @@ -982,6 +999,7 @@ Class | Method | HTTP request | Description - [RewardPointsRequired](docs/RewardPointsRequired.md) - [Risk](docs/Risk.md) - [RiskAffectedEntityItem](docs/RiskAffectedEntityItem.md) +- [RiskCriticalityUpdate](docs/RiskCriticalityUpdate.md) - [RiskDetail](docs/RiskDetail.md) - [RiskNotification](docs/RiskNotification.md) - [Role](docs/Role.md) @@ -1015,7 +1033,6 @@ Class | Method | HTTP request | Description - [SamlConnectionInternal](docs/SamlConnectionInternal.md) - [SamlConnectionMetadata](docs/SamlConnectionMetadata.md) - [SamlLoginEndpoint](docs/SamlLoginEndpoint.md) -- [ScalarCheckAttributeBlock](docs/ScalarCheckAttributeBlock.md) - [ScimBaseGroup](docs/ScimBaseGroup.md) - [ScimBaseUser](docs/ScimBaseUser.md) - [ScimBaseUserName](docs/ScimBaseUserName.md) @@ -1033,6 +1050,8 @@ Class | Method | HTTP request | Description - [ScimServiceProviderConfigResponseBulk](docs/ScimServiceProviderConfigResponseBulk.md) - [ScimServiceProviderConfigResponseChangePassword](docs/ScimServiceProviderConfigResponseChangePassword.md) - [ScimServiceProviderConfigResponseFilter](docs/ScimServiceProviderConfigResponseFilter.md) +- [ScimServiceProviderConfigResponsePatch](docs/ScimServiceProviderConfigResponsePatch.md) +- [ScimServiceProviderConfigResponseSort](docs/ScimServiceProviderConfigResponseSort.md) - [ScimUser](docs/ScimUser.md) - [ScimUsersListResponse](docs/ScimUsersListResponse.md) - [SecondaryDeployment](docs/SecondaryDeployment.md) @@ -1049,11 +1068,13 @@ Class | Method | HTTP request | Description - [SkuUnitAnalyticsDataPoint](docs/SkuUnitAnalyticsDataPoint.md) - [SlotDef](docs/SlotDef.md) - [Store](docs/Store.md) +- [StrikethroughBlock](docs/StrikethroughBlock.md) - [StrikethroughChangedItem](docs/StrikethroughChangedItem.md) - [StrikethroughCheckAttributeBlock](docs/StrikethroughCheckAttributeBlock.md) - [StrikethroughCustomEffectPerItemProps](docs/StrikethroughCustomEffectPerItemProps.md) - [StrikethroughDebugResponse](docs/StrikethroughDebugResponse.md) - [StrikethroughEffect](docs/StrikethroughEffect.md) +- [StrikethroughEffectProps](docs/StrikethroughEffectProps.md) - [StrikethroughGroupBlock](docs/StrikethroughGroupBlock.md) - [StrikethroughLabelingNotification](docs/StrikethroughLabelingNotification.md) - [StrikethroughRuleV2](docs/StrikethroughRuleV2.md) @@ -1084,15 +1105,21 @@ Class | Method | HTTP request | Description - [TransferLoyaltyCard](docs/TransferLoyaltyCard.md) - [TriggerWebhookEffectProps](docs/TriggerWebhookEffectProps.md) - [TwoFAConfig](docs/TwoFAConfig.md) -- [UnaryCheckAttributeBlock](docs/UnaryCheckAttributeBlock.md) - [UpdateAccount](docs/UpdateAccount.md) - [UpdateAchievement](docs/UpdateAchievement.md) +- [UpdateAchievementProgressBlock](docs/UpdateAchievementProgressBlock.md) +- [UpdateAchievementProgressBlock1Achievement](docs/UpdateAchievementProgressBlock1Achievement.md) - [UpdateAchievementV2](docs/UpdateAchievementV2.md) - [UpdateApplication](docs/UpdateApplication.md) - [UpdateApplicationAPIKey](docs/UpdateApplicationAPIKey.md) - [UpdateApplicationCIF](docs/UpdateApplicationCIF.md) - [UpdateAttributeEffectProps](docs/UpdateAttributeEffectProps.md) +- [UpdateAttributeValueBlock](docs/UpdateAttributeValueBlock.md) +- [UpdateAttributeValueBlock1Attribute](docs/UpdateAttributeValueBlock1Attribute.md) +- [UpdateAttributeValueBlock1Target](docs/UpdateAttributeValueBlock1Target.md) - [UpdateAudience](docs/UpdateAudience.md) +- [UpdateAudienceMembershipBlock](docs/UpdateAudienceMembershipBlock.md) +- [UpdateAudienceMembershipBlock1Audience](docs/UpdateAudienceMembershipBlock1Audience.md) - [UpdateBlueprint](docs/UpdateBlueprint.md) - [UpdateCampaign](docs/UpdateCampaign.md) - [UpdateCampaignCollection](docs/UpdateCampaignCollection.md) @@ -1105,6 +1132,7 @@ Class | Method | HTTP request | Description - [UpdateCouponBatch](docs/UpdateCouponBatch.md) - [UpdateCouponsData](docs/UpdateCouponsData.md) - [UpdateCustomEffect](docs/UpdateCustomEffect.md) +- [UpdateCustomerProfileV2409Response](docs/UpdateCustomerProfileV2409Response.md) - [UpdateCustomerSessionV2409Response](docs/UpdateCustomerSessionV2409Response.md) - [UpdateExperiment](docs/UpdateExperiment.md) - [UpdateExperimentVariant](docs/UpdateExperimentVariant.md) @@ -1129,6 +1157,10 @@ Class | Method | HTTP request | Description - [ValueMap](docs/ValueMap.md) - [Webhook](docs/Webhook.md) - [WebhookAuthentication](docs/WebhookAuthentication.md) +- [WebhookAuthenticationAllOfData](docs/WebhookAuthenticationAllOfData.md) +- [WebhookAuthenticationBase](docs/WebhookAuthenticationBase.md) +- [WebhookAuthenticationBaseOneOf](docs/WebhookAuthenticationBaseOneOf.md) +- [WebhookAuthenticationBaseOneOf1](docs/WebhookAuthenticationBaseOneOf1.md) - [WebhookAuthenticationDataBasic](docs/WebhookAuthenticationDataBasic.md) - [WebhookAuthenticationDataCustom](docs/WebhookAuthenticationDataCustom.md) - [WebhookAuthenticationWebhookRef](docs/WebhookAuthenticationWebhookRef.md) diff --git a/docs/ApplicationEvent.md b/docs/ApplicationEvent.md index 3f4e5ec..fddec51 100644 --- a/docs/ApplicationEvent.md +++ b/docs/ApplicationEvent.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **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** | 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 properties associated with this campaign. | +**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/ApplicationNotification.md b/docs/ApplicationNotification.md deleted file mode 100644 index 16c7f97..0000000 --- a/docs/ApplicationNotification.md +++ /dev/null @@ -1,29 +0,0 @@ -# ApplicationNotification - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**event** | **str** | Event type. It can be one of the following: ['campaign_evaluation_tree_changed'] | - -## Example - -```python -from talon_one.models.application_notification import ApplicationNotification - -# TODO update the JSON string below -json = "{}" -# create an instance of ApplicationNotification from a JSON string -application_notification_instance = ApplicationNotification.from_json(json) -# print the JSON string representation of the object -print(ApplicationNotification.to_json()) - -# convert the object into a dict -application_notification_dict = application_notification_instance.to_dict() -# create an instance of ApplicationNotification from a dict -application_notification_from_dict = ApplicationNotification.from_dict(application_notification_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/ApplicationSession.md b/docs/ApplicationSession.md index 59a53d5..e173bd4 100644 --- a/docs/ApplicationSession.md +++ b/docs/ApplicationSession.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes **discounts** | **Dict[str, float]** | **API V1 only.** A map of labeled discount values, in the same currency as the session. If you are using the V2 endpoints, refer to the `totalDiscounts` property instead. | **total_discounts** | **float** | The total sum of the discounts applied to this session. **Note:** If more than one session is returned, this value is displayed as `0`. | **total** | **float** | The total sum of the session before any discounts applied. | -**attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] +**attributes** | **object** | Arbitrary properties associated with this item. | [optional] ## Example diff --git a/docs/AwardGiveawayBlock.md b/docs/AwardGiveawayBlock.md index 0ae3ed6..d3f5f97 100644 --- a/docs/AwardGiveawayBlock.md +++ b/docs/AwardGiveawayBlock.md @@ -10,8 +10,8 @@ Name | Type | Description | Notes **tags** | **List[str]** | Semantic labels attached to this block. | [optional] **giveaway_pool** | [**AwardGiveawayBlock1GiveawayPool**](AwardGiveawayBlock1GiveawayPool.md) | | **profile** | **str** | The customer profile to award the giveaway to. `Current` targets the customer in the current session; `Advocate` targets the person who invited their friend via referral program. | -**on_failure** | **List[object]** | Blocks evaluated when this block fails or returns false. | [optional] -**on_error** | **Dict[str, List[object]]** | Named error handlers evaluated when a specific error occurs. | [optional] +**on_failure** | [**List[PromotionBlock]**](PromotionBlock.md) | Blocks evaluated when this block fails or returns false. | [optional] +**on_error** | **Dict[str, List[PromotionBlock]]** | Named error handlers evaluated when a specific error occurs. | [optional] ## Example diff --git a/docs/AwardItemBlock.md b/docs/AwardItemBlock.md index 7358d15..9d5e4d0 100644 --- a/docs/AwardItemBlock.md +++ b/docs/AwardItemBlock.md @@ -12,8 +12,8 @@ Name | Type | Description | Notes **name** | **str** | The display name of the item to award. | **quantity** | **str** | The number of items to award. Supports template placeholders (e.g. \"{{$Session.Total / 2}}\") for dynamic quantities. | **partial** | **bool** | When set to `true`, applies a partial item reward if the remaining budget is insufficient to award the full reward. | [optional] -**on_failure** | **List[object]** | Blocks evaluated when this block fails or returns false. | [optional] -**on_error** | **Dict[str, List[object]]** | Named error handlers evaluated when a specific error occurs. | [optional] +**on_failure** | [**List[PromotionBlock]**](PromotionBlock.md) | Blocks evaluated when this block fails or returns false. | [optional] +**on_error** | **Dict[str, List[PromotionBlock]]** | Named error handlers evaluated when a specific error occurs. | [optional] ## Example diff --git a/docs/BaseNotification.md b/docs/BaseNotification.md index 4151641..dc234a9 100644 --- a/docs/BaseNotification.md +++ b/docs/BaseNotification.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**policy** | **object** | Indicates which notification properties to apply. | +**policy** | [**BaseNotificationPolicy**](BaseNotificationPolicy.md) | | **enabled** | **bool** | Indicates whether the notification is activated. | [optional] [default to True] **webhook** | [**BaseNotificationWebhook**](BaseNotificationWebhook.md) | | **id** | **int** | Unique ID for this entity. | diff --git a/docs/BaseNotificationEntity.md b/docs/BaseNotificationEntity.md index 1c10e98..d68ae55 100644 --- a/docs/BaseNotificationEntity.md +++ b/docs/BaseNotificationEntity.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**policy** | **object** | Indicates which notification properties to apply. | +**policy** | [**BaseNotificationPolicy**](BaseNotificationPolicy.md) | | **enabled** | **bool** | Indicates whether the notification is activated. | [optional] [default to True] ## Example diff --git a/docs/BaseNotificationPolicy.md b/docs/BaseNotificationPolicy.md new file mode 100644 index 0000000..2836ffe --- /dev/null +++ b/docs/BaseNotificationPolicy.md @@ -0,0 +1,36 @@ +# BaseNotificationPolicy + +Indicates which notification properties to apply. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the notification. | +**triggers** | [**List[TierWillDowngradeNotificationTrigger]**](TierWillDowngradeNotificationTrigger.md) | | +**batching_enabled** | **bool** | Indicates whether batching is activated. | [optional] [default to True] +**batch_size** | **int** | The required size of each batch of data. This value applies only when `batchingEnabled` is `true`. | [optional] [default to 1000] +**scopes** | **List[str]** | | +**include_data** | **bool** | Indicates whether to include all generated coupons. If `false`, only the `batchId` of the generated coupons is included. | [optional] +**ahead_of_days_trigger** | **int** | The number of days in advance that strikethrough pricing updates should be sent. | [optional] + +## Example + +```python +from talon_one.models.base_notification_policy import BaseNotificationPolicy + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseNotificationPolicy from a JSON string +base_notification_policy_instance = BaseNotificationPolicy.from_json(json) +# print the JSON string representation of the object +print(BaseNotificationPolicy.to_json()) + +# convert the object into a dict +base_notification_policy_dict = base_notification_policy_instance.to_dict() +# create an instance of BaseNotificationPolicy from a dict +base_notification_policy_from_dict = BaseNotificationPolicy.from_dict(base_notification_policy_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/BestPriorPrice.md b/docs/BestPriorPrice.md index 2d5318e..c0a0cd4 100644 --- a/docs/BestPriorPrice.md +++ b/docs/BestPriorPrice.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **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** | | +**target** | [**LabelTarget**](LabelTarget.md) | | ## Example diff --git a/docs/BetweenCheckAttributeBlock.md b/docs/BetweenCheckAttributeBlock.md deleted file mode 100644 index b2f4527..0000000 --- a/docs/BetweenCheckAttributeBlock.md +++ /dev/null @@ -1,32 +0,0 @@ -# BetweenCheckAttributeBlock - -Variant of `CheckAttributeBlock` for the `between` operator, which requires both a minimum and maximum value. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**operator** | **str** | The range comparison operator. Must be `between`. | [optional] -**min** | **object** | | -**max** | **object** | | - -## Example - -```python -from talon_one.models.between_check_attribute_block import BetweenCheckAttributeBlock - -# TODO update the JSON string below -json = "{}" -# create an instance of BetweenCheckAttributeBlock from a JSON string -between_check_attribute_block_instance = BetweenCheckAttributeBlock.from_json(json) -# print the JSON string representation of the object -print(BetweenCheckAttributeBlock.to_json()) - -# convert the object into a dict -between_check_attribute_block_dict = between_check_attribute_block_instance.to_dict() -# create an instance of BetweenCheckAttributeBlock from a dict -between_check_attribute_block_from_dict = BetweenCheckAttributeBlock.from_dict(between_check_attribute_block_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BulkApplicationNotification.md b/docs/BulkApplicationNotification.md index a6fabc0..030023b 100644 --- a/docs/BulkApplicationNotification.md +++ b/docs/BulkApplicationNotification.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **total_result_size** | **int** | | -**data** | [**List[ApplicationNotification]**](ApplicationNotification.md) | | +**data** | [**List[CampaignEvaluationTreeChangedNotification]**](CampaignEvaluationTreeChangedNotification.md) | | ## Example diff --git a/docs/CampaignEvaluationTreeChangedMessage.md b/docs/CampaignEvaluationTreeChangedMessage.md index 22f8572..ca06d83 100644 --- a/docs/CampaignEvaluationTreeChangedMessage.md +++ b/docs/CampaignEvaluationTreeChangedMessage.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **notification_type** | **str** | The type of the notification | **total_result_size** | **int** | The total size of the result set. | -**data** | [**List[ApplicationNotification]**](ApplicationNotification.md) | The array of changes. | [optional] +**data** | [**List[CampaignEvaluationTreeChangedNotification]**](CampaignEvaluationTreeChangedNotification.md) | The array of changes. | [optional] ## Example diff --git a/docs/CampaignSetNode.md b/docs/CampaignSetNode.md index a849251..70d5b6f 100644 --- a/docs/CampaignSetNode.md +++ b/docs/CampaignSetNode.md @@ -6,6 +6,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | | +**name** | **str** | Name of the set. | +**operator** | **str** | An indicator of how the set operates on its elements. | +**elements** | [**List[CampaignSetNode]**](CampaignSetNode.md) | Child elements of this set. | +**group_id** | **int** | The ID of the campaign set. | +**locked** | **bool** | An indicator of whether the campaign set is locked for modification. | +**description** | **str** | A description of the campaign set. | [optional] +**evaluation_mode** | **str** | The mode by which campaigns in the campaign evaluation group are evaluated. | +**evaluation_scope** | **str** | The evaluation scope of the campaign evaluation group. | +**campaign_id** | **int** | ID of the campaign | ## Example diff --git a/docs/CatalogAction.md b/docs/CatalogAction.md index aa1cf4b..5517018 100644 --- a/docs/CatalogAction.md +++ b/docs/CatalogAction.md @@ -6,8 +6,8 @@ Definition of all the properties that are needed for a single catalog sync actio Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **str** | The type of sync action. | -**payload** | **object** | | +**type** | **object** | | +**payload** | [**AddPriceAdjustmentCatalogAction**](AddPriceAdjustmentCatalogAction.md) | | ## Example diff --git a/docs/CatalogActionOneOf.md b/docs/CatalogActionOneOf.md new file mode 100644 index 0000000..96f1a36 --- /dev/null +++ b/docs/CatalogActionOneOf.md @@ -0,0 +1,30 @@ +# CatalogActionOneOf + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **object** | | +**payload** | [**AddItemCatalogAction**](AddItemCatalogAction.md) | The payload of sync action. | + +## Example + +```python +from talon_one.models.catalog_action_one_of import CatalogActionOneOf + +# TODO update the JSON string below +json = "{}" +# create an instance of CatalogActionOneOf from a JSON string +catalog_action_one_of_instance = CatalogActionOneOf.from_json(json) +# print the JSON string representation of the object +print(CatalogActionOneOf.to_json()) + +# convert the object into a dict +catalog_action_one_of_dict = catalog_action_one_of_instance.to_dict() +# create an instance of CatalogActionOneOf from a dict +catalog_action_one_of_from_dict = CatalogActionOneOf.from_dict(catalog_action_one_of_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/CatalogActionOneOf1.md b/docs/CatalogActionOneOf1.md new file mode 100644 index 0000000..34a02ff --- /dev/null +++ b/docs/CatalogActionOneOf1.md @@ -0,0 +1,30 @@ +# CatalogActionOneOf1 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **object** | | +**payload** | [**PatchItemCatalogAction**](PatchItemCatalogAction.md) | | + +## Example + +```python +from talon_one.models.catalog_action_one_of1 import CatalogActionOneOf1 + +# TODO update the JSON string below +json = "{}" +# create an instance of CatalogActionOneOf1 from a JSON string +catalog_action_one_of1_instance = CatalogActionOneOf1.from_json(json) +# print the JSON string representation of the object +print(CatalogActionOneOf1.to_json()) + +# convert the object into a dict +catalog_action_one_of1_dict = catalog_action_one_of1_instance.to_dict() +# create an instance of CatalogActionOneOf1 from a dict +catalog_action_one_of1_from_dict = CatalogActionOneOf1.from_dict(catalog_action_one_of1_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/CatalogActionOneOf2.md b/docs/CatalogActionOneOf2.md new file mode 100644 index 0000000..7aee9ac --- /dev/null +++ b/docs/CatalogActionOneOf2.md @@ -0,0 +1,30 @@ +# CatalogActionOneOf2 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **object** | | +**payload** | [**PatchManyItemsCatalogAction**](PatchManyItemsCatalogAction.md) | | + +## Example + +```python +from talon_one.models.catalog_action_one_of2 import CatalogActionOneOf2 + +# TODO update the JSON string below +json = "{}" +# create an instance of CatalogActionOneOf2 from a JSON string +catalog_action_one_of2_instance = CatalogActionOneOf2.from_json(json) +# print the JSON string representation of the object +print(CatalogActionOneOf2.to_json()) + +# convert the object into a dict +catalog_action_one_of2_dict = catalog_action_one_of2_instance.to_dict() +# create an instance of CatalogActionOneOf2 from a dict +catalog_action_one_of2_from_dict = CatalogActionOneOf2.from_dict(catalog_action_one_of2_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/CatalogActionOneOf3.md b/docs/CatalogActionOneOf3.md new file mode 100644 index 0000000..bb9153a --- /dev/null +++ b/docs/CatalogActionOneOf3.md @@ -0,0 +1,30 @@ +# CatalogActionOneOf3 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **object** | | +**payload** | [**RemoveItemCatalogAction**](RemoveItemCatalogAction.md) | | + +## Example + +```python +from talon_one.models.catalog_action_one_of3 import CatalogActionOneOf3 + +# TODO update the JSON string below +json = "{}" +# create an instance of CatalogActionOneOf3 from a JSON string +catalog_action_one_of3_instance = CatalogActionOneOf3.from_json(json) +# print the JSON string representation of the object +print(CatalogActionOneOf3.to_json()) + +# convert the object into a dict +catalog_action_one_of3_dict = catalog_action_one_of3_instance.to_dict() +# create an instance of CatalogActionOneOf3 from a dict +catalog_action_one_of3_from_dict = CatalogActionOneOf3.from_dict(catalog_action_one_of3_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/CatalogActionOneOf4.md b/docs/CatalogActionOneOf4.md new file mode 100644 index 0000000..4622d65 --- /dev/null +++ b/docs/CatalogActionOneOf4.md @@ -0,0 +1,30 @@ +# CatalogActionOneOf4 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **object** | | +**payload** | [**RemoveManyItemsCatalogAction**](RemoveManyItemsCatalogAction.md) | | + +## Example + +```python +from talon_one.models.catalog_action_one_of4 import CatalogActionOneOf4 + +# TODO update the JSON string below +json = "{}" +# create an instance of CatalogActionOneOf4 from a JSON string +catalog_action_one_of4_instance = CatalogActionOneOf4.from_json(json) +# print the JSON string representation of the object +print(CatalogActionOneOf4.to_json()) + +# convert the object into a dict +catalog_action_one_of4_dict = catalog_action_one_of4_instance.to_dict() +# create an instance of CatalogActionOneOf4 from a dict +catalog_action_one_of4_from_dict = CatalogActionOneOf4.from_dict(catalog_action_one_of4_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/CatalogActionOneOf5.md b/docs/CatalogActionOneOf5.md new file mode 100644 index 0000000..e962453 --- /dev/null +++ b/docs/CatalogActionOneOf5.md @@ -0,0 +1,30 @@ +# CatalogActionOneOf5 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **object** | | +**payload** | [**AddPriceAdjustmentCatalogAction**](AddPriceAdjustmentCatalogAction.md) | | + +## Example + +```python +from talon_one.models.catalog_action_one_of5 import CatalogActionOneOf5 + +# TODO update the JSON string below +json = "{}" +# create an instance of CatalogActionOneOf5 from a JSON string +catalog_action_one_of5_instance = CatalogActionOneOf5.from_json(json) +# print the JSON string representation of the object +print(CatalogActionOneOf5.to_json()) + +# convert the object into a dict +catalog_action_one_of5_dict = catalog_action_one_of5_instance.to_dict() +# create an instance of CatalogActionOneOf5 from a dict +catalog_action_one_of5_from_dict = CatalogActionOneOf5.from_dict(catalog_action_one_of5_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/Change.md b/docs/Change.md index cc62ffa..f2b32b6 100644 --- a/docs/Change.md +++ b/docs/Change.md @@ -10,8 +10,8 @@ Name | Type | Description | Notes **user_id** | **int** | The ID of the user associated with this entity. | **application_id** | **int** | ID of application associated with change. | [optional] **entity** | **str** | API endpoint on which the change was initiated. | -**old** | **object** | Arbitrary properties associated with this campaign. | [optional] -**new** | **object** | Arbitrary properties associated with this campaign. | [optional] +**old** | **object** | Resource before the change occurred. | [optional] +**new** | **object** | Resource after the change occurred. | [optional] **management_key_id** | **int** | ID of management key used to perform changes. | [optional] ## Example diff --git a/docs/CheckAttributeBlock.md b/docs/CheckAttributeBlockBase.md similarity index 66% rename from docs/CheckAttributeBlock.md rename to docs/CheckAttributeBlockBase.md index b052c16..5693918 100644 --- a/docs/CheckAttributeBlock.md +++ b/docs/CheckAttributeBlockBase.md @@ -1,4 +1,4 @@ -# CheckAttributeBlock +# CheckAttributeBlockBase ## Properties @@ -19,19 +19,19 @@ Name | Type | Description | Notes ## Example ```python -from talon_one.models.check_attribute_block import CheckAttributeBlock +from talon_one.models.check_attribute_block_base import CheckAttributeBlockBase # TODO update the JSON string below json = "{}" -# create an instance of CheckAttributeBlock from a JSON string -check_attribute_block_instance = CheckAttributeBlock.from_json(json) +# create an instance of CheckAttributeBlockBase from a JSON string +check_attribute_block_base_instance = CheckAttributeBlockBase.from_json(json) # print the JSON string representation of the object -print(CheckAttributeBlock.to_json()) +print(CheckAttributeBlockBase.to_json()) # convert the object into a dict -check_attribute_block_dict = check_attribute_block_instance.to_dict() -# create an instance of CheckAttributeBlock from a dict -check_attribute_block_from_dict = CheckAttributeBlock.from_dict(check_attribute_block_dict) +check_attribute_block_base_dict = check_attribute_block_base_instance.to_dict() +# create an instance of CheckAttributeBlockBase from a dict +check_attribute_block_base_from_dict = CheckAttributeBlockBase.from_dict(check_attribute_block_base_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/CheckAudienceBlock.md b/docs/CheckAudienceBlock.md index b7fb1ee..ef78fbb 100644 --- a/docs/CheckAudienceBlock.md +++ b/docs/CheckAudienceBlock.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **operator** | **str** | An indicator of how the block compares its elements. | **profile** | **str** | The customer profile to check against the audience. `Current` targets the customer in the current session; `Advocate` targets the person who invited their friend via referral program. | **audience** | [**CheckAudienceBlock1Audience**](CheckAudienceBlock1Audience.md) | | -**on_failure** | **List[object]** | Promotion blocks evaluated when this block fails or returns false. | [optional] +**on_failure** | [**List[PromotionBlock]**](PromotionBlock.md) | Promotion blocks evaluated when this block fails or returns false. | [optional] ## Example diff --git a/docs/CheckCouponBlock.md b/docs/CheckCouponBlock.md index 6b8f629..e5b5458 100644 --- a/docs/CheckCouponBlock.md +++ b/docs/CheckCouponBlock.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **type** | **str** | Identifies the block variant and determines which additional properties are present in it. | **tags** | **List[str]** | Semantic labels attached to this block. | [optional] **redeem** | **bool** | When `true`, the coupon code is redeemed. | -**on_failure** | **List[object]** | Promotion blocks evaluated when this block fails or returns false. | [optional] +**on_failure** | [**List[PromotionBlock]**](PromotionBlock.md) | Promotion blocks evaluated when this block fails or returns false. | [optional] ## Example diff --git a/docs/CheckReferralBlock.md b/docs/CheckReferralBlock.md index 4f03d31..ef8d675 100644 --- a/docs/CheckReferralBlock.md +++ b/docs/CheckReferralBlock.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **type** | **str** | Identifies the block variant and determines which additional properties are present in it. | **tags** | **List[str]** | Semantic labels attached to this block. | [optional] **redeem** | **bool** | When `true`, the referral code is redeemed. | -**on_failure** | **List[object]** | Promotion blocks evaluated when this block fails or returns false. | [optional] +**on_failure** | [**List[PromotionBlock]**](PromotionBlock.md) | Promotion blocks evaluated when this block fails or returns false. | [optional] ## Example diff --git a/docs/ConfirmRisksRequest.md b/docs/ConfirmRisksRequest.md new file mode 100644 index 0000000..a8ab12c --- /dev/null +++ b/docs/ConfirmRisksRequest.md @@ -0,0 +1,30 @@ +# ConfirmRisksRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**risk_ids** | **List[int]** | The IDs of the risks to confirm. | +**comment** | **str** | Free-text description of how the risk was resolved. | + +## Example + +```python +from talon_one.models.confirm_risks_request import ConfirmRisksRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of ConfirmRisksRequest from a JSON string +confirm_risks_request_instance = ConfirmRisksRequest.from_json(json) +# print the JSON string representation of the object +print(ConfirmRisksRequest.to_json()) + +# convert the object into a dict +confirm_risks_request_dict = confirm_risks_request_instance.to_dict() +# create an instance of ConfirmRisksRequest from a dict +confirm_risks_request_from_dict = ConfirmRisksRequest.from_dict(confirm_risks_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/CouponCreationJob.md b/docs/CouponCreationJob.md index 7b36341..08cae13 100644 --- a/docs/CouponCreationJob.md +++ b/docs/CouponCreationJob.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes **expiry_date** | **datetime** | Expiration date of the coupon. Coupon never expires if this is omitted. | [optional] **number_of_coupons** | **int** | The number of new coupon codes to generate for the campaign. | **coupon_settings** | [**CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] -**attributes** | **object** | Arbitrary properties associated with this campaign. | +**attributes** | **object** | Arbitrary properties associated with coupons. | **is_reservation_mandatory** | **bool** | An indication of whether the code can be redeemed only if it has been reserved first. | [optional] [default to False] **batch_id** | **str** | The batch ID coupons created by this job will bear. | **status** | **str** | The current status of this request. Possible values: - `pending verification` - `pending` - `completed` - `failed` - `coupon pattern full` | diff --git a/docs/CustomerProfileReward.md b/docs/CustomerProfileReward.md new file mode 100644 index 0000000..087aea8 --- /dev/null +++ b/docs/CustomerProfileReward.md @@ -0,0 +1,39 @@ +# CustomerProfileReward + +A reward instance held by a customer profile. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the customer reward instance. A customer profile can have multiple instances of the same reward. | +**reward_id** | **int** | The ID of the reward this instance belongs to. | +**reward_name** | **str** | The name of the reward. | +**status** | **str** | The status of the customer reward: - `unlocked`: The reward is available for use. - `used`: The reward has been used. | +**unlocked_at** | **datetime** | The date and time when the reward was unlocked. | +**unlocked_by_integration_id** | **str** | The integration ID of the customer profile that unlocked the reward. For rewards unlocked with a loyalty card, this can be any customer profile linked to that loyalty card. | [optional] +**used_at** | **datetime** | The date and time when the reward was used. | [optional] +**used_by_integration_id** | **str** | The integration ID of the customer profile that used the reward. For rewards unlocked with a loyalty card, this can be any customer profile linked to that loyalty card. Only returned when the reward has been used. | [optional] +**loyalty_program_id** | **int** | The ID of the loyalty program that the loyalty card belongs to. Only returned for rewards unlocked with a loyalty card. | [optional] +**loyalty_card_identifier** | **str** | The identifier of the loyalty card that the reward was unlocked with. Only returned for rewards unlocked with a loyalty card. | [optional] + +## Example + +```python +from talon_one.models.customer_profile_reward import CustomerProfileReward + +# TODO update the JSON string below +json = "{}" +# create an instance of CustomerProfileReward from a JSON string +customer_profile_reward_instance = CustomerProfileReward.from_json(json) +# print the JSON string representation of the object +print(CustomerProfileReward.to_json()) + +# convert the object into a dict +customer_profile_reward_dict = customer_profile_reward_instance.to_dict() +# create an instance of CustomerProfileReward from a dict +customer_profile_reward_from_dict = CustomerProfileReward.from_dict(customer_profile_reward_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/CustomerSession.md b/docs/CustomerSession.md index b3f4cec..5f9326d 100644 --- a/docs/CustomerSession.md +++ b/docs/CustomerSession.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **cart_items** | [**List[CartItem]**](CartItem.md) | Serialized JSON representation. | [optional] **identifiers** | **List[str]** | Session custom identifiers that you can set limits on or use inside your rules. For example, you can use IP addresses as identifiers to potentially identify devices and limit discounts abuse in case of customers creating multiple accounts. See the [tutorial](https://docs.talon.one/docs/dev/tutorials/using-identifiers). | [optional] **total** | **float** | The total sum of the cart in one session. | [optional] -**attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] +**attributes** | **object** | A key-value map of the sessions attributes. The potentially valid attributes are configured in your accounts developer settings. | [optional] **first_session** | **bool** | Indicates whether this is the first session for the customer's profile. Will always be true for anonymous sessions. | **update_count** | **int** | The number of times the session was updated. When the session is created, this value is initialized to `1`. | **discounts** | **Dict[str, float]** | A map of labelled discount values, values will be in the same currency as the application associated with the session. | diff --git a/docs/DigitalPass.md b/docs/DigitalPass.md new file mode 100644 index 0000000..c7b4486 --- /dev/null +++ b/docs/DigitalPass.md @@ -0,0 +1,32 @@ +# DigitalPass + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pass_id** | **str** | The ID of the generated digital pass. | +**pass_template_id** | **str** | The ID of the digital pass template used to generate the pass. | +**status** | **str** | The status of the digital pass. | +**pass_url** | **str** | The URL you can use to let the customer add the digital pass to their wallet. | + +## Example + +```python +from talon_one.models.digital_pass import DigitalPass + +# TODO update the JSON string below +json = "{}" +# create an instance of DigitalPass from a JSON string +digital_pass_instance = DigitalPass.from_json(json) +# print the JSON string representation of the object +print(DigitalPass.to_json()) + +# convert the object into a dict +digital_pass_dict = digital_pass_instance.to_dict() +# create an instance of DigitalPass from a dict +digital_pass_from_dict = DigitalPass.from_dict(digital_pass_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/DiscardRisksRequest.md b/docs/DiscardRisksRequest.md new file mode 100644 index 0000000..15de497 --- /dev/null +++ b/docs/DiscardRisksRequest.md @@ -0,0 +1,31 @@ +# DiscardRisksRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**risk_ids** | **List[int]** | The IDs of the risks to discard. | +**reason** | **str** | The reason the risks are being discarded. | +**comment** | **str** | Free-text description of why the risks are being discarded. Required when `reason` is `other`, optional for `expected_behavior`. | [optional] + +## Example + +```python +from talon_one.models.discard_risks_request import DiscardRisksRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscardRisksRequest from a JSON string +discard_risks_request_instance = DiscardRisksRequest.from_json(json) +# print the JSON string representation of the object +print(DiscardRisksRequest.to_json()) + +# convert the object into a dict +discard_risks_request_dict = discard_risks_request_instance.to_dict() +# create an instance of DiscardRisksRequest from a dict +discard_risks_request_from_dict = DiscardRisksRequest.from_dict(discard_risks_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/Effect.md b/docs/Effect.md index 5aa5e48..948893a 100644 --- a/docs/Effect.md +++ b/docs/Effect.md @@ -21,7 +21,7 @@ Name | Type | Description | Notes **selected_price_type** | **str** | The selected price type for the SKU targeted by this effect. | [optional] **selected_price** | **float** | The value of the selected price type to apply to the SKU targeted by this effect, before any discounts are applied. | [optional] **adjustment_reference_id** | **UUID** | The reference identifier of the selected price adjustment for this SKU. This is only returned if the `selectedPrice` resulted from a price adjustment. | [optional] -**props** | **object** | | +**props** | [**EffectAllOfProps**](EffectAllOfProps.md) | | ## Example diff --git a/docs/EffectAllOfProps.md b/docs/EffectAllOfProps.md new file mode 100644 index 0000000..161959a --- /dev/null +++ b/docs/EffectAllOfProps.md @@ -0,0 +1,98 @@ +# EffectAllOfProps + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **float** | The current progress of the customer in the achievement. | +**id** | **int** | The id of the referral code that was redeemed. | +**rejection_reason** | **str** | The reason why the code was rejected. - `AdvocateNotFound`: The advocate was not found. - `CampaignLimitReached`: The campaign-wide referral code redemption limit has been reached. - `EffectCouldNotBeApplied`: One of the effects in the campaign wasn't applied because a limit for that effect was reached (most common use case will be `setDiscount` can not be applied because a discount limit is reached). - `ProfileLimitReached`: The profile-specific referral code redemption limit has been reached. - `ReferralCustomerAlreadyReferred`: The friend is already referred. - `ReferralExpired`: The transferred referral code is expired. - `ReferralLimitReached`: The referral code redemption limit has been reached. - `ReferralNotFound`: The transferred referral code is wrong. - `ReferralPartOfNotRunningCampaign`: The campaign the referral code belongs to is currently not active. The campaign ID field shows the ID of that campaign. - `ReferralRecipientDoesNotMatch`: The given referral code value does not match the recipient. - `ReferralRecipientIdSameAsAdvocate`: The recipient (friend) has the same id as the advocate. - `ReferralRejectedByCondition`: The referral code is valid and in an active campaign, but there were other conditions in that campaign's rules that were not met. - `ReferralStartDateInFuture`: The transferred referral code isn't active yet. - `ReferralPartOfNotTriggeredCampaign`: The campaign the referral code belongs to was not triggered during evaluation (an exclusive or stackable campaign). The campaign ID field shows the ID of that campaign. | +**condition_index** | **int** | The index of the condition that caused the rejection of the referral. | [optional] +**effect_index** | **int** | The index of the effect that caused the rejection of the referral. | [optional] +**details** | **str** | More details about the failure. | [optional] +**campaign_exclusion_reason** | **str** | The reason why the campaign the referral belongs to was excluded during [campaign evaluation](https://docs.talon.one/docs/product/applications/manage-campaign-evaluation), when `rejectionReason` was `CouponPartOfNotTriggeredCampaign`. Its possible values are: - `CampaignGaveLowerDiscount`: The required campaign and referral conditions were met, but another campaign in a [Highest discount value](https://docs.talon.one/docs/product/applications/manage-campaign-evaluation#set-campaign-evaluation-mode) group offered a higher discount value. - `CampaignIsNotFirst`: The campaign was not evaluated because another campaign in a [First campaign](https://docs.talon.one/docs/product/applications/manage-campaign-evaluation#set-campaign-evaluation-mode) group was picked and evaluated first. - `CampaignNotInEvaluationSet`: The campaign did not meet other evaluation requirements, for example, because the referral is part of an archived campaign. | [optional] +**profile_id** | **int** | The internal ID of the customer profile. | +**name** | **str** | The description of this discount. `#number` is appended to the name. It is equal to the `position` property. | +**scope** | **str** | The scope of the rolled back discount. - For a discount per session, it can be one of `cartItems`, `additionalCosts` or `sessionTotal` - For a discount per item, it can be one of `price`, `additionalCosts` or `itemTotal` | [optional] +**desired_value** | **float** | _[(Partial discounts enabled only)](https://docs.talon.one/docs/product/applications/manage-general-settings#partial-discounts)_. The monetary value of the discount to be applied to the additional cost without considering budget limitations. | [optional] +**position** | **float** | The index of the item in the `cartItem` object containing the additional cost that this discount applies to. | +**sub_position** | **float** | The index of the item unit in its line item. | [optional] +**total_discount** | **float** | _(Pro rata discounts only)_ The monetary value of the total effective discount | [optional] +**desired_total_discount** | **float** | _(Pro rata discounts only)_ The monetary value of the total discount to be applied without considering budget limitations | [optional] +**bundle_index** | **int** | The position of the bundle in a list of item bundles created from the same bundle definition. | [optional] +**bundle_name** | **str** | The name of the bundle definition. | [optional] +**targeted_item_position** | **float** | _(Discounting individual item in bundles only)_ The index of the targeted bundle item on which the applied discount is based. | [optional] +**targeted_item_sub_position** | **float** | _(Discounting individual item in bundles only)_ The sub-position of the targeted bundle item on which the applied discount is based. | [optional] +**excluded_from_price_history** | **bool** | When set to `true`, the applied discount is excluded from the item's price history. | [optional] +**additional_cost_id** | **int** | The identifier of the additional cost to be discounted. | +**additional_cost** | **str** | The API name of the additional cost to be discounted. | +**webhook_id** | **float** | The internal ID of the webhook. | +**webhook_name** | **str** | The name of the webhook. | +**program_id** | **int** | ID of the loyalty program that contains these points. | +**sub_ledger_id** | **str** | API name of the loyalty program subledger that contains these points. | +**recipient_integration_id** | **str** | The integration ID of the customer that receives the giveaway. | +**start_date** | **datetime** | The date after which the reimbursed points will be valid. | [optional] +**expiry_date** | **datetime** | The date after which the reimbursed points will expire. | [optional] +**transaction_uuid** | **str** | The identifier of this loyalty point transaction. | +**cart_item_position** | **float** | The index of the item in the cart item list to which the custom effect is applied. | [optional] +**cart_item_sub_position** | **float** | For cart items with quantity > 1, the sub position indicates to which item unit the custom effect is applied. | [optional] +**card_identifier** | **str** | The identifier of the card from which these points were originally deducted. | [optional] +**awaits_activation** | **bool** | Indicates whether the points have an action-based start date. This property is returned only for point transactions with an action-based start date. | [optional] +**validity_duration** | **str** | The duration for which the points remain active, calculated relative to their start date. | [optional] +**rule_title** | **str** | The title of the rule that triggered the tier upgrade. | +**previous_tier_name** | **str** | The name of the tier from which the user was upgraded. | [optional] +**new_tier_name** | **str** | The name of the tier to which the user has been upgraded. | +**sku** | **str** | SKU of the item that needs to be added. | +**desired_quantity** | **int** | The original quantity in case a partial reward was applied. | [optional] +**notification_type** | **str** | The type of notification. | +**title** | **str** | The title of the notification. | +**body** | **str** | The body of the notification. | +**path** | **str** | The entity type and the attribute name. | +**description** | **str** | Description of the product bundle. | +**bundle_attributes** | **List[str]** | The cart item attributes that determined which items are being bundled together. | +**items_indices** | **List[float]** | The indices in the cart items array of the bundled items. | +**pool_id** | **int** | The internal ID of the giveaway pool. | +**pool_name** | **str** | The name of the giveaway pool. | +**giveaway_id** | **int** | The internal ID of the giveaway. | +**code** | **str** | The giveaway code to be rewarded. | +**message** | **str** | The error message. | +**effect_id** | **int** | The ID of the custom effect that was triggered. | +**payload** | **object** | The JSON payload of the custom effect. | +**coupon_value** | **str** | The coupon code that was created. | +**profile_integration_id** | **str** | The ID of the customer profile in the third-party integration platform. | +**is_new_reservation** | **bool** | Indicates whether this is a new coupon reservation or not. | +**audience_id** | **int** | The internal ID of the audience. | [optional] +**audience_name** | **str** | The name of the audience. | [optional] +**achievement_id** | **int** | The internal ID of the achievement. | +**achievement_name** | **str** | The name of the achievement. | +**progress_tracker_id** | **int** | The internal ID of the achievement progress tracker. | +**delta** | **float** | The value by which the customer's current progress in the achievement has increased. | +**target** | **float** | The target value to complete the achievement. | +**is_just_completed** | **bool** | Indicates if the customer has completed the achievement in the current session. | +**decrease_progress_by** | **float** | The value by which the customer's current progress in the achievement has decreased. | +**current_progress** | **float** | The current progress of the customer in the achievement. | +**extension_duration** | **str** | Time frame by which the expiry date extends. The time format is either: - immediate, or - an **integer** followed by a letter indicating the time unit. Examples: `immediate`, `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 round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. | +**affected_transactions** | [**List[LoyaltyLedgerEntryExpiryDateChange]**](LoyaltyLedgerEntryExpiryDateChange.md) | List of transactions affected by the expiry date update. | [optional] +**new_expiry_date** | **datetime** | The specified expiry date and time for all active and pending point transactions in the loyalty program subledger. | + +## Example + +```python +from talon_one.models.effect_all_of_props import EffectAllOfProps + +# TODO update the JSON string below +json = "{}" +# create an instance of EffectAllOfProps from a JSON string +effect_all_of_props_instance = EffectAllOfProps.from_json(json) +# print the JSON string representation of the object +print(EffectAllOfProps.to_json()) + +# convert the object into a dict +effect_all_of_props_dict = effect_all_of_props_instance.to_dict() +# create an instance of EffectAllOfProps from a dict +effect_all_of_props_from_dict = EffectAllOfProps.from_dict(effect_all_of_props_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/EffectProps.md b/docs/EffectProps.md new file mode 100644 index 0000000..1b5aad5 --- /dev/null +++ b/docs/EffectProps.md @@ -0,0 +1,99 @@ +# EffectProps + +The properties of the effect. See [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **float** | The current progress of the customer in the achievement. | +**id** | **int** | The id of the referral code that was redeemed. | +**rejection_reason** | **str** | The reason why the code was rejected. - `AdvocateNotFound`: The advocate was not found. - `CampaignLimitReached`: The campaign-wide referral code redemption limit has been reached. - `EffectCouldNotBeApplied`: One of the effects in the campaign wasn't applied because a limit for that effect was reached (most common use case will be `setDiscount` can not be applied because a discount limit is reached). - `ProfileLimitReached`: The profile-specific referral code redemption limit has been reached. - `ReferralCustomerAlreadyReferred`: The friend is already referred. - `ReferralExpired`: The transferred referral code is expired. - `ReferralLimitReached`: The referral code redemption limit has been reached. - `ReferralNotFound`: The transferred referral code is wrong. - `ReferralPartOfNotRunningCampaign`: The campaign the referral code belongs to is currently not active. The campaign ID field shows the ID of that campaign. - `ReferralRecipientDoesNotMatch`: The given referral code value does not match the recipient. - `ReferralRecipientIdSameAsAdvocate`: The recipient (friend) has the same id as the advocate. - `ReferralRejectedByCondition`: The referral code is valid and in an active campaign, but there were other conditions in that campaign's rules that were not met. - `ReferralStartDateInFuture`: The transferred referral code isn't active yet. - `ReferralPartOfNotTriggeredCampaign`: The campaign the referral code belongs to was not triggered during evaluation (an exclusive or stackable campaign). The campaign ID field shows the ID of that campaign. | +**condition_index** | **int** | The index of the condition that caused the rejection of the referral. | [optional] +**effect_index** | **int** | The index of the effect that caused the rejection of the referral. | [optional] +**details** | **str** | More details about the failure. | [optional] +**campaign_exclusion_reason** | **str** | The reason why the campaign the referral belongs to was excluded during [campaign evaluation](https://docs.talon.one/docs/product/applications/manage-campaign-evaluation), when `rejectionReason` was `CouponPartOfNotTriggeredCampaign`. Its possible values are: - `CampaignGaveLowerDiscount`: The required campaign and referral conditions were met, but another campaign in a [Highest discount value](https://docs.talon.one/docs/product/applications/manage-campaign-evaluation#set-campaign-evaluation-mode) group offered a higher discount value. - `CampaignIsNotFirst`: The campaign was not evaluated because another campaign in a [First campaign](https://docs.talon.one/docs/product/applications/manage-campaign-evaluation#set-campaign-evaluation-mode) group was picked and evaluated first. - `CampaignNotInEvaluationSet`: The campaign did not meet other evaluation requirements, for example, because the referral is part of an archived campaign. | [optional] +**profile_id** | **int** | The internal ID of the customer profile. | +**name** | **str** | The description of this discount. `#number` is appended to the name. It is equal to the `position` property. | +**scope** | **str** | The scope of the rolled back discount. - For a discount per session, it can be one of `cartItems`, `additionalCosts` or `sessionTotal` - For a discount per item, it can be one of `price`, `additionalCosts` or `itemTotal` | [optional] +**desired_value** | **float** | _[(Partial discounts enabled only)](https://docs.talon.one/docs/product/applications/manage-general-settings#partial-discounts)_. The monetary value of the discount to be applied to the additional cost without considering budget limitations. | [optional] +**position** | **float** | The index of the item in the `cartItem` object containing the additional cost that this discount applies to. | +**sub_position** | **float** | The index of the item unit in its line item. | [optional] +**total_discount** | **float** | _(Pro rata discounts only)_ The monetary value of the total effective discount | [optional] +**desired_total_discount** | **float** | _(Pro rata discounts only)_ The monetary value of the total discount to be applied without considering budget limitations | [optional] +**bundle_index** | **int** | The position of the bundle in a list of item bundles created from the same bundle definition. | [optional] +**bundle_name** | **str** | The name of the bundle definition. | [optional] +**targeted_item_position** | **float** | _(Discounting individual item in bundles only)_ The index of the targeted bundle item on which the applied discount is based. | [optional] +**targeted_item_sub_position** | **float** | _(Discounting individual item in bundles only)_ The sub-position of the targeted bundle item on which the applied discount is based. | [optional] +**excluded_from_price_history** | **bool** | When set to `true`, the applied discount is excluded from the item's price history. | [optional] +**additional_cost_id** | **int** | The identifier of the additional cost to be discounted. | +**additional_cost** | **str** | The API name of the additional cost to be discounted. | +**webhook_id** | **float** | The internal ID of the webhook. | +**webhook_name** | **str** | The name of the webhook. | +**program_id** | **int** | ID of the loyalty program that contains these points. | +**sub_ledger_id** | **str** | API name of the loyalty program subledger that contains these points. | +**recipient_integration_id** | **str** | The integration ID of the customer that receives the giveaway. | +**start_date** | **datetime** | The date after which the reimbursed points will be valid. | [optional] +**expiry_date** | **datetime** | The date after which the reimbursed points will expire. | [optional] +**transaction_uuid** | **str** | The identifier of this loyalty point transaction. | +**cart_item_position** | **float** | The index of the item in the cart item list to which the custom effect is applied. | [optional] +**cart_item_sub_position** | **float** | For cart items with quantity > 1, the sub position indicates to which item unit the custom effect is applied. | [optional] +**card_identifier** | **str** | The identifier of the card from which these points were originally deducted. | [optional] +**awaits_activation** | **bool** | Indicates whether the points have an action-based start date. This property is returned only for point transactions with an action-based start date. | [optional] +**validity_duration** | **str** | The duration for which the points remain active, calculated relative to their start date. | [optional] +**rule_title** | **str** | The title of the rule that triggered the tier upgrade. | +**previous_tier_name** | **str** | The name of the tier from which the user was upgraded. | [optional] +**new_tier_name** | **str** | The name of the tier to which the user has been upgraded. | +**sku** | **str** | SKU of the item that needs to be added. | +**desired_quantity** | **int** | The original quantity in case a partial reward was applied. | [optional] +**notification_type** | **str** | The type of notification. | +**title** | **str** | The title of the notification. | +**body** | **str** | The body of the notification. | +**path** | **str** | The entity type and the attribute name. | +**description** | **str** | Description of the product bundle. | +**bundle_attributes** | **List[str]** | The cart item attributes that determined which items are being bundled together. | +**items_indices** | **List[float]** | The indices in the cart items array of the bundled items. | +**pool_id** | **int** | The internal ID of the giveaway pool. | +**pool_name** | **str** | The name of the giveaway pool. | +**giveaway_id** | **int** | The internal ID of the giveaway. | +**code** | **str** | The giveaway code to be rewarded. | +**message** | **str** | The error message. | +**effect_id** | **int** | The ID of the custom effect that was triggered. | +**payload** | **object** | The JSON payload of the custom effect. | +**coupon_value** | **str** | The coupon code that was created. | +**profile_integration_id** | **str** | The ID of the customer profile in the third-party integration platform. | +**is_new_reservation** | **bool** | Indicates whether this is a new coupon reservation or not. | +**audience_id** | **int** | The internal ID of the audience. | [optional] +**audience_name** | **str** | The name of the audience. | [optional] +**achievement_id** | **int** | The internal ID of the achievement. | +**achievement_name** | **str** | The name of the achievement. | +**progress_tracker_id** | **int** | The internal ID of the achievement progress tracker. | +**delta** | **float** | The value by which the customer's current progress in the achievement has increased. | +**target** | **float** | The target value to complete the achievement. | +**is_just_completed** | **bool** | Indicates if the customer has completed the achievement in the current session. | +**decrease_progress_by** | **float** | The value by which the customer's current progress in the achievement has decreased. | +**current_progress** | **float** | The current progress of the customer in the achievement. | +**extension_duration** | **str** | Time frame by which the expiry date extends. The time format is either: - immediate, or - an **integer** followed by a letter indicating the time unit. Examples: `immediate`, `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 round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. | +**affected_transactions** | [**List[LoyaltyLedgerEntryExpiryDateChange]**](LoyaltyLedgerEntryExpiryDateChange.md) | List of transactions affected by the expiry date update. | [optional] +**new_expiry_date** | **datetime** | The specified expiry date and time for all active and pending point transactions in the loyalty program subledger. | + +## Example + +```python +from talon_one.models.effect_props import EffectProps + +# TODO update the JSON string below +json = "{}" +# create an instance of EffectProps from a JSON string +effect_props_instance = EffectProps.from_json(json) +# print the JSON string representation of the object +print(EffectProps.to_json()) + +# convert the object into a dict +effect_props_dict = effect_props_instance.to_dict() +# create an instance of EffectProps from a dict +effect_props_from_dict = EffectProps.from_dict(effect_props_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/Event.md b/docs/Event.md index 8fa8b0b..a93c1df 100644 --- a/docs/Event.md +++ b/docs/Event.md @@ -11,7 +11,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** | 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 properties associated with this campaign. | +**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). | diff --git a/docs/EventV3.md b/docs/EventV3.md index 75d5bac..8ba02d0 100644 --- a/docs/EventV3.md +++ b/docs/EventV3.md @@ -12,7 +12,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** | 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 properties associated with this campaign. | +**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). | diff --git a/docs/Export.md b/docs/Export.md index 64b222e..613cff7 100644 --- a/docs/Export.md +++ b/docs/Export.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **account_id** | **int** | The ID of the account that owns this entity. | **user_id** | **int** | The ID of the user associated with this entity. | **entity** | **str** | The name of the entity that was exported. | -**filter** | **object** | Arbitrary properties associated with this campaign. | +**filter** | **object** | Map of keys and values that were used to filter the exported rows. | ## Example diff --git a/docs/Giveaway.md b/docs/Giveaway.md index 355c5a6..acecf76 100644 --- a/docs/Giveaway.md +++ b/docs/Giveaway.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **pool_id** | **int** | The ID of the pool to return giveaway codes from. | **start_date** | **datetime** | Timestamp at which point the giveaway becomes valid. | [optional] **end_date** | **datetime** | Timestamp at which point the giveaway becomes invalid. | [optional] -**attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] +**attributes** | **object** | Arbitrary properties associated with this giveaway. | [optional] **used** | **bool** | Indicates whether this giveaway code was given before. | [optional] **import_id** | **int** | The ID of the Import which created this giveaway. | [optional] **profile_integration_id** | **str** | The third-party integration ID of the customer profile that was awarded the giveaway, if the giveaway was awarded. | [optional] diff --git a/docs/History.md b/docs/History.md index aaf55ef..4136812 100644 --- a/docs/History.md +++ b/docs/History.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **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** | | +**target** | [**LabelTarget**](LabelTarget.md) | | ## Example diff --git a/docs/IntegrationApi.md b/docs/IntegrationApi.md index d39bd6a..d67a147 100644 --- a/docs/IntegrationApi.md +++ b/docs/IntegrationApi.md @@ -1847,7 +1847,7 @@ with talon_one.ApiClient(configuration) as api_client: api_instance = talon_one.IntegrationApi(api_client) loyalty_program_id = 56 # int | 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. loyalty_card_id = 'loyalty_card_id_example' # str | Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. **Important**: The loyalty card ID requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `NewCard2026%` as `NewCard2026%25`. - status = active # str | Filter points based on their status. (optional) (default to active) + status = 'active' # str | Filter points based on their status. (optional) (default to 'active') subledger_id = ['subledger_id_example'] # List[str] | Filter results by one or more subledger IDs. Must be exact match. (optional) customer_session_ids = ['customer_session_ids_example'] # List[str] | Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. (optional) transaction_uuids = ['transaction_uuids_example'] # List[str] | Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. (optional) @@ -1873,7 +1873,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **loyalty_program_id** | **int**| 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. | **loyalty_card_id** | **str**| Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. **Important**: The loyalty card ID requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `NewCard2026%` as `NewCard2026%25`. | - **status** | **str**| Filter points based on their status. | [optional] [default to active] + **status** | **str**| Filter points based on their status. | [optional] [default to 'active'] **subledger_id** | [**List[str]**](str.md)| Filter results by one or more subledger IDs. Must be exact match. | [optional] **customer_session_ids** | [**List[str]**](str.md)| Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. | [optional] **transaction_uuids** | [**List[str]**](str.md)| Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. | [optional] @@ -2055,7 +2055,7 @@ with talon_one.ApiClient(configuration) as api_client: api_instance = talon_one.IntegrationApi(api_client) loyalty_program_id = 56 # int | Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. integration_id = 'integration_id_example' # str | The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. - status = active # str | Filter points based on their status. (optional) (default to active) + status = 'active' # str | Filter points based on their status. (optional) (default to 'active') subledger_id = ['subledger_id_example'] # List[str] | Filter the results by a list of subledger IDs. To include multiple IDs, repeat the parameter for each one, for example, `?subledgerId=id1&subledgerId=id2`. The response contains only data associated with the specified subledgers. (optional) customer_session_ids = ['customer_session_ids_example'] # List[str] | Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. (optional) transaction_uuids = ['transaction_uuids_example'] # List[str] | Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. (optional) @@ -2081,7 +2081,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **loyalty_program_id** | **int**| Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | **integration_id** | **str**| The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. | - **status** | **str**| Filter points based on their status. | [optional] [default to active] + **status** | **str**| Filter points based on their status. | [optional] [default to 'active'] **subledger_id** | [**List[str]**](str.md)| Filter the results by a list of subledger IDs. To include multiple IDs, repeat the parameter for each one, for example, `?subledgerId=id1&subledgerId=id2`. The response contains only data associated with the specified subledgers. | [optional] **customer_session_ids** | [**List[str]**](str.md)| Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. | [optional] **transaction_uuids** | [**List[str]**](str.md)| Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. | [optional] @@ -2652,6 +2652,11 @@ To see an example of a rollback, see the > [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) > endpoint to cancel a closed session and create a new one. +> [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: +> - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. +> - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. +> - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. + ### Example @@ -3189,6 +3194,11 @@ link to a product. See our [tutorial](https://docs.talon.one/docs/product/tutori > - 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. +> [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: +> - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. +> - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. +> - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. + ### Example @@ -3751,6 +3761,11 @@ You can use this endpoint to: > See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation when `runRuleEngine` is `true`. +> [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: +> - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. +> - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. +> - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. + ### Example @@ -3854,6 +3869,11 @@ sessions](https://docs.talon.one/integration-api#tag/Customer-sessions). > To trigger the Rule Engine for customer profile updates, > use the [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint. +> [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: +> - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. +> - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. +> - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. + ### Example @@ -3952,6 +3972,11 @@ with Talon.One. > - The currency for the session and the cart items in it is the currency set for the Application linked to this session. > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered for rule evaluation. +> [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: +> - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. +> - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. +> - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. + ### Session management To use this endpoint, start by learning about [customer diff --git a/docs/IntegrationEvent.md b/docs/IntegrationEvent.md index 8696a4d..414667a 100644 --- a/docs/IntegrationEvent.md +++ b/docs/IntegrationEvent.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] **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 properties associated with this campaign. | +**attributes** | **object** | Arbitrary additional JSON data associated with the event. | ## Example diff --git a/docs/IntegrationHubEventPayloadCouponBasedNotifications.md b/docs/IntegrationHubEventPayloadCouponBasedNotifications.md index 6ac4a55..67cc520 100644 --- a/docs/IntegrationHubEventPayloadCouponBasedNotifications.md +++ b/docs/IntegrationHubEventPayloadCouponBasedNotifications.md @@ -21,7 +21,7 @@ Name | Type | Description | Notes **recipient_integration_id** | **str** | | [optional] **import_id** | **int** | | [optional] **batch_id** | **str** | | [optional] -**attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] +**attributes** | **object** | | [optional] **limits** | [**List[IntegrationHubEventPayloadCouponBasedNotificationsLimits]**](IntegrationHubEventPayloadCouponBasedNotificationsLimits.md) | | [optional] **published_at** | **datetime** | Timestamp when the event was published. | **source_of_event** | **str** | | diff --git a/docs/IntegrationHubPaginatedEventPayload.md b/docs/IntegrationHubPaginatedEventPayload.md index 18f67cc..9c32273 100644 --- a/docs/IntegrationHubPaginatedEventPayload.md +++ b/docs/IntegrationHubPaginatedEventPayload.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **total_result_size** | **int** | | **batched_at** | **datetime** | Timestamp when the batch was created. | [optional] **event_type** | [**IntegrationHubEventType**](IntegrationHubEventType.md) | | -**data** | **List[object]** | | +**data** | [**List[IntegrationHubPaginatedEventPayloadDataInner]**](IntegrationHubPaginatedEventPayloadDataInner.md) | | ## Example diff --git a/docs/IntegrationHubPaginatedEventPayloadDataInner.md b/docs/IntegrationHubPaginatedEventPayloadDataInner.md new file mode 100644 index 0000000..5536102 --- /dev/null +++ b/docs/IntegrationHubPaginatedEventPayloadDataInner.md @@ -0,0 +1,63 @@ +# IntegrationHubPaginatedEventPayloadDataInner + + +## Properties + +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. | +**session_integration_id** | **str** | The integration ID of the session through which the points were earned or lost. Only set when the change results from a rule engine execution; empty otherwise. | [optional] +**employee_name** | **str** | | +**user_id** | **int** | | [optional] +**current_points** | **float** | | +**actions** | [**List[IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction]**](IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md) | | [optional] +**published_at** | **datetime** | Timestamp when the event was published. | +**old_tier** | **str** | | [optional] +**tier_expiration_date** | **datetime** | | [optional] +**timestamp_of_tier_change** | **datetime** | | [optional] +**points_required_to_the_next_tier** | **float** | | [optional] +**next_tier** | **str** | | [optional] +**id** | **int** | | +**created** | **datetime** | | +**campaign_id** | **int** | | +**value** | **str** | | +**usage_limit** | **int** | | +**discount_limit** | **float** | | [optional] +**reservation_limit** | **int** | | [optional] +**start_date** | **datetime** | | [optional] +**expiry_date** | **datetime** | | [optional] +**usage_counter** | **int** | | +**discount_counter** | **float** | | [optional] +**discount_remainder** | **float** | | [optional] +**referral_id** | **int** | | [optional] +**recipient_integration_id** | **str** | | [optional] +**import_id** | **int** | | [optional] +**batch_id** | **str** | | [optional] +**attributes** | **object** | | [optional] +**limits** | [**List[IntegrationHubEventPayloadCouponBasedNotificationsLimits]**](IntegrationHubEventPayloadCouponBasedNotificationsLimits.md) | | [optional] + +## Example + +```python +from talon_one.models.integration_hub_paginated_event_payload_data_inner import IntegrationHubPaginatedEventPayloadDataInner + +# TODO update the JSON string below +json = "{}" +# create an instance of IntegrationHubPaginatedEventPayloadDataInner from a JSON string +integration_hub_paginated_event_payload_data_inner_instance = IntegrationHubPaginatedEventPayloadDataInner.from_json(json) +# print the JSON string representation of the object +print(IntegrationHubPaginatedEventPayloadDataInner.to_json()) + +# convert the object into a dict +integration_hub_paginated_event_payload_data_inner_dict = integration_hub_paginated_event_payload_data_inner_instance.to_dict() +# create an instance of IntegrationHubPaginatedEventPayloadDataInner from a dict +integration_hub_paginated_event_payload_data_inner_from_dict = IntegrationHubPaginatedEventPayloadDataInner.from_dict(integration_hub_paginated_event_payload_data_inner_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/InventoryReferral.md b/docs/InventoryReferral.md index f97324b..3ee0143 100644 --- a/docs/InventoryReferral.md +++ b/docs/InventoryReferral.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **campaign_id** | **int** | ID of the campaign from which the referral received the referral code. | **advocate_profile_integration_id** | **str** | The Integration ID of the Advocate's Profile. | **friend_profile_integration_id** | **str** | An optional Integration ID of the Friend's Profile. | [optional] -**attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] +**attributes** | **object** | Arbitrary properties associated with this item. | [optional] **import_id** | **int** | The ID of the Import which created this referral. | [optional] **code** | **str** | The referral code. | **usage_counter** | **int** | The number of times this referral code has been successfully used. | diff --git a/docs/LabelTarget.md b/docs/LabelTarget.md new file mode 100644 index 0000000..5a37940 --- /dev/null +++ b/docs/LabelTarget.md @@ -0,0 +1,30 @@ +# LabelTarget + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | +**audience** | [**AudienceReference**](AudienceReference.md) | | + +## Example + +```python +from talon_one.models.label_target import LabelTarget + +# TODO update the JSON string below +json = "{}" +# create an instance of LabelTarget from a JSON string +label_target_instance = LabelTarget.from_json(json) +# print the JSON string representation of the object +print(LabelTarget.to_json()) + +# convert the object into a dict +label_target_dict = label_target_instance.to_dict() +# create an instance of LabelTarget from a dict +label_target_from_dict = LabelTarget.from_dict(label_target_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/ListCheckAttributeBlock.md b/docs/ListCheckAttributeBlock.md deleted file mode 100644 index 5447956..0000000 --- a/docs/ListCheckAttributeBlock.md +++ /dev/null @@ -1,31 +0,0 @@ -# ListCheckAttributeBlock - -Variant of `CheckAttributeBlock` for operators that test list membership against a set of values. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**operator** | **str** | The list membership operator applied to the attribute. | [optional] -**values** | **object** | | - -## Example - -```python -from talon_one.models.list_check_attribute_block import ListCheckAttributeBlock - -# TODO update the JSON string below -json = "{}" -# create an instance of ListCheckAttributeBlock from a JSON string -list_check_attribute_block_instance = ListCheckAttributeBlock.from_json(json) -# print the JSON string representation of the object -print(ListCheckAttributeBlock.to_json()) - -# convert the object into a dict -list_check_attribute_block_dict = list_check_attribute_block_instance.to_dict() -# create an instance of ListCheckAttributeBlock from a dict -list_check_attribute_block_from_dict = ListCheckAttributeBlock.from_dict(list_check_attribute_block_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListWithCountCheckAttributeBlock.md b/docs/ListWithCountCheckAttributeBlock.md deleted file mode 100644 index f82fee8..0000000 --- a/docs/ListWithCountCheckAttributeBlock.md +++ /dev/null @@ -1,32 +0,0 @@ -# ListWithCountCheckAttributeBlock - -Variant of `CheckAttributeBlock` for operators that test list membership with a minimum or exact count threshold. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**operator** | **str** | The list membership operator with a count threshold applied to the attribute. | [optional] -**values** | **object** | | -**count** | **object** | | - -## Example - -```python -from talon_one.models.list_with_count_check_attribute_block import ListWithCountCheckAttributeBlock - -# TODO update the JSON string below -json = "{}" -# create an instance of ListWithCountCheckAttributeBlock from a JSON string -list_with_count_check_attribute_block_instance = ListWithCountCheckAttributeBlock.from_json(json) -# print the JSON string representation of the object -print(ListWithCountCheckAttributeBlock.to_json()) - -# convert the object into a dict -list_with_count_check_attribute_block_dict = list_with_count_check_attribute_block_instance.to_dict() -# create an instance of ListWithCountCheckAttributeBlock from a dict -list_with_count_check_attribute_block_from_dict = ListWithCountCheckAttributeBlock.from_dict(list_with_count_check_attribute_block_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/MCPOAuthProtectedResource.md b/docs/MCPOAuthProtectedResource.md new file mode 100644 index 0000000..6116b7d --- /dev/null +++ b/docs/MCPOAuthProtectedResource.md @@ -0,0 +1,30 @@ +# MCPOAuthProtectedResource + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource** | **str** | The URL of the protected resource (the MCP entrypoint). | +**authorization_servers** | **List[str]** | List of authorization server base URLs that can issue tokens for this resource. | + +## Example + +```python +from talon_one.models.mcpo_auth_protected_resource import MCPOAuthProtectedResource + +# TODO update the JSON string below +json = "{}" +# create an instance of MCPOAuthProtectedResource from a JSON string +mcpo_auth_protected_resource_instance = MCPOAuthProtectedResource.from_json(json) +# print the JSON string representation of the object +print(MCPOAuthProtectedResource.to_json()) + +# convert the object into a dict +mcpo_auth_protected_resource_dict = mcpo_auth_protected_resource_instance.to_dict() +# create an instance of MCPOAuthProtectedResource from a dict +mcpo_auth_protected_resource_from_dict = MCPOAuthProtectedResource.from_dict(mcpo_auth_protected_resource_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/MCPOAuthServerMetadata.md b/docs/MCPOAuthServerMetadata.md new file mode 100644 index 0000000..48e7986 --- /dev/null +++ b/docs/MCPOAuthServerMetadata.md @@ -0,0 +1,35 @@ +# MCPOAuthServerMetadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**issuer** | **str** | The authorization server's issuer identifier (its base URL). | +**authorization_endpoint** | **str** | URL of the authorization endpoint. | +**token_endpoint** | **str** | URL of the token endpoint. | +**registration_endpoint** | **str** | URL of the client registration endpoint. | +**response_types_supported** | **List[str]** | List of supported OAuth2 response types. | +**grant_types_supported** | **List[str]** | List of supported OAuth2 grant types. | +**code_challenge_methods_supported** | **List[str]** | List of supported PKCE code challenge methods. | + +## Example + +```python +from talon_one.models.mcpo_auth_server_metadata import MCPOAuthServerMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of MCPOAuthServerMetadata from a JSON string +mcpo_auth_server_metadata_instance = MCPOAuthServerMetadata.from_json(json) +# print the JSON string representation of the object +print(MCPOAuthServerMetadata.to_json()) + +# convert the object into a dict +mcpo_auth_server_metadata_dict = mcpo_auth_server_metadata_instance.to_dict() +# create an instance of MCPOAuthServerMetadata from a dict +mcpo_auth_server_metadata_from_dict = MCPOAuthServerMetadata.from_dict(mcpo_auth_server_metadata_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/NewBaseNotification.md b/docs/NewBaseNotification.md index b82706a..a846bf2 100644 --- a/docs/NewBaseNotification.md +++ b/docs/NewBaseNotification.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**policy** | **object** | Indicates which notification properties to apply. | +**policy** | [**BaseNotificationPolicy**](BaseNotificationPolicy.md) | | **enabled** | **bool** | Indicates whether the notification is activated. | [optional] [default to True] **webhook** | [**NewNotificationWebhook**](NewNotificationWebhook.md) | | diff --git a/docs/NewCouponCreationJob.md b/docs/NewCouponCreationJob.md index 8fc429c..d39e102 100644 --- a/docs/NewCouponCreationJob.md +++ b/docs/NewCouponCreationJob.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **expiry_date** | **datetime** | Expiration date of the coupon. Coupon never expires if this is omitted. | [optional] **number_of_coupons** | **int** | The number of new coupon codes to generate for the campaign. | **coupon_settings** | [**CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] -**attributes** | **object** | Arbitrary properties associated with this campaign. | +**attributes** | **object** | Arbitrary properties associated with coupons. | **is_reservation_mandatory** | **bool** | An indication of whether the code can be redeemed only if it has been reserved first. | [optional] [default to False] ## Example diff --git a/docs/NewCoupons.md b/docs/NewCoupons.md index d6efd55..e2654f6 100644 --- a/docs/NewCoupons.md +++ b/docs/NewCoupons.md @@ -13,12 +13,14 @@ Name | Type | Description | Notes **limits** | [**List[LimitConfig]**](LimitConfig.md) | Limits configuration for a coupon. These limits will override the limits set from the campaign. **Note:** Only usable when creating a single coupon which is not tied to a specific recipient. Only per-profile limits are allowed to be configured. | [optional] **number_of_coupons** | **int** | The number of new coupon codes to generate for the campaign. Must be at least 1. | **unique_prefix** | **str** | **DEPRECATED** To create more than 20,000 coupons in one request, use [Create coupons asynchronously](https://docs.talon.one/management-api#tag/Coupons/operation/createCouponsAsync) endpoint. | [optional] -**attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] +**attributes** | **object** | Arbitrary properties associated with this item. | [optional] **recipient_integration_id** | **str** | The integration ID for this coupon's beneficiary's profile. | [optional] **valid_characters** | **List[str]** | List of characters used to generate the random parts of a code. By default, the list of characters is equivalent to the `[A-Z, 0-9]` regular expression. | [optional] **coupon_pattern** | **str** | The pattern used to generate coupon codes. The character `#` is a placeholder and is replaced by a random character from the `validCharacters` set. | [optional] **is_reservation_mandatory** | **bool** | An indication of whether the code can be redeemed only if it has been reserved first. | [optional] [default to False] **implicitly_reserved** | **bool** | An indication of whether the coupon is implicitly reserved for all customers. | [optional] +**support_request_id** | **int** | The identifier of the support request to link to the coupon creation. The request must exist and not yet be processed. | [optional] +**support_request_note** | **str** | A note recorded when the linked support request is approved or rejected. Applied when `supportRequestId` is provided. | [optional] ## Example diff --git a/docs/NewCouponsForMultipleRecipients.md b/docs/NewCouponsForMultipleRecipients.md index ec7eb94..120de0b 100644 --- a/docs/NewCouponsForMultipleRecipients.md +++ b/docs/NewCouponsForMultipleRecipients.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **reservation_limit** | **int** | The number of reservations that can be made with this coupon code. | [optional] **start_date** | **datetime** | Timestamp at which point the coupon becomes valid. | [optional] **expiry_date** | **datetime** | Expiration date of the coupon. Coupon never expires if this is omitted. | [optional] -**attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] +**attributes** | **object** | Arbitrary properties associated with this item. | [optional] **recipients_integration_ids** | **List[str]** | The integration IDs for recipients. | **valid_characters** | **List[str]** | List of characters used to generate the random parts of a code. By default, the list of characters is equivalent to the `[A-Z, 0-9]` regular expression. | [optional] **coupon_pattern** | **str** | The pattern used to generate coupon codes. The character `#` is a placeholder and is replaced by a random character from the `validCharacters` set. | [optional] diff --git a/docs/NewCustomerSession.md b/docs/NewCustomerSession.md index 8d5a5fc..3973a32 100644 --- a/docs/NewCustomerSession.md +++ b/docs/NewCustomerSession.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **cart_items** | [**List[CartItem]**](CartItem.md) | Serialized JSON representation. | [optional] **identifiers** | **List[str]** | Session custom identifiers that you can set limits on or use inside your rules. For example, you can use IP addresses as identifiers to potentially identify devices and limit discounts abuse in case of customers creating multiple accounts. See the [tutorial](https://docs.talon.one/docs/dev/tutorials/using-identifiers). | [optional] **total** | **float** | The total sum of the cart in one session. | [optional] -**attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] +**attributes** | **object** | A key-value map of the sessions attributes. The potentially valid attributes are configured in your accounts developer settings. | [optional] ## Example diff --git a/docs/NewDigitalPass.md b/docs/NewDigitalPass.md new file mode 100644 index 0000000..759aad1 --- /dev/null +++ b/docs/NewDigitalPass.md @@ -0,0 +1,34 @@ +# NewDigitalPass + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**loyalty_program_id** | **int** | The ID of the associated loyalty program. | +**pass_template_id** | **str** | The ID of the digital pass template used to generate the pass. | +**profile_id** | **str** | The integration ID of the customer profile the pass is issued for. | +**loyalty_card_id** | **str** | The identifier of the loyalty card the pass is issued for. **Note**: Only applicable for card-based loyalty programs. | [optional] +**platform** | **str** | The wallet platform the pass is generated for. | +**attributes** | **Dict[str, str]** | A map of placeholder values that you provide to fill in the pass template. These values are not validated against the template. | [optional] + +## Example + +```python +from talon_one.models.new_digital_pass import NewDigitalPass + +# TODO update the JSON string below +json = "{}" +# create an instance of NewDigitalPass from a JSON string +new_digital_pass_instance = NewDigitalPass.from_json(json) +# print the JSON string representation of the object +print(NewDigitalPass.to_json()) + +# convert the object into a dict +new_digital_pass_dict = new_digital_pass_instance.to_dict() +# create an instance of NewDigitalPass from a dict +new_digital_pass_from_dict = NewDigitalPass.from_dict(new_digital_pass_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/NewEvent.md b/docs/NewEvent.md index aaaf4c3..09189f9 100644 --- a/docs/NewEvent.md +++ b/docs/NewEvent.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] **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 properties associated with this campaign. | +**attributes** | **object** | Arbitrary additional JSON data associated with the event. | **session_id** | **str** | The ID of the session that this event occurred in. | ## Example diff --git a/docs/NewReferral.md b/docs/NewReferral.md index 8b552b4..36e015e 100644 --- a/docs/NewReferral.md +++ b/docs/NewReferral.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **campaign_id** | **int** | ID of the campaign from which the referral received the referral code. | **advocate_profile_integration_id** | **str** | The Integration ID of the Advocate's Profile. | **friend_profile_integration_id** | **str** | An optional Integration ID of the Friend's Profile. | [optional] -**attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] +**attributes** | **object** | Arbitrary properties associated with this item. | [optional] ## Example diff --git a/docs/NewReferralsForMultipleAdvocates.md b/docs/NewReferralsForMultipleAdvocates.md index 506ac0b..509632e 100644 --- a/docs/NewReferralsForMultipleAdvocates.md +++ b/docs/NewReferralsForMultipleAdvocates.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **usage_limit** | **int** | The number of times a referral code can be used. `0` means no limit but any campaign usage limits will still apply. | [optional] **campaign_id** | **int** | The ID of the campaign from which the referral received the referral code. | **advocate_profile_integration_ids** | **List[str]** | An array containing all the respective advocate profiles. | -**attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] +**attributes** | **object** | Arbitrary properties associated with this referral code. | [optional] **valid_characters** | **List[str]** | List of characters used to generate the random parts of a code. By default, the list of characters is equivalent to the `[A-Z, 0-9]` regular expression. | [optional] **referral_pattern** | **str** | The pattern used to generate referrals. The character `#` is a placeholder and is replaced by a random character from the `validCharacters` set. | [optional] diff --git a/docs/OutgoingIntegrationConfiguration.md b/docs/OutgoingIntegrationConfiguration.md index dcc62ad..2e6f18a 100644 --- a/docs/OutgoingIntegrationConfiguration.md +++ b/docs/OutgoingIntegrationConfiguration.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **id** | **int** | Unique ID for this entity. | **account_id** | **int** | The ID of the account to which this configuration belongs. | **type_id** | **int** | The outgoing integration type ID. | -**policy** | **object** | The outgoing integration policy specific to each integration type. | +**policy** | [**OutgoingIntegrationConfigurationPolicy**](OutgoingIntegrationConfigurationPolicy.md) | | ## Example diff --git a/docs/OutgoingIntegrationConfigurationPolicy.md b/docs/OutgoingIntegrationConfigurationPolicy.md new file mode 100644 index 0000000..edba5ae --- /dev/null +++ b/docs/OutgoingIntegrationConfigurationPolicy.md @@ -0,0 +1,36 @@ +# OutgoingIntegrationConfigurationPolicy + +The outgoing integration policy specific to each integration type. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**base_url** | **str** | The base URL that is based on the region key of your Iterable account. | +**api_key** | **str** | The API key generated from your Iterable account. See [Iterable API Key Guide](https://support.iterable.com/hc/en-us/articles/360043464871-API-Keys-) | +**account_id** | **str** | The CleverTap Project ID. | +**passcode** | **str** | The CleverTap Project passcode. | +**app_id** | **str** | MoEngage APP ID. See [MoEngage Developer Guide](https://developers.moengage.com/hc/en-us/articles/4404674776724-Overview). | +**data_api_id** | **str** | MoEngage DATA API ID. See [MoEngage Developer Guide](https://developers.moengage.com/hc/en-us/articles/4404674776724-Overview). | +**data_api_key** | **str** | MoEngage DATA API Key. See [MoEngage Developer Guide](https://developers.moengage.com/hc/en-us/articles/4404674776724-Overview). | + +## Example + +```python +from talon_one.models.outgoing_integration_configuration_policy import OutgoingIntegrationConfigurationPolicy + +# TODO update the JSON string below +json = "{}" +# create an instance of OutgoingIntegrationConfigurationPolicy from a JSON string +outgoing_integration_configuration_policy_instance = OutgoingIntegrationConfigurationPolicy.from_json(json) +# print the JSON string representation of the object +print(OutgoingIntegrationConfigurationPolicy.to_json()) + +# convert the object into a dict +outgoing_integration_configuration_policy_dict = outgoing_integration_configuration_policy_instance.to_dict() +# create an instance of OutgoingIntegrationConfigurationPolicy from a dict +outgoing_integration_configuration_policy_from_dict = OutgoingIntegrationConfigurationPolicy.from_dict(outgoing_integration_configuration_policy_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/OutgoingIntegrationTemplateWithConfigurationDetails.md b/docs/OutgoingIntegrationTemplateWithConfigurationDetails.md index bf623f5..bcdd415 100644 --- a/docs/OutgoingIntegrationTemplateWithConfigurationDetails.md +++ b/docs/OutgoingIntegrationTemplateWithConfigurationDetails.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **method** | **str** | API method for this webhook. | **relative_url** | **str** | The relative URL corresponding to each integration template. | **headers** | **List[str]** | The list of HTTP headers for this integration template. | -**policy** | **object** | The outgoing integration policy specific to each integration type. | +**policy** | [**OutgoingIntegrationConfigurationPolicy**](OutgoingIntegrationConfigurationPolicy.md) | | ## Example diff --git a/docs/PassthroughBlock.md b/docs/PassthroughBlock.md index f2685a5..5831d41 100644 --- a/docs/PassthroughBlock.md +++ b/docs/PassthroughBlock.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Unique identifier for this block. | **type** | **str** | The type discriminator for this block. | -**expression** | **List[object]** | The raw Talang expression as an array. The first element is the function name; subsequent elements are its arguments, which may themselves be nested expressions. | +**expression** | **List[object]** | The raw Talang expression as an array. For a function call, the first element is the function name and subsequent elements are its arguments. For any other expression (for example a bare attribute path or a literal value), this is a single-element array containing that value. | ## Example diff --git a/docs/PromotionBlock.md b/docs/PromotionBlock.md new file mode 100644 index 0000000..06a5269 --- /dev/null +++ b/docs/PromotionBlock.md @@ -0,0 +1,56 @@ +# PromotionBlock + +Describes a part of the logic of the rule. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier for this block. | +**type** | **str** | Identifies the block variant and determines which additional properties are present in it. | +**tags** | **List[str]** | Semantic labels attached to this block. | [optional] +**operator** | **str** | The update operation applied to the attribute. | +**blocks** | [**List[PromotionBlock]**](PromotionBlock.md) | Child blocks evaluated according to the operator. | +**on_failure** | [**List[PromotionBlock]**](PromotionBlock.md) | Promotion blocks evaluated when this block fails or returns false. | [optional] +**on_error** | **Dict[str, List[PromotionBlock]]** | Named error handlers evaluated when a specific error occurs. | [optional] +**expression** | **List[object]** | The raw Talang expression as an array. For a function call, the first element is the function name and subsequent elements are its arguments. For any other expression (for example a bare attribute path or a literal value), this is a single-element array containing that value. | +**notification_type** | **str** | The type of notification to display. | +**title** | **str** | The notification heading shown to the customer. | +**body** | **str** | The notification body text. Supports template placeholders (e.g. \"{{$Session.Total}}\") evaluated at rule execution time. | [optional] +**sku** | **str** | The stock keeping unit of the item to award. | +**name** | **str** | The display name of the item to award. | +**quantity** | **str** | The number of items to award. Supports template placeholders (e.g. \"{{$Session.Total / 2}}\") for dynamic quantities. | +**partial** | **bool** | When set to `true`, applies a partial item reward if the remaining budget is insufficient to award the full reward. | [optional] +**giveaway_pool** | [**AwardGiveawayBlock1GiveawayPool**](AwardGiveawayBlock1GiveawayPool.md) | | +**profile** | **str** | The customer profile to add or remove from the audience. `Current` targets the customer in the current session; `Advocate` targets the person who invited their friend via referral program. | +**attribute** | [**UpdateAttributeValueBlock1Attribute**](UpdateAttributeValueBlock1Attribute.md) | | +**value** | **object** | | +**min** | **object** | | [optional] +**max** | **object** | | [optional] +**values** | **object** | | [optional] +**count** | **object** | | [optional] +**audience** | [**UpdateAudienceMembershipBlock1Audience**](UpdateAudienceMembershipBlock1Audience.md) | | +**redeem** | **bool** | When `true`, the referral code is redeemed. | +**achievement** | [**UpdateAchievementProgressBlock1Achievement**](UpdateAchievementProgressBlock1Achievement.md) | | +**target** | [**UpdateAttributeValueBlock1Target**](UpdateAttributeValueBlock1Target.md) | | + +## Example + +```python +from talon_one.models.promotion_block import PromotionBlock + +# TODO update the JSON string below +json = "{}" +# create an instance of PromotionBlock from a JSON string +promotion_block_instance = PromotionBlock.from_json(json) +# print the JSON string representation of the object +print(PromotionBlock.to_json()) + +# convert the object into a dict +promotion_block_dict = promotion_block_instance.to_dict() +# create an instance of PromotionBlock from a dict +promotion_block_from_dict = PromotionBlock.from_dict(promotion_block_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PromotionCheckAttributeBlock.md b/docs/PromotionCheckAttributeBlock.md index f831a17..d723211 100644 --- a/docs/PromotionCheckAttributeBlock.md +++ b/docs/PromotionCheckAttributeBlock.md @@ -5,7 +5,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**on_failure** | **List[object]** | Promotion blocks evaluated when this block fails or returns false. | [optional] +**id** | **str** | Unique identifier for this block. | +**type** | **str** | Identifies the block variant and determines which additional properties are present in it. | +**tags** | **List[str]** | Semantic labels attached to this block. | [optional] +**operator** | **str** | The comparison operator applied to the attribute. | +**attribute** | **str** | The attribute path identifier (e.g. \"$Session.Total\"). | +**value** | **object** | | [optional] +**min** | **object** | | [optional] +**max** | **object** | | [optional] +**values** | **object** | | [optional] +**count** | **object** | | [optional] +**on_failure** | [**List[PromotionBlock]**](PromotionBlock.md) | Promotion blocks evaluated when this block fails or returns false. | [optional] ## Example diff --git a/docs/PromotionGroupBlock.md b/docs/PromotionGroupBlock.md index 6845497..0dc0843 100644 --- a/docs/PromotionGroupBlock.md +++ b/docs/PromotionGroupBlock.md @@ -9,9 +9,9 @@ Name | Type | Description | Notes **type** | **str** | Identifies the block variant and determines which additional properties are present in it. | **tags** | **List[str]** | Semantic labels attached to this block. | [optional] **operator** | **str** | Logical operator applied across child blocks. `all` requires every child to pass, `atLeastOne` requires at least one, `none` requires all to fail. | -**blocks** | **List[object]** | Child blocks evaluated according to the operator. | -**on_failure** | **List[object]** | Promotion blocks evaluated when this block fails or returns false. | [optional] -**on_error** | **Dict[str, List[object]]** | Named error handlers evaluated when a specific error occurs. | [optional] +**blocks** | [**List[PromotionBlock]**](PromotionBlock.md) | Child blocks evaluated according to the operator. | +**on_failure** | [**List[PromotionBlock]**](PromotionBlock.md) | Promotion blocks evaluated when this block fails or returns false. | [optional] +**on_error** | **Dict[str, List[PromotionBlock]]** | Named error handlers evaluated when a specific error occurs. | [optional] ## Example diff --git a/docs/PromotionRuleV2.md b/docs/PromotionRuleV2.md index a83abeb..e4939f3 100644 --- a/docs/PromotionRuleV2.md +++ b/docs/PromotionRuleV2.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **parent_id** | **str** | ID of the parent rule, if any. | [optional] **title** | **str** | A short description of the rule. | **description** | **str** | A longer description of the rule. | [optional] -**blocks** | **List[object]** | The condition and effect blocks that make up this promotion rule. | +**blocks** | [**List[PromotionBlock]**](PromotionBlock.md) | The condition and effect blocks that make up this promotion rule. | ## Example diff --git a/docs/Referral.md b/docs/Referral.md index 8d2d7ce..f4a461a 100644 --- a/docs/Referral.md +++ b/docs/Referral.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **campaign_id** | **int** | ID of the campaign from which the referral received the referral code. | **advocate_profile_integration_id** | **str** | The Integration ID of the Advocate's Profile. | **friend_profile_integration_id** | **str** | An optional Integration ID of the Friend's Profile. | [optional] -**attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] +**attributes** | **object** | Arbitrary properties associated with this item. | [optional] **import_id** | **int** | The ID of the Import which created this referral. | [optional] **code** | **str** | The referral code. | **usage_counter** | **int** | The number of times this referral code has been successfully used. | diff --git a/docs/ReviewRisksRequest.md b/docs/ReviewRisksRequest.md new file mode 100644 index 0000000..c6985a8 --- /dev/null +++ b/docs/ReviewRisksRequest.md @@ -0,0 +1,29 @@ +# ReviewRisksRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**risk_ids** | **List[int]** | The IDs of the risks to move to `In review` status. | + +## Example + +```python +from talon_one.models.review_risks_request import ReviewRisksRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of ReviewRisksRequest from a JSON string +review_risks_request_instance = ReviewRisksRequest.from_json(json) +# print the JSON string representation of the object +print(ReviewRisksRequest.to_json()) + +# convert the object into a dict +review_risks_request_dict = review_risks_request_instance.to_dict() +# create an instance of ReviewRisksRequest from a dict +review_risks_request_from_dict = ReviewRisksRequest.from_dict(review_risks_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/Risk.md b/docs/Risk.md index fc9561b..3dfb677 100644 --- a/docs/Risk.md +++ b/docs/Risk.md @@ -20,6 +20,10 @@ Name | Type | Description | Notes **reported_date** | **datetime** | The time the ML service reported this risk. | **affected_entity_count** | **int** | The total number of entities affected by this risk. | **description** | **str** | Human-readable description of the detected anomaly. | [optional] +**discard_reason** | **str** | The reason this risk was discarded. Only present on discarded risks. | [optional] +**status_comment** | **str** | The free-text details of the latest reclassification action: the description for resolving confirmed risks, or the details for discarding risks. | [optional] +**status_changed_by** | **int** | The ID of the user who performed the latest reclassification action. | [optional] +**status_changed_at** | **datetime** | The time of the latest reclassification action. | [optional] **modified** | **datetime** | Timestamp of the most recent update. | ## Example diff --git a/docs/RiskCriticalityUpdate.md b/docs/RiskCriticalityUpdate.md new file mode 100644 index 0000000..0d69a1a --- /dev/null +++ b/docs/RiskCriticalityUpdate.md @@ -0,0 +1,30 @@ +# RiskCriticalityUpdate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**risk_ids** | **List[int]** | The IDs of the risks to reclassify. | +**criticality** | **str** | The criticality to assign to risks. Only `not_critical` is accepted: critical risks can be reclassified as non-critical, but not the other way around. | + +## Example + +```python +from talon_one.models.risk_criticality_update import RiskCriticalityUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of RiskCriticalityUpdate from a JSON string +risk_criticality_update_instance = RiskCriticalityUpdate.from_json(json) +# print the JSON string representation of the object +print(RiskCriticalityUpdate.to_json()) + +# convert the object into a dict +risk_criticality_update_dict = risk_criticality_update_instance.to_dict() +# create an instance of RiskCriticalityUpdate from a dict +risk_criticality_update_from_dict = RiskCriticalityUpdate.from_dict(risk_criticality_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/RiskDetail.md b/docs/RiskDetail.md index ee1d832..c263e6d 100644 --- a/docs/RiskDetail.md +++ b/docs/RiskDetail.md @@ -20,6 +20,10 @@ Name | Type | Description | Notes **reported_date** | **datetime** | The time the ML service reported this risk. | **affected_entity_count** | **int** | The total number of entities affected by this risk. | **description** | **str** | Human-readable description of the detected anomaly. | [optional] +**discard_reason** | **str** | The reason this risk was discarded. Only present on discarded risks. | [optional] +**status_comment** | **str** | The free-text details of the latest reclassification action: the description for resolving confirmed risks, or the details for discarding risks. | [optional] +**status_changed_by** | **int** | The ID of the user who performed the latest reclassification action. | [optional] +**status_changed_at** | **datetime** | The time of the latest reclassification action. | [optional] **modified** | **datetime** | Timestamp of the most recent update. | **affected_entities** | [**List[RiskAffectedEntityItem]**](RiskAffectedEntityItem.md) | The affected entities with the highest severity ratios, in descending order. | diff --git a/docs/ScalarCheckAttributeBlock.md b/docs/ScalarCheckAttributeBlock.md deleted file mode 100644 index 6fbc01a..0000000 --- a/docs/ScalarCheckAttributeBlock.md +++ /dev/null @@ -1,31 +0,0 @@ -# ScalarCheckAttributeBlock - -Variant of `CheckAttributeBlock` for operators that compare an attribute against a single value. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**operator** | **str** | The comparison operator applied to the attribute. | [optional] -**value** | **object** | | - -## Example - -```python -from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock - -# TODO update the JSON string below -json = "{}" -# create an instance of ScalarCheckAttributeBlock from a JSON string -scalar_check_attribute_block_instance = ScalarCheckAttributeBlock.from_json(json) -# print the JSON string representation of the object -print(ScalarCheckAttributeBlock.to_json()) - -# convert the object into a dict -scalar_check_attribute_block_dict = scalar_check_attribute_block_instance.to_dict() -# create an instance of ScalarCheckAttributeBlock from a dict -scalar_check_attribute_block_from_dict = ScalarCheckAttributeBlock.from_dict(scalar_check_attribute_block_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScimServiceProviderConfigResponse.md b/docs/ScimServiceProviderConfigResponse.md index 705c07e..9712d85 100644 --- a/docs/ScimServiceProviderConfigResponse.md +++ b/docs/ScimServiceProviderConfigResponse.md @@ -10,9 +10,9 @@ Name | Type | Description | Notes **change_password** | [**ScimServiceProviderConfigResponseChangePassword**](ScimServiceProviderConfigResponseChangePassword.md) | | [optional] **documentation_uri** | **str** | The URI that points to the SCIM service provider's documentation, providing further details about the service's capabilities and usage. | [optional] **filter** | [**ScimServiceProviderConfigResponseFilter**](ScimServiceProviderConfigResponseFilter.md) | | [optional] -**patch** | [**ScimServiceProviderConfigResponseChangePassword**](ScimServiceProviderConfigResponseChangePassword.md) | | [optional] +**patch** | [**ScimServiceProviderConfigResponsePatch**](ScimServiceProviderConfigResponsePatch.md) | | [optional] **schemas** | **List[str]** | A list of SCIM schemas that define the structure and data types supported by the service provider. | [optional] -**sort** | [**ScimServiceProviderConfigResponseChangePassword**](ScimServiceProviderConfigResponseChangePassword.md) | | [optional] +**sort** | [**ScimServiceProviderConfigResponseSort**](ScimServiceProviderConfigResponseSort.md) | | [optional] ## Example diff --git a/docs/ScimServiceProviderConfigResponsePatch.md b/docs/ScimServiceProviderConfigResponsePatch.md new file mode 100644 index 0000000..34fe5de --- /dev/null +++ b/docs/ScimServiceProviderConfigResponsePatch.md @@ -0,0 +1,30 @@ +# ScimServiceProviderConfigResponsePatch + +Configuration settings related to patch operations, which allow partial updates to SCIM resources. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**supported** | **bool** | Indicates whether the service provider supports patch operations for modifying resources. | [optional] + +## Example + +```python +from talon_one.models.scim_service_provider_config_response_patch import ScimServiceProviderConfigResponsePatch + +# TODO update the JSON string below +json = "{}" +# create an instance of ScimServiceProviderConfigResponsePatch from a JSON string +scim_service_provider_config_response_patch_instance = ScimServiceProviderConfigResponsePatch.from_json(json) +# print the JSON string representation of the object +print(ScimServiceProviderConfigResponsePatch.to_json()) + +# convert the object into a dict +scim_service_provider_config_response_patch_dict = scim_service_provider_config_response_patch_instance.to_dict() +# create an instance of ScimServiceProviderConfigResponsePatch from a dict +scim_service_provider_config_response_patch_from_dict = ScimServiceProviderConfigResponsePatch.from_dict(scim_service_provider_config_response_patch_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/ScimServiceProviderConfigResponseSort.md b/docs/ScimServiceProviderConfigResponseSort.md new file mode 100644 index 0000000..d92a74d --- /dev/null +++ b/docs/ScimServiceProviderConfigResponseSort.md @@ -0,0 +1,30 @@ +# ScimServiceProviderConfigResponseSort + +Configuration settings related to sorting SCIM resources in query responses. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**supported** | **bool** | Indicates whether the service provider supports sorting operations for ordered query results. | [optional] + +## Example + +```python +from talon_one.models.scim_service_provider_config_response_sort import ScimServiceProviderConfigResponseSort + +# TODO update the JSON string below +json = "{}" +# create an instance of ScimServiceProviderConfigResponseSort from a JSON string +scim_service_provider_config_response_sort_instance = ScimServiceProviderConfigResponseSort.from_json(json) +# print the JSON string representation of the object +print(ScimServiceProviderConfigResponseSort.to_json()) + +# convert the object into a dict +scim_service_provider_config_response_sort_dict = scim_service_provider_config_response_sort_instance.to_dict() +# create an instance of ScimServiceProviderConfigResponseSort from a dict +scim_service_provider_config_response_sort_from_dict = ScimServiceProviderConfigResponseSort.from_dict(scim_service_provider_config_response_sort_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/ShowNotificationBlock.md b/docs/ShowNotificationBlock.md index f3220ee..d9a2526 100644 --- a/docs/ShowNotificationBlock.md +++ b/docs/ShowNotificationBlock.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **notification_type** | **str** | The type of notification to display. | **title** | **str** | The notification heading shown to the customer. | **body** | **str** | The notification body text. Supports template placeholders (e.g. \"{{$Session.Total}}\") evaluated at rule execution time. | [optional] -**on_failure** | **List[object]** | Blocks evaluated when this block fails or returns false. | [optional] -**on_error** | **Dict[str, List[object]]** | Named error handlers evaluated when a specific error occurs. | [optional] +**on_failure** | [**List[PromotionBlock]**](PromotionBlock.md) | Blocks evaluated when this block fails or returns false. | [optional] +**on_error** | **Dict[str, List[PromotionBlock]]** | Named error handlers evaluated when a specific error occurs. | [optional] ## Example diff --git a/docs/StrikethroughBlock.md b/docs/StrikethroughBlock.md new file mode 100644 index 0000000..95d6299 --- /dev/null +++ b/docs/StrikethroughBlock.md @@ -0,0 +1,43 @@ +# StrikethroughBlock + +A block valid in a strikethrough rule. The `type` field identifies the concrete block type. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier for this block. | +**type** | **str** | Identifies the block variant and determines which additional properties are present in it. | +**tags** | **List[str]** | Semantic labels attached to this block. | [optional] +**operator** | **str** | The comparison operator applied to the attribute. | +**blocks** | [**List[StrikethroughBlock]**](StrikethroughBlock.md) | Child blocks evaluated according to the operator. | +**on_failure** | [**List[StrikethroughBlock]**](StrikethroughBlock.md) | Strikethrough blocks evaluated when this block fails or returns false. | [optional] +**on_error** | **Dict[str, List[StrikethroughBlock]]** | Named error handlers evaluated when a specific error occurs. | [optional] +**expression** | **List[object]** | The raw Talang expression as an array. For a function call, the first element is the function name and subsequent elements are its arguments. For any other expression (for example a bare attribute path or a literal value), this is a single-element array containing that value. | +**attribute** | **str** | The attribute path identifier (e.g. \"$Session.Total\"). | +**value** | **object** | | [optional] +**min** | **object** | | [optional] +**max** | **object** | | [optional] +**values** | **object** | | [optional] +**count** | **object** | | [optional] + +## Example + +```python +from talon_one.models.strikethrough_block import StrikethroughBlock + +# TODO update the JSON string below +json = "{}" +# create an instance of StrikethroughBlock from a JSON string +strikethrough_block_instance = StrikethroughBlock.from_json(json) +# print the JSON string representation of the object +print(StrikethroughBlock.to_json()) + +# convert the object into a dict +strikethrough_block_dict = strikethrough_block_instance.to_dict() +# create an instance of StrikethroughBlock from a dict +strikethrough_block_from_dict = StrikethroughBlock.from_dict(strikethrough_block_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StrikethroughCheckAttributeBlock.md b/docs/StrikethroughCheckAttributeBlock.md index 76ac3b9..c35b004 100644 --- a/docs/StrikethroughCheckAttributeBlock.md +++ b/docs/StrikethroughCheckAttributeBlock.md @@ -5,7 +5,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**on_failure** | **List[object]** | Strikethrough blocks evaluated when this block fails or returns false. | [optional] +**id** | **str** | Unique identifier for this block. | +**type** | **str** | Identifies the block variant and determines which additional properties are present in it. | +**tags** | **List[str]** | Semantic labels attached to this block. | [optional] +**operator** | **str** | The comparison operator applied to the attribute. | +**attribute** | **str** | The attribute path identifier (e.g. \"$Session.Total\"). | +**value** | **object** | | [optional] +**min** | **object** | | [optional] +**max** | **object** | | [optional] +**values** | **object** | | [optional] +**count** | **object** | | [optional] +**on_failure** | [**List[StrikethroughBlock]**](StrikethroughBlock.md) | Strikethrough blocks evaluated when this block fails or returns false. | [optional] ## Example diff --git a/docs/StrikethroughEffect.md b/docs/StrikethroughEffect.md index 25d33c7..391daba 100644 --- a/docs/StrikethroughEffect.md +++ b/docs/StrikethroughEffect.md @@ -11,13 +11,13 @@ Name | Type | Description | Notes **rule_index** | **int** | The position of the rule that triggered this effect within the ruleset. | **rule_name** | **str** | The name of the rule that triggered this effect. | **type** | **str** | The type of this effect. | -**props** | **object** | Arbitrary properties associated with this effect type. | +**props** | [**StrikethroughEffectProps**](StrikethroughEffectProps.md) | Arbitrary properties associated with this effect type. | **start_time** | **datetime** | The start of the time frame where the effect is active in UTC. | [optional] **end_time** | **datetime** | The end of the time frame where the effect is active in UTC. | [optional] **selected_price_type** | **str** | The selected price type for this cart item (e.g. the price for members only). | [optional] **selected_price** | **float** | The value of the selected price type to apply to the SKU targeted by this effect, before any discounts are applied. | [optional] **adjustment_reference_id** | **str** | The reference identifier of the selected price adjustment for this cart item. | [optional] -**targets** | **List[object]** | A list of entities (e.g. audiences) targeted by this effect. | [optional] +**targets** | [**List[LabelTarget]**](LabelTarget.md) | A list of entities (e.g. audiences) targeted by this effect. | [optional] ## Example diff --git a/docs/StrikethroughEffectProps.md b/docs/StrikethroughEffectProps.md new file mode 100644 index 0000000..deea28b --- /dev/null +++ b/docs/StrikethroughEffectProps.md @@ -0,0 +1,33 @@ +# StrikethroughEffectProps + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The effect name. | +**value** | **object** | | +**excluded_from_price_history** | **bool** | When set to `true`, the applied discount is excluded from the item's price history. | [optional] +**effect_id** | **int** | ID of the effect. | +**payload** | **object** | The JSON payload of the custom effect. | + +## Example + +```python +from talon_one.models.strikethrough_effect_props import StrikethroughEffectProps + +# TODO update the JSON string below +json = "{}" +# create an instance of StrikethroughEffectProps from a JSON string +strikethrough_effect_props_instance = StrikethroughEffectProps.from_json(json) +# print the JSON string representation of the object +print(StrikethroughEffectProps.to_json()) + +# convert the object into a dict +strikethrough_effect_props_dict = strikethrough_effect_props_instance.to_dict() +# create an instance of StrikethroughEffectProps from a dict +strikethrough_effect_props_from_dict = StrikethroughEffectProps.from_dict(strikethrough_effect_props_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StrikethroughGroupBlock.md b/docs/StrikethroughGroupBlock.md index 17903d0..0bd7446 100644 --- a/docs/StrikethroughGroupBlock.md +++ b/docs/StrikethroughGroupBlock.md @@ -9,9 +9,9 @@ Name | Type | Description | Notes **type** | **str** | Identifies the block variant and determines which additional properties are present in it. | **tags** | **List[str]** | Semantic labels attached to this block. | [optional] **operator** | **str** | Logical operator applied across child blocks. `all` requires every child to pass, `atLeastOne` requires at least one, `none` requires all to fail. | -**blocks** | **List[object]** | Child blocks evaluated according to the operator. | -**on_failure** | **List[object]** | Strikethrough blocks evaluated when this block fails or returns false. | [optional] -**on_error** | **Dict[str, List[object]]** | Named error handlers evaluated when a specific error occurs. | [optional] +**blocks** | [**List[StrikethroughBlock]**](StrikethroughBlock.md) | Child blocks evaluated according to the operator. | +**on_failure** | [**List[StrikethroughBlock]**](StrikethroughBlock.md) | Strikethrough blocks evaluated when this block fails or returns false. | [optional] +**on_error** | **Dict[str, List[StrikethroughBlock]]** | Named error handlers evaluated when a specific error occurs. | [optional] ## Example diff --git a/docs/StrikethroughRuleV2.md b/docs/StrikethroughRuleV2.md index 41f4c43..f2b0d78 100644 --- a/docs/StrikethroughRuleV2.md +++ b/docs/StrikethroughRuleV2.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **parent_id** | **str** | ID of the parent rule, if any. | [optional] **title** | **str** | A short description of the rule. | **description** | **str** | A longer description of the rule. | [optional] -**blocks** | **List[object]** | The condition and effect blocks that make up this strikethrough rule. | +**blocks** | [**List[StrikethroughBlock]**](StrikethroughBlock.md) | The condition and effect blocks that make up this strikethrough rule. | ## Example diff --git a/docs/SupportRequest.md b/docs/SupportRequest.md index e39323d..4932694 100644 --- a/docs/SupportRequest.md +++ b/docs/SupportRequest.md @@ -21,6 +21,7 @@ Name | Type | Description | Notes **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] +**coupon_code** | **str** | Coupon code associated with the approved support request. | [optional] ## Example diff --git a/docs/TemplateArgDef.md b/docs/TemplateArgDef.md index 0833371..72f7b8b 100644 --- a/docs/TemplateArgDef.md +++ b/docs/TemplateArgDef.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **type** | **str** | The type of value this argument expects. | **description** | **str** | A campaigner-friendly description of the argument, this will also be shown in the rule editor. | [optional] **title** | **str** | A campaigner friendly name for the argument, this will be shown in the rule editor. | -**ui** | **object** | Arbitrary properties associated with this campaign. | +**ui** | **object** | Arbitrary metadata that may be used to render an input for this argument. | **key** | **str** | The identifier for the associated value within the JSON object. | [optional] **picklist_id** | **int** | ID of the picklist linked to a template. | [optional] **restricted_by_picklist** | **bool** | Whether or not this attribute's value is restricted by picklist (`picklist` property) | [optional] diff --git a/docs/UnaryCheckAttributeBlock.md b/docs/UnaryCheckAttributeBlock.md deleted file mode 100644 index b07f55f..0000000 --- a/docs/UnaryCheckAttributeBlock.md +++ /dev/null @@ -1,30 +0,0 @@ -# UnaryCheckAttributeBlock - -Variant of `CheckAttributeBlock` for operators that test a property of the attribute itself with no comparison value. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**operator** | **str** | The unary operator applied to the attribute. These operators require no comparison value. | [optional] - -## Example - -```python -from talon_one.models.unary_check_attribute_block import UnaryCheckAttributeBlock - -# TODO update the JSON string below -json = "{}" -# create an instance of UnaryCheckAttributeBlock from a JSON string -unary_check_attribute_block_instance = UnaryCheckAttributeBlock.from_json(json) -# print the JSON string representation of the object -print(UnaryCheckAttributeBlock.to_json()) - -# convert the object into a dict -unary_check_attribute_block_dict = unary_check_attribute_block_instance.to_dict() -# create an instance of UnaryCheckAttributeBlock from a dict -unary_check_attribute_block_from_dict = UnaryCheckAttributeBlock.from_dict(unary_check_attribute_block_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UpdateAchievementProgressBlock.md b/docs/UpdateAchievementProgressBlock.md new file mode 100644 index 0000000..89c36b7 --- /dev/null +++ b/docs/UpdateAchievementProgressBlock.md @@ -0,0 +1,34 @@ +# UpdateAchievementProgressBlock + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier for this block. | +**type** | **str** | Identifies the block variant and determines which additional properties are present in it. | +**tags** | **List[str]** | Semantic labels attached to this block. | [optional] +**operator** | **str** | | +**value** | **str** | The value to update the progress by. Supports template placeholders (e.g. \"{{$Session.Total / 2}}\") for dynamic quantities. | +**achievement** | [**UpdateAchievementProgressBlock1Achievement**](UpdateAchievementProgressBlock1Achievement.md) | | + +## Example + +```python +from talon_one.models.update_achievement_progress_block import UpdateAchievementProgressBlock + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateAchievementProgressBlock from a JSON string +update_achievement_progress_block_instance = UpdateAchievementProgressBlock.from_json(json) +# print the JSON string representation of the object +print(UpdateAchievementProgressBlock.to_json()) + +# convert the object into a dict +update_achievement_progress_block_dict = update_achievement_progress_block_instance.to_dict() +# create an instance of UpdateAchievementProgressBlock from a dict +update_achievement_progress_block_from_dict = UpdateAchievementProgressBlock.from_dict(update_achievement_progress_block_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateAchievementProgressBlock1Achievement.md b/docs/UpdateAchievementProgressBlock1Achievement.md new file mode 100644 index 0000000..bf34048 --- /dev/null +++ b/docs/UpdateAchievementProgressBlock1Achievement.md @@ -0,0 +1,33 @@ +# UpdateAchievementProgressBlock1Achievement + +The achievement to update. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the achievement. | +**name** | **str** | The internal name of the achievement used in API requests. | +**title** | **str** | The display name of the achievement in the Campaign Manager. | +**target** | **float** | The required number of actions or the transactional milestone to complete the achievement. | + +## Example + +```python +from talon_one.models.update_achievement_progress_block1_achievement import UpdateAchievementProgressBlock1Achievement + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateAchievementProgressBlock1Achievement from a JSON string +update_achievement_progress_block1_achievement_instance = UpdateAchievementProgressBlock1Achievement.from_json(json) +# print the JSON string representation of the object +print(UpdateAchievementProgressBlock1Achievement.to_json()) + +# convert the object into a dict +update_achievement_progress_block1_achievement_dict = update_achievement_progress_block1_achievement_instance.to_dict() +# create an instance of UpdateAchievementProgressBlock1Achievement from a dict +update_achievement_progress_block1_achievement_from_dict = UpdateAchievementProgressBlock1Achievement.from_dict(update_achievement_progress_block1_achievement_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateAttributeValueBlock.md b/docs/UpdateAttributeValueBlock.md new file mode 100644 index 0000000..e6f93dc --- /dev/null +++ b/docs/UpdateAttributeValueBlock.md @@ -0,0 +1,35 @@ +# UpdateAttributeValueBlock + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier for this block. | +**type** | **str** | Identifies the block variant and determines which additional properties are present in it. | +**tags** | **List[str]** | Semantic labels attached to this block. | [optional] +**operator** | **str** | The update operation applied to the attribute. | +**attribute** | [**UpdateAttributeValueBlock1Attribute**](UpdateAttributeValueBlock1Attribute.md) | | +**value** | **object** | | [optional] +**target** | [**UpdateAttributeValueBlock1Target**](UpdateAttributeValueBlock1Target.md) | | + +## Example + +```python +from talon_one.models.update_attribute_value_block import UpdateAttributeValueBlock + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateAttributeValueBlock from a JSON string +update_attribute_value_block_instance = UpdateAttributeValueBlock.from_json(json) +# print the JSON string representation of the object +print(UpdateAttributeValueBlock.to_json()) + +# convert the object into a dict +update_attribute_value_block_dict = update_attribute_value_block_instance.to_dict() +# create an instance of UpdateAttributeValueBlock from a dict +update_attribute_value_block_from_dict = UpdateAttributeValueBlock.from_dict(update_attribute_value_block_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateAttributeValueBlock1Attribute.md b/docs/UpdateAttributeValueBlock1Attribute.md new file mode 100644 index 0000000..58d2cfa --- /dev/null +++ b/docs/UpdateAttributeValueBlock1Attribute.md @@ -0,0 +1,34 @@ +# UpdateAttributeValueBlock1Attribute + +The attribute being updated. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The internal ID of the attribute. Reverts to `0` when the attribute is deleted or does not exist. | +**entity** | **str** | The entity type that owns the attribute. Reverts to an empty string when the attribute is deleted or does not exist. | +**name** | **str** | The attribute name as used in API requests. | +**title** | **str** | The human-readable name of the attribute. | +**type** | **str** | The data type of the attribute. | + +## Example + +```python +from talon_one.models.update_attribute_value_block1_attribute import UpdateAttributeValueBlock1Attribute + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateAttributeValueBlock1Attribute from a JSON string +update_attribute_value_block1_attribute_instance = UpdateAttributeValueBlock1Attribute.from_json(json) +# print the JSON string representation of the object +print(UpdateAttributeValueBlock1Attribute.to_json()) + +# convert the object into a dict +update_attribute_value_block1_attribute_dict = update_attribute_value_block1_attribute_instance.to_dict() +# create an instance of UpdateAttributeValueBlock1Attribute from a dict +update_attribute_value_block1_attribute_from_dict = UpdateAttributeValueBlock1Attribute.from_dict(update_attribute_value_block1_attribute_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/UpdateAttributeValueBlock1Target.md b/docs/UpdateAttributeValueBlock1Target.md new file mode 100644 index 0000000..5f3a54b --- /dev/null +++ b/docs/UpdateAttributeValueBlock1Target.md @@ -0,0 +1,30 @@ +# UpdateAttributeValueBlock1Target + +The entity or item scope that this effect operates on. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | Identifies the target scope of the attribute update. | + +## Example + +```python +from talon_one.models.update_attribute_value_block1_target import UpdateAttributeValueBlock1Target + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateAttributeValueBlock1Target from a JSON string +update_attribute_value_block1_target_instance = UpdateAttributeValueBlock1Target.from_json(json) +# print the JSON string representation of the object +print(UpdateAttributeValueBlock1Target.to_json()) + +# convert the object into a dict +update_attribute_value_block1_target_dict = update_attribute_value_block1_target_instance.to_dict() +# create an instance of UpdateAttributeValueBlock1Target from a dict +update_attribute_value_block1_target_from_dict = UpdateAttributeValueBlock1Target.from_dict(update_attribute_value_block1_target_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/UpdateAudienceMembershipBlock.md b/docs/UpdateAudienceMembershipBlock.md new file mode 100644 index 0000000..e170a09 --- /dev/null +++ b/docs/UpdateAudienceMembershipBlock.md @@ -0,0 +1,34 @@ +# UpdateAudienceMembershipBlock + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier for this block. | +**type** | **str** | Identifies the block variant and determines which additional properties are present in it. | +**tags** | **List[str]** | Semantic labels attached to this block. | [optional] +**operator** | **str** | The action to perform. | +**profile** | **str** | The customer profile to add or remove from the audience. `Current` targets the customer in the current session; `Advocate` targets the person who invited their friend via referral program. | +**audience** | [**UpdateAudienceMembershipBlock1Audience**](UpdateAudienceMembershipBlock1Audience.md) | | + +## Example + +```python +from talon_one.models.update_audience_membership_block import UpdateAudienceMembershipBlock + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateAudienceMembershipBlock from a JSON string +update_audience_membership_block_instance = UpdateAudienceMembershipBlock.from_json(json) +# print the JSON string representation of the object +print(UpdateAudienceMembershipBlock.to_json()) + +# convert the object into a dict +update_audience_membership_block_dict = update_audience_membership_block_instance.to_dict() +# create an instance of UpdateAudienceMembershipBlock from a dict +update_audience_membership_block_from_dict = UpdateAudienceMembershipBlock.from_dict(update_audience_membership_block_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateAudienceMembershipBlock1Audience.md b/docs/UpdateAudienceMembershipBlock1Audience.md new file mode 100644 index 0000000..491f4b3 --- /dev/null +++ b/docs/UpdateAudienceMembershipBlock1Audience.md @@ -0,0 +1,33 @@ +# UpdateAudienceMembershipBlock1Audience + +The audience to add the customer to or remove them from. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the audience. | +**name** | **str** | The display name of the audience. | +**integration** | **str** | The Talon.One-supported [3rd-party platform](https://docs.talon.one/docs/dev/technology-partners/overview) that this audience was created in. For example, `mParticle`, `Segment`, `Shopify`, `Braze`, or `Iterable`. **Note:** If you do not integrate with any of these platforms, do not use this property. | [optional] +**integration_id** | **str** | The ID of this audience in the third-party integration. **Note:** To create an audience that doesn't come from a 3rd party platform, do not use this property. | [optional] + +## Example + +```python +from talon_one.models.update_audience_membership_block1_audience import UpdateAudienceMembershipBlock1Audience + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateAudienceMembershipBlock1Audience from a JSON string +update_audience_membership_block1_audience_instance = UpdateAudienceMembershipBlock1Audience.from_json(json) +# print the JSON string representation of the object +print(UpdateAudienceMembershipBlock1Audience.to_json()) + +# convert the object into a dict +update_audience_membership_block1_audience_dict = update_audience_membership_block1_audience_instance.to_dict() +# create an instance of UpdateAudienceMembershipBlock1Audience from a dict +update_audience_membership_block1_audience_from_dict = UpdateAudienceMembershipBlock1Audience.from_dict(update_audience_membership_block1_audience_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/UpdateCoupon.md b/docs/UpdateCoupon.md index b6a0c47..5ed33d9 100644 --- a/docs/UpdateCoupon.md +++ b/docs/UpdateCoupon.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **expiry_date** | **datetime** | Expiration date of the coupon. Coupon never expires if this is omitted. | [optional] **limits** | [**List[LimitConfig]**](LimitConfig.md) | Limits configuration for a coupon. These limits will override the limits set from the campaign. **Note:** Only usable when creating a single coupon which is not tied to a specific recipient. Only per-profile limits are allowed to be configured. | [optional] **recipient_integration_id** | **str** | The integration ID for this coupon's beneficiary's profile. | [optional] -**attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] +**attributes** | **object** | Arbitrary properties associated with this item. | [optional] **is_reservation_mandatory** | **bool** | An indication of whether the code can be redeemed only if it has been reserved first. | [optional] [default to False] **implicitly_reserved** | **bool** | An indication of whether the coupon is implicitly reserved for all customers. | [optional] diff --git a/docs/UpdateCouponBatch.md b/docs/UpdateCouponBatch.md index ae63916..fb7e073 100644 --- a/docs/UpdateCouponBatch.md +++ b/docs/UpdateCouponBatch.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **reservation_limit** | **int** | The number of reservations that can be made with this coupon code. | [optional] **start_date** | **datetime** | Timestamp at which point the coupon becomes valid. | [optional] **expiry_date** | **datetime** | Expiration date of the coupon. Coupon never expires if this is omitted. | [optional] -**attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] +**attributes** | **object** | Optional property to set the value of custom coupon attributes. They are defined in the Campaign Manager, see [Managing attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes). Coupon attributes can also be set to _mandatory_ in your Application [settings](https://docs.talon.one/docs/product/applications/using-attributes#making-attributes-mandatory). If your Application uses mandatory attributes, you must use this property to set their value. | [optional] **batch_id** | **str** | The ID of the batch the coupon(s) belong to. | [optional] ## Example diff --git a/docs/UpdateCustomerProfileV2409Response.md b/docs/UpdateCustomerProfileV2409Response.md new file mode 100644 index 0000000..c546e86 --- /dev/null +++ b/docs/UpdateCustomerProfileV2409Response.md @@ -0,0 +1,31 @@ +# UpdateCustomerProfileV2409Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | | [optional] +**errors** | **List[object]** | | [optional] +**status_code** | **int** | | [optional] + +## Example + +```python +from talon_one.models.update_customer_profile_v2409_response import UpdateCustomerProfileV2409Response + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateCustomerProfileV2409Response from a JSON string +update_customer_profile_v2409_response_instance = UpdateCustomerProfileV2409Response.from_json(json) +# print the JSON string representation of the object +print(UpdateCustomerProfileV2409Response.to_json()) + +# convert the object into a dict +update_customer_profile_v2409_response_dict = update_customer_profile_v2409_response_instance.to_dict() +# create an instance of UpdateCustomerProfileV2409Response from a dict +update_customer_profile_v2409_response_from_dict = UpdateCustomerProfileV2409Response.from_dict(update_customer_profile_v2409_response_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/User.md b/docs/User.md index 0e1011b..1a622b5 100644 --- a/docs/User.md +++ b/docs/User.md @@ -17,11 +17,11 @@ Name | Type | Description | Notes **policy** | **object** | Access level of the user. | **roles** | **List[int]** | A list of the IDs of the roles assigned to the user. | [optional] **auth_method** | **str** | Authentication method for this user. | [optional] -**application_notification_subscriptions** | **object** | Arbitrary properties associated with this campaign. | [optional] +**application_notification_subscriptions** | **object** | Application notifications that the user is subscribed to. | [optional] **last_signed_in** | **datetime** | Timestamp when the user last signed in to Talon.One. | [optional] **last_accessed** | **datetime** | Timestamp of the user's last activity after signing in to Talon.One. | [optional] **latest_feed_timestamp** | **datetime** | Timestamp when the user was notified for feed. | [optional] -**additional_attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] +**additional_attributes** | **object** | Additional user attributes, created and used by external identity providers. | [optional] ## Example diff --git a/docs/WebhookAuthentication.md b/docs/WebhookAuthentication.md index fe1097e..9634c29 100644 --- a/docs/WebhookAuthentication.md +++ b/docs/WebhookAuthentication.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **webhooks** | [**List[WebhookAuthenticationWebhookRef]**](WebhookAuthenticationWebhookRef.md) | | **name** | **str** | The name of the webhook authentication. | **type** | **str** | | -**data** | **object** | | +**data** | [**WebhookAuthenticationAllOfData**](WebhookAuthenticationAllOfData.md) | | ## Example diff --git a/docs/WebhookAuthenticationAllOfData.md b/docs/WebhookAuthenticationAllOfData.md new file mode 100644 index 0000000..bcb5244 --- /dev/null +++ b/docs/WebhookAuthenticationAllOfData.md @@ -0,0 +1,31 @@ +# WebhookAuthenticationAllOfData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **str** | The Basic HTTP username. | +**password** | **str** | The Basic HTTP password. | +**headers** | **Dict[str, str]** | | + +## Example + +```python +from talon_one.models.webhook_authentication_all_of_data import WebhookAuthenticationAllOfData + +# TODO update the JSON string below +json = "{}" +# create an instance of WebhookAuthenticationAllOfData from a JSON string +webhook_authentication_all_of_data_instance = WebhookAuthenticationAllOfData.from_json(json) +# print the JSON string representation of the object +print(WebhookAuthenticationAllOfData.to_json()) + +# convert the object into a dict +webhook_authentication_all_of_data_dict = webhook_authentication_all_of_data_instance.to_dict() +# create an instance of WebhookAuthenticationAllOfData from a dict +webhook_authentication_all_of_data_from_dict = WebhookAuthenticationAllOfData.from_dict(webhook_authentication_all_of_data_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/WebhookAuthenticationBase.md b/docs/WebhookAuthenticationBase.md new file mode 100644 index 0000000..51a0278 --- /dev/null +++ b/docs/WebhookAuthenticationBase.md @@ -0,0 +1,31 @@ +# WebhookAuthenticationBase + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the webhook authentication. | +**type** | **object** | | +**data** | [**WebhookAuthenticationDataCustom**](WebhookAuthenticationDataCustom.md) | | + +## Example + +```python +from talon_one.models.webhook_authentication_base import WebhookAuthenticationBase + +# TODO update the JSON string below +json = "{}" +# create an instance of WebhookAuthenticationBase from a JSON string +webhook_authentication_base_instance = WebhookAuthenticationBase.from_json(json) +# print the JSON string representation of the object +print(WebhookAuthenticationBase.to_json()) + +# convert the object into a dict +webhook_authentication_base_dict = webhook_authentication_base_instance.to_dict() +# create an instance of WebhookAuthenticationBase from a dict +webhook_authentication_base_from_dict = WebhookAuthenticationBase.from_dict(webhook_authentication_base_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/WebhookAuthenticationBaseOneOf.md b/docs/WebhookAuthenticationBaseOneOf.md new file mode 100644 index 0000000..cd03154 --- /dev/null +++ b/docs/WebhookAuthenticationBaseOneOf.md @@ -0,0 +1,31 @@ +# WebhookAuthenticationBaseOneOf + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the webhook authentication. | [optional] +**type** | **object** | | [optional] +**data** | [**WebhookAuthenticationDataBasic**](WebhookAuthenticationDataBasic.md) | | [optional] + +## Example + +```python +from talon_one.models.webhook_authentication_base_one_of import WebhookAuthenticationBaseOneOf + +# TODO update the JSON string below +json = "{}" +# create an instance of WebhookAuthenticationBaseOneOf from a JSON string +webhook_authentication_base_one_of_instance = WebhookAuthenticationBaseOneOf.from_json(json) +# print the JSON string representation of the object +print(WebhookAuthenticationBaseOneOf.to_json()) + +# convert the object into a dict +webhook_authentication_base_one_of_dict = webhook_authentication_base_one_of_instance.to_dict() +# create an instance of WebhookAuthenticationBaseOneOf from a dict +webhook_authentication_base_one_of_from_dict = WebhookAuthenticationBaseOneOf.from_dict(webhook_authentication_base_one_of_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/WebhookAuthenticationBaseOneOf1.md b/docs/WebhookAuthenticationBaseOneOf1.md new file mode 100644 index 0000000..b1e8467 --- /dev/null +++ b/docs/WebhookAuthenticationBaseOneOf1.md @@ -0,0 +1,31 @@ +# WebhookAuthenticationBaseOneOf1 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the webhook authentication. | [optional] +**type** | **object** | | [optional] +**data** | [**WebhookAuthenticationDataCustom**](WebhookAuthenticationDataCustom.md) | | [optional] + +## Example + +```python +from talon_one.models.webhook_authentication_base_one_of1 import WebhookAuthenticationBaseOneOf1 + +# TODO update the JSON string below +json = "{}" +# create an instance of WebhookAuthenticationBaseOneOf1 from a JSON string +webhook_authentication_base_one_of1_instance = WebhookAuthenticationBaseOneOf1.from_json(json) +# print the JSON string representation of the object +print(WebhookAuthenticationBaseOneOf1.to_json()) + +# convert the object into a dict +webhook_authentication_base_one_of1_dict = webhook_authentication_base_one_of1_instance.to_dict() +# create an instance of WebhookAuthenticationBaseOneOf1 from a dict +webhook_authentication_base_one_of1_from_dict = WebhookAuthenticationBaseOneOf1.from_dict(webhook_authentication_base_one_of1_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 cd2dd0b..c453fb8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "talon_one" -version = "26.14.0" +version = "26.15.0" description = "Talon.One API" authors = [ {name = "OpenAPI Generator Community",email = "team@openapitools.org"}, @@ -10,7 +10,7 @@ keywords = ["OpenAPI", "OpenAPI-Generator", "Talon.One API"] requires-python = ">=3.9" dependencies = [ - "urllib3 (>=2.1.0,<3.0.0)", + "urllib3 (>=2.6.3,<3.0.0)", "python-dateutil (>=2.8.2)", "pydantic (>=2.11)", "typing-extensions (>=4.7.1)", @@ -23,7 +23,7 @@ Repository = "https://github.com/talon-one/talon-one-python-sdk" requires-poetry = ">=2.0" [tool.poetry.group.dev.dependencies] -pytest = ">= 7.2.1" +pytest = ">= 8.4.2" pytest-cov = ">= 2.8.1" tox = ">= 3.9.0" flake8 = ">= 4.0.0" diff --git a/requirements.txt b/requirements.txt index 9e2d67a..9af8f58 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -urllib3 >= 2.1.0, < 3.0.0 +urllib3 >= 2.6.3, < 3.0.0 python_dateutil >= 2.8.2 pydantic >= 2.11 typing-extensions >= 4.7.1 diff --git a/setup.py b/setup.py index f9f7a16..106c7e5 100644 --- a/setup.py +++ b/setup.py @@ -19,10 +19,10 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "talon_one" -VERSION = "26.14.0" +VERSION = "26.15.0" PYTHON_REQUIRES = ">= 3.10" REQUIRES = [ - "urllib3 >= 2.1.0, < 3.0.0", + "urllib3 >= 2.6.3, < 3.0.0", "python-dateutil >= 2.8.2", "pydantic >= 2.11", "typing-extensions >= 4.7.1", diff --git a/talon_one/__init__.py b/talon_one/__init__.py index f7af9ed..bee2f79 100644 --- a/talon_one/__init__.py +++ b/talon_one/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "26.14.0" +__version__ = "26.15.0" # Define package exports __all__ = [ @@ -90,7 +90,6 @@ "ApplicationCustomerEntity", "ApplicationEntity", "ApplicationEvent", - "ApplicationNotification", "ApplicationReferee", "ApplicationSession", "ApplicationSessionEntity", @@ -116,6 +115,7 @@ "BaseLoyaltyProgram", "BaseNotification", "BaseNotificationEntity", + "BaseNotificationPolicy", "BaseNotificationWebhook", "BaseNotifications", "BaseSamlConnection", @@ -124,7 +124,6 @@ "BestPriorPriceRequest", "BestPriorPriceSettings", "BestPriorTarget", - "BetweenCheckAttributeBlock", "Binding", "Blueprint", "BulkApplicationNotification", @@ -192,6 +191,12 @@ "Catalog", "CatalogAction", "CatalogActionFilter", + "CatalogActionOneOf", + "CatalogActionOneOf1", + "CatalogActionOneOf2", + "CatalogActionOneOf3", + "CatalogActionOneOf4", + "CatalogActionOneOf5", "CatalogItem", "CatalogRule", "CatalogSyncRequest", @@ -199,7 +204,7 @@ "Change", "ChangeLoyaltyTierLevelEffectProps", "ChangeProfilePassword", - "CheckAttributeBlock", + "CheckAttributeBlockBase", "CheckAudienceBlock", "CheckAudienceBlock1Audience", "CheckCouponBlock", @@ -208,6 +213,7 @@ "Collection", "CollectionItem", "CollectionWithoutPayload", + "ConfirmRisksRequest", "Coupon", "CouponConstraints", "CouponCreatedEffectProps", @@ -246,6 +252,7 @@ "CustomerProfileEntity", "CustomerProfileIntegrationRequestV2", "CustomerProfileIntegrationResponseV2", + "CustomerProfileReward", "CustomerProfileSearchQuery", "CustomerProfileUpdateV2Response", "CustomerSession", @@ -256,8 +263,12 @@ "DeleteCouponsData", "DeleteLoyaltyTransactionsRequest", "DeleteUserRequest", + "DigitalPass", + "DiscardRisksRequest", "Effect", + "EffectAllOfProps", "EffectEntity", + "EffectProps", "EmailEntity", "EmbeddedAnalyticsConfiguration", "EmbeddedAnalyticsConfigurationDashboards", @@ -412,6 +423,7 @@ "IntegrationHubFlowResponse", "IntegrationHubFlowWithConfig", "IntegrationHubPaginatedEventPayload", + "IntegrationHubPaginatedEventPayloadDataInner", "IntegrationProfileEntity", "IntegrationProfileEntityV3", "IntegrationRequest", @@ -422,6 +434,7 @@ "InventoryCoupon", "InventoryReferral", "ItemAttribute", + "LabelTarget", "LabelTargetAudience", "LabelTargetNone", "LedgerEntry", @@ -439,10 +452,8 @@ "ListCampaignStoreBudgets", "ListCampaignStoreBudgetsStore", "ListCatalogItems200Response", - "ListCheckAttributeBlock", "ListExperiments200Response", "ListStores200Response", - "ListWithCountCheckAttributeBlock", "LoginParams", "Loyalty", "LoyaltyBalance", @@ -471,6 +482,8 @@ "LoyaltySubLedger", "LoyaltyTier", "MCPKey", + "MCPOAuthProtectedResource", + "MCPOAuthServerMetadata", "ManagementKey", "ManagerConfig", "MessageLogEntries", @@ -521,6 +534,7 @@ "NewCustomerProfile", "NewCustomerSession", "NewCustomerSessionV2", + "NewDigitalPass", "NewEvent", "NewEventType", "NewEventV3Entity", @@ -571,6 +585,7 @@ "OutgoingIntegrationBrazePolicy", "OutgoingIntegrationCleverTapPolicy", "OutgoingIntegrationConfiguration", + "OutgoingIntegrationConfigurationPolicy", "OutgoingIntegrationIterablePolicy", "OutgoingIntegrationMoEngagePolicy", "OutgoingIntegrationTemplate", @@ -600,6 +615,7 @@ "ProfileAudiencesChanges", "ProjectedTier", "PromoteExperiment", + "PromotionBlock", "PromotionCheckAttributeBlock", "PromotionGroupBlock", "PromotionRuleV2", @@ -618,6 +634,7 @@ "ResponseContentObject", "ReturnIntegrationRequest", "ReturnedCartItem", + "ReviewRisksRequest", "Revision", "RevisionActivation", "RevisionActivationRequest", @@ -626,6 +643,7 @@ "RewardPointsRequired", "Risk", "RiskAffectedEntityItem", + "RiskCriticalityUpdate", "RiskDetail", "RiskNotification", "Role", @@ -659,7 +677,6 @@ "SamlConnectionInternal", "SamlConnectionMetadata", "SamlLoginEndpoint", - "ScalarCheckAttributeBlock", "ScimBaseGroup", "ScimBaseUser", "ScimBaseUserName", @@ -677,6 +694,8 @@ "ScimServiceProviderConfigResponseBulk", "ScimServiceProviderConfigResponseChangePassword", "ScimServiceProviderConfigResponseFilter", + "ScimServiceProviderConfigResponsePatch", + "ScimServiceProviderConfigResponseSort", "ScimUser", "ScimUsersListResponse", "SecondaryDeployment", @@ -693,11 +712,13 @@ "SkuUnitAnalyticsDataPoint", "SlotDef", "Store", + "StrikethroughBlock", "StrikethroughChangedItem", "StrikethroughCheckAttributeBlock", "StrikethroughCustomEffectPerItemProps", "StrikethroughDebugResponse", "StrikethroughEffect", + "StrikethroughEffectProps", "StrikethroughGroupBlock", "StrikethroughLabelingNotification", "StrikethroughRuleV2", @@ -728,15 +749,21 @@ "TransferLoyaltyCard", "TriggerWebhookEffectProps", "TwoFAConfig", - "UnaryCheckAttributeBlock", "UpdateAccount", "UpdateAchievement", + "UpdateAchievementProgressBlock", + "UpdateAchievementProgressBlock1Achievement", "UpdateAchievementV2", "UpdateApplication", "UpdateApplicationAPIKey", "UpdateApplicationCIF", "UpdateAttributeEffectProps", + "UpdateAttributeValueBlock", + "UpdateAttributeValueBlock1Attribute", + "UpdateAttributeValueBlock1Target", "UpdateAudience", + "UpdateAudienceMembershipBlock", + "UpdateAudienceMembershipBlock1Audience", "UpdateBlueprint", "UpdateCampaign", "UpdateCampaignCollection", @@ -749,6 +776,7 @@ "UpdateCouponBatch", "UpdateCouponsData", "UpdateCustomEffect", + "UpdateCustomerProfileV2409Response", "UpdateCustomerSessionV2409Response", "UpdateExperiment", "UpdateExperimentVariant", @@ -773,6 +801,10 @@ "ValueMap", "Webhook", "WebhookAuthentication", + "WebhookAuthenticationAllOfData", + "WebhookAuthenticationBase", + "WebhookAuthenticationBaseOneOf", + "WebhookAuthenticationBaseOneOf1", "WebhookAuthenticationDataBasic", "WebhookAuthenticationDataCustom", "WebhookAuthenticationWebhookRef", @@ -857,7 +889,6 @@ from talon_one.models.application_customer_entity import ApplicationCustomerEntity as ApplicationCustomerEntity from talon_one.models.application_entity import ApplicationEntity as ApplicationEntity from talon_one.models.application_event import ApplicationEvent as ApplicationEvent -from talon_one.models.application_notification import ApplicationNotification as ApplicationNotification from talon_one.models.application_referee import ApplicationReferee as ApplicationReferee from talon_one.models.application_session import ApplicationSession as ApplicationSession from talon_one.models.application_session_entity import ApplicationSessionEntity as ApplicationSessionEntity @@ -883,6 +914,7 @@ from talon_one.models.base_loyalty_program import BaseLoyaltyProgram as BaseLoyaltyProgram from talon_one.models.base_notification import BaseNotification as BaseNotification from talon_one.models.base_notification_entity import BaseNotificationEntity as BaseNotificationEntity +from talon_one.models.base_notification_policy import BaseNotificationPolicy as BaseNotificationPolicy from talon_one.models.base_notification_webhook import BaseNotificationWebhook as BaseNotificationWebhook from talon_one.models.base_notifications import BaseNotifications as BaseNotifications from talon_one.models.base_saml_connection import BaseSamlConnection as BaseSamlConnection @@ -891,7 +923,6 @@ from talon_one.models.best_prior_price_request import BestPriorPriceRequest as BestPriorPriceRequest from talon_one.models.best_prior_price_settings import BestPriorPriceSettings as BestPriorPriceSettings from talon_one.models.best_prior_target import BestPriorTarget as BestPriorTarget -from talon_one.models.between_check_attribute_block import BetweenCheckAttributeBlock as BetweenCheckAttributeBlock from talon_one.models.binding import Binding as Binding from talon_one.models.blueprint import Blueprint as Blueprint from talon_one.models.bulk_application_notification import BulkApplicationNotification as BulkApplicationNotification @@ -959,6 +990,12 @@ 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_action_one_of import CatalogActionOneOf as CatalogActionOneOf +from talon_one.models.catalog_action_one_of1 import CatalogActionOneOf1 as CatalogActionOneOf1 +from talon_one.models.catalog_action_one_of2 import CatalogActionOneOf2 as CatalogActionOneOf2 +from talon_one.models.catalog_action_one_of3 import CatalogActionOneOf3 as CatalogActionOneOf3 +from talon_one.models.catalog_action_one_of4 import CatalogActionOneOf4 as CatalogActionOneOf4 +from talon_one.models.catalog_action_one_of5 import CatalogActionOneOf5 as CatalogActionOneOf5 from talon_one.models.catalog_item import CatalogItem as CatalogItem from talon_one.models.catalog_rule import CatalogRule as CatalogRule from talon_one.models.catalog_sync_request import CatalogSyncRequest as CatalogSyncRequest @@ -966,7 +1003,7 @@ from talon_one.models.change import Change as Change from talon_one.models.change_loyalty_tier_level_effect_props import ChangeLoyaltyTierLevelEffectProps as ChangeLoyaltyTierLevelEffectProps from talon_one.models.change_profile_password import ChangeProfilePassword as ChangeProfilePassword -from talon_one.models.check_attribute_block import CheckAttributeBlock as CheckAttributeBlock +from talon_one.models.check_attribute_block_base import CheckAttributeBlockBase as CheckAttributeBlockBase from talon_one.models.check_audience_block import CheckAudienceBlock as CheckAudienceBlock from talon_one.models.check_audience_block1_audience import CheckAudienceBlock1Audience as CheckAudienceBlock1Audience from talon_one.models.check_coupon_block import CheckCouponBlock as CheckCouponBlock @@ -975,6 +1012,7 @@ from talon_one.models.collection import Collection as Collection from talon_one.models.collection_item import CollectionItem as CollectionItem from talon_one.models.collection_without_payload import CollectionWithoutPayload as CollectionWithoutPayload +from talon_one.models.confirm_risks_request import ConfirmRisksRequest as ConfirmRisksRequest from talon_one.models.coupon import Coupon as Coupon from talon_one.models.coupon_constraints import CouponConstraints as CouponConstraints from talon_one.models.coupon_created_effect_props import CouponCreatedEffectProps as CouponCreatedEffectProps @@ -1013,6 +1051,7 @@ from talon_one.models.customer_profile_entity import CustomerProfileEntity as CustomerProfileEntity from talon_one.models.customer_profile_integration_request_v2 import CustomerProfileIntegrationRequestV2 as CustomerProfileIntegrationRequestV2 from talon_one.models.customer_profile_integration_response_v2 import CustomerProfileIntegrationResponseV2 as CustomerProfileIntegrationResponseV2 +from talon_one.models.customer_profile_reward import CustomerProfileReward as CustomerProfileReward from talon_one.models.customer_profile_search_query import CustomerProfileSearchQuery as CustomerProfileSearchQuery from talon_one.models.customer_profile_update_v2_response import CustomerProfileUpdateV2Response as CustomerProfileUpdateV2Response from talon_one.models.customer_session import CustomerSession as CustomerSession @@ -1023,8 +1062,12 @@ from talon_one.models.delete_coupons_data import DeleteCouponsData as DeleteCouponsData from talon_one.models.delete_loyalty_transactions_request import DeleteLoyaltyTransactionsRequest as DeleteLoyaltyTransactionsRequest from talon_one.models.delete_user_request import DeleteUserRequest as DeleteUserRequest +from talon_one.models.digital_pass import DigitalPass as DigitalPass +from talon_one.models.discard_risks_request import DiscardRisksRequest as DiscardRisksRequest from talon_one.models.effect import Effect as Effect +from talon_one.models.effect_all_of_props import EffectAllOfProps as EffectAllOfProps from talon_one.models.effect_entity import EffectEntity as EffectEntity +from talon_one.models.effect_props import EffectProps as EffectProps from talon_one.models.email_entity import EmailEntity as EmailEntity from talon_one.models.embedded_analytics_configuration import EmbeddedAnalyticsConfiguration as EmbeddedAnalyticsConfiguration from talon_one.models.embedded_analytics_configuration_dashboards import EmbeddedAnalyticsConfigurationDashboards as EmbeddedAnalyticsConfigurationDashboards @@ -1179,6 +1222,7 @@ from talon_one.models.integration_hub_flow_response import IntegrationHubFlowResponse as IntegrationHubFlowResponse from talon_one.models.integration_hub_flow_with_config import IntegrationHubFlowWithConfig as IntegrationHubFlowWithConfig from talon_one.models.integration_hub_paginated_event_payload import IntegrationHubPaginatedEventPayload as IntegrationHubPaginatedEventPayload +from talon_one.models.integration_hub_paginated_event_payload_data_inner import IntegrationHubPaginatedEventPayloadDataInner as IntegrationHubPaginatedEventPayloadDataInner from talon_one.models.integration_profile_entity import IntegrationProfileEntity as IntegrationProfileEntity from talon_one.models.integration_profile_entity_v3 import IntegrationProfileEntityV3 as IntegrationProfileEntityV3 from talon_one.models.integration_request import IntegrationRequest as IntegrationRequest @@ -1189,6 +1233,7 @@ from talon_one.models.inventory_coupon import InventoryCoupon as InventoryCoupon from talon_one.models.inventory_referral import InventoryReferral as InventoryReferral from talon_one.models.item_attribute import ItemAttribute as ItemAttribute +from talon_one.models.label_target import LabelTarget as LabelTarget from talon_one.models.label_target_audience import LabelTargetAudience as LabelTargetAudience from talon_one.models.label_target_none import LabelTargetNone as LabelTargetNone from talon_one.models.ledger_entry import LedgerEntry as LedgerEntry @@ -1206,10 +1251,8 @@ from talon_one.models.list_campaign_store_budgets import ListCampaignStoreBudgets as ListCampaignStoreBudgets from talon_one.models.list_campaign_store_budgets_store import ListCampaignStoreBudgetsStore as ListCampaignStoreBudgetsStore from talon_one.models.list_catalog_items200_response import ListCatalogItems200Response as ListCatalogItems200Response -from talon_one.models.list_check_attribute_block import ListCheckAttributeBlock as ListCheckAttributeBlock from talon_one.models.list_experiments200_response import ListExperiments200Response as ListExperiments200Response from talon_one.models.list_stores200_response import ListStores200Response as ListStores200Response -from talon_one.models.list_with_count_check_attribute_block import ListWithCountCheckAttributeBlock as ListWithCountCheckAttributeBlock from talon_one.models.login_params import LoginParams as LoginParams from talon_one.models.loyalty import Loyalty as Loyalty from talon_one.models.loyalty_balance import LoyaltyBalance as LoyaltyBalance @@ -1238,6 +1281,8 @@ from talon_one.models.loyalty_sub_ledger import LoyaltySubLedger as LoyaltySubLedger from talon_one.models.loyalty_tier import LoyaltyTier as LoyaltyTier from talon_one.models.mcp_key import MCPKey as MCPKey +from talon_one.models.mcpo_auth_protected_resource import MCPOAuthProtectedResource as MCPOAuthProtectedResource +from talon_one.models.mcpo_auth_server_metadata import MCPOAuthServerMetadata as MCPOAuthServerMetadata from talon_one.models.management_key import ManagementKey as ManagementKey from talon_one.models.manager_config import ManagerConfig as ManagerConfig from talon_one.models.message_log_entries import MessageLogEntries as MessageLogEntries @@ -1288,6 +1333,7 @@ from talon_one.models.new_customer_profile import NewCustomerProfile as NewCustomerProfile from talon_one.models.new_customer_session import NewCustomerSession as NewCustomerSession from talon_one.models.new_customer_session_v2 import NewCustomerSessionV2 as NewCustomerSessionV2 +from talon_one.models.new_digital_pass import NewDigitalPass as NewDigitalPass 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 @@ -1338,6 +1384,7 @@ from talon_one.models.outgoing_integration_braze_policy import OutgoingIntegrationBrazePolicy as OutgoingIntegrationBrazePolicy from talon_one.models.outgoing_integration_clever_tap_policy import OutgoingIntegrationCleverTapPolicy as OutgoingIntegrationCleverTapPolicy from talon_one.models.outgoing_integration_configuration import OutgoingIntegrationConfiguration as OutgoingIntegrationConfiguration +from talon_one.models.outgoing_integration_configuration_policy import OutgoingIntegrationConfigurationPolicy as OutgoingIntegrationConfigurationPolicy from talon_one.models.outgoing_integration_iterable_policy import OutgoingIntegrationIterablePolicy as OutgoingIntegrationIterablePolicy from talon_one.models.outgoing_integration_mo_engage_policy import OutgoingIntegrationMoEngagePolicy as OutgoingIntegrationMoEngagePolicy from talon_one.models.outgoing_integration_template import OutgoingIntegrationTemplate as OutgoingIntegrationTemplate @@ -1367,6 +1414,7 @@ from talon_one.models.profile_audiences_changes import ProfileAudiencesChanges as ProfileAudiencesChanges from talon_one.models.projected_tier import ProjectedTier as ProjectedTier from talon_one.models.promote_experiment import PromoteExperiment as PromoteExperiment +from talon_one.models.promotion_block import PromotionBlock as PromotionBlock from talon_one.models.promotion_check_attribute_block import PromotionCheckAttributeBlock as PromotionCheckAttributeBlock from talon_one.models.promotion_group_block import PromotionGroupBlock as PromotionGroupBlock from talon_one.models.promotion_rule_v2 import PromotionRuleV2 as PromotionRuleV2 @@ -1385,6 +1433,7 @@ from talon_one.models.response_content_object import ResponseContentObject as ResponseContentObject from talon_one.models.return_integration_request import ReturnIntegrationRequest as ReturnIntegrationRequest from talon_one.models.returned_cart_item import ReturnedCartItem as ReturnedCartItem +from talon_one.models.review_risks_request import ReviewRisksRequest as ReviewRisksRequest from talon_one.models.revision import Revision as Revision from talon_one.models.revision_activation import RevisionActivation as RevisionActivation from talon_one.models.revision_activation_request import RevisionActivationRequest as RevisionActivationRequest @@ -1393,6 +1442,7 @@ from talon_one.models.reward_points_required import RewardPointsRequired as RewardPointsRequired from talon_one.models.risk import Risk as Risk from talon_one.models.risk_affected_entity_item import RiskAffectedEntityItem as RiskAffectedEntityItem +from talon_one.models.risk_criticality_update import RiskCriticalityUpdate as RiskCriticalityUpdate from talon_one.models.risk_detail import RiskDetail as RiskDetail from talon_one.models.risk_notification import RiskNotification as RiskNotification from talon_one.models.role import Role as Role @@ -1426,7 +1476,6 @@ from talon_one.models.saml_connection_internal import SamlConnectionInternal as SamlConnectionInternal from talon_one.models.saml_connection_metadata import SamlConnectionMetadata as SamlConnectionMetadata from talon_one.models.saml_login_endpoint import SamlLoginEndpoint as SamlLoginEndpoint -from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock as ScalarCheckAttributeBlock from talon_one.models.scim_base_group import ScimBaseGroup as ScimBaseGroup from talon_one.models.scim_base_user import ScimBaseUser as ScimBaseUser from talon_one.models.scim_base_user_name import ScimBaseUserName as ScimBaseUserName @@ -1444,6 +1493,8 @@ from talon_one.models.scim_service_provider_config_response_bulk import ScimServiceProviderConfigResponseBulk as ScimServiceProviderConfigResponseBulk from talon_one.models.scim_service_provider_config_response_change_password import ScimServiceProviderConfigResponseChangePassword as ScimServiceProviderConfigResponseChangePassword from talon_one.models.scim_service_provider_config_response_filter import ScimServiceProviderConfigResponseFilter as ScimServiceProviderConfigResponseFilter +from talon_one.models.scim_service_provider_config_response_patch import ScimServiceProviderConfigResponsePatch as ScimServiceProviderConfigResponsePatch +from talon_one.models.scim_service_provider_config_response_sort import ScimServiceProviderConfigResponseSort as ScimServiceProviderConfigResponseSort from talon_one.models.scim_user import ScimUser as ScimUser from talon_one.models.scim_users_list_response import ScimUsersListResponse as ScimUsersListResponse from talon_one.models.secondary_deployment import SecondaryDeployment as SecondaryDeployment @@ -1460,11 +1511,13 @@ from talon_one.models.sku_unit_analytics_data_point import SkuUnitAnalyticsDataPoint as SkuUnitAnalyticsDataPoint from talon_one.models.slot_def import SlotDef as SlotDef from talon_one.models.store import Store as Store +from talon_one.models.strikethrough_block import StrikethroughBlock as StrikethroughBlock from talon_one.models.strikethrough_changed_item import StrikethroughChangedItem as StrikethroughChangedItem from talon_one.models.strikethrough_check_attribute_block import StrikethroughCheckAttributeBlock as StrikethroughCheckAttributeBlock from talon_one.models.strikethrough_custom_effect_per_item_props import StrikethroughCustomEffectPerItemProps as StrikethroughCustomEffectPerItemProps from talon_one.models.strikethrough_debug_response import StrikethroughDebugResponse as StrikethroughDebugResponse from talon_one.models.strikethrough_effect import StrikethroughEffect as StrikethroughEffect +from talon_one.models.strikethrough_effect_props import StrikethroughEffectProps as StrikethroughEffectProps from talon_one.models.strikethrough_group_block import StrikethroughGroupBlock as StrikethroughGroupBlock from talon_one.models.strikethrough_labeling_notification import StrikethroughLabelingNotification as StrikethroughLabelingNotification from talon_one.models.strikethrough_rule_v2 import StrikethroughRuleV2 as StrikethroughRuleV2 @@ -1495,15 +1548,21 @@ from talon_one.models.transfer_loyalty_card import TransferLoyaltyCard as TransferLoyaltyCard from talon_one.models.trigger_webhook_effect_props import TriggerWebhookEffectProps as TriggerWebhookEffectProps from talon_one.models.two_fa_config import TwoFAConfig as TwoFAConfig -from talon_one.models.unary_check_attribute_block import UnaryCheckAttributeBlock as UnaryCheckAttributeBlock from talon_one.models.update_account import UpdateAccount as UpdateAccount from talon_one.models.update_achievement import UpdateAchievement as UpdateAchievement +from talon_one.models.update_achievement_progress_block import UpdateAchievementProgressBlock as UpdateAchievementProgressBlock +from talon_one.models.update_achievement_progress_block1_achievement import UpdateAchievementProgressBlock1Achievement as UpdateAchievementProgressBlock1Achievement from talon_one.models.update_achievement_v2 import UpdateAchievementV2 as UpdateAchievementV2 from talon_one.models.update_application import UpdateApplication as UpdateApplication from talon_one.models.update_application_api_key import UpdateApplicationAPIKey as UpdateApplicationAPIKey from talon_one.models.update_application_cif import UpdateApplicationCIF as UpdateApplicationCIF from talon_one.models.update_attribute_effect_props import UpdateAttributeEffectProps as UpdateAttributeEffectProps +from talon_one.models.update_attribute_value_block import UpdateAttributeValueBlock as UpdateAttributeValueBlock +from talon_one.models.update_attribute_value_block1_attribute import UpdateAttributeValueBlock1Attribute as UpdateAttributeValueBlock1Attribute +from talon_one.models.update_attribute_value_block1_target import UpdateAttributeValueBlock1Target as UpdateAttributeValueBlock1Target from talon_one.models.update_audience import UpdateAudience as UpdateAudience +from talon_one.models.update_audience_membership_block import UpdateAudienceMembershipBlock as UpdateAudienceMembershipBlock +from talon_one.models.update_audience_membership_block1_audience import UpdateAudienceMembershipBlock1Audience as UpdateAudienceMembershipBlock1Audience from talon_one.models.update_blueprint import UpdateBlueprint as UpdateBlueprint from talon_one.models.update_campaign import UpdateCampaign as UpdateCampaign from talon_one.models.update_campaign_collection import UpdateCampaignCollection as UpdateCampaignCollection @@ -1516,6 +1575,7 @@ from talon_one.models.update_coupon_batch import UpdateCouponBatch as UpdateCouponBatch from talon_one.models.update_coupons_data import UpdateCouponsData as UpdateCouponsData from talon_one.models.update_custom_effect import UpdateCustomEffect as UpdateCustomEffect +from talon_one.models.update_customer_profile_v2409_response import UpdateCustomerProfileV2409Response as UpdateCustomerProfileV2409Response from talon_one.models.update_customer_session_v2409_response import UpdateCustomerSessionV2409Response as UpdateCustomerSessionV2409Response from talon_one.models.update_experiment import UpdateExperiment as UpdateExperiment from talon_one.models.update_experiment_variant import UpdateExperimentVariant as UpdateExperimentVariant @@ -1540,6 +1600,10 @@ from talon_one.models.value_map import ValueMap as ValueMap from talon_one.models.webhook import Webhook as Webhook from talon_one.models.webhook_authentication import WebhookAuthentication as WebhookAuthentication +from talon_one.models.webhook_authentication_all_of_data import WebhookAuthenticationAllOfData as WebhookAuthenticationAllOfData +from talon_one.models.webhook_authentication_base import WebhookAuthenticationBase as WebhookAuthenticationBase +from talon_one.models.webhook_authentication_base_one_of import WebhookAuthenticationBaseOneOf as WebhookAuthenticationBaseOneOf +from talon_one.models.webhook_authentication_base_one_of1 import WebhookAuthenticationBaseOneOf1 as WebhookAuthenticationBaseOneOf1 from talon_one.models.webhook_authentication_data_basic import WebhookAuthenticationDataBasic as WebhookAuthenticationDataBasic from talon_one.models.webhook_authentication_data_custom import WebhookAuthenticationDataCustom as WebhookAuthenticationDataCustom from talon_one.models.webhook_authentication_webhook_ref import WebhookAuthenticationWebhookRef as WebhookAuthenticationWebhookRef diff --git a/talon_one/api/integration_api.py b/talon_one/api/integration_api.py index 45ff4b4..f38976e 100644 --- a/talon_one/api/integration_api.py +++ b/talon_one/api/integration_api.py @@ -8945,7 +8945,7 @@ def reopen_customer_session( ) -> ReopenSessionResponse: """Reopen customer session - Reopen a closed [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). For example, if a session has been completed but still needs to be edited, you can reopen it with this endpoint. A reopen session is treated like a standard open session. When reopening a session: - The `talon_session_reopened` event is triggered. You can see it in the **Events** view in the Campaign Manager. - The session state is updated to `open`. - Any modified budgets and triggered effects are rolled back when the session closes. - Depending on the [return policy](https://docs.talon.one/docs/product/loyalty-programs/managing-loyalty-programs#return-policy) in your loyalty programs, points are rolled back in the following ways: - Pending points are rolled back automatically. - If **Active points deduction** setting is enabled, any points that were earned and activated when the session closed are rolled back. - If **Negative balance** is enabled, the rollback can create a negative points balance.
Effects and budgets unimpacted by a session reopening

The following effects and budgets remain in the state they were in when the session closed:

  • Add free item effect
  • Award giveaway
  • Coupon and referral creation
  • Coupon reservation
  • Custom effect
  • Update attribute value
  • Update cart item attribute value
To see an example of a rollback, see the [Cancelling a session with campaign budgets](https://docs.talon.one/docs/dev/tutorials/rolling-back-effects) tutorial. > [!note] If your order workflow requires you to create a new session > instead of reopening a session, use the > [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) > endpoint to cancel a closed session and create a new one. + Reopen a closed [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). For example, if a session has been completed but still needs to be edited, you can reopen it with this endpoint. A reopen session is treated like a standard open session. When reopening a session: - The `talon_session_reopened` event is triggered. You can see it in the **Events** view in the Campaign Manager. - The session state is updated to `open`. - Any modified budgets and triggered effects are rolled back when the session closes. - Depending on the [return policy](https://docs.talon.one/docs/product/loyalty-programs/managing-loyalty-programs#return-policy) in your loyalty programs, points are rolled back in the following ways: - Pending points are rolled back automatically. - If **Active points deduction** setting is enabled, any points that were earned and activated when the session closed are rolled back. - If **Negative balance** is enabled, the rollback can create a negative points balance.
Effects and budgets unimpacted by a session reopening

The following effects and budgets remain in the state they were in when the session closed:

  • Add free item effect
  • Award giveaway
  • Coupon and referral creation
  • Coupon reservation
  • Custom effect
  • Update attribute value
  • Update cart item attribute value
To see an example of a rollback, see the [Cancelling a session with campaign budgets](https://docs.talon.one/docs/dev/tutorials/rolling-back-effects) tutorial. > [!note] If your order workflow requires you to create a new session > instead of reopening a session, use the > [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) > endpoint to cancel a closed session and create a new one. > [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: > - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. > - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. > - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) :type customer_session_id: str @@ -9014,7 +9014,7 @@ def reopen_customer_session_with_http_info( ) -> ApiResponse[ReopenSessionResponse]: """Reopen customer session - Reopen a closed [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). For example, if a session has been completed but still needs to be edited, you can reopen it with this endpoint. A reopen session is treated like a standard open session. When reopening a session: - The `talon_session_reopened` event is triggered. You can see it in the **Events** view in the Campaign Manager. - The session state is updated to `open`. - Any modified budgets and triggered effects are rolled back when the session closes. - Depending on the [return policy](https://docs.talon.one/docs/product/loyalty-programs/managing-loyalty-programs#return-policy) in your loyalty programs, points are rolled back in the following ways: - Pending points are rolled back automatically. - If **Active points deduction** setting is enabled, any points that were earned and activated when the session closed are rolled back. - If **Negative balance** is enabled, the rollback can create a negative points balance.
Effects and budgets unimpacted by a session reopening

The following effects and budgets remain in the state they were in when the session closed:

  • Add free item effect
  • Award giveaway
  • Coupon and referral creation
  • Coupon reservation
  • Custom effect
  • Update attribute value
  • Update cart item attribute value
To see an example of a rollback, see the [Cancelling a session with campaign budgets](https://docs.talon.one/docs/dev/tutorials/rolling-back-effects) tutorial. > [!note] If your order workflow requires you to create a new session > instead of reopening a session, use the > [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) > endpoint to cancel a closed session and create a new one. + Reopen a closed [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). For example, if a session has been completed but still needs to be edited, you can reopen it with this endpoint. A reopen session is treated like a standard open session. When reopening a session: - The `talon_session_reopened` event is triggered. You can see it in the **Events** view in the Campaign Manager. - The session state is updated to `open`. - Any modified budgets and triggered effects are rolled back when the session closes. - Depending on the [return policy](https://docs.talon.one/docs/product/loyalty-programs/managing-loyalty-programs#return-policy) in your loyalty programs, points are rolled back in the following ways: - Pending points are rolled back automatically. - If **Active points deduction** setting is enabled, any points that were earned and activated when the session closed are rolled back. - If **Negative balance** is enabled, the rollback can create a negative points balance.
Effects and budgets unimpacted by a session reopening

The following effects and budgets remain in the state they were in when the session closed:

  • Add free item effect
  • Award giveaway
  • Coupon and referral creation
  • Coupon reservation
  • Custom effect
  • Update attribute value
  • Update cart item attribute value
To see an example of a rollback, see the [Cancelling a session with campaign budgets](https://docs.talon.one/docs/dev/tutorials/rolling-back-effects) tutorial. > [!note] If your order workflow requires you to create a new session > instead of reopening a session, use the > [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) > endpoint to cancel a closed session and create a new one. > [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: > - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. > - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. > - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) :type customer_session_id: str @@ -9083,7 +9083,7 @@ def reopen_customer_session_without_preload_content( ) -> RESTResponseType: """Reopen customer session - Reopen a closed [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). For example, if a session has been completed but still needs to be edited, you can reopen it with this endpoint. A reopen session is treated like a standard open session. When reopening a session: - The `talon_session_reopened` event is triggered. You can see it in the **Events** view in the Campaign Manager. - The session state is updated to `open`. - Any modified budgets and triggered effects are rolled back when the session closes. - Depending on the [return policy](https://docs.talon.one/docs/product/loyalty-programs/managing-loyalty-programs#return-policy) in your loyalty programs, points are rolled back in the following ways: - Pending points are rolled back automatically. - If **Active points deduction** setting is enabled, any points that were earned and activated when the session closed are rolled back. - If **Negative balance** is enabled, the rollback can create a negative points balance.
Effects and budgets unimpacted by a session reopening

The following effects and budgets remain in the state they were in when the session closed:

  • Add free item effect
  • Award giveaway
  • Coupon and referral creation
  • Coupon reservation
  • Custom effect
  • Update attribute value
  • Update cart item attribute value
To see an example of a rollback, see the [Cancelling a session with campaign budgets](https://docs.talon.one/docs/dev/tutorials/rolling-back-effects) tutorial. > [!note] If your order workflow requires you to create a new session > instead of reopening a session, use the > [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) > endpoint to cancel a closed session and create a new one. + Reopen a closed [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). For example, if a session has been completed but still needs to be edited, you can reopen it with this endpoint. A reopen session is treated like a standard open session. When reopening a session: - The `talon_session_reopened` event is triggered. You can see it in the **Events** view in the Campaign Manager. - The session state is updated to `open`. - Any modified budgets and triggered effects are rolled back when the session closes. - Depending on the [return policy](https://docs.talon.one/docs/product/loyalty-programs/managing-loyalty-programs#return-policy) in your loyalty programs, points are rolled back in the following ways: - Pending points are rolled back automatically. - If **Active points deduction** setting is enabled, any points that were earned and activated when the session closed are rolled back. - If **Negative balance** is enabled, the rollback can create a negative points balance.
Effects and budgets unimpacted by a session reopening

The following effects and budgets remain in the state they were in when the session closed:

  • Add free item effect
  • Award giveaway
  • Coupon and referral creation
  • Coupon reservation
  • Custom effect
  • Update attribute value
  • Update cart item attribute value
To see an example of a rollback, see the [Cancelling a session with campaign budgets](https://docs.talon.one/docs/dev/tutorials/rolling-back-effects) tutorial. > [!note] If your order workflow requires you to create a new session > instead of reopening a session, use the > [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) > endpoint to cancel a closed session and create a new one. > [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: > - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. > - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. > - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) :type customer_session_id: str @@ -9842,7 +9842,7 @@ def track_event_v2( ) -> IntegrationEventV2Response: """Track event - Trigger 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. + Trigger 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. > [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: > - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. > - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. > - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. :param integration_event_v2_request: body (required) :type integration_event_v2_request: IntegrationEventV2Request @@ -9890,7 +9890,7 @@ def track_event_v2( '204': "str", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerSessionV2409Response", + '409': "UpdateCustomerProfileV2409Response", } response_data = self.api_client.call_api( *_param, @@ -9925,7 +9925,7 @@ def track_event_v2_with_http_info( ) -> ApiResponse[IntegrationEventV2Response]: """Track event - Trigger 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. + Trigger 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. > [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: > - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. > - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. > - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. :param integration_event_v2_request: body (required) :type integration_event_v2_request: IntegrationEventV2Request @@ -9973,7 +9973,7 @@ def track_event_v2_with_http_info( '204': "str", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerSessionV2409Response", + '409': "UpdateCustomerProfileV2409Response", } response_data = self.api_client.call_api( *_param, @@ -10008,7 +10008,7 @@ def track_event_v2_without_preload_content( ) -> RESTResponseType: """Track event - Trigger 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. + Trigger 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. > [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: > - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. > - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. > - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. :param integration_event_v2_request: body (required) :type integration_event_v2_request: IntegrationEventV2Request @@ -10056,7 +10056,7 @@ def track_event_v2_without_preload_content( '204': "str", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerSessionV2409Response", + '409': "UpdateCustomerProfileV2409Response", } response_data = self.api_client.call_api( *_param, @@ -10226,7 +10226,7 @@ def track_event_v3( '200': "IntegrationEventV3Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerSessionV2409Response", + '409': "UpdateCustomerProfileV2409Response", } response_data = self.api_client.call_api( *_param, @@ -10308,7 +10308,7 @@ def track_event_v3_with_http_info( '200': "IntegrationEventV3Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerSessionV2409Response", + '409': "UpdateCustomerProfileV2409Response", } response_data = self.api_client.call_api( *_param, @@ -10390,7 +10390,7 @@ def track_event_v3_without_preload_content( '200': "IntegrationEventV3Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerSessionV2409Response", + '409': "UpdateCustomerProfileV2409Response", } response_data = self.api_client.call_api( *_param, @@ -11699,7 +11699,7 @@ def update_customer_profile_v2( ) -> CustomerProfileIntegrationResponseV2: """Update customer profile - Update or create a [Customer Profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles). This endpoint triggers the Rule Builder. You can use this endpoint to: - Set attributes on the given customer profile. Ensure you create the attributes in the Campaign Manager, first. - Modify the audience the customer profile is a member of. > [!note] **Note** > - Updating a customer profile returns a response with the requested integration state. > - You can use the `responseContent` property to save yourself extra API calls. For example, you can get > the customer profile details directly without extra requests. > - We recommend sending requests sequentially. > See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation when `runRuleEngine` is `true`. + Update or create a [Customer Profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles). This endpoint triggers the Rule Builder. You can use this endpoint to: - Set attributes on the given customer profile. Ensure you create the attributes in the Campaign Manager, first. - Modify the audience the customer profile is a member of. > [!note] **Note** > - Updating a customer profile returns a response with the requested integration state. > - You can use the `responseContent` property to save yourself extra API calls. For example, you can get > the customer profile details directly without extra requests. > - We recommend sending requests sequentially. > See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation when `runRuleEngine` is `true`. > [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: > - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. > - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. > - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. **Note**: It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). (required) :type integration_id: str @@ -11746,7 +11746,7 @@ def update_customer_profile_v2( '200': "CustomerProfileIntegrationResponseV2", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerSessionV2409Response", + '409': "UpdateCustomerProfileV2409Response", } response_data = self.api_client.call_api( *_param, @@ -11781,7 +11781,7 @@ def update_customer_profile_v2_with_http_info( ) -> ApiResponse[CustomerProfileIntegrationResponseV2]: """Update customer profile - Update or create a [Customer Profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles). This endpoint triggers the Rule Builder. You can use this endpoint to: - Set attributes on the given customer profile. Ensure you create the attributes in the Campaign Manager, first. - Modify the audience the customer profile is a member of. > [!note] **Note** > - Updating a customer profile returns a response with the requested integration state. > - You can use the `responseContent` property to save yourself extra API calls. For example, you can get > the customer profile details directly without extra requests. > - We recommend sending requests sequentially. > See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation when `runRuleEngine` is `true`. + Update or create a [Customer Profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles). This endpoint triggers the Rule Builder. You can use this endpoint to: - Set attributes on the given customer profile. Ensure you create the attributes in the Campaign Manager, first. - Modify the audience the customer profile is a member of. > [!note] **Note** > - Updating a customer profile returns a response with the requested integration state. > - You can use the `responseContent` property to save yourself extra API calls. For example, you can get > the customer profile details directly without extra requests. > - We recommend sending requests sequentially. > See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation when `runRuleEngine` is `true`. > [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: > - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. > - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. > - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. **Note**: It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). (required) :type integration_id: str @@ -11828,7 +11828,7 @@ def update_customer_profile_v2_with_http_info( '200': "CustomerProfileIntegrationResponseV2", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerSessionV2409Response", + '409': "UpdateCustomerProfileV2409Response", } response_data = self.api_client.call_api( *_param, @@ -11863,7 +11863,7 @@ def update_customer_profile_v2_without_preload_content( ) -> RESTResponseType: """Update customer profile - Update or create a [Customer Profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles). This endpoint triggers the Rule Builder. You can use this endpoint to: - Set attributes on the given customer profile. Ensure you create the attributes in the Campaign Manager, first. - Modify the audience the customer profile is a member of. > [!note] **Note** > - Updating a customer profile returns a response with the requested integration state. > - You can use the `responseContent` property to save yourself extra API calls. For example, you can get > the customer profile details directly without extra requests. > - We recommend sending requests sequentially. > See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation when `runRuleEngine` is `true`. + Update or create a [Customer Profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles). This endpoint triggers the Rule Builder. You can use this endpoint to: - Set attributes on the given customer profile. Ensure you create the attributes in the Campaign Manager, first. - Modify the audience the customer profile is a member of. > [!note] **Note** > - Updating a customer profile returns a response with the requested integration state. > - You can use the `responseContent` property to save yourself extra API calls. For example, you can get > the customer profile details directly without extra requests. > - We recommend sending requests sequentially. > See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation when `runRuleEngine` is `true`. > [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: > - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. > - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. > - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. **Note**: It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). (required) :type integration_id: str @@ -11910,7 +11910,7 @@ def update_customer_profile_v2_without_preload_content( '200': "CustomerProfileIntegrationResponseV2", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerSessionV2409Response", + '409': "UpdateCustomerProfileV2409Response", } response_data = self.api_client.call_api( *_param, @@ -12029,7 +12029,7 @@ def update_customer_profiles_v2( ) -> MultipleCustomerProfileIntegrationResponseV2: """Update multiple customer profiles - Update (or create) up to 1000 [customer profiles](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles) in 1 request. The `integrationId` must be any identifier that remains stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. A customer profile [can be linked to one or more sessions](https://docs.talon.one/integration-api#tag/Customer-sessions). > [!note] This endpoint does not trigger the Rule Engine. > To trigger the Rule Engine for customer profile updates, > use the [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint. + Update (or create) up to 1000 [customer profiles](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles) in 1 request. The `integrationId` must be any identifier that remains stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. A customer profile [can be linked to one or more sessions](https://docs.talon.one/integration-api#tag/Customer-sessions). > [!note] This endpoint does not trigger the Rule Engine. > To trigger the Rule Engine for customer profile updates, > use the [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint. > [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: > - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. > - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. > - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. :param multiple_customer_profile_integration_request: body (required) :type multiple_customer_profile_integration_request: MultipleCustomerProfileIntegrationRequest @@ -12103,7 +12103,7 @@ def update_customer_profiles_v2_with_http_info( ) -> ApiResponse[MultipleCustomerProfileIntegrationResponseV2]: """Update multiple customer profiles - Update (or create) up to 1000 [customer profiles](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles) in 1 request. The `integrationId` must be any identifier that remains stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. A customer profile [can be linked to one or more sessions](https://docs.talon.one/integration-api#tag/Customer-sessions). > [!note] This endpoint does not trigger the Rule Engine. > To trigger the Rule Engine for customer profile updates, > use the [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint. + Update (or create) up to 1000 [customer profiles](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles) in 1 request. The `integrationId` must be any identifier that remains stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. A customer profile [can be linked to one or more sessions](https://docs.talon.one/integration-api#tag/Customer-sessions). > [!note] This endpoint does not trigger the Rule Engine. > To trigger the Rule Engine for customer profile updates, > use the [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint. > [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: > - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. > - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. > - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. :param multiple_customer_profile_integration_request: body (required) :type multiple_customer_profile_integration_request: MultipleCustomerProfileIntegrationRequest @@ -12177,7 +12177,7 @@ def update_customer_profiles_v2_without_preload_content( ) -> RESTResponseType: """Update multiple customer profiles - Update (or create) up to 1000 [customer profiles](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles) in 1 request. The `integrationId` must be any identifier that remains stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. A customer profile [can be linked to one or more sessions](https://docs.talon.one/integration-api#tag/Customer-sessions). > [!note] This endpoint does not trigger the Rule Engine. > To trigger the Rule Engine for customer profile updates, > use the [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint. + Update (or create) up to 1000 [customer profiles](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles) in 1 request. The `integrationId` must be any identifier that remains stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. A customer profile [can be linked to one or more sessions](https://docs.talon.one/integration-api#tag/Customer-sessions). > [!note] This endpoint does not trigger the Rule Engine. > To trigger the Rule Engine for customer profile updates, > use the [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint. > [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: > - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. > - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. > - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. :param multiple_customer_profile_integration_request: body (required) :type multiple_customer_profile_integration_request: MultipleCustomerProfileIntegrationRequest @@ -12331,7 +12331,7 @@ def update_customer_session_v2( ) -> IntegrationStateV2: """Update customer session - Update or create a [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). The endpoint responds with the potential promotion rule [effects](https://docs.talon.one/docs/dev/integration-api/api-effects) that match the current cart. For example, use this endpoint to share the contents of a customer's cart with Talon.One. > [!note] **Note** > - The currency for the session and the cart items in it is the currency set for the Application linked to this session. > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered for rule evaluation. ### Session management To use this endpoint, start by learning about [customer sessions](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions) and their states and refer to the `state` parameter documentation the request body schema docs below. ### Sessions and customer profiles - To link a session to a customer profile, set the `profileId` parameter in the request body to a customer profile's `integrationId`. - While you can create an anonymous session with `profileId=\"\"`, we recommend you use a guest ID instead. - A profile can be linked to simultaneous sessions in different Applications. Either: - Use unique session integration IDs or, - Use the same session integration ID across all of the Applications. > [!note] **Note** > - If the specified profile does not exist, an empty profile is **created automatically**. > You can update it with [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2). > - Updating a customer session returns a response with the new integration state. Use the `responseContent` property to save yourself extra API calls. > For example, you can get the customer profile details directly without extra requests. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). For more information, see: - The introductory video in [Getting started](https://docs.talon.one/docs/dev/getting-started/overview). - The [integration tutorial](https://docs.talon.one/docs/dev/tutorials/integrating-talon-one). + Update or create a [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). The endpoint responds with the potential promotion rule [effects](https://docs.talon.one/docs/dev/integration-api/api-effects) that match the current cart. For example, use this endpoint to share the contents of a customer's cart with Talon.One. > [!note] **Note** > - The currency for the session and the cart items in it is the currency set for the Application linked to this session. > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered for rule evaluation. > [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: > - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. > - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. > - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. ### Session management To use this endpoint, start by learning about [customer sessions](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions) and their states and refer to the `state` parameter documentation the request body schema docs below. ### Sessions and customer profiles - To link a session to a customer profile, set the `profileId` parameter in the request body to a customer profile's `integrationId`. - While you can create an anonymous session with `profileId=\"\"`, we recommend you use a guest ID instead. - A profile can be linked to simultaneous sessions in different Applications. Either: - Use unique session integration IDs or, - Use the same session integration ID across all of the Applications. > [!note] **Note** > - If the specified profile does not exist, an empty profile is **created automatically**. > You can update it with [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2). > - Updating a customer session returns a response with the new integration state. Use the `responseContent` property to save yourself extra API calls. > For example, you can get the customer profile details directly without extra requests. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). For more information, see: - The introductory video in [Getting started](https://docs.talon.one/docs/dev/getting-started/overview). - The [integration tutorial](https://docs.talon.one/docs/dev/tutorials/integrating-talon-one). :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). (required) :type customer_session_id: str @@ -12413,7 +12413,7 @@ def update_customer_session_v2_with_http_info( ) -> ApiResponse[IntegrationStateV2]: """Update customer session - Update or create a [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). The endpoint responds with the potential promotion rule [effects](https://docs.talon.one/docs/dev/integration-api/api-effects) that match the current cart. For example, use this endpoint to share the contents of a customer's cart with Talon.One. > [!note] **Note** > - The currency for the session and the cart items in it is the currency set for the Application linked to this session. > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered for rule evaluation. ### Session management To use this endpoint, start by learning about [customer sessions](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions) and their states and refer to the `state` parameter documentation the request body schema docs below. ### Sessions and customer profiles - To link a session to a customer profile, set the `profileId` parameter in the request body to a customer profile's `integrationId`. - While you can create an anonymous session with `profileId=\"\"`, we recommend you use a guest ID instead. - A profile can be linked to simultaneous sessions in different Applications. Either: - Use unique session integration IDs or, - Use the same session integration ID across all of the Applications. > [!note] **Note** > - If the specified profile does not exist, an empty profile is **created automatically**. > You can update it with [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2). > - Updating a customer session returns a response with the new integration state. Use the `responseContent` property to save yourself extra API calls. > For example, you can get the customer profile details directly without extra requests. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). For more information, see: - The introductory video in [Getting started](https://docs.talon.one/docs/dev/getting-started/overview). - The [integration tutorial](https://docs.talon.one/docs/dev/tutorials/integrating-talon-one). + Update or create a [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). The endpoint responds with the potential promotion rule [effects](https://docs.talon.one/docs/dev/integration-api/api-effects) that match the current cart. For example, use this endpoint to share the contents of a customer's cart with Talon.One. > [!note] **Note** > - The currency for the session and the cart items in it is the currency set for the Application linked to this session. > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered for rule evaluation. > [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: > - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. > - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. > - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. ### Session management To use this endpoint, start by learning about [customer sessions](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions) and their states and refer to the `state` parameter documentation the request body schema docs below. ### Sessions and customer profiles - To link a session to a customer profile, set the `profileId` parameter in the request body to a customer profile's `integrationId`. - While you can create an anonymous session with `profileId=\"\"`, we recommend you use a guest ID instead. - A profile can be linked to simultaneous sessions in different Applications. Either: - Use unique session integration IDs or, - Use the same session integration ID across all of the Applications. > [!note] **Note** > - If the specified profile does not exist, an empty profile is **created automatically**. > You can update it with [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2). > - Updating a customer session returns a response with the new integration state. Use the `responseContent` property to save yourself extra API calls. > For example, you can get the customer profile details directly without extra requests. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). For more information, see: - The introductory video in [Getting started](https://docs.talon.one/docs/dev/getting-started/overview). - The [integration tutorial](https://docs.talon.one/docs/dev/tutorials/integrating-talon-one). :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). (required) :type customer_session_id: str @@ -12495,7 +12495,7 @@ def update_customer_session_v2_without_preload_content( ) -> RESTResponseType: """Update customer session - Update or create a [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). The endpoint responds with the potential promotion rule [effects](https://docs.talon.one/docs/dev/integration-api/api-effects) that match the current cart. For example, use this endpoint to share the contents of a customer's cart with Talon.One. > [!note] **Note** > - The currency for the session and the cart items in it is the currency set for the Application linked to this session. > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered for rule evaluation. ### Session management To use this endpoint, start by learning about [customer sessions](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions) and their states and refer to the `state` parameter documentation the request body schema docs below. ### Sessions and customer profiles - To link a session to a customer profile, set the `profileId` parameter in the request body to a customer profile's `integrationId`. - While you can create an anonymous session with `profileId=\"\"`, we recommend you use a guest ID instead. - A profile can be linked to simultaneous sessions in different Applications. Either: - Use unique session integration IDs or, - Use the same session integration ID across all of the Applications. > [!note] **Note** > - If the specified profile does not exist, an empty profile is **created automatically**. > You can update it with [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2). > - Updating a customer session returns a response with the new integration state. Use the `responseContent` property to save yourself extra API calls. > For example, you can get the customer profile details directly without extra requests. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). For more information, see: - The introductory video in [Getting started](https://docs.talon.one/docs/dev/getting-started/overview). - The [integration tutorial](https://docs.talon.one/docs/dev/tutorials/integrating-talon-one). + Update or create a [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). The endpoint responds with the potential promotion rule [effects](https://docs.talon.one/docs/dev/integration-api/api-effects) that match the current cart. For example, use this endpoint to share the contents of a customer's cart with Talon.One. > [!note] **Note** > - The currency for the session and the cart items in it is the currency set for the Application linked to this session. > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered for rule evaluation. > [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: > - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. > - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. > - Idempotency keys are typically UUID keys and should not exceed 255 characters in length. ### Session management To use this endpoint, start by learning about [customer sessions](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions) and their states and refer to the `state` parameter documentation the request body schema docs below. ### Sessions and customer profiles - To link a session to a customer profile, set the `profileId` parameter in the request body to a customer profile's `integrationId`. - While you can create an anonymous session with `profileId=\"\"`, we recommend you use a guest ID instead. - A profile can be linked to simultaneous sessions in different Applications. Either: - Use unique session integration IDs or, - Use the same session integration ID across all of the Applications. > [!note] **Note** > - If the specified profile does not exist, an empty profile is **created automatically**. > You can update it with [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2). > - Updating a customer session returns a response with the new integration state. Use the `responseContent` property to save yourself extra API calls. > For example, you can get the customer profile details directly without extra requests. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). For more information, see: - The introductory video in [Getting started](https://docs.talon.one/docs/dev/getting-started/overview). - The [integration tutorial](https://docs.talon.one/docs/dev/tutorials/integrating-talon-one). :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). (required) :type customer_session_id: str diff --git a/talon_one/api_client.py b/talon_one/api_client.py index a5c8148..b969377 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.14.0/python' + self.user_agent = 'OpenAPI-Generator/26.15.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): @@ -302,6 +302,12 @@ def response_deserialize( # if not found, look for '1XX', '2XX', etc. response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + # If the response_type has not matched (eg. did not match the previous if statements) and the default response is available, use it. + if response_type is None and str(response_data.status) not in response_types_map \ + and (not isinstance(response_data.status, int) or not 100 <= response_data.status <= 599 or str(response_data.status)[0] + "XX" not in response_types_map) \ + and 'default' in response_types_map: + response_type = response_types_map['default'] + # deserialize response data response_text = None return_data = None @@ -672,7 +678,16 @@ def _apply_auth_params( :param auth_setting: auth settings for the endpoint """ if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] + if not 'Cookie' in headers: + headers['Cookie'] = "" + else: + headers['Cookie'] += "; " + # Account for cookie value containing spaces and special characters + cookie_value = str(auth_setting['value']) + if not re.match("^\".*\"$", cookie_value): + cookie_value = cookie_value.replace("\"", "\\\"") + cookie_value = f"\"{cookie_value}\"" + headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': headers[auth_setting['key']] = auth_setting['value'] diff --git a/talon_one/configuration.py b/talon_one/configuration.py index 2dffbfb..12ad7e1 100644 --- a/talon_one/configuration.py +++ b/talon_one/configuration.py @@ -17,6 +17,8 @@ import multiprocessing import sys from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union +from urllib.parse import urlparse +from urllib.request import getproxies from typing_extensions import NotRequired, Self import urllib3 @@ -169,6 +171,7 @@ class Configuration: :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync. :param proxy: Proxy URL. + :param no_proxy: Comma-separated hosts that bypass the proxy. :param proxy_headers: Proxy headers. :param safe_chars_for_path_param: Safe characters for path parameter encoding. :param client_side_validation: Enable client-side validation. Default True. @@ -223,6 +226,7 @@ def __init__( tls_server_name: Optional[str]=None, connection_pool_maxsize: Optional[int]=None, proxy: Optional[str]=None, + no_proxy: Optional[str]=None, proxy_headers: Optional[Any]=None, safe_chars_for_path_param: str='', client_side_validation: bool=True, @@ -329,9 +333,21 @@ def __init__( per pool. None in the constructor is coerced to cpu_count * 5. """ + # urllib3 does not read proxy environment variables itself: + # https://github.com/urllib3/urllib3/issues/1785 + if proxy is None or no_proxy is None: + proxies = getproxies() + if proxy is None: + scheme = urlparse(self.host).scheme + proxy = proxies.get(scheme) or proxies.get("all") + if no_proxy is None: + no_proxy = proxies.get("no") self.proxy = proxy """Proxy URL """ + self.no_proxy = no_proxy + """Hosts that bypass the proxy + """ self.proxy_headers = proxy_headers """Proxy headers """ @@ -365,9 +381,9 @@ def __deepcopy__(self, memo: Dict[int, Any]) -> Self: setattr(result, k, copy.deepcopy(v, memo)) # shallow copy of loggers result.logger = copy.copy(self.logger) - # use setters to configure loggers + # use setter to re-create the file handler (excluded from __dict__ copy) result.logger_file = self.logger_file - result.debug = self.debug + return result def __setattr__(self, name: str, value: Any) -> None: @@ -504,7 +520,8 @@ def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> self.refresh_api_key_hook(self) key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) if key: - prefix = self.api_key_prefix.get(identifier) + prefix = self.api_key_prefix.get( + identifier, self.api_key_prefix.get(alias) if alias is not None else None) if prefix: return "%s %s" % (prefix, key) else: @@ -554,7 +571,7 @@ def to_debug_report(self) -> str: "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: \n"\ - "SDK Package Version: 26.14.0".\ + "SDK Package Version: 26.15.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 9df67d2..219ad7b 100644 --- a/talon_one/models/__init__.py +++ b/talon_one/models/__init__.py @@ -74,7 +74,6 @@ from talon_one.models.application_customer_entity import ApplicationCustomerEntity from talon_one.models.application_entity import ApplicationEntity from talon_one.models.application_event import ApplicationEvent -from talon_one.models.application_notification import ApplicationNotification from talon_one.models.application_referee import ApplicationReferee from talon_one.models.application_session import ApplicationSession from talon_one.models.application_session_entity import ApplicationSessionEntity @@ -100,6 +99,7 @@ from talon_one.models.base_loyalty_program import BaseLoyaltyProgram from talon_one.models.base_notification import BaseNotification from talon_one.models.base_notification_entity import BaseNotificationEntity +from talon_one.models.base_notification_policy import BaseNotificationPolicy from talon_one.models.base_notification_webhook import BaseNotificationWebhook from talon_one.models.base_notifications import BaseNotifications from talon_one.models.base_saml_connection import BaseSamlConnection @@ -108,7 +108,6 @@ from talon_one.models.best_prior_price_request import BestPriorPriceRequest from talon_one.models.best_prior_price_settings import BestPriorPriceSettings from talon_one.models.best_prior_target import BestPriorTarget -from talon_one.models.between_check_attribute_block import BetweenCheckAttributeBlock from talon_one.models.binding import Binding from talon_one.models.blueprint import Blueprint from talon_one.models.bulk_application_notification import BulkApplicationNotification @@ -176,6 +175,12 @@ 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_action_one_of import CatalogActionOneOf +from talon_one.models.catalog_action_one_of1 import CatalogActionOneOf1 +from talon_one.models.catalog_action_one_of2 import CatalogActionOneOf2 +from talon_one.models.catalog_action_one_of3 import CatalogActionOneOf3 +from talon_one.models.catalog_action_one_of4 import CatalogActionOneOf4 +from talon_one.models.catalog_action_one_of5 import CatalogActionOneOf5 from talon_one.models.catalog_item import CatalogItem from talon_one.models.catalog_rule import CatalogRule from talon_one.models.catalog_sync_request import CatalogSyncRequest @@ -183,7 +188,7 @@ from talon_one.models.change import Change from talon_one.models.change_loyalty_tier_level_effect_props import ChangeLoyaltyTierLevelEffectProps from talon_one.models.change_profile_password import ChangeProfilePassword -from talon_one.models.check_attribute_block import CheckAttributeBlock +from talon_one.models.check_attribute_block_base import CheckAttributeBlockBase from talon_one.models.check_audience_block import CheckAudienceBlock from talon_one.models.check_audience_block1_audience import CheckAudienceBlock1Audience from talon_one.models.check_coupon_block import CheckCouponBlock @@ -192,6 +197,7 @@ from talon_one.models.collection import Collection from talon_one.models.collection_item import CollectionItem from talon_one.models.collection_without_payload import CollectionWithoutPayload +from talon_one.models.confirm_risks_request import ConfirmRisksRequest from talon_one.models.coupon import Coupon from talon_one.models.coupon_constraints import CouponConstraints from talon_one.models.coupon_created_effect_props import CouponCreatedEffectProps @@ -230,6 +236,7 @@ from talon_one.models.customer_profile_entity import CustomerProfileEntity from talon_one.models.customer_profile_integration_request_v2 import CustomerProfileIntegrationRequestV2 from talon_one.models.customer_profile_integration_response_v2 import CustomerProfileIntegrationResponseV2 +from talon_one.models.customer_profile_reward import CustomerProfileReward from talon_one.models.customer_profile_search_query import CustomerProfileSearchQuery from talon_one.models.customer_profile_update_v2_response import CustomerProfileUpdateV2Response from talon_one.models.customer_session import CustomerSession @@ -240,8 +247,12 @@ from talon_one.models.delete_coupons_data import DeleteCouponsData from talon_one.models.delete_loyalty_transactions_request import DeleteLoyaltyTransactionsRequest from talon_one.models.delete_user_request import DeleteUserRequest +from talon_one.models.digital_pass import DigitalPass +from talon_one.models.discard_risks_request import DiscardRisksRequest from talon_one.models.effect import Effect +from talon_one.models.effect_all_of_props import EffectAllOfProps from talon_one.models.effect_entity import EffectEntity +from talon_one.models.effect_props import EffectProps from talon_one.models.email_entity import EmailEntity from talon_one.models.embedded_analytics_configuration import EmbeddedAnalyticsConfiguration from talon_one.models.embedded_analytics_configuration_dashboards import EmbeddedAnalyticsConfigurationDashboards @@ -396,6 +407,7 @@ from talon_one.models.integration_hub_flow_response import IntegrationHubFlowResponse from talon_one.models.integration_hub_flow_with_config import IntegrationHubFlowWithConfig from talon_one.models.integration_hub_paginated_event_payload import IntegrationHubPaginatedEventPayload +from talon_one.models.integration_hub_paginated_event_payload_data_inner import IntegrationHubPaginatedEventPayloadDataInner from talon_one.models.integration_profile_entity import IntegrationProfileEntity from talon_one.models.integration_profile_entity_v3 import IntegrationProfileEntityV3 from talon_one.models.integration_request import IntegrationRequest @@ -406,6 +418,7 @@ from talon_one.models.inventory_coupon import InventoryCoupon from talon_one.models.inventory_referral import InventoryReferral from talon_one.models.item_attribute import ItemAttribute +from talon_one.models.label_target import LabelTarget from talon_one.models.label_target_audience import LabelTargetAudience from talon_one.models.label_target_none import LabelTargetNone from talon_one.models.ledger_entry import LedgerEntry @@ -423,10 +436,8 @@ from talon_one.models.list_campaign_store_budgets import ListCampaignStoreBudgets from talon_one.models.list_campaign_store_budgets_store import ListCampaignStoreBudgetsStore from talon_one.models.list_catalog_items200_response import ListCatalogItems200Response -from talon_one.models.list_check_attribute_block import ListCheckAttributeBlock from talon_one.models.list_experiments200_response import ListExperiments200Response from talon_one.models.list_stores200_response import ListStores200Response -from talon_one.models.list_with_count_check_attribute_block import ListWithCountCheckAttributeBlock from talon_one.models.login_params import LoginParams from talon_one.models.loyalty import Loyalty from talon_one.models.loyalty_balance import LoyaltyBalance @@ -455,6 +466,8 @@ from talon_one.models.loyalty_sub_ledger import LoyaltySubLedger from talon_one.models.loyalty_tier import LoyaltyTier from talon_one.models.mcp_key import MCPKey +from talon_one.models.mcpo_auth_protected_resource import MCPOAuthProtectedResource +from talon_one.models.mcpo_auth_server_metadata import MCPOAuthServerMetadata from talon_one.models.management_key import ManagementKey from talon_one.models.manager_config import ManagerConfig from talon_one.models.message_log_entries import MessageLogEntries @@ -505,6 +518,7 @@ from talon_one.models.new_customer_profile import NewCustomerProfile from talon_one.models.new_customer_session import NewCustomerSession from talon_one.models.new_customer_session_v2 import NewCustomerSessionV2 +from talon_one.models.new_digital_pass import NewDigitalPass 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 @@ -555,6 +569,7 @@ from talon_one.models.outgoing_integration_braze_policy import OutgoingIntegrationBrazePolicy from talon_one.models.outgoing_integration_clever_tap_policy import OutgoingIntegrationCleverTapPolicy from talon_one.models.outgoing_integration_configuration import OutgoingIntegrationConfiguration +from talon_one.models.outgoing_integration_configuration_policy import OutgoingIntegrationConfigurationPolicy from talon_one.models.outgoing_integration_iterable_policy import OutgoingIntegrationIterablePolicy from talon_one.models.outgoing_integration_mo_engage_policy import OutgoingIntegrationMoEngagePolicy from talon_one.models.outgoing_integration_template import OutgoingIntegrationTemplate @@ -584,6 +599,7 @@ from talon_one.models.profile_audiences_changes import ProfileAudiencesChanges from talon_one.models.projected_tier import ProjectedTier from talon_one.models.promote_experiment import PromoteExperiment +from talon_one.models.promotion_block import PromotionBlock from talon_one.models.promotion_check_attribute_block import PromotionCheckAttributeBlock from talon_one.models.promotion_group_block import PromotionGroupBlock from talon_one.models.promotion_rule_v2 import PromotionRuleV2 @@ -602,6 +618,7 @@ from talon_one.models.response_content_object import ResponseContentObject from talon_one.models.return_integration_request import ReturnIntegrationRequest from talon_one.models.returned_cart_item import ReturnedCartItem +from talon_one.models.review_risks_request import ReviewRisksRequest from talon_one.models.revision import Revision from talon_one.models.revision_activation import RevisionActivation from talon_one.models.revision_activation_request import RevisionActivationRequest @@ -610,6 +627,7 @@ from talon_one.models.reward_points_required import RewardPointsRequired from talon_one.models.risk import Risk from talon_one.models.risk_affected_entity_item import RiskAffectedEntityItem +from talon_one.models.risk_criticality_update import RiskCriticalityUpdate from talon_one.models.risk_detail import RiskDetail from talon_one.models.risk_notification import RiskNotification from talon_one.models.role import Role @@ -643,7 +661,6 @@ from talon_one.models.saml_connection_internal import SamlConnectionInternal from talon_one.models.saml_connection_metadata import SamlConnectionMetadata from talon_one.models.saml_login_endpoint import SamlLoginEndpoint -from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock from talon_one.models.scim_base_group import ScimBaseGroup from talon_one.models.scim_base_user import ScimBaseUser from talon_one.models.scim_base_user_name import ScimBaseUserName @@ -661,6 +678,8 @@ from talon_one.models.scim_service_provider_config_response_bulk import ScimServiceProviderConfigResponseBulk from talon_one.models.scim_service_provider_config_response_change_password import ScimServiceProviderConfigResponseChangePassword from talon_one.models.scim_service_provider_config_response_filter import ScimServiceProviderConfigResponseFilter +from talon_one.models.scim_service_provider_config_response_patch import ScimServiceProviderConfigResponsePatch +from talon_one.models.scim_service_provider_config_response_sort import ScimServiceProviderConfigResponseSort from talon_one.models.scim_user import ScimUser from talon_one.models.scim_users_list_response import ScimUsersListResponse from talon_one.models.secondary_deployment import SecondaryDeployment @@ -677,11 +696,13 @@ from talon_one.models.sku_unit_analytics_data_point import SkuUnitAnalyticsDataPoint from talon_one.models.slot_def import SlotDef from talon_one.models.store import Store +from talon_one.models.strikethrough_block import StrikethroughBlock from talon_one.models.strikethrough_changed_item import StrikethroughChangedItem from talon_one.models.strikethrough_check_attribute_block import StrikethroughCheckAttributeBlock from talon_one.models.strikethrough_custom_effect_per_item_props import StrikethroughCustomEffectPerItemProps from talon_one.models.strikethrough_debug_response import StrikethroughDebugResponse from talon_one.models.strikethrough_effect import StrikethroughEffect +from talon_one.models.strikethrough_effect_props import StrikethroughEffectProps from talon_one.models.strikethrough_group_block import StrikethroughGroupBlock from talon_one.models.strikethrough_labeling_notification import StrikethroughLabelingNotification from talon_one.models.strikethrough_rule_v2 import StrikethroughRuleV2 @@ -712,15 +733,21 @@ from talon_one.models.transfer_loyalty_card import TransferLoyaltyCard from talon_one.models.trigger_webhook_effect_props import TriggerWebhookEffectProps from talon_one.models.two_fa_config import TwoFAConfig -from talon_one.models.unary_check_attribute_block import UnaryCheckAttributeBlock from talon_one.models.update_account import UpdateAccount from talon_one.models.update_achievement import UpdateAchievement +from talon_one.models.update_achievement_progress_block import UpdateAchievementProgressBlock +from talon_one.models.update_achievement_progress_block1_achievement import UpdateAchievementProgressBlock1Achievement from talon_one.models.update_achievement_v2 import UpdateAchievementV2 from talon_one.models.update_application import UpdateApplication from talon_one.models.update_application_api_key import UpdateApplicationAPIKey from talon_one.models.update_application_cif import UpdateApplicationCIF from talon_one.models.update_attribute_effect_props import UpdateAttributeEffectProps +from talon_one.models.update_attribute_value_block import UpdateAttributeValueBlock +from talon_one.models.update_attribute_value_block1_attribute import UpdateAttributeValueBlock1Attribute +from talon_one.models.update_attribute_value_block1_target import UpdateAttributeValueBlock1Target from talon_one.models.update_audience import UpdateAudience +from talon_one.models.update_audience_membership_block import UpdateAudienceMembershipBlock +from talon_one.models.update_audience_membership_block1_audience import UpdateAudienceMembershipBlock1Audience from talon_one.models.update_blueprint import UpdateBlueprint from talon_one.models.update_campaign import UpdateCampaign from talon_one.models.update_campaign_collection import UpdateCampaignCollection @@ -733,6 +760,7 @@ from talon_one.models.update_coupon_batch import UpdateCouponBatch from talon_one.models.update_coupons_data import UpdateCouponsData from talon_one.models.update_custom_effect import UpdateCustomEffect +from talon_one.models.update_customer_profile_v2409_response import UpdateCustomerProfileV2409Response from talon_one.models.update_customer_session_v2409_response import UpdateCustomerSessionV2409Response from talon_one.models.update_experiment import UpdateExperiment from talon_one.models.update_experiment_variant import UpdateExperimentVariant @@ -757,6 +785,10 @@ from talon_one.models.value_map import ValueMap from talon_one.models.webhook import Webhook from talon_one.models.webhook_authentication import WebhookAuthentication +from talon_one.models.webhook_authentication_all_of_data import WebhookAuthenticationAllOfData +from talon_one.models.webhook_authentication_base import WebhookAuthenticationBase +from talon_one.models.webhook_authentication_base_one_of import WebhookAuthenticationBaseOneOf +from talon_one.models.webhook_authentication_base_one_of1 import WebhookAuthenticationBaseOneOf1 from talon_one.models.webhook_authentication_data_basic import WebhookAuthenticationDataBasic from talon_one.models.webhook_authentication_data_custom import WebhookAuthenticationDataCustom from talon_one.models.webhook_authentication_webhook_ref import WebhookAuthenticationWebhookRef diff --git a/talon_one/models/account_additional_cost.py b/talon_one/models/account_additional_cost.py index af8cf3e..f430082 100644 --- a/talon_one/models/account_additional_cost.py +++ b/talon_one/models/account_additional_cost.py @@ -39,23 +39,17 @@ class AccountAdditionalCost(BaseModel): type: Optional[StrictStr] = Field(default='session', description="The type of additional cost. Possible value: - `session`: Additional cost will be added per session. - `item`: Additional cost will be added per item. - `both`: Additional cost will be added per item and session. ", json_schema_extra={"examples": ["session"]}) __properties: ClassVar[List[str]] = ["id", "created", "accountId", "name", "title", "description", "subscribedApplicationsIds", "type"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z]\w*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z]\w*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z]\w*$/") return value - @field_validator('title') + @field_validator('title', mode="before") def title_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z][A-Za-z0-9_.!~*\'() -]*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z][A-Za-z0-9_.!~*\'() -]*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z][A-Za-z0-9_.!~*'() -]*$/") return value diff --git a/talon_one/models/achievement.py b/talon_one/models/achievement.py index 8673519..150a684 100644 --- a/talon_one/models/achievement.py +++ b/talon_one/models/achievement.py @@ -50,13 +50,10 @@ class Achievement(BaseModel): status: Optional[StrictStr] = Field(default=None, description="The status of the achievement.", json_schema_extra={"examples": ["inprogress"]}) __properties: ClassVar[List[str]] = ["id", "created", "name", "title", "description", "target", "period", "periodEndOverride", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "campaignId", "userId", "createdBy", "hasProgress", "status"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[a-zA-Z]\w+$", value): + if isinstance(value, str) and not re.match(r"^[a-zA-Z]\w+$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z]\w+$/") return value diff --git a/talon_one/models/achievement_base.py b/talon_one/models/achievement_base.py index 995a98d..bb0e13c 100644 --- a/talon_one/models/achievement_base.py +++ b/talon_one/models/achievement_base.py @@ -43,16 +43,13 @@ class AchievementBase(BaseModel): allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="allowRollbackAfterCompletion", json_schema_extra={"examples": [False]}) __properties: ClassVar[List[str]] = ["name", "title", "description", "target", "period", "periodEndOverride", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion"] - @field_validator('name') + @field_validator('name', mode="before") 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) - - if not re.match(r"^[a-zA-Z]\w+$", value): + if isinstance(value, str) and not re.match(r"^[a-zA-Z]\w+$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z]\w+$/") return value diff --git a/talon_one/models/achievement_base_v2.py b/talon_one/models/achievement_base_v2.py index 8415c32..dd9185a 100644 --- a/talon_one/models/achievement_base_v2.py +++ b/talon_one/models/achievement_base_v2.py @@ -42,16 +42,13 @@ class AchievementBaseV2(BaseModel): 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", json_schema_extra={"examples": [[132, 97]]}) __properties: ClassVar[List[str]] = ["name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "subscribedApplications"] - @field_validator('name') + @field_validator('name', mode="before") 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) - - if not re.match(r"^[a-zA-Z]\w+$", value): + if isinstance(value, str) and not re.match(r"^[a-zA-Z]\w+$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z]\w+$/") return value diff --git a/talon_one/models/achievement_progress_with_definition.py b/talon_one/models/achievement_progress_with_definition.py index 155b437..1b43beb 100644 --- a/talon_one/models/achievement_progress_with_definition.py +++ b/talon_one/models/achievement_progress_with_definition.py @@ -54,13 +54,10 @@ def status_validate_enum(cls, value): raise ValueError("must be one of enum values ('inprogress', 'completed', 'expired', 'not_started')") return value - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[a-zA-Z]\w+$", value): + if isinstance(value, str) and not re.match(r"^[a-zA-Z]\w+$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z]\w+$/") return value diff --git a/talon_one/models/achievement_status_entry.py b/talon_one/models/achievement_status_entry.py index 743572b..81526f1 100644 --- a/talon_one/models/achievement_status_entry.py +++ b/talon_one/models/achievement_status_entry.py @@ -49,13 +49,10 @@ class AchievementStatusEntry(BaseModel): current_progress: Optional[AchievementProgress] = Field(default=None, alias="currentProgress") __properties: ClassVar[List[str]] = ["id", "created", "name", "title", "description", "target", "period", "periodEndOverride", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "campaignId", "status", "currentProgress"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[a-zA-Z]\w+$", value): + if isinstance(value, str) and not re.match(r"^[a-zA-Z]\w+$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z]\w+$/") return value diff --git a/talon_one/models/achievement_v2.py b/talon_one/models/achievement_v2.py index 6e14f45..ff07f04 100644 --- a/talon_one/models/achievement_v2.py +++ b/talon_one/models/achievement_v2.py @@ -52,13 +52,10 @@ class AchievementV2(BaseModel): timezone: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string containing an IANA timezone descriptor.", json_schema_extra={"examples": ["Europe/Berlin"]}) __properties: ClassVar[List[str]] = ["id", "created", "name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "subscribedApplications", "userId", "createdBy", "periodEndOverride", "hasProgress", "status", "sandbox", "timezone"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[a-zA-Z]\w+$", value): + if isinstance(value, str) and not re.match(r"^[a-zA-Z]\w+$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z]\w+$/") return value diff --git a/talon_one/models/add_loyalty_points_effect_props.py b/talon_one/models/add_loyalty_points_effect_props.py index c3aeb51..38cdc4a 100644 --- a/talon_one/models/add_loyalty_points_effect_props.py +++ b/talon_one/models/add_loyalty_points_effect_props.py @@ -47,16 +47,13 @@ class AddLoyaltyPointsEffectProps(BaseModel): validity_duration: Optional[StrictStr] = Field(default=None, description="The duration for which the points remain active, calculated relative to their start date.", alias="validityDuration") __properties: ClassVar[List[str]] = ["name", "programId", "subLedgerId", "value", "desiredValue", "recipientIntegrationId", "startDate", "expiryDate", "transactionUUID", "cartItemPosition", "cartItemSubPosition", "cardIdentifier", "bundleIndex", "bundleName", "awaitsActivation", "validityDuration"] - @field_validator('card_identifier') + @field_validator('card_identifier', mode="before") def card_identifier_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z0-9._%+@-]+$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z0-9._%+@-]+$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z0-9._%+@-]+$/") return value diff --git a/talon_one/models/application_event.py b/talon_one/models/application_event.py index ccf8c6d..4f0f3c2 100644 --- a/talon_one/models/application_event.py +++ b/talon_one/models/application_event.py @@ -40,7 +40,7 @@ class ApplicationEvent(BaseModel): 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", json_schema_extra={"examples": ["175KJPS947296"]}) 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="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 properties associated with this campaign.") + 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", "integrationId", "sessionId", "type", "attributes", "effects", "ruleFailureReasons"] diff --git a/talon_one/models/application_session.py b/talon_one/models/application_session.py index 3aade64..ab993e7 100644 --- a/talon_one/models/application_session.py +++ b/talon_one/models/application_session.py @@ -44,7 +44,7 @@ class ApplicationSession(BaseModel): discounts: Dict[str, Union[StrictFloat, StrictInt]] = Field(description="**API V1 only.** A map of labeled discount values, in the same currency as the session. If you are using the V2 endpoints, refer to the `totalDiscounts` property instead. ") total_discounts: Union[StrictFloat, StrictInt] = Field(description="The total sum of the discounts applied to this session. **Note:** If more than one session is returned, this value is displayed as `0`. ", alias="totalDiscounts", json_schema_extra={"examples": [100]}) total: Union[StrictFloat, StrictInt] = Field(description="The total sum of the session before any discounts applied.", json_schema_extra={"examples": [200]}) - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.") __properties: ClassVar[List[str]] = ["id", "created", "integrationId", "storeIntegrationId", "applicationId", "profileId", "profileintegrationid", "coupon", "referral", "state", "cartItems", "discounts", "totalDiscounts", "total", "attributes"] @field_validator('state') diff --git a/talon_one/models/attribute.py b/talon_one/models/attribute.py index b03b37b..ae6e928 100644 --- a/talon_one/models/attribute.py +++ b/talon_one/models/attribute.py @@ -55,23 +55,17 @@ def entity_validate_enum(cls, value): raise ValueError("must be one of enum values ('Application', 'Campaign', 'CustomerProfile', 'CustomerSession', 'CartItem', 'Coupon', 'Event', 'Giveaway', 'LoyaltyCard', 'Referral', 'Store')") return value - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z]\w*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z]\w*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z]\w*$/") return value - @field_validator('title') + @field_validator('title', mode="before") def title_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z][A-Za-z0-9_.!~*\'() -]*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z][A-Za-z0-9_.!~*\'() -]*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z][A-Za-z0-9_.!~*'() -]*$/") return value diff --git a/talon_one/models/award_giveaway_block.py b/talon_one/models/award_giveaway_block.py index 70b2032..171c092 100644 --- a/talon_one/models/award_giveaway_block.py +++ b/talon_one/models/award_giveaway_block.py @@ -33,8 +33,8 @@ class AwardGiveawayBlock(BaseModel): tags: Optional[List[StrictStr]] = Field(default=None, description="Semantic labels attached to this block.") giveaway_pool: AwardGiveawayBlock1GiveawayPool = Field(alias="giveawayPool") profile: StrictStr = Field(description="The customer profile to award the giveaway to. `Current` targets the customer in the current session; `Advocate` targets the person who invited their friend via referral program.", json_schema_extra={"examples": ["Current"]}) - on_failure: Optional[List[Any]] = Field(default=None, description="Blocks evaluated when this block fails or returns false.", alias="onFailure") - on_error: Optional[Dict[str, List[Any]]] = Field(default=None, description="Named error handlers evaluated when a specific error occurs.", alias="onError") + on_failure: Optional[List[PromotionBlock]] = Field(default=None, description="Blocks evaluated when this block fails or returns false.", alias="onFailure") + on_error: Optional[Dict[str, List[PromotionBlock]]] = Field(default=None, description="Named error handlers evaluated when a specific error occurs.", alias="onError") __properties: ClassVar[List[str]] = ["id", "type", "tags", "giveawayPool", "profile", "onFailure", "onError"] @field_validator('profile') @@ -86,6 +86,22 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of giveaway_pool if self.giveaway_pool: _dict['giveawayPool'] = self.giveaway_pool.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in on_failure (list) + _items = [] + if self.on_failure: + for _item_on_failure in self.on_failure: + if _item_on_failure: + _items.append(_item_on_failure.to_dict()) + _dict['onFailure'] = _items + # override the default output from pydantic by calling `to_dict()` of each value in on_error (dict of array) + _field_dict_of_array = {} + if self.on_error: + for _key_on_error in self.on_error: + if self.on_error[_key_on_error] is not None: + _field_dict_of_array[_key_on_error] = [ + _item.to_dict() for _item in self.on_error[_key_on_error] + ] + _dict['onError'] = _field_dict_of_array return _dict @classmethod @@ -103,9 +119,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "tags": obj.get("tags"), "giveawayPool": AwardGiveawayBlock1GiveawayPool.from_dict(obj["giveawayPool"]) if obj.get("giveawayPool") is not None else None, "profile": obj.get("profile"), - "onFailure": obj.get("onFailure"), - "onError": obj.get("onError") + "onFailure": [PromotionBlock.from_dict(_item) for _item in obj["onFailure"]] if obj.get("onFailure") is not None else None, + "onError": { + _k: [PromotionBlock.from_dict(_item) for _item in _v] if _v is not None else None + for _k, _v in obj["onError"].items() + } + if obj.get("onError") is not None + else None }) return _obj +from talon_one.models.promotion_block import PromotionBlock +# TODO: Rewrite to not use raise_errors +AwardGiveawayBlock.model_rebuild(raise_errors=False) diff --git a/talon_one/models/award_item_block.py b/talon_one/models/award_item_block.py index c288b3d..08eb43c 100644 --- a/talon_one/models/award_item_block.py +++ b/talon_one/models/award_item_block.py @@ -34,8 +34,8 @@ class AwardItemBlock(BaseModel): name: StrictStr = Field(description="The display name of the item to award.", json_schema_extra={"examples": ["Free Tote Bag"]}) quantity: StrictStr = Field(description="The number of items to award. Supports template placeholders (e.g. \"{{$Session.Total / 2}}\") for dynamic quantities.", json_schema_extra={"examples": ["1"]}) partial: Optional[StrictBool] = Field(default=None, description="When set to `true`, applies a partial item reward if the remaining budget is insufficient to award the full reward.", json_schema_extra={"examples": [False]}) - on_failure: Optional[List[Any]] = Field(default=None, description="Blocks evaluated when this block fails or returns false.", alias="onFailure") - on_error: Optional[Dict[str, List[Any]]] = Field(default=None, description="Named error handlers evaluated when a specific error occurs.", alias="onError") + on_failure: Optional[List[PromotionBlock]] = Field(default=None, description="Blocks evaluated when this block fails or returns false.", alias="onFailure") + on_error: Optional[Dict[str, List[PromotionBlock]]] = Field(default=None, description="Named error handlers evaluated when a specific error occurs.", alias="onError") __properties: ClassVar[List[str]] = ["id", "type", "tags", "sku", "name", "quantity", "partial", "onFailure", "onError"] model_config = ConfigDict( @@ -77,6 +77,22 @@ 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 on_failure (list) + _items = [] + if self.on_failure: + for _item_on_failure in self.on_failure: + if _item_on_failure: + _items.append(_item_on_failure.to_dict()) + _dict['onFailure'] = _items + # override the default output from pydantic by calling `to_dict()` of each value in on_error (dict of array) + _field_dict_of_array = {} + if self.on_error: + for _key_on_error in self.on_error: + if self.on_error[_key_on_error] is not None: + _field_dict_of_array[_key_on_error] = [ + _item.to_dict() for _item in self.on_error[_key_on_error] + ] + _dict['onError'] = _field_dict_of_array return _dict @classmethod @@ -96,9 +112,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "quantity": obj.get("quantity"), "partial": obj.get("partial"), - "onFailure": obj.get("onFailure"), - "onError": obj.get("onError") + "onFailure": [PromotionBlock.from_dict(_item) for _item in obj["onFailure"]] if obj.get("onFailure") is not None else None, + "onError": { + _k: [PromotionBlock.from_dict(_item) for _item in _v] if _v is not None else None + for _k, _v in obj["onError"].items() + } + if obj.get("onError") is not None + else None }) return _obj +from talon_one.models.promotion_block import PromotionBlock +# TODO: Rewrite to not use raise_errors +AwardItemBlock.model_rebuild(raise_errors=False) diff --git a/talon_one/models/base_notification.py b/talon_one/models/base_notification.py index 9f4f298..2ce64c5 100644 --- a/talon_one/models/base_notification.py +++ b/talon_one/models/base_notification.py @@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from talon_one.models.base_notification_policy import BaseNotificationPolicy from talon_one.models.base_notification_webhook import BaseNotificationWebhook from typing import Optional, Set from typing_extensions import Self @@ -29,7 +30,7 @@ class BaseNotification(BaseModel): """ BaseNotification """ # noqa: E501 - policy: Dict[str, Any] = Field(description="Indicates which notification properties to apply.") + policy: BaseNotificationPolicy enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether the notification is activated.") webhook: BaseNotificationWebhook id: Annotated[int, Field(strict=True, ge=1)] = Field(description="Unique ID for this entity.", json_schema_extra={"examples": [6]}) @@ -82,6 +83,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of policy + if self.policy: + _dict['policy'] = self.policy.to_dict() # override the default output from pydantic by calling `to_dict()` of webhook if self.webhook: _dict['webhook'] = self.webhook.to_dict() @@ -97,7 +101,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "policy": obj.get("policy"), + "policy": BaseNotificationPolicy.from_dict(obj["policy"]) if obj.get("policy") is not None else None, "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, "webhook": BaseNotificationWebhook.from_dict(obj["webhook"]) if obj.get("webhook") is not None else None, "id": obj.get("id"), diff --git a/talon_one/models/base_notification_entity.py b/talon_one/models/base_notification_entity.py index 962ef28..631ada9 100644 --- a/talon_one/models/base_notification_entity.py +++ b/talon_one/models/base_notification_entity.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.base_notification_policy import BaseNotificationPolicy from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -27,7 +28,7 @@ class BaseNotificationEntity(BaseModel): """ BaseNotificationEntity """ # noqa: E501 - policy: Dict[str, Any] = Field(description="Indicates which notification properties to apply.") + policy: BaseNotificationPolicy enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether the notification is activated.") __properties: ClassVar[List[str]] = ["policy", "enabled"] @@ -70,6 +71,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of policy + if self.policy: + _dict['policy'] = self.policy.to_dict() return _dict @classmethod @@ -82,7 +86,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "policy": obj.get("policy"), + "policy": BaseNotificationPolicy.from_dict(obj["policy"]) if obj.get("policy") is not None else None, "enabled": obj.get("enabled") if obj.get("enabled") is not None else True }) return _obj diff --git a/talon_one/models/base_notification_policy.py b/talon_one/models/base_notification_policy.py new file mode 100644 index 0000000..786e9e1 --- /dev/null +++ b/talon_one/models/base_notification_policy.py @@ -0,0 +1,305 @@ +# 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from talon_one.models.added_deducted_points_balances_notification_policy import AddedDeductedPointsBalancesNotificationPolicy +from talon_one.models.added_deducted_points_notification_policy import AddedDeductedPointsNotificationPolicy +from talon_one.models.campaign_notification_policy import CampaignNotificationPolicy +from talon_one.models.card_added_deducted_points_balances_notification_policy import CardAddedDeductedPointsBalancesNotificationPolicy +from talon_one.models.card_added_deducted_points_notification_policy import CardAddedDeductedPointsNotificationPolicy +from talon_one.models.card_expiring_points_notification_policy import CardExpiringPointsNotificationPolicy +from talon_one.models.catalogs_strikethrough_notification_policy import CatalogsStrikethroughNotificationPolicy +from talon_one.models.coupons_notification_policy import CouponsNotificationPolicy +from talon_one.models.expiring_coupons_notification_policy import ExpiringCouponsNotificationPolicy +from talon_one.models.expiring_points_notification_policy import ExpiringPointsNotificationPolicy +from talon_one.models.pending_points_notification_policy import PendingPointsNotificationPolicy +from talon_one.models.tier_downgrade_notification_policy import TierDowngradeNotificationPolicy +from talon_one.models.tier_upgrade_notification_policy import TierUpgradeNotificationPolicy +from talon_one.models.tier_will_downgrade_notification_policy import TierWillDowngradeNotificationPolicy +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +BASENOTIFICATIONPOLICY_ONE_OF_SCHEMAS = ["AddedDeductedPointsBalancesNotificationPolicy", "AddedDeductedPointsNotificationPolicy", "CampaignNotificationPolicy", "CardAddedDeductedPointsBalancesNotificationPolicy", "CardAddedDeductedPointsNotificationPolicy", "CardExpiringPointsNotificationPolicy", "CatalogsStrikethroughNotificationPolicy", "CouponsNotificationPolicy", "ExpiringCouponsNotificationPolicy", "ExpiringPointsNotificationPolicy", "PendingPointsNotificationPolicy", "TierDowngradeNotificationPolicy", "TierUpgradeNotificationPolicy", "TierWillDowngradeNotificationPolicy"] + +class BaseNotificationPolicy(BaseModel): + """ + Indicates which notification properties to apply. + """ + # data type: ExpiringCouponsNotificationPolicy + oneof_schema_1_validator: Optional[ExpiringCouponsNotificationPolicy] = None + # data type: CardExpiringPointsNotificationPolicy + oneof_schema_2_validator: Optional[CardExpiringPointsNotificationPolicy] = None + # data type: ExpiringPointsNotificationPolicy + oneof_schema_3_validator: Optional[ExpiringPointsNotificationPolicy] = None + # data type: AddedDeductedPointsNotificationPolicy + oneof_schema_4_validator: Optional[AddedDeductedPointsNotificationPolicy] = None + # data type: CardAddedDeductedPointsNotificationPolicy + oneof_schema_5_validator: Optional[CardAddedDeductedPointsNotificationPolicy] = None + # data type: AddedDeductedPointsBalancesNotificationPolicy + oneof_schema_6_validator: Optional[AddedDeductedPointsBalancesNotificationPolicy] = None + # data type: CardAddedDeductedPointsBalancesNotificationPolicy + oneof_schema_7_validator: Optional[CardAddedDeductedPointsBalancesNotificationPolicy] = None + # data type: CouponsNotificationPolicy + oneof_schema_8_validator: Optional[CouponsNotificationPolicy] = None + # data type: CatalogsStrikethroughNotificationPolicy + oneof_schema_9_validator: Optional[CatalogsStrikethroughNotificationPolicy] = None + # data type: PendingPointsNotificationPolicy + oneof_schema_10_validator: Optional[PendingPointsNotificationPolicy] = None + # data type: CampaignNotificationPolicy + oneof_schema_11_validator: Optional[CampaignNotificationPolicy] = None + # data type: TierDowngradeNotificationPolicy + oneof_schema_12_validator: Optional[TierDowngradeNotificationPolicy] = None + # data type: TierUpgradeNotificationPolicy + oneof_schema_13_validator: Optional[TierUpgradeNotificationPolicy] = None + # data type: TierWillDowngradeNotificationPolicy + oneof_schema_14_validator: Optional[TierWillDowngradeNotificationPolicy] = None + actual_instance: Optional[Union[AddedDeductedPointsBalancesNotificationPolicy, AddedDeductedPointsNotificationPolicy, CampaignNotificationPolicy, CardAddedDeductedPointsBalancesNotificationPolicy, CardAddedDeductedPointsNotificationPolicy, CardExpiringPointsNotificationPolicy, CatalogsStrikethroughNotificationPolicy, CouponsNotificationPolicy, ExpiringCouponsNotificationPolicy, ExpiringPointsNotificationPolicy, PendingPointsNotificationPolicy, TierDowngradeNotificationPolicy, TierUpgradeNotificationPolicy, TierWillDowngradeNotificationPolicy]] = None + one_of_schemas: Set[str] = { "AddedDeductedPointsBalancesNotificationPolicy", "AddedDeductedPointsNotificationPolicy", "CampaignNotificationPolicy", "CardAddedDeductedPointsBalancesNotificationPolicy", "CardAddedDeductedPointsNotificationPolicy", "CardExpiringPointsNotificationPolicy", "CatalogsStrikethroughNotificationPolicy", "CouponsNotificationPolicy", "ExpiringCouponsNotificationPolicy", "ExpiringPointsNotificationPolicy", "PendingPointsNotificationPolicy", "TierDowngradeNotificationPolicy", "TierUpgradeNotificationPolicy", "TierWillDowngradeNotificationPolicy" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = BaseNotificationPolicy.model_construct() + error_messages = [] + match = 0 + # validate data type: ExpiringCouponsNotificationPolicy + if not isinstance(v, ExpiringCouponsNotificationPolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `ExpiringCouponsNotificationPolicy`") + else: + match += 1 + # validate data type: CardExpiringPointsNotificationPolicy + if not isinstance(v, CardExpiringPointsNotificationPolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `CardExpiringPointsNotificationPolicy`") + else: + match += 1 + # validate data type: ExpiringPointsNotificationPolicy + if not isinstance(v, ExpiringPointsNotificationPolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `ExpiringPointsNotificationPolicy`") + else: + match += 1 + # validate data type: AddedDeductedPointsNotificationPolicy + if not isinstance(v, AddedDeductedPointsNotificationPolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `AddedDeductedPointsNotificationPolicy`") + else: + match += 1 + # validate data type: CardAddedDeductedPointsNotificationPolicy + if not isinstance(v, CardAddedDeductedPointsNotificationPolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `CardAddedDeductedPointsNotificationPolicy`") + else: + match += 1 + # validate data type: AddedDeductedPointsBalancesNotificationPolicy + if not isinstance(v, AddedDeductedPointsBalancesNotificationPolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `AddedDeductedPointsBalancesNotificationPolicy`") + else: + match += 1 + # validate data type: CardAddedDeductedPointsBalancesNotificationPolicy + if not isinstance(v, CardAddedDeductedPointsBalancesNotificationPolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `CardAddedDeductedPointsBalancesNotificationPolicy`") + else: + match += 1 + # validate data type: CouponsNotificationPolicy + if not isinstance(v, CouponsNotificationPolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `CouponsNotificationPolicy`") + else: + match += 1 + # validate data type: CatalogsStrikethroughNotificationPolicy + if not isinstance(v, CatalogsStrikethroughNotificationPolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `CatalogsStrikethroughNotificationPolicy`") + else: + match += 1 + # validate data type: PendingPointsNotificationPolicy + if not isinstance(v, PendingPointsNotificationPolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `PendingPointsNotificationPolicy`") + else: + match += 1 + # validate data type: CampaignNotificationPolicy + if not isinstance(v, CampaignNotificationPolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `CampaignNotificationPolicy`") + else: + match += 1 + # validate data type: TierDowngradeNotificationPolicy + if not isinstance(v, TierDowngradeNotificationPolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `TierDowngradeNotificationPolicy`") + else: + match += 1 + # validate data type: TierUpgradeNotificationPolicy + if not isinstance(v, TierUpgradeNotificationPolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `TierUpgradeNotificationPolicy`") + else: + match += 1 + # validate data type: TierWillDowngradeNotificationPolicy + if not isinstance(v, TierWillDowngradeNotificationPolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `TierWillDowngradeNotificationPolicy`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in BaseNotificationPolicy with oneOf schemas: AddedDeductedPointsBalancesNotificationPolicy, AddedDeductedPointsNotificationPolicy, CampaignNotificationPolicy, CardAddedDeductedPointsBalancesNotificationPolicy, CardAddedDeductedPointsNotificationPolicy, CardExpiringPointsNotificationPolicy, CatalogsStrikethroughNotificationPolicy, CouponsNotificationPolicy, ExpiringCouponsNotificationPolicy, ExpiringPointsNotificationPolicy, PendingPointsNotificationPolicy, TierDowngradeNotificationPolicy, TierUpgradeNotificationPolicy, TierWillDowngradeNotificationPolicy. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in BaseNotificationPolicy with oneOf schemas: AddedDeductedPointsBalancesNotificationPolicy, AddedDeductedPointsNotificationPolicy, CampaignNotificationPolicy, CardAddedDeductedPointsBalancesNotificationPolicy, CardAddedDeductedPointsNotificationPolicy, CardExpiringPointsNotificationPolicy, CatalogsStrikethroughNotificationPolicy, CouponsNotificationPolicy, ExpiringCouponsNotificationPolicy, ExpiringPointsNotificationPolicy, PendingPointsNotificationPolicy, TierDowngradeNotificationPolicy, TierUpgradeNotificationPolicy, TierWillDowngradeNotificationPolicy. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into ExpiringCouponsNotificationPolicy + try: + instance.actual_instance = ExpiringCouponsNotificationPolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CardExpiringPointsNotificationPolicy + try: + instance.actual_instance = CardExpiringPointsNotificationPolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ExpiringPointsNotificationPolicy + try: + instance.actual_instance = ExpiringPointsNotificationPolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AddedDeductedPointsNotificationPolicy + try: + instance.actual_instance = AddedDeductedPointsNotificationPolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CardAddedDeductedPointsNotificationPolicy + try: + instance.actual_instance = CardAddedDeductedPointsNotificationPolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AddedDeductedPointsBalancesNotificationPolicy + try: + instance.actual_instance = AddedDeductedPointsBalancesNotificationPolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CardAddedDeductedPointsBalancesNotificationPolicy + try: + instance.actual_instance = CardAddedDeductedPointsBalancesNotificationPolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CouponsNotificationPolicy + try: + instance.actual_instance = CouponsNotificationPolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CatalogsStrikethroughNotificationPolicy + try: + instance.actual_instance = CatalogsStrikethroughNotificationPolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into PendingPointsNotificationPolicy + try: + instance.actual_instance = PendingPointsNotificationPolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CampaignNotificationPolicy + try: + instance.actual_instance = CampaignNotificationPolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into TierDowngradeNotificationPolicy + try: + instance.actual_instance = TierDowngradeNotificationPolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into TierUpgradeNotificationPolicy + try: + instance.actual_instance = TierUpgradeNotificationPolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into TierWillDowngradeNotificationPolicy + try: + instance.actual_instance = TierWillDowngradeNotificationPolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into BaseNotificationPolicy with oneOf schemas: AddedDeductedPointsBalancesNotificationPolicy, AddedDeductedPointsNotificationPolicy, CampaignNotificationPolicy, CardAddedDeductedPointsBalancesNotificationPolicy, CardAddedDeductedPointsNotificationPolicy, CardExpiringPointsNotificationPolicy, CatalogsStrikethroughNotificationPolicy, CouponsNotificationPolicy, ExpiringCouponsNotificationPolicy, ExpiringPointsNotificationPolicy, PendingPointsNotificationPolicy, TierDowngradeNotificationPolicy, TierUpgradeNotificationPolicy, TierWillDowngradeNotificationPolicy. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into BaseNotificationPolicy with oneOf schemas: AddedDeductedPointsBalancesNotificationPolicy, AddedDeductedPointsNotificationPolicy, CampaignNotificationPolicy, CardAddedDeductedPointsBalancesNotificationPolicy, CardAddedDeductedPointsNotificationPolicy, CardExpiringPointsNotificationPolicy, CatalogsStrikethroughNotificationPolicy, CouponsNotificationPolicy, ExpiringCouponsNotificationPolicy, ExpiringPointsNotificationPolicy, PendingPointsNotificationPolicy, TierDowngradeNotificationPolicy, TierUpgradeNotificationPolicy, TierWillDowngradeNotificationPolicy. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], AddedDeductedPointsBalancesNotificationPolicy, AddedDeductedPointsNotificationPolicy, CampaignNotificationPolicy, CardAddedDeductedPointsBalancesNotificationPolicy, CardAddedDeductedPointsNotificationPolicy, CardExpiringPointsNotificationPolicy, CatalogsStrikethroughNotificationPolicy, CouponsNotificationPolicy, ExpiringCouponsNotificationPolicy, ExpiringPointsNotificationPolicy, PendingPointsNotificationPolicy, TierDowngradeNotificationPolicy, TierUpgradeNotificationPolicy, TierWillDowngradeNotificationPolicy]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/talon_one/models/best_prior_price.py b/talon_one/models/best_prior_price.py index 068a5a7..ec6023a 100644 --- a/talon_one/models/best_prior_price.py +++ b/talon_one/models/best_prior_price.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union from talon_one.models.best_prior_price_metadata import BestPriorPriceMetadata +from talon_one.models.label_target import LabelTarget from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -36,7 +37,7 @@ class BestPriorPrice(BaseModel): context_id: Optional[StrictStr] = Field(default='', description="This property is **deprecated**. Use `contextIds` instead. Defaults to an empty string. ", alias="contextId", json_schema_extra={"examples": [""]}) price: Union[StrictFloat, StrictInt] = Field(description="Price of the item.", json_schema_extra={"examples": [99.99]}) metadata: BestPriorPriceMetadata - target: Dict[str, Any] + target: LabelTarget __properties: ClassVar[List[str]] = ["id", "sku", "observedAt", "contextIds", "contextId", "price", "metadata", "target"] model_config = ConfigDict( @@ -81,6 +82,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of target + if self.target: + _dict['target'] = self.target.to_dict() return _dict @classmethod @@ -100,7 +104,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "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") + "target": LabelTarget.from_dict(obj["target"]) if obj.get("target") is not None else None }) return _obj diff --git a/talon_one/models/bulk_application_notification.py b/talon_one/models/bulk_application_notification.py index 5b6fb87..2bf9b52 100644 --- a/talon_one/models/bulk_application_notification.py +++ b/talon_one/models/bulk_application_notification.py @@ -19,7 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List -from talon_one.models.application_notification import ApplicationNotification +from talon_one.models.campaign_evaluation_tree_changed_notification import CampaignEvaluationTreeChangedNotification from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -29,7 +29,7 @@ class BulkApplicationNotification(BaseModel): BulkApplicationNotification """ # noqa: E501 total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) - data: List[ApplicationNotification] + data: List[CampaignEvaluationTreeChangedNotification] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] model_config = ConfigDict( @@ -91,7 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "totalResultSize": obj.get("totalResultSize"), - "data": [ApplicationNotification.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None + "data": [CampaignEvaluationTreeChangedNotification.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None }) return _obj diff --git a/talon_one/models/campaign_collection.py b/talon_one/models/campaign_collection.py index 0d3ae3d..e581485 100644 --- a/talon_one/models/campaign_collection.py +++ b/talon_one/models/campaign_collection.py @@ -42,13 +42,10 @@ class CampaignCollection(BaseModel): payload: Optional[Annotated[List[StrictStr], Field(max_length=50)]] = Field(default=None, description="The content of the collection.", json_schema_extra={"examples": [["KTL-WH-ET-1", "KTL-BL-ET-1"]]}) __properties: ClassVar[List[str]] = ["id", "created", "accountId", "modified", "description", "name", "modifiedBy", "createdBy", "applicationId", "campaignId", "payload"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): + if isinstance(value, str) and not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): raise ValueError(r"must validate the regular expression /^[^[:cntrl:]\s][^[:cntrl:]]*$/") return value diff --git a/talon_one/models/campaign_collection_without_payload.py b/talon_one/models/campaign_collection_without_payload.py index c956368..a610fac 100644 --- a/talon_one/models/campaign_collection_without_payload.py +++ b/talon_one/models/campaign_collection_without_payload.py @@ -41,13 +41,10 @@ class CampaignCollectionWithoutPayload(BaseModel): campaign_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign that owns this entity.", alias="campaignId", json_schema_extra={"examples": [7]}) __properties: ClassVar[List[str]] = ["id", "created", "accountId", "modified", "description", "name", "modifiedBy", "createdBy", "applicationId", "campaignId"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): + if isinstance(value, str) and not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): raise ValueError(r"must validate the regular expression /^[^[:cntrl:]\s][^[:cntrl:]]*$/") return value diff --git a/talon_one/models/campaign_evaluation_tree_changed_message.py b/talon_one/models/campaign_evaluation_tree_changed_message.py index 78183bf..7fc04c0 100644 --- a/talon_one/models/campaign_evaluation_tree_changed_message.py +++ b/talon_one/models/campaign_evaluation_tree_changed_message.py @@ -19,7 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from talon_one.models.application_notification import ApplicationNotification +from talon_one.models.campaign_evaluation_tree_changed_notification import CampaignEvaluationTreeChangedNotification from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -30,7 +30,7 @@ class CampaignEvaluationTreeChangedMessage(BaseModel): """ # noqa: E501 notification_type: StrictStr = Field(description="The type of the notification", alias="NotificationType", json_schema_extra={"examples": ["CampaignNotification"]}) total_result_size: StrictInt = Field(description="The total size of the result set.", alias="TotalResultSize") - data: Optional[List[ApplicationNotification]] = Field(default=None, description="The array of changes.", alias="Data") + data: Optional[List[CampaignEvaluationTreeChangedNotification]] = Field(default=None, description="The array of changes.", alias="Data") __properties: ClassVar[List[str]] = ["NotificationType", "TotalResultSize", "Data"] @field_validator('notification_type') @@ -100,7 +100,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "NotificationType": obj.get("NotificationType"), "TotalResultSize": obj.get("TotalResultSize"), - "Data": [ApplicationNotification.from_dict(_item) for _item in obj["Data"]] if obj.get("Data") is not None else None + "Data": [CampaignEvaluationTreeChangedNotification.from_dict(_item) for _item in obj["Data"]] if obj.get("Data") is not None else None }) return _obj diff --git a/talon_one/models/campaign_set_branch_node.py b/talon_one/models/campaign_set_branch_node.py index 6455634..3f426a3 100644 --- a/talon_one/models/campaign_set_branch_node.py +++ b/talon_one/models/campaign_set_branch_node.py @@ -19,7 +19,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from talon_one.models.campaign_set_node import CampaignSetNode from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -137,4 +136,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: }) return _obj +from talon_one.models.campaign_set_node import CampaignSetNode +# TODO: Rewrite to not use raise_errors +CampaignSetBranchNode.model_rebuild(raise_errors=False) diff --git a/talon_one/models/campaign_set_node.py b/talon_one/models/campaign_set_node.py index 1ec34a5..39b533e 100644 --- a/talon_one/models/campaign_set_node.py +++ b/talon_one/models/campaign_set_node.py @@ -13,76 +13,127 @@ from __future__ import annotations -import pprint -import re # noqa: F401 import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from talon_one.models.campaign_set_leaf_node import CampaignSetLeafNode +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self -from pydantic_core import to_jsonable_python +CAMPAIGNSETNODE_ONE_OF_SCHEMAS = ["CampaignSetBranchNode", "CampaignSetLeafNode"] class CampaignSetNode(BaseModel): """ CampaignSetNode - """ # noqa: E501 - type: StrictStr = Field(json_schema_extra={"examples": ["type"]}) - __properties: ClassVar[List[str]] = ["type"] + """ + # data type: CampaignSetBranchNode + oneof_schema_1_validator: Optional[CampaignSetBranchNode] = None + # data type: CampaignSetLeafNode + oneof_schema_2_validator: Optional[CampaignSetLeafNode] = None + actual_instance: Optional[Union[CampaignSetBranchNode, CampaignSetLeafNode]] = None + one_of_schemas: Set[str] = { "CampaignSetBranchNode", "CampaignSetLeafNode" } 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())) + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = CampaignSetNode.model_construct() + error_messages = [] + match = 0 + # validate data type: CampaignSetBranchNode + if not isinstance(v, CampaignSetBranchNode): + error_messages.append(f"Error! Input type `{type(v)}` is not `CampaignSetBranchNode`") + else: + match += 1 + # validate data type: CampaignSetLeafNode + if not isinstance(v, CampaignSetLeafNode): + error_messages.append(f"Error! Input type `{type(v)}` is not `CampaignSetLeafNode`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in CampaignSetNode with oneOf schemas: CampaignSetBranchNode, CampaignSetLeafNode. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in CampaignSetNode with oneOf schemas: CampaignSetBranchNode, CampaignSetLeafNode. Details: " + ", ".join(error_messages)) + else: + return v @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CampaignSetNode 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 + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CampaignSetNode from a dict""" - if obj is None: + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into CampaignSetBranchNode + try: + instance.actual_instance = CampaignSetBranchNode.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CampaignSetLeafNode + try: + instance.actual_instance = CampaignSetLeafNode.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into CampaignSetNode with oneOf schemas: CampaignSetBranchNode, CampaignSetLeafNode. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into CampaignSetNode with oneOf schemas: CampaignSetBranchNode, CampaignSetLeafNode. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], CampaignSetBranchNode, CampaignSetLeafNode]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: return None - if not isinstance(obj, dict): - return cls.model_validate(obj) + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance - _obj = cls.model_validate({ - "type": obj.get("type") - }) - return _obj + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) +from talon_one.models.campaign_set_branch_node import CampaignSetBranchNode +# TODO: Rewrite to not use raise_errors +CampaignSetNode.model_rebuild(raise_errors=False) diff --git a/talon_one/models/campaign_template_collection.py b/talon_one/models/campaign_template_collection.py index cae6fa0..83caac1 100644 --- a/talon_one/models/campaign_template_collection.py +++ b/talon_one/models/campaign_template_collection.py @@ -32,13 +32,10 @@ class CampaignTemplateCollection(BaseModel): description: Optional[StrictStr] = Field(default=None, description="A short description of the purpose of this collection.", json_schema_extra={"examples": ["My collection of SKUs"]}) __properties: ClassVar[List[str]] = ["name", "description"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z](\w|\s)*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z](\w|\s)*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z](\w|\s)*$/") return value diff --git a/talon_one/models/card_ledger_transaction_log_entry.py b/talon_one/models/card_ledger_transaction_log_entry.py index 1487561..d66f146 100644 --- a/talon_one/models/card_ledger_transaction_log_entry.py +++ b/talon_one/models/card_ledger_transaction_log_entry.py @@ -45,13 +45,10 @@ class CardLedgerTransactionLogEntry(BaseModel): id: StrictInt = Field(description="ID of the loyalty ledger entry.", json_schema_extra={"examples": [123]}) __properties: ClassVar[List[str]] = ["transactionUUID", "created", "programId", "cardIdentifier", "applicationId", "sessionId", "customerSessionId", "type", "name", "startDate", "expiryDate", "subledgerId", "amount", "id"] - @field_validator('card_identifier') + @field_validator('card_identifier', mode="before") def card_identifier_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z0-9._%+@-]+$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z0-9._%+@-]+$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z0-9._%+@-]+$/") return value diff --git a/talon_one/models/card_ledger_transaction_log_entry_integration_api.py b/talon_one/models/card_ledger_transaction_log_entry_integration_api.py index 89d97a8..b1b0c0f 100644 --- a/talon_one/models/card_ledger_transaction_log_entry_integration_api.py +++ b/talon_one/models/card_ledger_transaction_log_entry_integration_api.py @@ -46,13 +46,10 @@ class CardLedgerTransactionLogEntryIntegrationAPI(BaseModel): validity_duration: Optional[StrictStr] = Field(default=None, description="The duration for which the points remain active, relative to the activation date. **Note**: This only applies to points for which `awaitsActivation` is `true` and `expiryDate` is not set. ", alias="validityDuration", json_schema_extra={"examples": ["30D"]}) __properties: ClassVar[List[str]] = ["transactionUUID", "created", "programId", "cardIdentifier", "customerSessionId", "type", "name", "startDate", "expiryDate", "subledgerId", "amount", "id", "rulesetId", "ruleName", "validityDuration"] - @field_validator('card_identifier') + @field_validator('card_identifier', mode="before") def card_identifier_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z0-9._%+@-]+$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z0-9._%+@-]+$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z0-9._%+@-]+$/") return value diff --git a/talon_one/models/catalog_action.py b/talon_one/models/catalog_action.py index 1ac6fcc..717d67c 100644 --- a/talon_one/models/catalog_action.py +++ b/talon_one/models/catalog_action.py @@ -13,85 +13,181 @@ 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 +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from talon_one.models.catalog_action_one_of import CatalogActionOneOf +from talon_one.models.catalog_action_one_of1 import CatalogActionOneOf1 +from talon_one.models.catalog_action_one_of2 import CatalogActionOneOf2 +from talon_one.models.catalog_action_one_of3 import CatalogActionOneOf3 +from talon_one.models.catalog_action_one_of4 import CatalogActionOneOf4 +from talon_one.models.catalog_action_one_of5 import CatalogActionOneOf5 +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +CATALOGACTION_ONE_OF_SCHEMAS = ["CatalogActionOneOf", "CatalogActionOneOf1", "CatalogActionOneOf2", "CatalogActionOneOf3", "CatalogActionOneOf4", "CatalogActionOneOf5"] 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.", json_schema_extra={"examples": ["ADD"]}) - 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 + """ + # data type: CatalogActionOneOf + oneof_schema_1_validator: Optional[CatalogActionOneOf] = None + # data type: CatalogActionOneOf1 + oneof_schema_2_validator: Optional[CatalogActionOneOf1] = None + # data type: CatalogActionOneOf2 + oneof_schema_3_validator: Optional[CatalogActionOneOf2] = None + # data type: CatalogActionOneOf3 + oneof_schema_4_validator: Optional[CatalogActionOneOf3] = None + # data type: CatalogActionOneOf4 + oneof_schema_5_validator: Optional[CatalogActionOneOf4] = None + # data type: CatalogActionOneOf5 + oneof_schema_6_validator: Optional[CatalogActionOneOf5] = None + actual_instance: Optional[Union[CatalogActionOneOf, CatalogActionOneOf1, CatalogActionOneOf2, CatalogActionOneOf3, CatalogActionOneOf4, CatalogActionOneOf5]] = None + one_of_schemas: Set[str] = { "CatalogActionOneOf", "CatalogActionOneOf1", "CatalogActionOneOf2", "CatalogActionOneOf3", "CatalogActionOneOf4", "CatalogActionOneOf5" } 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())) + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = CatalogAction.model_construct() + error_messages = [] + match = 0 + # validate data type: CatalogActionOneOf + if not isinstance(v, CatalogActionOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `CatalogActionOneOf`") + else: + match += 1 + # validate data type: CatalogActionOneOf1 + if not isinstance(v, CatalogActionOneOf1): + error_messages.append(f"Error! Input type `{type(v)}` is not `CatalogActionOneOf1`") + else: + match += 1 + # validate data type: CatalogActionOneOf2 + if not isinstance(v, CatalogActionOneOf2): + error_messages.append(f"Error! Input type `{type(v)}` is not `CatalogActionOneOf2`") + else: + match += 1 + # validate data type: CatalogActionOneOf3 + if not isinstance(v, CatalogActionOneOf3): + error_messages.append(f"Error! Input type `{type(v)}` is not `CatalogActionOneOf3`") + else: + match += 1 + # validate data type: CatalogActionOneOf4 + if not isinstance(v, CatalogActionOneOf4): + error_messages.append(f"Error! Input type `{type(v)}` is not `CatalogActionOneOf4`") + else: + match += 1 + # validate data type: CatalogActionOneOf5 + if not isinstance(v, CatalogActionOneOf5): + error_messages.append(f"Error! Input type `{type(v)}` is not `CatalogActionOneOf5`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in CatalogAction with oneOf schemas: CatalogActionOneOf, CatalogActionOneOf1, CatalogActionOneOf2, CatalogActionOneOf3, CatalogActionOneOf4, CatalogActionOneOf5. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in CatalogAction with oneOf schemas: CatalogActionOneOf, CatalogActionOneOf1, CatalogActionOneOf2, CatalogActionOneOf3, CatalogActionOneOf4, CatalogActionOneOf5. Details: " + ", ".join(error_messages)) + else: + return v @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 + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CatalogAction from a dict""" - if obj is None: + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into CatalogActionOneOf + try: + instance.actual_instance = CatalogActionOneOf.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CatalogActionOneOf1 + try: + instance.actual_instance = CatalogActionOneOf1.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CatalogActionOneOf2 + try: + instance.actual_instance = CatalogActionOneOf2.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CatalogActionOneOf3 + try: + instance.actual_instance = CatalogActionOneOf3.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CatalogActionOneOf4 + try: + instance.actual_instance = CatalogActionOneOf4.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CatalogActionOneOf5 + try: + instance.actual_instance = CatalogActionOneOf5.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into CatalogAction with oneOf schemas: CatalogActionOneOf, CatalogActionOneOf1, CatalogActionOneOf2, CatalogActionOneOf3, CatalogActionOneOf4, CatalogActionOneOf5. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into CatalogAction with oneOf schemas: CatalogActionOneOf, CatalogActionOneOf1, CatalogActionOneOf2, CatalogActionOneOf3, CatalogActionOneOf4, CatalogActionOneOf5. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], CatalogActionOneOf, CatalogActionOneOf1, CatalogActionOneOf2, CatalogActionOneOf3, CatalogActionOneOf4, CatalogActionOneOf5]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: return None - if not isinstance(obj, dict): - return cls.model_validate(obj) + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance - _obj = cls.model_validate({ - "type": obj.get("type"), - "payload": obj.get("payload") - }) - return _obj + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) diff --git a/talon_one/models/catalog_action_one_of.py b/talon_one/models/catalog_action_one_of.py new file mode 100644 index 0000000..232922f --- /dev/null +++ b/talon_one/models/catalog_action_one_of.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.add_item_catalog_action import AddItemCatalogAction +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CatalogActionOneOf(BaseModel): + """ + CatalogActionOneOf + """ # noqa: E501 + type: Optional[Any] + payload: AddItemCatalogAction = Field(description="The payload of sync action.") + __properties: ClassVar[List[str]] = ["type", "payload"] + + 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 CatalogActionOneOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of payload + if self.payload: + _dict['payload'] = self.payload.to_dict() + # set to None if type (nullable) is None + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: + _dict['type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CatalogActionOneOf 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": AddItemCatalogAction.from_dict(obj["payload"]) if obj.get("payload") is not None else None + }) + return _obj + + diff --git a/talon_one/models/catalog_action_one_of1.py b/talon_one/models/catalog_action_one_of1.py new file mode 100644 index 0000000..a6339d3 --- /dev/null +++ b/talon_one/models/catalog_action_one_of1.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.patch_item_catalog_action import PatchItemCatalogAction +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CatalogActionOneOf1(BaseModel): + """ + CatalogActionOneOf1 + """ # noqa: E501 + type: Optional[Any] + payload: PatchItemCatalogAction + __properties: ClassVar[List[str]] = ["type", "payload"] + + 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 CatalogActionOneOf1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of payload + if self.payload: + _dict['payload'] = self.payload.to_dict() + # set to None if type (nullable) is None + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: + _dict['type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CatalogActionOneOf1 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": PatchItemCatalogAction.from_dict(obj["payload"]) if obj.get("payload") is not None else None + }) + return _obj + + diff --git a/talon_one/models/catalog_action_one_of2.py b/talon_one/models/catalog_action_one_of2.py new file mode 100644 index 0000000..1e8d76e --- /dev/null +++ b/talon_one/models/catalog_action_one_of2.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.patch_many_items_catalog_action import PatchManyItemsCatalogAction +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CatalogActionOneOf2(BaseModel): + """ + CatalogActionOneOf2 + """ # noqa: E501 + type: Optional[Any] + payload: PatchManyItemsCatalogAction + __properties: ClassVar[List[str]] = ["type", "payload"] + + 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 CatalogActionOneOf2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of payload + if self.payload: + _dict['payload'] = self.payload.to_dict() + # set to None if type (nullable) is None + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: + _dict['type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CatalogActionOneOf2 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": PatchManyItemsCatalogAction.from_dict(obj["payload"]) if obj.get("payload") is not None else None + }) + return _obj + + diff --git a/talon_one/models/catalog_action_one_of3.py b/talon_one/models/catalog_action_one_of3.py new file mode 100644 index 0000000..bbf8654 --- /dev/null +++ b/talon_one/models/catalog_action_one_of3.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.remove_item_catalog_action import RemoveItemCatalogAction +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CatalogActionOneOf3(BaseModel): + """ + CatalogActionOneOf3 + """ # noqa: E501 + type: Optional[Any] + payload: RemoveItemCatalogAction + __properties: ClassVar[List[str]] = ["type", "payload"] + + 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 CatalogActionOneOf3 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of payload + if self.payload: + _dict['payload'] = self.payload.to_dict() + # set to None if type (nullable) is None + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: + _dict['type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CatalogActionOneOf3 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": RemoveItemCatalogAction.from_dict(obj["payload"]) if obj.get("payload") is not None else None + }) + return _obj + + diff --git a/talon_one/models/catalog_action_one_of4.py b/talon_one/models/catalog_action_one_of4.py new file mode 100644 index 0000000..6d47542 --- /dev/null +++ b/talon_one/models/catalog_action_one_of4.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.remove_many_items_catalog_action import RemoveManyItemsCatalogAction +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CatalogActionOneOf4(BaseModel): + """ + CatalogActionOneOf4 + """ # noqa: E501 + type: Optional[Any] + payload: RemoveManyItemsCatalogAction + __properties: ClassVar[List[str]] = ["type", "payload"] + + 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 CatalogActionOneOf4 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of payload + if self.payload: + _dict['payload'] = self.payload.to_dict() + # set to None if type (nullable) is None + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: + _dict['type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CatalogActionOneOf4 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": RemoveManyItemsCatalogAction.from_dict(obj["payload"]) if obj.get("payload") is not None else None + }) + return _obj + + diff --git a/talon_one/models/catalog_action_one_of5.py b/talon_one/models/catalog_action_one_of5.py new file mode 100644 index 0000000..8a7189d --- /dev/null +++ b/talon_one/models/catalog_action_one_of5.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.add_price_adjustment_catalog_action import AddPriceAdjustmentCatalogAction +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CatalogActionOneOf5(BaseModel): + """ + CatalogActionOneOf5 + """ # noqa: E501 + type: Optional[Any] + payload: AddPriceAdjustmentCatalogAction + __properties: ClassVar[List[str]] = ["type", "payload"] + + 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 CatalogActionOneOf5 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of payload + if self.payload: + _dict['payload'] = self.payload.to_dict() + # set to None if type (nullable) is None + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: + _dict['type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CatalogActionOneOf5 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": AddPriceAdjustmentCatalogAction.from_dict(obj["payload"]) if obj.get("payload") is not None else None + }) + return _obj + + diff --git a/talon_one/models/change.py b/talon_one/models/change.py index 8666a3c..89035d0 100644 --- a/talon_one/models/change.py +++ b/talon_one/models/change.py @@ -33,8 +33,8 @@ class Change(BaseModel): user_id: StrictInt = Field(description="The ID of the user associated with this entity.", alias="userId", json_schema_extra={"examples": [388]}) application_id: Optional[StrictInt] = Field(default=None, description="ID of application associated with change.", alias="applicationId", json_schema_extra={"examples": [359]}) entity: StrictStr = Field(description="API endpoint on which the change was initiated.", json_schema_extra={"examples": ["/v1/applications/359/campaigns/6727"]}) - old: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") - new: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") + old: Optional[Dict[str, Any]] = Field(default=None, description="Resource before the change occurred.", json_schema_extra={"examples": ["{}"]}) + new: Optional[Dict[str, Any]] = Field(default=None, description="Resource after the change occurred.", json_schema_extra={"examples": ["{applicationId\"=359, attributes\"={}, campaignGroups\"=[], created\"=2022-07-08T13:04:02.972762328Z, description\"=, features\"=[referrals, loyalty], id=6727}"]}) management_key_id: Optional[StrictInt] = Field(default=None, description="ID of management key used to perform changes.", alias="managementKeyId", json_schema_extra={"examples": [3]}) __properties: ClassVar[List[str]] = ["id", "created", "userId", "applicationId", "entity", "old", "new", "managementKeyId"] diff --git a/talon_one/models/check_attribute_block.py b/talon_one/models/check_attribute_block.py deleted file mode 100644 index 99f6f17..0000000 --- a/talon_one/models/check_attribute_block.py +++ /dev/null @@ -1,233 +0,0 @@ -# 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 importlib import import_module -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self -from pydantic_core import to_jsonable_python - -from typing import TYPE_CHECKING -if TYPE_CHECKING: - from talon_one.models.between_check_attribute_block import BetweenCheckAttributeBlock - from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock - from talon_one.models.list_check_attribute_block import ListCheckAttributeBlock - from talon_one.models.list_with_count_check_attribute_block import ListWithCountCheckAttributeBlock - from talon_one.models.list_with_count_check_attribute_block import ListWithCountCheckAttributeBlock - from talon_one.models.list_check_attribute_block import ListCheckAttributeBlock - from talon_one.models.list_check_attribute_block import ListCheckAttributeBlock - from talon_one.models.unary_check_attribute_block import UnaryCheckAttributeBlock - from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock - from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock - from talon_one.models.unary_check_attribute_block import UnaryCheckAttributeBlock - from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock - from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock - from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock - from talon_one.models.unary_check_attribute_block import UnaryCheckAttributeBlock - from talon_one.models.unary_check_attribute_block import UnaryCheckAttributeBlock - from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock - from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock - from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock - from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock - from talon_one.models.unary_check_attribute_block import UnaryCheckAttributeBlock - from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock - from talon_one.models.unary_check_attribute_block import UnaryCheckAttributeBlock - from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock - from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock - from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock - from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock - from talon_one.models.promotion_check_attribute_block import PromotionCheckAttributeBlock - from talon_one.models.strikethrough_check_attribute_block import StrikethroughCheckAttributeBlock - -class CheckAttributeBlock(BaseModel): - """ - CheckAttributeBlock - """ # noqa: E501 - id: StrictStr = Field(description="Unique identifier for this block.", json_schema_extra={"examples": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}) - type: StrictStr = Field(description="Identifies the block variant and determines which additional properties are present in it.") - tags: Optional[List[StrictStr]] = Field(default=None, description="Semantic labels attached to this block.") - operator: StrictStr = Field(description="The comparison operator applied to the attribute.", json_schema_extra={"examples": ["greaterThan"]}) - attribute: StrictStr = Field(description="The attribute path identifier (e.g. \"$Session.Total\").", json_schema_extra={"examples": ["$Session.Total"]}) - value: Optional[Any] = None - min: Optional[Any] = None - max: Optional[Any] = None - values: Optional[Any] = None - count: Optional[Any] = None - __properties: ClassVar[List[str]] = ["id", "type", "tags", "operator", "attribute", "value", "min", "max", "values", "count"] - - @field_validator('operator') - def operator_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['equals', 'not(equals)', 'lessThan', 'lessThanOrEqual', 'greaterThan', 'greaterThanOrEqual', 'between', 'contains', 'not(contains)', 'matchesRegexp', 'startsWith', 'endsWith', 'oneOf', 'not(oneOf)', 'inCollection', 'not(inCollection)', 'empty', 'not(empty)', 'exists', 'not(exists)', 'isTrue', 'isFalse', 'containsAtLeast', 'containsExactly', 'containsOneOf', 'containsNoneOf', 'containsAllOf']): - raise ValueError("must be one of enum values ('equals', 'not(equals)', 'lessThan', 'lessThanOrEqual', 'greaterThan', 'greaterThanOrEqual', 'between', 'contains', 'not(contains)', 'matchesRegexp', 'startsWith', 'endsWith', 'oneOf', 'not(oneOf)', 'inCollection', 'not(inCollection)', 'empty', 'not(empty)', 'exists', 'not(exists)', 'isTrue', 'isFalse', 'containsAtLeast', 'containsExactly', 'containsOneOf', 'containsNoneOf', 'containsAllOf')") - return value - - model_config = ConfigDict( - validate_by_name=True, - validate_by_alias=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - # JSON field name that stores the object type - __discriminator_property_name: ClassVar[str] = 'operator' - - # discriminator mappings - __discriminator_value_class_map: ClassVar[Dict[str, str]] = { - 'between': 'BetweenCheckAttributeBlock','contains': 'ScalarCheckAttributeBlock','containsAllOf': 'ListCheckAttributeBlock','containsAtLeast': 'ListWithCountCheckAttributeBlock','containsExactly': 'ListWithCountCheckAttributeBlock','containsNoneOf': 'ListCheckAttributeBlock','containsOneOf': 'ListCheckAttributeBlock','empty': 'UnaryCheckAttributeBlock','endsWith': 'ScalarCheckAttributeBlock','equals': 'ScalarCheckAttributeBlock','exists': 'UnaryCheckAttributeBlock','greaterThan': 'ScalarCheckAttributeBlock','greaterThanOrEqual': 'ScalarCheckAttributeBlock','inCollection': 'ScalarCheckAttributeBlock','isFalse': 'UnaryCheckAttributeBlock','isTrue': 'UnaryCheckAttributeBlock','lessThan': 'ScalarCheckAttributeBlock','lessThanOrEqual': 'ScalarCheckAttributeBlock','matchesRegexp': 'ScalarCheckAttributeBlock','not(contains)': 'ScalarCheckAttributeBlock','not(empty)': 'UnaryCheckAttributeBlock','not(equals)': 'ScalarCheckAttributeBlock','not(exists)': 'UnaryCheckAttributeBlock','not(inCollection)': 'ScalarCheckAttributeBlock','not(oneOf)': 'ScalarCheckAttributeBlock','oneOf': 'ScalarCheckAttributeBlock','startsWith': 'ScalarCheckAttributeBlock','PromotionCheckAttributeBlock': 'PromotionCheckAttributeBlock','StrikethroughCheckAttributeBlock': 'StrikethroughCheckAttributeBlock' - } - - @classmethod - def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: - """Returns the discriminator value (object type) of the data""" - discriminator_value = obj[cls.__discriminator_property_name] - if discriminator_value: - return cls.__discriminator_value_class_map.get(discriminator_value) - else: - return None - - 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[Union[BetweenCheckAttributeBlock, ScalarCheckAttributeBlock, ListCheckAttributeBlock, ListWithCountCheckAttributeBlock, ListWithCountCheckAttributeBlock, ListCheckAttributeBlock, ListCheckAttributeBlock, UnaryCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, UnaryCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, UnaryCheckAttributeBlock, UnaryCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, UnaryCheckAttributeBlock, ScalarCheckAttributeBlock, UnaryCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, PromotionCheckAttributeBlock, StrikethroughCheckAttributeBlock]]: - """Create an instance of CheckAttributeBlock 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, - ) - # set to None if value (nullable) is None - # and model_fields_set contains the field - if self.value is None and "value" in self.model_fields_set: - _dict['value'] = None - - # set to None if min (nullable) is None - # and model_fields_set contains the field - if self.min is None and "min" in self.model_fields_set: - _dict['min'] = None - - # set to None if max (nullable) is None - # and model_fields_set contains the field - if self.max is None and "max" in self.model_fields_set: - _dict['max'] = None - - # set to None if values (nullable) is None - # and model_fields_set contains the field - if self.values is None and "values" in self.model_fields_set: - _dict['values'] = None - - # set to None if count (nullable) is None - # and model_fields_set contains the field - if self.count is None and "count" in self.model_fields_set: - _dict['count'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[BetweenCheckAttributeBlock, ScalarCheckAttributeBlock, ListCheckAttributeBlock, ListWithCountCheckAttributeBlock, ListWithCountCheckAttributeBlock, ListCheckAttributeBlock, ListCheckAttributeBlock, UnaryCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, UnaryCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, UnaryCheckAttributeBlock, UnaryCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, UnaryCheckAttributeBlock, ScalarCheckAttributeBlock, UnaryCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, ScalarCheckAttributeBlock, PromotionCheckAttributeBlock, StrikethroughCheckAttributeBlock]]: - """Create an instance of CheckAttributeBlock from a dict""" - # look up the object type based on discriminator mapping - object_type = cls.get_discriminator_value(obj) - if object_type == 'BetweenCheckAttributeBlock': - return import_module("talon_one.models.between_check_attribute_block").BetweenCheckAttributeBlock.from_dict(obj) - if object_type == 'ScalarCheckAttributeBlock': - return import_module("talon_one.models.scalar_check_attribute_block").ScalarCheckAttributeBlock.from_dict(obj) - if object_type == 'ListCheckAttributeBlock': - return import_module("talon_one.models.list_check_attribute_block").ListCheckAttributeBlock.from_dict(obj) - if object_type == 'ListWithCountCheckAttributeBlock': - return import_module("talon_one.models.list_with_count_check_attribute_block").ListWithCountCheckAttributeBlock.from_dict(obj) - if object_type == 'ListWithCountCheckAttributeBlock': - return import_module("talon_one.models.list_with_count_check_attribute_block").ListWithCountCheckAttributeBlock.from_dict(obj) - if object_type == 'ListCheckAttributeBlock': - return import_module("talon_one.models.list_check_attribute_block").ListCheckAttributeBlock.from_dict(obj) - if object_type == 'ListCheckAttributeBlock': - return import_module("talon_one.models.list_check_attribute_block").ListCheckAttributeBlock.from_dict(obj) - if object_type == 'UnaryCheckAttributeBlock': - return import_module("talon_one.models.unary_check_attribute_block").UnaryCheckAttributeBlock.from_dict(obj) - if object_type == 'ScalarCheckAttributeBlock': - return import_module("talon_one.models.scalar_check_attribute_block").ScalarCheckAttributeBlock.from_dict(obj) - if object_type == 'ScalarCheckAttributeBlock': - return import_module("talon_one.models.scalar_check_attribute_block").ScalarCheckAttributeBlock.from_dict(obj) - if object_type == 'UnaryCheckAttributeBlock': - return import_module("talon_one.models.unary_check_attribute_block").UnaryCheckAttributeBlock.from_dict(obj) - if object_type == 'ScalarCheckAttributeBlock': - return import_module("talon_one.models.scalar_check_attribute_block").ScalarCheckAttributeBlock.from_dict(obj) - if object_type == 'ScalarCheckAttributeBlock': - return import_module("talon_one.models.scalar_check_attribute_block").ScalarCheckAttributeBlock.from_dict(obj) - if object_type == 'ScalarCheckAttributeBlock': - return import_module("talon_one.models.scalar_check_attribute_block").ScalarCheckAttributeBlock.from_dict(obj) - if object_type == 'UnaryCheckAttributeBlock': - return import_module("talon_one.models.unary_check_attribute_block").UnaryCheckAttributeBlock.from_dict(obj) - if object_type == 'UnaryCheckAttributeBlock': - return import_module("talon_one.models.unary_check_attribute_block").UnaryCheckAttributeBlock.from_dict(obj) - if object_type == 'ScalarCheckAttributeBlock': - return import_module("talon_one.models.scalar_check_attribute_block").ScalarCheckAttributeBlock.from_dict(obj) - if object_type == 'ScalarCheckAttributeBlock': - return import_module("talon_one.models.scalar_check_attribute_block").ScalarCheckAttributeBlock.from_dict(obj) - if object_type == 'ScalarCheckAttributeBlock': - return import_module("talon_one.models.scalar_check_attribute_block").ScalarCheckAttributeBlock.from_dict(obj) - if object_type == 'ScalarCheckAttributeBlock': - return import_module("talon_one.models.scalar_check_attribute_block").ScalarCheckAttributeBlock.from_dict(obj) - if object_type == 'UnaryCheckAttributeBlock': - return import_module("talon_one.models.unary_check_attribute_block").UnaryCheckAttributeBlock.from_dict(obj) - if object_type == 'ScalarCheckAttributeBlock': - return import_module("talon_one.models.scalar_check_attribute_block").ScalarCheckAttributeBlock.from_dict(obj) - if object_type == 'UnaryCheckAttributeBlock': - return import_module("talon_one.models.unary_check_attribute_block").UnaryCheckAttributeBlock.from_dict(obj) - if object_type == 'ScalarCheckAttributeBlock': - return import_module("talon_one.models.scalar_check_attribute_block").ScalarCheckAttributeBlock.from_dict(obj) - if object_type == 'ScalarCheckAttributeBlock': - return import_module("talon_one.models.scalar_check_attribute_block").ScalarCheckAttributeBlock.from_dict(obj) - if object_type == 'ScalarCheckAttributeBlock': - return import_module("talon_one.models.scalar_check_attribute_block").ScalarCheckAttributeBlock.from_dict(obj) - if object_type == 'ScalarCheckAttributeBlock': - return import_module("talon_one.models.scalar_check_attribute_block").ScalarCheckAttributeBlock.from_dict(obj) - if object_type == 'PromotionCheckAttributeBlock': - return import_module("talon_one.models.promotion_check_attribute_block").PromotionCheckAttributeBlock.from_dict(obj) - if object_type == 'StrikethroughCheckAttributeBlock': - return import_module("talon_one.models.strikethrough_check_attribute_block").StrikethroughCheckAttributeBlock.from_dict(obj) - - raise ValueError("CheckAttributeBlock failed to lookup discriminator value from " + - json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + - ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) - - diff --git a/talon_one/models/check_attribute_block_base.py b/talon_one/models/check_attribute_block_base.py new file mode 100644 index 0000000..6d2e857 --- /dev/null +++ b/talon_one/models/check_attribute_block_base.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from 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 CheckAttributeBlockBase(BaseModel): + """ + CheckAttributeBlockBase + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier for this block.", json_schema_extra={"examples": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}) + type: StrictStr = Field(description="Identifies the block variant and determines which additional properties are present in it.") + tags: Optional[List[StrictStr]] = Field(default=None, description="Semantic labels attached to this block.") + operator: StrictStr = Field(description="The comparison operator applied to the attribute.", json_schema_extra={"examples": ["greaterThan"]}) + attribute: StrictStr = Field(description="The attribute path identifier (e.g. \"$Session.Total\").", json_schema_extra={"examples": ["$Session.Total"]}) + value: Optional[Any] = None + min: Optional[Any] = None + max: Optional[Any] = None + values: Optional[Any] = None + count: Optional[Any] = None + __properties: ClassVar[List[str]] = ["id", "type", "tags", "operator", "attribute", "value", "min", "max", "values", "count"] + + @field_validator('operator') + def operator_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['equals', 'not(equals)', 'lessThan', 'lessThanOrEqual', 'greaterThan', 'greaterThanOrEqual', 'between', 'contains', 'not(contains)', 'matchesRegexp', 'startsWith', 'endsWith', 'oneOf', 'not(oneOf)', 'inCollection', 'not(inCollection)', 'empty', 'not(empty)', 'exists', 'not(exists)', 'isTrue', 'isFalse', 'containsAtLeast', 'containsExactly', 'containsOneOf', 'containsNoneOf', 'containsAllOf']): + raise ValueError("must be one of enum values ('equals', 'not(equals)', 'lessThan', 'lessThanOrEqual', 'greaterThan', 'greaterThanOrEqual', 'between', 'contains', 'not(contains)', 'matchesRegexp', 'startsWith', 'endsWith', 'oneOf', 'not(oneOf)', 'inCollection', 'not(inCollection)', 'empty', 'not(empty)', 'exists', 'not(exists)', 'isTrue', 'isFalse', 'containsAtLeast', 'containsExactly', 'containsOneOf', 'containsNoneOf', 'containsAllOf')") + 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 CheckAttributeBlockBase 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, + ) + # set to None if value (nullable) is None + # and model_fields_set contains the field + if self.value is None and "value" in self.model_fields_set: + _dict['value'] = None + + # set to None if min (nullable) is None + # and model_fields_set contains the field + if self.min is None and "min" in self.model_fields_set: + _dict['min'] = None + + # set to None if max (nullable) is None + # and model_fields_set contains the field + if self.max is None and "max" in self.model_fields_set: + _dict['max'] = None + + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + + # set to None if count (nullable) is None + # and model_fields_set contains the field + if self.count is None and "count" in self.model_fields_set: + _dict['count'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CheckAttributeBlockBase from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "tags": obj.get("tags"), + "operator": obj.get("operator"), + "attribute": obj.get("attribute"), + "value": obj.get("value"), + "min": obj.get("min"), + "max": obj.get("max"), + "values": obj.get("values"), + "count": obj.get("count") + }) + return _obj + + diff --git a/talon_one/models/check_audience_block.py b/talon_one/models/check_audience_block.py index 4b18c4b..a5a0304 100644 --- a/talon_one/models/check_audience_block.py +++ b/talon_one/models/check_audience_block.py @@ -34,7 +34,7 @@ class CheckAudienceBlock(BaseModel): operator: StrictStr = Field(description="An indicator of how the block compares its elements.", json_schema_extra={"examples": ["member"]}) profile: StrictStr = Field(description="The customer profile to check against the audience. `Current` targets the customer in the current session; `Advocate` targets the person who invited their friend via referral program.", json_schema_extra={"examples": ["Current"]}) audience: CheckAudienceBlock1Audience - on_failure: Optional[List[Any]] = Field(default=None, description="Promotion blocks evaluated when this block fails or returns false.", alias="onFailure") + on_failure: Optional[List[PromotionBlock]] = Field(default=None, description="Promotion blocks evaluated when this block fails or returns false.", alias="onFailure") __properties: ClassVar[List[str]] = ["id", "type", "tags", "operator", "profile", "audience", "onFailure"] @field_validator('operator') @@ -93,6 +93,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of audience if self.audience: _dict['audience'] = self.audience.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in on_failure (list) + _items = [] + if self.on_failure: + for _item_on_failure in self.on_failure: + if _item_on_failure: + _items.append(_item_on_failure.to_dict()) + _dict['onFailure'] = _items return _dict @classmethod @@ -111,8 +118,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "operator": obj.get("operator"), "profile": obj.get("profile"), "audience": CheckAudienceBlock1Audience.from_dict(obj["audience"]) if obj.get("audience") is not None else None, - "onFailure": obj.get("onFailure") + "onFailure": [PromotionBlock.from_dict(_item) for _item in obj["onFailure"]] if obj.get("onFailure") is not None else None }) return _obj +from talon_one.models.promotion_block import PromotionBlock +# TODO: Rewrite to not use raise_errors +CheckAudienceBlock.model_rebuild(raise_errors=False) diff --git a/talon_one/models/check_coupon_block.py b/talon_one/models/check_coupon_block.py index 1354010..1ccc2ea 100644 --- a/talon_one/models/check_coupon_block.py +++ b/talon_one/models/check_coupon_block.py @@ -31,7 +31,7 @@ class CheckCouponBlock(BaseModel): type: StrictStr = Field(description="Identifies the block variant and determines which additional properties are present in it.") tags: Optional[List[StrictStr]] = Field(default=None, description="Semantic labels attached to this block.") redeem: StrictBool = Field(description="When `true`, the coupon code is redeemed.", json_schema_extra={"examples": [True]}) - on_failure: Optional[List[Any]] = Field(default=None, description="Promotion blocks evaluated when this block fails or returns false.", alias="onFailure") + on_failure: Optional[List[PromotionBlock]] = Field(default=None, description="Promotion blocks evaluated when this block fails or returns false.", alias="onFailure") __properties: ClassVar[List[str]] = ["id", "type", "tags", "redeem", "onFailure"] model_config = ConfigDict( @@ -73,6 +73,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 on_failure (list) + _items = [] + if self.on_failure: + for _item_on_failure in self.on_failure: + if _item_on_failure: + _items.append(_item_on_failure.to_dict()) + _dict['onFailure'] = _items return _dict @classmethod @@ -89,8 +96,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "type": obj.get("type"), "tags": obj.get("tags"), "redeem": obj.get("redeem"), - "onFailure": obj.get("onFailure") + "onFailure": [PromotionBlock.from_dict(_item) for _item in obj["onFailure"]] if obj.get("onFailure") is not None else None }) return _obj +from talon_one.models.promotion_block import PromotionBlock +# TODO: Rewrite to not use raise_errors +CheckCouponBlock.model_rebuild(raise_errors=False) diff --git a/talon_one/models/check_referral_block.py b/talon_one/models/check_referral_block.py index 7dc51dc..36a24af 100644 --- a/talon_one/models/check_referral_block.py +++ b/talon_one/models/check_referral_block.py @@ -31,7 +31,7 @@ class CheckReferralBlock(BaseModel): type: StrictStr = Field(description="Identifies the block variant and determines which additional properties are present in it.") tags: Optional[List[StrictStr]] = Field(default=None, description="Semantic labels attached to this block.") redeem: StrictBool = Field(description="When `true`, the referral code is redeemed.", json_schema_extra={"examples": [True]}) - on_failure: Optional[List[Any]] = Field(default=None, description="Promotion blocks evaluated when this block fails or returns false.", alias="onFailure") + on_failure: Optional[List[PromotionBlock]] = Field(default=None, description="Promotion blocks evaluated when this block fails or returns false.", alias="onFailure") __properties: ClassVar[List[str]] = ["id", "type", "tags", "redeem", "onFailure"] model_config = ConfigDict( @@ -73,6 +73,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 on_failure (list) + _items = [] + if self.on_failure: + for _item_on_failure in self.on_failure: + if _item_on_failure: + _items.append(_item_on_failure.to_dict()) + _dict['onFailure'] = _items return _dict @classmethod @@ -89,8 +96,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "type": obj.get("type"), "tags": obj.get("tags"), "redeem": obj.get("redeem"), - "onFailure": obj.get("onFailure") + "onFailure": [PromotionBlock.from_dict(_item) for _item in obj["onFailure"]] if obj.get("onFailure") is not None else None }) return _obj +from talon_one.models.promotion_block import PromotionBlock +# TODO: Rewrite to not use raise_errors +CheckReferralBlock.model_rebuild(raise_errors=False) diff --git a/talon_one/models/code_generator_settings.py b/talon_one/models/code_generator_settings.py index 6015ec0..2f75d99 100644 --- a/talon_one/models/code_generator_settings.py +++ b/talon_one/models/code_generator_settings.py @@ -32,13 +32,10 @@ class CodeGeneratorSettings(BaseModel): coupon_pattern: Annotated[str, Field(min_length=3, strict=True, max_length=100)] = Field(description="The pattern used to generate codes, such as coupon codes, referral codes, and loyalty cards. The character `#` is a placeholder and is replaced by a random character from the `validCharacters` set. ", alias="couponPattern", json_schema_extra={"examples": ["SUMMER-####-####"]}) __properties: ClassVar[List[str]] = ["validCharacters", "couponPattern"] - @field_validator('coupon_pattern') + @field_validator('coupon_pattern', mode="before") def coupon_pattern_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z0-9._%+@#-]+$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z0-9._%+@#-]+$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z0-9._%+@#-]+$/") return value diff --git a/talon_one/models/collection.py b/talon_one/models/collection.py index a49d976..b92e7af 100644 --- a/talon_one/models/collection.py +++ b/talon_one/models/collection.py @@ -43,13 +43,10 @@ class Collection(BaseModel): payload: Optional[Annotated[List[StrictStr], Field(max_length=50)]] = Field(default=None, description="The content of the collection.", json_schema_extra={"examples": [["KTL-WH-ET-1", "KTL-BL-ET-1"]]}) __properties: ClassVar[List[str]] = ["id", "created", "accountId", "modified", "description", "subscribedApplicationsIds", "name", "modifiedBy", "createdBy", "applicationId", "campaignId", "payload"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): + if isinstance(value, str) and not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): raise ValueError(r"must validate the regular expression /^[^[:cntrl:]\s][^[:cntrl:]]*$/") return value diff --git a/talon_one/models/collection_without_payload.py b/talon_one/models/collection_without_payload.py index 1c79a03..3bbee00 100644 --- a/talon_one/models/collection_without_payload.py +++ b/talon_one/models/collection_without_payload.py @@ -42,13 +42,10 @@ class CollectionWithoutPayload(BaseModel): campaign_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign that owns this entity.", alias="campaignId", json_schema_extra={"examples": [7]}) __properties: ClassVar[List[str]] = ["id", "created", "accountId", "modified", "description", "subscribedApplicationsIds", "name", "modifiedBy", "createdBy", "applicationId", "campaignId"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): + if isinstance(value, str) and not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): raise ValueError(r"must validate the regular expression /^[^[:cntrl:]\s][^[:cntrl:]]*$/") return value diff --git a/talon_one/models/confirm_risks_request.py b/talon_one/models/confirm_risks_request.py new file mode 100644 index 0000000..4caf351 --- /dev/null +++ b/talon_one/models/confirm_risks_request.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ConfirmRisksRequest(BaseModel): + """ + ConfirmRisksRequest + """ # noqa: E501 + risk_ids: Annotated[List[StrictInt], Field(min_length=1, max_length=1000)] = Field(description="The IDs of the risks to confirm.", alias="riskIds", json_schema_extra={"examples": [[1, 2, 3]]}) + comment: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Free-text description of how the risk was resolved.", json_schema_extra={"examples": ["Investigated with the customer and fixed the loyalty rule."]}) + __properties: ClassVar[List[str]] = ["riskIds", "comment"] + + 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 ConfirmRisksRequest 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 ConfirmRisksRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "riskIds": obj.get("riskIds"), + "comment": obj.get("comment") + }) + return _obj + + diff --git a/talon_one/models/coupon_creation_job.py b/talon_one/models/coupon_creation_job.py index 007ee08..175adb1 100644 --- a/talon_one/models/coupon_creation_job.py +++ b/talon_one/models/coupon_creation_job.py @@ -42,7 +42,7 @@ class CouponCreationJob(BaseModel): expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the coupon. Coupon never expires if this is omitted.", alias="expiryDate", json_schema_extra={"examples": ["2023-08-24T14:15:22Z"]}) number_of_coupons: Annotated[int, Field(le=5000000, strict=True, ge=1)] = Field(description="The number of new coupon codes to generate for the campaign.", alias="numberOfCoupons", json_schema_extra={"examples": [200000]}) coupon_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="couponSettings") - attributes: Dict[str, Any] = Field(description="Arbitrary properties associated with this campaign.") + attributes: Dict[str, Any] = Field(description="Arbitrary properties associated with coupons.") is_reservation_mandatory: Optional[StrictBool] = Field(default=False, description="An indication of whether the code can be redeemed only if it has been reserved first.", alias="isReservationMandatory", json_schema_extra={"examples": [False]}) batch_id: StrictStr = Field(description="The batch ID coupons created by this job will bear.", alias="batchId", json_schema_extra={"examples": ["tqyrgahe"]}) status: StrictStr = Field(description="The current status of this request. Possible values: - `pending verification` - `pending` - `completed` - `failed` - `coupon pattern full` ", json_schema_extra={"examples": ["pending"]}) diff --git a/talon_one/models/create_achievement.py b/talon_one/models/create_achievement.py index a55886f..d9e20c9 100644 --- a/talon_one/models/create_achievement.py +++ b/talon_one/models/create_achievement.py @@ -43,13 +43,10 @@ class CreateAchievement(BaseModel): allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="allowRollbackAfterCompletion", json_schema_extra={"examples": [False]}) __properties: ClassVar[List[str]] = ["name", "title", "description", "target", "period", "periodEndOverride", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[a-zA-Z]\w+$", value): + if isinstance(value, str) and not re.match(r"^[a-zA-Z]\w+$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z]\w+$/") return value diff --git a/talon_one/models/create_achievement_v2.py b/talon_one/models/create_achievement_v2.py index 6c79df8..142fbca 100644 --- a/talon_one/models/create_achievement_v2.py +++ b/talon_one/models/create_achievement_v2.py @@ -44,13 +44,10 @@ class CreateAchievementV2(BaseModel): timezone: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string containing an IANA timezone descriptor.", json_schema_extra={"examples": ["Europe/Berlin"]}) __properties: ClassVar[List[str]] = ["name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "subscribedApplications", "sandbox", "timezone"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[a-zA-Z]\w+$", value): + if isinstance(value, str) and not re.match(r"^[a-zA-Z]\w+$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z]\w+$/") return value diff --git a/talon_one/models/custom_effect.py b/talon_one/models/custom_effect.py index 026e6c1..b002d48 100644 --- a/talon_one/models/custom_effect.py +++ b/talon_one/models/custom_effect.py @@ -46,23 +46,17 @@ class CustomEffect(BaseModel): created_by: StrictInt = Field(description="ID of the user who created this effect.", alias="createdBy", json_schema_extra={"examples": [216]}) __properties: ClassVar[List[str]] = ["id", "created", "accountId", "modified", "applicationIds", "isPerItem", "name", "title", "payload", "description", "enabled", "params", "modifiedBy", "createdBy"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z](\w|\s)*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z](\w|\s)*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z](\w|\s)*$/") return value - @field_validator('title') + @field_validator('title', mode="before") def title_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): + if isinstance(value, str) and not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): raise ValueError(r"must validate the regular expression /^[^[:cntrl:]\s][^[:cntrl:]]*$/") return value diff --git a/talon_one/models/customer_achievement.py b/talon_one/models/customer_achievement.py index 9650e47..5162b23 100644 --- a/talon_one/models/customer_achievement.py +++ b/talon_one/models/customer_achievement.py @@ -43,13 +43,10 @@ class CustomerAchievement(BaseModel): current_progress: Optional[AchievementProgress] = Field(default=None, alias="currentProgress") __properties: ClassVar[List[str]] = ["id", "name", "title", "description", "target", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "currentProgress"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[a-zA-Z]\w+$", value): + if isinstance(value, str) and not re.match(r"^[a-zA-Z]\w+$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z]\w+$/") return value diff --git a/talon_one/models/customer_profile_reward.py b/talon_one/models/customer_profile_reward.py new file mode 100644 index 0000000..cd10a02 --- /dev/null +++ b/talon_one/models/customer_profile_reward.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CustomerProfileReward(BaseModel): + """ + A reward instance held by a customer profile. + """ # noqa: E501 + id: StrictInt = Field(description="The ID of the customer reward instance. A customer profile can have multiple instances of the same reward.", json_schema_extra={"examples": [6]}) + reward_id: StrictInt = Field(description="The ID of the reward this instance belongs to.", alias="rewardId", json_schema_extra={"examples": [12]}) + reward_name: StrictStr = Field(description="The name of the reward.", alias="rewardName", json_schema_extra={"examples": ["Free coffee"]}) + status: StrictStr = Field(description="The status of the customer reward: - `unlocked`: The reward is available for use. - `used`: The reward has been used. ", json_schema_extra={"examples": ["unlocked"]}) + unlocked_at: datetime = Field(description="The date and time when the reward was unlocked.", alias="unlockedAt", json_schema_extra={"examples": ["2026-07-01T09:00:00Z"]}) + unlocked_by_integration_id: Optional[StrictStr] = Field(default=None, description="The integration ID of the customer profile that unlocked the reward. For rewards unlocked with a loyalty card, this can be any customer profile linked to that loyalty card. ", alias="unlockedByIntegrationId", json_schema_extra={"examples": ["customer2839"]}) + used_at: Optional[datetime] = Field(default=None, description="The date and time when the reward was used.", alias="usedAt", json_schema_extra={"examples": ["2026-07-02T10:30:00Z"]}) + used_by_integration_id: Optional[StrictStr] = Field(default=None, description="The integration ID of the customer profile that used the reward. For rewards unlocked with a loyalty card, this can be any customer profile linked to that loyalty card. Only returned when the reward has been used. ", alias="usedByIntegrationId", json_schema_extra={"examples": ["customer2840"]}) + loyalty_program_id: Optional[StrictInt] = Field(default=None, description="The ID of the loyalty program that the loyalty card belongs to. Only returned for rewards unlocked with a loyalty card.", alias="loyaltyProgramId", json_schema_extra={"examples": [9]}) + loyalty_card_identifier: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=108)]] = Field(default=None, description="The identifier of the loyalty card that the reward was unlocked with. Only returned for rewards unlocked with a loyalty card.", alias="loyaltyCardIdentifier", json_schema_extra={"examples": ["summer-loyalty-card-0543"]}) + __properties: ClassVar[List[str]] = ["id", "rewardId", "rewardName", "status", "unlockedAt", "unlockedByIntegrationId", "usedAt", "usedByIntegrationId", "loyaltyProgramId", "loyaltyCardIdentifier"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['unlocked', 'used']): + raise ValueError("must be one of enum values ('unlocked', 'used')") + return value + + @field_validator('loyalty_card_identifier', mode="before") + def loyalty_card_identifier_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if isinstance(value, str) and not re.match(r"^[A-Za-z0-9._%+@-]+$", value): + raise ValueError(r"must validate the regular expression /^[A-Za-z0-9._%+@-]+$/") + 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 CustomerProfileReward 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 CustomerProfileReward 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"), + "rewardId": obj.get("rewardId"), + "rewardName": obj.get("rewardName"), + "status": obj.get("status"), + "unlockedAt": obj.get("unlockedAt"), + "unlockedByIntegrationId": obj.get("unlockedByIntegrationId"), + "usedAt": obj.get("usedAt"), + "usedByIntegrationId": obj.get("usedByIntegrationId"), + "loyaltyProgramId": obj.get("loyaltyProgramId"), + "loyaltyCardIdentifier": obj.get("loyaltyCardIdentifier") + }) + return _obj + + diff --git a/talon_one/models/customer_session.py b/talon_one/models/customer_session.py index eb07ce9..41629cc 100644 --- a/talon_one/models/customer_session.py +++ b/talon_one/models/customer_session.py @@ -40,7 +40,7 @@ class CustomerSession(BaseModel): cart_items: Optional[List[CartItem]] = Field(default=None, description="Serialized JSON representation.", alias="cartItems") identifiers: Optional[Annotated[List[StrictStr], Field(max_length=5)]] = Field(default=None, description="Session custom identifiers that you can set limits on or use inside your rules. For example, you can use IP addresses as identifiers to potentially identify devices and limit discounts abuse in case of customers creating multiple accounts. See the [tutorial](https://docs.talon.one/docs/dev/tutorials/using-identifiers). ", json_schema_extra={"examples": [["91.11.156.141"]]}) total: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total sum of the cart in one session.") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="A key-value map of the sessions attributes. The potentially valid attributes are configured in your accounts developer settings. ") first_session: StrictBool = Field(description="Indicates whether this is the first session for the customer's profile. Will always be true for anonymous sessions.", alias="firstSession", json_schema_extra={"examples": [True]}) update_count: StrictInt = Field(description="The number of times the session was updated. When the session is created, this value is initialized to `1`.", alias="updateCount", json_schema_extra={"examples": [3]}) discounts: Dict[str, Union[StrictFloat, StrictInt]] = Field(description="A map of labelled discount values, values will be in the same currency as the application associated with the session.") diff --git a/talon_one/models/deduct_loyalty_points_effect_props.py b/talon_one/models/deduct_loyalty_points_effect_props.py index a953337..4c1b364 100644 --- a/talon_one/models/deduct_loyalty_points_effect_props.py +++ b/talon_one/models/deduct_loyalty_points_effect_props.py @@ -37,16 +37,13 @@ class DeductLoyaltyPointsEffectProps(BaseModel): card_identifier: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=108)]] = Field(default=None, description="The identifier of the card from which these points were deducted.", alias="cardIdentifier", json_schema_extra={"examples": ["summer-loyalty-card-0543"]}) __properties: ClassVar[List[str]] = ["ruleTitle", "programId", "subLedgerId", "value", "transactionUUID", "name", "cardIdentifier"] - @field_validator('card_identifier') + @field_validator('card_identifier', mode="before") def card_identifier_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z0-9._%+@-]+$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z0-9._%+@-]+$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z0-9._%+@-]+$/") return value diff --git a/talon_one/models/between_check_attribute_block.py b/talon_one/models/digital_pass.py similarity index 67% rename from talon_one/models/between_check_attribute_block.py rename to talon_one/models/digital_pass.py index 6c5f1f6..3ee0f07 100644 --- a/talon_one/models/between_check_attribute_block.py +++ b/talon_one/models/digital_pass.py @@ -18,28 +18,26 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +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 BetweenCheckAttributeBlock(BaseModel): +class DigitalPass(BaseModel): """ - Variant of `CheckAttributeBlock` for the `between` operator, which requires both a minimum and maximum value. + DigitalPass """ # noqa: E501 - operator: Optional[StrictStr] = Field(default=None, description="The range comparison operator. Must be `between`.") - min: Optional[Any] - max: Optional[Any] - __properties: ClassVar[List[str]] = ["operator", "min", "max"] - - @field_validator('operator') - def operator_validate_enum(cls, value): + pass_id: StrictStr = Field(description="The ID of the generated digital pass.", alias="passId", json_schema_extra={"examples": ["pass_9c3f1a2b"]}) + pass_template_id: StrictStr = Field(description="The ID of the digital pass template used to generate the pass.", alias="passTemplateId", json_schema_extra={"examples": ["tmpl_summer_loyalty"]}) + status: StrictStr = Field(description="The status of the digital pass.", json_schema_extra={"examples": ["created"]}) + pass_url: StrictStr = Field(description="The URL you can use to let the customer add the digital pass to their wallet.", alias="passUrl", json_schema_extra={"examples": ["https://wallet.example.com/passes/pass_9c3f1a2b"]}) + __properties: ClassVar[List[str]] = ["passId", "passTemplateId", "status", "passUrl"] + + @field_validator('status') + def status_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - - if value not in set(['between']): - raise ValueError("must be one of enum values ('between')") + if value not in set(['created']): + raise ValueError("must be one of enum values ('created')") return value model_config = ConfigDict( @@ -60,7 +58,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetweenCheckAttributeBlock from a JSON string""" + """Create an instance of DigitalPass from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -81,21 +79,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # set to None if min (nullable) is None - # and model_fields_set contains the field - if self.min is None and "min" in self.model_fields_set: - _dict['min'] = None - - # set to None if max (nullable) is None - # and model_fields_set contains the field - if self.max is None and "max" in self.model_fields_set: - _dict['max'] = None - return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetweenCheckAttributeBlock from a dict""" + """Create an instance of DigitalPass from a dict""" if obj is None: return None @@ -103,9 +91,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "operator": obj.get("operator"), - "min": obj.get("min"), - "max": obj.get("max") + "passId": obj.get("passId"), + "passTemplateId": obj.get("passTemplateId"), + "status": obj.get("status"), + "passUrl": obj.get("passUrl") }) return _obj diff --git a/talon_one/models/list_with_count_check_attribute_block.py b/talon_one/models/discard_risks_request.py similarity index 65% rename from talon_one/models/list_with_count_check_attribute_block.py rename to talon_one/models/discard_risks_request.py index 715fc3b..ee4f0ca 100644 --- a/talon_one/models/list_with_count_check_attribute_block.py +++ b/talon_one/models/discard_risks_request.py @@ -17,29 +17,27 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python -class ListWithCountCheckAttributeBlock(BaseModel): +class DiscardRisksRequest(BaseModel): """ - Variant of `CheckAttributeBlock` for operators that test list membership with a minimum or exact count threshold. + DiscardRisksRequest """ # noqa: E501 - operator: Optional[StrictStr] = Field(default=None, description="The list membership operator with a count threshold applied to the attribute.") - values: Optional[Any] - count: Optional[Any] - __properties: ClassVar[List[str]] = ["operator", "values", "count"] + risk_ids: Annotated[List[StrictInt], Field(min_length=1, max_length=1000)] = Field(description="The IDs of the risks to discard.", alias="riskIds", json_schema_extra={"examples": [[1, 2, 3]]}) + reason: StrictStr = Field(description="The reason the risks are being discarded.", json_schema_extra={"examples": ["expected_behavior"]}) + comment: Optional[StrictStr] = Field(default=None, description="Free-text description of why the risks are being discarded. Required when `reason` is `other`, optional for `expected_behavior`. ", json_schema_extra={"examples": ["Duplicate of a risk already being handled."]}) + __properties: ClassVar[List[str]] = ["riskIds", "reason", "comment"] - @field_validator('operator') - def operator_validate_enum(cls, value): + @field_validator('reason') + def reason_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - - if value not in set(['containsAtLeast', 'containsExactly']): - raise ValueError("must be one of enum values ('containsAtLeast', 'containsExactly')") + if value not in set(['expected_behavior', 'other']): + raise ValueError("must be one of enum values ('expected_behavior', 'other')") return value model_config = ConfigDict( @@ -60,7 +58,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ListWithCountCheckAttributeBlock from a JSON string""" + """Create an instance of DiscardRisksRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -81,21 +79,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # set to None if values (nullable) is None - # and model_fields_set contains the field - if self.values is None and "values" in self.model_fields_set: - _dict['values'] = None - - # set to None if count (nullable) is None - # and model_fields_set contains the field - if self.count is None and "count" in self.model_fields_set: - _dict['count'] = None - return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListWithCountCheckAttributeBlock from a dict""" + """Create an instance of DiscardRisksRequest from a dict""" if obj is None: return None @@ -103,9 +91,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "operator": obj.get("operator"), - "values": obj.get("values"), - "count": obj.get("count") + "riskIds": obj.get("riskIds"), + "reason": obj.get("reason"), + "comment": obj.get("comment") }) return _obj diff --git a/talon_one/models/effect.py b/talon_one/models/effect.py index 3c4bf56..9951d74 100644 --- a/talon_one/models/effect.py +++ b/talon_one/models/effect.py @@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union from uuid import UUID +from talon_one.models.effect_all_of_props import EffectAllOfProps from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -44,7 +45,7 @@ class Effect(BaseModel): selected_price_type: Optional[StrictStr] = Field(default=None, description="The selected price type for the SKU targeted by this effect.", alias="selectedPriceType", json_schema_extra={"examples": ["member"]}) selected_price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The value of the selected price type to apply to the SKU targeted by this effect, before any discounts are applied.", alias="selectedPrice", json_schema_extra={"examples": [100]}) adjustment_reference_id: Optional[UUID] = Field(default=None, description="The reference identifier of the selected price adjustment for this SKU. This is only returned if the `selectedPrice` resulted from a price adjustment.", alias="adjustmentReferenceId", json_schema_extra={"examples": ["68851723-e6fa-488f-ace9-112581e6c19b"]}) - props: Optional[Any] + props: EffectAllOfProps __properties: ClassVar[List[str]] = ["experimentId", "campaignId", "rulesetId", "ruleIndex", "ruleName", "effectType", "triggeredByCoupon", "triggeredForCatalogItem", "conditionIndex", "evaluationGroupID", "evaluationGroupMode", "campaignRevisionId", "campaignRevisionVersionId", "selectedPriceType", "selectedPrice", "adjustmentReferenceId", "props"] model_config = ConfigDict( @@ -86,11 +87,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # set to None if props (nullable) is None - # and model_fields_set contains the field - if self.props is None and "props" in self.model_fields_set: - _dict['props'] = None - + # override the default output from pydantic by calling `to_dict()` of props + if self.props: + _dict['props'] = self.props.to_dict() return _dict @classmethod @@ -119,7 +118,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "selectedPriceType": obj.get("selectedPriceType"), "selectedPrice": obj.get("selectedPrice"), "adjustmentReferenceId": obj.get("adjustmentReferenceId"), - "props": obj.get("props") + "props": EffectAllOfProps.from_dict(obj["props"]) if obj.get("props") is not None else None }) return _obj diff --git a/talon_one/models/effect_all_of_props.py b/talon_one/models/effect_all_of_props.py new file mode 100644 index 0000000..0c00108 --- /dev/null +++ b/talon_one/models/effect_all_of_props.py @@ -0,0 +1,599 @@ +# 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from talon_one.models.accept_coupon_effect_props import AcceptCouponEffectProps +from talon_one.models.accept_referral_effect_props import AcceptReferralEffectProps +from talon_one.models.add_free_item_effect_props import AddFreeItemEffectProps +from talon_one.models.add_loyalty_points_effect_props import AddLoyaltyPointsEffectProps +from talon_one.models.add_to_audience_effect_props import AddToAudienceEffectProps +from talon_one.models.award_giveaway_effect_props import AwardGiveawayEffectProps +from talon_one.models.change_loyalty_tier_level_effect_props import ChangeLoyaltyTierLevelEffectProps +from talon_one.models.coupon_created_effect_props import CouponCreatedEffectProps +from talon_one.models.custom_effect_props import CustomEffectProps +from talon_one.models.deduct_loyalty_points_effect_props import DeductLoyaltyPointsEffectProps +from talon_one.models.error_effect_props import ErrorEffectProps +from talon_one.models.extend_loyalty_points_expiry_date_effect_props import ExtendLoyaltyPointsExpiryDateEffectProps +from talon_one.models.increase_achievement_progress_effect_props import IncreaseAchievementProgressEffectProps +from talon_one.models.redeem_referral_effect_props import RedeemReferralEffectProps +from talon_one.models.referral_created_effect_props import ReferralCreatedEffectProps +from talon_one.models.reject_coupon_effect_props import RejectCouponEffectProps +from talon_one.models.reject_referral_effect_props import RejectReferralEffectProps +from talon_one.models.remove_from_audience_effect_props import RemoveFromAudienceEffectProps +from talon_one.models.reserve_coupon_effect_props import ReserveCouponEffectProps +from talon_one.models.rollback_added_loyalty_points_effect_props import RollbackAddedLoyaltyPointsEffectProps +from talon_one.models.rollback_coupon_effect_props import RollbackCouponEffectProps +from talon_one.models.rollback_deducted_loyalty_points_effect_props import RollbackDeductedLoyaltyPointsEffectProps +from talon_one.models.rollback_discount_effect_props import RollbackDiscountEffectProps +from talon_one.models.rollback_increased_achievement_progress_effect_props import RollbackIncreasedAchievementProgressEffectProps +from talon_one.models.rollback_referral_effect_props import RollbackReferralEffectProps +from talon_one.models.set_discount_effect_props import SetDiscountEffectProps +from talon_one.models.set_discount_per_additional_cost_effect_props import SetDiscountPerAdditionalCostEffectProps +from talon_one.models.set_discount_per_additional_cost_per_item_effect_props import SetDiscountPerAdditionalCostPerItemEffectProps +from talon_one.models.set_discount_per_item_effect_props import SetDiscountPerItemEffectProps +from talon_one.models.set_loyalty_points_expiry_date_effect_props import SetLoyaltyPointsExpiryDateEffectProps +from talon_one.models.show_bundle_metadata_effect_props import ShowBundleMetadataEffectProps +from talon_one.models.show_notification_effect_props import ShowNotificationEffectProps +from talon_one.models.trigger_webhook_effect_props import TriggerWebhookEffectProps +from talon_one.models.update_attribute_effect_props import UpdateAttributeEffectProps +from talon_one.models.will_award_giveaway_effect_props import WillAwardGiveawayEffectProps +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +EFFECTALLOFPROPS_ONE_OF_SCHEMAS = ["AcceptCouponEffectProps", "AcceptReferralEffectProps", "AddFreeItemEffectProps", "AddLoyaltyPointsEffectProps", "AddToAudienceEffectProps", "AwardGiveawayEffectProps", "ChangeLoyaltyTierLevelEffectProps", "CouponCreatedEffectProps", "CustomEffectProps", "DeductLoyaltyPointsEffectProps", "ErrorEffectProps", "ExtendLoyaltyPointsExpiryDateEffectProps", "IncreaseAchievementProgressEffectProps", "RedeemReferralEffectProps", "ReferralCreatedEffectProps", "RejectCouponEffectProps", "RejectReferralEffectProps", "RemoveFromAudienceEffectProps", "ReserveCouponEffectProps", "RollbackAddedLoyaltyPointsEffectProps", "RollbackCouponEffectProps", "RollbackDeductedLoyaltyPointsEffectProps", "RollbackDiscountEffectProps", "RollbackIncreasedAchievementProgressEffectProps", "RollbackReferralEffectProps", "SetDiscountEffectProps", "SetDiscountPerAdditionalCostEffectProps", "SetDiscountPerAdditionalCostPerItemEffectProps", "SetDiscountPerItemEffectProps", "SetLoyaltyPointsExpiryDateEffectProps", "ShowBundleMetadataEffectProps", "ShowNotificationEffectProps", "TriggerWebhookEffectProps", "UpdateAttributeEffectProps", "WillAwardGiveawayEffectProps"] + +class EffectAllOfProps(BaseModel): + """ + EffectAllOfProps + """ + # data type: AcceptCouponEffectProps + oneof_schema_1_validator: Optional[AcceptCouponEffectProps] = None + # data type: AcceptReferralEffectProps + oneof_schema_2_validator: Optional[AcceptReferralEffectProps] = None + # data type: RedeemReferralEffectProps + oneof_schema_3_validator: Optional[RedeemReferralEffectProps] = None + # data type: RejectCouponEffectProps + oneof_schema_4_validator: Optional[RejectCouponEffectProps] = None + # data type: RejectReferralEffectProps + oneof_schema_5_validator: Optional[RejectReferralEffectProps] = None + # data type: CouponCreatedEffectProps + oneof_schema_6_validator: Optional[CouponCreatedEffectProps] = None + # data type: ReferralCreatedEffectProps + oneof_schema_7_validator: Optional[ReferralCreatedEffectProps] = None + # data type: SetDiscountEffectProps + oneof_schema_8_validator: Optional[SetDiscountEffectProps] = None + # data type: SetDiscountPerItemEffectProps + oneof_schema_9_validator: Optional[SetDiscountPerItemEffectProps] = None + # data type: SetDiscountPerAdditionalCostEffectProps + oneof_schema_10_validator: Optional[SetDiscountPerAdditionalCostEffectProps] = None + # data type: TriggerWebhookEffectProps + oneof_schema_11_validator: Optional[TriggerWebhookEffectProps] = None + # data type: AddLoyaltyPointsEffectProps + oneof_schema_12_validator: Optional[AddLoyaltyPointsEffectProps] = None + # data type: DeductLoyaltyPointsEffectProps + oneof_schema_13_validator: Optional[DeductLoyaltyPointsEffectProps] = None + # data type: ChangeLoyaltyTierLevelEffectProps + oneof_schema_14_validator: Optional[ChangeLoyaltyTierLevelEffectProps] = None + # data type: AddFreeItemEffectProps + oneof_schema_15_validator: Optional[AddFreeItemEffectProps] = None + # data type: ShowNotificationEffectProps + oneof_schema_16_validator: Optional[ShowNotificationEffectProps] = None + # data type: UpdateAttributeEffectProps + oneof_schema_17_validator: Optional[UpdateAttributeEffectProps] = None + # data type: RollbackCouponEffectProps + oneof_schema_18_validator: Optional[RollbackCouponEffectProps] = None + # data type: RollbackReferralEffectProps + oneof_schema_19_validator: Optional[RollbackReferralEffectProps] = None + # data type: RollbackDiscountEffectProps + oneof_schema_20_validator: Optional[RollbackDiscountEffectProps] = None + # data type: RollbackAddedLoyaltyPointsEffectProps + oneof_schema_21_validator: Optional[RollbackAddedLoyaltyPointsEffectProps] = None + # data type: RollbackDeductedLoyaltyPointsEffectProps + oneof_schema_22_validator: Optional[RollbackDeductedLoyaltyPointsEffectProps] = None + # data type: ShowBundleMetadataEffectProps + oneof_schema_23_validator: Optional[ShowBundleMetadataEffectProps] = None + # data type: AwardGiveawayEffectProps + oneof_schema_24_validator: Optional[AwardGiveawayEffectProps] = None + # data type: WillAwardGiveawayEffectProps + oneof_schema_25_validator: Optional[WillAwardGiveawayEffectProps] = None + # data type: ErrorEffectProps + oneof_schema_26_validator: Optional[ErrorEffectProps] = None + # data type: CustomEffectProps + oneof_schema_27_validator: Optional[CustomEffectProps] = None + # data type: SetDiscountPerAdditionalCostPerItemEffectProps + oneof_schema_28_validator: Optional[SetDiscountPerAdditionalCostPerItemEffectProps] = None + # data type: ReserveCouponEffectProps + oneof_schema_29_validator: Optional[ReserveCouponEffectProps] = None + # data type: AddToAudienceEffectProps + oneof_schema_30_validator: Optional[AddToAudienceEffectProps] = None + # data type: RemoveFromAudienceEffectProps + oneof_schema_31_validator: Optional[RemoveFromAudienceEffectProps] = None + # data type: IncreaseAchievementProgressEffectProps + oneof_schema_32_validator: Optional[IncreaseAchievementProgressEffectProps] = None + # data type: RollbackIncreasedAchievementProgressEffectProps + oneof_schema_33_validator: Optional[RollbackIncreasedAchievementProgressEffectProps] = None + # data type: ExtendLoyaltyPointsExpiryDateEffectProps + oneof_schema_34_validator: Optional[ExtendLoyaltyPointsExpiryDateEffectProps] = None + # data type: SetLoyaltyPointsExpiryDateEffectProps + oneof_schema_35_validator: Optional[SetLoyaltyPointsExpiryDateEffectProps] = None + actual_instance: Optional[Union[AcceptCouponEffectProps, AcceptReferralEffectProps, AddFreeItemEffectProps, AddLoyaltyPointsEffectProps, AddToAudienceEffectProps, AwardGiveawayEffectProps, ChangeLoyaltyTierLevelEffectProps, CouponCreatedEffectProps, CustomEffectProps, DeductLoyaltyPointsEffectProps, ErrorEffectProps, ExtendLoyaltyPointsExpiryDateEffectProps, IncreaseAchievementProgressEffectProps, RedeemReferralEffectProps, ReferralCreatedEffectProps, RejectCouponEffectProps, RejectReferralEffectProps, RemoveFromAudienceEffectProps, ReserveCouponEffectProps, RollbackAddedLoyaltyPointsEffectProps, RollbackCouponEffectProps, RollbackDeductedLoyaltyPointsEffectProps, RollbackDiscountEffectProps, RollbackIncreasedAchievementProgressEffectProps, RollbackReferralEffectProps, SetDiscountEffectProps, SetDiscountPerAdditionalCostEffectProps, SetDiscountPerAdditionalCostPerItemEffectProps, SetDiscountPerItemEffectProps, SetLoyaltyPointsExpiryDateEffectProps, ShowBundleMetadataEffectProps, ShowNotificationEffectProps, TriggerWebhookEffectProps, UpdateAttributeEffectProps, WillAwardGiveawayEffectProps]] = None + one_of_schemas: Set[str] = { "AcceptCouponEffectProps", "AcceptReferralEffectProps", "AddFreeItemEffectProps", "AddLoyaltyPointsEffectProps", "AddToAudienceEffectProps", "AwardGiveawayEffectProps", "ChangeLoyaltyTierLevelEffectProps", "CouponCreatedEffectProps", "CustomEffectProps", "DeductLoyaltyPointsEffectProps", "ErrorEffectProps", "ExtendLoyaltyPointsExpiryDateEffectProps", "IncreaseAchievementProgressEffectProps", "RedeemReferralEffectProps", "ReferralCreatedEffectProps", "RejectCouponEffectProps", "RejectReferralEffectProps", "RemoveFromAudienceEffectProps", "ReserveCouponEffectProps", "RollbackAddedLoyaltyPointsEffectProps", "RollbackCouponEffectProps", "RollbackDeductedLoyaltyPointsEffectProps", "RollbackDiscountEffectProps", "RollbackIncreasedAchievementProgressEffectProps", "RollbackReferralEffectProps", "SetDiscountEffectProps", "SetDiscountPerAdditionalCostEffectProps", "SetDiscountPerAdditionalCostPerItemEffectProps", "SetDiscountPerItemEffectProps", "SetLoyaltyPointsExpiryDateEffectProps", "ShowBundleMetadataEffectProps", "ShowNotificationEffectProps", "TriggerWebhookEffectProps", "UpdateAttributeEffectProps", "WillAwardGiveawayEffectProps" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = EffectAllOfProps.model_construct() + error_messages = [] + match = 0 + # validate data type: AcceptCouponEffectProps + if not isinstance(v, AcceptCouponEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `AcceptCouponEffectProps`") + else: + match += 1 + # validate data type: AcceptReferralEffectProps + if not isinstance(v, AcceptReferralEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `AcceptReferralEffectProps`") + else: + match += 1 + # validate data type: RedeemReferralEffectProps + if not isinstance(v, RedeemReferralEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RedeemReferralEffectProps`") + else: + match += 1 + # validate data type: RejectCouponEffectProps + if not isinstance(v, RejectCouponEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RejectCouponEffectProps`") + else: + match += 1 + # validate data type: RejectReferralEffectProps + if not isinstance(v, RejectReferralEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RejectReferralEffectProps`") + else: + match += 1 + # validate data type: CouponCreatedEffectProps + if not isinstance(v, CouponCreatedEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `CouponCreatedEffectProps`") + else: + match += 1 + # validate data type: ReferralCreatedEffectProps + if not isinstance(v, ReferralCreatedEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `ReferralCreatedEffectProps`") + else: + match += 1 + # validate data type: SetDiscountEffectProps + if not isinstance(v, SetDiscountEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `SetDiscountEffectProps`") + else: + match += 1 + # validate data type: SetDiscountPerItemEffectProps + if not isinstance(v, SetDiscountPerItemEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `SetDiscountPerItemEffectProps`") + else: + match += 1 + # validate data type: SetDiscountPerAdditionalCostEffectProps + if not isinstance(v, SetDiscountPerAdditionalCostEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `SetDiscountPerAdditionalCostEffectProps`") + else: + match += 1 + # validate data type: TriggerWebhookEffectProps + if not isinstance(v, TriggerWebhookEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `TriggerWebhookEffectProps`") + else: + match += 1 + # validate data type: AddLoyaltyPointsEffectProps + if not isinstance(v, AddLoyaltyPointsEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `AddLoyaltyPointsEffectProps`") + else: + match += 1 + # validate data type: DeductLoyaltyPointsEffectProps + if not isinstance(v, DeductLoyaltyPointsEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `DeductLoyaltyPointsEffectProps`") + else: + match += 1 + # validate data type: ChangeLoyaltyTierLevelEffectProps + if not isinstance(v, ChangeLoyaltyTierLevelEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `ChangeLoyaltyTierLevelEffectProps`") + else: + match += 1 + # validate data type: AddFreeItemEffectProps + if not isinstance(v, AddFreeItemEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `AddFreeItemEffectProps`") + else: + match += 1 + # validate data type: ShowNotificationEffectProps + if not isinstance(v, ShowNotificationEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `ShowNotificationEffectProps`") + else: + match += 1 + # validate data type: UpdateAttributeEffectProps + if not isinstance(v, UpdateAttributeEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateAttributeEffectProps`") + else: + match += 1 + # validate data type: RollbackCouponEffectProps + if not isinstance(v, RollbackCouponEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RollbackCouponEffectProps`") + else: + match += 1 + # validate data type: RollbackReferralEffectProps + if not isinstance(v, RollbackReferralEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RollbackReferralEffectProps`") + else: + match += 1 + # validate data type: RollbackDiscountEffectProps + if not isinstance(v, RollbackDiscountEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RollbackDiscountEffectProps`") + else: + match += 1 + # validate data type: RollbackAddedLoyaltyPointsEffectProps + if not isinstance(v, RollbackAddedLoyaltyPointsEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RollbackAddedLoyaltyPointsEffectProps`") + else: + match += 1 + # validate data type: RollbackDeductedLoyaltyPointsEffectProps + if not isinstance(v, RollbackDeductedLoyaltyPointsEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RollbackDeductedLoyaltyPointsEffectProps`") + else: + match += 1 + # validate data type: ShowBundleMetadataEffectProps + if not isinstance(v, ShowBundleMetadataEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `ShowBundleMetadataEffectProps`") + else: + match += 1 + # validate data type: AwardGiveawayEffectProps + if not isinstance(v, AwardGiveawayEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `AwardGiveawayEffectProps`") + else: + match += 1 + # validate data type: WillAwardGiveawayEffectProps + if not isinstance(v, WillAwardGiveawayEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `WillAwardGiveawayEffectProps`") + else: + match += 1 + # validate data type: ErrorEffectProps + if not isinstance(v, ErrorEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `ErrorEffectProps`") + else: + match += 1 + # validate data type: CustomEffectProps + if not isinstance(v, CustomEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `CustomEffectProps`") + else: + match += 1 + # validate data type: SetDiscountPerAdditionalCostPerItemEffectProps + if not isinstance(v, SetDiscountPerAdditionalCostPerItemEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `SetDiscountPerAdditionalCostPerItemEffectProps`") + else: + match += 1 + # validate data type: ReserveCouponEffectProps + if not isinstance(v, ReserveCouponEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `ReserveCouponEffectProps`") + else: + match += 1 + # validate data type: AddToAudienceEffectProps + if not isinstance(v, AddToAudienceEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `AddToAudienceEffectProps`") + else: + match += 1 + # validate data type: RemoveFromAudienceEffectProps + if not isinstance(v, RemoveFromAudienceEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RemoveFromAudienceEffectProps`") + else: + match += 1 + # validate data type: IncreaseAchievementProgressEffectProps + if not isinstance(v, IncreaseAchievementProgressEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `IncreaseAchievementProgressEffectProps`") + else: + match += 1 + # validate data type: RollbackIncreasedAchievementProgressEffectProps + if not isinstance(v, RollbackIncreasedAchievementProgressEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RollbackIncreasedAchievementProgressEffectProps`") + else: + match += 1 + # validate data type: ExtendLoyaltyPointsExpiryDateEffectProps + if not isinstance(v, ExtendLoyaltyPointsExpiryDateEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `ExtendLoyaltyPointsExpiryDateEffectProps`") + else: + match += 1 + # validate data type: SetLoyaltyPointsExpiryDateEffectProps + if not isinstance(v, SetLoyaltyPointsExpiryDateEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `SetLoyaltyPointsExpiryDateEffectProps`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in EffectAllOfProps with oneOf schemas: AcceptCouponEffectProps, AcceptReferralEffectProps, AddFreeItemEffectProps, AddLoyaltyPointsEffectProps, AddToAudienceEffectProps, AwardGiveawayEffectProps, ChangeLoyaltyTierLevelEffectProps, CouponCreatedEffectProps, CustomEffectProps, DeductLoyaltyPointsEffectProps, ErrorEffectProps, ExtendLoyaltyPointsExpiryDateEffectProps, IncreaseAchievementProgressEffectProps, RedeemReferralEffectProps, ReferralCreatedEffectProps, RejectCouponEffectProps, RejectReferralEffectProps, RemoveFromAudienceEffectProps, ReserveCouponEffectProps, RollbackAddedLoyaltyPointsEffectProps, RollbackCouponEffectProps, RollbackDeductedLoyaltyPointsEffectProps, RollbackDiscountEffectProps, RollbackIncreasedAchievementProgressEffectProps, RollbackReferralEffectProps, SetDiscountEffectProps, SetDiscountPerAdditionalCostEffectProps, SetDiscountPerAdditionalCostPerItemEffectProps, SetDiscountPerItemEffectProps, SetLoyaltyPointsExpiryDateEffectProps, ShowBundleMetadataEffectProps, ShowNotificationEffectProps, TriggerWebhookEffectProps, UpdateAttributeEffectProps, WillAwardGiveawayEffectProps. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in EffectAllOfProps with oneOf schemas: AcceptCouponEffectProps, AcceptReferralEffectProps, AddFreeItemEffectProps, AddLoyaltyPointsEffectProps, AddToAudienceEffectProps, AwardGiveawayEffectProps, ChangeLoyaltyTierLevelEffectProps, CouponCreatedEffectProps, CustomEffectProps, DeductLoyaltyPointsEffectProps, ErrorEffectProps, ExtendLoyaltyPointsExpiryDateEffectProps, IncreaseAchievementProgressEffectProps, RedeemReferralEffectProps, ReferralCreatedEffectProps, RejectCouponEffectProps, RejectReferralEffectProps, RemoveFromAudienceEffectProps, ReserveCouponEffectProps, RollbackAddedLoyaltyPointsEffectProps, RollbackCouponEffectProps, RollbackDeductedLoyaltyPointsEffectProps, RollbackDiscountEffectProps, RollbackIncreasedAchievementProgressEffectProps, RollbackReferralEffectProps, SetDiscountEffectProps, SetDiscountPerAdditionalCostEffectProps, SetDiscountPerAdditionalCostPerItemEffectProps, SetDiscountPerItemEffectProps, SetLoyaltyPointsExpiryDateEffectProps, ShowBundleMetadataEffectProps, ShowNotificationEffectProps, TriggerWebhookEffectProps, UpdateAttributeEffectProps, WillAwardGiveawayEffectProps. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into AcceptCouponEffectProps + try: + instance.actual_instance = AcceptCouponEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AcceptReferralEffectProps + try: + instance.actual_instance = AcceptReferralEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RedeemReferralEffectProps + try: + instance.actual_instance = RedeemReferralEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RejectCouponEffectProps + try: + instance.actual_instance = RejectCouponEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RejectReferralEffectProps + try: + instance.actual_instance = RejectReferralEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CouponCreatedEffectProps + try: + instance.actual_instance = CouponCreatedEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ReferralCreatedEffectProps + try: + instance.actual_instance = ReferralCreatedEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into SetDiscountEffectProps + try: + instance.actual_instance = SetDiscountEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into SetDiscountPerItemEffectProps + try: + instance.actual_instance = SetDiscountPerItemEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into SetDiscountPerAdditionalCostEffectProps + try: + instance.actual_instance = SetDiscountPerAdditionalCostEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into TriggerWebhookEffectProps + try: + instance.actual_instance = TriggerWebhookEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AddLoyaltyPointsEffectProps + try: + instance.actual_instance = AddLoyaltyPointsEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into DeductLoyaltyPointsEffectProps + try: + instance.actual_instance = DeductLoyaltyPointsEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ChangeLoyaltyTierLevelEffectProps + try: + instance.actual_instance = ChangeLoyaltyTierLevelEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AddFreeItemEffectProps + try: + instance.actual_instance = AddFreeItemEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ShowNotificationEffectProps + try: + instance.actual_instance = ShowNotificationEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into UpdateAttributeEffectProps + try: + instance.actual_instance = UpdateAttributeEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RollbackCouponEffectProps + try: + instance.actual_instance = RollbackCouponEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RollbackReferralEffectProps + try: + instance.actual_instance = RollbackReferralEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RollbackDiscountEffectProps + try: + instance.actual_instance = RollbackDiscountEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RollbackAddedLoyaltyPointsEffectProps + try: + instance.actual_instance = RollbackAddedLoyaltyPointsEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RollbackDeductedLoyaltyPointsEffectProps + try: + instance.actual_instance = RollbackDeductedLoyaltyPointsEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ShowBundleMetadataEffectProps + try: + instance.actual_instance = ShowBundleMetadataEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AwardGiveawayEffectProps + try: + instance.actual_instance = AwardGiveawayEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into WillAwardGiveawayEffectProps + try: + instance.actual_instance = WillAwardGiveawayEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ErrorEffectProps + try: + instance.actual_instance = ErrorEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CustomEffectProps + try: + instance.actual_instance = CustomEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into SetDiscountPerAdditionalCostPerItemEffectProps + try: + instance.actual_instance = SetDiscountPerAdditionalCostPerItemEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ReserveCouponEffectProps + try: + instance.actual_instance = ReserveCouponEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AddToAudienceEffectProps + try: + instance.actual_instance = AddToAudienceEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RemoveFromAudienceEffectProps + try: + instance.actual_instance = RemoveFromAudienceEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IncreaseAchievementProgressEffectProps + try: + instance.actual_instance = IncreaseAchievementProgressEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RollbackIncreasedAchievementProgressEffectProps + try: + instance.actual_instance = RollbackIncreasedAchievementProgressEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ExtendLoyaltyPointsExpiryDateEffectProps + try: + instance.actual_instance = ExtendLoyaltyPointsExpiryDateEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into SetLoyaltyPointsExpiryDateEffectProps + try: + instance.actual_instance = SetLoyaltyPointsExpiryDateEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into EffectAllOfProps with oneOf schemas: AcceptCouponEffectProps, AcceptReferralEffectProps, AddFreeItemEffectProps, AddLoyaltyPointsEffectProps, AddToAudienceEffectProps, AwardGiveawayEffectProps, ChangeLoyaltyTierLevelEffectProps, CouponCreatedEffectProps, CustomEffectProps, DeductLoyaltyPointsEffectProps, ErrorEffectProps, ExtendLoyaltyPointsExpiryDateEffectProps, IncreaseAchievementProgressEffectProps, RedeemReferralEffectProps, ReferralCreatedEffectProps, RejectCouponEffectProps, RejectReferralEffectProps, RemoveFromAudienceEffectProps, ReserveCouponEffectProps, RollbackAddedLoyaltyPointsEffectProps, RollbackCouponEffectProps, RollbackDeductedLoyaltyPointsEffectProps, RollbackDiscountEffectProps, RollbackIncreasedAchievementProgressEffectProps, RollbackReferralEffectProps, SetDiscountEffectProps, SetDiscountPerAdditionalCostEffectProps, SetDiscountPerAdditionalCostPerItemEffectProps, SetDiscountPerItemEffectProps, SetLoyaltyPointsExpiryDateEffectProps, ShowBundleMetadataEffectProps, ShowNotificationEffectProps, TriggerWebhookEffectProps, UpdateAttributeEffectProps, WillAwardGiveawayEffectProps. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into EffectAllOfProps with oneOf schemas: AcceptCouponEffectProps, AcceptReferralEffectProps, AddFreeItemEffectProps, AddLoyaltyPointsEffectProps, AddToAudienceEffectProps, AwardGiveawayEffectProps, ChangeLoyaltyTierLevelEffectProps, CouponCreatedEffectProps, CustomEffectProps, DeductLoyaltyPointsEffectProps, ErrorEffectProps, ExtendLoyaltyPointsExpiryDateEffectProps, IncreaseAchievementProgressEffectProps, RedeemReferralEffectProps, ReferralCreatedEffectProps, RejectCouponEffectProps, RejectReferralEffectProps, RemoveFromAudienceEffectProps, ReserveCouponEffectProps, RollbackAddedLoyaltyPointsEffectProps, RollbackCouponEffectProps, RollbackDeductedLoyaltyPointsEffectProps, RollbackDiscountEffectProps, RollbackIncreasedAchievementProgressEffectProps, RollbackReferralEffectProps, SetDiscountEffectProps, SetDiscountPerAdditionalCostEffectProps, SetDiscountPerAdditionalCostPerItemEffectProps, SetDiscountPerItemEffectProps, SetLoyaltyPointsExpiryDateEffectProps, ShowBundleMetadataEffectProps, ShowNotificationEffectProps, TriggerWebhookEffectProps, UpdateAttributeEffectProps, WillAwardGiveawayEffectProps. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], AcceptCouponEffectProps, AcceptReferralEffectProps, AddFreeItemEffectProps, AddLoyaltyPointsEffectProps, AddToAudienceEffectProps, AwardGiveawayEffectProps, ChangeLoyaltyTierLevelEffectProps, CouponCreatedEffectProps, CustomEffectProps, DeductLoyaltyPointsEffectProps, ErrorEffectProps, ExtendLoyaltyPointsExpiryDateEffectProps, IncreaseAchievementProgressEffectProps, RedeemReferralEffectProps, ReferralCreatedEffectProps, RejectCouponEffectProps, RejectReferralEffectProps, RemoveFromAudienceEffectProps, ReserveCouponEffectProps, RollbackAddedLoyaltyPointsEffectProps, RollbackCouponEffectProps, RollbackDeductedLoyaltyPointsEffectProps, RollbackDiscountEffectProps, RollbackIncreasedAchievementProgressEffectProps, RollbackReferralEffectProps, SetDiscountEffectProps, SetDiscountPerAdditionalCostEffectProps, SetDiscountPerAdditionalCostPerItemEffectProps, SetDiscountPerItemEffectProps, SetLoyaltyPointsExpiryDateEffectProps, ShowBundleMetadataEffectProps, ShowNotificationEffectProps, TriggerWebhookEffectProps, UpdateAttributeEffectProps, WillAwardGiveawayEffectProps]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/talon_one/models/effect_props.py b/talon_one/models/effect_props.py new file mode 100644 index 0000000..b09c93b --- /dev/null +++ b/talon_one/models/effect_props.py @@ -0,0 +1,599 @@ +# 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from talon_one.models.accept_coupon_effect_props import AcceptCouponEffectProps +from talon_one.models.accept_referral_effect_props import AcceptReferralEffectProps +from talon_one.models.add_free_item_effect_props import AddFreeItemEffectProps +from talon_one.models.add_loyalty_points_effect_props import AddLoyaltyPointsEffectProps +from talon_one.models.add_to_audience_effect_props import AddToAudienceEffectProps +from talon_one.models.award_giveaway_effect_props import AwardGiveawayEffectProps +from talon_one.models.change_loyalty_tier_level_effect_props import ChangeLoyaltyTierLevelEffectProps +from talon_one.models.coupon_created_effect_props import CouponCreatedEffectProps +from talon_one.models.custom_effect_props import CustomEffectProps +from talon_one.models.deduct_loyalty_points_effect_props import DeductLoyaltyPointsEffectProps +from talon_one.models.error_effect_props import ErrorEffectProps +from talon_one.models.extend_loyalty_points_expiry_date_effect_props import ExtendLoyaltyPointsExpiryDateEffectProps +from talon_one.models.increase_achievement_progress_effect_props import IncreaseAchievementProgressEffectProps +from talon_one.models.redeem_referral_effect_props import RedeemReferralEffectProps +from talon_one.models.referral_created_effect_props import ReferralCreatedEffectProps +from talon_one.models.reject_coupon_effect_props import RejectCouponEffectProps +from talon_one.models.reject_referral_effect_props import RejectReferralEffectProps +from talon_one.models.remove_from_audience_effect_props import RemoveFromAudienceEffectProps +from talon_one.models.reserve_coupon_effect_props import ReserveCouponEffectProps +from talon_one.models.rollback_added_loyalty_points_effect_props import RollbackAddedLoyaltyPointsEffectProps +from talon_one.models.rollback_coupon_effect_props import RollbackCouponEffectProps +from talon_one.models.rollback_deducted_loyalty_points_effect_props import RollbackDeductedLoyaltyPointsEffectProps +from talon_one.models.rollback_discount_effect_props import RollbackDiscountEffectProps +from talon_one.models.rollback_increased_achievement_progress_effect_props import RollbackIncreasedAchievementProgressEffectProps +from talon_one.models.rollback_referral_effect_props import RollbackReferralEffectProps +from talon_one.models.set_discount_effect_props import SetDiscountEffectProps +from talon_one.models.set_discount_per_additional_cost_effect_props import SetDiscountPerAdditionalCostEffectProps +from talon_one.models.set_discount_per_additional_cost_per_item_effect_props import SetDiscountPerAdditionalCostPerItemEffectProps +from talon_one.models.set_discount_per_item_effect_props import SetDiscountPerItemEffectProps +from talon_one.models.set_loyalty_points_expiry_date_effect_props import SetLoyaltyPointsExpiryDateEffectProps +from talon_one.models.show_bundle_metadata_effect_props import ShowBundleMetadataEffectProps +from talon_one.models.show_notification_effect_props import ShowNotificationEffectProps +from talon_one.models.trigger_webhook_effect_props import TriggerWebhookEffectProps +from talon_one.models.update_attribute_effect_props import UpdateAttributeEffectProps +from talon_one.models.will_award_giveaway_effect_props import WillAwardGiveawayEffectProps +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +EFFECTPROPS_ONE_OF_SCHEMAS = ["AcceptCouponEffectProps", "AcceptReferralEffectProps", "AddFreeItemEffectProps", "AddLoyaltyPointsEffectProps", "AddToAudienceEffectProps", "AwardGiveawayEffectProps", "ChangeLoyaltyTierLevelEffectProps", "CouponCreatedEffectProps", "CustomEffectProps", "DeductLoyaltyPointsEffectProps", "ErrorEffectProps", "ExtendLoyaltyPointsExpiryDateEffectProps", "IncreaseAchievementProgressEffectProps", "RedeemReferralEffectProps", "ReferralCreatedEffectProps", "RejectCouponEffectProps", "RejectReferralEffectProps", "RemoveFromAudienceEffectProps", "ReserveCouponEffectProps", "RollbackAddedLoyaltyPointsEffectProps", "RollbackCouponEffectProps", "RollbackDeductedLoyaltyPointsEffectProps", "RollbackDiscountEffectProps", "RollbackIncreasedAchievementProgressEffectProps", "RollbackReferralEffectProps", "SetDiscountEffectProps", "SetDiscountPerAdditionalCostEffectProps", "SetDiscountPerAdditionalCostPerItemEffectProps", "SetDiscountPerItemEffectProps", "SetLoyaltyPointsExpiryDateEffectProps", "ShowBundleMetadataEffectProps", "ShowNotificationEffectProps", "TriggerWebhookEffectProps", "UpdateAttributeEffectProps", "WillAwardGiveawayEffectProps"] + +class EffectProps(BaseModel): + """ + The properties of the effect. See [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects). + """ + # data type: AcceptCouponEffectProps + oneof_schema_1_validator: Optional[AcceptCouponEffectProps] = None + # data type: AcceptReferralEffectProps + oneof_schema_2_validator: Optional[AcceptReferralEffectProps] = None + # data type: RedeemReferralEffectProps + oneof_schema_3_validator: Optional[RedeemReferralEffectProps] = None + # data type: RejectCouponEffectProps + oneof_schema_4_validator: Optional[RejectCouponEffectProps] = None + # data type: RejectReferralEffectProps + oneof_schema_5_validator: Optional[RejectReferralEffectProps] = None + # data type: CouponCreatedEffectProps + oneof_schema_6_validator: Optional[CouponCreatedEffectProps] = None + # data type: ReferralCreatedEffectProps + oneof_schema_7_validator: Optional[ReferralCreatedEffectProps] = None + # data type: SetDiscountEffectProps + oneof_schema_8_validator: Optional[SetDiscountEffectProps] = None + # data type: SetDiscountPerItemEffectProps + oneof_schema_9_validator: Optional[SetDiscountPerItemEffectProps] = None + # data type: SetDiscountPerAdditionalCostEffectProps + oneof_schema_10_validator: Optional[SetDiscountPerAdditionalCostEffectProps] = None + # data type: TriggerWebhookEffectProps + oneof_schema_11_validator: Optional[TriggerWebhookEffectProps] = None + # data type: AddLoyaltyPointsEffectProps + oneof_schema_12_validator: Optional[AddLoyaltyPointsEffectProps] = None + # data type: DeductLoyaltyPointsEffectProps + oneof_schema_13_validator: Optional[DeductLoyaltyPointsEffectProps] = None + # data type: ChangeLoyaltyTierLevelEffectProps + oneof_schema_14_validator: Optional[ChangeLoyaltyTierLevelEffectProps] = None + # data type: AddFreeItemEffectProps + oneof_schema_15_validator: Optional[AddFreeItemEffectProps] = None + # data type: ShowNotificationEffectProps + oneof_schema_16_validator: Optional[ShowNotificationEffectProps] = None + # data type: UpdateAttributeEffectProps + oneof_schema_17_validator: Optional[UpdateAttributeEffectProps] = None + # data type: RollbackCouponEffectProps + oneof_schema_18_validator: Optional[RollbackCouponEffectProps] = None + # data type: RollbackReferralEffectProps + oneof_schema_19_validator: Optional[RollbackReferralEffectProps] = None + # data type: RollbackDiscountEffectProps + oneof_schema_20_validator: Optional[RollbackDiscountEffectProps] = None + # data type: RollbackAddedLoyaltyPointsEffectProps + oneof_schema_21_validator: Optional[RollbackAddedLoyaltyPointsEffectProps] = None + # data type: RollbackDeductedLoyaltyPointsEffectProps + oneof_schema_22_validator: Optional[RollbackDeductedLoyaltyPointsEffectProps] = None + # data type: ShowBundleMetadataEffectProps + oneof_schema_23_validator: Optional[ShowBundleMetadataEffectProps] = None + # data type: AwardGiveawayEffectProps + oneof_schema_24_validator: Optional[AwardGiveawayEffectProps] = None + # data type: WillAwardGiveawayEffectProps + oneof_schema_25_validator: Optional[WillAwardGiveawayEffectProps] = None + # data type: ErrorEffectProps + oneof_schema_26_validator: Optional[ErrorEffectProps] = None + # data type: CustomEffectProps + oneof_schema_27_validator: Optional[CustomEffectProps] = None + # data type: SetDiscountPerAdditionalCostPerItemEffectProps + oneof_schema_28_validator: Optional[SetDiscountPerAdditionalCostPerItemEffectProps] = None + # data type: ReserveCouponEffectProps + oneof_schema_29_validator: Optional[ReserveCouponEffectProps] = None + # data type: AddToAudienceEffectProps + oneof_schema_30_validator: Optional[AddToAudienceEffectProps] = None + # data type: RemoveFromAudienceEffectProps + oneof_schema_31_validator: Optional[RemoveFromAudienceEffectProps] = None + # data type: IncreaseAchievementProgressEffectProps + oneof_schema_32_validator: Optional[IncreaseAchievementProgressEffectProps] = None + # data type: RollbackIncreasedAchievementProgressEffectProps + oneof_schema_33_validator: Optional[RollbackIncreasedAchievementProgressEffectProps] = None + # data type: ExtendLoyaltyPointsExpiryDateEffectProps + oneof_schema_34_validator: Optional[ExtendLoyaltyPointsExpiryDateEffectProps] = None + # data type: SetLoyaltyPointsExpiryDateEffectProps + oneof_schema_35_validator: Optional[SetLoyaltyPointsExpiryDateEffectProps] = None + actual_instance: Optional[Union[AcceptCouponEffectProps, AcceptReferralEffectProps, AddFreeItemEffectProps, AddLoyaltyPointsEffectProps, AddToAudienceEffectProps, AwardGiveawayEffectProps, ChangeLoyaltyTierLevelEffectProps, CouponCreatedEffectProps, CustomEffectProps, DeductLoyaltyPointsEffectProps, ErrorEffectProps, ExtendLoyaltyPointsExpiryDateEffectProps, IncreaseAchievementProgressEffectProps, RedeemReferralEffectProps, ReferralCreatedEffectProps, RejectCouponEffectProps, RejectReferralEffectProps, RemoveFromAudienceEffectProps, ReserveCouponEffectProps, RollbackAddedLoyaltyPointsEffectProps, RollbackCouponEffectProps, RollbackDeductedLoyaltyPointsEffectProps, RollbackDiscountEffectProps, RollbackIncreasedAchievementProgressEffectProps, RollbackReferralEffectProps, SetDiscountEffectProps, SetDiscountPerAdditionalCostEffectProps, SetDiscountPerAdditionalCostPerItemEffectProps, SetDiscountPerItemEffectProps, SetLoyaltyPointsExpiryDateEffectProps, ShowBundleMetadataEffectProps, ShowNotificationEffectProps, TriggerWebhookEffectProps, UpdateAttributeEffectProps, WillAwardGiveawayEffectProps]] = None + one_of_schemas: Set[str] = { "AcceptCouponEffectProps", "AcceptReferralEffectProps", "AddFreeItemEffectProps", "AddLoyaltyPointsEffectProps", "AddToAudienceEffectProps", "AwardGiveawayEffectProps", "ChangeLoyaltyTierLevelEffectProps", "CouponCreatedEffectProps", "CustomEffectProps", "DeductLoyaltyPointsEffectProps", "ErrorEffectProps", "ExtendLoyaltyPointsExpiryDateEffectProps", "IncreaseAchievementProgressEffectProps", "RedeemReferralEffectProps", "ReferralCreatedEffectProps", "RejectCouponEffectProps", "RejectReferralEffectProps", "RemoveFromAudienceEffectProps", "ReserveCouponEffectProps", "RollbackAddedLoyaltyPointsEffectProps", "RollbackCouponEffectProps", "RollbackDeductedLoyaltyPointsEffectProps", "RollbackDiscountEffectProps", "RollbackIncreasedAchievementProgressEffectProps", "RollbackReferralEffectProps", "SetDiscountEffectProps", "SetDiscountPerAdditionalCostEffectProps", "SetDiscountPerAdditionalCostPerItemEffectProps", "SetDiscountPerItemEffectProps", "SetLoyaltyPointsExpiryDateEffectProps", "ShowBundleMetadataEffectProps", "ShowNotificationEffectProps", "TriggerWebhookEffectProps", "UpdateAttributeEffectProps", "WillAwardGiveawayEffectProps" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = EffectProps.model_construct() + error_messages = [] + match = 0 + # validate data type: AcceptCouponEffectProps + if not isinstance(v, AcceptCouponEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `AcceptCouponEffectProps`") + else: + match += 1 + # validate data type: AcceptReferralEffectProps + if not isinstance(v, AcceptReferralEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `AcceptReferralEffectProps`") + else: + match += 1 + # validate data type: RedeemReferralEffectProps + if not isinstance(v, RedeemReferralEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RedeemReferralEffectProps`") + else: + match += 1 + # validate data type: RejectCouponEffectProps + if not isinstance(v, RejectCouponEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RejectCouponEffectProps`") + else: + match += 1 + # validate data type: RejectReferralEffectProps + if not isinstance(v, RejectReferralEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RejectReferralEffectProps`") + else: + match += 1 + # validate data type: CouponCreatedEffectProps + if not isinstance(v, CouponCreatedEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `CouponCreatedEffectProps`") + else: + match += 1 + # validate data type: ReferralCreatedEffectProps + if not isinstance(v, ReferralCreatedEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `ReferralCreatedEffectProps`") + else: + match += 1 + # validate data type: SetDiscountEffectProps + if not isinstance(v, SetDiscountEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `SetDiscountEffectProps`") + else: + match += 1 + # validate data type: SetDiscountPerItemEffectProps + if not isinstance(v, SetDiscountPerItemEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `SetDiscountPerItemEffectProps`") + else: + match += 1 + # validate data type: SetDiscountPerAdditionalCostEffectProps + if not isinstance(v, SetDiscountPerAdditionalCostEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `SetDiscountPerAdditionalCostEffectProps`") + else: + match += 1 + # validate data type: TriggerWebhookEffectProps + if not isinstance(v, TriggerWebhookEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `TriggerWebhookEffectProps`") + else: + match += 1 + # validate data type: AddLoyaltyPointsEffectProps + if not isinstance(v, AddLoyaltyPointsEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `AddLoyaltyPointsEffectProps`") + else: + match += 1 + # validate data type: DeductLoyaltyPointsEffectProps + if not isinstance(v, DeductLoyaltyPointsEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `DeductLoyaltyPointsEffectProps`") + else: + match += 1 + # validate data type: ChangeLoyaltyTierLevelEffectProps + if not isinstance(v, ChangeLoyaltyTierLevelEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `ChangeLoyaltyTierLevelEffectProps`") + else: + match += 1 + # validate data type: AddFreeItemEffectProps + if not isinstance(v, AddFreeItemEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `AddFreeItemEffectProps`") + else: + match += 1 + # validate data type: ShowNotificationEffectProps + if not isinstance(v, ShowNotificationEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `ShowNotificationEffectProps`") + else: + match += 1 + # validate data type: UpdateAttributeEffectProps + if not isinstance(v, UpdateAttributeEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateAttributeEffectProps`") + else: + match += 1 + # validate data type: RollbackCouponEffectProps + if not isinstance(v, RollbackCouponEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RollbackCouponEffectProps`") + else: + match += 1 + # validate data type: RollbackReferralEffectProps + if not isinstance(v, RollbackReferralEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RollbackReferralEffectProps`") + else: + match += 1 + # validate data type: RollbackDiscountEffectProps + if not isinstance(v, RollbackDiscountEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RollbackDiscountEffectProps`") + else: + match += 1 + # validate data type: RollbackAddedLoyaltyPointsEffectProps + if not isinstance(v, RollbackAddedLoyaltyPointsEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RollbackAddedLoyaltyPointsEffectProps`") + else: + match += 1 + # validate data type: RollbackDeductedLoyaltyPointsEffectProps + if not isinstance(v, RollbackDeductedLoyaltyPointsEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RollbackDeductedLoyaltyPointsEffectProps`") + else: + match += 1 + # validate data type: ShowBundleMetadataEffectProps + if not isinstance(v, ShowBundleMetadataEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `ShowBundleMetadataEffectProps`") + else: + match += 1 + # validate data type: AwardGiveawayEffectProps + if not isinstance(v, AwardGiveawayEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `AwardGiveawayEffectProps`") + else: + match += 1 + # validate data type: WillAwardGiveawayEffectProps + if not isinstance(v, WillAwardGiveawayEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `WillAwardGiveawayEffectProps`") + else: + match += 1 + # validate data type: ErrorEffectProps + if not isinstance(v, ErrorEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `ErrorEffectProps`") + else: + match += 1 + # validate data type: CustomEffectProps + if not isinstance(v, CustomEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `CustomEffectProps`") + else: + match += 1 + # validate data type: SetDiscountPerAdditionalCostPerItemEffectProps + if not isinstance(v, SetDiscountPerAdditionalCostPerItemEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `SetDiscountPerAdditionalCostPerItemEffectProps`") + else: + match += 1 + # validate data type: ReserveCouponEffectProps + if not isinstance(v, ReserveCouponEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `ReserveCouponEffectProps`") + else: + match += 1 + # validate data type: AddToAudienceEffectProps + if not isinstance(v, AddToAudienceEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `AddToAudienceEffectProps`") + else: + match += 1 + # validate data type: RemoveFromAudienceEffectProps + if not isinstance(v, RemoveFromAudienceEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RemoveFromAudienceEffectProps`") + else: + match += 1 + # validate data type: IncreaseAchievementProgressEffectProps + if not isinstance(v, IncreaseAchievementProgressEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `IncreaseAchievementProgressEffectProps`") + else: + match += 1 + # validate data type: RollbackIncreasedAchievementProgressEffectProps + if not isinstance(v, RollbackIncreasedAchievementProgressEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `RollbackIncreasedAchievementProgressEffectProps`") + else: + match += 1 + # validate data type: ExtendLoyaltyPointsExpiryDateEffectProps + if not isinstance(v, ExtendLoyaltyPointsExpiryDateEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `ExtendLoyaltyPointsExpiryDateEffectProps`") + else: + match += 1 + # validate data type: SetLoyaltyPointsExpiryDateEffectProps + if not isinstance(v, SetLoyaltyPointsExpiryDateEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `SetLoyaltyPointsExpiryDateEffectProps`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in EffectProps with oneOf schemas: AcceptCouponEffectProps, AcceptReferralEffectProps, AddFreeItemEffectProps, AddLoyaltyPointsEffectProps, AddToAudienceEffectProps, AwardGiveawayEffectProps, ChangeLoyaltyTierLevelEffectProps, CouponCreatedEffectProps, CustomEffectProps, DeductLoyaltyPointsEffectProps, ErrorEffectProps, ExtendLoyaltyPointsExpiryDateEffectProps, IncreaseAchievementProgressEffectProps, RedeemReferralEffectProps, ReferralCreatedEffectProps, RejectCouponEffectProps, RejectReferralEffectProps, RemoveFromAudienceEffectProps, ReserveCouponEffectProps, RollbackAddedLoyaltyPointsEffectProps, RollbackCouponEffectProps, RollbackDeductedLoyaltyPointsEffectProps, RollbackDiscountEffectProps, RollbackIncreasedAchievementProgressEffectProps, RollbackReferralEffectProps, SetDiscountEffectProps, SetDiscountPerAdditionalCostEffectProps, SetDiscountPerAdditionalCostPerItemEffectProps, SetDiscountPerItemEffectProps, SetLoyaltyPointsExpiryDateEffectProps, ShowBundleMetadataEffectProps, ShowNotificationEffectProps, TriggerWebhookEffectProps, UpdateAttributeEffectProps, WillAwardGiveawayEffectProps. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in EffectProps with oneOf schemas: AcceptCouponEffectProps, AcceptReferralEffectProps, AddFreeItemEffectProps, AddLoyaltyPointsEffectProps, AddToAudienceEffectProps, AwardGiveawayEffectProps, ChangeLoyaltyTierLevelEffectProps, CouponCreatedEffectProps, CustomEffectProps, DeductLoyaltyPointsEffectProps, ErrorEffectProps, ExtendLoyaltyPointsExpiryDateEffectProps, IncreaseAchievementProgressEffectProps, RedeemReferralEffectProps, ReferralCreatedEffectProps, RejectCouponEffectProps, RejectReferralEffectProps, RemoveFromAudienceEffectProps, ReserveCouponEffectProps, RollbackAddedLoyaltyPointsEffectProps, RollbackCouponEffectProps, RollbackDeductedLoyaltyPointsEffectProps, RollbackDiscountEffectProps, RollbackIncreasedAchievementProgressEffectProps, RollbackReferralEffectProps, SetDiscountEffectProps, SetDiscountPerAdditionalCostEffectProps, SetDiscountPerAdditionalCostPerItemEffectProps, SetDiscountPerItemEffectProps, SetLoyaltyPointsExpiryDateEffectProps, ShowBundleMetadataEffectProps, ShowNotificationEffectProps, TriggerWebhookEffectProps, UpdateAttributeEffectProps, WillAwardGiveawayEffectProps. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into AcceptCouponEffectProps + try: + instance.actual_instance = AcceptCouponEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AcceptReferralEffectProps + try: + instance.actual_instance = AcceptReferralEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RedeemReferralEffectProps + try: + instance.actual_instance = RedeemReferralEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RejectCouponEffectProps + try: + instance.actual_instance = RejectCouponEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RejectReferralEffectProps + try: + instance.actual_instance = RejectReferralEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CouponCreatedEffectProps + try: + instance.actual_instance = CouponCreatedEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ReferralCreatedEffectProps + try: + instance.actual_instance = ReferralCreatedEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into SetDiscountEffectProps + try: + instance.actual_instance = SetDiscountEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into SetDiscountPerItemEffectProps + try: + instance.actual_instance = SetDiscountPerItemEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into SetDiscountPerAdditionalCostEffectProps + try: + instance.actual_instance = SetDiscountPerAdditionalCostEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into TriggerWebhookEffectProps + try: + instance.actual_instance = TriggerWebhookEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AddLoyaltyPointsEffectProps + try: + instance.actual_instance = AddLoyaltyPointsEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into DeductLoyaltyPointsEffectProps + try: + instance.actual_instance = DeductLoyaltyPointsEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ChangeLoyaltyTierLevelEffectProps + try: + instance.actual_instance = ChangeLoyaltyTierLevelEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AddFreeItemEffectProps + try: + instance.actual_instance = AddFreeItemEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ShowNotificationEffectProps + try: + instance.actual_instance = ShowNotificationEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into UpdateAttributeEffectProps + try: + instance.actual_instance = UpdateAttributeEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RollbackCouponEffectProps + try: + instance.actual_instance = RollbackCouponEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RollbackReferralEffectProps + try: + instance.actual_instance = RollbackReferralEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RollbackDiscountEffectProps + try: + instance.actual_instance = RollbackDiscountEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RollbackAddedLoyaltyPointsEffectProps + try: + instance.actual_instance = RollbackAddedLoyaltyPointsEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RollbackDeductedLoyaltyPointsEffectProps + try: + instance.actual_instance = RollbackDeductedLoyaltyPointsEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ShowBundleMetadataEffectProps + try: + instance.actual_instance = ShowBundleMetadataEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AwardGiveawayEffectProps + try: + instance.actual_instance = AwardGiveawayEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into WillAwardGiveawayEffectProps + try: + instance.actual_instance = WillAwardGiveawayEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ErrorEffectProps + try: + instance.actual_instance = ErrorEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CustomEffectProps + try: + instance.actual_instance = CustomEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into SetDiscountPerAdditionalCostPerItemEffectProps + try: + instance.actual_instance = SetDiscountPerAdditionalCostPerItemEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ReserveCouponEffectProps + try: + instance.actual_instance = ReserveCouponEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AddToAudienceEffectProps + try: + instance.actual_instance = AddToAudienceEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RemoveFromAudienceEffectProps + try: + instance.actual_instance = RemoveFromAudienceEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IncreaseAchievementProgressEffectProps + try: + instance.actual_instance = IncreaseAchievementProgressEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RollbackIncreasedAchievementProgressEffectProps + try: + instance.actual_instance = RollbackIncreasedAchievementProgressEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ExtendLoyaltyPointsExpiryDateEffectProps + try: + instance.actual_instance = ExtendLoyaltyPointsExpiryDateEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into SetLoyaltyPointsExpiryDateEffectProps + try: + instance.actual_instance = SetLoyaltyPointsExpiryDateEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into EffectProps with oneOf schemas: AcceptCouponEffectProps, AcceptReferralEffectProps, AddFreeItemEffectProps, AddLoyaltyPointsEffectProps, AddToAudienceEffectProps, AwardGiveawayEffectProps, ChangeLoyaltyTierLevelEffectProps, CouponCreatedEffectProps, CustomEffectProps, DeductLoyaltyPointsEffectProps, ErrorEffectProps, ExtendLoyaltyPointsExpiryDateEffectProps, IncreaseAchievementProgressEffectProps, RedeemReferralEffectProps, ReferralCreatedEffectProps, RejectCouponEffectProps, RejectReferralEffectProps, RemoveFromAudienceEffectProps, ReserveCouponEffectProps, RollbackAddedLoyaltyPointsEffectProps, RollbackCouponEffectProps, RollbackDeductedLoyaltyPointsEffectProps, RollbackDiscountEffectProps, RollbackIncreasedAchievementProgressEffectProps, RollbackReferralEffectProps, SetDiscountEffectProps, SetDiscountPerAdditionalCostEffectProps, SetDiscountPerAdditionalCostPerItemEffectProps, SetDiscountPerItemEffectProps, SetLoyaltyPointsExpiryDateEffectProps, ShowBundleMetadataEffectProps, ShowNotificationEffectProps, TriggerWebhookEffectProps, UpdateAttributeEffectProps, WillAwardGiveawayEffectProps. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into EffectProps with oneOf schemas: AcceptCouponEffectProps, AcceptReferralEffectProps, AddFreeItemEffectProps, AddLoyaltyPointsEffectProps, AddToAudienceEffectProps, AwardGiveawayEffectProps, ChangeLoyaltyTierLevelEffectProps, CouponCreatedEffectProps, CustomEffectProps, DeductLoyaltyPointsEffectProps, ErrorEffectProps, ExtendLoyaltyPointsExpiryDateEffectProps, IncreaseAchievementProgressEffectProps, RedeemReferralEffectProps, ReferralCreatedEffectProps, RejectCouponEffectProps, RejectReferralEffectProps, RemoveFromAudienceEffectProps, ReserveCouponEffectProps, RollbackAddedLoyaltyPointsEffectProps, RollbackCouponEffectProps, RollbackDeductedLoyaltyPointsEffectProps, RollbackDiscountEffectProps, RollbackIncreasedAchievementProgressEffectProps, RollbackReferralEffectProps, SetDiscountEffectProps, SetDiscountPerAdditionalCostEffectProps, SetDiscountPerAdditionalCostPerItemEffectProps, SetDiscountPerItemEffectProps, SetLoyaltyPointsExpiryDateEffectProps, ShowBundleMetadataEffectProps, ShowNotificationEffectProps, TriggerWebhookEffectProps, UpdateAttributeEffectProps, WillAwardGiveawayEffectProps. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], AcceptCouponEffectProps, AcceptReferralEffectProps, AddFreeItemEffectProps, AddLoyaltyPointsEffectProps, AddToAudienceEffectProps, AwardGiveawayEffectProps, ChangeLoyaltyTierLevelEffectProps, CouponCreatedEffectProps, CustomEffectProps, DeductLoyaltyPointsEffectProps, ErrorEffectProps, ExtendLoyaltyPointsExpiryDateEffectProps, IncreaseAchievementProgressEffectProps, RedeemReferralEffectProps, ReferralCreatedEffectProps, RejectCouponEffectProps, RejectReferralEffectProps, RemoveFromAudienceEffectProps, ReserveCouponEffectProps, RollbackAddedLoyaltyPointsEffectProps, RollbackCouponEffectProps, RollbackDeductedLoyaltyPointsEffectProps, RollbackDiscountEffectProps, RollbackIncreasedAchievementProgressEffectProps, RollbackReferralEffectProps, SetDiscountEffectProps, SetDiscountPerAdditionalCostEffectProps, SetDiscountPerAdditionalCostPerItemEffectProps, SetDiscountPerItemEffectProps, SetLoyaltyPointsExpiryDateEffectProps, ShowBundleMetadataEffectProps, ShowNotificationEffectProps, TriggerWebhookEffectProps, UpdateAttributeEffectProps, WillAwardGiveawayEffectProps]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/talon_one/models/event.py b/talon_one/models/event.py index 06e182a..0a14ea9 100644 --- a/talon_one/models/event.py +++ b/talon_one/models/event.py @@ -37,7 +37,7 @@ class Event(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", json_schema_extra={"examples": ["URNGV8294NV"]}) 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", json_schema_extra={"examples": ["STORE-001"]}) 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.", json_schema_extra={"examples": ["pageViewed"]}) - attributes: Dict[str, Any] = Field(description="Arbitrary properties associated with this campaign.") + attributes: Dict[str, Any] = Field(description="Arbitrary additional JSON data associated with the event.", json_schema_extra={"examples": ["{myAttribute=myValue}"]}) 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", json_schema_extra={"examples": ["175KJPS947296"]}) session_id: Optional[StrictStr] = Field(default=None, description="The ID of the session that this event occurred in.", alias="sessionId", json_schema_extra={"examples": ["175KJPS947296"]}) 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). ") diff --git a/talon_one/models/event_v3.py b/talon_one/models/event_v3.py index 01f206f..f511d91 100644 --- a/talon_one/models/event_v3.py +++ b/talon_one/models/event_v3.py @@ -36,7 +36,7 @@ class EventV3(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", json_schema_extra={"examples": ["URNGV8294NV"]}) 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", json_schema_extra={"examples": ["STORE-001"]}) 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.", json_schema_extra={"examples": ["pageViewed"]}) - attributes: Dict[str, Any] = Field(description="Arbitrary properties associated with this campaign.") + attributes: Dict[str, Any] = Field(description="Arbitrary additional JSON data associated with the event.", json_schema_extra={"examples": ["{myAttribute=myValue}"]}) 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", json_schema_extra={"examples": ["175KJPS947296"]}) 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"] diff --git a/talon_one/models/export.py b/talon_one/models/export.py index 5265a00..3cbbe1c 100644 --- a/talon_one/models/export.py +++ b/talon_one/models/export.py @@ -33,7 +33,7 @@ class Export(BaseModel): account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) user_id: StrictInt = Field(description="The ID of the user associated with this entity.", alias="userId", json_schema_extra={"examples": [388]}) entity: StrictStr = Field(description="The name of the entity that was exported.") - filter: Dict[str, Any] = Field(description="Arbitrary properties associated with this campaign.") + filter: Dict[str, Any] = Field(description="Map of keys and values that were used to filter the exported rows.") __properties: ClassVar[List[str]] = ["id", "created", "accountId", "userId", "entity", "filter"] @field_validator('entity') diff --git a/talon_one/models/generate_loyalty_card.py b/talon_one/models/generate_loyalty_card.py index a0fe7c9..44afcb9 100644 --- a/talon_one/models/generate_loyalty_card.py +++ b/talon_one/models/generate_loyalty_card.py @@ -43,16 +43,13 @@ def status_validate_enum(cls, value): raise ValueError("must be one of enum values ('active', 'inactive')") return value - @field_validator('card_identifier') + @field_validator('card_identifier', mode="before") def card_identifier_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z0-9._%+@-]+$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z0-9._%+@-]+$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z0-9._%+@-]+$/") return value diff --git a/talon_one/models/giveaway.py b/talon_one/models/giveaway.py index 822a6a9..e84295f 100644 --- a/talon_one/models/giveaway.py +++ b/talon_one/models/giveaway.py @@ -34,7 +34,7 @@ class Giveaway(BaseModel): pool_id: StrictInt = Field(description="The ID of the pool to return giveaway codes from.", alias="poolId", json_schema_extra={"examples": [1]}) start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the giveaway becomes valid.", alias="startDate", json_schema_extra={"examples": ["2022-01-02T15:04:05Z07:00"]}) end_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the giveaway becomes invalid.", alias="endDate", json_schema_extra={"examples": ["2023-01-02T15:04:05Z07:00"]}) - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this giveaway.") used: Optional[StrictBool] = Field(default=None, description="Indicates whether this giveaway code was given before.", json_schema_extra={"examples": [True]}) import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this giveaway.", alias="importId", json_schema_extra={"examples": [4]}) profile_integration_id: Optional[StrictStr] = Field(default=None, description="The third-party integration ID of the customer profile that was awarded the giveaway, if the giveaway was awarded.", alias="profileIntegrationId", json_schema_extra={"examples": ["R195412"]}) diff --git a/talon_one/models/history.py b/talon_one/models/history.py index 2f1000b..6914eb3 100644 --- a/talon_one/models/history.py +++ b/talon_one/models/history.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union from talon_one.models.best_prior_price_metadata import BestPriorPriceMetadata +from talon_one.models.label_target import LabelTarget from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -35,7 +36,7 @@ class History(BaseModel): context_id: Optional[StrictStr] = Field(default='', description="This property is **deprecated**. Use `contextIds` instead. Defaults to an empty string. ", alias="contextId", json_schema_extra={"examples": [""]}) price: Union[StrictFloat, StrictInt] = Field(description="Price of the item.", json_schema_extra={"examples": [99.99]}) metadata: BestPriorPriceMetadata - target: Dict[str, Any] + target: LabelTarget __properties: ClassVar[List[str]] = ["id", "observedAt", "contextIds", "contextId", "price", "metadata", "target"] model_config = ConfigDict( @@ -80,6 +81,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of target + if self.target: + _dict['target'] = self.target.to_dict() return _dict @classmethod @@ -98,7 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "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") + "target": LabelTarget.from_dict(obj["target"]) if obj.get("target") is not None else None }) return _obj diff --git a/talon_one/models/integration_event.py b/talon_one/models/integration_event.py index e4edc84..faf2960 100644 --- a/talon_one/models/integration_event.py +++ b/talon_one/models/integration_event.py @@ -31,7 +31,7 @@ class IntegrationEvent(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", json_schema_extra={"examples": ["URNGV8294NV"]}) 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", json_schema_extra={"examples": ["STORE-001"]}) 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.", json_schema_extra={"examples": ["pageViewed"]}) - attributes: Dict[str, Any] = Field(description="Arbitrary properties associated with this campaign.") + attributes: Dict[str, Any] = Field(description="Arbitrary additional JSON data associated with the event.", json_schema_extra={"examples": ["{myAttribute=myValue}"]}) __properties: ClassVar[List[str]] = ["profileId", "storeIntegrationId", "type", "attributes"] model_config = ConfigDict( diff --git a/talon_one/models/integration_hub_event_payload_coupon_based_notifications.py b/talon_one/models/integration_hub_event_payload_coupon_based_notifications.py index 8f9c300..689ac79 100644 --- a/talon_one/models/integration_hub_event_payload_coupon_based_notifications.py +++ b/talon_one/models/integration_hub_event_payload_coupon_based_notifications.py @@ -45,7 +45,7 @@ class IntegrationHubEventPayloadCouponBasedNotifications(BaseModel): recipient_integration_id: Optional[StrictStr] = Field(default=None, alias="RecipientIntegrationId") import_id: Optional[StrictInt] = Field(default=None, alias="ImportId") batch_id: Optional[StrictStr] = Field(default=None, alias="BatchId") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.", alias="Attributes") + attributes: Optional[Dict[str, Any]] = Field(default=None, alias="Attributes") limits: Optional[List[IntegrationHubEventPayloadCouponBasedNotificationsLimits]] = Field(default=None, alias="Limits") published_at: datetime = Field(description="Timestamp when the event was published.", alias="PublishedAt") source_of_event: StrictStr = Field(alias="SourceOfEvent") diff --git a/talon_one/models/integration_hub_paginated_event_payload.py b/talon_one/models/integration_hub_paginated_event_payload.py index ce280a2..14bbbc5 100644 --- a/talon_one/models/integration_hub_paginated_event_payload.py +++ b/talon_one/models/integration_hub_paginated_event_payload.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional from talon_one.models.integration_hub_event_type import IntegrationHubEventType +from talon_one.models.integration_hub_paginated_event_payload_data_inner import IntegrationHubPaginatedEventPayloadDataInner from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -32,7 +33,7 @@ class IntegrationHubPaginatedEventPayload(BaseModel): total_result_size: StrictInt = Field(alias="TotalResultSize") batched_at: Optional[datetime] = Field(default=None, description="Timestamp when the batch was created.", alias="BatchedAt") event_type: IntegrationHubEventType = Field(alias="EventType") - data: List[Any] = Field(alias="Data") + data: List[IntegrationHubPaginatedEventPayloadDataInner] = Field(alias="Data") __properties: ClassVar[List[str]] = ["TotalResultSize", "BatchedAt", "EventType", "Data"] model_config = ConfigDict( @@ -74,6 +75,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 data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['Data'] = _items return _dict @classmethod @@ -89,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "TotalResultSize": obj.get("TotalResultSize"), "BatchedAt": obj.get("BatchedAt"), "EventType": obj.get("EventType"), - "Data": obj.get("Data") + "Data": [IntegrationHubPaginatedEventPayloadDataInner.from_dict(_item) for _item in obj["Data"]] if obj.get("Data") is not None else None }) return _obj diff --git a/talon_one/models/integration_hub_paginated_event_payload_data_inner.py b/talon_one/models/integration_hub_paginated_event_payload_data_inner.py new file mode 100644 index 0000000..1e400f3 --- /dev/null +++ b/talon_one/models/integration_hub_paginated_event_payload_data_inner.py @@ -0,0 +1,168 @@ +# 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from talon_one.models.integration_hub_event_payload_coupon_based_notifications import IntegrationHubEventPayloadCouponBasedNotifications +from talon_one.models.integration_hub_event_payload_loyalty_profile_based_points_changed_notification import IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification +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 pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +INTEGRATIONHUBPAGINATEDEVENTPAYLOADDATAINNER_ONE_OF_SCHEMAS = ["IntegrationHubEventPayloadCouponBasedNotifications", "IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification", "IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification", "IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification"] + +class IntegrationHubPaginatedEventPayloadDataInner(BaseModel): + """ + IntegrationHubPaginatedEventPayloadDataInner + """ + # data type: IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification + oneof_schema_1_validator: Optional[IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification] = None + # data type: IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification + oneof_schema_2_validator: Optional[IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification] = None + # data type: IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification + oneof_schema_3_validator: Optional[IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification] = None + # data type: IntegrationHubEventPayloadCouponBasedNotifications + oneof_schema_4_validator: Optional[IntegrationHubEventPayloadCouponBasedNotifications] = None + actual_instance: Optional[Union[IntegrationHubEventPayloadCouponBasedNotifications, IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification, IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification, IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification]] = None + one_of_schemas: Set[str] = { "IntegrationHubEventPayloadCouponBasedNotifications", "IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification", "IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification", "IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = IntegrationHubPaginatedEventPayloadDataInner.model_construct() + error_messages = [] + match = 0 + # validate data type: IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification + if not isinstance(v, IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification): + error_messages.append(f"Error! Input type `{type(v)}` is not `IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification`") + else: + match += 1 + # validate data type: IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification + if not isinstance(v, IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification): + error_messages.append(f"Error! Input type `{type(v)}` is not `IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification`") + else: + match += 1 + # validate data type: IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification + if not isinstance(v, IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification): + error_messages.append(f"Error! Input type `{type(v)}` is not `IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification`") + else: + match += 1 + # validate data type: IntegrationHubEventPayloadCouponBasedNotifications + if not isinstance(v, IntegrationHubEventPayloadCouponBasedNotifications): + error_messages.append(f"Error! Input type `{type(v)}` is not `IntegrationHubEventPayloadCouponBasedNotifications`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in IntegrationHubPaginatedEventPayloadDataInner with oneOf schemas: IntegrationHubEventPayloadCouponBasedNotifications, IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification, IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification, IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in IntegrationHubPaginatedEventPayloadDataInner with oneOf schemas: IntegrationHubEventPayloadCouponBasedNotifications, IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification, IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification, IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification + try: + instance.actual_instance = IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification + try: + instance.actual_instance = IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification + try: + instance.actual_instance = IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IntegrationHubEventPayloadCouponBasedNotifications + try: + instance.actual_instance = IntegrationHubEventPayloadCouponBasedNotifications.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into IntegrationHubPaginatedEventPayloadDataInner with oneOf schemas: IntegrationHubEventPayloadCouponBasedNotifications, IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification, IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification, IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into IntegrationHubPaginatedEventPayloadDataInner with oneOf schemas: IntegrationHubEventPayloadCouponBasedNotifications, IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification, IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification, IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], IntegrationHubEventPayloadCouponBasedNotifications, IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification, IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification, IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/talon_one/models/inventory_referral.py b/talon_one/models/inventory_referral.py index 73a409d..740b21b 100644 --- a/talon_one/models/inventory_referral.py +++ b/talon_one/models/inventory_referral.py @@ -37,7 +37,7 @@ class InventoryReferral(BaseModel): campaign_id: StrictInt = Field(description="ID of the campaign from which the referral received the referral code.", alias="campaignId", json_schema_extra={"examples": [78]}) advocate_profile_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The Integration ID of the Advocate's Profile.", alias="advocateProfileIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) friend_profile_integration_id: Optional[StrictStr] = Field(default=None, description="An optional Integration ID of the Friend's Profile.", alias="friendProfileIntegrationId", json_schema_extra={"examples": ["BZGGC2454PA"]}) - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.", json_schema_extra={"examples": ["{channel=web}"]}) import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this referral.", alias="importId", json_schema_extra={"examples": [4]}) code: Annotated[str, Field(min_length=4, strict=True)] = Field(description="The referral code.", json_schema_extra={"examples": ["27G47Y54VH9L"]}) usage_counter: StrictInt = Field(description="The number of times this referral code has been successfully used.", alias="usageCounter", json_schema_extra={"examples": [1]}) diff --git a/talon_one/models/label_target.py b/talon_one/models/label_target.py new file mode 100644 index 0000000..f12d4e3 --- /dev/null +++ b/talon_one/models/label_target.py @@ -0,0 +1,137 @@ +# 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from talon_one.models.label_target_audience import LabelTargetAudience +from talon_one.models.label_target_none import LabelTargetNone +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +LABELTARGET_ONE_OF_SCHEMAS = ["LabelTargetAudience", "LabelTargetNone"] + +class LabelTarget(BaseModel): + """ + LabelTarget + """ + # data type: LabelTargetNone + oneof_schema_1_validator: Optional[LabelTargetNone] = None + # data type: LabelTargetAudience + oneof_schema_2_validator: Optional[LabelTargetAudience] = None + actual_instance: Optional[Union[LabelTargetAudience, LabelTargetNone]] = None + one_of_schemas: Set[str] = { "LabelTargetAudience", "LabelTargetNone" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = LabelTarget.model_construct() + error_messages = [] + match = 0 + # validate data type: LabelTargetNone + if not isinstance(v, LabelTargetNone): + error_messages.append(f"Error! Input type `{type(v)}` is not `LabelTargetNone`") + else: + match += 1 + # validate data type: LabelTargetAudience + if not isinstance(v, LabelTargetAudience): + error_messages.append(f"Error! Input type `{type(v)}` is not `LabelTargetAudience`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in LabelTarget with oneOf schemas: LabelTargetAudience, LabelTargetNone. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in LabelTarget with oneOf schemas: LabelTargetAudience, LabelTargetNone. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into LabelTargetNone + try: + instance.actual_instance = LabelTargetNone.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into LabelTargetAudience + try: + instance.actual_instance = LabelTargetAudience.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into LabelTarget with oneOf schemas: LabelTargetAudience, LabelTargetNone. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into LabelTarget with oneOf schemas: LabelTargetAudience, LabelTargetNone. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], LabelTargetAudience, LabelTargetNone]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/talon_one/models/loyalty_card.py b/talon_one/models/loyalty_card.py index 92b3a18..e8e1e00 100644 --- a/talon_one/models/loyalty_card.py +++ b/talon_one/models/loyalty_card.py @@ -49,39 +49,30 @@ class LoyaltyCard(BaseModel): batch_id: Optional[StrictStr] = Field(default=None, description="The ID of the batch in which the loyalty card was created.", alias="batchId", json_schema_extra={"examples": ["wdefpov"]}) __properties: ClassVar[List[str]] = ["id", "created", "programID", "programName", "programTitle", "status", "blockReason", "identifier", "usersPerCardLimit", "profiles", "ledger", "subledgers", "modified", "oldCardIdentifier", "newCardIdentifier", "batchId"] - @field_validator('identifier') + @field_validator('identifier', mode="before") def identifier_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z0-9._%+@-]+$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z0-9._%+@-]+$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z0-9._%+@-]+$/") return value - @field_validator('old_card_identifier') + @field_validator('old_card_identifier', mode="before") def old_card_identifier_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z0-9._%+@-]+$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z0-9._%+@-]+$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z0-9._%+@-]+$/") return value - @field_validator('new_card_identifier') + @field_validator('new_card_identifier', mode="before") def new_card_identifier_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z0-9._%+@-]+$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z0-9._%+@-]+$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z0-9._%+@-]+$/") return value diff --git a/talon_one/models/loyalty_card_batch.py b/talon_one/models/loyalty_card_batch.py index 359efed..413b394 100644 --- a/talon_one/models/loyalty_card_batch.py +++ b/talon_one/models/loyalty_card_batch.py @@ -35,16 +35,13 @@ class LoyaltyCardBatch(BaseModel): card_code_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="cardCodeSettings") __properties: ClassVar[List[str]] = ["numberOfCards", "batchId", "status", "cardCodeSettings"] - @field_validator('batch_id') + @field_validator('batch_id', mode="before") def batch_id_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z0-9_-]*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z0-9_-]*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z0-9_-]*$/") return value diff --git a/talon_one/models/loyalty_program_transaction.py b/talon_one/models/loyalty_program_transaction.py index 19d1f3a..70110f6 100644 --- a/talon_one/models/loyalty_program_transaction.py +++ b/talon_one/models/loyalty_program_transaction.py @@ -60,16 +60,13 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('addition', 'subtraction')") return value - @field_validator('card_identifier') + @field_validator('card_identifier', mode="before") def card_identifier_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z0-9._%+@-]+$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z0-9._%+@-]+$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z0-9._%+@-]+$/") return value diff --git a/talon_one/models/mcpo_auth_protected_resource.py b/talon_one/models/mcpo_auth_protected_resource.py new file mode 100644 index 0000000..41b00b3 --- /dev/null +++ b/talon_one/models/mcpo_auth_protected_resource.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MCPOAuthProtectedResource(BaseModel): + """ + MCPOAuthProtectedResource + """ # noqa: E501 + resource: StrictStr = Field(description="The URL of the protected resource (the MCP entrypoint).", json_schema_extra={"examples": ["https://mycompany.talon.one/v1/mcp/entrypoint"]}) + authorization_servers: List[StrictStr] = Field(description="List of authorization server base URLs that can issue tokens for this resource.", json_schema_extra={"examples": [["https://mycompany.talon.one/v1/mcp/auth"]]}) + __properties: ClassVar[List[str]] = ["resource", "authorization_servers"] + + 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 MCPOAuthProtectedResource 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 MCPOAuthProtectedResource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "resource": obj.get("resource"), + "authorization_servers": obj.get("authorization_servers") + }) + return _obj + + diff --git a/talon_one/models/mcpo_auth_server_metadata.py b/talon_one/models/mcpo_auth_server_metadata.py new file mode 100644 index 0000000..ffe1d82 --- /dev/null +++ b/talon_one/models/mcpo_auth_server_metadata.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MCPOAuthServerMetadata(BaseModel): + """ + MCPOAuthServerMetadata + """ # noqa: E501 + issuer: StrictStr = Field(description="The authorization server's issuer identifier (its base URL).", json_schema_extra={"examples": ["https://mycompany.talon.one"]}) + authorization_endpoint: StrictStr = Field(description="URL of the authorization endpoint.", json_schema_extra={"examples": ["https://mycompany.talon.one/v1/mcp/auth/authorize"]}) + token_endpoint: StrictStr = Field(description="URL of the token endpoint.", json_schema_extra={"examples": ["https://mycompany.talon.one/v1/mcp/auth/token"]}) + registration_endpoint: StrictStr = Field(description="URL of the client registration endpoint.", json_schema_extra={"examples": ["https://mycompany.talon.one/v1/mcp/auth/register"]}) + response_types_supported: List[StrictStr] = Field(description="List of supported OAuth2 response types.", json_schema_extra={"examples": [["code"]]}) + grant_types_supported: List[StrictStr] = Field(description="List of supported OAuth2 grant types.", json_schema_extra={"examples": [["authorization_code"]]}) + code_challenge_methods_supported: List[StrictStr] = Field(description="List of supported PKCE code challenge methods.", json_schema_extra={"examples": [["S256"]]}) + __properties: ClassVar[List[str]] = ["issuer", "authorization_endpoint", "token_endpoint", "registration_endpoint", "response_types_supported", "grant_types_supported", "code_challenge_methods_supported"] + + 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 MCPOAuthServerMetadata 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 MCPOAuthServerMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "issuer": obj.get("issuer"), + "authorization_endpoint": obj.get("authorization_endpoint"), + "token_endpoint": obj.get("token_endpoint"), + "registration_endpoint": obj.get("registration_endpoint"), + "response_types_supported": obj.get("response_types_supported"), + "grant_types_supported": obj.get("grant_types_supported"), + "code_challenge_methods_supported": obj.get("code_challenge_methods_supported") + }) + return _obj + + diff --git a/talon_one/models/new_additional_cost.py b/talon_one/models/new_additional_cost.py index 2c0bc2e..cc878fc 100644 --- a/talon_one/models/new_additional_cost.py +++ b/talon_one/models/new_additional_cost.py @@ -35,23 +35,17 @@ class NewAdditionalCost(BaseModel): type: Optional[StrictStr] = Field(default='session', description="The type of additional cost. Possible value: - `session`: Additional cost will be added per session. - `item`: Additional cost will be added per item. - `both`: Additional cost will be added per item and session. ", json_schema_extra={"examples": ["session"]}) __properties: ClassVar[List[str]] = ["name", "title", "description", "subscribedApplicationsIds", "type"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z]\w*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z]\w*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z]\w*$/") return value - @field_validator('title') + @field_validator('title', mode="before") def title_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z][A-Za-z0-9_.!~*\'() -]*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z][A-Za-z0-9_.!~*\'() -]*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z][A-Za-z0-9_.!~*'() -]*$/") return value diff --git a/talon_one/models/new_application.py b/talon_one/models/new_application.py index e613ef0..f102658 100644 --- a/talon_one/models/new_application.py +++ b/talon_one/models/new_application.py @@ -80,16 +80,13 @@ def default_discount_additional_cost_per_item_scope_validate_enum(cls, value): raise ValueError("must be one of enum values ('price', 'itemTotal', 'additionalCosts')") return value - @field_validator('key') + @field_validator('key', mode="before") def key_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[a-fA-F0-9]{16}$", value): + if isinstance(value, str) and not re.match(r"^[a-fA-F0-9]{16}$", value): raise ValueError(r"must validate the regular expression /^[a-fA-F0-9]{16}$/") return value diff --git a/talon_one/models/new_attribute.py b/talon_one/models/new_attribute.py index 1fa8f3e..ed8d21c 100644 --- a/talon_one/models/new_attribute.py +++ b/talon_one/models/new_attribute.py @@ -50,23 +50,17 @@ def entity_validate_enum(cls, value): raise ValueError("must be one of enum values ('Application', 'Campaign', 'CustomerProfile', 'CustomerSession', 'CartItem', 'Coupon', 'Event', 'Giveaway', 'LoyaltyCard', 'Referral', 'Store')") return value - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z]\w*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z]\w*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z]\w*$/") return value - @field_validator('title') + @field_validator('title', mode="before") def title_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z][A-Za-z0-9_.!~*\'() -]*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z][A-Za-z0-9_.!~*\'() -]*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z][A-Za-z0-9_.!~*'() -]*$/") return value diff --git a/talon_one/models/new_base_notification.py b/talon_one/models/new_base_notification.py index f376f8e..009e13e 100644 --- a/talon_one/models/new_base_notification.py +++ b/talon_one/models/new_base_notification.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.base_notification_policy import BaseNotificationPolicy from talon_one.models.new_notification_webhook import NewNotificationWebhook from typing import Optional, Set from typing_extensions import Self @@ -28,7 +29,7 @@ class NewBaseNotification(BaseModel): """ NewBaseNotification """ # noqa: E501 - policy: Dict[str, Any] = Field(description="Indicates which notification properties to apply.") + policy: BaseNotificationPolicy enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether the notification is activated.") webhook: NewNotificationWebhook __properties: ClassVar[List[str]] = ["policy", "enabled", "webhook"] @@ -72,6 +73,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of policy + if self.policy: + _dict['policy'] = self.policy.to_dict() # override the default output from pydantic by calling `to_dict()` of webhook if self.webhook: _dict['webhook'] = self.webhook.to_dict() @@ -87,7 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "policy": obj.get("policy"), + "policy": BaseNotificationPolicy.from_dict(obj["policy"]) if obj.get("policy") is not None else None, "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, "webhook": NewNotificationWebhook.from_dict(obj["webhook"]) if obj.get("webhook") is not None else None }) diff --git a/talon_one/models/new_campaign_collection.py b/talon_one/models/new_campaign_collection.py index 9e0a413..5af250c 100644 --- a/talon_one/models/new_campaign_collection.py +++ b/talon_one/models/new_campaign_collection.py @@ -32,13 +32,10 @@ class NewCampaignCollection(BaseModel): name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this collection.", json_schema_extra={"examples": ["My collection"]}) __properties: ClassVar[List[str]] = ["description", "name"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): + if isinstance(value, str) and not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): raise ValueError(r"must validate the regular expression /^[^[:cntrl:]\s][^[:cntrl:]]*$/") return value diff --git a/talon_one/models/new_collection.py b/talon_one/models/new_collection.py index 80ac927..bfe157d 100644 --- a/talon_one/models/new_collection.py +++ b/talon_one/models/new_collection.py @@ -33,13 +33,10 @@ class NewCollection(BaseModel): name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this collection.", json_schema_extra={"examples": ["My collection"]}) __properties: ClassVar[List[str]] = ["description", "subscribedApplicationsIds", "name"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): + if isinstance(value, str) and not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): raise ValueError(r"must validate the regular expression /^[^[:cntrl:]\s][^[:cntrl:]]*$/") return value diff --git a/talon_one/models/new_coupon_creation_job.py b/talon_one/models/new_coupon_creation_job.py index f6a0401..0ccfcb7 100644 --- a/talon_one/models/new_coupon_creation_job.py +++ b/talon_one/models/new_coupon_creation_job.py @@ -37,7 +37,7 @@ class NewCouponCreationJob(BaseModel): expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the coupon. Coupon never expires if this is omitted.", alias="expiryDate", json_schema_extra={"examples": ["2023-08-24T14:15:22Z"]}) number_of_coupons: Annotated[int, Field(le=5000000, strict=True, ge=1)] = Field(description="The number of new coupon codes to generate for the campaign.", alias="numberOfCoupons", json_schema_extra={"examples": [200000]}) coupon_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="couponSettings") - attributes: Dict[str, Any] = Field(description="Arbitrary properties associated with this campaign.") + attributes: Dict[str, Any] = Field(description="Arbitrary properties associated with coupons.") is_reservation_mandatory: Optional[StrictBool] = Field(default=False, description="An indication of whether the code can be redeemed only if it has been reserved first.", alias="isReservationMandatory", json_schema_extra={"examples": [False]}) __properties: ClassVar[List[str]] = ["usageLimit", "discountLimit", "reservationLimit", "startDate", "expiryDate", "numberOfCoupons", "couponSettings", "attributes", "isReservationMandatory"] diff --git a/talon_one/models/new_coupons.py b/talon_one/models/new_coupons.py index d1ecad7..694210b 100644 --- a/talon_one/models/new_coupons.py +++ b/talon_one/models/new_coupons.py @@ -38,13 +38,15 @@ class NewCoupons(BaseModel): limits: Optional[List[LimitConfig]] = Field(default=None, description="Limits configuration for a coupon. These limits will override the limits set from the campaign. **Note:** Only usable when creating a single coupon which is not tied to a specific recipient. Only per-profile limits are allowed to be configured. ") number_of_coupons: StrictInt = Field(description="The number of new coupon codes to generate for the campaign. Must be at least 1.", alias="numberOfCoupons", json_schema_extra={"examples": [1]}) unique_prefix: Optional[StrictStr] = Field(default=None, description="**DEPRECATED** To create more than 20,000 coupons in one request, use [Create coupons asynchronously](https://docs.talon.one/management-api#tag/Coupons/operation/createCouponsAsync) endpoint. ", alias="uniquePrefix", json_schema_extra={"examples": [""]}) - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.", json_schema_extra={"examples": ["{venueId=12}"]}) recipient_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The integration ID for this coupon's beneficiary's profile.", alias="recipientIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) valid_characters: Optional[List[StrictStr]] = Field(default=None, description="List of characters used to generate the random parts of a code. By default, the list of characters is equivalent to the `[A-Z, 0-9]` regular expression. ", alias="validCharacters", json_schema_extra={"examples": [["A", "B", "G", "Y"]]}) coupon_pattern: Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]] = Field(default=None, description="The pattern used to generate coupon codes. The character `#` is a placeholder and is replaced by a random character from the `validCharacters` set. ", alias="couponPattern", json_schema_extra={"examples": ["SUMMER-#####"]}) is_reservation_mandatory: Optional[StrictBool] = Field(default=False, description="An indication of whether the code can be redeemed only if it has been reserved first.", alias="isReservationMandatory", json_schema_extra={"examples": [False]}) implicitly_reserved: Optional[StrictBool] = Field(default=None, description="An indication of whether the coupon is implicitly reserved for all customers.", alias="implicitlyReserved", json_schema_extra={"examples": [False]}) - __properties: ClassVar[List[str]] = ["usageLimit", "discountLimit", "reservationLimit", "startDate", "expiryDate", "limits", "numberOfCoupons", "uniquePrefix", "attributes", "recipientIntegrationId", "validCharacters", "couponPattern", "isReservationMandatory", "implicitlyReserved"] + support_request_id: Optional[StrictInt] = Field(default=None, description="The identifier of the support request to link to the coupon creation. The request must exist and not yet be processed.", alias="supportRequestId", json_schema_extra={"examples": [42]}) + support_request_note: Optional[StrictStr] = Field(default=None, description="A note recorded when the linked support request is approved or rejected. Applied when `supportRequestId` is provided.", alias="supportRequestNote", json_schema_extra={"examples": ["Approved as compensation for the delayed order."]}) + __properties: ClassVar[List[str]] = ["usageLimit", "discountLimit", "reservationLimit", "startDate", "expiryDate", "limits", "numberOfCoupons", "uniquePrefix", "attributes", "recipientIntegrationId", "validCharacters", "couponPattern", "isReservationMandatory", "implicitlyReserved", "supportRequestId", "supportRequestNote"] model_config = ConfigDict( validate_by_name=True, @@ -117,7 +119,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "validCharacters": obj.get("validCharacters"), "couponPattern": obj.get("couponPattern"), "isReservationMandatory": obj.get("isReservationMandatory") if obj.get("isReservationMandatory") is not None else False, - "implicitlyReserved": obj.get("implicitlyReserved") + "implicitlyReserved": obj.get("implicitlyReserved"), + "supportRequestId": obj.get("supportRequestId"), + "supportRequestNote": obj.get("supportRequestNote") }) return _obj diff --git a/talon_one/models/new_coupons_for_multiple_recipients.py b/talon_one/models/new_coupons_for_multiple_recipients.py index 2d53e59..e2a39e6 100644 --- a/talon_one/models/new_coupons_for_multiple_recipients.py +++ b/talon_one/models/new_coupons_for_multiple_recipients.py @@ -34,7 +34,7 @@ class NewCouponsForMultipleRecipients(BaseModel): reservation_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of reservations that can be made with this coupon code. ", alias="reservationLimit", json_schema_extra={"examples": [45]}) start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon becomes valid.", alias="startDate", json_schema_extra={"examples": ["2020-01-24T14:15:22Z"]}) expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the coupon. Coupon never expires if this is omitted.", alias="expiryDate", json_schema_extra={"examples": ["2023-08-24T14:15:22Z"]}) - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.", json_schema_extra={"examples": ["{venueId=12}"]}) recipients_integration_ids: Annotated[List[StrictStr], Field(min_length=1, max_length=1000)] = Field(description="The integration IDs for recipients.", alias="recipientsIntegrationIds", json_schema_extra={"examples": [["URNGV8294NV", "BZGGC2454PA"]]}) valid_characters: Optional[List[StrictStr]] = Field(default=None, description="List of characters used to generate the random parts of a code. By default, the list of characters is equivalent to the `[A-Z, 0-9]` regular expression. ", alias="validCharacters", json_schema_extra={"examples": [["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]]}) coupon_pattern: Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]] = Field(default=None, description="The pattern used to generate coupon codes. The character `#` is a placeholder and is replaced by a random character from the `validCharacters` set. ", alias="couponPattern", json_schema_extra={"examples": ["SUMMER-#####"]}) diff --git a/talon_one/models/new_custom_effect.py b/talon_one/models/new_custom_effect.py index 63298b8..178c483 100644 --- a/talon_one/models/new_custom_effect.py +++ b/talon_one/models/new_custom_effect.py @@ -39,23 +39,17 @@ class NewCustomEffect(BaseModel): params: Optional[List[TemplateArgDef]] = Field(default=None, description="Array of template argument definitions.") __properties: ClassVar[List[str]] = ["applicationIds", "isPerItem", "name", "title", "payload", "description", "enabled", "params"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z](\w|\s)*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z](\w|\s)*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z](\w|\s)*$/") return value - @field_validator('title') + @field_validator('title', mode="before") def title_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): + if isinstance(value, str) and not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): raise ValueError(r"must validate the regular expression /^[^[:cntrl:]\s][^[:cntrl:]]*$/") return value diff --git a/talon_one/models/new_customer_session.py b/talon_one/models/new_customer_session.py index c0d3237..ae7846c 100644 --- a/talon_one/models/new_customer_session.py +++ b/talon_one/models/new_customer_session.py @@ -36,7 +36,7 @@ class NewCustomerSession(BaseModel): cart_items: Optional[List[CartItem]] = Field(default=None, description="Serialized JSON representation.", alias="cartItems") identifiers: Optional[Annotated[List[StrictStr], Field(max_length=5)]] = Field(default=None, description="Session custom identifiers that you can set limits on or use inside your rules. For example, you can use IP addresses as identifiers to potentially identify devices and limit discounts abuse in case of customers creating multiple accounts. See the [tutorial](https://docs.talon.one/docs/dev/tutorials/using-identifiers). ", json_schema_extra={"examples": [["91.11.156.141"]]}) total: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total sum of the cart in one session.") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="A key-value map of the sessions attributes. The potentially valid attributes are configured in your accounts developer settings. ") __properties: ClassVar[List[str]] = ["profileId", "coupon", "referral", "state", "cartItems", "identifiers", "total", "attributes"] @field_validator('state') diff --git a/talon_one/models/new_digital_pass.py b/talon_one/models/new_digital_pass.py new file mode 100644 index 0000000..9021b8e --- /dev/null +++ b/talon_one/models/new_digital_pass.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class NewDigitalPass(BaseModel): + """ + NewDigitalPass + """ # noqa: E501 + loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the associated loyalty program.", alias="loyaltyProgramId", json_schema_extra={"examples": [42]}) + pass_template_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The ID of the digital pass template used to generate the pass. ", alias="passTemplateId", json_schema_extra={"examples": ["tmpl_summer_loyalty"]}) + profile_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The integration ID of the customer profile the pass is issued for.", alias="profileId", json_schema_extra={"examples": ["12412412421"]}) + loyalty_card_id: Optional[StrictStr] = Field(default=None, description="The identifier of the loyalty card the pass is issued for. **Note**: Only applicable for card-based loyalty programs. ", alias="loyaltyCardId", json_schema_extra={"examples": ["summer-loyalty-0e2f"]}) + platform: StrictStr = Field(description="The wallet platform the pass is generated for.", json_schema_extra={"examples": ["google"]}) + attributes: Optional[Dict[str, StrictStr]] = Field(default=None, description="A map of placeholder values that you provide to fill in the pass template. These values are not validated against the template. ", json_schema_extra={"examples": [{"hm_member_name": "Jane Doe"}]}) + __properties: ClassVar[List[str]] = ["loyaltyProgramId", "passTemplateId", "profileId", "loyaltyCardId", "platform", "attributes"] + + @field_validator('platform') + def platform_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['apple', 'google']): + raise ValueError("must be one of enum values ('apple', 'google')") + 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 NewDigitalPass 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 NewDigitalPass from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "loyaltyProgramId": obj.get("loyaltyProgramId"), + "passTemplateId": obj.get("passTemplateId"), + "profileId": obj.get("profileId"), + "loyaltyCardId": obj.get("loyaltyCardId"), + "platform": obj.get("platform"), + "attributes": obj.get("attributes") + }) + return _obj + + diff --git a/talon_one/models/new_event.py b/talon_one/models/new_event.py index 2ae7c94..086e34e 100644 --- a/talon_one/models/new_event.py +++ b/talon_one/models/new_event.py @@ -31,7 +31,7 @@ class NewEvent(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", json_schema_extra={"examples": ["URNGV8294NV"]}) 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", json_schema_extra={"examples": ["STORE-001"]}) 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.", json_schema_extra={"examples": ["pageViewed"]}) - attributes: Dict[str, Any] = Field(description="Arbitrary properties associated with this campaign.") + attributes: Dict[str, Any] = Field(description="Arbitrary additional JSON data associated with the event.", json_schema_extra={"examples": ["{myAttribute=myValue}"]}) session_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The ID of the session that this event occurred in.", alias="sessionId", json_schema_extra={"examples": ["175KJPS947296"]}) __properties: ClassVar[List[str]] = ["profileId", "storeIntegrationId", "type", "attributes", "sessionId"] diff --git a/talon_one/models/new_price_type.py b/talon_one/models/new_price_type.py index e328417..b5fe9b2 100644 --- a/talon_one/models/new_price_type.py +++ b/talon_one/models/new_price_type.py @@ -34,13 +34,10 @@ class NewPriceType(BaseModel): targeted_audiences_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the audiences targeted by this price type.", alias="targetedAudiencesIds", json_schema_extra={"examples": [[1, 2, 3]]}) __properties: ClassVar[List[str]] = ["name", "title", "description", "targetedAudiencesIds"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z]\w*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z]\w*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z]\w*$/") return value diff --git a/talon_one/models/new_referral.py b/talon_one/models/new_referral.py index 7deca1b..3ea1557 100644 --- a/talon_one/models/new_referral.py +++ b/talon_one/models/new_referral.py @@ -35,7 +35,7 @@ class NewReferral(BaseModel): campaign_id: StrictInt = Field(description="ID of the campaign from which the referral received the referral code.", alias="campaignId", json_schema_extra={"examples": [78]}) advocate_profile_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The Integration ID of the Advocate's Profile.", alias="advocateProfileIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) friend_profile_integration_id: Optional[StrictStr] = Field(default=None, description="An optional Integration ID of the Friend's Profile.", alias="friendProfileIntegrationId", json_schema_extra={"examples": ["BZGGC2454PA"]}) - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.", json_schema_extra={"examples": ["{channel=web}"]}) __properties: ClassVar[List[str]] = ["startDate", "expiryDate", "usageLimit", "campaignId", "advocateProfileIntegrationId", "friendProfileIntegrationId", "attributes"] model_config = ConfigDict( diff --git a/talon_one/models/new_referrals_for_multiple_advocates.py b/talon_one/models/new_referrals_for_multiple_advocates.py index bbaf639..c0af726 100644 --- a/talon_one/models/new_referrals_for_multiple_advocates.py +++ b/talon_one/models/new_referrals_for_multiple_advocates.py @@ -34,7 +34,7 @@ class NewReferralsForMultipleAdvocates(BaseModel): usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times a referral code can be used. `0` means no limit but any campaign usage limits will still apply. ", alias="usageLimit", json_schema_extra={"examples": [1]}) campaign_id: StrictInt = Field(description="The ID of the campaign from which the referral received the referral code.", alias="campaignId", json_schema_extra={"examples": [45]}) advocate_profile_integration_ids: Annotated[List[StrictStr], Field(min_length=1, max_length=1000)] = Field(description="An array containing all the respective advocate profiles.", alias="advocateProfileIntegrationIds", json_schema_extra={"examples": [["URNGV8294NV", "DRPVV9476AF"]]}) - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this referral code.", json_schema_extra={"examples": ["{channel=web}"]}) valid_characters: Optional[List[StrictStr]] = Field(default=None, description="List of characters used to generate the random parts of a code. By default, the list of characters is equivalent to the `[A-Z, 0-9]` regular expression. ", alias="validCharacters", json_schema_extra={"examples": [["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]]}) referral_pattern: Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]] = Field(default=None, description="The pattern used to generate referrals. The character `#` is a placeholder and is replaced by a random character from the `validCharacters` set. ", alias="referralPattern", json_schema_extra={"examples": ["REF-###-###"]}) __properties: ClassVar[List[str]] = ["startDate", "expiryDate", "usageLimit", "campaignId", "advocateProfileIntegrationIds", "attributes", "validCharacters", "referralPattern"] diff --git a/talon_one/models/new_secondary_deployment.py b/talon_one/models/new_secondary_deployment.py index 5539be1..fa1721b 100644 --- a/talon_one/models/new_secondary_deployment.py +++ b/talon_one/models/new_secondary_deployment.py @@ -31,13 +31,10 @@ class NewSecondaryDeployment(BaseModel): name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the deployment. Used as subdomain, e.g. experimental.your-company.europe-west1.talon.one", json_schema_extra={"examples": ["experimental"]}) __properties: ClassVar[List[str]] = ["name"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[a-z0-9]+$", value): + if isinstance(value, str) and not re.match(r"^[a-z0-9]+$", value): raise ValueError(r"must validate the regular expression /^[a-z0-9]+$/") return value diff --git a/talon_one/models/new_webhook.py b/talon_one/models/new_webhook.py index 883513f..649c785 100644 --- a/talon_one/models/new_webhook.py +++ b/talon_one/models/new_webhook.py @@ -42,13 +42,10 @@ class NewWebhook(BaseModel): authentication_id: Optional[StrictInt] = Field(default=None, description="The ID of the credential that this webhook is using.", alias="authenticationId", json_schema_extra={"examples": [1]}) __properties: ClassVar[List[str]] = ["applicationIds", "title", "description", "draft", "verb", "url", "headers", "payload", "params", "enabled", "authenticationId"] - @field_validator('title') + @field_validator('title', mode="before") def title_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z][A-Za-z0-9_.!~*\'() -]*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z][A-Za-z0-9_.!~*\'() -]*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z][A-Za-z0-9_.!~*'() -]*$/") return value diff --git a/talon_one/models/outgoing_integration_configuration.py b/talon_one/models/outgoing_integration_configuration.py index 940289d..be2e893 100644 --- a/talon_one/models/outgoing_integration_configuration.py +++ b/talon_one/models/outgoing_integration_configuration.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List +from talon_one.models.outgoing_integration_configuration_policy import OutgoingIntegrationConfigurationPolicy from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -30,7 +31,7 @@ class OutgoingIntegrationConfiguration(BaseModel): id: StrictInt = Field(description="Unique ID for this entity.", json_schema_extra={"examples": [6]}) account_id: StrictInt = Field(description="The ID of the account to which this configuration belongs.", alias="accountId", json_schema_extra={"examples": [3886]}) type_id: StrictInt = Field(description="The outgoing integration type ID.", alias="typeId", json_schema_extra={"examples": [12]}) - policy: Dict[str, Any] = Field(description="The outgoing integration policy specific to each integration type.") + policy: OutgoingIntegrationConfigurationPolicy __properties: ClassVar[List[str]] = ["id", "accountId", "typeId", "policy"] model_config = ConfigDict( @@ -72,6 +73,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of policy + if self.policy: + _dict['policy'] = self.policy.to_dict() return _dict @classmethod @@ -87,7 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "id": obj.get("id"), "accountId": obj.get("accountId"), "typeId": obj.get("typeId"), - "policy": obj.get("policy") + "policy": OutgoingIntegrationConfigurationPolicy.from_dict(obj["policy"]) if obj.get("policy") is not None else None }) return _obj diff --git a/talon_one/models/outgoing_integration_configuration_policy.py b/talon_one/models/outgoing_integration_configuration_policy.py new file mode 100644 index 0000000..0a8c45d --- /dev/null +++ b/talon_one/models/outgoing_integration_configuration_policy.py @@ -0,0 +1,165 @@ +# 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from talon_one.models.outgoing_integration_braze_policy import OutgoingIntegrationBrazePolicy +from talon_one.models.outgoing_integration_clever_tap_policy import OutgoingIntegrationCleverTapPolicy +from talon_one.models.outgoing_integration_iterable_policy import OutgoingIntegrationIterablePolicy +from talon_one.models.outgoing_integration_mo_engage_policy import OutgoingIntegrationMoEngagePolicy +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +OUTGOINGINTEGRATIONCONFIGURATIONPOLICY_ONE_OF_SCHEMAS = ["OutgoingIntegrationBrazePolicy", "OutgoingIntegrationCleverTapPolicy", "OutgoingIntegrationIterablePolicy", "OutgoingIntegrationMoEngagePolicy"] + +class OutgoingIntegrationConfigurationPolicy(BaseModel): + """ + The outgoing integration policy specific to each integration type. + """ + # data type: OutgoingIntegrationBrazePolicy + oneof_schema_1_validator: Optional[OutgoingIntegrationBrazePolicy] = None + # data type: OutgoingIntegrationCleverTapPolicy + oneof_schema_2_validator: Optional[OutgoingIntegrationCleverTapPolicy] = None + # data type: OutgoingIntegrationMoEngagePolicy + oneof_schema_3_validator: Optional[OutgoingIntegrationMoEngagePolicy] = None + # data type: OutgoingIntegrationIterablePolicy + oneof_schema_4_validator: Optional[OutgoingIntegrationIterablePolicy] = None + actual_instance: Optional[Union[OutgoingIntegrationBrazePolicy, OutgoingIntegrationCleverTapPolicy, OutgoingIntegrationIterablePolicy, OutgoingIntegrationMoEngagePolicy]] = None + one_of_schemas: Set[str] = { "OutgoingIntegrationBrazePolicy", "OutgoingIntegrationCleverTapPolicy", "OutgoingIntegrationIterablePolicy", "OutgoingIntegrationMoEngagePolicy" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = OutgoingIntegrationConfigurationPolicy.model_construct() + error_messages = [] + match = 0 + # validate data type: OutgoingIntegrationBrazePolicy + if not isinstance(v, OutgoingIntegrationBrazePolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `OutgoingIntegrationBrazePolicy`") + else: + match += 1 + # validate data type: OutgoingIntegrationCleverTapPolicy + if not isinstance(v, OutgoingIntegrationCleverTapPolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `OutgoingIntegrationCleverTapPolicy`") + else: + match += 1 + # validate data type: OutgoingIntegrationMoEngagePolicy + if not isinstance(v, OutgoingIntegrationMoEngagePolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `OutgoingIntegrationMoEngagePolicy`") + else: + match += 1 + # validate data type: OutgoingIntegrationIterablePolicy + if not isinstance(v, OutgoingIntegrationIterablePolicy): + error_messages.append(f"Error! Input type `{type(v)}` is not `OutgoingIntegrationIterablePolicy`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in OutgoingIntegrationConfigurationPolicy with oneOf schemas: OutgoingIntegrationBrazePolicy, OutgoingIntegrationCleverTapPolicy, OutgoingIntegrationIterablePolicy, OutgoingIntegrationMoEngagePolicy. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in OutgoingIntegrationConfigurationPolicy with oneOf schemas: OutgoingIntegrationBrazePolicy, OutgoingIntegrationCleverTapPolicy, OutgoingIntegrationIterablePolicy, OutgoingIntegrationMoEngagePolicy. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into OutgoingIntegrationBrazePolicy + try: + instance.actual_instance = OutgoingIntegrationBrazePolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into OutgoingIntegrationCleverTapPolicy + try: + instance.actual_instance = OutgoingIntegrationCleverTapPolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into OutgoingIntegrationMoEngagePolicy + try: + instance.actual_instance = OutgoingIntegrationMoEngagePolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into OutgoingIntegrationIterablePolicy + try: + instance.actual_instance = OutgoingIntegrationIterablePolicy.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into OutgoingIntegrationConfigurationPolicy with oneOf schemas: OutgoingIntegrationBrazePolicy, OutgoingIntegrationCleverTapPolicy, OutgoingIntegrationIterablePolicy, OutgoingIntegrationMoEngagePolicy. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into OutgoingIntegrationConfigurationPolicy with oneOf schemas: OutgoingIntegrationBrazePolicy, OutgoingIntegrationCleverTapPolicy, OutgoingIntegrationIterablePolicy, OutgoingIntegrationMoEngagePolicy. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], OutgoingIntegrationBrazePolicy, OutgoingIntegrationCleverTapPolicy, OutgoingIntegrationIterablePolicy, OutgoingIntegrationMoEngagePolicy]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/talon_one/models/outgoing_integration_template_with_configuration_details.py b/talon_one/models/outgoing_integration_template_with_configuration_details.py index 225a796..d789600 100644 --- a/talon_one/models/outgoing_integration_template_with_configuration_details.py +++ b/talon_one/models/outgoing_integration_template_with_configuration_details.py @@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List from typing_extensions import Annotated +from talon_one.models.outgoing_integration_configuration_policy import OutgoingIntegrationConfigurationPolicy from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -36,7 +37,7 @@ class OutgoingIntegrationTemplateWithConfigurationDetails(BaseModel): method: StrictStr = Field(description="API method for this webhook.", json_schema_extra={"examples": ["POST"]}) relative_url: StrictStr = Field(description="The relative URL corresponding to each integration template.", alias="relativeUrl", json_schema_extra={"examples": ["/campaigns/trigger/send"]}) headers: List[Annotated[str, Field(strict=True)]] = Field(description="The list of HTTP headers for this integration template.", json_schema_extra={"examples": [["{\"Content-Type\": \"application/json\"}"]]}) - policy: Dict[str, Any] = Field(description="The outgoing integration policy specific to each integration type.") + policy: OutgoingIntegrationConfigurationPolicy __properties: ClassVar[List[str]] = ["id", "integrationType", "title", "description", "payload", "method", "relativeUrl", "headers", "policy"] @field_validator('method') @@ -85,6 +86,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of policy + if self.policy: + _dict['policy'] = self.policy.to_dict() return _dict @classmethod @@ -105,7 +109,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "method": obj.get("method"), "relativeUrl": obj.get("relativeUrl"), "headers": obj.get("headers"), - "policy": obj.get("policy") + "policy": OutgoingIntegrationConfigurationPolicy.from_dict(obj["policy"]) if obj.get("policy") is not None else None }) return _obj diff --git a/talon_one/models/passthrough_block.py b/talon_one/models/passthrough_block.py index 57bf7d9..28b3dac 100644 --- a/talon_one/models/passthrough_block.py +++ b/talon_one/models/passthrough_block.py @@ -29,7 +29,7 @@ class PassthroughBlock(BaseModel): """ # noqa: E501 id: StrictStr = Field(description="Unique identifier for this block.", json_schema_extra={"examples": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}) type: StrictStr = Field(description="The type discriminator for this block.") - expression: List[Any] = Field(description="The raw Talang expression as an array. The first element is the function name; subsequent elements are its arguments, which may themselves be nested expressions.") + expression: List[Any] = Field(description="The raw Talang expression as an array. For a function call, the first element is the function name and subsequent elements are its arguments. For any other expression (for example a bare attribute path or a literal value), this is a single-element array containing that value.") __properties: ClassVar[List[str]] = ["id", "type", "expression"] @field_validator('type') diff --git a/talon_one/models/price_type.py b/talon_one/models/price_type.py index 695035c..0970d5e 100644 --- a/talon_one/models/price_type.py +++ b/talon_one/models/price_type.py @@ -40,13 +40,10 @@ class PriceType(BaseModel): targeted_audiences_ids: List[StrictInt] = Field(description="A list of the IDs of the audiences targeted by this price type.", alias="targetedAudiencesIds", json_schema_extra={"examples": [[1, 2, 3]]}) __properties: ClassVar[List[str]] = ["id", "created", "accountId", "name", "title", "description", "modified", "subscribedCatalogsIds", "targetedAudiencesIds"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z]\w*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z]\w*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z]\w*$/") return value diff --git a/talon_one/models/promotion_block.py b/talon_one/models/promotion_block.py new file mode 100644 index 0000000..ed0b252 --- /dev/null +++ b/talon_one/models/promotion_block.py @@ -0,0 +1,282 @@ +# 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from talon_one.models.passthrough_block import PassthroughBlock +from talon_one.models.update_achievement_progress_block import UpdateAchievementProgressBlock +from talon_one.models.update_attribute_value_block import UpdateAttributeValueBlock +from talon_one.models.update_audience_membership_block import UpdateAudienceMembershipBlock +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +PROMOTIONBLOCK_ONE_OF_SCHEMAS = ["AwardGiveawayBlock", "AwardItemBlock", "CheckAudienceBlock", "CheckCouponBlock", "CheckReferralBlock", "PassthroughBlock", "PromotionCheckAttributeBlock", "PromotionGroupBlock", "ShowNotificationBlock", "UpdateAchievementProgressBlock", "UpdateAttributeValueBlock", "UpdateAudienceMembershipBlock"] + +class PromotionBlock(BaseModel): + """ + Describes a part of the logic of the rule. + """ + # data type: PromotionGroupBlock + oneof_schema_1_validator: Optional[PromotionGroupBlock] = None + # data type: PassthroughBlock + oneof_schema_2_validator: Optional[PassthroughBlock] = None + # data type: ShowNotificationBlock + oneof_schema_3_validator: Optional[ShowNotificationBlock] = None + # data type: AwardItemBlock + oneof_schema_4_validator: Optional[AwardItemBlock] = None + # data type: AwardGiveawayBlock + oneof_schema_5_validator: Optional[AwardGiveawayBlock] = None + # data type: PromotionCheckAttributeBlock + oneof_schema_6_validator: Optional[PromotionCheckAttributeBlock] = None + # data type: CheckAudienceBlock + oneof_schema_7_validator: Optional[CheckAudienceBlock] = None + # data type: CheckCouponBlock + oneof_schema_8_validator: Optional[CheckCouponBlock] = None + # data type: CheckReferralBlock + oneof_schema_9_validator: Optional[CheckReferralBlock] = None + # data type: UpdateAudienceMembershipBlock + oneof_schema_10_validator: Optional[UpdateAudienceMembershipBlock] = None + # data type: UpdateAchievementProgressBlock + oneof_schema_11_validator: Optional[UpdateAchievementProgressBlock] = None + # data type: UpdateAttributeValueBlock + oneof_schema_12_validator: Optional[UpdateAttributeValueBlock] = None + actual_instance: Optional[Union[AwardGiveawayBlock, AwardItemBlock, CheckAudienceBlock, CheckCouponBlock, CheckReferralBlock, PassthroughBlock, PromotionCheckAttributeBlock, PromotionGroupBlock, ShowNotificationBlock, UpdateAchievementProgressBlock, UpdateAttributeValueBlock, UpdateAudienceMembershipBlock]] = None + one_of_schemas: Set[str] = { "AwardGiveawayBlock", "AwardItemBlock", "CheckAudienceBlock", "CheckCouponBlock", "CheckReferralBlock", "PassthroughBlock", "PromotionCheckAttributeBlock", "PromotionGroupBlock", "ShowNotificationBlock", "UpdateAchievementProgressBlock", "UpdateAttributeValueBlock", "UpdateAudienceMembershipBlock" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = PromotionBlock.model_construct() + error_messages = [] + match = 0 + # validate data type: PromotionGroupBlock + if not isinstance(v, PromotionGroupBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `PromotionGroupBlock`") + else: + match += 1 + # validate data type: PassthroughBlock + if not isinstance(v, PassthroughBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `PassthroughBlock`") + else: + match += 1 + # validate data type: ShowNotificationBlock + if not isinstance(v, ShowNotificationBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `ShowNotificationBlock`") + else: + match += 1 + # validate data type: AwardItemBlock + if not isinstance(v, AwardItemBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `AwardItemBlock`") + else: + match += 1 + # validate data type: AwardGiveawayBlock + if not isinstance(v, AwardGiveawayBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `AwardGiveawayBlock`") + else: + match += 1 + # validate data type: PromotionCheckAttributeBlock + if not isinstance(v, PromotionCheckAttributeBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `PromotionCheckAttributeBlock`") + else: + match += 1 + # validate data type: CheckAudienceBlock + if not isinstance(v, CheckAudienceBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `CheckAudienceBlock`") + else: + match += 1 + # validate data type: CheckCouponBlock + if not isinstance(v, CheckCouponBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `CheckCouponBlock`") + else: + match += 1 + # validate data type: CheckReferralBlock + if not isinstance(v, CheckReferralBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `CheckReferralBlock`") + else: + match += 1 + # validate data type: UpdateAudienceMembershipBlock + if not isinstance(v, UpdateAudienceMembershipBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateAudienceMembershipBlock`") + else: + match += 1 + # validate data type: UpdateAchievementProgressBlock + if not isinstance(v, UpdateAchievementProgressBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateAchievementProgressBlock`") + else: + match += 1 + # validate data type: UpdateAttributeValueBlock + if not isinstance(v, UpdateAttributeValueBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateAttributeValueBlock`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in PromotionBlock with oneOf schemas: AwardGiveawayBlock, AwardItemBlock, CheckAudienceBlock, CheckCouponBlock, CheckReferralBlock, PassthroughBlock, PromotionCheckAttributeBlock, PromotionGroupBlock, ShowNotificationBlock, UpdateAchievementProgressBlock, UpdateAttributeValueBlock, UpdateAudienceMembershipBlock. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in PromotionBlock with oneOf schemas: AwardGiveawayBlock, AwardItemBlock, CheckAudienceBlock, CheckCouponBlock, CheckReferralBlock, PassthroughBlock, PromotionCheckAttributeBlock, PromotionGroupBlock, ShowNotificationBlock, UpdateAchievementProgressBlock, UpdateAttributeValueBlock, UpdateAudienceMembershipBlock. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into PromotionGroupBlock + try: + instance.actual_instance = PromotionGroupBlock.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into PassthroughBlock + try: + instance.actual_instance = PassthroughBlock.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ShowNotificationBlock + try: + instance.actual_instance = ShowNotificationBlock.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AwardItemBlock + try: + instance.actual_instance = AwardItemBlock.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AwardGiveawayBlock + try: + instance.actual_instance = AwardGiveawayBlock.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into PromotionCheckAttributeBlock + try: + instance.actual_instance = PromotionCheckAttributeBlock.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CheckAudienceBlock + try: + instance.actual_instance = CheckAudienceBlock.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CheckCouponBlock + try: + instance.actual_instance = CheckCouponBlock.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CheckReferralBlock + try: + instance.actual_instance = CheckReferralBlock.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into UpdateAudienceMembershipBlock + try: + instance.actual_instance = UpdateAudienceMembershipBlock.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into UpdateAchievementProgressBlock + try: + instance.actual_instance = UpdateAchievementProgressBlock.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into UpdateAttributeValueBlock + try: + instance.actual_instance = UpdateAttributeValueBlock.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into PromotionBlock with oneOf schemas: AwardGiveawayBlock, AwardItemBlock, CheckAudienceBlock, CheckCouponBlock, CheckReferralBlock, PassthroughBlock, PromotionCheckAttributeBlock, PromotionGroupBlock, ShowNotificationBlock, UpdateAchievementProgressBlock, UpdateAttributeValueBlock, UpdateAudienceMembershipBlock. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into PromotionBlock with oneOf schemas: AwardGiveawayBlock, AwardItemBlock, CheckAudienceBlock, CheckCouponBlock, CheckReferralBlock, PassthroughBlock, PromotionCheckAttributeBlock, PromotionGroupBlock, ShowNotificationBlock, UpdateAchievementProgressBlock, UpdateAttributeValueBlock, UpdateAudienceMembershipBlock. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], AwardGiveawayBlock, AwardItemBlock, CheckAudienceBlock, CheckCouponBlock, CheckReferralBlock, PassthroughBlock, PromotionCheckAttributeBlock, PromotionGroupBlock, ShowNotificationBlock, UpdateAchievementProgressBlock, UpdateAttributeValueBlock, UpdateAudienceMembershipBlock]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + +from talon_one.models.award_giveaway_block import AwardGiveawayBlock +from talon_one.models.award_item_block import AwardItemBlock +from talon_one.models.check_audience_block import CheckAudienceBlock +from talon_one.models.check_coupon_block import CheckCouponBlock +from talon_one.models.check_referral_block import CheckReferralBlock +from talon_one.models.promotion_check_attribute_block import PromotionCheckAttributeBlock +from talon_one.models.promotion_group_block import PromotionGroupBlock +from talon_one.models.show_notification_block import ShowNotificationBlock +# TODO: Rewrite to not use raise_errors +PromotionBlock.model_rebuild(raise_errors=False) + diff --git a/talon_one/models/promotion_check_attribute_block.py b/talon_one/models/promotion_check_attribute_block.py index 4982eb6..5c23a4e 100644 --- a/talon_one/models/promotion_check_attribute_block.py +++ b/talon_one/models/promotion_check_attribute_block.py @@ -17,20 +17,36 @@ import re # noqa: F401 import json -from pydantic import ConfigDict, Field +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from talon_one.models.check_attribute_block import CheckAttributeBlock from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python -class PromotionCheckAttributeBlock(CheckAttributeBlock): +class PromotionCheckAttributeBlock(BaseModel): """ PromotionCheckAttributeBlock """ # noqa: E501 - on_failure: Optional[List[Any]] = Field(default=None, description="Promotion blocks evaluated when this block fails or returns false.", alias="onFailure") + id: StrictStr = Field(description="Unique identifier for this block.", json_schema_extra={"examples": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}) + type: StrictStr = Field(description="Identifies the block variant and determines which additional properties are present in it.") + tags: Optional[List[StrictStr]] = Field(default=None, description="Semantic labels attached to this block.") + operator: StrictStr = Field(description="The comparison operator applied to the attribute.", json_schema_extra={"examples": ["greaterThan"]}) + attribute: StrictStr = Field(description="The attribute path identifier (e.g. \"$Session.Total\").", json_schema_extra={"examples": ["$Session.Total"]}) + value: Optional[Any] = None + min: Optional[Any] = None + max: Optional[Any] = None + values: Optional[Any] = None + count: Optional[Any] = None + on_failure: Optional[List[PromotionBlock]] = Field(default=None, description="Promotion blocks evaluated when this block fails or returns false.", alias="onFailure") __properties: ClassVar[List[str]] = ["id", "type", "tags", "operator", "attribute", "value", "min", "max", "values", "count", "onFailure"] + @field_validator('operator') + def operator_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['equals', 'not(equals)', 'lessThan', 'lessThanOrEqual', 'greaterThan', 'greaterThanOrEqual', 'between', 'contains', 'not(contains)', 'matchesRegexp', 'startsWith', 'endsWith', 'oneOf', 'not(oneOf)', 'inCollection', 'not(inCollection)', 'empty', 'not(empty)', 'exists', 'not(exists)', 'isTrue', 'isFalse', 'containsAtLeast', 'containsExactly', 'containsOneOf', 'containsNoneOf', 'containsAllOf']): + raise ValueError("must be one of enum values ('equals', 'not(equals)', 'lessThan', 'lessThanOrEqual', 'greaterThan', 'greaterThanOrEqual', 'between', 'contains', 'not(contains)', 'matchesRegexp', 'startsWith', 'endsWith', 'oneOf', 'not(oneOf)', 'inCollection', 'not(inCollection)', 'empty', 'not(empty)', 'exists', 'not(exists)', 'isTrue', 'isFalse', 'containsAtLeast', 'containsExactly', 'containsOneOf', 'containsNoneOf', 'containsAllOf')") + return value + model_config = ConfigDict( validate_by_name=True, validate_by_alias=True, @@ -70,6 +86,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 on_failure (list) + _items = [] + if self.on_failure: + for _item_on_failure in self.on_failure: + if _item_on_failure: + _items.append(_item_on_failure.to_dict()) + _dict['onFailure'] = _items # set to None if value (nullable) is None # and model_fields_set contains the field if self.value is None and "value" in self.model_fields_set: @@ -117,8 +140,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "max": obj.get("max"), "values": obj.get("values"), "count": obj.get("count"), - "onFailure": obj.get("onFailure") + "onFailure": [PromotionBlock.from_dict(_item) for _item in obj["onFailure"]] if obj.get("onFailure") is not None else None }) return _obj +from talon_one.models.promotion_block import PromotionBlock +# TODO: Rewrite to not use raise_errors +PromotionCheckAttributeBlock.model_rebuild(raise_errors=False) diff --git a/talon_one/models/promotion_group_block.py b/talon_one/models/promotion_group_block.py index b00893b..0f4e451 100644 --- a/talon_one/models/promotion_group_block.py +++ b/talon_one/models/promotion_group_block.py @@ -31,9 +31,9 @@ class PromotionGroupBlock(BaseModel): type: StrictStr = Field(description="Identifies the block variant and determines which additional properties are present in it.") tags: Optional[List[StrictStr]] = Field(default=None, description="Semantic labels attached to this block.") operator: StrictStr = Field(description="Logical operator applied across child blocks. `all` requires every child to pass, `atLeastOne` requires at least one, `none` requires all to fail.") - blocks: List[Any] = Field(description="Child blocks evaluated according to the operator.") - on_failure: Optional[List[Any]] = Field(default=None, description="Promotion blocks evaluated when this block fails or returns false.", alias="onFailure") - on_error: Optional[Dict[str, List[Any]]] = Field(default=None, description="Named error handlers evaluated when a specific error occurs.", alias="onError") + blocks: List[PromotionBlock] = Field(description="Child blocks evaluated according to the operator.") + on_failure: Optional[List[PromotionBlock]] = Field(default=None, description="Promotion blocks evaluated when this block fails or returns false.", alias="onFailure") + on_error: Optional[Dict[str, List[PromotionBlock]]] = Field(default=None, description="Named error handlers evaluated when a specific error occurs.", alias="onError") __properties: ClassVar[List[str]] = ["id", "type", "tags", "operator", "blocks", "onFailure", "onError"] @field_validator('operator') @@ -82,6 +82,29 @@ 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 blocks (list) + _items = [] + if self.blocks: + for _item_blocks in self.blocks: + if _item_blocks: + _items.append(_item_blocks.to_dict()) + _dict['blocks'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in on_failure (list) + _items = [] + if self.on_failure: + for _item_on_failure in self.on_failure: + if _item_on_failure: + _items.append(_item_on_failure.to_dict()) + _dict['onFailure'] = _items + # override the default output from pydantic by calling `to_dict()` of each value in on_error (dict of array) + _field_dict_of_array = {} + if self.on_error: + for _key_on_error in self.on_error: + if self.on_error[_key_on_error] is not None: + _field_dict_of_array[_key_on_error] = [ + _item.to_dict() for _item in self.on_error[_key_on_error] + ] + _dict['onError'] = _field_dict_of_array return _dict @classmethod @@ -98,10 +121,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "type": obj.get("type"), "tags": obj.get("tags"), "operator": obj.get("operator"), - "blocks": obj.get("blocks"), - "onFailure": obj.get("onFailure"), - "onError": obj.get("onError") + "blocks": [PromotionBlock.from_dict(_item) for _item in obj["blocks"]] if obj.get("blocks") is not None else None, + "onFailure": [PromotionBlock.from_dict(_item) for _item in obj["onFailure"]] if obj.get("onFailure") is not None else None, + "onError": { + _k: [PromotionBlock.from_dict(_item) for _item in _v] if _v is not None else None + for _k, _v in obj["onError"].items() + } + if obj.get("onError") is not None + else None }) return _obj +from talon_one.models.promotion_block import PromotionBlock +# TODO: Rewrite to not use raise_errors +PromotionGroupBlock.model_rebuild(raise_errors=False) diff --git a/talon_one/models/promotion_rule_v2.py b/talon_one/models/promotion_rule_v2.py index 6976296..d360fe0 100644 --- a/talon_one/models/promotion_rule_v2.py +++ b/talon_one/models/promotion_rule_v2.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.promotion_block import PromotionBlock from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -31,7 +32,7 @@ class PromotionRuleV2(BaseModel): parent_id: Optional[StrictStr] = Field(default=None, description="ID of the parent rule, if any.", alias="parentId") title: StrictStr = Field(description="A short description of the rule.", json_schema_extra={"examples": ["10% off for loyalty members"]}) description: Optional[StrictStr] = Field(default=None, description="A longer description of the rule.") - blocks: List[Any] = Field(description="The condition and effect blocks that make up this promotion rule.") + blocks: List[PromotionBlock] = Field(description="The condition and effect blocks that make up this promotion rule.") __properties: ClassVar[List[str]] = ["id", "parentId", "title", "description", "blocks"] model_config = ConfigDict( @@ -73,6 +74,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 blocks (list) + _items = [] + if self.blocks: + for _item_blocks in self.blocks: + if _item_blocks: + _items.append(_item_blocks.to_dict()) + _dict['blocks'] = _items return _dict @classmethod @@ -89,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "parentId": obj.get("parentId"), "title": obj.get("title"), "description": obj.get("description"), - "blocks": obj.get("blocks") + "blocks": [PromotionBlock.from_dict(_item) for _item in obj["blocks"]] if obj.get("blocks") is not None else None }) return _obj diff --git a/talon_one/models/referral.py b/talon_one/models/referral.py index a183a4d..beab28c 100644 --- a/talon_one/models/referral.py +++ b/talon_one/models/referral.py @@ -37,7 +37,7 @@ class Referral(BaseModel): campaign_id: StrictInt = Field(description="ID of the campaign from which the referral received the referral code.", alias="campaignId", json_schema_extra={"examples": [78]}) advocate_profile_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The Integration ID of the Advocate's Profile.", alias="advocateProfileIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) friend_profile_integration_id: Optional[StrictStr] = Field(default=None, description="An optional Integration ID of the Friend's Profile.", alias="friendProfileIntegrationId", json_schema_extra={"examples": ["BZGGC2454PA"]}) - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.", json_schema_extra={"examples": ["{channel=web}"]}) import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this referral.", alias="importId", json_schema_extra={"examples": [4]}) code: Annotated[str, Field(min_length=4, strict=True)] = Field(description="The referral code.", json_schema_extra={"examples": ["27G47Y54VH9L"]}) usage_counter: StrictInt = Field(description="The number of times this referral code has been successfully used.", alias="usageCounter", json_schema_extra={"examples": [1]}) diff --git a/talon_one/models/application_notification.py b/talon_one/models/review_risks_request.py similarity index 81% rename from talon_one/models/application_notification.py rename to talon_one/models/review_risks_request.py index eac7b47..06c2fbc 100644 --- a/talon_one/models/application_notification.py +++ b/talon_one/models/review_risks_request.py @@ -17,18 +17,19 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt 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 ApplicationNotification(BaseModel): +class ReviewRisksRequest(BaseModel): """ - ApplicationNotification + ReviewRisksRequest """ # noqa: E501 - event: StrictStr = Field(description="Event type. It can be one of the following: ['campaign_evaluation_tree_changed'] ") - __properties: ClassVar[List[str]] = ["event"] + risk_ids: Annotated[List[StrictInt], Field(min_length=1, max_length=1000)] = Field(description="The IDs of the risks to move to `In review` status.", alias="riskIds", json_schema_extra={"examples": [[1, 2, 3]]}) + __properties: ClassVar[List[str]] = ["riskIds"] model_config = ConfigDict( validate_by_name=True, @@ -48,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationNotification from a JSON string""" + """Create an instance of ReviewRisksRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationNotification from a dict""" + """Create an instance of ReviewRisksRequest from a dict""" if obj is None: return None @@ -81,7 +82,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "event": obj.get("event") + "riskIds": obj.get("riskIds") }) return _obj diff --git a/talon_one/models/risk.py b/talon_one/models/risk.py index 0329267..cc77952 100644 --- a/talon_one/models/risk.py +++ b/talon_one/models/risk.py @@ -42,8 +42,12 @@ class Risk(BaseModel): reported_date: datetime = Field(description="The time the ML service reported this risk.", alias="reportedDate", json_schema_extra={"examples": ["2026-06-05T06:26:13.698884Z"]}) affected_entity_count: StrictInt = Field(description="The total number of entities affected by this risk.", alias="affectedEntityCount", json_schema_extra={"examples": [4437]}) description: Optional[StrictStr] = Field(default=None, description="Human-readable description of the detected anomaly.", json_schema_extra={"examples": ["Unusual discount usage detected for 4437 customer profiles."]}) + discard_reason: Optional[StrictStr] = Field(default=None, description="The reason this risk was discarded. Only present on discarded risks.", alias="discardReason", json_schema_extra={"examples": ["expected_behavior"]}) + status_comment: Optional[StrictStr] = Field(default=None, description="The free-text details of the latest reclassification action: the description for resolving confirmed risks, or the details for discarding risks. ", alias="statusComment", json_schema_extra={"examples": ["Investigated with the customer and fixed the loyalty rule."]}) + status_changed_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who performed the latest reclassification action.", alias="statusChangedBy", json_schema_extra={"examples": [42]}) + status_changed_at: Optional[datetime] = Field(default=None, description="The time of the latest reclassification action.", alias="statusChangedAt", json_schema_extra={"examples": ["2026-06-06T09:12:45.000000Z"]}) modified: datetime = Field(description="Timestamp of the most recent update.", json_schema_extra={"examples": ["2026-06-05T06:26:13.698884Z"]}) - __properties: ClassVar[List[str]] = ["id", "created", "notificationId", "featureDate", "groupKey", "applicationId", "status", "criticality", "entity", "activity", "timeFrame", "reportedDate", "affectedEntityCount", "description", "modified"] + __properties: ClassVar[List[str]] = ["id", "created", "notificationId", "featureDate", "groupKey", "applicationId", "status", "criticality", "entity", "activity", "timeFrame", "reportedDate", "affectedEntityCount", "description", "discardReason", "statusComment", "statusChangedBy", "statusChangedAt", "modified"] @field_validator('status') def status_validate_enum(cls, value): @@ -80,6 +84,16 @@ def time_frame_validate_enum(cls, value): raise ValueError("must be one of enum values ('1D', '7D', '30D')") return value + @field_validator('discard_reason') + def discard_reason_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['expected_behavior', 'other']): + raise ValueError("must be one of enum values ('expected_behavior', 'other')") + return value + model_config = ConfigDict( validate_by_name=True, validate_by_alias=True, @@ -145,6 +159,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "reportedDate": obj.get("reportedDate"), "affectedEntityCount": obj.get("affectedEntityCount"), "description": obj.get("description"), + "discardReason": obj.get("discardReason"), + "statusComment": obj.get("statusComment"), + "statusChangedBy": obj.get("statusChangedBy"), + "statusChangedAt": obj.get("statusChangedAt"), "modified": obj.get("modified") }) return _obj diff --git a/talon_one/models/risk_criticality_update.py b/talon_one/models/risk_criticality_update.py new file mode 100644 index 0000000..3eaaf82 --- /dev/null +++ b/talon_one/models/risk_criticality_update.py @@ -0,0 +1,98 @@ +# 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_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RiskCriticalityUpdate(BaseModel): + """ + RiskCriticalityUpdate + """ # noqa: E501 + risk_ids: Annotated[List[StrictInt], Field(min_length=1, max_length=1000)] = Field(description="The IDs of the risks to reclassify.", alias="riskIds", json_schema_extra={"examples": [[1, 2, 3]]}) + criticality: StrictStr = Field(description="The criticality to assign to risks. Only `not_critical` is accepted: critical risks can be reclassified as non-critical, but not the other way around. ", json_schema_extra={"examples": ["not_critical"]}) + __properties: ClassVar[List[str]] = ["riskIds", "criticality"] + + @field_validator('criticality') + def criticality_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['not_critical']): + raise ValueError("must be one of enum values ('not_critical')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RiskCriticalityUpdate 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 RiskCriticalityUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "riskIds": obj.get("riskIds"), + "criticality": obj.get("criticality") + }) + return _obj + + diff --git a/talon_one/models/risk_detail.py b/talon_one/models/risk_detail.py index ae30cba..7d1a6fa 100644 --- a/talon_one/models/risk_detail.py +++ b/talon_one/models/risk_detail.py @@ -43,9 +43,13 @@ class RiskDetail(BaseModel): reported_date: datetime = Field(description="The time the ML service reported this risk.", alias="reportedDate", json_schema_extra={"examples": ["2026-06-05T06:26:13.698884Z"]}) affected_entity_count: StrictInt = Field(description="The total number of entities affected by this risk.", alias="affectedEntityCount", json_schema_extra={"examples": [4437]}) description: Optional[StrictStr] = Field(default=None, description="Human-readable description of the detected anomaly.", json_schema_extra={"examples": ["Unusual discount usage detected for 4437 customer profiles."]}) + discard_reason: Optional[StrictStr] = Field(default=None, description="The reason this risk was discarded. Only present on discarded risks.", alias="discardReason", json_schema_extra={"examples": ["expected_behavior"]}) + status_comment: Optional[StrictStr] = Field(default=None, description="The free-text details of the latest reclassification action: the description for resolving confirmed risks, or the details for discarding risks. ", alias="statusComment", json_schema_extra={"examples": ["Investigated with the customer and fixed the loyalty rule."]}) + status_changed_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who performed the latest reclassification action.", alias="statusChangedBy", json_schema_extra={"examples": [42]}) + status_changed_at: Optional[datetime] = Field(default=None, description="The time of the latest reclassification action.", alias="statusChangedAt", json_schema_extra={"examples": ["2026-06-06T09:12:45.000000Z"]}) modified: datetime = Field(description="Timestamp of the most recent update.", json_schema_extra={"examples": ["2026-06-05T06:26:13.698884Z"]}) affected_entities: List[RiskAffectedEntityItem] = Field(description="The affected entities with the highest severity ratios, in descending order.", alias="affectedEntities") - __properties: ClassVar[List[str]] = ["id", "created", "notificationId", "featureDate", "groupKey", "applicationId", "status", "criticality", "entity", "activity", "timeFrame", "reportedDate", "affectedEntityCount", "description", "modified", "affectedEntities"] + __properties: ClassVar[List[str]] = ["id", "created", "notificationId", "featureDate", "groupKey", "applicationId", "status", "criticality", "entity", "activity", "timeFrame", "reportedDate", "affectedEntityCount", "description", "discardReason", "statusComment", "statusChangedBy", "statusChangedAt", "modified", "affectedEntities"] @field_validator('status') def status_validate_enum(cls, value): @@ -82,6 +86,16 @@ def time_frame_validate_enum(cls, value): raise ValueError("must be one of enum values ('1D', '7D', '30D')") return value + @field_validator('discard_reason') + def discard_reason_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['expected_behavior', 'other']): + raise ValueError("must be one of enum values ('expected_behavior', 'other')") + return value + model_config = ConfigDict( validate_by_name=True, validate_by_alias=True, @@ -154,6 +168,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "reportedDate": obj.get("reportedDate"), "affectedEntityCount": obj.get("affectedEntityCount"), "description": obj.get("description"), + "discardReason": obj.get("discardReason"), + "statusComment": obj.get("statusComment"), + "statusChangedBy": obj.get("statusChangedBy"), + "statusChangedAt": obj.get("statusChangedAt"), "modified": obj.get("modified"), "affectedEntities": [RiskAffectedEntityItem.from_dict(_item) for _item in obj["affectedEntities"]] if obj.get("affectedEntities") is not None else None }) diff --git a/talon_one/models/rollback_added_loyalty_points_effect_props.py b/talon_one/models/rollback_added_loyalty_points_effect_props.py index 60efbff..07e4e50 100644 --- a/talon_one/models/rollback_added_loyalty_points_effect_props.py +++ b/talon_one/models/rollback_added_loyalty_points_effect_props.py @@ -38,16 +38,13 @@ class RollbackAddedLoyaltyPointsEffectProps(BaseModel): card_identifier: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=108)]] = Field(default=None, description="The identifier of the card on which these points were originally added.", alias="cardIdentifier", json_schema_extra={"examples": ["summer-loyalty-card-0543"]}) __properties: ClassVar[List[str]] = ["programId", "subLedgerId", "value", "recipientIntegrationId", "transactionUUID", "cartItemPosition", "cartItemSubPosition", "cardIdentifier"] - @field_validator('card_identifier') + @field_validator('card_identifier', mode="before") def card_identifier_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z0-9._%+@-]+$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z0-9._%+@-]+$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z0-9._%+@-]+$/") return value diff --git a/talon_one/models/rollback_deducted_loyalty_points_effect_props.py b/talon_one/models/rollback_deducted_loyalty_points_effect_props.py index 4d6d80e..afb70d9 100644 --- a/talon_one/models/rollback_deducted_loyalty_points_effect_props.py +++ b/talon_one/models/rollback_deducted_loyalty_points_effect_props.py @@ -39,16 +39,13 @@ class RollbackDeductedLoyaltyPointsEffectProps(BaseModel): card_identifier: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=108)]] = Field(default=None, description="The identifier of the card from which these points were originally deducted.", alias="cardIdentifier", json_schema_extra={"examples": ["summer-loyalty-card-0543"]}) __properties: ClassVar[List[str]] = ["programId", "subLedgerId", "value", "recipientIntegrationId", "startDate", "expiryDate", "transactionUUID", "cardIdentifier"] - @field_validator('card_identifier') + @field_validator('card_identifier', mode="before") def card_identifier_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z0-9._%+@-]+$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z0-9._%+@-]+$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z0-9._%+@-]+$/") return value diff --git a/talon_one/models/scim_service_provider_config_response.py b/talon_one/models/scim_service_provider_config_response.py index 985fc7c..1ebbb45 100644 --- a/talon_one/models/scim_service_provider_config_response.py +++ b/talon_one/models/scim_service_provider_config_response.py @@ -22,6 +22,8 @@ from talon_one.models.scim_service_provider_config_response_bulk import ScimServiceProviderConfigResponseBulk from talon_one.models.scim_service_provider_config_response_change_password import ScimServiceProviderConfigResponseChangePassword from talon_one.models.scim_service_provider_config_response_filter import ScimServiceProviderConfigResponseFilter +from talon_one.models.scim_service_provider_config_response_patch import ScimServiceProviderConfigResponsePatch +from talon_one.models.scim_service_provider_config_response_sort import ScimServiceProviderConfigResponseSort from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -34,9 +36,9 @@ class ScimServiceProviderConfigResponse(BaseModel): change_password: Optional[ScimServiceProviderConfigResponseChangePassword] = Field(default=None, alias="changePassword") documentation_uri: Optional[StrictStr] = Field(default=None, description="The URI that points to the SCIM service provider's documentation, providing further details about the service's capabilities and usage.", alias="documentationUri") filter: Optional[ScimServiceProviderConfigResponseFilter] = None - patch: Optional[ScimServiceProviderConfigResponseChangePassword] = None + patch: Optional[ScimServiceProviderConfigResponsePatch] = None schemas: Optional[List[StrictStr]] = Field(default=None, description="A list of SCIM schemas that define the structure and data types supported by the service provider.") - sort: Optional[ScimServiceProviderConfigResponseChangePassword] = None + sort: Optional[ScimServiceProviderConfigResponseSort] = None __properties: ClassVar[List[str]] = ["bulk", "changePassword", "documentationUri", "filter", "patch", "schemas", "sort"] model_config = ConfigDict( @@ -109,9 +111,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "changePassword": ScimServiceProviderConfigResponseChangePassword.from_dict(obj["changePassword"]) if obj.get("changePassword") is not None else None, "documentationUri": obj.get("documentationUri"), "filter": ScimServiceProviderConfigResponseFilter.from_dict(obj["filter"]) if obj.get("filter") is not None else None, - "patch": ScimServiceProviderConfigResponseChangePassword.from_dict(obj["patch"]) if obj.get("patch") is not None else None, + "patch": ScimServiceProviderConfigResponsePatch.from_dict(obj["patch"]) if obj.get("patch") is not None else None, "schemas": obj.get("schemas"), - "sort": ScimServiceProviderConfigResponseChangePassword.from_dict(obj["sort"]) if obj.get("sort") is not None else None + "sort": ScimServiceProviderConfigResponseSort.from_dict(obj["sort"]) if obj.get("sort") is not None else None }) return _obj diff --git a/talon_one/models/scim_service_provider_config_response_patch.py b/talon_one/models/scim_service_provider_config_response_patch.py new file mode 100644 index 0000000..24a7b77 --- /dev/null +++ b/talon_one/models/scim_service_provider_config_response_patch.py @@ -0,0 +1,88 @@ +# 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, StrictBool +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 ScimServiceProviderConfigResponsePatch(BaseModel): + """ + Configuration settings related to patch operations, which allow partial updates to SCIM resources. + """ # noqa: E501 + supported: Optional[StrictBool] = Field(default=None, description="Indicates whether the service provider supports patch operations for modifying resources.") + __properties: ClassVar[List[str]] = ["supported"] + + 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 ScimServiceProviderConfigResponsePatch 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 ScimServiceProviderConfigResponsePatch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "supported": obj.get("supported") + }) + return _obj + + diff --git a/talon_one/models/scim_service_provider_config_response_sort.py b/talon_one/models/scim_service_provider_config_response_sort.py new file mode 100644 index 0000000..8c2bfcb --- /dev/null +++ b/talon_one/models/scim_service_provider_config_response_sort.py @@ -0,0 +1,88 @@ +# 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, StrictBool +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 ScimServiceProviderConfigResponseSort(BaseModel): + """ + Configuration settings related to sorting SCIM resources in query responses. + """ # noqa: E501 + supported: Optional[StrictBool] = Field(default=None, description="Indicates whether the service provider supports sorting operations for ordered query results.") + __properties: ClassVar[List[str]] = ["supported"] + + 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 ScimServiceProviderConfigResponseSort 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 ScimServiceProviderConfigResponseSort from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "supported": obj.get("supported") + }) + return _obj + + diff --git a/talon_one/models/secondary_deployment.py b/talon_one/models/secondary_deployment.py index 14644bd..e07c570 100644 --- a/talon_one/models/secondary_deployment.py +++ b/talon_one/models/secondary_deployment.py @@ -39,13 +39,10 @@ class SecondaryDeployment(BaseModel): deleted_at: Optional[datetime] = Field(default=None, description="Timestamp when the deployment was deleted.", alias="deletedAt", json_schema_extra={"examples": ["2023-01-18T16:00:00.700763Z"]}) __properties: ClassVar[List[str]] = ["id", "name", "userId", "status", "createdAt", "activeAt", "failedAt", "deletedAt"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[a-z0-9]+$", value): + if isinstance(value, str) and not re.match(r"^[a-z0-9]+$", value): raise ValueError(r"must validate the regular expression /^[a-z0-9]+$/") return value diff --git a/talon_one/models/show_notification_block.py b/talon_one/models/show_notification_block.py index 761a852..863792a 100644 --- a/talon_one/models/show_notification_block.py +++ b/talon_one/models/show_notification_block.py @@ -33,8 +33,8 @@ class ShowNotificationBlock(BaseModel): notification_type: StrictStr = Field(description="The type of notification to display.", alias="notificationType", json_schema_extra={"examples": ["Info"]}) title: StrictStr = Field(description="The notification heading shown to the customer.", json_schema_extra={"examples": ["You earned a reward!"]}) body: Optional[StrictStr] = Field(default=None, description="The notification body text. Supports template placeholders (e.g. \"{{$Session.Total}}\") evaluated at rule execution time.", json_schema_extra={"examples": ["You saved $10 on your order."]}) - on_failure: Optional[List[Any]] = Field(default=None, description="Blocks evaluated when this block fails or returns false.", alias="onFailure") - on_error: Optional[Dict[str, List[Any]]] = Field(default=None, description="Named error handlers evaluated when a specific error occurs.", alias="onError") + on_failure: Optional[List[PromotionBlock]] = Field(default=None, description="Blocks evaluated when this block fails or returns false.", alias="onFailure") + on_error: Optional[Dict[str, List[PromotionBlock]]] = Field(default=None, description="Named error handlers evaluated when a specific error occurs.", alias="onError") __properties: ClassVar[List[str]] = ["id", "type", "tags", "notificationType", "title", "body", "onFailure", "onError"] model_config = ConfigDict( @@ -76,6 +76,22 @@ 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 on_failure (list) + _items = [] + if self.on_failure: + for _item_on_failure in self.on_failure: + if _item_on_failure: + _items.append(_item_on_failure.to_dict()) + _dict['onFailure'] = _items + # override the default output from pydantic by calling `to_dict()` of each value in on_error (dict of array) + _field_dict_of_array = {} + if self.on_error: + for _key_on_error in self.on_error: + if self.on_error[_key_on_error] is not None: + _field_dict_of_array[_key_on_error] = [ + _item.to_dict() for _item in self.on_error[_key_on_error] + ] + _dict['onError'] = _field_dict_of_array return _dict @classmethod @@ -94,9 +110,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "notificationType": obj.get("notificationType"), "title": obj.get("title"), "body": obj.get("body"), - "onFailure": obj.get("onFailure"), - "onError": obj.get("onError") + "onFailure": [PromotionBlock.from_dict(_item) for _item in obj["onFailure"]] if obj.get("onFailure") is not None else None, + "onError": { + _k: [PromotionBlock.from_dict(_item) for _item in _v] if _v is not None else None + for _k, _v in obj["onError"].items() + } + if obj.get("onError") is not None + else None }) return _obj +from talon_one.models.promotion_block import PromotionBlock +# TODO: Rewrite to not use raise_errors +ShowNotificationBlock.model_rebuild(raise_errors=False) diff --git a/talon_one/models/strikethrough_block.py b/talon_one/models/strikethrough_block.py new file mode 100644 index 0000000..07d0691 --- /dev/null +++ b/talon_one/models/strikethrough_block.py @@ -0,0 +1,156 @@ +# 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from talon_one.models.passthrough_block import PassthroughBlock +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +STRIKETHROUGHBLOCK_ONE_OF_SCHEMAS = ["PassthroughBlock", "StrikethroughCheckAttributeBlock", "StrikethroughGroupBlock"] + +class StrikethroughBlock(BaseModel): + """ + A block valid in a strikethrough rule. The `type` field identifies the concrete block type. + """ + # data type: StrikethroughGroupBlock + oneof_schema_1_validator: Optional[StrikethroughGroupBlock] = None + # data type: PassthroughBlock + oneof_schema_2_validator: Optional[PassthroughBlock] = None + # data type: StrikethroughCheckAttributeBlock + oneof_schema_3_validator: Optional[StrikethroughCheckAttributeBlock] = None + actual_instance: Optional[Union[PassthroughBlock, StrikethroughCheckAttributeBlock, StrikethroughGroupBlock]] = None + one_of_schemas: Set[str] = { "PassthroughBlock", "StrikethroughCheckAttributeBlock", "StrikethroughGroupBlock" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = StrikethroughBlock.model_construct() + error_messages = [] + match = 0 + # validate data type: StrikethroughGroupBlock + if not isinstance(v, StrikethroughGroupBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `StrikethroughGroupBlock`") + else: + match += 1 + # validate data type: PassthroughBlock + if not isinstance(v, PassthroughBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `PassthroughBlock`") + else: + match += 1 + # validate data type: StrikethroughCheckAttributeBlock + if not isinstance(v, StrikethroughCheckAttributeBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `StrikethroughCheckAttributeBlock`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in StrikethroughBlock with oneOf schemas: PassthroughBlock, StrikethroughCheckAttributeBlock, StrikethroughGroupBlock. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in StrikethroughBlock with oneOf schemas: PassthroughBlock, StrikethroughCheckAttributeBlock, StrikethroughGroupBlock. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into StrikethroughGroupBlock + try: + instance.actual_instance = StrikethroughGroupBlock.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into PassthroughBlock + try: + instance.actual_instance = PassthroughBlock.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into StrikethroughCheckAttributeBlock + try: + instance.actual_instance = StrikethroughCheckAttributeBlock.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into StrikethroughBlock with oneOf schemas: PassthroughBlock, StrikethroughCheckAttributeBlock, StrikethroughGroupBlock. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into StrikethroughBlock with oneOf schemas: PassthroughBlock, StrikethroughCheckAttributeBlock, StrikethroughGroupBlock. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], PassthroughBlock, StrikethroughCheckAttributeBlock, StrikethroughGroupBlock]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + +from talon_one.models.strikethrough_check_attribute_block import StrikethroughCheckAttributeBlock +from talon_one.models.strikethrough_group_block import StrikethroughGroupBlock +# TODO: Rewrite to not use raise_errors +StrikethroughBlock.model_rebuild(raise_errors=False) + diff --git a/talon_one/models/strikethrough_check_attribute_block.py b/talon_one/models/strikethrough_check_attribute_block.py index 6c63d5c..434d557 100644 --- a/talon_one/models/strikethrough_check_attribute_block.py +++ b/talon_one/models/strikethrough_check_attribute_block.py @@ -17,20 +17,36 @@ import re # noqa: F401 import json -from pydantic import ConfigDict, Field +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from talon_one.models.check_attribute_block import CheckAttributeBlock from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python -class StrikethroughCheckAttributeBlock(CheckAttributeBlock): +class StrikethroughCheckAttributeBlock(BaseModel): """ StrikethroughCheckAttributeBlock """ # noqa: E501 - on_failure: Optional[List[Any]] = Field(default=None, description="Strikethrough blocks evaluated when this block fails or returns false.", alias="onFailure") + id: StrictStr = Field(description="Unique identifier for this block.", json_schema_extra={"examples": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}) + type: StrictStr = Field(description="Identifies the block variant and determines which additional properties are present in it.") + tags: Optional[List[StrictStr]] = Field(default=None, description="Semantic labels attached to this block.") + operator: StrictStr = Field(description="The comparison operator applied to the attribute.", json_schema_extra={"examples": ["greaterThan"]}) + attribute: StrictStr = Field(description="The attribute path identifier (e.g. \"$Session.Total\").", json_schema_extra={"examples": ["$Session.Total"]}) + value: Optional[Any] = None + min: Optional[Any] = None + max: Optional[Any] = None + values: Optional[Any] = None + count: Optional[Any] = None + on_failure: Optional[List[StrikethroughBlock]] = Field(default=None, description="Strikethrough blocks evaluated when this block fails or returns false.", alias="onFailure") __properties: ClassVar[List[str]] = ["id", "type", "tags", "operator", "attribute", "value", "min", "max", "values", "count", "onFailure"] + @field_validator('operator') + def operator_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['equals', 'not(equals)', 'lessThan', 'lessThanOrEqual', 'greaterThan', 'greaterThanOrEqual', 'between', 'contains', 'not(contains)', 'matchesRegexp', 'startsWith', 'endsWith', 'oneOf', 'not(oneOf)', 'inCollection', 'not(inCollection)', 'empty', 'not(empty)', 'exists', 'not(exists)', 'isTrue', 'isFalse', 'containsAtLeast', 'containsExactly', 'containsOneOf', 'containsNoneOf', 'containsAllOf']): + raise ValueError("must be one of enum values ('equals', 'not(equals)', 'lessThan', 'lessThanOrEqual', 'greaterThan', 'greaterThanOrEqual', 'between', 'contains', 'not(contains)', 'matchesRegexp', 'startsWith', 'endsWith', 'oneOf', 'not(oneOf)', 'inCollection', 'not(inCollection)', 'empty', 'not(empty)', 'exists', 'not(exists)', 'isTrue', 'isFalse', 'containsAtLeast', 'containsExactly', 'containsOneOf', 'containsNoneOf', 'containsAllOf')") + return value + model_config = ConfigDict( validate_by_name=True, validate_by_alias=True, @@ -70,6 +86,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 on_failure (list) + _items = [] + if self.on_failure: + for _item_on_failure in self.on_failure: + if _item_on_failure: + _items.append(_item_on_failure.to_dict()) + _dict['onFailure'] = _items # set to None if value (nullable) is None # and model_fields_set contains the field if self.value is None and "value" in self.model_fields_set: @@ -117,8 +140,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "max": obj.get("max"), "values": obj.get("values"), "count": obj.get("count"), - "onFailure": obj.get("onFailure") + "onFailure": [StrikethroughBlock.from_dict(_item) for _item in obj["onFailure"]] if obj.get("onFailure") is not None else None }) return _obj +from talon_one.models.strikethrough_block import StrikethroughBlock +# TODO: Rewrite to not use raise_errors +StrikethroughCheckAttributeBlock.model_rebuild(raise_errors=False) diff --git a/talon_one/models/strikethrough_effect.py b/talon_one/models/strikethrough_effect.py index cf186dd..08ae44e 100644 --- a/talon_one/models/strikethrough_effect.py +++ b/talon_one/models/strikethrough_effect.py @@ -20,6 +20,8 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union +from talon_one.models.label_target import LabelTarget +from talon_one.models.strikethrough_effect_props import StrikethroughEffectProps from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -33,13 +35,13 @@ class StrikethroughEffect(BaseModel): rule_index: StrictInt = Field(description="The position of the rule that triggered this effect within the ruleset.", alias="ruleIndex", json_schema_extra={"examples": [2]}) rule_name: StrictStr = Field(description="The name of the rule that triggered this effect.", alias="ruleName", json_schema_extra={"examples": ["Add 2 points"]}) type: StrictStr = Field(description="The type of this effect.", json_schema_extra={"examples": ["setDiscountPerItem"]}) - props: Dict[str, Any] = Field(description="Arbitrary properties associated with this effect type.") + props: StrikethroughEffectProps = Field(description="Arbitrary properties associated with this effect type.") start_time: Optional[datetime] = Field(default=None, description="The start of the time frame where the effect is active in UTC.", alias="startTime", json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) end_time: Optional[datetime] = Field(default=None, description="The end of the time frame where the effect is active in UTC.", alias="endTime", json_schema_extra={"examples": ["2021-10-01T02:00:00Z"]}) selected_price_type: Optional[StrictStr] = Field(default=None, description="The selected price type for this cart item (e.g. the price for members only).", alias="selectedPriceType", json_schema_extra={"examples": ["member"]}) selected_price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The value of the selected price type to apply to the SKU targeted by this effect, before any discounts are applied.", alias="selectedPrice", json_schema_extra={"examples": [100]}) adjustment_reference_id: Optional[StrictStr] = Field(default=None, description="The reference identifier of the selected price adjustment for this cart item.", alias="adjustmentReferenceId", json_schema_extra={"examples": ["68851723-e6fa-488f-ace9-112581e6c19b"]}) - targets: Optional[List[Dict[str, Any]]] = Field(default=None, description="A list of entities (e.g. audiences) targeted by this effect.") + targets: Optional[List[LabelTarget]] = Field(default=None, description="A list of entities (e.g. audiences) targeted by this effect.") __properties: ClassVar[List[str]] = ["campaignId", "rulesetId", "ruleIndex", "ruleName", "type", "props", "startTime", "endTime", "selectedPriceType", "selectedPrice", "adjustmentReferenceId", "targets"] model_config = ConfigDict( @@ -81,6 +83,16 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of props + if self.props: + _dict['props'] = self.props.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in targets (list) + _items = [] + if self.targets: + for _item_targets in self.targets: + if _item_targets: + _items.append(_item_targets.to_dict()) + _dict['targets'] = _items return _dict @classmethod @@ -98,13 +110,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "ruleIndex": obj.get("ruleIndex"), "ruleName": obj.get("ruleName"), "type": obj.get("type"), - "props": obj.get("props"), + "props": StrikethroughEffectProps.from_dict(obj["props"]) if obj.get("props") is not None else None, "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), "selectedPriceType": obj.get("selectedPriceType"), "selectedPrice": obj.get("selectedPrice"), "adjustmentReferenceId": obj.get("adjustmentReferenceId"), - "targets": obj.get("targets") + "targets": [LabelTarget.from_dict(_item) for _item in obj["targets"]] if obj.get("targets") is not None else None }) return _obj diff --git a/talon_one/models/strikethrough_effect_props.py b/talon_one/models/strikethrough_effect_props.py new file mode 100644 index 0000000..7021fc1 --- /dev/null +++ b/talon_one/models/strikethrough_effect_props.py @@ -0,0 +1,151 @@ +# 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from talon_one.models.strikethrough_custom_effect_per_item_props import StrikethroughCustomEffectPerItemProps +from talon_one.models.strikethrough_set_discount_per_item_effect_props import StrikethroughSetDiscountPerItemEffectProps +from talon_one.models.strikethrough_set_discount_per_item_member_effect_props import StrikethroughSetDiscountPerItemMemberEffectProps +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +STRIKETHROUGHEFFECTPROPS_ONE_OF_SCHEMAS = ["StrikethroughCustomEffectPerItemProps", "StrikethroughSetDiscountPerItemEffectProps", "StrikethroughSetDiscountPerItemMemberEffectProps"] + +class StrikethroughEffectProps(BaseModel): + """ + StrikethroughEffectProps + """ + # data type: StrikethroughSetDiscountPerItemEffectProps + oneof_schema_1_validator: Optional[StrikethroughSetDiscountPerItemEffectProps] = None + # data type: StrikethroughCustomEffectPerItemProps + oneof_schema_2_validator: Optional[StrikethroughCustomEffectPerItemProps] = None + # data type: StrikethroughSetDiscountPerItemMemberEffectProps + oneof_schema_3_validator: Optional[StrikethroughSetDiscountPerItemMemberEffectProps] = None + actual_instance: Optional[Union[StrikethroughCustomEffectPerItemProps, StrikethroughSetDiscountPerItemEffectProps, StrikethroughSetDiscountPerItemMemberEffectProps]] = None + one_of_schemas: Set[str] = { "StrikethroughCustomEffectPerItemProps", "StrikethroughSetDiscountPerItemEffectProps", "StrikethroughSetDiscountPerItemMemberEffectProps" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = StrikethroughEffectProps.model_construct() + error_messages = [] + match = 0 + # validate data type: StrikethroughSetDiscountPerItemEffectProps + if not isinstance(v, StrikethroughSetDiscountPerItemEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `StrikethroughSetDiscountPerItemEffectProps`") + else: + match += 1 + # validate data type: StrikethroughCustomEffectPerItemProps + if not isinstance(v, StrikethroughCustomEffectPerItemProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `StrikethroughCustomEffectPerItemProps`") + else: + match += 1 + # validate data type: StrikethroughSetDiscountPerItemMemberEffectProps + if not isinstance(v, StrikethroughSetDiscountPerItemMemberEffectProps): + error_messages.append(f"Error! Input type `{type(v)}` is not `StrikethroughSetDiscountPerItemMemberEffectProps`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in StrikethroughEffectProps with oneOf schemas: StrikethroughCustomEffectPerItemProps, StrikethroughSetDiscountPerItemEffectProps, StrikethroughSetDiscountPerItemMemberEffectProps. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in StrikethroughEffectProps with oneOf schemas: StrikethroughCustomEffectPerItemProps, StrikethroughSetDiscountPerItemEffectProps, StrikethroughSetDiscountPerItemMemberEffectProps. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into StrikethroughSetDiscountPerItemEffectProps + try: + instance.actual_instance = StrikethroughSetDiscountPerItemEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into StrikethroughCustomEffectPerItemProps + try: + instance.actual_instance = StrikethroughCustomEffectPerItemProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into StrikethroughSetDiscountPerItemMemberEffectProps + try: + instance.actual_instance = StrikethroughSetDiscountPerItemMemberEffectProps.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into StrikethroughEffectProps with oneOf schemas: StrikethroughCustomEffectPerItemProps, StrikethroughSetDiscountPerItemEffectProps, StrikethroughSetDiscountPerItemMemberEffectProps. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into StrikethroughEffectProps with oneOf schemas: StrikethroughCustomEffectPerItemProps, StrikethroughSetDiscountPerItemEffectProps, StrikethroughSetDiscountPerItemMemberEffectProps. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], StrikethroughCustomEffectPerItemProps, StrikethroughSetDiscountPerItemEffectProps, StrikethroughSetDiscountPerItemMemberEffectProps]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/talon_one/models/strikethrough_group_block.py b/talon_one/models/strikethrough_group_block.py index 66f36e8..ae783e6 100644 --- a/talon_one/models/strikethrough_group_block.py +++ b/talon_one/models/strikethrough_group_block.py @@ -31,9 +31,9 @@ class StrikethroughGroupBlock(BaseModel): type: StrictStr = Field(description="Identifies the block variant and determines which additional properties are present in it.") tags: Optional[List[StrictStr]] = Field(default=None, description="Semantic labels attached to this block.") operator: StrictStr = Field(description="Logical operator applied across child blocks. `all` requires every child to pass, `atLeastOne` requires at least one, `none` requires all to fail.") - blocks: List[Any] = Field(description="Child blocks evaluated according to the operator.") - on_failure: Optional[List[Any]] = Field(default=None, description="Strikethrough blocks evaluated when this block fails or returns false.", alias="onFailure") - on_error: Optional[Dict[str, List[Any]]] = Field(default=None, description="Named error handlers evaluated when a specific error occurs.", alias="onError") + blocks: List[StrikethroughBlock] = Field(description="Child blocks evaluated according to the operator.") + on_failure: Optional[List[StrikethroughBlock]] = Field(default=None, description="Strikethrough blocks evaluated when this block fails or returns false.", alias="onFailure") + on_error: Optional[Dict[str, List[StrikethroughBlock]]] = Field(default=None, description="Named error handlers evaluated when a specific error occurs.", alias="onError") __properties: ClassVar[List[str]] = ["id", "type", "tags", "operator", "blocks", "onFailure", "onError"] @field_validator('operator') @@ -82,6 +82,29 @@ 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 blocks (list) + _items = [] + if self.blocks: + for _item_blocks in self.blocks: + if _item_blocks: + _items.append(_item_blocks.to_dict()) + _dict['blocks'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in on_failure (list) + _items = [] + if self.on_failure: + for _item_on_failure in self.on_failure: + if _item_on_failure: + _items.append(_item_on_failure.to_dict()) + _dict['onFailure'] = _items + # override the default output from pydantic by calling `to_dict()` of each value in on_error (dict of array) + _field_dict_of_array = {} + if self.on_error: + for _key_on_error in self.on_error: + if self.on_error[_key_on_error] is not None: + _field_dict_of_array[_key_on_error] = [ + _item.to_dict() for _item in self.on_error[_key_on_error] + ] + _dict['onError'] = _field_dict_of_array return _dict @classmethod @@ -98,10 +121,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "type": obj.get("type"), "tags": obj.get("tags"), "operator": obj.get("operator"), - "blocks": obj.get("blocks"), - "onFailure": obj.get("onFailure"), - "onError": obj.get("onError") + "blocks": [StrikethroughBlock.from_dict(_item) for _item in obj["blocks"]] if obj.get("blocks") is not None else None, + "onFailure": [StrikethroughBlock.from_dict(_item) for _item in obj["onFailure"]] if obj.get("onFailure") is not None else None, + "onError": { + _k: [StrikethroughBlock.from_dict(_item) for _item in _v] if _v is not None else None + for _k, _v in obj["onError"].items() + } + if obj.get("onError") is not None + else None }) return _obj +from talon_one.models.strikethrough_block import StrikethroughBlock +# TODO: Rewrite to not use raise_errors +StrikethroughGroupBlock.model_rebuild(raise_errors=False) diff --git a/talon_one/models/strikethrough_rule_v2.py b/talon_one/models/strikethrough_rule_v2.py index 32941e6..493097c 100644 --- a/talon_one/models/strikethrough_rule_v2.py +++ b/talon_one/models/strikethrough_rule_v2.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.strikethrough_block import StrikethroughBlock from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -31,7 +32,7 @@ class StrikethroughRuleV2(BaseModel): parent_id: Optional[StrictStr] = Field(default=None, description="ID of the parent rule, if any.", alias="parentId") title: StrictStr = Field(description="A short description of the rule.", json_schema_extra={"examples": ["10% off for loyalty members"]}) description: Optional[StrictStr] = Field(default=None, description="A longer description of the rule.") - blocks: List[Any] = Field(description="The condition and effect blocks that make up this strikethrough rule.") + blocks: List[StrikethroughBlock] = Field(description="The condition and effect blocks that make up this strikethrough rule.") __properties: ClassVar[List[str]] = ["id", "parentId", "title", "description", "blocks"] model_config = ConfigDict( @@ -73,6 +74,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 blocks (list) + _items = [] + if self.blocks: + for _item_blocks in self.blocks: + if _item_blocks: + _items.append(_item_blocks.to_dict()) + _dict['blocks'] = _items return _dict @classmethod @@ -89,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "parentId": obj.get("parentId"), "title": obj.get("title"), "description": obj.get("description"), - "blocks": obj.get("blocks") + "blocks": [StrikethroughBlock.from_dict(_item) for _item in obj["blocks"]] if obj.get("blocks") is not None else None }) return _obj diff --git a/talon_one/models/support_request.py b/talon_one/models/support_request.py index 243d33c..e35e3d8 100644 --- a/talon_one/models/support_request.py +++ b/talon_one/models/support_request.py @@ -44,7 +44,8 @@ class SupportRequest(BaseModel): processed_at: Optional[datetime] = Field(default=None, description="Timestamp when the request was approved or rejected.", alias="processedAt", json_schema_extra={"examples": ["2025-07-20T22:10:00Z"]}) processing_note: Optional[StrictStr] = Field(default=None, description="Notes attached by the admin when rejecting or approving a request.", alias="processingNote", json_schema_extra={"examples": ["Rejected as the customer was awarded points already."]}) processed_by_user: Optional[StrictStr] = Field(default=None, description="Email address of the admin who approved or rejected the support request.", alias="processedByUser", json_schema_extra={"examples": ["admin.name@company.com"]}) - __properties: ClassVar[List[str]] = ["id", "applicationId", "campaignId", "loyaltyProgramId", "subledgerId", "createdByUser", "createdAt", "customerProfileId", "requestType", "requestValue", "requestNote", "requestStatus", "processedAt", "processingNote", "processedByUser"] + coupon_code: Optional[StrictStr] = Field(default=None, description="Coupon code associated with the approved support request.", alias="couponCode", json_schema_extra={"examples": ["SUMMER-2025-XYZ"]}) + __properties: ClassVar[List[str]] = ["id", "applicationId", "campaignId", "loyaltyProgramId", "subledgerId", "createdByUser", "createdAt", "customerProfileId", "requestType", "requestValue", "requestNote", "requestStatus", "processedAt", "processingNote", "processedByUser", "couponCode"] @field_validator('request_type') def request_type_validate_enum(cls, value): @@ -56,8 +57,8 @@ def request_type_validate_enum(cls, 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')") + if value not in set(['pending_approval', 'approved', 'rejected', 'expired']): + raise ValueError("must be one of enum values ('pending_approval', 'approved', 'rejected', 'expired')") return value model_config = ConfigDict( @@ -125,7 +126,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "requestStatus": obj.get("requestStatus"), "processedAt": obj.get("processedAt"), "processingNote": obj.get("processingNote"), - "processedByUser": obj.get("processedByUser") + "processedByUser": obj.get("processedByUser"), + "couponCode": obj.get("couponCode") }) return _obj diff --git a/talon_one/models/template_arg_def.py b/talon_one/models/template_arg_def.py index 645b6f1..5944afd 100644 --- a/talon_one/models/template_arg_def.py +++ b/talon_one/models/template_arg_def.py @@ -31,7 +31,7 @@ class TemplateArgDef(BaseModel): type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The type of value this argument expects.") description: Optional[StrictStr] = Field(default=None, description="A campaigner-friendly description of the argument, this will also be shown in the rule editor.") title: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A campaigner friendly name for the argument, this will be shown in the rule editor.") - ui: Dict[str, Any] = Field(description="Arbitrary properties associated with this campaign.") + ui: Dict[str, Any] = Field(description="Arbitrary metadata that may be used to render an input for this argument.") key: Optional[StrictStr] = Field(default=None, description="The identifier for the associated value within the JSON object.") picklist_id: Optional[StrictInt] = Field(default=None, description="ID of the picklist linked to a template.", alias="picklistID") restricted_by_picklist: Optional[StrictBool] = Field(default=None, description="Whether or not this attribute's value is restricted by picklist (`picklist` property)", alias="restrictedByPicklist") diff --git a/talon_one/models/transfer_loyalty_card.py b/talon_one/models/transfer_loyalty_card.py index b77a891..98f1c47 100644 --- a/talon_one/models/transfer_loyalty_card.py +++ b/talon_one/models/transfer_loyalty_card.py @@ -32,13 +32,10 @@ class TransferLoyaltyCard(BaseModel): block_reason: Optional[StrictStr] = Field(default=None, description="Reason for transferring and blocking the loyalty card. ", alias="blockReason", json_schema_extra={"examples": ["Current card lost. Customer needs a new card."]}) __properties: ClassVar[List[str]] = ["newCardIdentifier", "blockReason"] - @field_validator('new_card_identifier') + @field_validator('new_card_identifier', mode="before") def new_card_identifier_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z0-9._%+@-]+$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z0-9._%+@-]+$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z0-9._%+@-]+$/") return value diff --git a/talon_one/models/update_achievement.py b/talon_one/models/update_achievement.py index 944f7dc..f67ee32 100644 --- a/talon_one/models/update_achievement.py +++ b/talon_one/models/update_achievement.py @@ -43,16 +43,13 @@ class UpdateAchievement(BaseModel): allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="allowRollbackAfterCompletion", json_schema_extra={"examples": [False]}) __properties: ClassVar[List[str]] = ["name", "title", "description", "target", "period", "periodEndOverride", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion"] - @field_validator('name') + @field_validator('name', mode="before") 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) - - if not re.match(r"^[a-zA-Z]\w+$", value): + if isinstance(value, str) and not re.match(r"^[a-zA-Z]\w+$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z]\w+$/") return value diff --git a/talon_one/models/update_achievement_progress_block.py b/talon_one/models/update_achievement_progress_block.py new file mode 100644 index 0000000..0ad4c9f --- /dev/null +++ b/talon_one/models/update_achievement_progress_block.py @@ -0,0 +1,109 @@ +# 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 talon_one.models.update_achievement_progress_block1_achievement import UpdateAchievementProgressBlock1Achievement +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UpdateAchievementProgressBlock(BaseModel): + """ + UpdateAchievementProgressBlock + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier for this block.", json_schema_extra={"examples": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}) + type: StrictStr = Field(description="Identifies the block variant and determines which additional properties are present in it.") + tags: Optional[List[StrictStr]] = Field(default=None, description="Semantic labels attached to this block.") + operator: StrictStr = Field(json_schema_extra={"examples": ["increaseBy"]}) + value: StrictStr = Field(description="The value to update the progress by. Supports template placeholders (e.g. \"{{$Session.Total / 2}}\") for dynamic quantities.", json_schema_extra={"examples": ["10"]}) + achievement: UpdateAchievementProgressBlock1Achievement + __properties: ClassVar[List[str]] = ["id", "type", "tags", "operator", "value", "achievement"] + + @field_validator('operator') + def operator_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['increaseBy']): + raise ValueError("must be one of enum values ('increaseBy')") + 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 UpdateAchievementProgressBlock from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of achievement + if self.achievement: + _dict['achievement'] = self.achievement.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateAchievementProgressBlock from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "tags": obj.get("tags"), + "operator": obj.get("operator"), + "value": obj.get("value"), + "achievement": UpdateAchievementProgressBlock1Achievement.from_dict(obj["achievement"]) if obj.get("achievement") is not None else None + }) + return _obj + + diff --git a/talon_one/models/update_achievement_progress_block1_achievement.py b/talon_one/models/update_achievement_progress_block1_achievement.py new file mode 100644 index 0000000..5077b69 --- /dev/null +++ b/talon_one/models/update_achievement_progress_block1_achievement.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UpdateAchievementProgressBlock1Achievement(BaseModel): + """ + The achievement to update. + """ # noqa: E501 + id: StrictInt = Field(description="The ID of the achievement.", json_schema_extra={"examples": [42]}) + name: StrictStr = Field(description="The internal name of the achievement used in API requests.", json_schema_extra={"examples": ["Order50Discount"]}) + title: StrictStr = Field(description="The display name of the achievement in the Campaign Manager.", json_schema_extra={"examples": ["50% off on 50th purchase."]}) + target: Union[StrictFloat, StrictInt] = Field(description="The required number of actions or the transactional milestone to complete the achievement.", json_schema_extra={"examples": [50]}) + __properties: ClassVar[List[str]] = ["id", "name", "title", "target"] + + 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 UpdateAchievementProgressBlock1Achievement 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 UpdateAchievementProgressBlock1Achievement from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "title": obj.get("title"), + "target": obj.get("target") + }) + return _obj + + diff --git a/talon_one/models/update_achievement_v2.py b/talon_one/models/update_achievement_v2.py index 33d6352..42c4b78 100644 --- a/talon_one/models/update_achievement_v2.py +++ b/talon_one/models/update_achievement_v2.py @@ -42,13 +42,10 @@ class UpdateAchievementV2(BaseModel): 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", json_schema_extra={"examples": [[132, 97]]}) __properties: ClassVar[List[str]] = ["name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "subscribedApplications"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[a-zA-Z]\w+$", value): + if isinstance(value, str) and not re.match(r"^[a-zA-Z]\w+$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z]\w+$/") return value diff --git a/talon_one/models/update_attribute_value_block.py b/talon_one/models/update_attribute_value_block.py new file mode 100644 index 0000000..d775f0c --- /dev/null +++ b/talon_one/models/update_attribute_value_block.py @@ -0,0 +1,120 @@ +# 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 talon_one.models.update_attribute_value_block1_attribute import UpdateAttributeValueBlock1Attribute +from talon_one.models.update_attribute_value_block1_target import UpdateAttributeValueBlock1Target +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UpdateAttributeValueBlock(BaseModel): + """ + UpdateAttributeValueBlock + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier for this block.", json_schema_extra={"examples": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}) + type: StrictStr = Field(description="Identifies the block variant and determines which additional properties are present in it.") + tags: Optional[List[StrictStr]] = Field(default=None, description="Semantic labels attached to this block.") + operator: StrictStr = Field(description="The update operation applied to the attribute.", json_schema_extra={"examples": ["setTo"]}) + attribute: UpdateAttributeValueBlock1Attribute + value: Optional[Any] = None + target: UpdateAttributeValueBlock1Target + __properties: ClassVar[List[str]] = ["id", "type", "tags", "operator", "attribute", "value", "target"] + + @field_validator('operator') + def operator_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['setTo', 'increaseBy', 'decreaseBy', 'multiplyBy', 'divideBy', 'toggle', 'laterBy', 'earlierBy']): + raise ValueError("must be one of enum values ('setTo', 'increaseBy', 'decreaseBy', 'multiplyBy', 'divideBy', 'toggle', 'laterBy', 'earlierBy')") + 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 UpdateAttributeValueBlock from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of attribute + if self.attribute: + _dict['attribute'] = self.attribute.to_dict() + # override the default output from pydantic by calling `to_dict()` of target + if self.target: + _dict['target'] = self.target.to_dict() + # set to None if value (nullable) is None + # and model_fields_set contains the field + if self.value is None and "value" in self.model_fields_set: + _dict['value'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateAttributeValueBlock from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "tags": obj.get("tags"), + "operator": obj.get("operator"), + "attribute": UpdateAttributeValueBlock1Attribute.from_dict(obj["attribute"]) if obj.get("attribute") is not None else None, + "value": obj.get("value"), + "target": UpdateAttributeValueBlock1Target.from_dict(obj["target"]) if obj.get("target") is not None else None + }) + return _obj + + diff --git a/talon_one/models/update_attribute_value_block1_attribute.py b/talon_one/models/update_attribute_value_block1_attribute.py new file mode 100644 index 0000000..225e848 --- /dev/null +++ b/talon_one/models/update_attribute_value_block1_attribute.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +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 UpdateAttributeValueBlock1Attribute(BaseModel): + """ + The attribute being updated. + """ # noqa: E501 + id: StrictInt = Field(description="The internal ID of the attribute. Reverts to `0` when the attribute is deleted or does not exist.", json_schema_extra={"examples": [100]}) + entity: StrictStr = Field(description="The entity type that owns the attribute. Reverts to an empty string when the attribute is deleted or does not exist.", json_schema_extra={"examples": ["profile"]}) + name: StrictStr = Field(description="The attribute name as used in API requests.", json_schema_extra={"examples": ["City"]}) + title: StrictStr = Field(description="The human-readable name of the attribute.", json_schema_extra={"examples": ["City"]}) + type: StrictStr = Field(description="The data type of the attribute.", json_schema_extra={"examples": ["string"]}) + __properties: ClassVar[List[str]] = ["id", "entity", "name", "title", "type"] + + 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 UpdateAttributeValueBlock1Attribute 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 UpdateAttributeValueBlock1Attribute 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"), + "entity": obj.get("entity"), + "name": obj.get("name"), + "title": obj.get("title"), + "type": obj.get("type") + }) + return _obj + + diff --git a/talon_one/models/unary_check_attribute_block.py b/talon_one/models/update_attribute_value_block1_target.py similarity index 74% rename from talon_one/models/unary_check_attribute_block.py rename to talon_one/models/update_attribute_value_block1_target.py index 5ad5af2..efaa212 100644 --- a/talon_one/models/unary_check_attribute_block.py +++ b/talon_one/models/update_attribute_value_block1_target.py @@ -18,26 +18,23 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +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 UnaryCheckAttributeBlock(BaseModel): +class UpdateAttributeValueBlock1Target(BaseModel): """ - Variant of `CheckAttributeBlock` for operators that test a property of the attribute itself with no comparison value. + The entity or item scope that this effect operates on. """ # noqa: E501 - operator: Optional[StrictStr] = Field(default=None, description="The unary operator applied to the attribute. These operators require no comparison value.") - __properties: ClassVar[List[str]] = ["operator"] + type: StrictStr = Field(description="Identifies the target scope of the attribute update.", json_schema_extra={"examples": ["profile"]}) + __properties: ClassVar[List[str]] = ["type"] - @field_validator('operator') - def operator_validate_enum(cls, value): + @field_validator('type') + def type_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - - if value not in set(['empty', 'not(empty)', 'exists', 'not(exists)', 'isTrue', 'isFalse']): - raise ValueError("must be one of enum values ('empty', 'not(empty)', 'exists', 'not(exists)', 'isTrue', 'isFalse')") + if value not in set(['session', 'profile', 'advocateProfile', 'coupon', 'referral', 'allItems', 'selector', 'globalFilter']): + raise ValueError("must be one of enum values ('session', 'profile', 'advocateProfile', 'coupon', 'referral', 'allItems', 'selector', 'globalFilter')") return value model_config = ConfigDict( @@ -58,7 +55,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UnaryCheckAttributeBlock from a JSON string""" + """Create an instance of UpdateAttributeValueBlock1Target from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -83,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UnaryCheckAttributeBlock from a dict""" + """Create an instance of UpdateAttributeValueBlock1Target from a dict""" if obj is None: return None @@ -91,7 +88,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "operator": obj.get("operator") + "type": obj.get("type") }) return _obj diff --git a/talon_one/models/update_audience_membership_block.py b/talon_one/models/update_audience_membership_block.py new file mode 100644 index 0000000..dbe3624 --- /dev/null +++ b/talon_one/models/update_audience_membership_block.py @@ -0,0 +1,116 @@ +# 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 talon_one.models.update_audience_membership_block1_audience import UpdateAudienceMembershipBlock1Audience +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UpdateAudienceMembershipBlock(BaseModel): + """ + UpdateAudienceMembershipBlock + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier for this block.", json_schema_extra={"examples": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}) + type: StrictStr = Field(description="Identifies the block variant and determines which additional properties are present in it.") + tags: Optional[List[StrictStr]] = Field(default=None, description="Semantic labels attached to this block.") + operator: StrictStr = Field(description="The action to perform.", json_schema_extra={"examples": ["add"]}) + profile: StrictStr = Field(description="The customer profile to add or remove from the audience. `Current` targets the customer in the current session; `Advocate` targets the person who invited their friend via referral program.", json_schema_extra={"examples": ["Current"]}) + audience: UpdateAudienceMembershipBlock1Audience + __properties: ClassVar[List[str]] = ["id", "type", "tags", "operator", "profile", "audience"] + + @field_validator('operator') + def operator_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['add', 'remove']): + raise ValueError("must be one of enum values ('add', 'remove')") + return value + + @field_validator('profile') + def profile_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['Current', 'Advocate']): + raise ValueError("must be one of enum values ('Current', 'Advocate')") + 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 UpdateAudienceMembershipBlock from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of audience + if self.audience: + _dict['audience'] = self.audience.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateAudienceMembershipBlock from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "tags": obj.get("tags"), + "operator": obj.get("operator"), + "profile": obj.get("profile"), + "audience": UpdateAudienceMembershipBlock1Audience.from_dict(obj["audience"]) if obj.get("audience") is not None else None + }) + return _obj + + diff --git a/talon_one/models/scalar_check_attribute_block.py b/talon_one/models/update_audience_membership_block1_audience.py similarity index 63% rename from talon_one/models/scalar_check_attribute_block.py rename to talon_one/models/update_audience_membership_block1_audience.py index 92815af..3426b07 100644 --- a/talon_one/models/scalar_check_attribute_block.py +++ b/talon_one/models/update_audience_membership_block1_audience.py @@ -17,29 +17,21 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python -class ScalarCheckAttributeBlock(BaseModel): +class UpdateAudienceMembershipBlock1Audience(BaseModel): """ - Variant of `CheckAttributeBlock` for operators that compare an attribute against a single value. + The audience to add the customer to or remove them from. """ # noqa: E501 - operator: Optional[StrictStr] = Field(default=None, description="The comparison operator applied to the attribute.") - value: Optional[Any] - __properties: ClassVar[List[str]] = ["operator", "value"] - - @field_validator('operator') - def operator_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['equals', 'not(equals)', 'lessThan', 'lessThanOrEqual', 'greaterThan', 'greaterThanOrEqual', 'contains', 'not(contains)', 'matchesRegexp', 'startsWith', 'endsWith', 'oneOf', 'not(oneOf)', 'inCollection', 'not(inCollection)']): - raise ValueError("must be one of enum values ('equals', 'not(equals)', 'lessThan', 'lessThanOrEqual', 'greaterThan', 'greaterThanOrEqual', 'contains', 'not(contains)', 'matchesRegexp', 'startsWith', 'endsWith', 'oneOf', 'not(oneOf)', 'inCollection', 'not(inCollection)')") - return value + id: StrictInt = Field(description="The ID of the audience.", json_schema_extra={"examples": [42]}) + name: StrictStr = Field(description="The display name of the audience.", json_schema_extra={"examples": ["Travel audience"]}) + integration: Optional[StrictStr] = Field(default=None, description="The Talon.One-supported [3rd-party platform](https://docs.talon.one/docs/dev/technology-partners/overview) that this audience was created in. For example, `mParticle`, `Segment`, `Shopify`, `Braze`, or `Iterable`. **Note:** If you do not integrate with any of these platforms, do not use this property. ", json_schema_extra={"examples": ["mparticle"]}) + integration_id: Optional[StrictStr] = Field(default=None, description="The ID of this audience in the third-party integration. **Note:** To create an audience that doesn't come from a 3rd party platform, do not use this property. ", alias="integrationId", json_schema_extra={"examples": ["382370BKDB946"]}) + __properties: ClassVar[List[str]] = ["id", "name", "integration", "integrationId"] model_config = ConfigDict( validate_by_name=True, @@ -59,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ScalarCheckAttributeBlock from a JSON string""" + """Create an instance of UpdateAudienceMembershipBlock1Audience from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -80,16 +72,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # set to None if value (nullable) is None - # and model_fields_set contains the field - if self.value is None and "value" in self.model_fields_set: - _dict['value'] = None - return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ScalarCheckAttributeBlock from a dict""" + """Create an instance of UpdateAudienceMembershipBlock1Audience from a dict""" if obj is None: return None @@ -97,8 +84,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "operator": obj.get("operator"), - "value": obj.get("value") + "id": obj.get("id"), + "name": obj.get("name"), + "integration": obj.get("integration"), + "integrationId": obj.get("integrationId") }) return _obj diff --git a/talon_one/models/update_coupon.py b/talon_one/models/update_coupon.py index cbda6a6..85d6e22 100644 --- a/talon_one/models/update_coupon.py +++ b/talon_one/models/update_coupon.py @@ -37,7 +37,7 @@ class UpdateCoupon(BaseModel): expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the coupon. Coupon never expires if this is omitted.", alias="expiryDate", json_schema_extra={"examples": ["2023-08-24T14:15:22Z"]}) limits: Optional[List[LimitConfig]] = Field(default=None, description="Limits configuration for a coupon. These limits will override the limits set from the campaign. **Note:** Only usable when creating a single coupon which is not tied to a specific recipient. Only per-profile limits are allowed to be configured. ") recipient_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The integration ID for this coupon's beneficiary's profile.", alias="recipientIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.") is_reservation_mandatory: Optional[StrictBool] = Field(default=False, description="An indication of whether the code can be redeemed only if it has been reserved first.", alias="isReservationMandatory", json_schema_extra={"examples": [False]}) implicitly_reserved: Optional[StrictBool] = Field(default=None, description="An indication of whether the coupon is implicitly reserved for all customers.", alias="implicitlyReserved", json_schema_extra={"examples": [False]}) __properties: ClassVar[List[str]] = ["usageLimit", "discountLimit", "reservationLimit", "startDate", "expiryDate", "limits", "recipientIntegrationId", "attributes", "isReservationMandatory", "implicitlyReserved"] diff --git a/talon_one/models/update_coupon_batch.py b/talon_one/models/update_coupon_batch.py index 639aedf..96618bd 100644 --- a/talon_one/models/update_coupon_batch.py +++ b/talon_one/models/update_coupon_batch.py @@ -34,7 +34,7 @@ class UpdateCouponBatch(BaseModel): reservation_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of reservations that can be made with this coupon code. ", alias="reservationLimit", json_schema_extra={"examples": [45]}) start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon becomes valid.", alias="startDate", json_schema_extra={"examples": ["2020-01-24T14:15:22Z"]}) expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the coupon. Coupon never expires if this is omitted.", alias="expiryDate", json_schema_extra={"examples": ["2023-08-24T14:15:22Z"]}) - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Optional property to set the value of custom coupon attributes. They are defined in the Campaign Manager, see [Managing attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes). Coupon attributes can also be set to _mandatory_ in your Application [settings](https://docs.talon.one/docs/product/applications/using-attributes#making-attributes-mandatory). If your Application uses mandatory attributes, you must use this property to set their value. ") batch_id: Optional[StrictStr] = Field(default=None, description="The ID of the batch the coupon(s) belong to.", alias="batchID") __properties: ClassVar[List[str]] = ["usageLimit", "discountLimit", "reservationLimit", "startDate", "expiryDate", "attributes", "batchID"] diff --git a/talon_one/models/update_custom_effect.py b/talon_one/models/update_custom_effect.py index 97377cc..8c657ed 100644 --- a/talon_one/models/update_custom_effect.py +++ b/talon_one/models/update_custom_effect.py @@ -39,23 +39,17 @@ class UpdateCustomEffect(BaseModel): params: Optional[List[TemplateArgDef]] = Field(default=None, description="Array of template argument definitions.") __properties: ClassVar[List[str]] = ["applicationIds", "isPerItem", "name", "title", "payload", "description", "enabled", "params"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z](\w|\s)*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z](\w|\s)*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z](\w|\s)*$/") return value - @field_validator('title') + @field_validator('title', mode="before") def title_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): + if isinstance(value, str) and not re.match(r"^[^[:cntrl:]\s][^[:cntrl:]]*$", value): raise ValueError(r"must validate the regular expression /^[^[:cntrl:]\s][^[:cntrl:]]*$/") return value diff --git a/talon_one/models/update_customer_profile_v2409_response.py b/talon_one/models/update_customer_profile_v2409_response.py new file mode 100644 index 0000000..8de6f67 --- /dev/null +++ b/talon_one/models/update_customer_profile_v2409_response.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UpdateCustomerProfileV2409Response(BaseModel): + """ + UpdateCustomerProfileV2409Response + """ # noqa: E501 + message: Optional[StrictStr] = Field(default=None, json_schema_extra={"examples": ["Too many requests are updating this profile at the same time"]}) + errors: Optional[List[Any]] = None + status_code: Optional[StrictInt] = Field(default=None, alias="StatusCode", json_schema_extra={"examples": [409]}) + __properties: ClassVar[List[str]] = ["message", "errors", "StatusCode"] + + 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 UpdateCustomerProfileV2409Response 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 UpdateCustomerProfileV2409Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "message": obj.get("message"), + "errors": obj.get("errors"), + "StatusCode": obj.get("StatusCode") + }) + return _obj + + diff --git a/talon_one/models/update_support_request.py b/talon_one/models/update_support_request.py index 6042948..b6c71ac 100644 --- a/talon_one/models/update_support_request.py +++ b/talon_one/models/update_support_request.py @@ -34,8 +34,8 @@ class UpdateSupportRequest(BaseModel): @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')") + if value not in set(['approved', 'rejected', 'expired']): + raise ValueError("must be one of enum values ('approved', 'rejected', 'expired')") return value model_config = ConfigDict( diff --git a/talon_one/models/user.py b/talon_one/models/user.py index d58df53..8f7f06c 100644 --- a/talon_one/models/user.py +++ b/talon_one/models/user.py @@ -40,11 +40,11 @@ class User(BaseModel): policy: Dict[str, Any] = Field(description="Access level of the user.", json_schema_extra={"examples": ["{Role=127}"]}) roles: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the roles assigned to the user.", json_schema_extra={"examples": [[71]]}) auth_method: Optional[StrictStr] = Field(default=None, description="Authentication method for this user.", alias="authMethod", json_schema_extra={"examples": ["basic_auth"]}) - application_notification_subscriptions: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.", alias="applicationNotificationSubscriptions") + application_notification_subscriptions: Optional[Dict[str, Any]] = Field(default=None, description="Application notifications that the user is subscribed to.", alias="applicationNotificationSubscriptions", json_schema_extra={"examples": ["{}"]}) last_signed_in: Optional[datetime] = Field(default=None, description="Timestamp when the user last signed in to Talon.One.", alias="lastSignedIn", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) last_accessed: Optional[datetime] = Field(default=None, description="Timestamp of the user's last activity after signing in to Talon.One.", alias="lastAccessed", json_schema_extra={"examples": ["2021-09-12T10:14:42Z"]}) latest_feed_timestamp: Optional[datetime] = Field(default=None, description="Timestamp when the user was notified for feed.", alias="latestFeedTimestamp", json_schema_extra={"examples": ["2020-06-01T00:00:00Z"]}) - additional_attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.", alias="additionalAttributes") + additional_attributes: Optional[Dict[str, Any]] = Field(default=None, description="Additional user attributes, created and used by external identity providers.", alias="additionalAttributes", json_schema_extra={"examples": ["{}"]}) __properties: ClassVar[List[str]] = ["id", "created", "modified", "email", "accountId", "name", "state", "inviteToken", "isAdmin", "policy", "roles", "authMethod", "applicationNotificationSubscriptions", "lastSignedIn", "lastAccessed", "latestFeedTimestamp", "additionalAttributes"] @field_validator('state') diff --git a/talon_one/models/webhook.py b/talon_one/models/webhook.py index 5944df7..860ff18 100644 --- a/talon_one/models/webhook.py +++ b/talon_one/models/webhook.py @@ -46,13 +46,10 @@ class Webhook(BaseModel): authentication_id: Optional[StrictInt] = Field(default=None, description="The ID of the credential that this webhook is using.", alias="authenticationId", json_schema_extra={"examples": [1]}) __properties: ClassVar[List[str]] = ["id", "created", "modified", "applicationIds", "title", "description", "draft", "verb", "url", "headers", "payload", "params", "enabled", "authenticationId"] - @field_validator('title') + @field_validator('title', mode="before") def title_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z][A-Za-z0-9_.!~*\'() -]*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z][A-Za-z0-9_.!~*\'() -]*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z][A-Za-z0-9_.!~*'() -]*$/") return value diff --git a/talon_one/models/webhook_authentication.py b/talon_one/models/webhook_authentication.py index 7ad237a..024dce5 100644 --- a/talon_one/models/webhook_authentication.py +++ b/talon_one/models/webhook_authentication.py @@ -19,7 +19,8 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +from typing import Any, ClassVar, Dict, List +from talon_one.models.webhook_authentication_all_of_data import WebhookAuthenticationAllOfData from talon_one.models.webhook_authentication_webhook_ref import WebhookAuthenticationWebhookRef from typing import Optional, Set from typing_extensions import Self @@ -37,7 +38,7 @@ class WebhookAuthentication(BaseModel): webhooks: List[WebhookAuthenticationWebhookRef] name: StrictStr = Field(description="The name of the webhook authentication.", json_schema_extra={"examples": ["My basic auth"]}) type: StrictStr - data: Optional[Any] + data: WebhookAuthenticationAllOfData __properties: ClassVar[List[str]] = ["id", "created", "modified", "createdBy", "modifiedBy", "webhooks", "name", "type", "data"] @field_validator('type') @@ -93,11 +94,9 @@ def to_dict(self) -> Dict[str, Any]: if _item_webhooks: _items.append(_item_webhooks.to_dict()) _dict['webhooks'] = _items - # set to None if data (nullable) is None - # and model_fields_set contains the field - if self.data is None and "data" in self.model_fields_set: - _dict['data'] = None - + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() return _dict @classmethod @@ -118,7 +117,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "webhooks": [WebhookAuthenticationWebhookRef.from_dict(_item) for _item in obj["webhooks"]] if obj.get("webhooks") is not None else None, "name": obj.get("name"), "type": obj.get("type"), - "data": obj.get("data") + "data": WebhookAuthenticationAllOfData.from_dict(obj["data"]) if obj.get("data") is not None else None }) return _obj diff --git a/talon_one/models/webhook_authentication_all_of_data.py b/talon_one/models/webhook_authentication_all_of_data.py new file mode 100644 index 0000000..97ecc20 --- /dev/null +++ b/talon_one/models/webhook_authentication_all_of_data.py @@ -0,0 +1,137 @@ +# 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from talon_one.models.webhook_authentication_data_basic import WebhookAuthenticationDataBasic +from talon_one.models.webhook_authentication_data_custom import WebhookAuthenticationDataCustom +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +WEBHOOKAUTHENTICATIONALLOFDATA_ONE_OF_SCHEMAS = ["WebhookAuthenticationDataBasic", "WebhookAuthenticationDataCustom"] + +class WebhookAuthenticationAllOfData(BaseModel): + """ + WebhookAuthenticationAllOfData + """ + # data type: WebhookAuthenticationDataBasic + oneof_schema_1_validator: Optional[WebhookAuthenticationDataBasic] = None + # data type: WebhookAuthenticationDataCustom + oneof_schema_2_validator: Optional[WebhookAuthenticationDataCustom] = None + actual_instance: Optional[Union[WebhookAuthenticationDataBasic, WebhookAuthenticationDataCustom]] = None + one_of_schemas: Set[str] = { "WebhookAuthenticationDataBasic", "WebhookAuthenticationDataCustom" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = WebhookAuthenticationAllOfData.model_construct() + error_messages = [] + match = 0 + # validate data type: WebhookAuthenticationDataBasic + if not isinstance(v, WebhookAuthenticationDataBasic): + error_messages.append(f"Error! Input type `{type(v)}` is not `WebhookAuthenticationDataBasic`") + else: + match += 1 + # validate data type: WebhookAuthenticationDataCustom + if not isinstance(v, WebhookAuthenticationDataCustom): + error_messages.append(f"Error! Input type `{type(v)}` is not `WebhookAuthenticationDataCustom`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in WebhookAuthenticationAllOfData with oneOf schemas: WebhookAuthenticationDataBasic, WebhookAuthenticationDataCustom. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in WebhookAuthenticationAllOfData with oneOf schemas: WebhookAuthenticationDataBasic, WebhookAuthenticationDataCustom. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into WebhookAuthenticationDataBasic + try: + instance.actual_instance = WebhookAuthenticationDataBasic.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into WebhookAuthenticationDataCustom + try: + instance.actual_instance = WebhookAuthenticationDataCustom.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into WebhookAuthenticationAllOfData with oneOf schemas: WebhookAuthenticationDataBasic, WebhookAuthenticationDataCustom. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into WebhookAuthenticationAllOfData with oneOf schemas: WebhookAuthenticationDataBasic, WebhookAuthenticationDataCustom. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], WebhookAuthenticationDataBasic, WebhookAuthenticationDataCustom]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/talon_one/models/webhook_authentication_base.py b/talon_one/models/webhook_authentication_base.py new file mode 100644 index 0000000..18825ba --- /dev/null +++ b/talon_one/models/webhook_authentication_base.py @@ -0,0 +1,137 @@ +# 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from talon_one.models.webhook_authentication_base_one_of import WebhookAuthenticationBaseOneOf +from talon_one.models.webhook_authentication_base_one_of1 import WebhookAuthenticationBaseOneOf1 +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +WEBHOOKAUTHENTICATIONBASE_ONE_OF_SCHEMAS = ["WebhookAuthenticationBaseOneOf", "WebhookAuthenticationBaseOneOf1"] + +class WebhookAuthenticationBase(BaseModel): + """ + WebhookAuthenticationBase + """ + # data type: WebhookAuthenticationBaseOneOf + oneof_schema_1_validator: Optional[WebhookAuthenticationBaseOneOf] = None + # data type: WebhookAuthenticationBaseOneOf1 + oneof_schema_2_validator: Optional[WebhookAuthenticationBaseOneOf1] = None + actual_instance: Optional[Union[WebhookAuthenticationBaseOneOf, WebhookAuthenticationBaseOneOf1]] = None + one_of_schemas: Set[str] = { "WebhookAuthenticationBaseOneOf", "WebhookAuthenticationBaseOneOf1" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = WebhookAuthenticationBase.model_construct() + error_messages = [] + match = 0 + # validate data type: WebhookAuthenticationBaseOneOf + if not isinstance(v, WebhookAuthenticationBaseOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `WebhookAuthenticationBaseOneOf`") + else: + match += 1 + # validate data type: WebhookAuthenticationBaseOneOf1 + if not isinstance(v, WebhookAuthenticationBaseOneOf1): + error_messages.append(f"Error! Input type `{type(v)}` is not `WebhookAuthenticationBaseOneOf1`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in WebhookAuthenticationBase with oneOf schemas: WebhookAuthenticationBaseOneOf, WebhookAuthenticationBaseOneOf1. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in WebhookAuthenticationBase with oneOf schemas: WebhookAuthenticationBaseOneOf, WebhookAuthenticationBaseOneOf1. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into WebhookAuthenticationBaseOneOf + try: + instance.actual_instance = WebhookAuthenticationBaseOneOf.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into WebhookAuthenticationBaseOneOf1 + try: + instance.actual_instance = WebhookAuthenticationBaseOneOf1.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into WebhookAuthenticationBase with oneOf schemas: WebhookAuthenticationBaseOneOf, WebhookAuthenticationBaseOneOf1. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into WebhookAuthenticationBase with oneOf schemas: WebhookAuthenticationBaseOneOf, WebhookAuthenticationBaseOneOf1. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], WebhookAuthenticationBaseOneOf, WebhookAuthenticationBaseOneOf1]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/talon_one/models/list_check_attribute_block.py b/talon_one/models/webhook_authentication_base_one_of.py similarity index 70% rename from talon_one/models/list_check_attribute_block.py rename to talon_one/models/webhook_authentication_base_one_of.py index 817d9d7..9cc9218 100644 --- a/talon_one/models/list_check_attribute_block.py +++ b/talon_one/models/webhook_authentication_base_one_of.py @@ -17,29 +17,21 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.webhook_authentication_data_basic import WebhookAuthenticationDataBasic from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python -class ListCheckAttributeBlock(BaseModel): +class WebhookAuthenticationBaseOneOf(BaseModel): """ - Variant of `CheckAttributeBlock` for operators that test list membership against a set of values. + WebhookAuthenticationBaseOneOf """ # noqa: E501 - operator: Optional[StrictStr] = Field(default=None, description="The list membership operator applied to the attribute.") - values: Optional[Any] - __properties: ClassVar[List[str]] = ["operator", "values"] - - @field_validator('operator') - def operator_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['containsOneOf', 'containsNoneOf', 'containsAllOf']): - raise ValueError("must be one of enum values ('containsOneOf', 'containsNoneOf', 'containsAllOf')") - return value + name: Optional[StrictStr] = Field(default=None, description="The name of the webhook authentication.", json_schema_extra={"examples": ["My basic auth"]}) + type: Optional[Any] = None + data: Optional[WebhookAuthenticationDataBasic] = None + __properties: ClassVar[List[str]] = ["name", "type", "data"] model_config = ConfigDict( validate_by_name=True, @@ -59,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ListCheckAttributeBlock from a JSON string""" + """Create an instance of WebhookAuthenticationBaseOneOf from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -80,16 +72,19 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # set to None if values (nullable) is None + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + # set to None if type (nullable) is None # and model_fields_set contains the field - if self.values is None and "values" in self.model_fields_set: - _dict['values'] = None + if self.type is None and "type" in self.model_fields_set: + _dict['type'] = None return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListCheckAttributeBlock from a dict""" + """Create an instance of WebhookAuthenticationBaseOneOf from a dict""" if obj is None: return None @@ -97,8 +92,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "operator": obj.get("operator"), - "values": obj.get("values") + "name": obj.get("name"), + "type": obj.get("type"), + "data": WebhookAuthenticationDataBasic.from_dict(obj["data"]) if obj.get("data") is not None else None }) return _obj diff --git a/talon_one/models/webhook_authentication_base_one_of1.py b/talon_one/models/webhook_authentication_base_one_of1.py new file mode 100644 index 0000000..17aa432 --- /dev/null +++ b/talon_one/models/webhook_authentication_base_one_of1.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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.webhook_authentication_data_custom import WebhookAuthenticationDataCustom +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebhookAuthenticationBaseOneOf1(BaseModel): + """ + WebhookAuthenticationBaseOneOf1 + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of the webhook authentication.", json_schema_extra={"examples": ["My basic auth"]}) + type: Optional[Any] = None + data: Optional[WebhookAuthenticationDataCustom] = None + __properties: ClassVar[List[str]] = ["name", "type", "data"] + + 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 WebhookAuthenticationBaseOneOf1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + # set to None if type (nullable) is None + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: + _dict['type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebhookAuthenticationBaseOneOf1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "type": obj.get("type"), + "data": WebhookAuthenticationDataCustom.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/talon_one/models/webhook_authentication_webhook_ref.py b/talon_one/models/webhook_authentication_webhook_ref.py index 3ac0ad9..bd42361 100644 --- a/talon_one/models/webhook_authentication_webhook_ref.py +++ b/talon_one/models/webhook_authentication_webhook_ref.py @@ -33,13 +33,10 @@ class WebhookAuthenticationWebhookRef(BaseModel): description: Optional[StrictStr] = Field(default=None, description="A description of the webhook authentication.", json_schema_extra={"examples": ["A webhook to send a coupon to the user."]}) __properties: ClassVar[List[str]] = ["id", "title", "description"] - @field_validator('title') + @field_validator('title', mode="before") def title_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z][A-Za-z0-9_.!~*\'() -]*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z][A-Za-z0-9_.!~*\'() -]*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z][A-Za-z0-9_.!~*'() -]*$/") return value diff --git a/talon_one/models/webhook_with_outgoing_integration_details.py b/talon_one/models/webhook_with_outgoing_integration_details.py index 37881e2..ea37d41 100644 --- a/talon_one/models/webhook_with_outgoing_integration_details.py +++ b/talon_one/models/webhook_with_outgoing_integration_details.py @@ -49,13 +49,10 @@ class WebhookWithOutgoingIntegrationDetails(BaseModel): outgoing_integration_type_name: Optional[StrictStr] = Field(default=None, description="Name of the outgoing integration.", alias="outgoingIntegrationTypeName", json_schema_extra={"examples": ["Braze"]}) __properties: ClassVar[List[str]] = ["id", "created", "modified", "applicationIds", "title", "description", "draft", "verb", "url", "headers", "payload", "params", "enabled", "authenticationId", "outgoingIntegrationTemplateId", "outgoingIntegrationTypeId", "outgoingIntegrationTypeName"] - @field_validator('title') + @field_validator('title', mode="before") def title_validate_regular_expression(cls, value): """Validates the regular expression""" - if not isinstance(value, str): - value = str(value) - - if not re.match(r"^[A-Za-z][A-Za-z0-9_.!~*\'() -]*$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z][A-Za-z0-9_.!~*\'() -]*$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z][A-Za-z0-9_.!~*'() -]*$/") return value diff --git a/talon_one/rest.py b/talon_one/rest.py index d5441fa..051b064 100644 --- a/talon_one/rest.py +++ b/talon_one/rest.py @@ -12,10 +12,12 @@ """ # noqa: E501 +import ipaddress import io import json import re import ssl +from urllib.parse import urlparse import urllib3 @@ -35,6 +37,44 @@ def is_socks_proxy_url(url): return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES +def should_bypass_proxies(url: str, no_proxy: str) -> bool: + """Return whether ``url`` matches the comma-separated ``no_proxy`` rules.""" + parsed_url = urlparse(url) + if not parsed_url.hostname: + return True + + host = parsed_url.hostname.lower() + host_and_port = parsed_url.netloc.lower() + try: + host_ip = ipaddress.ip_address(host) + except ValueError: + host_ip = None + + for entry in (entry.strip().lower() for entry in no_proxy.split(',')): + if not entry: + continue + if entry == '*': + return True + + if host_ip is not None: + try: + if host_ip in ipaddress.ip_network(entry, strict=False): + return True + except ValueError: + pass + + entry = entry.lstrip('.') + if ( + host == entry + or host.endswith('.' + entry) + or host_and_port == entry + or host_and_port.endswith('.' + entry) + ): + return True + + return False + + class RESTResponse(io.IOBase): def __init__(self, resp) -> None: @@ -104,7 +144,9 @@ def __init__(self, configuration) -> None: # https pool manager self.pool_manager: urllib3.PoolManager - if configuration.proxy: + if configuration.proxy and not should_bypass_proxies( + configuration.host, configuration.no_proxy or '' + ): if is_socks_proxy_url(configuration.proxy): from urllib3.contrib.socks import SOCKSProxyManager pool_args["proxy_url"] = configuration.proxy @@ -176,12 +218,20 @@ def request( # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # no content type provided or payload is json content_type = headers.get('Content-Type') - if ( + is_json = ( not content_type or re.search('json', content_type, re.IGNORECASE) - ): + ) + # JSON is valid YAML 1.2, so structured YAML bodies can use + # the existing JSON serializer: + # https://yaml.org/spec/1.2.2/#13-relation-to-json + is_structured_yaml = ( + content_type + and re.search('yaml', content_type, re.IGNORECASE) + and not isinstance(body, (str, bytes)) + ) + if is_json or is_structured_yaml: request_body = None if body is not None: request_body = json.dumps(body) diff --git a/test-requirements.txt b/test-requirements.txt index e98555c..731ef0e 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,4 @@ -pytest >= 7.2.1 +pytest >= 8.4.2 pytest-cov >= 2.8.1 tox >= 3.9.0 flake8 >= 4.0.0 diff --git a/test/test_add_item_catalog_action.py b/test/test_add_item_catalog_action.py index e04980a..406eb7e 100644 --- a/test/test_add_item_catalog_action.py +++ b/test/test_add_item_catalog_action.py @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> AddItemCatalogAction: return AddItemCatalogAction( sku = 'SKU1241028', price = 99.99, - attributes = {"origin":"germany","color":"blue"}, + attributes = {origin=germany, color=blue}, product = talon_one.models.product.Product( name = 'sample_product', ), replace_if_exists = False diff --git a/test/test_base_notification.py b/test/test_base_notification.py index d269232..9563637 100644 --- a/test/test_base_notification.py +++ b/test/test_base_notification.py @@ -35,7 +35,7 @@ def make_instance(self, include_optional) -> BaseNotification: model = BaseNotification() if include_optional: return BaseNotification( - policy = talon_one.models.policy.policy(), + policy = talon_one.models.base_notification_policy.BaseNotificationPolicy(), enabled = True, webhook = None, id = 6, @@ -43,7 +43,7 @@ def make_instance(self, include_optional) -> BaseNotification: ) else: return BaseNotification( - policy = talon_one.models.policy.policy(), + policy = talon_one.models.base_notification_policy.BaseNotificationPolicy(), webhook = None, id = 6, type = 'loyalty_added_deducted_points', diff --git a/test/test_base_notification_entity.py b/test/test_base_notification_entity.py index 5521698..e85a8b1 100644 --- a/test/test_base_notification_entity.py +++ b/test/test_base_notification_entity.py @@ -35,12 +35,12 @@ def make_instance(self, include_optional) -> BaseNotificationEntity: model = BaseNotificationEntity() if include_optional: return BaseNotificationEntity( - policy = None, + policy = talon_one.models.base_notification_policy.BaseNotificationPolicy(), enabled = True ) else: return BaseNotificationEntity( - policy = None, + policy = talon_one.models.base_notification_policy.BaseNotificationPolicy(), ) """ diff --git a/test/test_base_notification_policy.py b/test/test_base_notification_policy.py new file mode 100644 index 0000000..488d819 --- /dev/null +++ b/test/test_base_notification_policy.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.base_notification_policy import BaseNotificationPolicy + +class TestBaseNotificationPolicy(unittest.TestCase): + """BaseNotificationPolicy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseNotificationPolicy: + """Test BaseNotificationPolicy + 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 `BaseNotificationPolicy` + """ + model = BaseNotificationPolicy() + if include_optional: + return BaseNotificationPolicy( + name = 'Notification to Google', + triggers = [ + talon_one.models.tier_will_downgrade_notification_trigger.TierWillDowngradeNotificationTrigger( + amount = 56, + period = 'w', ) + ], + batching_enabled = False, + batch_size = 1000, + scopes = [ + 'all' + ], + include_data = True, + ahead_of_days_trigger = 1 + ) + else: + return BaseNotificationPolicy( + name = 'Notification to Google', + triggers = [ + talon_one.models.tier_will_downgrade_notification_trigger.TierWillDowngradeNotificationTrigger( + amount = 56, + period = 'w', ) + ], + scopes = [ + 'all' + ], + ) + """ + + def testBaseNotificationPolicy(self): + """Test BaseNotificationPolicy""" + # 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_bulk_application_notification.py b/test/test_bulk_application_notification.py index 7b97b1b..45cef42 100644 --- a/test/test_bulk_application_notification.py +++ b/test/test_bulk_application_notification.py @@ -37,16 +37,20 @@ def make_instance(self, include_optional) -> BulkApplicationNotification: return BulkApplicationNotification( total_result_size = 1, data = [ - talon_one.models.application_notification.ApplicationNotification( - event = '', ) + talon_one.models.campaign_evaluation_tree_changed_notification.CampaignEvaluationTreeChangedNotification( + application_id = 78, + old_evaluation_tree = null, + evaluation_tree = null, ) ] ) else: return BulkApplicationNotification( total_result_size = 1, data = [ - talon_one.models.application_notification.ApplicationNotification( - event = '', ) + talon_one.models.campaign_evaluation_tree_changed_notification.CampaignEvaluationTreeChangedNotification( + application_id = 78, + old_evaluation_tree = null, + evaluation_tree = null, ) ], ) """ diff --git a/test/test_campaign_evaluation_tree_changed_message.py b/test/test_campaign_evaluation_tree_changed_message.py index 69bbc42..26fc531 100644 --- a/test/test_campaign_evaluation_tree_changed_message.py +++ b/test/test_campaign_evaluation_tree_changed_message.py @@ -38,8 +38,10 @@ def make_instance(self, include_optional) -> CampaignEvaluationTreeChangedMessag notification_type = 'CampaignNotification', total_result_size = 56, data = [ - talon_one.models.application_notification.ApplicationNotification( - event = '', ) + talon_one.models.campaign_evaluation_tree_changed_notification.CampaignEvaluationTreeChangedNotification( + application_id = 78, + old_evaluation_tree = null, + evaluation_tree = null, ) ] ) else: diff --git a/test/test_campaign_set_node.py b/test/test_campaign_set_node.py index 7255650..f1c6545 100644 --- a/test/test_campaign_set_node.py +++ b/test/test_campaign_set_node.py @@ -35,11 +35,34 @@ def make_instance(self, include_optional) -> CampaignSetNode: model = CampaignSetNode() if include_optional: return CampaignSetNode( - type = 'type' + type = 'type', + name = 'name', + operator = 'ALL', + elements = [ + talon_one.models.campaign_set_node.CampaignSetNode( + type = 'type', ) + ], + group_id = 56, + locked = True, + description = '', + evaluation_mode = 'stackable', + evaluation_scope = 'cartItem', + campaign_id = 56 ) else: return CampaignSetNode( type = 'type', + name = 'name', + operator = 'ALL', + elements = [ + talon_one.models.campaign_set_node.CampaignSetNode( + type = 'type', ) + ], + group_id = 56, + locked = True, + evaluation_mode = 'stackable', + evaluation_scope = 'cartItem', + campaign_id = 56, ) """ diff --git a/test/test_catalog_action.py b/test/test_catalog_action.py index c6c2be4..3c6013d 100644 --- a/test/test_catalog_action.py +++ b/test/test_catalog_action.py @@ -35,13 +35,35 @@ def make_instance(self, include_optional) -> CatalogAction: model = CatalogAction() if include_optional: return CatalogAction( - type = 'ADD', - payload = None + type = None, + payload = talon_one.models.add_price_adjustment_catalog_action.AddPriceAdjustmentCatalogAction( + sku = 'SKU1241028', + adjustments = [ + talon_one.models.new_price_adjustment.NewPriceAdjustment( + price_type = 'member', + price = 100, + reference_id = '68851723-e6fa-488f-ace9-112581e6c19b', + calculated_at = '2021-09-12T10:12:42Z', + effective_from = '2021-09-12T10:12:42Z', + effective_until = '2021-09-12T10:12:42Z', + context_id = 'Summer2025', ) + ], ) ) else: return CatalogAction( - type = 'ADD', - payload = None, + type = None, + payload = talon_one.models.add_price_adjustment_catalog_action.AddPriceAdjustmentCatalogAction( + sku = 'SKU1241028', + adjustments = [ + talon_one.models.new_price_adjustment.NewPriceAdjustment( + price_type = 'member', + price = 100, + reference_id = '68851723-e6fa-488f-ace9-112581e6c19b', + calculated_at = '2021-09-12T10:12:42Z', + effective_from = '2021-09-12T10:12:42Z', + effective_until = '2021-09-12T10:12:42Z', + context_id = 'Summer2025', ) + ], ), ) """ diff --git a/test/test_catalog_action_one_of.py b/test/test_catalog_action_one_of.py new file mode 100644 index 0000000..4728c2f --- /dev/null +++ b/test/test_catalog_action_one_of.py @@ -0,0 +1,66 @@ +# 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_one_of import CatalogActionOneOf + +class TestCatalogActionOneOf(unittest.TestCase): + """CatalogActionOneOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CatalogActionOneOf: + """Test CatalogActionOneOf + 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 `CatalogActionOneOf` + """ + model = CatalogActionOneOf() + if include_optional: + return CatalogActionOneOf( + type = None, + payload = talon_one.models.add_item_catalog_action.AddItemCatalogAction( + sku = 'SKU1241028', + price = 99.99, + attributes = {origin=germany, color=blue}, + product = talon_one.models.product.Product( + name = 'sample_product', ), + replace_if_exists = False, ) + ) + else: + return CatalogActionOneOf( + type = None, + payload = talon_one.models.add_item_catalog_action.AddItemCatalogAction( + sku = 'SKU1241028', + price = 99.99, + attributes = {origin=germany, color=blue}, + product = talon_one.models.product.Product( + name = 'sample_product', ), + replace_if_exists = False, ), + ) + """ + + def testCatalogActionOneOf(self): + """Test CatalogActionOneOf""" + # 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_action_one_of1.py b/test/test_catalog_action_one_of1.py new file mode 100644 index 0000000..3a6e63b --- /dev/null +++ b/test/test_catalog_action_one_of1.py @@ -0,0 +1,66 @@ +# 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_one_of1 import CatalogActionOneOf1 + +class TestCatalogActionOneOf1(unittest.TestCase): + """CatalogActionOneOf1 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CatalogActionOneOf1: + """Test CatalogActionOneOf1 + 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 `CatalogActionOneOf1` + """ + model = CatalogActionOneOf1() + if include_optional: + return CatalogActionOneOf1( + type = None, + payload = talon_one.models.patch_item_catalog_action.PatchItemCatalogAction( + sku = '', + price = 99.99, + attributes = talon_one.models.attributes.attributes(), + product = talon_one.models.product.Product( + name = 'sample_product', ), + create_if_not_exists = True, ) + ) + else: + return CatalogActionOneOf1( + type = None, + payload = talon_one.models.patch_item_catalog_action.PatchItemCatalogAction( + sku = '', + price = 99.99, + attributes = talon_one.models.attributes.attributes(), + product = talon_one.models.product.Product( + name = 'sample_product', ), + create_if_not_exists = True, ), + ) + """ + + def testCatalogActionOneOf1(self): + """Test CatalogActionOneOf1""" + # 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_action_one_of2.py b/test/test_catalog_action_one_of2.py new file mode 100644 index 0000000..a6a58e1 --- /dev/null +++ b/test/test_catalog_action_one_of2.py @@ -0,0 +1,70 @@ +# 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_one_of2 import CatalogActionOneOf2 + +class TestCatalogActionOneOf2(unittest.TestCase): + """CatalogActionOneOf2 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CatalogActionOneOf2: + """Test CatalogActionOneOf2 + 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 `CatalogActionOneOf2` + """ + model = CatalogActionOneOf2() + if include_optional: + return CatalogActionOneOf2( + type = None, + payload = talon_one.models.patch_many_items_catalog_action.PatchManyItemsCatalogAction( + price = 99.99, + filters = [ + talon_one.models.catalog_action_filter.CatalogActionFilter( + attr = '', + op = 'EQ', + value = null, ) + ], + attributes = talon_one.models.attributes.attributes(), ) + ) + else: + return CatalogActionOneOf2( + type = None, + payload = talon_one.models.patch_many_items_catalog_action.PatchManyItemsCatalogAction( + price = 99.99, + filters = [ + talon_one.models.catalog_action_filter.CatalogActionFilter( + attr = '', + op = 'EQ', + value = null, ) + ], + attributes = talon_one.models.attributes.attributes(), ), + ) + """ + + def testCatalogActionOneOf2(self): + """Test CatalogActionOneOf2""" + # 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_action_one_of3.py b/test/test_catalog_action_one_of3.py new file mode 100644 index 0000000..39403ed --- /dev/null +++ b/test/test_catalog_action_one_of3.py @@ -0,0 +1,56 @@ +# 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_one_of3 import CatalogActionOneOf3 + +class TestCatalogActionOneOf3(unittest.TestCase): + """CatalogActionOneOf3 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CatalogActionOneOf3: + """Test CatalogActionOneOf3 + 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 `CatalogActionOneOf3` + """ + model = CatalogActionOneOf3() + if include_optional: + return CatalogActionOneOf3( + type = None, + payload = talon_one.models.remove_item_catalog_action.RemoveItemCatalogAction( + sku = '', ) + ) + else: + return CatalogActionOneOf3( + type = None, + payload = talon_one.models.remove_item_catalog_action.RemoveItemCatalogAction( + sku = '', ), + ) + """ + + def testCatalogActionOneOf3(self): + """Test CatalogActionOneOf3""" + # 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_action_one_of4.py b/test/test_catalog_action_one_of4.py new file mode 100644 index 0000000..5e8d9d6 --- /dev/null +++ b/test/test_catalog_action_one_of4.py @@ -0,0 +1,66 @@ +# 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_one_of4 import CatalogActionOneOf4 + +class TestCatalogActionOneOf4(unittest.TestCase): + """CatalogActionOneOf4 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CatalogActionOneOf4: + """Test CatalogActionOneOf4 + 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 `CatalogActionOneOf4` + """ + model = CatalogActionOneOf4() + if include_optional: + return CatalogActionOneOf4( + type = None, + payload = talon_one.models.remove_many_items_catalog_action.RemoveManyItemsCatalogAction( + filters = [ + talon_one.models.catalog_action_filter.CatalogActionFilter( + attr = '', + op = 'EQ', + value = null, ) + ], ) + ) + else: + return CatalogActionOneOf4( + type = None, + payload = talon_one.models.remove_many_items_catalog_action.RemoveManyItemsCatalogAction( + filters = [ + talon_one.models.catalog_action_filter.CatalogActionFilter( + attr = '', + op = 'EQ', + value = null, ) + ], ), + ) + """ + + def testCatalogActionOneOf4(self): + """Test CatalogActionOneOf4""" + # 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_action_one_of5.py b/test/test_catalog_action_one_of5.py new file mode 100644 index 0000000..c14014c --- /dev/null +++ b/test/test_catalog_action_one_of5.py @@ -0,0 +1,76 @@ +# 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_one_of5 import CatalogActionOneOf5 + +class TestCatalogActionOneOf5(unittest.TestCase): + """CatalogActionOneOf5 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CatalogActionOneOf5: + """Test CatalogActionOneOf5 + 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 `CatalogActionOneOf5` + """ + model = CatalogActionOneOf5() + if include_optional: + return CatalogActionOneOf5( + type = None, + payload = talon_one.models.add_price_adjustment_catalog_action.AddPriceAdjustmentCatalogAction( + sku = 'SKU1241028', + adjustments = [ + talon_one.models.new_price_adjustment.NewPriceAdjustment( + price_type = 'member', + price = 100, + reference_id = '68851723-e6fa-488f-ace9-112581e6c19b', + calculated_at = '2021-09-12T10:12:42Z', + effective_from = '2021-09-12T10:12:42Z', + effective_until = '2021-09-12T10:12:42Z', + context_id = 'Summer2025', ) + ], ) + ) + else: + return CatalogActionOneOf5( + type = None, + payload = talon_one.models.add_price_adjustment_catalog_action.AddPriceAdjustmentCatalogAction( + sku = 'SKU1241028', + adjustments = [ + talon_one.models.new_price_adjustment.NewPriceAdjustment( + price_type = 'member', + price = 100, + reference_id = '68851723-e6fa-488f-ace9-112581e6c19b', + calculated_at = '2021-09-12T10:12:42Z', + effective_from = '2021-09-12T10:12:42Z', + effective_until = '2021-09-12T10:12:42Z', + context_id = 'Summer2025', ) + ], ), + ) + """ + + def testCatalogActionOneOf5(self): + """Test CatalogActionOneOf5""" + # 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 8c6eabb..4e8e878 100644 --- a/test/test_catalog_sync_request.py +++ b/test/test_catalog_sync_request.py @@ -36,18 +36,14 @@ def make_instance(self, include_optional) -> CatalogSyncRequest: if include_optional: return CatalogSyncRequest( actions = [ - talon_one.models.catalog_action.CatalogAction( - type = 'ADD', - payload = talon_one.models.payload.payload(), ) + talon_one.models.catalog_action.CatalogAction() ], version = 244 ) else: return CatalogSyncRequest( actions = [ - talon_one.models.catalog_action.CatalogAction( - type = 'ADD', - payload = talon_one.models.payload.payload(), ) + talon_one.models.catalog_action.CatalogAction() ], ) """ diff --git a/test/test_change.py b/test/test_change.py index aa93604..b71a0bc 100644 --- a/test/test_change.py +++ b/test/test_change.py @@ -40,8 +40,8 @@ def make_instance(self, include_optional) -> Change: user_id = 388, application_id = 359, entity = '/v1/applications/359/campaigns/6727', - old = None, - new = None, + old = {}, + new = {applicationId"=359, attributes"={}, campaignGroups"=[], created"=2022-07-08T13:04:02.972762328Z, description"=, features"=[referrals, loyalty], id=6727}, management_key_id = 3 ) else: diff --git a/test/test_check_attribute_block.py b/test/test_check_attribute_block_base.py similarity index 82% rename from test/test_check_attribute_block.py rename to test/test_check_attribute_block_base.py index dd40220..6be1247 100644 --- a/test/test_check_attribute_block.py +++ b/test/test_check_attribute_block_base.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.check_attribute_block import CheckAttributeBlock +from talon_one.models.check_attribute_block_base import CheckAttributeBlockBase -class TestCheckAttributeBlock(unittest.TestCase): - """CheckAttributeBlock unit test stubs""" +class TestCheckAttributeBlockBase(unittest.TestCase): + """CheckAttributeBlockBase unit test stubs""" def setUp(self): pass @@ -25,16 +25,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> CheckAttributeBlock: - """Test CheckAttributeBlock + def make_instance(self, include_optional) -> CheckAttributeBlockBase: + """Test CheckAttributeBlockBase 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 `CheckAttributeBlock` + # uncomment below to create an instance of `CheckAttributeBlockBase` """ - model = CheckAttributeBlock() + model = CheckAttributeBlockBase() if include_optional: - return CheckAttributeBlock( + return CheckAttributeBlockBase( id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', type = '', tags = [ @@ -49,7 +49,7 @@ def make_instance(self, include_optional) -> CheckAttributeBlock: count = None ) else: - return CheckAttributeBlock( + return CheckAttributeBlockBase( id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', type = '', operator = 'greaterThan', @@ -57,8 +57,8 @@ def make_instance(self, include_optional) -> CheckAttributeBlock: ) """ - def testCheckAttributeBlock(self): - """Test CheckAttributeBlock""" + def testCheckAttributeBlockBase(self): + """Test CheckAttributeBlockBase""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_confirm_risks_request.py b/test/test_confirm_risks_request.py new file mode 100644 index 0000000..18bc75c --- /dev/null +++ b/test/test_confirm_risks_request.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.confirm_risks_request import ConfirmRisksRequest + +class TestConfirmRisksRequest(unittest.TestCase): + """ConfirmRisksRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ConfirmRisksRequest: + """Test ConfirmRisksRequest + 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 `ConfirmRisksRequest` + """ + model = ConfirmRisksRequest() + if include_optional: + return ConfirmRisksRequest( + risk_ids = [1,2,3], + comment = 'Investigated with the customer and fixed the loyalty rule.' + ) + else: + return ConfirmRisksRequest( + risk_ids = [1,2,3], + comment = 'Investigated with the customer and fixed the loyalty rule.', + ) + """ + + def testConfirmRisksRequest(self): + """Test ConfirmRisksRequest""" + # 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_customer_profile_reward.py b/test/test_customer_profile_reward.py new file mode 100644 index 0000000..111aadb --- /dev/null +++ b/test/test_customer_profile_reward.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.customer_profile_reward import CustomerProfileReward + +class TestCustomerProfileReward(unittest.TestCase): + """CustomerProfileReward unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CustomerProfileReward: + """Test CustomerProfileReward + 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 `CustomerProfileReward` + """ + model = CustomerProfileReward() + if include_optional: + return CustomerProfileReward( + id = 6, + reward_id = 12, + reward_name = 'Free coffee', + status = 'unlocked', + unlocked_at = '2026-07-01T09:00:00Z', + unlocked_by_integration_id = 'customer2839', + used_at = '2026-07-02T10:30:00Z', + used_by_integration_id = 'customer2840', + loyalty_program_id = 9, + loyalty_card_identifier = 'summer-loyalty-card-0543' + ) + else: + return CustomerProfileReward( + id = 6, + reward_id = 12, + reward_name = 'Free coffee', + status = 'unlocked', + unlocked_at = '2026-07-01T09:00:00Z', + ) + """ + + def testCustomerProfileReward(self): + """Test CustomerProfileReward""" + # 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_list_with_count_check_attribute_block.py b/test/test_digital_pass.py similarity index 63% rename from test/test_list_with_count_check_attribute_block.py rename to test/test_digital_pass.py index bab1c87..c50815f 100644 --- a/test/test_list_with_count_check_attribute_block.py +++ b/test/test_digital_pass.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.list_with_count_check_attribute_block import ListWithCountCheckAttributeBlock +from talon_one.models.digital_pass import DigitalPass -class TestListWithCountCheckAttributeBlock(unittest.TestCase): - """ListWithCountCheckAttributeBlock unit test stubs""" +class TestDigitalPass(unittest.TestCase): + """DigitalPass unit test stubs""" def setUp(self): pass @@ -25,29 +25,32 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> ListWithCountCheckAttributeBlock: - """Test ListWithCountCheckAttributeBlock + def make_instance(self, include_optional) -> DigitalPass: + """Test DigitalPass 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 `ListWithCountCheckAttributeBlock` + # uncomment below to create an instance of `DigitalPass` """ - model = ListWithCountCheckAttributeBlock() + model = DigitalPass() if include_optional: - return ListWithCountCheckAttributeBlock( - operator = 'containsAtLeast', - values = None, - count = None + return DigitalPass( + pass_id = 'pass_9c3f1a2b', + pass_template_id = 'tmpl_summer_loyalty', + status = 'created', + pass_url = 'https://wallet.example.com/passes/pass_9c3f1a2b' ) else: - return ListWithCountCheckAttributeBlock( - values = None, - count = None, + return DigitalPass( + pass_id = 'pass_9c3f1a2b', + pass_template_id = 'tmpl_summer_loyalty', + status = 'created', + pass_url = 'https://wallet.example.com/passes/pass_9c3f1a2b', ) """ - def testListWithCountCheckAttributeBlock(self): - """Test ListWithCountCheckAttributeBlock""" + def testDigitalPass(self): + """Test DigitalPass""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_between_check_attribute_block.py b/test/test_discard_risks_request.py similarity index 65% rename from test/test_between_check_attribute_block.py rename to test/test_discard_risks_request.py index 20523dc..88d2c43 100644 --- a/test/test_between_check_attribute_block.py +++ b/test/test_discard_risks_request.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.between_check_attribute_block import BetweenCheckAttributeBlock +from talon_one.models.discard_risks_request import DiscardRisksRequest -class TestBetweenCheckAttributeBlock(unittest.TestCase): - """BetweenCheckAttributeBlock unit test stubs""" +class TestDiscardRisksRequest(unittest.TestCase): + """DiscardRisksRequest unit test stubs""" def setUp(self): pass @@ -25,29 +25,29 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> BetweenCheckAttributeBlock: - """Test BetweenCheckAttributeBlock + def make_instance(self, include_optional) -> DiscardRisksRequest: + """Test DiscardRisksRequest 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 `BetweenCheckAttributeBlock` + # uncomment below to create an instance of `DiscardRisksRequest` """ - model = BetweenCheckAttributeBlock() + model = DiscardRisksRequest() if include_optional: - return BetweenCheckAttributeBlock( - operator = 'between', - min = None, - max = None + return DiscardRisksRequest( + risk_ids = [1,2,3], + reason = 'expected_behavior', + comment = 'Duplicate of a risk already being handled.' ) else: - return BetweenCheckAttributeBlock( - min = None, - max = None, + return DiscardRisksRequest( + risk_ids = [1,2,3], + reason = 'expected_behavior', ) """ - def testBetweenCheckAttributeBlock(self): - """Test BetweenCheckAttributeBlock""" + def testDiscardRisksRequest(self): + """Test DiscardRisksRequest""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_effect_all_of_props.py b/test/test_effect_all_of_props.py new file mode 100644 index 0000000..30886c1 --- /dev/null +++ b/test/test_effect_all_of_props.py @@ -0,0 +1,177 @@ +# 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.effect_all_of_props import EffectAllOfProps + +class TestEffectAllOfProps(unittest.TestCase): + """EffectAllOfProps unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EffectAllOfProps: + """Test EffectAllOfProps + 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 `EffectAllOfProps` + """ + model = EffectAllOfProps() + if include_optional: + return EffectAllOfProps( + value = 1.337, + id = 56, + rejection_reason = '', + condition_index = 56, + effect_index = 56, + details = '', + campaign_exclusion_reason = 'CampaignGaveLowerDiscount', + profile_id = 150, + name = '', + scope = '', + desired_value = 1.337, + position = 1.337, + sub_position = 1.337, + total_discount = 1.337, + desired_total_discount = 1.337, + bundle_index = 1, + bundle_name = 'my_bundle', + targeted_item_position = 1.337, + targeted_item_sub_position = 1.337, + excluded_from_price_history = True, + additional_cost_id = 56, + additional_cost = '', + webhook_id = 1.337, + webhook_name = '', + program_id = 56, + sub_ledger_id = '', + recipient_integration_id = 'URNGV8294NV', + start_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + expiry_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + transaction_uuid = '', + cart_item_position = 1, + cart_item_sub_position = 2, + card_identifier = 'summer-loyalty-card-0543', + awaits_activation = True, + validity_duration = '', + rule_title = '', + previous_tier_name = '', + new_tier_name = '', + sku = 'SKU1241028', + desired_quantity = 56, + notification_type = '', + title = '', + body = '', + path = '', + description = '', + bundle_attributes = [ + '' + ], + items_indices = [ + 1.337 + ], + pool_id = 2, + pool_name = 'My pool', + giveaway_id = 5, + code = '57638t-67439hty', + message = '', + effect_id = 1, + payload = None, + coupon_value = '', + profile_integration_id = 'URNGV8294NV', + is_new_reservation = True, + audience_id = 10, + audience_name = 'My audience', + achievement_id = 10, + achievement_name = 'FreeCoffee10Orders', + progress_tracker_id = 56, + delta = 1.337, + target = 1.337, + is_just_completed = True, + decrease_progress_by = 1.337, + current_progress = 1.337, + extension_duration = '12h', + affected_transactions = [ + talon_one.models.loyalty_ledger_entry_expiry_date_change.LoyaltyLedgerEntryExpiryDateChange( + transaction_uuid = '', + previous_expiry_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + new_expiry_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ], + new_expiry_date = '2024-07-24T14:15:22Z' + ) + else: + return EffectAllOfProps( + value = 1.337, + id = 56, + rejection_reason = '', + profile_id = 150, + name = '', + position = 1.337, + additional_cost_id = 56, + additional_cost = '', + webhook_id = 1.337, + webhook_name = '', + program_id = 56, + sub_ledger_id = '', + recipient_integration_id = 'URNGV8294NV', + transaction_uuid = '', + rule_title = '', + new_tier_name = '', + sku = 'SKU1241028', + notification_type = '', + title = '', + body = '', + path = '', + description = '', + bundle_attributes = [ + '' + ], + items_indices = [ + 1.337 + ], + pool_id = 2, + pool_name = 'My pool', + giveaway_id = 5, + code = '57638t-67439hty', + message = '', + effect_id = 1, + payload = None, + coupon_value = '', + profile_integration_id = 'URNGV8294NV', + is_new_reservation = True, + achievement_id = 10, + achievement_name = 'FreeCoffee10Orders', + progress_tracker_id = 56, + delta = 1.337, + target = 1.337, + is_just_completed = True, + decrease_progress_by = 1.337, + current_progress = 1.337, + extension_duration = '12h', + new_expiry_date = '2024-07-24T14:15:22Z', + ) + """ + + def testEffectAllOfProps(self): + """Test EffectAllOfProps""" + # 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_effect_props.py b/test/test_effect_props.py new file mode 100644 index 0000000..e0e45d7 --- /dev/null +++ b/test/test_effect_props.py @@ -0,0 +1,177 @@ +# 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.effect_props import EffectProps + +class TestEffectProps(unittest.TestCase): + """EffectProps unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EffectProps: + """Test EffectProps + 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 `EffectProps` + """ + model = EffectProps() + if include_optional: + return EffectProps( + value = 1.337, + id = 56, + rejection_reason = '', + condition_index = 56, + effect_index = 56, + details = '', + campaign_exclusion_reason = 'CampaignGaveLowerDiscount', + profile_id = 150, + name = '', + scope = '', + desired_value = 1.337, + position = 1.337, + sub_position = 1.337, + total_discount = 1.337, + desired_total_discount = 1.337, + bundle_index = 1, + bundle_name = 'my_bundle', + targeted_item_position = 1.337, + targeted_item_sub_position = 1.337, + excluded_from_price_history = True, + additional_cost_id = 56, + additional_cost = '', + webhook_id = 1.337, + webhook_name = '', + program_id = 56, + sub_ledger_id = '', + recipient_integration_id = 'URNGV8294NV', + start_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + expiry_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + transaction_uuid = '', + cart_item_position = 1, + cart_item_sub_position = 2, + card_identifier = 'summer-loyalty-card-0543', + awaits_activation = True, + validity_duration = '', + rule_title = '', + previous_tier_name = '', + new_tier_name = '', + sku = 'SKU1241028', + desired_quantity = 56, + notification_type = '', + title = '', + body = '', + path = '', + description = '', + bundle_attributes = [ + '' + ], + items_indices = [ + 1.337 + ], + pool_id = 2, + pool_name = 'My pool', + giveaway_id = 5, + code = '57638t-67439hty', + message = '', + effect_id = 1, + payload = None, + coupon_value = '', + profile_integration_id = 'URNGV8294NV', + is_new_reservation = True, + audience_id = 10, + audience_name = 'My audience', + achievement_id = 10, + achievement_name = 'FreeCoffee10Orders', + progress_tracker_id = 56, + delta = 1.337, + target = 1.337, + is_just_completed = True, + decrease_progress_by = 1.337, + current_progress = 1.337, + extension_duration = '12h', + affected_transactions = [ + talon_one.models.loyalty_ledger_entry_expiry_date_change.LoyaltyLedgerEntryExpiryDateChange( + transaction_uuid = '', + previous_expiry_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + new_expiry_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ], + new_expiry_date = '2024-07-24T14:15:22Z' + ) + else: + return EffectProps( + value = 1.337, + id = 56, + rejection_reason = '', + profile_id = 150, + name = '', + position = 1.337, + additional_cost_id = 56, + additional_cost = '', + webhook_id = 1.337, + webhook_name = '', + program_id = 56, + sub_ledger_id = '', + recipient_integration_id = 'URNGV8294NV', + transaction_uuid = '', + rule_title = '', + new_tier_name = '', + sku = 'SKU1241028', + notification_type = '', + title = '', + body = '', + path = '', + description = '', + bundle_attributes = [ + '' + ], + items_indices = [ + 1.337 + ], + pool_id = 2, + pool_name = 'My pool', + giveaway_id = 5, + code = '57638t-67439hty', + message = '', + effect_id = 1, + payload = None, + coupon_value = '', + profile_integration_id = 'URNGV8294NV', + is_new_reservation = True, + achievement_id = 10, + achievement_name = 'FreeCoffee10Orders', + progress_tracker_id = 56, + delta = 1.337, + target = 1.337, + is_just_completed = True, + decrease_progress_by = 1.337, + current_progress = 1.337, + extension_duration = '12h', + new_expiry_date = '2024-07-24T14:15:22Z', + ) + """ + + def testEffectProps(self): + """Test EffectProps""" + # 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.py b/test/test_event.py index e2221b3..8f98b71 100644 --- a/test/test_event.py +++ b/test/test_event.py @@ -41,7 +41,7 @@ def make_instance(self, include_optional) -> Event: profile_id = 'URNGV8294NV', store_integration_id = 'STORE-001', type = 'pageViewed', - attributes = None, + attributes = {myAttribute=myValue}, integration_id = '175KJPS947296', session_id = '175KJPS947296', effects = [ @@ -69,7 +69,7 @@ def make_instance(self, include_optional) -> Event: created = '2020-06-10T09:05:27.993483Z', application_id = 322, type = 'pageViewed', - attributes = None, + attributes = {myAttribute=myValue}, effects = [ None ], diff --git a/test/test_event_v3.py b/test/test_event_v3.py index e266a3a..285de00 100644 --- a/test/test_event_v3.py +++ b/test/test_event_v3.py @@ -42,7 +42,7 @@ def make_instance(self, include_optional) -> EventV3: profile_id = 'URNGV8294NV', store_integration_id = 'STORE-001', type = 'pageViewed', - attributes = None, + attributes = {myAttribute=myValue}, integration_id = '175KJPS947296', effects = [ None @@ -54,7 +54,7 @@ def make_instance(self, include_optional) -> EventV3: created = '2020-06-10T09:05:27.993483Z', application_id = 322, type = 'pageViewed', - attributes = None, + attributes = {myAttribute=myValue}, effects = [ None ], diff --git a/test/test_integration_event.py b/test/test_integration_event.py index 11b7a6b..352a1d7 100644 --- a/test/test_integration_event.py +++ b/test/test_integration_event.py @@ -38,12 +38,12 @@ def make_instance(self, include_optional) -> IntegrationEvent: profile_id = 'URNGV8294NV', store_integration_id = 'STORE-001', type = 'pageViewed', - attributes = None + attributes = {myAttribute=myValue} ) else: return IntegrationEvent( type = 'pageViewed', - attributes = None, + attributes = {myAttribute=myValue}, ) """ diff --git a/test/test_integration_hub_paginated_event_payload_data_inner.py b/test/test_integration_hub_paginated_event_payload_data_inner.py new file mode 100644 index 0000000..b7fe763 --- /dev/null +++ b/test/test_integration_hub_paginated_event_payload_data_inner.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 + + +import unittest + +from talon_one.models.integration_hub_paginated_event_payload_data_inner import IntegrationHubPaginatedEventPayloadDataInner + +class TestIntegrationHubPaginatedEventPayloadDataInner(unittest.TestCase): + """IntegrationHubPaginatedEventPayloadDataInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IntegrationHubPaginatedEventPayloadDataInner: + """Test IntegrationHubPaginatedEventPayloadDataInner + 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 `IntegrationHubPaginatedEventPayloadDataInner` + """ + model = IntegrationHubPaginatedEventPayloadDataInner() + if include_optional: + return IntegrationHubPaginatedEventPayloadDataInner( + profile_integration_id = '', + loyalty_program_id = 56, + loyalty_program_name = '', + subledger_id = '', + source_of_event = '', + current_tier = '', + session_integration_id = '', + employee_name = '', + user_id = 56, + current_points = 1.337, + actions = [ + null + ], + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + 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'), + points_required_to_the_next_tier = 1.337, + next_tier = '', + id = 56, + created = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + campaign_id = 56, + value = '', + usage_limit = 56, + discount_limit = 1.337, + reservation_limit = 56, + start_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + expiry_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + usage_counter = 56, + discount_counter = 1.337, + discount_remainder = 1.337, + referral_id = 56, + recipient_integration_id = '', + import_id = 56, + batch_id = '', + attributes = None, + limits = [ + talon_one.models.integration_hub_event_payload_coupon_based_notifications_limits.IntegrationHubEventPayloadCouponBasedNotificationsLimits( + action = '', + limit = 1.337, + period = '', + entities = [ + '' + ], ) + ] + ) + else: + return IntegrationHubPaginatedEventPayloadDataInner( + profile_integration_id = '', + loyalty_program_id = 56, + loyalty_program_name = '', + subledger_id = '', + source_of_event = '', + current_tier = '', + employee_name = '', + current_points = 1.337, + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + id = 56, + created = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + campaign_id = 56, + value = '', + usage_limit = 56, + usage_counter = 56, + ) + """ + + def testIntegrationHubPaginatedEventPayloadDataInner(self): + """Test IntegrationHubPaginatedEventPayloadDataInner""" + # 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_inventory_referral.py b/test/test_inventory_referral.py index fd967ea..5db924f 100644 --- a/test/test_inventory_referral.py +++ b/test/test_inventory_referral.py @@ -43,7 +43,7 @@ def make_instance(self, include_optional) -> InventoryReferral: campaign_id = 78, advocate_profile_integration_id = 'URNGV8294NV', friend_profile_integration_id = 'BZGGC2454PA', - attributes = None, + attributes = {channel=web}, import_id = 4, code = '27G47Y54VH9L', usage_counter = 1, diff --git a/test/test_unary_check_attribute_block.py b/test/test_label_target.py similarity index 70% rename from test/test_unary_check_attribute_block.py rename to test/test_label_target.py index 3335956..70393d7 100644 --- a/test/test_unary_check_attribute_block.py +++ b/test/test_label_target.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.unary_check_attribute_block import UnaryCheckAttributeBlock +from talon_one.models.label_target import LabelTarget -class TestUnaryCheckAttributeBlock(unittest.TestCase): - """UnaryCheckAttributeBlock unit test stubs""" +class TestLabelTarget(unittest.TestCase): + """LabelTarget unit test stubs""" def setUp(self): pass @@ -25,25 +25,28 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> UnaryCheckAttributeBlock: - """Test UnaryCheckAttributeBlock + def make_instance(self, include_optional) -> LabelTarget: + """Test LabelTarget 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 `UnaryCheckAttributeBlock` + # uncomment below to create an instance of `LabelTarget` """ - model = UnaryCheckAttributeBlock() + model = LabelTarget() if include_optional: - return UnaryCheckAttributeBlock( - operator = 'empty' + return LabelTarget( + type = 'NONE', + audience = None ) else: - return UnaryCheckAttributeBlock( + return LabelTarget( + type = 'NONE', + audience = None, ) """ - def testUnaryCheckAttributeBlock(self): - """Test UnaryCheckAttributeBlock""" + def testLabelTarget(self): + """Test LabelTarget""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_ledger_info.py b/test/test_ledger_info.py index 77408ab..32fbfc0 100644 --- a/test/test_ledger_info.py +++ b/test/test_ledger_info.py @@ -43,12 +43,7 @@ def make_instance(self, include_optional) -> LedgerInfo: tentative_current_balance = 100, tentative_pending_balance = 20, tentative_negative_balance = 100, - current_tier = talon_one.models.tier.Tier( - id = 11, - name = 'bronze', - start_date = '2021-05-03T12:32:00Z07:00', - expiry_date = '2022-08-02T15:04:05Z07:00', - downgrade_policy = 'one_down', ), + current_tier = bronze, points_to_next_tier = 20, next_tier_name = 'Silver' ) diff --git a/test/test_loyalty_balance_with_tier.py b/test/test_loyalty_balance_with_tier.py index c111dc3..d3e9eca 100644 --- a/test/test_loyalty_balance_with_tier.py +++ b/test/test_loyalty_balance_with_tier.py @@ -40,12 +40,7 @@ def make_instance(self, include_optional) -> LoyaltyBalanceWithTier: spent_points = 150, expired_points = 286, negative_points = 286, - current_tier = talon_one.models.tier.Tier( - id = 11, - name = 'bronze', - start_date = '2021-05-03T12:32:00Z07:00', - expiry_date = '2022-08-02T15:04:05Z07:00', - downgrade_policy = 'one_down', ), + current_tier = bronze, projected_tier = talon_one.models.projected_tier.ProjectedTier( projected_active_points = 198, stay_in_tier_points = 2, diff --git a/test/test_loyalty_card.py b/test/test_loyalty_card.py index 4285b8d..519a05c 100644 --- a/test/test_loyalty_card.py +++ b/test/test_loyalty_card.py @@ -54,8 +54,8 @@ def make_instance(self, include_optional) -> LoyaltyCard: 'key' : null }, modified = '2021-09-12T10:12:42Z', - old_card_identifier = 'summer-loyalty-card-0543', - new_card_identifier = 'summer-loyalty-card-0543', + old_card_identifier = summer-loyalty-card-0543, + new_card_identifier = autumn-loyalty-card-5822, batch_id = 'wdefpov' ) else: diff --git a/test/test_mcpo_auth_protected_resource.py b/test/test_mcpo_auth_protected_resource.py new file mode 100644 index 0000000..a97e413 --- /dev/null +++ b/test/test_mcpo_auth_protected_resource.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.mcpo_auth_protected_resource import MCPOAuthProtectedResource + +class TestMCPOAuthProtectedResource(unittest.TestCase): + """MCPOAuthProtectedResource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MCPOAuthProtectedResource: + """Test MCPOAuthProtectedResource + 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 `MCPOAuthProtectedResource` + """ + model = MCPOAuthProtectedResource() + if include_optional: + return MCPOAuthProtectedResource( + resource = 'https://mycompany.talon.one/v1/mcp/entrypoint', + authorization_servers = ["https://mycompany.talon.one/v1/mcp/auth"] + ) + else: + return MCPOAuthProtectedResource( + resource = 'https://mycompany.talon.one/v1/mcp/entrypoint', + authorization_servers = ["https://mycompany.talon.one/v1/mcp/auth"], + ) + """ + + def testMCPOAuthProtectedResource(self): + """Test MCPOAuthProtectedResource""" + # 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_mcpo_auth_server_metadata.py b/test/test_mcpo_auth_server_metadata.py new file mode 100644 index 0000000..dcd891d --- /dev/null +++ b/test/test_mcpo_auth_server_metadata.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.mcpo_auth_server_metadata import MCPOAuthServerMetadata + +class TestMCPOAuthServerMetadata(unittest.TestCase): + """MCPOAuthServerMetadata unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MCPOAuthServerMetadata: + """Test MCPOAuthServerMetadata + 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 `MCPOAuthServerMetadata` + """ + model = MCPOAuthServerMetadata() + if include_optional: + return MCPOAuthServerMetadata( + issuer = 'https://mycompany.talon.one', + authorization_endpoint = 'https://mycompany.talon.one/v1/mcp/auth/authorize', + token_endpoint = 'https://mycompany.talon.one/v1/mcp/auth/token', + registration_endpoint = 'https://mycompany.talon.one/v1/mcp/auth/register', + response_types_supported = ["code"], + grant_types_supported = ["authorization_code"], + code_challenge_methods_supported = ["S256"] + ) + else: + return MCPOAuthServerMetadata( + issuer = 'https://mycompany.talon.one', + authorization_endpoint = 'https://mycompany.talon.one/v1/mcp/auth/authorize', + token_endpoint = 'https://mycompany.talon.one/v1/mcp/auth/token', + registration_endpoint = 'https://mycompany.talon.one/v1/mcp/auth/register', + response_types_supported = ["code"], + grant_types_supported = ["authorization_code"], + code_challenge_methods_supported = ["S256"], + ) + """ + + def testMCPOAuthServerMetadata(self): + """Test MCPOAuthServerMetadata""" + # 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_base_notification.py b/test/test_new_base_notification.py index 6ce57b6..8e7503a 100644 --- a/test/test_new_base_notification.py +++ b/test/test_new_base_notification.py @@ -35,7 +35,7 @@ def make_instance(self, include_optional) -> NewBaseNotification: model = NewBaseNotification() if include_optional: return NewBaseNotification( - policy = talon_one.models.policy.policy(), + policy = talon_one.models.base_notification_policy.BaseNotificationPolicy(), enabled = True, webhook = talon_one.models.new_notification_webhook.NewNotificationWebhook( url = 'www.my-company.com/my-endpoint-name', @@ -46,7 +46,7 @@ def make_instance(self, include_optional) -> NewBaseNotification: ) else: return NewBaseNotification( - policy = talon_one.models.policy.policy(), + policy = talon_one.models.base_notification_policy.BaseNotificationPolicy(), webhook = talon_one.models.new_notification_webhook.NewNotificationWebhook( url = 'www.my-company.com/my-endpoint-name', headers = [ diff --git a/test/test_new_coupons.py b/test/test_new_coupons.py index 5b86ab5..21b2139 100644 --- a/test/test_new_coupons.py +++ b/test/test_new_coupons.py @@ -49,12 +49,14 @@ def make_instance(self, include_optional) -> NewCoupons: ], number_of_coupons = 1, unique_prefix = '', - attributes = None, + attributes = {venueId=12}, recipient_integration_id = 'URNGV8294NV', valid_characters = [A, B, G, Y], coupon_pattern = 'SUMMER-#####', is_reservation_mandatory = False, - implicitly_reserved = False + implicitly_reserved = False, + support_request_id = 42, + support_request_note = 'Approved as compensation for the delayed order.' ) else: return NewCoupons( diff --git a/test/test_new_coupons_for_multiple_recipients.py b/test/test_new_coupons_for_multiple_recipients.py index 876a40f..ebbef23 100644 --- a/test/test_new_coupons_for_multiple_recipients.py +++ b/test/test_new_coupons_for_multiple_recipients.py @@ -40,7 +40,7 @@ def make_instance(self, include_optional) -> NewCouponsForMultipleRecipients: reservation_limit = 45, start_date = '2020-01-24T14:15:22Z', expiry_date = '2023-08-24T14:15:22Z', - attributes = None, + attributes = {venueId=12}, recipients_integration_ids = [URNGV8294NV, BZGGC2454PA], valid_characters = [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z], coupon_pattern = 'SUMMER-#####' diff --git a/test/test_new_digital_pass.py b/test/test_new_digital_pass.py new file mode 100644 index 0000000..6609bdb --- /dev/null +++ b/test/test_new_digital_pass.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.new_digital_pass import NewDigitalPass + +class TestNewDigitalPass(unittest.TestCase): + """NewDigitalPass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NewDigitalPass: + """Test NewDigitalPass + 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 `NewDigitalPass` + """ + model = NewDigitalPass() + if include_optional: + return NewDigitalPass( + loyalty_program_id = 42, + pass_template_id = 'tmpl_summer_loyalty', + profile_id = '12412412421', + loyalty_card_id = 'summer-loyalty-0e2f', + platform = 'google', + attributes = {hm_member_name=Jane Doe} + ) + else: + return NewDigitalPass( + loyalty_program_id = 42, + pass_template_id = 'tmpl_summer_loyalty', + profile_id = '12412412421', + platform = 'google', + ) + """ + + def testNewDigitalPass(self): + """Test NewDigitalPass""" + # 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.py b/test/test_new_event.py index a0e3aa7..8d3d7a3 100644 --- a/test/test_new_event.py +++ b/test/test_new_event.py @@ -38,13 +38,13 @@ def make_instance(self, include_optional) -> NewEvent: profile_id = 'URNGV8294NV', store_integration_id = 'STORE-001', type = 'pageViewed', - attributes = None, + attributes = {myAttribute=myValue}, session_id = '175KJPS947296' ) else: return NewEvent( type = 'pageViewed', - attributes = None, + attributes = {myAttribute=myValue}, session_id = '175KJPS947296', ) """ diff --git a/test/test_new_referral.py b/test/test_new_referral.py index d403870..95d644a 100644 --- a/test/test_new_referral.py +++ b/test/test_new_referral.py @@ -41,7 +41,7 @@ def make_instance(self, include_optional) -> NewReferral: campaign_id = 78, advocate_profile_integration_id = 'URNGV8294NV', friend_profile_integration_id = 'BZGGC2454PA', - attributes = None + attributes = {channel=web} ) else: return NewReferral( diff --git a/test/test_new_referrals_for_multiple_advocates.py b/test/test_new_referrals_for_multiple_advocates.py index 47763e0..4f7c1ff 100644 --- a/test/test_new_referrals_for_multiple_advocates.py +++ b/test/test_new_referrals_for_multiple_advocates.py @@ -40,7 +40,7 @@ def make_instance(self, include_optional) -> NewReferralsForMultipleAdvocates: usage_limit = 1, campaign_id = 45, advocate_profile_integration_ids = [URNGV8294NV, DRPVV9476AF], - attributes = None, + attributes = {channel=web}, valid_characters = [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z], referral_pattern = 'REF-###-###' ) diff --git a/test/test_okta_event_payload.py b/test/test_okta_event_payload.py index 07cca67..bd578ba 100644 --- a/test/test_okta_event_payload.py +++ b/test/test_okta_event_payload.py @@ -35,31 +35,11 @@ def make_instance(self, include_optional) -> OktaEventPayload: model = OktaEventPayload() if include_optional: return OktaEventPayload( - data = talon_one.models.okta_event_payload_data.OktaEventPayloadData( - events = [ - talon_one.models.okta_event.OktaEvent( - event_type = 'application.user_membership.add', - target = [ - talon_one.models.okta_event_target.OktaEventTarget( - type = 'AppUser', - alternate_id = 'john.doe@example.com', - display_name = 'John Doe', ) - ], ) - ], ) + data = {"data":{"events":[{"eventType":"application.user_membership.add","target":[{"type":"AppUser","alternateId":"john.doe@example.com","displayName":"John Doe"}]}]}} ) else: return OktaEventPayload( - data = talon_one.models.okta_event_payload_data.OktaEventPayloadData( - events = [ - talon_one.models.okta_event.OktaEvent( - event_type = 'application.user_membership.add', - target = [ - talon_one.models.okta_event_target.OktaEventTarget( - type = 'AppUser', - alternate_id = 'john.doe@example.com', - display_name = 'John Doe', ) - ], ) - ], ), + data = {"data":{"events":[{"eventType":"application.user_membership.add","target":[{"type":"AppUser","alternateId":"john.doe@example.com","displayName":"John Doe"}]}]}}, ) """ diff --git a/test/test_outgoing_integration_configuration.py b/test/test_outgoing_integration_configuration.py index ad72268..aa28499 100644 --- a/test/test_outgoing_integration_configuration.py +++ b/test/test_outgoing_integration_configuration.py @@ -38,14 +38,14 @@ def make_instance(self, include_optional) -> OutgoingIntegrationConfiguration: id = 6, account_id = 3886, type_id = 12, - policy = None + policy = talon_one.models.outgoing_integration_configuration_policy.OutgoingIntegrationConfigurationPolicy() ) else: return OutgoingIntegrationConfiguration( id = 6, account_id = 3886, type_id = 12, - policy = None, + policy = talon_one.models.outgoing_integration_configuration_policy.OutgoingIntegrationConfigurationPolicy(), ) """ diff --git a/test/test_outgoing_integration_configuration_policy.py b/test/test_outgoing_integration_configuration_policy.py new file mode 100644 index 0000000..029d1b4 --- /dev/null +++ b/test/test_outgoing_integration_configuration_policy.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.outgoing_integration_configuration_policy import OutgoingIntegrationConfigurationPolicy + +class TestOutgoingIntegrationConfigurationPolicy(unittest.TestCase): + """OutgoingIntegrationConfigurationPolicy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> OutgoingIntegrationConfigurationPolicy: + """Test OutgoingIntegrationConfigurationPolicy + 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 `OutgoingIntegrationConfigurationPolicy` + """ + model = OutgoingIntegrationConfigurationPolicy() + if include_optional: + return OutgoingIntegrationConfigurationPolicy( + base_url = 'https://api.iterable.com', + api_key = '1234df4ba16940ca59c9352936d080a8', + account_id = 'A9X-7A6-4A6B', + passcode = 'ABB-BAF-AWZP', + app_id = 'LDUBEU9PLTPYXV30SMTYAAAA', + data_api_id = 'LDUBEU9PLTPYXV30SMTYAAAA', + data_api_key = 'R95crrAAdZ747QLXe8LwnGLX' + ) + else: + return OutgoingIntegrationConfigurationPolicy( + base_url = 'https://api.iterable.com', + api_key = '1234df4ba16940ca59c9352936d080a8', + account_id = 'A9X-7A6-4A6B', + passcode = 'ABB-BAF-AWZP', + app_id = 'LDUBEU9PLTPYXV30SMTYAAAA', + data_api_id = 'LDUBEU9PLTPYXV30SMTYAAAA', + data_api_key = 'R95crrAAdZ747QLXe8LwnGLX', + ) + """ + + def testOutgoingIntegrationConfigurationPolicy(self): + """Test OutgoingIntegrationConfigurationPolicy""" + # 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_outgoing_integration_template_with_configuration_details.py b/test/test_outgoing_integration_template_with_configuration_details.py index 8f8ce25..4abafb4 100644 --- a/test/test_outgoing_integration_template_with_configuration_details.py +++ b/test/test_outgoing_integration_template_with_configuration_details.py @@ -45,7 +45,7 @@ def make_instance(self, include_optional) -> OutgoingIntegrationTemplateWithConf method = 'POST', relative_url = '/campaigns/trigger/send', headers = [{"Content-Type": "application/json"}], - policy = None + policy = talon_one.models.outgoing_integration_configuration_policy.OutgoingIntegrationConfigurationPolicy() ) else: return OutgoingIntegrationTemplateWithConfigurationDetails( @@ -59,7 +59,7 @@ def make_instance(self, include_optional) -> OutgoingIntegrationTemplateWithConf method = 'POST', relative_url = '/campaigns/trigger/send', headers = [{"Content-Type": "application/json"}], - policy = None, + policy = talon_one.models.outgoing_integration_configuration_policy.OutgoingIntegrationConfigurationPolicy(), ) """ diff --git a/test/test_promotion_block.py b/test/test_promotion_block.py new file mode 100644 index 0000000..7f8b997 --- /dev/null +++ b/test/test_promotion_block.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.promotion_block import PromotionBlock + +class TestPromotionBlock(unittest.TestCase): + """PromotionBlock unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PromotionBlock: + """Test PromotionBlock + 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 `PromotionBlock` + """ + model = PromotionBlock() + if include_optional: + return PromotionBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + tags = [ + '' + ], + operator = 'setTo', + blocks = [ + null + ], + on_failure = [ + null + ], + on_error = { + 'key' : [ + null + ] + }, + expression = [ + null + ], + notification_type = 'Info', + title = 'You earned a reward!', + body = 'You saved $10 on your order.', + sku = 'SKU1241028', + name = 'Free Tote Bag', + quantity = '1', + partial = False, + giveaway_pool = talon_one.models.award_giveaway_block_1_giveaway_pool.AwardGiveawayBlock_1_giveawayPool( + id = 42, + name = 'Summer Campaign Pool', ), + profile = 'Current', + attribute = talon_one.models.update_attribute_value_block_1_attribute.UpdateAttributeValueBlock_1_attribute( + id = 100, + entity = 'profile', + name = 'City', + title = 'City', + type = 'string', ), + value = None, + min = None, + max = None, + values = None, + count = None, + audience = talon_one.models.update_audience_membership_block_1_audience.UpdateAudienceMembershipBlock_1_audience( + id = 42, + name = 'Travel audience', + integration = 'mparticle', + integration_id = '382370BKDB946', ), + redeem = True, + achievement = talon_one.models.update_achievement_progress_block_1_achievement.UpdateAchievementProgressBlock_1_achievement( + id = 42, + name = 'Order50Discount', + title = '50% off on 50th purchase.', + target = 50, ), + target = talon_one.models.update_attribute_value_block_1_target.UpdateAttributeValueBlock_1_target( + type = 'profile', ) + ) + else: + return PromotionBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + operator = 'setTo', + blocks = [ + null + ], + expression = [ + null + ], + notification_type = 'Info', + title = 'You earned a reward!', + sku = 'SKU1241028', + name = 'Free Tote Bag', + quantity = '1', + giveaway_pool = talon_one.models.award_giveaway_block_1_giveaway_pool.AwardGiveawayBlock_1_giveawayPool( + id = 42, + name = 'Summer Campaign Pool', ), + profile = 'Current', + attribute = talon_one.models.update_attribute_value_block_1_attribute.UpdateAttributeValueBlock_1_attribute( + id = 100, + entity = 'profile', + name = 'City', + title = 'City', + type = 'string', ), + value = None, + audience = talon_one.models.update_audience_membership_block_1_audience.UpdateAudienceMembershipBlock_1_audience( + id = 42, + name = 'Travel audience', + integration = 'mparticle', + integration_id = '382370BKDB946', ), + redeem = True, + achievement = talon_one.models.update_achievement_progress_block_1_achievement.UpdateAchievementProgressBlock_1_achievement( + id = 42, + name = 'Order50Discount', + title = '50% off on 50th purchase.', + target = 50, ), + target = talon_one.models.update_attribute_value_block_1_target.UpdateAttributeValueBlock_1_target( + type = 'profile', ), + ) + """ + + def testPromotionBlock(self): + """Test PromotionBlock""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_promotion_check_attribute_block.py b/test/test_promotion_check_attribute_block.py index e7efdb4..c808312 100644 --- a/test/test_promotion_check_attribute_block.py +++ b/test/test_promotion_check_attribute_block.py @@ -35,12 +35,28 @@ def make_instance(self, include_optional) -> PromotionCheckAttributeBlock: model = PromotionCheckAttributeBlock() if include_optional: return PromotionCheckAttributeBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + tags = [ + '' + ], + operator = 'greaterThan', + attribute = '$Session.Total', + value = None, + min = None, + max = None, + values = None, + count = None, on_failure = [ null ] ) else: return PromotionCheckAttributeBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + operator = 'greaterThan', + attribute = '$Session.Total', ) """ diff --git a/test/test_referral.py b/test/test_referral.py index f9e4799..0d808fd 100644 --- a/test/test_referral.py +++ b/test/test_referral.py @@ -43,7 +43,7 @@ def make_instance(self, include_optional) -> Referral: campaign_id = 78, advocate_profile_integration_id = 'URNGV8294NV', friend_profile_integration_id = 'BZGGC2454PA', - attributes = None, + attributes = {channel=web}, import_id = 4, code = '27G47Y54VH9L', usage_counter = 1, diff --git a/test/test_application_notification.py b/test/test_review_risks_request.py similarity index 69% rename from test/test_application_notification.py rename to test/test_review_risks_request.py index 95d1974..c872c01 100644 --- a/test/test_application_notification.py +++ b/test/test_review_risks_request.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.application_notification import ApplicationNotification +from talon_one.models.review_risks_request import ReviewRisksRequest -class TestApplicationNotification(unittest.TestCase): - """ApplicationNotification unit test stubs""" +class TestReviewRisksRequest(unittest.TestCase): + """ReviewRisksRequest unit test stubs""" def setUp(self): pass @@ -25,26 +25,26 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> ApplicationNotification: - """Test ApplicationNotification + def make_instance(self, include_optional) -> ReviewRisksRequest: + """Test ReviewRisksRequest 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 `ApplicationNotification` + # uncomment below to create an instance of `ReviewRisksRequest` """ - model = ApplicationNotification() + model = ReviewRisksRequest() if include_optional: - return ApplicationNotification( - event = '' + return ReviewRisksRequest( + risk_ids = [1,2,3] ) else: - return ApplicationNotification( - event = '', + return ReviewRisksRequest( + risk_ids = [1,2,3], ) """ - def testApplicationNotification(self): - """Test ApplicationNotification""" + def testReviewRisksRequest(self): + """Test ReviewRisksRequest""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_risk.py b/test/test_risk.py index d37db0b..9578491 100644 --- a/test/test_risk.py +++ b/test/test_risk.py @@ -49,6 +49,10 @@ def make_instance(self, include_optional) -> Risk: reported_date = '2026-06-05T06:26:13.698884Z', affected_entity_count = 4437, description = 'Unusual discount usage detected for 4437 customer profiles.', + discard_reason = 'expected_behavior', + status_comment = 'Investigated with the customer and fixed the loyalty rule.', + status_changed_by = 42, + status_changed_at = '2026-06-06T09:12:45.000000Z', modified = '2026-06-05T06:26:13.698884Z' ) else: diff --git a/test/test_scalar_check_attribute_block.py b/test/test_risk_criticality_update.py similarity index 67% rename from test/test_scalar_check_attribute_block.py rename to test/test_risk_criticality_update.py index 95c05e0..3bbd472 100644 --- a/test/test_scalar_check_attribute_block.py +++ b/test/test_risk_criticality_update.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.scalar_check_attribute_block import ScalarCheckAttributeBlock +from talon_one.models.risk_criticality_update import RiskCriticalityUpdate -class TestScalarCheckAttributeBlock(unittest.TestCase): - """ScalarCheckAttributeBlock unit test stubs""" +class TestRiskCriticalityUpdate(unittest.TestCase): + """RiskCriticalityUpdate unit test stubs""" def setUp(self): pass @@ -25,27 +25,28 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> ScalarCheckAttributeBlock: - """Test ScalarCheckAttributeBlock + def make_instance(self, include_optional) -> RiskCriticalityUpdate: + """Test RiskCriticalityUpdate 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 `ScalarCheckAttributeBlock` + # uncomment below to create an instance of `RiskCriticalityUpdate` """ - model = ScalarCheckAttributeBlock() + model = RiskCriticalityUpdate() if include_optional: - return ScalarCheckAttributeBlock( - operator = 'equals', - value = None + return RiskCriticalityUpdate( + risk_ids = [1,2,3], + criticality = 'not_critical' ) else: - return ScalarCheckAttributeBlock( - value = None, + return RiskCriticalityUpdate( + risk_ids = [1,2,3], + criticality = 'not_critical', ) """ - def testScalarCheckAttributeBlock(self): - """Test ScalarCheckAttributeBlock""" + def testRiskCriticalityUpdate(self): + """Test RiskCriticalityUpdate""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_risk_detail.py b/test/test_risk_detail.py index 60762f2..c3ba332 100644 --- a/test/test_risk_detail.py +++ b/test/test_risk_detail.py @@ -49,6 +49,10 @@ def make_instance(self, include_optional) -> RiskDetail: reported_date = '2026-06-05T06:26:13.698884Z', affected_entity_count = 4437, description = 'Unusual discount usage detected for 4437 customer profiles.', + discard_reason = 'expected_behavior', + status_comment = 'Investigated with the customer and fixed the loyalty rule.', + status_changed_by = 42, + status_changed_at = '2026-06-06T09:12:45.000000Z', modified = '2026-06-05T06:26:13.698884Z', affected_entities = [ talon_one.models.risk_affected_entity_item.RiskAffectedEntityItem( diff --git a/test/test_scim_service_provider_config_response.py b/test/test_scim_service_provider_config_response.py index 80ead34..72ec9c7 100644 --- a/test/test_scim_service_provider_config_response.py +++ b/test/test_scim_service_provider_config_response.py @@ -45,12 +45,12 @@ def make_instance(self, include_optional) -> ScimServiceProviderConfigResponse: filter = talon_one.models.scim_service_provider_config_response_filter.ScimServiceProviderConfigResponse_filter( max_results = 56, supported = True, ), - patch = talon_one.models.scim_service_provider_config_response_change_password.ScimServiceProviderConfigResponse_changePassword( + patch = talon_one.models.scim_service_provider_config_response_patch.ScimServiceProviderConfigResponse_patch( supported = True, ), schemas = [ '' ], - sort = talon_one.models.scim_service_provider_config_response_change_password.ScimServiceProviderConfigResponse_changePassword( + sort = talon_one.models.scim_service_provider_config_response_sort.ScimServiceProviderConfigResponse_sort( supported = True, ) ) else: diff --git a/test/test_scim_service_provider_config_response_patch.py b/test/test_scim_service_provider_config_response_patch.py new file mode 100644 index 0000000..50a826c --- /dev/null +++ b/test/test_scim_service_provider_config_response_patch.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.scim_service_provider_config_response_patch import ScimServiceProviderConfigResponsePatch + +class TestScimServiceProviderConfigResponsePatch(unittest.TestCase): + """ScimServiceProviderConfigResponsePatch unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScimServiceProviderConfigResponsePatch: + """Test ScimServiceProviderConfigResponsePatch + 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 `ScimServiceProviderConfigResponsePatch` + """ + model = ScimServiceProviderConfigResponsePatch() + if include_optional: + return ScimServiceProviderConfigResponsePatch( + supported = True + ) + else: + return ScimServiceProviderConfigResponsePatch( + ) + """ + + def testScimServiceProviderConfigResponsePatch(self): + """Test ScimServiceProviderConfigResponsePatch""" + # 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_scim_service_provider_config_response_sort.py b/test/test_scim_service_provider_config_response_sort.py new file mode 100644 index 0000000..7588e16 --- /dev/null +++ b/test/test_scim_service_provider_config_response_sort.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.scim_service_provider_config_response_sort import ScimServiceProviderConfigResponseSort + +class TestScimServiceProviderConfigResponseSort(unittest.TestCase): + """ScimServiceProviderConfigResponseSort unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScimServiceProviderConfigResponseSort: + """Test ScimServiceProviderConfigResponseSort + 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 `ScimServiceProviderConfigResponseSort` + """ + model = ScimServiceProviderConfigResponseSort() + if include_optional: + return ScimServiceProviderConfigResponseSort( + supported = True + ) + else: + return ScimServiceProviderConfigResponseSort( + ) + """ + + def testScimServiceProviderConfigResponseSort(self): + """Test ScimServiceProviderConfigResponseSort""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_strikethrough_block.py b/test/test_strikethrough_block.py new file mode 100644 index 0000000..a04aadb --- /dev/null +++ b/test/test_strikethrough_block.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.strikethrough_block import StrikethroughBlock + +class TestStrikethroughBlock(unittest.TestCase): + """StrikethroughBlock unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StrikethroughBlock: + """Test StrikethroughBlock + 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 `StrikethroughBlock` + """ + model = StrikethroughBlock() + if include_optional: + return StrikethroughBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + tags = [ + '' + ], + operator = 'greaterThan', + blocks = [ + null + ], + on_failure = [ + null + ], + on_error = { + 'key' : [ + null + ] + }, + expression = [ + null + ], + attribute = '$Session.Total', + value = None, + min = None, + max = None, + values = None, + count = None + ) + else: + return StrikethroughBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + operator = 'greaterThan', + blocks = [ + null + ], + expression = [ + null + ], + attribute = '$Session.Total', + ) + """ + + def testStrikethroughBlock(self): + """Test StrikethroughBlock""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_strikethrough_check_attribute_block.py b/test/test_strikethrough_check_attribute_block.py index f1d64b6..7c7b370 100644 --- a/test/test_strikethrough_check_attribute_block.py +++ b/test/test_strikethrough_check_attribute_block.py @@ -35,12 +35,28 @@ def make_instance(self, include_optional) -> StrikethroughCheckAttributeBlock: model = StrikethroughCheckAttributeBlock() if include_optional: return StrikethroughCheckAttributeBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + tags = [ + '' + ], + operator = 'greaterThan', + attribute = '$Session.Total', + value = None, + min = None, + max = None, + values = None, + count = None, on_failure = [ null ] ) else: return StrikethroughCheckAttributeBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + operator = 'greaterThan', + attribute = '$Session.Total', ) """ diff --git a/test/test_strikethrough_effect.py b/test/test_strikethrough_effect.py index 231fcad..370035a 100644 --- a/test/test_strikethrough_effect.py +++ b/test/test_strikethrough_effect.py @@ -40,7 +40,7 @@ def make_instance(self, include_optional) -> StrikethroughEffect: rule_index = 2, rule_name = 'Add 2 points', type = 'setDiscountPerItem', - props = talon_one.models.label_target.LabelTarget(), + props = talon_one.models.strikethrough_effect_props.StrikethroughEffectProps(), start_time = '2021-07-20T22:00:00Z', end_time = '2021-10-01T02:00:00Z', selected_price_type = 'member', @@ -57,7 +57,7 @@ def make_instance(self, include_optional) -> StrikethroughEffect: rule_index = 2, rule_name = 'Add 2 points', type = 'setDiscountPerItem', - props = talon_one.models.label_target.LabelTarget(), + props = talon_one.models.strikethrough_effect_props.StrikethroughEffectProps(), ) """ diff --git a/test/test_strikethrough_effect_props.py b/test/test_strikethrough_effect_props.py new file mode 100644 index 0000000..9bc63c2 --- /dev/null +++ b/test/test_strikethrough_effect_props.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.strikethrough_effect_props import StrikethroughEffectProps + +class TestStrikethroughEffectProps(unittest.TestCase): + """StrikethroughEffectProps unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StrikethroughEffectProps: + """Test StrikethroughEffectProps + 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 `StrikethroughEffectProps` + """ + model = StrikethroughEffectProps() + if include_optional: + return StrikethroughEffectProps( + name = '10% off members only', + value = None, + excluded_from_price_history = True, + effect_id = 1, + payload = talon_one.models.payload.payload() + ) + else: + return StrikethroughEffectProps( + name = '10% off members only', + value = None, + effect_id = 1, + payload = talon_one.models.payload.payload(), + ) + """ + + def testStrikethroughEffectProps(self): + """Test StrikethroughEffectProps""" + # 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 index 3dc192d..4de1b43 100644 --- a/test/test_support_request.py +++ b/test/test_support_request.py @@ -49,7 +49,8 @@ def make_instance(self, include_optional) -> SupportRequest: 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' + processed_by_user = 'admin.name@company.com', + coupon_code = 'SUMMER-2025-XYZ' ) else: return SupportRequest( diff --git a/test/test_update_achievement_progress_block.py b/test/test_update_achievement_progress_block.py new file mode 100644 index 0000000..01b6f9a --- /dev/null +++ b/test/test_update_achievement_progress_block.py @@ -0,0 +1,71 @@ +# 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_achievement_progress_block import UpdateAchievementProgressBlock + +class TestUpdateAchievementProgressBlock(unittest.TestCase): + """UpdateAchievementProgressBlock unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateAchievementProgressBlock: + """Test UpdateAchievementProgressBlock + 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 `UpdateAchievementProgressBlock` + """ + model = UpdateAchievementProgressBlock() + if include_optional: + return UpdateAchievementProgressBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + tags = [ + '' + ], + operator = 'increaseBy', + value = '10', + achievement = talon_one.models.update_achievement_progress_block_1_achievement.UpdateAchievementProgressBlock_1_achievement( + id = 42, + name = 'Order50Discount', + title = '50% off on 50th purchase.', + target = 50, ) + ) + else: + return UpdateAchievementProgressBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + operator = 'increaseBy', + value = '10', + achievement = talon_one.models.update_achievement_progress_block_1_achievement.UpdateAchievementProgressBlock_1_achievement( + id = 42, + name = 'Order50Discount', + title = '50% off on 50th purchase.', + target = 50, ), + ) + """ + + def testUpdateAchievementProgressBlock(self): + """Test UpdateAchievementProgressBlock""" + # 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_progress_block1_achievement.py b/test/test_update_achievement_progress_block1_achievement.py new file mode 100644 index 0000000..43adf36 --- /dev/null +++ b/test/test_update_achievement_progress_block1_achievement.py @@ -0,0 +1,58 @@ +# 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_achievement_progress_block1_achievement import UpdateAchievementProgressBlock1Achievement + +class TestUpdateAchievementProgressBlock1Achievement(unittest.TestCase): + """UpdateAchievementProgressBlock1Achievement unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateAchievementProgressBlock1Achievement: + """Test UpdateAchievementProgressBlock1Achievement + 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 `UpdateAchievementProgressBlock1Achievement` + """ + model = UpdateAchievementProgressBlock1Achievement() + if include_optional: + return UpdateAchievementProgressBlock1Achievement( + id = 42, + name = 'Order50Discount', + title = '50% off on 50th purchase.', + target = 50 + ) + else: + return UpdateAchievementProgressBlock1Achievement( + id = 42, + name = 'Order50Discount', + title = '50% off on 50th purchase.', + target = 50, + ) + """ + + def testUpdateAchievementProgressBlock1Achievement(self): + """Test UpdateAchievementProgressBlock1Achievement""" + # 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_attribute_value_block.py b/test/test_update_attribute_value_block.py new file mode 100644 index 0000000..6a6b3f4 --- /dev/null +++ b/test/test_update_attribute_value_block.py @@ -0,0 +1,76 @@ +# 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_attribute_value_block import UpdateAttributeValueBlock + +class TestUpdateAttributeValueBlock(unittest.TestCase): + """UpdateAttributeValueBlock unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateAttributeValueBlock: + """Test UpdateAttributeValueBlock + 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 `UpdateAttributeValueBlock` + """ + model = UpdateAttributeValueBlock() + if include_optional: + return UpdateAttributeValueBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + tags = [ + '' + ], + operator = 'setTo', + attribute = talon_one.models.update_attribute_value_block_1_attribute.UpdateAttributeValueBlock_1_attribute( + id = 100, + entity = 'profile', + name = 'City', + title = 'City', + type = 'string', ), + value = None, + target = talon_one.models.update_attribute_value_block_1_target.UpdateAttributeValueBlock_1_target( + type = 'profile', ) + ) + else: + return UpdateAttributeValueBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + operator = 'setTo', + attribute = talon_one.models.update_attribute_value_block_1_attribute.UpdateAttributeValueBlock_1_attribute( + id = 100, + entity = 'profile', + name = 'City', + title = 'City', + type = 'string', ), + target = talon_one.models.update_attribute_value_block_1_target.UpdateAttributeValueBlock_1_target( + type = 'profile', ), + ) + """ + + def testUpdateAttributeValueBlock(self): + """Test UpdateAttributeValueBlock""" + # 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_attribute_value_block1_attribute.py b/test/test_update_attribute_value_block1_attribute.py new file mode 100644 index 0000000..58f9ee3 --- /dev/null +++ b/test/test_update_attribute_value_block1_attribute.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.update_attribute_value_block1_attribute import UpdateAttributeValueBlock1Attribute + +class TestUpdateAttributeValueBlock1Attribute(unittest.TestCase): + """UpdateAttributeValueBlock1Attribute unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateAttributeValueBlock1Attribute: + """Test UpdateAttributeValueBlock1Attribute + 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 `UpdateAttributeValueBlock1Attribute` + """ + model = UpdateAttributeValueBlock1Attribute() + if include_optional: + return UpdateAttributeValueBlock1Attribute( + id = 100, + entity = 'profile', + name = 'City', + title = 'City', + type = 'string' + ) + else: + return UpdateAttributeValueBlock1Attribute( + id = 100, + entity = 'profile', + name = 'City', + title = 'City', + type = 'string', + ) + """ + + def testUpdateAttributeValueBlock1Attribute(self): + """Test UpdateAttributeValueBlock1Attribute""" + # 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_list_check_attribute_block.py b/test/test_update_attribute_value_block1_target.py similarity index 66% rename from test/test_list_check_attribute_block.py rename to test/test_update_attribute_value_block1_target.py index 96a5154..0c3143e 100644 --- a/test/test_list_check_attribute_block.py +++ b/test/test_update_attribute_value_block1_target.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.list_check_attribute_block import ListCheckAttributeBlock +from talon_one.models.update_attribute_value_block1_target import UpdateAttributeValueBlock1Target -class TestListCheckAttributeBlock(unittest.TestCase): - """ListCheckAttributeBlock unit test stubs""" +class TestUpdateAttributeValueBlock1Target(unittest.TestCase): + """UpdateAttributeValueBlock1Target unit test stubs""" def setUp(self): pass @@ -25,27 +25,26 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> ListCheckAttributeBlock: - """Test ListCheckAttributeBlock + def make_instance(self, include_optional) -> UpdateAttributeValueBlock1Target: + """Test UpdateAttributeValueBlock1Target 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 `ListCheckAttributeBlock` + # uncomment below to create an instance of `UpdateAttributeValueBlock1Target` """ - model = ListCheckAttributeBlock() + model = UpdateAttributeValueBlock1Target() if include_optional: - return ListCheckAttributeBlock( - operator = 'containsOneOf', - values = None + return UpdateAttributeValueBlock1Target( + type = 'profile' ) else: - return ListCheckAttributeBlock( - values = None, + return UpdateAttributeValueBlock1Target( + type = 'profile', ) """ - def testListCheckAttributeBlock(self): - """Test ListCheckAttributeBlock""" + def testUpdateAttributeValueBlock1Target(self): + """Test UpdateAttributeValueBlock1Target""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_update_audience_membership_block.py b/test/test_update_audience_membership_block.py new file mode 100644 index 0000000..242ce12 --- /dev/null +++ b/test/test_update_audience_membership_block.py @@ -0,0 +1,71 @@ +# 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_audience_membership_block import UpdateAudienceMembershipBlock + +class TestUpdateAudienceMembershipBlock(unittest.TestCase): + """UpdateAudienceMembershipBlock unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateAudienceMembershipBlock: + """Test UpdateAudienceMembershipBlock + 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 `UpdateAudienceMembershipBlock` + """ + model = UpdateAudienceMembershipBlock() + if include_optional: + return UpdateAudienceMembershipBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + tags = [ + '' + ], + operator = 'add', + profile = 'Current', + audience = talon_one.models.update_audience_membership_block_1_audience.UpdateAudienceMembershipBlock_1_audience( + id = 42, + name = 'Travel audience', + integration = 'mparticle', + integration_id = '382370BKDB946', ) + ) + else: + return UpdateAudienceMembershipBlock( + id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + type = '', + operator = 'add', + profile = 'Current', + audience = talon_one.models.update_audience_membership_block_1_audience.UpdateAudienceMembershipBlock_1_audience( + id = 42, + name = 'Travel audience', + integration = 'mparticle', + integration_id = '382370BKDB946', ), + ) + """ + + def testUpdateAudienceMembershipBlock(self): + """Test UpdateAudienceMembershipBlock""" + # 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_audience_membership_block1_audience.py b/test/test_update_audience_membership_block1_audience.py new file mode 100644 index 0000000..43182e1 --- /dev/null +++ b/test/test_update_audience_membership_block1_audience.py @@ -0,0 +1,56 @@ +# 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_audience_membership_block1_audience import UpdateAudienceMembershipBlock1Audience + +class TestUpdateAudienceMembershipBlock1Audience(unittest.TestCase): + """UpdateAudienceMembershipBlock1Audience unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateAudienceMembershipBlock1Audience: + """Test UpdateAudienceMembershipBlock1Audience + 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 `UpdateAudienceMembershipBlock1Audience` + """ + model = UpdateAudienceMembershipBlock1Audience() + if include_optional: + return UpdateAudienceMembershipBlock1Audience( + id = 42, + name = 'Travel audience', + integration = 'mparticle', + integration_id = '382370BKDB946' + ) + else: + return UpdateAudienceMembershipBlock1Audience( + id = 42, + name = 'Travel audience', + ) + """ + + def testUpdateAudienceMembershipBlock1Audience(self): + """Test UpdateAudienceMembershipBlock1Audience""" + # 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_customer_profile_v2409_response.py b/test/test_update_customer_profile_v2409_response.py new file mode 100644 index 0000000..bbf714c --- /dev/null +++ b/test/test_update_customer_profile_v2409_response.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.update_customer_profile_v2409_response import UpdateCustomerProfileV2409Response + +class TestUpdateCustomerProfileV2409Response(unittest.TestCase): + """UpdateCustomerProfileV2409Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateCustomerProfileV2409Response: + """Test UpdateCustomerProfileV2409Response + 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 `UpdateCustomerProfileV2409Response` + """ + model = UpdateCustomerProfileV2409Response() + if include_optional: + return UpdateCustomerProfileV2409Response( + message = 'Too many requests are updating this profile at the same time', + errors = [ + null + ], + status_code = 409 + ) + else: + return UpdateCustomerProfileV2409Response( + ) + """ + + def testUpdateCustomerProfileV2409Response(self): + """Test UpdateCustomerProfileV2409Response""" + # 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_user.py b/test/test_user.py index 91824d7..f8b3270 100644 --- a/test/test_user.py +++ b/test/test_user.py @@ -47,11 +47,11 @@ def make_instance(self, include_optional) -> User: policy = {Role=127}, roles = [71], auth_method = 'basic_auth', - application_notification_subscriptions = None, + application_notification_subscriptions = {}, last_signed_in = '2021-09-12T10:12:42Z', last_accessed = '2021-09-12T10:14:42Z', latest_feed_timestamp = '2020-06-01T00:00:00Z', - additional_attributes = None + additional_attributes = {} ) else: return User( diff --git a/test/test_webhook_authentication_all_of_data.py b/test/test_webhook_authentication_all_of_data.py new file mode 100644 index 0000000..adbdac8 --- /dev/null +++ b/test/test_webhook_authentication_all_of_data.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.webhook_authentication_all_of_data import WebhookAuthenticationAllOfData + +class TestWebhookAuthenticationAllOfData(unittest.TestCase): + """WebhookAuthenticationAllOfData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebhookAuthenticationAllOfData: + """Test WebhookAuthenticationAllOfData + 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 `WebhookAuthenticationAllOfData` + """ + model = WebhookAuthenticationAllOfData() + if include_optional: + return WebhookAuthenticationAllOfData( + username = '', + password = '', + headers = { + 'key' : '' + } + ) + else: + return WebhookAuthenticationAllOfData( + username = '', + password = '', + headers = { + 'key' : '' + }, + ) + """ + + def testWebhookAuthenticationAllOfData(self): + """Test WebhookAuthenticationAllOfData""" + # 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_webhook_authentication_base.py b/test/test_webhook_authentication_base.py new file mode 100644 index 0000000..6dc9aba --- /dev/null +++ b/test/test_webhook_authentication_base.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.webhook_authentication_base import WebhookAuthenticationBase + +class TestWebhookAuthenticationBase(unittest.TestCase): + """WebhookAuthenticationBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebhookAuthenticationBase: + """Test WebhookAuthenticationBase + 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 `WebhookAuthenticationBase` + """ + model = WebhookAuthenticationBase() + if include_optional: + return WebhookAuthenticationBase( + name = 'My basic auth', + type = None, + data = talon_one.models.webhook_authentication_data_custom.WebhookAuthenticationDataCustom( + headers = { + 'key' : '' + }, ) + ) + else: + return WebhookAuthenticationBase( + name = 'My basic auth', + type = None, + data = talon_one.models.webhook_authentication_data_custom.WebhookAuthenticationDataCustom( + headers = { + 'key' : '' + }, ), + ) + """ + + def testWebhookAuthenticationBase(self): + """Test WebhookAuthenticationBase""" + # 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_webhook_authentication_base_one_of.py b/test/test_webhook_authentication_base_one_of.py new file mode 100644 index 0000000..687234e --- /dev/null +++ b/test/test_webhook_authentication_base_one_of.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.webhook_authentication_base_one_of import WebhookAuthenticationBaseOneOf + +class TestWebhookAuthenticationBaseOneOf(unittest.TestCase): + """WebhookAuthenticationBaseOneOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebhookAuthenticationBaseOneOf: + """Test WebhookAuthenticationBaseOneOf + 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 `WebhookAuthenticationBaseOneOf` + """ + model = WebhookAuthenticationBaseOneOf() + if include_optional: + return WebhookAuthenticationBaseOneOf( + name = 'My basic auth', + type = None, + data = talon_one.models.webhook_authentication_data_basic.WebhookAuthenticationDataBasic( + username = '', + password = '', ) + ) + else: + return WebhookAuthenticationBaseOneOf( + ) + """ + + def testWebhookAuthenticationBaseOneOf(self): + """Test WebhookAuthenticationBaseOneOf""" + # 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_webhook_authentication_base_one_of1.py b/test/test_webhook_authentication_base_one_of1.py new file mode 100644 index 0000000..5debddd --- /dev/null +++ b/test/test_webhook_authentication_base_one_of1.py @@ -0,0 +1,56 @@ +# 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.webhook_authentication_base_one_of1 import WebhookAuthenticationBaseOneOf1 + +class TestWebhookAuthenticationBaseOneOf1(unittest.TestCase): + """WebhookAuthenticationBaseOneOf1 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebhookAuthenticationBaseOneOf1: + """Test WebhookAuthenticationBaseOneOf1 + 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 `WebhookAuthenticationBaseOneOf1` + """ + model = WebhookAuthenticationBaseOneOf1() + if include_optional: + return WebhookAuthenticationBaseOneOf1( + name = 'My basic auth', + type = None, + data = talon_one.models.webhook_authentication_data_custom.WebhookAuthenticationDataCustom( + headers = { + 'key' : '' + }, ) + ) + else: + return WebhookAuthenticationBaseOneOf1( + ) + """ + + def testWebhookAuthenticationBaseOneOf1(self): + """Test WebhookAuthenticationBaseOneOf1""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()