From d487643fdcfefef0837cdf7a99926e4e92050c09 Mon Sep 17 00:00:00 2001 From: Talon-One SDK Generator Date: Wed, 10 Jun 2026 08:30:57 +0000 Subject: [PATCH] update to 26.12.0 --- .openapi-generator/FILES | 27 +- .openapi-generator/VERSION | 2 +- README.md | 12 +- docs/AcceptCouponEffectProps.md | 2 +- docs/AcceptReferralEffectProps.md | 4 +- docs/AchievementAdditionalPropertiesV2.md | 3 +- docs/AchievementReference.md | 1 + docs/AchievementV2.md | 3 +- docs/AddFreeItemEffectProps.md | 4 +- docs/AddLoyaltyPointsEffectProps.md | 26 +- docs/AddToAudienceEffectProps.md | 2 +- docs/ApplicationEvent.md | 2 +- docs/ApplicationSession.md | 2 +- docs/AwardGiveawayEffectProps.md | 12 +- docs/CampaignEligibility.md | 1 + docs/CampaignEligibilityExperiment.md | 31 + docs/Change.md | 4 +- docs/ChangeLoyaltyTierLevelEffectProps.md | 6 +- docs/CouponCreatedEffectProps.md | 2 +- docs/CouponCreationJob.md | 2 +- docs/CustomEffectProps.md | 2 +- docs/CustomerSession.md | 2 +- docs/DeductLoyaltyPointsEffectProps.md | 12 +- docs/ErrorEffectProps.md | 2 +- docs/Event.md | 2 +- docs/EventV3.md | 2 +- docs/ExperimentConfidenceTimeline.md | 29 + docs/ExperimentConfidenceTimelineDataPoint.md | 30 + docs/Export.md | 2 +- ...xtendLoyaltyPointsExpiryDateEffectProps.md | 4 +- docs/Giveaway.md | 2 +- .../IncreaseAchievementProgressEffectProps.md | 6 +- docs/IntegrationApi.md | 201 +++++- docs/IntegrationEvent.md | 2 +- ...HubEventPayloadCouponBasedNotifications.md | 2 +- ...tPayloadLoyaltyProfileBasedNotification.md | 44 -- docs/IntegrationHubEventRecord.md | 20 +- docs/IntegrationHubEventType.md | 21 + docs/IntegrationHubFlow.md | 5 +- docs/IntegrationHubFlowResponse.md | 7 +- docs/IntegrationHubFlowWithConfig.md | 5 +- docs/IntegrationHubPaginatedEventPayload.md | 2 +- docs/InventoryReferral.md | 2 +- docs/ManagementApi.md | 141 +++- docs/NewCouponCreationJob.md | 2 +- docs/NewCoupons.md | 2 +- docs/NewCouponsForMultipleRecipients.md | 2 +- docs/NewCustomerSession.md | 2 +- docs/NewEvent.md | 2 +- docs/NewReferral.md | 2 +- docs/NewReferralsForMultipleAdvocates.md | 2 +- docs/RedeemReferralEffectProps.md | 2 +- docs/Referral.md | 2 +- docs/ReferralCreatedEffectProps.md | 4 +- docs/RejectCouponEffectProps.md | 6 +- docs/RejectReferralEffectProps.md | 8 +- docs/RemoveFromAudienceEffectProps.md | 2 +- docs/ReserveCouponEffectProps.md | 6 +- docs/RoleV2ApplicationDetails.md | 1 - docs/RoleV2Permissions.md | 1 + docs/RolesV2Thresholds.md | 1 + docs/RollbackAddedLoyaltyPointsEffectProps.md | 16 +- docs/RollbackCouponEffectProps.md | 4 +- ...ollbackDeductedLoyaltyPointsEffectProps.md | 12 +- docs/RollbackDiscountEffectProps.md | 16 +- ...IncreasedAchievementProgressEffectProps.md | 4 +- docs/RollbackReferralEffectProps.md | 4 +- docs/ScimServiceProviderConfigResponse.md | 4 +- .../ScimServiceProviderConfigResponsePatch.md | 30 - docs/ScimServiceProviderConfigResponseSort.md | 30 - docs/SetDiscountEffectProps.md | 10 +- ...SetDiscountPerAdditionalCostEffectProps.md | 12 +- ...ountPerAdditionalCostPerItemEffectProps.md | 16 +- docs/SetDiscountPerItemEffectProps.md | 26 +- docs/SetLoyaltyPointsExpiryDateEffectProps.md | 2 +- docs/ShowBundleMetadataEffectProps.md | 2 +- docs/ShowNotificationEffectProps.md | 8 +- docs/TemplateArgDef.md | 2 +- docs/TriggerWebhookEffectProps.md | 6 +- docs/UpdateAttributeEffectProps.md | 4 +- docs/UpdateCoupon.md | 2 +- docs/UpdateCouponBatch.md | 2 +- docs/UpdateCustomerProfileV2409Response.md | 31 - docs/UpdateRiskNotification.md | 33 + docs/User.md | 4 +- docs/WillAwardGiveawayEffectProps.md | 8 +- pyproject.toml | 2 +- setup.py | 2 +- talon_one/__init__.py | 20 +- talon_one/api/integration_api.py | 646 +++++++++++++++++- talon_one/api/management_api.py | 404 ++++++++++- talon_one/api_client.py | 2 +- talon_one/configuration.py | 2 +- talon_one/models/__init__.py | 9 +- .../models/accept_coupon_effect_props.py | 2 +- .../models/accept_referral_effect_props.py | 4 +- talon_one/models/access_log_entry.py | 14 +- talon_one/models/account.py | 6 +- talon_one/models/account_additional_cost.py | 16 +- talon_one/models/account_analytics.py | 38 +- talon_one/models/account_entity.py | 2 +- talon_one/models/achievement.py | 32 +- .../achievement_additional_properties.py | 8 +- .../achievement_additional_properties_v2.py | 18 +- talon_one/models/achievement_base.py | 20 +- talon_one/models/achievement_base_v2.py | 22 +- talon_one/models/achievement_progress.py | 10 +- .../achievement_progress_with_definition.py | 32 +- talon_one/models/achievement_reference.py | 14 +- talon_one/models/achievement_status_entry.py | 28 +- talon_one/models/achievement_v2.py | 48 +- talon_one/models/activate_loyalty_points.py | 4 +- talon_one/models/activate_user_request.py | 2 +- .../models/add_free_item_effect_props.py | 6 +- talon_one/models/add_item_catalog_action.py | 8 +- talon_one/models/add_loyalty_points.py | 16 +- .../models/add_loyalty_points_effect_props.py | 28 +- .../add_price_adjustment_catalog_action.py | 2 +- .../models/add_to_audience_effect_props.py | 10 +- .../added_deducted_points_balances_action.py | 8 +- ...d_deducted_points_balances_notification.py | 14 +- ...ted_points_balances_notification_policy.py | 2 +- .../added_deducted_points_notification.py | 20 +- ...ded_deducted_points_notification_policy.py | 2 +- .../models/additional_campaign_properties.py | 48 +- talon_one/models/additional_cost.py | 4 +- talon_one/models/adjustment_details.py | 4 +- talon_one/models/analytics_data_point.py | 6 +- .../models/analytics_data_point_with_trend.py | 6 +- ...ta_point_with_trend_and_influenced_rate.py | 6 +- ...lytics_data_point_with_trend_and_uplift.py | 8 +- talon_one/models/analytics_product.py | 6 +- talon_one/models/analytics_sku.py | 10 +- talon_one/models/application.py | 36 +- .../application_analytics_data_point.py | 8 +- talon_one/models/application_api_health.py | 2 +- talon_one/models/application_api_key.py | 20 +- .../models/application_campaign_analytics.py | 12 +- talon_one/models/application_cif.py | 16 +- .../models/application_cif_expression.py | 12 +- .../models/application_cif_references.py | 2 +- talon_one/models/application_customer.py | 16 +- .../models/application_customer_entity.py | 2 +- talon_one/models/application_entity.py | 2 +- talon_one/models/application_event.py | 14 +- talon_one/models/application_referee.py | 2 +- talon_one/models/application_session.py | 26 +- .../models/application_session_entity.py | 2 +- .../models/async_coupon_creation_response.py | 2 +- .../async_coupon_deletion_job_response.py | 2 +- talon_one/models/async_coupons_data.py | 8 +- talon_one/models/attribute.py | 32 +- talon_one/models/audience.py | 22 +- talon_one/models/audience_analytics.py | 4 +- talon_one/models/audience_customer.py | 22 +- talon_one/models/audience_integration_id.py | 2 +- talon_one/models/audience_membership.py | 4 +- talon_one/models/audience_reference.py | 2 +- .../models/award_giveaway_effect_props.py | 12 +- talon_one/models/base_campaign.py | 24 +- talon_one/models/base_loyalty_program.py | 20 +- talon_one/models/base_notification.py | 4 +- talon_one/models/base_notification_webhook.py | 10 +- talon_one/models/base_saml_connection.py | 2 +- talon_one/models/best_prior_price.py | 12 +- talon_one/models/best_prior_price_request.py | 8 +- talon_one/models/best_prior_target.py | 4 +- talon_one/models/binding.py | 16 +- talon_one/models/blueprint.py | 2 +- .../models/bulk_application_notification.py | 2 +- .../models/bulk_operation_on_campaigns.py | 4 +- talon_one/models/campaign.py | 94 +-- .../models/campaign_activation_request.py | 2 +- talon_one/models/campaign_analytics.py | 16 +- talon_one/models/campaign_budget.py | 6 +- talon_one/models/campaign_collection.py | 22 +- ...campaign_collection_edited_notification.py | 2 +- ...ign_collection_edited_notification_item.py | 2 +- .../campaign_collection_without_payload.py | 20 +- talon_one/models/campaign_copy.py | 14 +- .../models/campaign_created_notification.py | 2 +- .../campaign_created_notification_item.py | 2 +- .../models/campaign_deactivation_request.py | 2 +- .../models/campaign_deleted_notification.py | 2 +- .../campaign_deleted_notification_item.py | 4 +- talon_one/models/campaign_detail.py | 4 +- .../models/campaign_edited_notification.py | 2 +- .../campaign_edited_notification_item.py | 2 +- talon_one/models/campaign_eligibility.py | 28 +- ....py => campaign_eligibility_experiment.py} | 24 +- talon_one/models/campaign_entity.py | 2 +- talon_one/models/campaign_evaluation_group.py | 12 +- .../models/campaign_evaluation_position.py | 6 +- ...ampaign_evaluation_tree_changed_message.py | 2 +- ...gn_evaluation_tree_changed_notification.py | 2 +- talon_one/models/campaign_group.py | 16 +- talon_one/models/campaign_log_summary.py | 8 +- .../models/campaign_notification_base.py | 2 +- .../models/campaign_notification_generic.py | 2 +- .../models/campaign_notification_item_base.py | 2 +- .../models/campaign_notification_policy.py | 6 +- .../campaign_ruleset_changed_notification.py | 2 +- ...paign_ruleset_changed_notification_item.py | 2 +- talon_one/models/campaign_set.py | 8 +- talon_one/models/campaign_set_branch_node.py | 6 +- talon_one/models/campaign_set_node.py | 4 +- .../campaign_state_changed_notification.py | 2 +- ...ampaign_state_changed_notification_item.py | 6 +- talon_one/models/campaign_store_budget.py | 6 +- .../campaign_store_budget_limit_config.py | 8 +- talon_one/models/campaign_template.py | 36 +- .../models/campaign_template_collection.py | 4 +- ...gn_template_coupon_reservation_settings.py | 4 +- talon_one/models/campaign_template_params.py | 8 +- talon_one/models/campaign_versions.py | 14 +- ...d_deducted_points_balances_notification.py | 18 +- ...ted_points_balances_notification_policy.py | 2 +- ...card_added_deducted_points_notification.py | 24 +- ...ded_deducted_points_notification_policy.py | 2 +- ...ard_expiring_points_notification_policy.py | 6 +- ...ard_ledger_points_entry_integration_api.py | 24 +- .../card_ledger_transaction_log_entry.py | 28 +- ...r_transaction_log_entry_integration_api.py | 30 +- talon_one/models/cart_item.py | 30 +- talon_one/models/cart_item_filter_template.py | 4 +- talon_one/models/catalog.py | 18 +- talon_one/models/catalog_action.py | 2 +- talon_one/models/catalog_item.py | 12 +- talon_one/models/catalog_rule.py | 6 +- talon_one/models/catalog_sync_request.py | 2 +- ...alogs_strikethrough_notification_policy.py | 4 +- talon_one/models/change.py | 16 +- .../change_loyalty_tier_level_effect_props.py | 6 +- talon_one/models/change_profile_password.py | 4 +- talon_one/models/code_generator_settings.py | 4 +- talon_one/models/collection.py | 24 +- .../models/collection_without_payload.py | 22 +- talon_one/models/coupon.py | 40 +- talon_one/models/coupon_constraints.py | 10 +- .../models/coupon_created_effect_props.py | 2 +- talon_one/models/coupon_creation_job.py | 44 +- talon_one/models/coupon_deletion_job.py | 20 +- talon_one/models/coupon_entity.py | 4 +- talon_one/models/coupon_failure_summary.py | 20 +- talon_one/models/coupon_rejection_reason.py | 6 +- talon_one/models/coupon_reservations.py | 2 +- talon_one/models/coupon_value.py | 2 +- talon_one/models/coupon_with_application.py | 44 +- talon_one/models/coupons_notification_data.py | 10 +- .../models/coupons_notification_policy.py | 8 +- talon_one/models/create_achievement.py | 20 +- talon_one/models/create_achievement_v2.py | 26 +- .../models/create_application_api_key.py | 10 +- talon_one/models/create_coupon_data.py | 12 +- .../models/create_coupons200_response.py | 2 +- talon_one/models/create_management_key.py | 6 +- talon_one/models/create_mcp_key.py | 4 +- ...rals_for_multiple_advocates201_response.py | 2 +- talon_one/models/create_template_campaign.py | 14 +- talon_one/models/custom_effect.py | 12 +- talon_one/models/custom_effect_props.py | 14 +- talon_one/models/customer_activity_report.py | 4 +- talon_one/models/customer_profile.py | 18 +- .../customer_profile_audience_request_item.py | 6 +- talon_one/models/customer_profile_entity.py | 4 +- ...customer_profile_integration_request_v2.py | 6 +- talon_one/models/customer_session.py | 22 +- talon_one/models/customer_session_v2.py | 42 +- talon_one/models/deactivate_user_request.py | 2 +- talon_one/models/deduct_loyalty_points.py | 8 +- .../deduct_loyalty_points_effect_props.py | 12 +- .../delete_loyalty_transactions_request.py | 4 +- talon_one/models/delete_user_request.py | 2 +- talon_one/models/effect.py | 32 +- talon_one/models/effect_entity.py | 32 +- talon_one/models/email_entity.py | 2 +- .../embedded_dashboard_configuration.py | 4 +- talon_one/models/endpoint.py | 2 +- talon_one/models/entity.py | 4 +- .../models/entity_with_talang_visible_id.py | 4 +- talon_one/models/environment.py | 6 +- talon_one/models/error_effect_props.py | 2 +- talon_one/models/evaluable_campaign_ids.py | 2 +- talon_one/models/event.py | 18 +- talon_one/models/event_attributes_entity.py | 4 +- talon_one/models/event_type.py | 10 +- talon_one/models/event_v2.py | 10 +- talon_one/models/event_v3.py | 18 +- talon_one/models/event_v3_connections.py | 2 +- talon_one/models/event_v3_entity.py | 2 +- talon_one/models/event_v3_request_entity.py | 14 +- talon_one/models/experiment.py | 10 +- talon_one/models/experiment_campaign_copy.py | 12 +- ...t.py => experiment_confidence_timeline.py} | 26 +- ...eriment_confidence_timeline_data_point.py} | 25 +- talon_one/models/experiment_result.py | 2 +- .../models/experiment_segment_insight.py | 8 +- .../experiment_segment_insight_metric.py | 2 +- .../experiment_segment_insight_variant.py | 8 +- .../models/experiment_segment_insights.py | 6 +- talon_one/models/experiment_variant.py | 12 +- .../models/experiment_variant_allocation.py | 4 +- talon_one/models/experiment_variant_result.py | 22 +- .../experiment_variant_result_confidence.py | 6 +- talon_one/models/expiring_card_points_data.py | 10 +- .../expiring_card_points_notification.py | 2 +- talon_one/models/expiring_coupons_data.py | 18 +- .../models/expiring_coupons_notification.py | 2 +- .../expiring_coupons_notification_policy.py | 6 +- talon_one/models/expiring_points_data.py | 8 +- .../models/expiring_points_notification.py | 2 +- .../expiring_points_notification_policy.py | 6 +- talon_one/models/export.py | 10 +- ...loyalty_points_expiry_date_effect_props.py | 6 +- talon_one/models/extended_coupon.py | 40 +- talon_one/models/feature_flag.py | 8 +- talon_one/models/feature_flag_update.py | 4 +- ...enerate_coupon_failure_detailed_summary.py | 6 +- .../models/generate_coupon_failure_summary.py | 2 +- .../generate_item_filter_description.py | 2 +- talon_one/models/generate_loyalty_card.py | 6 +- talon_one/models/generate_rule_title_rule.py | 4 +- .../get_additional_costs200_response.py | 2 +- ...pplication_customer_friends200_response.py | 2 +- .../get_application_customers200_response.py | 2 +- ...get_application_event_types200_response.py | 2 +- .../models/get_applications200_response.py | 2 +- .../models/get_attributes200_response.py | 2 +- talon_one/models/get_audiences200_response.py | 2 +- .../get_campaign_analytics200_response.py | 2 +- .../models/get_campaign_groups200_response.py | 2 +- .../get_campaign_templates200_response.py | 2 +- talon_one/models/get_campaigns200_response.py | 2 +- talon_one/models/get_changes200_response.py | 2 +- ...coupons_without_total_count200_response.py | 2 +- ...ustomer_achievement_history200_response.py | 2 +- .../get_customer_achievements200_response.py | 2 +- ...rofile_achievement_progress200_response.py | 2 +- .../get_dashboard_statistics200_response.py | 2 +- .../models/get_event_types200_response.py | 2 +- talon_one/models/get_exports200_response.py | 2 +- .../models/get_integration_coupon_request.py | 2 +- .../get_loyalty_card_points200_response.py | 2 +- ...yalty_card_transaction_logs200_response.py | 2 +- ...t_loyalty_card_transactions200_response.py | 2 +- .../models/get_loyalty_cards200_response.py | 2 +- ...alty_program_profile_points200_response.py | 2 +- ...rogram_profile_transactions200_response.py | 2 +- ...oyalty_program_transactions200_response.py | 2 +- .../get_loyalty_programs200_response.py | 2 +- ...ferrals_without_total_count200_response.py | 2 +- .../get_reserved_customers200_response.py | 2 +- talon_one/models/get_rulesets200_response.py | 2 +- talon_one/models/get_users200_response.py | 2 +- talon_one/models/get_webhooks200_response.py | 2 +- talon_one/models/giveaway.py | 22 +- .../models/giveaway_pool_notification.py | 2 +- .../models/giveaway_pool_notification_data.py | 20 +- talon_one/models/giveaways_pool.py | 14 +- talon_one/models/hidden_conditions_effects.py | 8 +- talon_one/models/history.py | 10 +- talon_one/models/identifiable_entity.py | 2 +- talon_one/models/import_entity.py | 2 +- ...rease_achievement_progress_effect_props.py | 10 +- talon_one/models/integration_campaign.py | 18 +- talon_one/models/integration_campaign_base.py | 18 +- talon_one/models/integration_coupon.py | 42 +- ..._customer_profile_audience_request_item.py | 6 +- talon_one/models/integration_entity.py | 4 +- talon_one/models/integration_event.py | 8 +- .../models/integration_event_v2_request.py | 14 +- .../models/integration_event_v3_request.py | 18 +- talon_one/models/integration_hub_config.py | 4 +- ...vent_payload_coupon_based_notifications.py | 2 +- ...load_loyalty_profile_based_notification.py | 127 ---- .../models/integration_hub_event_record.py | 48 +- .../integration_hub_event_status_update.py | 2 +- .../models/integration_hub_event_type.py | 41 ++ talon_one/models/integration_hub_flow.py | 9 +- .../models/integration_hub_flow_response.py | 40 +- .../integration_hub_flow_with_config.py | 9 +- ...integration_hub_paginated_event_payload.py | 12 +- .../models/integration_profile_entity.py | 2 +- .../models/integration_profile_entity_v3.py | 2 +- talon_one/models/integration_request.py | 2 +- talon_one/models/integration_store_entity.py | 2 +- talon_one/models/inventory_coupon.py | 44 +- talon_one/models/inventory_referral.py | 26 +- talon_one/models/item_attribute.py | 2 +- talon_one/models/ledger_entry.py | 16 +- talon_one/models/ledger_info.py | 20 +- .../ledger_points_entry_integration_api.py | 22 +- ...r_transaction_log_entry_integration_api.py | 28 +- talon_one/models/limit_config.py | 8 +- talon_one/models/limit_counter.py | 30 +- .../list_account_collections200_response.py | 2 +- .../models/list_all_roles_v2200_response.py | 2 +- .../models/list_catalog_items200_response.py | 2 +- .../models/list_experiments200_response.py | 2 +- talon_one/models/list_stores200_response.py | 2 +- talon_one/models/login_params.py | 4 +- talon_one/models/loyalty_balance.py | 10 +- talon_one/models/loyalty_balance_with_tier.py | 14 +- talon_one/models/loyalty_balances.py | 2 +- .../models/loyalty_balances_with_tiers.py | 2 +- talon_one/models/loyalty_card.py | 26 +- talon_one/models/loyalty_card_balances.py | 2 +- talon_one/models/loyalty_card_batch.py | 6 +- .../models/loyalty_card_batch_response.py | 4 +- .../loyalty_card_profile_registration.py | 4 +- talon_one/models/loyalty_card_registration.py | 2 +- talon_one/models/loyalty_dashboard_data.py | 14 +- .../loyalty_dashboard_points_breakdown.py | 4 +- talon_one/models/loyalty_ledger.py | 2 +- talon_one/models/loyalty_ledger_entry.py | 30 +- .../models/loyalty_ledger_transactions.py | 2 +- talon_one/models/loyalty_membership.py | 4 +- talon_one/models/loyalty_program.py | 42 +- talon_one/models/loyalty_program_balance.py | 16 +- talon_one/models/loyalty_program_entity.py | 6 +- talon_one/models/loyalty_program_ledgers.py | 8 +- .../models/loyalty_program_transaction.py | 40 +- talon_one/models/loyalty_tier.py | 14 +- talon_one/models/management_key.py | 18 +- talon_one/models/mcp_key.py | 16 +- talon_one/models/message_log_entries.py | 2 +- talon_one/models/message_log_entry.py | 26 +- talon_one/models/message_log_request.py | 4 +- talon_one/models/message_log_response.py | 6 +- talon_one/models/message_test.py | 4 +- talon_one/models/model_import.py | 12 +- talon_one/models/model_return.py | 20 +- talon_one/models/multiple_audiences.py | 2 +- talon_one/models/multiple_audiences_item.py | 12 +- ...stomer_profile_integration_request_item.py | 4 +- talon_one/models/mutable_entity.py | 2 +- talon_one/models/new_account_sign_up.py | 4 +- talon_one/models/new_additional_cost.py | 10 +- talon_one/models/new_application.py | 14 +- talon_one/models/new_application_api_key.py | 22 +- talon_one/models/new_application_cif.py | 10 +- .../models/new_application_cif_expression.py | 6 +- talon_one/models/new_attribute.py | 24 +- talon_one/models/new_audience.py | 16 +- talon_one/models/new_blueprint.py | 2 +- talon_one/models/new_campaign.py | 26 +- talon_one/models/new_campaign_collection.py | 4 +- .../models/new_campaign_evaluation_group.py | 8 +- talon_one/models/new_campaign_group.py | 8 +- talon_one/models/new_campaign_set.py | 4 +- .../new_campaign_store_budget_store_limit.py | 4 +- talon_one/models/new_campaign_template.py | 6 +- talon_one/models/new_catalog.py | 6 +- talon_one/models/new_collection.py | 6 +- talon_one/models/new_coupon_creation_job.py | 16 +- talon_one/models/new_coupons.py | 26 +- .../new_coupons_for_multiple_recipients.py | 18 +- talon_one/models/new_customer_profile.py | 2 +- talon_one/models/new_customer_session.py | 12 +- talon_one/models/new_customer_session_v2.py | 20 +- talon_one/models/new_event.py | 10 +- talon_one/models/new_event_type.py | 6 +- talon_one/models/new_event_v3_entity.py | 2 +- talon_one/models/new_experiment.py | 2 +- talon_one/models/new_experiment_variant.py | 6 +- talon_one/models/new_external_invitation.py | 6 +- talon_one/models/new_giveaways_pool.py | 8 +- talon_one/models/new_internal_audience.py | 8 +- talon_one/models/new_invitation.py | 6 +- talon_one/models/new_invite_email.py | 4 +- talon_one/models/new_loyalty_program.py | 24 +- talon_one/models/new_loyalty_tier.py | 4 +- talon_one/models/new_management_key.py | 20 +- talon_one/models/new_mcp_key.py | 18 +- talon_one/models/new_message_test.py | 12 +- .../models/new_multiple_audiences_item.py | 6 +- talon_one/models/new_notification_webhook.py | 4 +- .../new_outgoing_integration_webhook.py | 6 +- talon_one/models/new_password.py | 4 +- talon_one/models/new_picklist.py | 4 +- talon_one/models/new_price_adjustment.py | 14 +- talon_one/models/new_price_type.py | 8 +- talon_one/models/new_referral.py | 14 +- .../new_referrals_for_multiple_advocates.py | 16 +- talon_one/models/new_revision_version.py | 12 +- talon_one/models/new_reward.py | 10 +- talon_one/models/new_risk_notification.py | 6 +- talon_one/models/new_role.py | 8 +- talon_one/models/new_role_v2.py | 6 +- talon_one/models/new_ruleset.py | 6 +- talon_one/models/new_saml_connection.py | 2 +- talon_one/models/new_secondary_deployment.py | 2 +- talon_one/models/new_store.py | 8 +- talon_one/models/new_user.py | 6 +- talon_one/models/new_webhook.py | 20 +- talon_one/models/notification_list_item.py | 8 +- talon_one/models/okta_event.py | 2 +- talon_one/models/okta_event_target.py | 6 +- talon_one/models/one_time_code.py | 8 +- .../outgoing_integration_braze_policy.py | 4 +- .../outgoing_integration_clever_tap_policy.py | 6 +- .../outgoing_integration_configuration.py | 6 +- .../outgoing_integration_iterable_policy.py | 4 +- .../outgoing_integration_mo_engage_policy.py | 8 +- .../models/outgoing_integration_template.py | 16 +- ...ion_template_with_configuration_details.py | 16 +- talon_one/models/outgoing_integration_type.py | 10 +- talon_one/models/patch_item_catalog_action.py | 2 +- .../models/patch_many_items_catalog_action.py | 2 +- .../models/pending_active_points_data.py | 14 +- .../pending_active_points_notification.py | 2 +- .../pending_points_notification_policy.py | 6 +- talon_one/models/picklist.py | 16 +- talon_one/models/placeholder_details.py | 6 +- talon_one/models/price_detail.py | 10 +- talon_one/models/price_history_request.py | 6 +- talon_one/models/price_history_response.py | 2 +- talon_one/models/price_type.py | 18 +- .../models/price_type_reference_detail.py | 6 +- talon_one/models/price_type_references.py | 2 +- talon_one/models/product.py | 2 +- talon_one/models/product_search_match.py | 6 +- .../product_unit_analytics_data_point.py | 8 +- talon_one/models/profile_audiences_changes.py | 4 +- talon_one/models/projected_tier.py | 6 +- .../models/redeem_referral_effect_props.py | 2 +- talon_one/models/referral.py | 26 +- talon_one/models/referral_constraints.py | 6 +- .../models/referral_created_effect_props.py | 4 +- talon_one/models/referral_rejection_reason.py | 2 +- .../models/reject_coupon_effect_props.py | 6 +- .../models/reject_referral_effect_props.py | 8 +- .../remove_from_audience_effect_props.py | 10 +- .../models/reserve_coupon_effect_props.py | 6 +- talon_one/models/response_content_object.py | 2 +- .../models/return_integration_request.py | 2 +- talon_one/models/returned_cart_item.py | 6 +- talon_one/models/revision.py | 2 +- .../models/revision_activation_request.py | 4 +- talon_one/models/revision_version.py | 14 +- talon_one/models/reward.py | 20 +- talon_one/models/reward_points_required.py | 8 +- talon_one/models/risk_notification.py | 14 +- talon_one/models/role.py | 18 +- talon_one/models/role_assign.py | 4 +- talon_one/models/role_v2.py | 16 +- .../models/role_v2_application_details.py | 12 +- talon_one/models/role_v2_base.py | 6 +- talon_one/models/role_v2_permission_set.py | 4 +- talon_one/models/role_v2_permissions.py | 16 +- talon_one/models/role_v2_readonly.py | 2 +- talon_one/models/role_v2_roles_group.py | 6 +- talon_one/models/roles_v2_thresholds.py | 6 +- ...lback_added_loyalty_points_effect_props.py | 16 +- .../models/rollback_coupon_effect_props.py | 4 +- ...ck_deducted_loyalty_points_effect_props.py | 14 +- .../models/rollback_discount_effect_props.py | 16 +- ...eased_achievement_progress_effect_props.py | 8 +- .../models/rollback_referral_effect_props.py | 4 +- talon_one/models/rule.py | 12 +- talon_one/models/rule_eligibility.py | 2 +- .../rule_eligibility_failure_details.py | 2 +- talon_one/models/rule_failure_reason.py | 6 +- talon_one/models/rule_metadata.py | 8 +- talon_one/models/rule_metadata_eligibility.py | 8 +- talon_one/models/ruleset.py | 16 +- talon_one/models/saml_connection.py | 6 +- talon_one/models/saml_login_endpoint.py | 2 +- talon_one/models/scim_base_group.py | 2 +- talon_one/models/scim_base_user.py | 6 +- talon_one/models/scim_base_user_name.py | 2 +- talon_one/models/scim_group.py | 4 +- talon_one/models/scim_group_member.py | 4 +- talon_one/models/scim_new_user.py | 6 +- .../scim_service_provider_config_response.py | 10 +- talon_one/models/scim_user.py | 8 +- talon_one/models/secondary_deployment.py | 16 +- talon_one/models/session.py | 6 +- talon_one/models/set_discount_effect_props.py | 10 +- ...scount_per_additional_cost_effect_props.py | 12 +- ...r_additional_cost_per_item_effect_props.py | 16 +- .../set_discount_per_item_effect_props.py | 26 +- ...loyalty_points_expiry_date_effect_props.py | 4 +- .../show_bundle_metadata_effect_props.py | 2 +- .../models/show_notification_effect_props.py | 8 +- .../models/sku_unit_analytics_data_point.py | 6 +- talon_one/models/sso_config.py | 4 +- talon_one/models/store.py | 18 +- .../models/strikethrough_changed_item.py | 14 +- ...ikethrough_custom_effect_per_item_props.py | 4 +- talon_one/models/strikethrough_effect.py | 20 +- .../strikethrough_labeling_notification.py | 8 +- ...ough_set_discount_per_item_effect_props.py | 2 +- ...t_discount_per_item_member_effect_props.py | 2 +- talon_one/models/strikethrough_trigger.py | 10 +- talon_one/models/support_request.py | 30 +- talon_one/models/support_request_input.py | 16 +- talon_one/models/template_arg_def.py | 2 +- talon_one/models/template_def.py | 6 +- talon_one/models/template_limit_config.py | 8 +- talon_one/models/tier.py | 8 +- talon_one/models/tier_downgrade_data.py | 16 +- .../models/tier_downgrade_notification.py | 2 +- .../tier_downgrade_notification_policy.py | 6 +- talon_one/models/tier_upgrade_data.py | 20 +- talon_one/models/tier_upgrade_notification.py | 2 +- .../tier_upgrade_notification_policy.py | 6 +- talon_one/models/tier_will_downgrade_data.py | 16 +- .../tier_will_downgrade_notification.py | 2 +- ...tier_will_downgrade_notification_policy.py | 6 +- talon_one/models/time_point.py | 10 +- talon_one/models/transfer_loyalty_card.py | 4 +- .../models/trigger_webhook_effect_props.py | 6 +- talon_one/models/two_fa_config.py | 4 +- talon_one/models/update_achievement.py | 20 +- talon_one/models/update_achievement_v2.py | 22 +- talon_one/models/update_application.py | 28 +- .../models/update_application_api_key.py | 2 +- talon_one/models/update_application_cif.py | 6 +- .../models/update_attribute_effect_props.py | 4 +- talon_one/models/update_audience.py | 4 +- talon_one/models/update_campaign.py | 28 +- .../models/update_campaign_collection.py | 2 +- .../update_campaign_evaluation_group.py | 8 +- talon_one/models/update_campaign_group.py | 8 +- talon_one/models/update_campaign_template.py | 18 +- talon_one/models/update_catalog.py | 6 +- talon_one/models/update_collection.py | 4 +- talon_one/models/update_coupon.py | 18 +- talon_one/models/update_coupon_batch.py | 12 +- .../update_customer_session_v2409_response.py | 4 +- talon_one/models/update_experiment.py | 2 +- talon_one/models/update_experiment_variant.py | 6 +- .../models/update_experiment_variant_name.py | 2 +- talon_one/models/update_loyalty_card.py | 4 +- .../models/update_loyalty_card_request.py | 2 +- talon_one/models/update_loyalty_program.py | 20 +- .../models/update_loyalty_program_tier.py | 6 +- talon_one/models/update_picklist.py | 4 +- talon_one/models/update_price_type.py | 6 +- talon_one/models/update_referral.py | 8 +- talon_one/models/update_referral_batch.py | 8 +- talon_one/models/update_reward.py | 8 +- talon_one/models/update_risk_notification.py | 115 ++++ talon_one/models/update_role.py | 8 +- talon_one/models/update_store.py | 6 +- talon_one/models/update_support_request.py | 4 +- talon_one/models/update_user.py | 10 +- talon_one/models/user.py | 34 +- talon_one/models/user_entity.py | 2 +- talon_one/models/value_map.py | 8 +- talon_one/models/webhook.py | 26 +- talon_one/models/webhook_authentication.py | 8 +- .../webhook_authentication_webhook_ref.py | 6 +- ...bhook_with_outgoing_integration_details.py | 32 +- .../will_award_giveaway_effect_props.py | 8 +- ...st_achievement_additional_properties_v2.py | 3 +- test/test_achievement_reference.py | 4 +- test/test_achievement_v2.py | 3 +- test/test_campaign_eligibility.py | 5 +- ...> test_campaign_eligibility_experiment.py} | 27 +- test/test_change.py | 4 +- test/test_event.py | 4 +- test/test_event_v3.py | 4 +- test/test_experiment_confidence_timeline.py | 66 ++ ...eriment_confidence_timeline_data_point.py} | 37 +- test/test_integration_api.py | 14 + test/test_integration_event.py | 4 +- ...load_loyalty_profile_based_notification.py | 76 --- test/test_integration_hub_event_record.py | 16 +- test/test_integration_hub_event_type.py | 33 + test/test_integration_hub_flow.py | 5 +- test/test_integration_hub_flow_response.py | 6 + test/test_integration_hub_flow_with_config.py | 5 +- ...integration_hub_paginated_event_payload.py | 4 +- test/test_inventory_referral.py | 2 +- test/test_management_api.py | 7 + test/test_new_coupons.py | 2 +- ...est_new_coupons_for_multiple_recipients.py | 2 +- test/test_new_event.py | 4 +- test/test_new_referral.py | 2 +- ...st_new_referrals_for_multiple_advocates.py | 2 +- test/test_new_role_v2.py | 7 +- test/test_referral.py | 2 +- test/test_role_v2.py | 7 +- test/test_role_v2_application_details.py | 4 +- test/test_role_v2_base.py | 7 +- test/test_role_v2_permissions.py | 7 +- test/test_roles_v2_thresholds.py | 1 + ...t_scim_service_provider_config_response.py | 4 +- ...ch.py => test_update_risk_notification.py} | 31 +- test/test_user.py | 4 +- 692 files changed, 4906 insertions(+), 3432 deletions(-) create mode 100644 docs/CampaignEligibilityExperiment.md create mode 100644 docs/ExperimentConfidenceTimeline.md create mode 100644 docs/ExperimentConfidenceTimelineDataPoint.md delete mode 100644 docs/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md create mode 100644 docs/IntegrationHubEventType.md delete mode 100644 docs/ScimServiceProviderConfigResponsePatch.md delete mode 100644 docs/ScimServiceProviderConfigResponseSort.md delete mode 100644 docs/UpdateCustomerProfileV2409Response.md create mode 100644 docs/UpdateRiskNotification.md rename talon_one/models/{update_customer_profile_v2409_response.py => campaign_eligibility_experiment.py} (75%) rename talon_one/models/{scim_service_provider_config_response_sort.py => experiment_confidence_timeline.py} (69%) rename talon_one/models/{scim_service_provider_config_response_patch.py => experiment_confidence_timeline_data_point.py} (70%) delete mode 100644 talon_one/models/integration_hub_event_payload_loyalty_profile_based_notification.py create mode 100644 talon_one/models/integration_hub_event_type.py create mode 100644 talon_one/models/update_risk_notification.py rename test/{test_scim_service_provider_config_response_sort.py => test_campaign_eligibility_experiment.py} (65%) create mode 100644 test/test_experiment_confidence_timeline.py rename test/{test_update_customer_profile_v2409_response.py => test_experiment_confidence_timeline_data_point.py} (51%) delete mode 100644 test/test_integration_hub_event_payload_loyalty_profile_based_notification.py create mode 100644 test/test_integration_hub_event_type.py rename test/{test_scim_service_provider_config_response_patch.py => test_update_risk_notification.py} (62%) diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 612b9d5..e61573c 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -123,6 +123,7 @@ docs/CampaignEditedNotification.md docs/CampaignEditedNotificationItem.md docs/CampaignEligibility.md docs/CampaignEligibilityDetails.md +docs/CampaignEligibilityExperiment.md docs/CampaignEligibilityFailureDetails.md docs/CampaignEntity.md docs/CampaignEvaluationGroup.md @@ -249,6 +250,8 @@ docs/EventV3Entity.md docs/EventV3RequestEntity.md docs/Experiment.md docs/ExperimentCampaignCopy.md +docs/ExperimentConfidenceTimeline.md +docs/ExperimentConfidenceTimelineDataPoint.md docs/ExperimentCopy.md docs/ExperimentCopyExperiment.md docs/ExperimentListResults.md @@ -365,13 +368,13 @@ docs/IntegrationGetAllCampaigns200Response.md docs/IntegrationHubConfig.md docs/IntegrationHubEventPayloadCouponBasedNotifications.md docs/IntegrationHubEventPayloadCouponBasedNotificationsLimits.md -docs/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md docs/IntegrationHubEventRecord.md docs/IntegrationHubEventStatusUpdate.md +docs/IntegrationHubEventType.md docs/IntegrationHubFlow.md docs/IntegrationHubFlowConfig.md docs/IntegrationHubFlowConfigResponse.md @@ -632,8 +635,6 @@ 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 @@ -701,7 +702,6 @@ docs/UpdateCoupon.md docs/UpdateCouponBatch.md docs/UpdateCouponsData.md docs/UpdateCustomEffect.md -docs/UpdateCustomerProfileV2409Response.md docs/UpdateCustomerSessionV2409Response.md docs/UpdateExperiment.md docs/UpdateExperimentVariant.md @@ -716,6 +716,7 @@ docs/UpdatePriceType.md docs/UpdateReferral.md docs/UpdateReferralBatch.md docs/UpdateReward.md +docs/UpdateRiskNotification.md docs/UpdateRole.md docs/UpdateStore.md docs/UpdateSupportRequest.md @@ -858,6 +859,7 @@ talon_one/models/campaign_edited_notification.py talon_one/models/campaign_edited_notification_item.py talon_one/models/campaign_eligibility.py talon_one/models/campaign_eligibility_details.py +talon_one/models/campaign_eligibility_experiment.py talon_one/models/campaign_eligibility_failure_details.py talon_one/models/campaign_entity.py talon_one/models/campaign_evaluation_group.py @@ -984,6 +986,8 @@ talon_one/models/event_v3_entity.py talon_one/models/event_v3_request_entity.py talon_one/models/experiment.py talon_one/models/experiment_campaign_copy.py +talon_one/models/experiment_confidence_timeline.py +talon_one/models/experiment_confidence_timeline_data_point.py talon_one/models/experiment_copy.py talon_one/models/experiment_copy_experiment.py talon_one/models/experiment_list_results.py @@ -1099,13 +1103,13 @@ talon_one/models/integration_get_all_campaigns200_response.py talon_one/models/integration_hub_config.py talon_one/models/integration_hub_event_payload_coupon_based_notifications.py talon_one/models/integration_hub_event_payload_coupon_based_notifications_limits.py -talon_one/models/integration_hub_event_payload_loyalty_profile_based_notification.py talon_one/models/integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py talon_one/models/integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action.py talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py talon_one/models/integration_hub_event_record.py talon_one/models/integration_hub_event_status_update.py +talon_one/models/integration_hub_event_type.py talon_one/models/integration_hub_flow.py talon_one/models/integration_hub_flow_config.py talon_one/models/integration_hub_flow_config_response.py @@ -1364,8 +1368,6 @@ 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 @@ -1434,7 +1436,6 @@ 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 @@ -1449,6 +1450,7 @@ talon_one/models/update_price_type.py talon_one/models/update_referral.py talon_one/models/update_referral_batch.py talon_one/models/update_reward.py +talon_one/models/update_risk_notification.py talon_one/models/update_role.py talon_one/models/update_store.py talon_one/models/update_support_request.py @@ -1580,6 +1582,7 @@ test/test_campaign_edited_notification.py test/test_campaign_edited_notification_item.py test/test_campaign_eligibility.py test/test_campaign_eligibility_details.py +test/test_campaign_eligibility_experiment.py test/test_campaign_eligibility_failure_details.py test/test_campaign_entity.py test/test_campaign_evaluation_group.py @@ -1706,6 +1709,8 @@ test/test_event_v3_entity.py test/test_event_v3_request_entity.py test/test_experiment.py test/test_experiment_campaign_copy.py +test/test_experiment_confidence_timeline.py +test/test_experiment_confidence_timeline_data_point.py test/test_experiment_copy.py test/test_experiment_copy_experiment.py test/test_experiment_list_results.py @@ -1822,13 +1827,13 @@ test/test_integration_get_all_campaigns200_response.py test/test_integration_hub_config.py test/test_integration_hub_event_payload_coupon_based_notifications.py test/test_integration_hub_event_payload_coupon_based_notifications_limits.py -test/test_integration_hub_event_payload_loyalty_profile_based_notification.py test/test_integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py test/test_integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action.py test/test_integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py test/test_integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py test/test_integration_hub_event_record.py test/test_integration_hub_event_status_update.py +test/test_integration_hub_event_type.py test/test_integration_hub_flow.py test/test_integration_hub_flow_config.py test/test_integration_hub_flow_config_response.py @@ -2088,8 +2093,6 @@ 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 @@ -2158,7 +2161,6 @@ 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 @@ -2173,6 +2175,7 @@ test/test_update_price_type.py test/test_update_referral.py test/test_update_referral_batch.py test/test_update_reward.py +test/test_update_risk_notification.py test/test_update_role.py test/test_update_store.py test/test_update_support_request.py diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 696eaac..14d6b5d 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -7.22.0 +7.23.0 diff --git a/README.md b/README.md index e8aaf4c..9ce0aa5 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,7 @@ Class | Method | HTTP request | Description *IntegrationApi* | [**get_customer_achievements**](docs/IntegrationApi.md#get_customer_achievements) | **GET** /v1/customer_profiles/{integrationId}/achievements | List customer's available achievements *IntegrationApi* | [**get_customer_inventory**](docs/IntegrationApi.md#get_customer_inventory) | **GET** /v1/customer_profiles/{integrationId}/inventory | List customer data *IntegrationApi* | [**get_customer_session**](docs/IntegrationApi.md#get_customer_session) | **GET** /v2/customer_sessions/{customerSessionId} | Get customer session +*IntegrationApi* | [**get_event_v3**](docs/IntegrationApi.md#get_event_v3) | **GET** /v3/events/{integrationId} | Get advanced event *IntegrationApi* | [**get_loyalty_balances**](docs/IntegrationApi.md#get_loyalty_balances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/balances | Get customer's loyalty balances *IntegrationApi* | [**get_loyalty_card_balances**](docs/IntegrationApi.md#get_loyalty_card_balances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/balances | Get card's point balances *IntegrationApi* | [**get_loyalty_card_points**](docs/IntegrationApi.md#get_loyalty_card_points) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/points | List card's unused loyalty points @@ -185,6 +186,7 @@ Class | Method | HTTP request | Description *IntegrationApi* | [**return_cart_items**](docs/IntegrationApi.md#return_cart_items) | **POST** /v2/customer_sessions/{customerSessionId}/returns | Return cart items *IntegrationApi* | [**sync_catalog**](docs/IntegrationApi.md#sync_catalog) | **PUT** /v1/catalogs/{catalogId}/sync | Sync cart item catalog *IntegrationApi* | [**track_event_v2**](docs/IntegrationApi.md#track_event_v2) | **POST** /v2/events | Track event +*IntegrationApi* | [**track_event_v3**](docs/IntegrationApi.md#track_event_v3) | **POST** /v3/events | Track advanced event *IntegrationApi* | [**unlink_loyalty_card_from_profile**](docs/IntegrationApi.md#unlink_loyalty_card_from_profile) | **POST** /v2/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/unlink_profile | Unlink customer profile from a loyalty card *IntegrationApi* | [**update_audience_customers_attributes**](docs/IntegrationApi.md#update_audience_customers_attributes) | **PUT** /v2/audience_customers/{audienceId}/attributes | Update profile attributes for all customers in audience *IntegrationApi* | [**update_audience_v2**](docs/IntegrationApi.md#update_audience_v2) | **PUT** /v2/audiences/{audienceId} | Update audience name @@ -326,6 +328,7 @@ Class | Method | HTTP request | Description *ManagementApi* | [**import_coupons**](docs/ManagementApi.md#import_coupons) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/import_coupons | Import coupons *ManagementApi* | [**import_loyalty_cards**](docs/ManagementApi.md#import_loyalty_cards) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/import_cards | Import loyalty cards *ManagementApi* | [**import_loyalty_customers_tiers**](docs/ManagementApi.md#import_loyalty_customers_tiers) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/import_customers_tiers | Import customers into loyalty tiers +*ManagementApi* | [**import_loyalty_join_dates**](docs/ManagementApi.md#import_loyalty_join_dates) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/import_join_dates | Import join dates for a loyalty program *ManagementApi* | [**import_loyalty_points**](docs/ManagementApi.md#import_loyalty_points) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/import_points | Import loyalty points *ManagementApi* | [**import_pool_giveaways**](docs/ManagementApi.md#import_pool_giveaways) | **POST** /v1/giveaways/pools/{poolId}/import | Import giveaway codes into a giveaway pool *ManagementApi* | [**import_referrals**](docs/ManagementApi.md#import_referrals) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/import_referrals | Import referrals @@ -492,6 +495,7 @@ Class | Method | HTTP request | Description - [CampaignEditedNotificationItem](docs/CampaignEditedNotificationItem.md) - [CampaignEligibility](docs/CampaignEligibility.md) - [CampaignEligibilityDetails](docs/CampaignEligibilityDetails.md) +- [CampaignEligibilityExperiment](docs/CampaignEligibilityExperiment.md) - [CampaignEligibilityFailureDetails](docs/CampaignEligibilityFailureDetails.md) - [CampaignEntity](docs/CampaignEntity.md) - [CampaignEvaluationGroup](docs/CampaignEvaluationGroup.md) @@ -618,6 +622,8 @@ Class | Method | HTTP request | Description - [EventV3RequestEntity](docs/EventV3RequestEntity.md) - [Experiment](docs/Experiment.md) - [ExperimentCampaignCopy](docs/ExperimentCampaignCopy.md) +- [ExperimentConfidenceTimeline](docs/ExperimentConfidenceTimeline.md) +- [ExperimentConfidenceTimelineDataPoint](docs/ExperimentConfidenceTimelineDataPoint.md) - [ExperimentCopy](docs/ExperimentCopy.md) - [ExperimentCopyExperiment](docs/ExperimentCopyExperiment.md) - [ExperimentListResults](docs/ExperimentListResults.md) @@ -733,13 +739,13 @@ Class | Method | HTTP request | Description - [IntegrationHubConfig](docs/IntegrationHubConfig.md) - [IntegrationHubEventPayloadCouponBasedNotifications](docs/IntegrationHubEventPayloadCouponBasedNotifications.md) - [IntegrationHubEventPayloadCouponBasedNotificationsLimits](docs/IntegrationHubEventPayloadCouponBasedNotificationsLimits.md) -- [IntegrationHubEventPayloadLoyaltyProfileBasedNotification](docs/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md) - [IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification](docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md) - [IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction](docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md) - [IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification](docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md) - [IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification](docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md) - [IntegrationHubEventRecord](docs/IntegrationHubEventRecord.md) - [IntegrationHubEventStatusUpdate](docs/IntegrationHubEventStatusUpdate.md) +- [IntegrationHubEventType](docs/IntegrationHubEventType.md) - [IntegrationHubFlow](docs/IntegrationHubFlow.md) - [IntegrationHubFlowConfig](docs/IntegrationHubFlowConfig.md) - [IntegrationHubFlowConfigResponse](docs/IntegrationHubFlowConfigResponse.md) @@ -999,8 +1005,6 @@ 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) @@ -1068,7 +1072,6 @@ 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) @@ -1083,6 +1086,7 @@ Class | Method | HTTP request | Description - [UpdateReferral](docs/UpdateReferral.md) - [UpdateReferralBatch](docs/UpdateReferralBatch.md) - [UpdateReward](docs/UpdateReward.md) +- [UpdateRiskNotification](docs/UpdateRiskNotification.md) - [UpdateRole](docs/UpdateRole.md) - [UpdateStore](docs/UpdateStore.md) - [UpdateSupportRequest](docs/UpdateSupportRequest.md) diff --git a/docs/AcceptCouponEffectProps.md b/docs/AcceptCouponEffectProps.md index e1ca595..39cb81e 100644 --- a/docs/AcceptCouponEffectProps.md +++ b/docs/AcceptCouponEffectProps.md @@ -1,6 +1,6 @@ # AcceptCouponEffectProps -The properties specific to the \"acceptCoupon\" effect. This gets triggered whenever the coupon is valid and all other conditions in the rules of its campaign are met. +This effect indicates that the coupon code supplied was valid. You should handle this effect by clearing any messages from previous `rejectCoupon` effects and informing the user that the coupon is valid. The code is automatically redeemed when you close the session. Other effects, such as [setDiscount](https://docs.talon.one/docs/dev/integration-api/api-effects#setdiscount), provide more information about the actual rewards received. ## Properties diff --git a/docs/AcceptReferralEffectProps.md b/docs/AcceptReferralEffectProps.md index f4d5277..d3bc705 100644 --- a/docs/AcceptReferralEffectProps.md +++ b/docs/AcceptReferralEffectProps.md @@ -1,12 +1,12 @@ # AcceptReferralEffectProps -The properties specific to the \"acceptReferral\" effect. TThis gets triggered whenever the referral code is valid and all other conditions in the rules of its campaign are met. +This effect indicates that the referral code supplied is valid. You should handle this effect by informing the user that the referral code is valid. The code is automatically redeemed when you close the session. Other effects will provide more information about the actual reward. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The referral code that was accepted. | +**value** | **str** | The referral code provided in the session. | ## Example diff --git a/docs/AchievementAdditionalPropertiesV2.md b/docs/AchievementAdditionalPropertiesV2.md index 836e16d..65b3de9 100644 --- a/docs/AchievementAdditionalPropertiesV2.md +++ b/docs/AchievementAdditionalPropertiesV2.md @@ -7,8 +7,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **user_id** | **int** | The ID of the user that created this achievement. | **created_by** | **str** | Name of the user that created the achievement. **Note**: This is not available if the user has been deleted. | [optional] +**period_end_override** | [**TimePoint**](TimePoint.md) | | [optional] **has_progress** | **bool** | Indicates if a customer has made progress in the achievement. | [optional] -**status** | **str** | The status of the achievement. | [optional] +**status** | **str** | The status of the achievement. - `active`: The achievement is available to customers. - `scheduled`: The achievement has a `fixedStartDate` set in the future. - `expired`: The achievement's `endDate` is in the past. | [optional] ## Example diff --git a/docs/AchievementReference.md b/docs/AchievementReference.md index b746378..e6eee70 100644 --- a/docs/AchievementReference.md +++ b/docs/AchievementReference.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **application_id** | **int** | The ID of the Application associated with the campaign that references this achievement. | **application_name** | **str** | The name of the Application associated with the campaign that references this achievement. | **campaign_id** | **int** | The ID of the campaign that references this achievement. | +**campaign_name** | **str** | The name of the campaign that references this achievement. | ## Example diff --git a/docs/AchievementV2.md b/docs/AchievementV2.md index c07ace2..bbd032e 100644 --- a/docs/AchievementV2.md +++ b/docs/AchievementV2.md @@ -20,8 +20,9 @@ Name | Type | Description | Notes **subscribed_applications** | **List[int]** | A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement. | **user_id** | **int** | The ID of the user that created this achievement. | **created_by** | **str** | Name of the user that created the achievement. **Note**: This is not available if the user has been deleted. | [optional] +**period_end_override** | [**TimePoint**](TimePoint.md) | | [optional] **has_progress** | **bool** | Indicates if a customer has made progress in the achievement. | [optional] -**status** | **str** | The status of the achievement. | [optional] +**status** | **str** | The status of the achievement. - `active`: The achievement is available to customers. - `scheduled`: The achievement has a `fixedStartDate` set in the future. - `expired`: The achievement's `endDate` is in the past. | [optional] **sandbox** | **bool** | Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. | **timezone** | **str** | A string containing an IANA timezone descriptor. | diff --git a/docs/AddFreeItemEffectProps.md b/docs/AddFreeItemEffectProps.md index 6ddca49..9df3942 100644 --- a/docs/AddFreeItemEffectProps.md +++ b/docs/AddFreeItemEffectProps.md @@ -1,13 +1,13 @@ # AddFreeItemEffectProps -The properties specific to the \"addFreeItem\" effect. This gets triggered whenever a validated rule contained an \"add free item\" effect. +This effect indicates that a free item should be added to the shopping cart in the current session. In this example, add the SKU to the shopping cart and set its price to `0`. The effect of a successful referral can mean a free item for someone else, such as the referrer. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **sku** | **str** | SKU of the item that needs to be added. | -**name** | **str** | The name / description of the effect | +**name** | **str** | Description of the effect. | **desired_quantity** | **int** | The original quantity in case a partial reward was applied. | [optional] ## Example diff --git a/docs/AddLoyaltyPointsEffectProps.md b/docs/AddLoyaltyPointsEffectProps.md index c04a122..b8732a0 100644 --- a/docs/AddLoyaltyPointsEffectProps.md +++ b/docs/AddLoyaltyPointsEffectProps.md @@ -1,27 +1,27 @@ # AddLoyaltyPointsEffectProps -The properties specific to the \"addLoyaltyPoints\" effect. This gets triggered whenever a validated rule contained an \"add loyalty\" effect. These points are automatically stored and managed inside Talon.One. +This effect indicates that a defined amount of loyalty points was successfully added to the customer's profile or to a loyalty card. If you use the [Add loyalty points per item effect](https://docs.talon.one/docs/product/rules/effects/available-effects#reward-effects), use the `cartItemPosition` property to identify which item to add the loyalty points for. Enabling [partial rewards](https://docs.talon.one/docs/product/applications/manage-general-settings#partial-rewards) allows a rule that would fail because of insufficient budget to pass. The rule still fails when the budget reaches 0. Use the `desiredValue` property to identify the original amount of loyalty points. If you use **Add loyalty points per item** and if the session contains some cart items with _quantity > 1_, use the `cartItemSubPosition` property to identify the item unit in its line item. See the example below for more information. If your list of cart items is a [bundle definition](https://docs.talon.one/docs/product/rules/create-and-manage-bundles), use the `bundleIndex` and `bundleName` properties to identify the bundle containing the items for which loyalty points are added. If you have set custom activation and expiration dates for the loyalty points, use the `startDate` and `expiryDate` properties to identify when the reward will be active and when will expire. If the loyalty program is [profile-based](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types), use the `recipientIntegrationId` property to identify the user who receives the loyalty points. If the loyalty program is [card-based](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types), use the `cardIdentifier` property to identify the loyalty card on which these points are added. The points only persist when the session is closed. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **str** | The name / description of this loyalty point addition. | +**name** | **str** | The reason of this loyalty point addition. | **program_id** | **int** | The ID of the loyalty program where these points were added. | **sub_ledger_id** | **str** | The ID of the subledger within the loyalty program where these points were added. | **value** | **float** | The amount of points that were added. | -**desired_value** | **float** | The original amount of loyalty points to be awarded. | [optional] +**desired_value** | **float** | (Partial rewards enabled only) The amount of loyalty points to be awarded without considering budget limitations. | [optional] **recipient_integration_id** | **str** | The user for whom these points were added. | -**start_date** | **datetime** | Date after which points will be valid. | [optional] -**expiry_date** | **datetime** | Date after which points will expire. | [optional] -**transaction_uuid** | **str** | The identifier of this addition in the loyalty ledger. | -**cart_item_position** | **float** | The index of the item in the cart items list on which the loyal points addition should be applied. | [optional] -**cart_item_sub_position** | **float** | For cart items with `quantity` > 1, the sub position indicates to which item the loyalty points addition is applied. | [optional] -**card_identifier** | **str** | The card on which these points were added. | [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] -**awaits_activation** | **bool** | If `true`, the loyalty points remain pending until a specific action is complete. The `startDate` parameter automatically sets to `on_action`. | [optional] -**validity_duration** | **str** | The duration for which the points remain active, calculated relative to the activation date. **Note**: This value is returned only if `awaitsActivation` is `true` and `expiryDate` is not set. | [optional] +**start_date** | **datetime** | The date after which the added points will be valid. | [optional] +**expiry_date** | **datetime** | The date after which the added points will expire. | [optional] +**transaction_uuid** | **str** | The identifier of this loyalty point transaction. | +**cart_item_position** | **float** | (_Add points per cart item_ only.) The index of the item in the `cartItem` object for which these points were added. | [optional] +**cart_item_sub_position** | **float** | (_Add points per cart item_ ) The index of the item unit in its line item. | [optional] +**card_identifier** | **str** | The identifier of the card on which these points were added. | [optional] +**bundle_index** | **int** | _(With bundles only)_ The position of the specific bundle in the list of bundles created from the same bundle definition. | [optional] +**bundle_name** | **str** | _(With bundles only)_ The name of the bundle definition. | [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] ## Example diff --git a/docs/AddToAudienceEffectProps.md b/docs/AddToAudienceEffectProps.md index a98c0f8..2806df4 100644 --- a/docs/AddToAudienceEffectProps.md +++ b/docs/AddToAudienceEffectProps.md @@ -1,6 +1,6 @@ # AddToAudienceEffectProps -The properties specific to the \"addToAudience\" effect. This gets triggered whenever a validated rule contains an \"addToAudience\" effect. +This effect is triggered when a rule containing an [Update audience](https://docs.talon.one/docs/product/rules/effects/use-effects#update-an-audience) effect with **Add customer to an audience** selected is validated. It indicates that a customer was added to an audience and is returned when a customer session is opened, updated, or closed. ## Properties diff --git a/docs/ApplicationEvent.md b/docs/ApplicationEvent.md index fddec51..3f4e5ec 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** | Additional JSON serialized data associated with the event. | +**attributes** | **object** | Arbitrary properties associated with this campaign. | **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/ApplicationSession.md b/docs/ApplicationSession.md index 3c78b9e..dd73cf9 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 item. | [optional] +**attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] ## Example diff --git a/docs/AwardGiveawayEffectProps.md b/docs/AwardGiveawayEffectProps.md index 2f7ec3f..90aa32a 100644 --- a/docs/AwardGiveawayEffectProps.md +++ b/docs/AwardGiveawayEffectProps.md @@ -1,16 +1,16 @@ # AwardGiveawayEffectProps -The properties specific to the \"awardGiveaway\" effect. This effect contains information on the giveaway item, and which profile it was awarded to. +This effect indicates the awarded giveaway item and to which profile the item was awarded. Learn more about [giveaways](https://docs.talon.one/docs/product/giveaways/overview). ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pool_id** | **int** | The ID of the giveaways pool the code was taken from. | -**pool_name** | **str** | The name of the giveaways pool the code was taken from. | -**recipient_integration_id** | **str** | The integration ID of the profile that was awarded the giveaway. | -**giveaway_id** | **int** | The internal ID for the giveaway that was awarded. | -**code** | **str** | The giveaway code that was awarded. | +**pool_id** | **int** | The internal ID of the giveaway pool. | +**pool_name** | **str** | The name of the giveaway pool. | +**recipient_integration_id** | **str** | The integration ID of the customer that receives the giveaway. | +**giveaway_id** | **int** | The internal ID of the giveaway. | +**code** | **str** | The giveaway code to be rewarded. | ## Example diff --git a/docs/CampaignEligibility.md b/docs/CampaignEligibility.md index 60d1ca9..3ab20cd 100644 --- a/docs/CampaignEligibility.md +++ b/docs/CampaignEligibility.md @@ -17,6 +17,7 @@ Name | Type | Description | Notes **features** | **List[str]** | The features enabled in this campaign. | **eligibility** | [**List[CampaignEligibilityDetails]**](CampaignEligibilityDetails.md) | The customer's eligibility for each campaign in the current customer session. | **rules** | [**List[RuleMetadataEligibility]**](RuleMetadataEligibility.md) | A list of rules containing customer-facing details of the rewards defined in the campaign. | +**experiment** | [**CampaignEligibilityExperiment**](CampaignEligibilityExperiment.md) | | [optional] ## Example diff --git a/docs/CampaignEligibilityExperiment.md b/docs/CampaignEligibilityExperiment.md new file mode 100644 index 0000000..21e5588 --- /dev/null +++ b/docs/CampaignEligibilityExperiment.md @@ -0,0 +1,31 @@ +# CampaignEligibilityExperiment + +The identifiers for the [experiment](https://docs.talon.one/management-api#tag/Experiments) and the variant assigned to the customer profile. Only returned when the customer profile has been assigned to a variant in an experiment campaign. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the experiment. | +**variant_id** | **int** | The ID of the variant assigned to the customer profile. | + +## Example + +```python +from talon_one.models.campaign_eligibility_experiment import CampaignEligibilityExperiment + +# TODO update the JSON string below +json = "{}" +# create an instance of CampaignEligibilityExperiment from a JSON string +campaign_eligibility_experiment_instance = CampaignEligibilityExperiment.from_json(json) +# print the JSON string representation of the object +print(CampaignEligibilityExperiment.to_json()) + +# convert the object into a dict +campaign_eligibility_experiment_dict = campaign_eligibility_experiment_instance.to_dict() +# create an instance of CampaignEligibilityExperiment from a dict +campaign_eligibility_experiment_from_dict = CampaignEligibilityExperiment.from_dict(campaign_eligibility_experiment_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 f2b32b6..cc62ffa 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** | Resource before the change occurred. | [optional] -**new** | **object** | Resource after the change occurred. | [optional] +**old** | **object** | Arbitrary properties associated with this campaign. | [optional] +**new** | **object** | Arbitrary properties associated with this campaign. | [optional] **management_key_id** | **int** | ID of management key used to perform changes. | [optional] ## Example diff --git a/docs/ChangeLoyaltyTierLevelEffectProps.md b/docs/ChangeLoyaltyTierLevelEffectProps.md index 0dcc6b3..f241402 100644 --- a/docs/ChangeLoyaltyTierLevelEffectProps.md +++ b/docs/ChangeLoyaltyTierLevelEffectProps.md @@ -1,14 +1,14 @@ # ChangeLoyaltyTierLevelEffectProps -The properties specific to the \"changeLoyaltyTierLevel\" effect. This is triggered whenever the user's loyalty tier is upgraded due to a validated rule that contained an \"addLoyaltyPoints\" effect. +This effect indicates that a customer's loyalty tier has been upgraded. This effect is generated only when the [Add loyalty points](https://docs.talon.one/docs/product/rules/effects/use-effects#add-loyalty-points) and the [Add loyalty points per cart item](https://docs.talon.one/docs/product/rules/effects/use-effects#add-loyalty-points-per-cart-item) effects are triggered for a particular customer, and, as a result, the customer's loyalty tier is upgraded. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **rule_title** | **str** | The title of the rule that triggered the tier upgrade. | -**program_id** | **int** | The ID of the loyalty program where these points were added. | -**sub_ledger_id** | **str** | The ID of the subledger within the loyalty program where these points were added. | +**program_id** | **int** | The ID of the loyalty program where the points were added. | +**sub_ledger_id** | **str** | The ID of the subledger within the loyalty program where the points were added. | **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. | **expiry_date** | **datetime** | The expiration date of the new tier. | [optional] diff --git a/docs/CouponCreatedEffectProps.md b/docs/CouponCreatedEffectProps.md index 6017224..33d4249 100644 --- a/docs/CouponCreatedEffectProps.md +++ b/docs/CouponCreatedEffectProps.md @@ -1,6 +1,6 @@ # CouponCreatedEffectProps -The properties specific to the \"couponCreated\" effect. This gets triggered whenever a validated rule contained a \"create coupon\" effect, and a coupon was created for a customer. See \"createdCoupons\" on the response for all details of this coupon. +This effect indicates that a coupon was created. For referrals and retention marketing, a common use case is to generate a coupon that can only be redeemed by one specific customer. Handle this effect by notifying the recipient about their new coupon code. ## Properties diff --git a/docs/CouponCreationJob.md b/docs/CouponCreationJob.md index 08cae13..7b36341 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 coupons. | +**attributes** | **object** | Arbitrary properties associated with this campaign. | **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/CustomEffectProps.md b/docs/CustomEffectProps.md index c9bb5d2..d660138 100644 --- a/docs/CustomEffectProps.md +++ b/docs/CustomEffectProps.md @@ -1,6 +1,6 @@ # CustomEffectProps -Effect containing custom payload. +If you want to return data as an effect but no effect matches your use case, you can [create a custom effect](https://docs.talon.one/docs/dev/tutorials/create-custom-effects). Custom effects can be used as both rule effects and failure effects. The structure of a custom effect depends on your specifications but is always named `customEffect`. ## Properties diff --git a/docs/CustomerSession.md b/docs/CustomerSession.md index 812db52..246fdc0 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** | A key-value map of the sessions attributes. The potentially valid attributes are configured in your accounts developer settings. | [optional] +**attributes** | **object** | Arbitrary properties associated with this campaign. | [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/DeductLoyaltyPointsEffectProps.md b/docs/DeductLoyaltyPointsEffectProps.md index ad5885f..bd41346 100644 --- a/docs/DeductLoyaltyPointsEffectProps.md +++ b/docs/DeductLoyaltyPointsEffectProps.md @@ -1,18 +1,18 @@ # DeductLoyaltyPointsEffectProps -The properties specific to the \"deductLoyaltyPoints\" effect. This gets triggered whenever a validated rule contained a condition to only trigger when the given number of loyalty points could be deduced. These points are automatically stored and managed inside Talon.One. +This effect is triggered when a customer redeems loyalty points. The points are deducted from their active point balance. If the loyalty program is card-based, use the `cardIdentifier` property to identify the loyalty card from which these points are deducted. The Rule Engine deducts points in this order: - Points with the earliest expiry date are deducted first, regardless of when they were added. - Points with an unlimited expiry date are deducted last. - For points with an unlimited expiry date, the points awarded first are deducted first. The points only persist when the session is closed. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **rule_title** | **str** | The title of the rule that contained triggered this points deduction. | -**program_id** | **int** | The ID of the loyalty program where these points were added. | -**sub_ledger_id** | **str** | The ID of the subledger within the loyalty program where these points were added. | +**program_id** | **int** | The ID of the loyalty program from which these points were deducted. | +**sub_ledger_id** | **str** | The ID of the subledger within the loyalty program from which these points were deducted. | **value** | **float** | The amount of points that were deducted. | -**transaction_uuid** | **str** | The identifier of this deduction in the loyalty ledger. | -**name** | **str** | The name property gets one of the following two values. It can be the loyalty program name or it can represent a reason for the respective deduction of loyalty points. The latter is an optional value defined in a deduction rule. | -**card_identifier** | **str** | The card on which these points were added. | [optional] +**transaction_uuid** | **str** | The identifier of this loyalty point transaction. | +**name** | **str** | The reason of this loyalty points deduction. | +**card_identifier** | **str** | The identifier of the card from which these points were deducted. | [optional] ## Example diff --git a/docs/ErrorEffectProps.md b/docs/ErrorEffectProps.md index febeaa7..47587ee 100644 --- a/docs/ErrorEffectProps.md +++ b/docs/ErrorEffectProps.md @@ -1,6 +1,6 @@ # ErrorEffectProps -Whenever an error occurred during evaluation, we return an error effect. This should never happen for rules created in the rule builder. +This effect is triggered whenever an error occurs during rule evaluation. This effect only provides information about what the error is. ## Properties diff --git a/docs/Event.md b/docs/Event.md index a93c1df..8fa8b0b 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 additional JSON data associated with the event. | +**attributes** | **object** | Arbitrary properties associated with this campaign. | **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 8ba02d0..75d5bac 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 additional JSON data associated with the event. | +**attributes** | **object** | Arbitrary properties associated with this campaign. | **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/ExperimentConfidenceTimeline.md b/docs/ExperimentConfidenceTimeline.md new file mode 100644 index 0000000..4a57db1 --- /dev/null +++ b/docs/ExperimentConfidenceTimeline.md @@ -0,0 +1,29 @@ +# ExperimentConfidenceTimeline + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[ExperimentConfidenceTimelineDataPoint]**](ExperimentConfidenceTimelineDataPoint.md) | Daily cumulative confidence values ordered chronologically from experiment start to end, or to today if the experiment is still running. Empty if the experiment has no data yet. | + +## Example + +```python +from talon_one.models.experiment_confidence_timeline import ExperimentConfidenceTimeline + +# TODO update the JSON string below +json = "{}" +# create an instance of ExperimentConfidenceTimeline from a JSON string +experiment_confidence_timeline_instance = ExperimentConfidenceTimeline.from_json(json) +# print the JSON string representation of the object +print(ExperimentConfidenceTimeline.to_json()) + +# convert the object into a dict +experiment_confidence_timeline_dict = experiment_confidence_timeline_instance.to_dict() +# create an instance of ExperimentConfidenceTimeline from a dict +experiment_confidence_timeline_from_dict = ExperimentConfidenceTimeline.from_dict(experiment_confidence_timeline_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/ExperimentConfidenceTimelineDataPoint.md b/docs/ExperimentConfidenceTimelineDataPoint.md new file mode 100644 index 0000000..61d0a3a --- /dev/null +++ b/docs/ExperimentConfidenceTimelineDataPoint.md @@ -0,0 +1,30 @@ +# ExperimentConfidenceTimelineDataPoint + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | The date-time this data point represents. | +**confidence** | [**ExperimentVariantResultConfidence**](ExperimentVariantResultConfidence.md) | | + +## Example + +```python +from talon_one.models.experiment_confidence_timeline_data_point import ExperimentConfidenceTimelineDataPoint + +# TODO update the JSON string below +json = "{}" +# create an instance of ExperimentConfidenceTimelineDataPoint from a JSON string +experiment_confidence_timeline_data_point_instance = ExperimentConfidenceTimelineDataPoint.from_json(json) +# print the JSON string representation of the object +print(ExperimentConfidenceTimelineDataPoint.to_json()) + +# convert the object into a dict +experiment_confidence_timeline_data_point_dict = experiment_confidence_timeline_data_point_instance.to_dict() +# create an instance of ExperimentConfidenceTimelineDataPoint from a dict +experiment_confidence_timeline_data_point_from_dict = ExperimentConfidenceTimelineDataPoint.from_dict(experiment_confidence_timeline_data_point_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/Export.md b/docs/Export.md index 613cff7..64b222e 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** | Map of keys and values that were used to filter the exported rows. | +**filter** | **object** | Arbitrary properties associated with this campaign. | ## Example diff --git a/docs/ExtendLoyaltyPointsExpiryDateEffectProps.md b/docs/ExtendLoyaltyPointsExpiryDateEffectProps.md index e0879cd..5d64f28 100644 --- a/docs/ExtendLoyaltyPointsExpiryDateEffectProps.md +++ b/docs/ExtendLoyaltyPointsExpiryDateEffectProps.md @@ -1,13 +1,13 @@ # ExtendLoyaltyPointsExpiryDateEffectProps -The properties specific to the \"extendLoyaltyPointsExpiryDate\" effect. This gets triggered when a validated rule contains the \"extend expiry date\" effect. The current expiry date gets extended by the time frame given in the effect. +If loyalty points have an expiry date, this effect extends the expiry of all active and pending point transactions by a selected duration. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **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. added. | +**sub_ledger_id** | **str** | API name of the loyalty program subledger that contains these points. | **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] diff --git a/docs/Giveaway.md b/docs/Giveaway.md index acecf76..355c5a6 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 giveaway. | [optional] +**attributes** | **object** | Arbitrary properties associated with this campaign. | [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/IncreaseAchievementProgressEffectProps.md b/docs/IncreaseAchievementProgressEffectProps.md index a6f3686..6b30cc4 100644 --- a/docs/IncreaseAchievementProgressEffectProps.md +++ b/docs/IncreaseAchievementProgressEffectProps.md @@ -1,6 +1,6 @@ # IncreaseAchievementProgressEffectProps -The properties specific to the \"increaseAchievementProgress\" effect. This gets triggered whenever a validated rule contained an \"increase customer progress\" effect. +This effect indicates that the customer's progress in an achievement was updated during the current session. It is triggered when a rule using the [Update customer progress](https://docs.talon.one/docs/product/rules/effects/use-effects#update-customer-progress) effect is successfully validated. For [on-completion achievements](https://docs.talon.one/docs/product/campaigns/achievements/achievements-overview#recurring-on-completion-achievements), any customer progress exceeding the target automatically starts a new iteration. This generates a new `progressTrackerId` for each iteration, and there can be multiple progress updates for the same achievement from a single validation of this effect. ## Properties @@ -8,8 +8,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **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. | [optional] -**delta** | **float** | The value by which the customer's current progress in the achievement is increased. | +**progress_tracker_id** | **int** | The internal ID of the customer progress tracker. For [on-completion achievements](https://docs.talon.one/docs/product/campaigns/achievements/achievements-overview#recurring-on-completion-achievements), this effect generates a unique ID for each iteration. | [optional] +**delta** | **float** | The value by which the customer's current progress in the achievement has increased. | **value** | **float** | The current progress of the customer in the achievement. | **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. | diff --git a/docs/IntegrationApi.md b/docs/IntegrationApi.md index 877bfaf..7795f80 100644 --- a/docs/IntegrationApi.md +++ b/docs/IntegrationApi.md @@ -20,6 +20,7 @@ Method | HTTP request | Description [**get_customer_achievements**](IntegrationApi.md#get_customer_achievements) | **GET** /v1/customer_profiles/{integrationId}/achievements | List customer's available achievements [**get_customer_inventory**](IntegrationApi.md#get_customer_inventory) | **GET** /v1/customer_profiles/{integrationId}/inventory | List customer data [**get_customer_session**](IntegrationApi.md#get_customer_session) | **GET** /v2/customer_sessions/{customerSessionId} | Get customer session +[**get_event_v3**](IntegrationApi.md#get_event_v3) | **GET** /v3/events/{integrationId} | Get advanced event [**get_loyalty_balances**](IntegrationApi.md#get_loyalty_balances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/balances | Get customer's loyalty balances [**get_loyalty_card_balances**](IntegrationApi.md#get_loyalty_card_balances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/balances | Get card's point balances [**get_loyalty_card_points**](IntegrationApi.md#get_loyalty_card_points) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/points | List card's unused loyalty points @@ -33,6 +34,7 @@ Method | HTTP request | Description [**return_cart_items**](IntegrationApi.md#return_cart_items) | **POST** /v2/customer_sessions/{customerSessionId}/returns | Return cart items [**sync_catalog**](IntegrationApi.md#sync_catalog) | **PUT** /v1/catalogs/{catalogId}/sync | Sync cart item catalog [**track_event_v2**](IntegrationApi.md#track_event_v2) | **POST** /v2/events | Track event +[**track_event_v3**](IntegrationApi.md#track_event_v3) | **POST** /v3/events | Track advanced event [**unlink_loyalty_card_from_profile**](IntegrationApi.md#unlink_loyalty_card_from_profile) | **POST** /v2/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/unlink_profile | Unlink customer profile from a loyalty card [**update_audience_customers_attributes**](IntegrationApi.md#update_audience_customers_attributes) | **PUT** /v2/audience_customers/{audienceId}/attributes | Update profile attributes for all customers in audience [**update_audience_v2**](IntegrationApi.md#update_audience_v2) | **PUT** /v2/audiences/{audienceId} | Update audience name @@ -705,7 +707,7 @@ void (empty response body) Delete audience -Delete an audience created by a third-party integration. +Delete an audience. > [!warning] This endpoint also removes any associations recorded between a customer profile and this audience. @@ -1519,6 +1521,87 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_event_v3** +> EventV3 get_event_v3(integration_id) + +Get advanced event + +Retrieve an advanced event by its identifier. + + +### Example + +* Api Key Authentication (api_key_v1): + +```python +import talon_one +from talon_one.models.event_v3 import EventV3 +from talon_one.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://yourbaseurl.talon.one +# See configuration.py for a list of all supported configuration parameters. +configuration = talon_one.Configuration( + host = "https://yourbaseurl.talon.one" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: api_key_v1 +configuration.api_key['api_key_v1'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_v1'] = 'Bearer' + +# Enter a context with an instance of the API client +with talon_one.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = talon_one.IntegrationApi(api_client) + integration_id = 'integration_id_example' # str | The unique ID of the advanced event. + + try: + # Get advanced event + api_response = api_instance.get_event_v3(integration_id) + print("The response of IntegrationApi->get_event_v3:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling IntegrationApi->get_event_v3: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integration_id** | **str**| The unique ID of the advanced event. | + +### Return type + +[**EventV3**](EventV3.md) + +### Authorization + +[api_key_v1](../README.md#api_key_v1) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**404** | Not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_loyalty_balances** > LoyaltyBalancesWithTiers get_loyalty_balances(loyalty_program_id, integration_id, end_date=end_date, subledger_id=subledger_id, include_tiers=include_tiers, include_projected_tier=include_projected_tier) @@ -1972,7 +2055,7 @@ with talon_one.ApiClient(configuration) as 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) - subledger_id = 'subledger_id_example' # str | The ID of the subledger by which we filter the data. (optional) + 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) page_size = 50 # int | The number of items in the response. (optional) (default to 50) @@ -1998,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] - **subledger_id** | **str**| The ID of the subledger by which we filter the data. | [optional] + **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] **page_size** | **int**| The number of items in the response. | [optional] [default to 50] @@ -2989,7 +3072,7 @@ Name | Type | Description | Notes Track event -Triggers a custom event. +Trigger a custom event. To use this endpoint: @@ -3093,6 +3176,116 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **track_event_v3** +> IntegrationEventV3Response track_event_v3(integration_event_v3_request, silent=silent, dry=dry, force_complete_evaluation=force_complete_evaluation) + +Track advanced event + +Trigger an advanced event. + +Advanced events are idempotent, uniquely identifiable events. They can also +reference a previously closed session to add more context for rule evaluation. + +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** +> - If the customer profile does not exist, it will be created. However, 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. + + +### Example + +* Api Key Authentication (api_key_v1): + +```python +import talon_one +from talon_one.models.integration_event_v3_request import IntegrationEventV3Request +from talon_one.models.integration_event_v3_response import IntegrationEventV3Response +from talon_one.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://yourbaseurl.talon.one +# See configuration.py for a list of all supported configuration parameters. +configuration = talon_one.Configuration( + host = "https://yourbaseurl.talon.one" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: api_key_v1 +configuration.api_key['api_key_v1'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_v1'] = 'Bearer' + +# Enter a context with an instance of the API client +with talon_one.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = talon_one.IntegrationApi(api_client) + integration_event_v3_request = talon_one.IntegrationEventV3Request() # IntegrationEventV3Request | body + silent = 'yes' # str | Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional) (default to 'yes') + dry = True # bool | Indicates whether to persist the changes. Changes are ignored when `dry=true`. (optional) + force_complete_evaluation = False # bool | Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. (optional) (default to False) + + try: + # Track advanced event + api_response = api_instance.track_event_v3(integration_event_v3_request, silent=silent, dry=dry, force_complete_evaluation=force_complete_evaluation) + print("The response of IntegrationApi->track_event_v3:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling IntegrationApi->track_event_v3: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integration_event_v3_request** | [**IntegrationEventV3Request**](IntegrationEventV3Request.md)| body | + **silent** | **str**| Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. | [optional] [default to 'yes'] + **dry** | **bool**| Indicates whether to persist the changes. Changes are ignored when `dry=true`. | [optional] + **force_complete_evaluation** | **bool**| Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. | [optional] [default to False] + +### Return type + +[**IntegrationEventV3Response**](IntegrationEventV3Response.md) + +### Authorization + +[api_key_v1](../README.md#api_key_v1) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad request | - | +**401** | Unauthorized - Invalid API key | - | +**409** | An advanced event already exists, too many requests, or limit reached. Avoid parallel requests. See the [docs](https://docs.talon.one/docs/dev/tutorials/integrating-talon-one#managing-parallel-requests). | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **unlink_loyalty_card_from_profile** > LoyaltyCard unlink_loyalty_card_from_profile(loyalty_program_id, loyalty_card_id, loyalty_card_registration) diff --git a/docs/IntegrationEvent.md b/docs/IntegrationEvent.md index 414667a..8696a4d 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 additional JSON data associated with the event. | +**attributes** | **object** | Arbitrary properties associated with this campaign. | ## Example diff --git a/docs/IntegrationHubEventPayloadCouponBasedNotifications.md b/docs/IntegrationHubEventPayloadCouponBasedNotifications.md index 67cc520..6ac4a55 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** | | [optional] +**attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] **limits** | [**List[IntegrationHubEventPayloadCouponBasedNotificationsLimits]**](IntegrationHubEventPayloadCouponBasedNotificationsLimits.md) | | [optional] **published_at** | **datetime** | Timestamp when the event was published. | **source_of_event** | **str** | | diff --git a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md deleted file mode 100644 index 637fd3e..0000000 --- a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md +++ /dev/null @@ -1,44 +0,0 @@ -# IntegrationHubEventPayloadLoyaltyProfileBasedNotification - - -## 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. | -**employee_name** | **str** | | [optional] -**user_id** | **int** | | [optional] -**current_points** | **float** | | -**actions** | [**List[IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction]**](IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md) | | [optional] -**published_at** | **datetime** | Timestamp when the event was published. | -**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] - -## Example - -```python -from talon_one.models.integration_hub_event_payload_loyalty_profile_based_notification import IntegrationHubEventPayloadLoyaltyProfileBasedNotification - -# TODO update the JSON string below -json = "{}" -# create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedNotification from a JSON string -integration_hub_event_payload_loyalty_profile_based_notification_instance = IntegrationHubEventPayloadLoyaltyProfileBasedNotification.from_json(json) -# print the JSON string representation of the object -print(IntegrationHubEventPayloadLoyaltyProfileBasedNotification.to_json()) - -# convert the object into a dict -integration_hub_event_payload_loyalty_profile_based_notification_dict = integration_hub_event_payload_loyalty_profile_based_notification_instance.to_dict() -# create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedNotification from a dict -integration_hub_event_payload_loyalty_profile_based_notification_from_dict = IntegrationHubEventPayloadLoyaltyProfileBasedNotification.from_dict(integration_hub_event_payload_loyalty_profile_based_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/IntegrationHubEventRecord.md b/docs/IntegrationHubEventRecord.md index 4d9ca9b..467d329 100644 --- a/docs/IntegrationHubEventRecord.md +++ b/docs/IntegrationHubEventRecord.md @@ -5,15 +5,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | -**flow_id** | **int** | | -**event_type** | **str** | | -**event_data** | **object** | | -**published_at** | **datetime** | | -**processed_at** | **datetime** | | [optional] -**delivered_at** | **datetime** | | [optional] -**process_after** | **datetime** | | -**retry** | **int** | | +**id** | **int** | ID of the event record. | +**flow_id** | **int** | ID of the integration hub flow. | +**integration_name** | **str** | Name of the integration. | [optional] +**instance_name** | **str** | Name of the integration instance. | [optional] +**event_type** | [**IntegrationHubEventType**](IntegrationHubEventType.md) | | +**published_at** | **datetime** | Timestamp when the event was published. | +**processed_at** | **datetime** | Timestamp when the event was processed. | [optional] +**delivered_at** | **datetime** | Timestamp when the event was delivered. | [optional] +**scheduled_to** | **datetime** | Timestamp after which the event is scheduled to be processed. | +**retry** | **int** | Number of delivery retries attempted. | +**payload** | **str** | The event payload as a formatted JSON string. | ## Example diff --git a/docs/IntegrationHubEventType.md b/docs/IntegrationHubEventType.md new file mode 100644 index 0000000..5737532 --- /dev/null +++ b/docs/IntegrationHubEventType.md @@ -0,0 +1,21 @@ +# IntegrationHubEventType + +The type of integration hub event. + +## Enum + +* `LOYALTYPOINTSCHANGED` (value: `'LoyaltyPointsChanged'`) + +* `LOYALTYTIERDOWNGRADE` (value: `'LoyaltyTierDowngrade'`) + +* `LOYALTYTIERUPGRADE` (value: `'LoyaltyTierUpgrade'`) + +* `COUPONCREATED` (value: `'CouponCreated'`) + +* `COUPONUPDATED` (value: `'CouponUpdated'`) + +* `COUPONDELETED` (value: `'CouponDeleted'`) + +[[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/IntegrationHubFlow.md b/docs/IntegrationHubFlow.md index 9987310..c6c0a7d 100644 --- a/docs/IntegrationHubFlow.md +++ b/docs/IntegrationHubFlow.md @@ -5,8 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**application_id** | **int** | ID of application the flow is registered for. | [optional] -**event_type** | **str** | The event type we want to register a flow for. | +**application_id** | **int** | ID of the application the flow is registered for. | [optional] +**loyalty_program_id** | **int** | ID of the loyalty program the flow is registered for. | [optional] +**event_type** | [**IntegrationHubEventType**](IntegrationHubEventType.md) | | **integration_hub_flow_url** | **str** | The URL of the integration hub flow that we want to trigger for the event. | ## Example diff --git a/docs/IntegrationHubFlowResponse.md b/docs/IntegrationHubFlowResponse.md index 0144ba6..760330e 100644 --- a/docs/IntegrationHubFlowResponse.md +++ b/docs/IntegrationHubFlowResponse.md @@ -6,7 +6,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | ID of the integration hub flow. | -**application_id** | **int** | ID of application the flow is registered for. | [optional] +**integration_name** | **str** | Name of the integration. | [optional] +**instance_name** | **str** | Name of the integration instance. | [optional] +**created_at** | **datetime** | Timestamp when the flow was created. | +**disabled_until** | **datetime** | Timestamp until which the flow is disabled. Null when the flow is active. | [optional] +**application_id** | **int** | ID of the application the flow is registered for. | [optional] +**loyalty_program_id** | **int** | ID of the loyalty program the flow is registered for. | [optional] **event_type** | **str** | The event type we want to register a flow for. | **integration_hub_flow_url** | **str** | The URL of the integration hub flow that we want to trigger for the event. | **config** | [**IntegrationHubFlowConfigResponse**](IntegrationHubFlowConfigResponse.md) | | diff --git a/docs/IntegrationHubFlowWithConfig.md b/docs/IntegrationHubFlowWithConfig.md index 54b4a3a..602b33d 100644 --- a/docs/IntegrationHubFlowWithConfig.md +++ b/docs/IntegrationHubFlowWithConfig.md @@ -5,8 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**application_id** | **int** | ID of application the flow is registered for. | [optional] -**event_type** | **str** | The event type we want to register a flow for. | +**application_id** | **int** | ID of the application the flow is registered for. | [optional] +**loyalty_program_id** | **int** | ID of the loyalty program the flow is registered for. | [optional] +**event_type** | [**IntegrationHubEventType**](IntegrationHubEventType.md) | | **integration_hub_flow_url** | **str** | The URL of the integration hub flow that we want to trigger for the event. | **config** | [**IntegrationHubFlowConfig**](IntegrationHubFlowConfig.md) | | diff --git a/docs/IntegrationHubPaginatedEventPayload.md b/docs/IntegrationHubPaginatedEventPayload.md index 3e0f5f8..18f67cc 100644 --- a/docs/IntegrationHubPaginatedEventPayload.md +++ b/docs/IntegrationHubPaginatedEventPayload.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **total_result_size** | **int** | | **batched_at** | **datetime** | Timestamp when the batch was created. | [optional] -**event_type** | **str** | | +**event_type** | [**IntegrationHubEventType**](IntegrationHubEventType.md) | | **data** | **List[object]** | | ## Example diff --git a/docs/InventoryReferral.md b/docs/InventoryReferral.md index 3ee0143..f97324b 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 item. | [optional] +**attributes** | **object** | Arbitrary properties associated with this campaign. | [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/ManagementApi.md b/docs/ManagementApi.md index 3661e59..2e922c4 100644 --- a/docs/ManagementApi.md +++ b/docs/ManagementApi.md @@ -138,6 +138,7 @@ Method | HTTP request | Description [**import_coupons**](ManagementApi.md#import_coupons) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/import_coupons | Import coupons [**import_loyalty_cards**](ManagementApi.md#import_loyalty_cards) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/import_cards | Import loyalty cards [**import_loyalty_customers_tiers**](ManagementApi.md#import_loyalty_customers_tiers) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/import_customers_tiers | Import customers into loyalty tiers +[**import_loyalty_join_dates**](ManagementApi.md#import_loyalty_join_dates) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/import_join_dates | Import join dates for a loyalty program [**import_loyalty_points**](ManagementApi.md#import_loyalty_points) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/import_points | Import loyalty points [**import_pool_giveaways**](ManagementApi.md#import_pool_giveaways) | **POST** /v1/giveaways/pools/{poolId}/import | Import giveaway codes into a giveaway pool [**import_referrals**](ManagementApi.md#import_referrals) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/import_referrals | Import referrals @@ -4171,7 +4172,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **export_customer_sessions** -> str export_customer_sessions(application_id, created_before=created_before, created_after=created_after, profile_integration_id=profile_integration_id, date_format=date_format, customer_session_state=customer_session_state) +> str export_customer_sessions(application_id, created_before=created_before, created_after=created_after, updated_before=updated_before, updated_after=updated_after, profile_integration_id=profile_integration_id, date_format=date_format, customer_session_state=customer_session_state) Export customer sessions @@ -4240,13 +4241,15 @@ with talon_one.ApiClient(configuration) as api_client: application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. created_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) created_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) + updated_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) + updated_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) profile_integration_id = 'profile_integration_id_example' # str | Only return sessions for the customer that matches this customer integration ID. (optional) date_format = 'date_format_example' # str | Determines the format of dates in the export document. (optional) customer_session_state = 'customer_session_state_example' # str | Filter results by state. (optional) try: # Export customer sessions - api_response = api_instance.export_customer_sessions(application_id, created_before=created_before, created_after=created_after, profile_integration_id=profile_integration_id, date_format=date_format, customer_session_state=customer_session_state) + api_response = api_instance.export_customer_sessions(application_id, created_before=created_before, created_after=created_after, updated_before=updated_before, updated_after=updated_after, profile_integration_id=profile_integration_id, date_format=date_format, customer_session_state=customer_session_state) print("The response of ManagementApi->export_customer_sessions:\n") pprint(api_response) except Exception as e: @@ -4263,6 +4266,8 @@ Name | Type | Description | Notes **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | **created_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. | [optional] **created_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. | [optional] + **updated_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. | [optional] + **updated_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. | [optional] **profile_integration_id** | **str**| Only return sessions for the customer that matches this customer integration ID. | [optional] **date_format** | **str**| Determines the format of dates in the export document. | [optional] **customer_session_state** | **str**| Filter results by state. | [optional] @@ -4902,7 +4907,7 @@ The CSV file contains the following columns: - `blockreason`: The reason for transferring and blocking the loyalty card. - `generated`: An indicator of whether the loyalty card was generated. - `batchid`: The ID of the batch the loyalty card is in. -- `attributes`: The custom attributes of this loyalty card. Currently, this feature is only available upon request. +- `attributes`: The custom attributes of this loyalty card. ### Example @@ -7524,7 +7529,7 @@ configuration.api_key['api_key_v1'] = os.environ["API_KEY"] with talon_one.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = talon_one.ManagementApi(api_client) - audience_ids = 'audience_ids_example' # str | The IDs of one or more audiences, separated by commas, by which to filter results. + audience_ids = 'audience_ids_example' # str | The IDs of one or more audiences, separated by commas, by which to filter results. Do not provide more than 1000 audience IDs. sort = 'sort_example' # str | The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. (optional) try: @@ -7543,7 +7548,7 @@ with talon_one.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **audience_ids** | **str**| The IDs of one or more audiences, separated by commas, by which to filter results. | + **audience_ids** | **str**| The IDs of one or more audiences, separated by commas, by which to filter results. Do not provide more than 1000 audience IDs. | **sort** | **str**| The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. | [optional] ### Return type @@ -12138,14 +12143,17 @@ which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). +- `attributes` (optional): A JSON object that contains the loyalty card's custom +attributes and their values. These attributes must be created and connected to this +loyalty program before they can be assigned to the cards through this endpoint. > [!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds. ## Example ```csv -identifier,state,customerprofileids -123-456-789AT,active,Alexa001;UserA +identifier,state,customerprofileids,attributes +123-456-789AT,active,Alexa001;UserA,'{""my_attributes"": ""10_off""}" ``` @@ -12356,6 +12364,117 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **import_loyalty_join_dates** +> ModelImport import_loyalty_join_dates(loyalty_program_id, up_file=up_file) + +Import join dates for a loyalty program + +Upload a CSV file containing customer profile IDs and their join dates for the +specified loyalty program. Send the file as multipart data. + +> [!important] This endpoint only works with profile-based loyalty programs. + +The CSV file **must** contain the following columns: + +- `customerprofileid`: The integration ID of the customer profile whose join + date you want to update. +- `newjoindate`: The new join date for the customer in RFC3339 format. You + can use the time zone of your choice. It is converted to UTC internally + by Talon.One. + +**Note**: +- Customer profiles must already exist. If a referenced profile does not exist, the import fails with a `400` error. +- If a join date already exists for a profile, the uploaded date replaces it. + +> [!note] We recommend limiting your file size to 500 MB. + +## Example + +```csv +customerprofileid,newjoindate +customer1,2024-03-21T07:32:14Z +customer2,2025-04-16T21:12:37Z +customer3,2026-05-03T11:47:01Z +``` + + +### Example + +* Api Key Authentication (api_key_v1): + +```python +import talon_one +from talon_one.models.model_import import ModelImport +from talon_one.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://yourbaseurl.talon.one +# See configuration.py for a list of all supported configuration parameters. +configuration = talon_one.Configuration( + host = "https://yourbaseurl.talon.one" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: api_key_v1 +configuration.api_key['api_key_v1'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_v1'] = 'Bearer' + +# Enter a context with an instance of the API client +with talon_one.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = talon_one.ManagementApi(api_client) + 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. + up_file = None # bytes | The CSV file containing the data that is being imported. (optional) + + try: + # Import join dates for a loyalty program + api_response = api_instance.import_loyalty_join_dates(loyalty_program_id, up_file=up_file) + print("The response of ManagementApi->import_loyalty_join_dates:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->import_loyalty_join_dates: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loyalty_program_id** | **int**| Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | + **up_file** | **bytes**| The CSV file containing the data that is being imported. | [optional] + +### Return type + +[**ModelImport**](ModelImport.md) + +### Authorization + +[api_key_v1](../README.md#api_key_v1) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad request | - | +**401** | Unauthorized | - | +**404** | Not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **import_loyalty_points** > ModelImport import_loyalty_points(loyalty_program_id, notifications_enabled=notifications_enabled, up_file=up_file) @@ -13076,7 +13195,7 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_application_cart_item_filters** -> ListApplicationCartItemFilters200Response list_application_cart_item_filters(application_id, page_size=page_size, skip=skip, title=title) +> ListApplicationCartItemFilters200Response list_application_cart_item_filters(application_id, page_size=page_size, skip=skip, name=name) List Application cart item filters @@ -13116,11 +13235,11 @@ with talon_one.ApiClient(configuration) as api_client: application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. page_size = 50 # int | The number of items in the response. (optional) (default to 50) skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - title = 'title_example' # str | Filter by the display name of the Application cart item filter in the Application. **Note**: If no `title` is provided, all the Application cart item filters in the Application are returned. (optional) + name = 'name_example' # str | Filter by the display name of the Application cart item filter in the Application. **Note**: If no `name` is provided, all the Application cart item filters in the Application are returned. (optional) try: # List Application cart item filters - api_response = api_instance.list_application_cart_item_filters(application_id, page_size=page_size, skip=skip, title=title) + api_response = api_instance.list_application_cart_item_filters(application_id, page_size=page_size, skip=skip, name=name) print("The response of ManagementApi->list_application_cart_item_filters:\n") pprint(api_response) except Exception as e: @@ -13137,7 +13256,7 @@ Name | Type | Description | Notes **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | **page_size** | **int**| The number of items in the response. | [optional] [default to 50] **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **title** | **str**| Filter by the display name of the Application cart item filter in the Application. **Note**: If no `title` is provided, all the Application cart item filters in the Application are returned. | [optional] + **name** | **str**| Filter by the display name of the Application cart item filter in the Application. **Note**: If no `name` is provided, all the Application cart item filters in the Application are returned. | [optional] ### Return type diff --git a/docs/NewCouponCreationJob.md b/docs/NewCouponCreationJob.md index d39e102..8fc429c 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 coupons. | +**attributes** | **object** | Arbitrary properties associated with this campaign. | **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 bb0c3ff..d6efd55 100644 --- a/docs/NewCoupons.md +++ b/docs/NewCoupons.md @@ -13,7 +13,7 @@ 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 item. | [optional] +**attributes** | **object** | Arbitrary properties associated with this campaign. | [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] diff --git a/docs/NewCouponsForMultipleRecipients.md b/docs/NewCouponsForMultipleRecipients.md index 120de0b..ec7eb94 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 item. | [optional] +**attributes** | **object** | Arbitrary properties associated with this campaign. | [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 dc01b90..85db563 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** | A key-value map of the sessions attributes. The potentially valid attributes are configured in your accounts developer settings. | [optional] +**attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] ## Example diff --git a/docs/NewEvent.md b/docs/NewEvent.md index 09189f9..aaaf4c3 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 additional JSON data associated with the event. | +**attributes** | **object** | Arbitrary properties associated with this campaign. | **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 36e015e..8b552b4 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 item. | [optional] +**attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] ## Example diff --git a/docs/NewReferralsForMultipleAdvocates.md b/docs/NewReferralsForMultipleAdvocates.md index 509632e..506ac0b 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 referral code. | [optional] +**attributes** | **object** | Arbitrary properties associated with this campaign. | [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/RedeemReferralEffectProps.md b/docs/RedeemReferralEffectProps.md index 8faa9e1..6130010 100644 --- a/docs/RedeemReferralEffectProps.md +++ b/docs/RedeemReferralEffectProps.md @@ -1,6 +1,6 @@ # RedeemReferralEffectProps -This effect is **deprecated**. The properties specific to the \"redeemReferral\" effect. This gets triggered whenever the referral code is valid, and a rule was triggered that contains a \"redeem referral\" effect. +This effect is **deprecated**. It has been replaced by the `acceptReferral` effect. This effect indicates that the referral code is valid and has been redeemed. ## Properties diff --git a/docs/Referral.md b/docs/Referral.md index f4a461a..8d2d7ce 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 item. | [optional] +**attributes** | **object** | Arbitrary properties associated with this campaign. | [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/ReferralCreatedEffectProps.md b/docs/ReferralCreatedEffectProps.md index bef82a7..645b895 100644 --- a/docs/ReferralCreatedEffectProps.md +++ b/docs/ReferralCreatedEffectProps.md @@ -1,12 +1,12 @@ # ReferralCreatedEffectProps -The properties specific to the \"referralCreated\" effect. This gets triggered whenever a validated rule contained a \"create referral\" effect, and a referral code was created for a customer. See \"createdReferrals\" on the response for all details of this referral code. +The `referralCreated` effect behaves similarly to [couponCreated](https://docs.talon.one/docs/dev/integration-api/api-effects#couponcreated). If the `friendProfileIntegrationId` parameter is empty, the referral code can be redeemed by anyone. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The referral code that was created. | +**value** | **str** | The referral code provided in the session. | ## Example diff --git a/docs/RejectCouponEffectProps.md b/docs/RejectCouponEffectProps.md index eda1b1f..ea86ea9 100644 --- a/docs/RejectCouponEffectProps.md +++ b/docs/RejectCouponEffectProps.md @@ -1,17 +1,17 @@ # RejectCouponEffectProps -The properties specific to the \"rejectCoupon\" effect. This gets triggered whenever the coupon was rejected. See rejectionReason for more info on why. +This effect indicates that the coupon code supplied couldn't be used. You should handle this effect by informing their user the coupon code is invalid. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The coupon code that was rejected. | -**rejection_reason** | **str** | The reason why this coupon was rejected. | +**rejection_reason** | **str** | The reason why the code was rejected. - `CampaignLimitReached`: The campaign-wide coupon code redemption limit has been reached. - `CouponExpired`: The coupon is expired. - `CouponLimitReached`: The coupon redemption limit or a campaign budget was reached. - `CouponNotFound`: The coupon code is incorrect. - `CouponPartOfNotRunningCampaign`: The campaign the coupon belongs to is currently not active. The campaignId field contains the ID of that campaign. - `CouponRecipientDoesNotMatch`: The given coupon value does not match the recipient or the coupon is linked to a `recipientIntegrationID` but there is no profile in the session. - `CouponRejectedByCondition`: Other conditions failed in the rule or all conditions passed but the `Coupon code is valid` condition is not present. - `CouponStartDateInFuture`: The coupon isn't active yet. - `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` cannot be applied because a discount limit is reached). - `ProfileLimitReached`: The profile-specific coupon redemption limit has been reached. - `CouponPartOfNotTriggeredCampaign`: The campaign the coupon belongs to was not triggered during evaluation (an exclusive or stackable campaign). The `campaignId` field contains the ID of that campaign. - `CouponReservationRequired`: The coupon's `isReservationMandatory` property is `true`, but the profile does not have a reservation. - `ProfileRequired`: The coupon's `isReservationMandatory` property is `true` or a [campaign profile budget](https://docs.talon.one/docs/product/campaigns/settings/manage-campaign-budgets) was set, but no profile exists in the session. | **condition_index** | **int** | The index of the condition that caused the rejection of the coupon. | [optional] **effect_index** | **int** | The index of the effect that caused the rejection of the coupon. | [optional] **details** | **str** | More details about the failure. | [optional] -**campaign_exclusion_reason** | **str** | The reason why the campaign was not applied. | [optional] +**campaign_exclusion_reason** | **str** | The reason why the campaign the coupon 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 coupon 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 coupon is part of an archived campaign. | [optional] ## Example diff --git a/docs/RejectReferralEffectProps.md b/docs/RejectReferralEffectProps.md index 5c38c3d..6674b4b 100644 --- a/docs/RejectReferralEffectProps.md +++ b/docs/RejectReferralEffectProps.md @@ -1,17 +1,17 @@ # RejectReferralEffectProps -The properties specific to the \"rejectReferral\" effect. This gets triggered whenever the referral code was rejected. See rejectionReason for more info on why. +This effect indicates that the provided referral code is invalid. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The referral code that was rejected. | -**rejection_reason** | **str** | The reason why this referral code was rejected. | +**value** | **str** | The referral code that was rejected | +**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 was not applied. | [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] ## Example diff --git a/docs/RemoveFromAudienceEffectProps.md b/docs/RemoveFromAudienceEffectProps.md index 9317a63..621f3c2 100644 --- a/docs/RemoveFromAudienceEffectProps.md +++ b/docs/RemoveFromAudienceEffectProps.md @@ -1,6 +1,6 @@ # RemoveFromAudienceEffectProps -The properties specific to the \"removeFromAudience\" effect. This gets triggered whenever a validated rule contains a \"removeFromAudience\" effect. +This effect is triggered when a rule containing an [Update audience](https://docs.talon.one/docs/product/rules/effects/use-effects#update-an-audience) effect with **Remove customer from an audience** selected is validated. It indicates that a customer was removed from an audience and is returned when a customer session is opened, updated, or closed. ## Properties diff --git a/docs/ReserveCouponEffectProps.md b/docs/ReserveCouponEffectProps.md index 4608fee..7602f1b 100644 --- a/docs/ReserveCouponEffectProps.md +++ b/docs/ReserveCouponEffectProps.md @@ -1,13 +1,13 @@ # ReserveCouponEffectProps -The properties specific to the \"reserveCoupon\" effect. This gets triggered whenever a validated rule contained a \"reserve coupon\" effect. This reserves the coupon currently on scope to the profile on scope. +This effect indicates that the given coupon code was reserved for the given customer. Talon.One provides soft and hard reservations. For more information, see [Reserve a coupon code](https://docs.talon.one/docs/product/rules/effects/use-effects#reserve-a-coupon-code). ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**coupon_value** | **str** | The value of the coupon currently on scope. | -**profile_integration_id** | **str** | The ID of this customer profile in the third-party integration. | +**coupon_value** | **str** | The coupon code that was created. | +**profile_integration_id** | **str** | The integration identifier of the customer for whom this coupon was reserved. | **is_new_reservation** | **bool** | Indicates whether this is a new coupon reservation or not. | ## Example diff --git a/docs/RoleV2ApplicationDetails.md b/docs/RoleV2ApplicationDetails.md index fcfd503..43c8c3f 100644 --- a/docs/RoleV2ApplicationDetails.md +++ b/docs/RoleV2ApplicationDetails.md @@ -9,7 +9,6 @@ Name | Type | Description | Notes **campaign** | **str** | Name of the campaign-related permission set for the given Application. | [optional] **draft_campaign** | **str** | Name of the draft campaign-related permission set for the given Application. | [optional] **tools** | **str** | Name of the tools-related permission set. | [optional] -**thresholds** | [**RolesV2Thresholds**](RolesV2Thresholds.md) | Support user limits for actions that require admin approval within the given application. | [optional] ## Example diff --git a/docs/RoleV2Permissions.md b/docs/RoleV2Permissions.md index f3c18b8..a68ab5e 100644 --- a/docs/RoleV2Permissions.md +++ b/docs/RoleV2Permissions.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **permission_sets** | [**List[RoleV2PermissionSet]**](RoleV2PermissionSet.md) | List of grouped logical operations referenced by roles. | [optional] **roles** | [**RoleV2RolesGroup**](RoleV2RolesGroup.md) | | [optional] +**thresholds** | [**List[RolesV2Thresholds]**](RolesV2Thresholds.md) | Support user limits for actions that require admin approval within the given application. | [optional] ## Example diff --git a/docs/RolesV2Thresholds.md b/docs/RolesV2Thresholds.md index 53531f9..bd30f3a 100644 --- a/docs/RolesV2Thresholds.md +++ b/docs/RolesV2Thresholds.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**loyalty_program_id** | **int** | Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | [optional] **loyalty_points_limit** | **int** | Maximum number of loyalty points a support user can award without approval. | [optional] ## Example diff --git a/docs/RollbackAddedLoyaltyPointsEffectProps.md b/docs/RollbackAddedLoyaltyPointsEffectProps.md index b54d28d..6fa9c1c 100644 --- a/docs/RollbackAddedLoyaltyPointsEffectProps.md +++ b/docs/RollbackAddedLoyaltyPointsEffectProps.md @@ -1,19 +1,19 @@ # RollbackAddedLoyaltyPointsEffectProps -The properties specific to the \"rollbackAddedLoyaltyPoints\" effect. This gets triggered whenever previously a closed session with an addLoyaltyPoints effect is cancelled. +This effect is triggered in the following cases: - A session was cancelled in which loyalty points have been added. - A session was partially returned and loyalty point were added by the returned items. See [returning items](https://docs.talon.one/docs/dev/tutorials/partially-return-a-session). If you use the [Add loyalty points per item effect](https://docs.talon.one/docs/product/rules/effects/available-effects#reward-effects), use the `cartItemPosition` property to identify which items the loyalty points were rolled back for. If you use **Add loyalty points per item** and if the session contains some cart items with _quantity > 1_, use the `cartItemSubPosition` property to identify the item unit in its line item. If the loyalty program is [profile-based](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types), use the `recipientIntegrationId` property to identify the user for whom the loyalty points are rolled back. If the loyalty program is [card-based](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types), use the `cardIdentifier` property to identify the loyalty card where the points were originally added. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**program_id** | **int** | The ID of the loyalty program where the points were originally added. | -**sub_ledger_id** | **str** | The ID of the subledger within the loyalty program where these points were originally added. | +**program_id** | **int** | The ID of the loyalty program where these points were rolled back. | +**sub_ledger_id** | **str** | The ID of the subledger within the loyalty program where these points were rolled back. | **value** | **float** | The amount of points that were rolled back. | -**recipient_integration_id** | **str** | The user for whom these points were originally added. | -**transaction_uuid** | **str** | The identifier of 'deduction' entry added to the ledger as the `addLoyaltyPoints` effect is rolled back. | -**cart_item_position** | **float** | The index of the item in the cart items for which the loyalty points were rolled back. | [optional] -**cart_item_sub_position** | **float** | For cart items with `quantity` > 1, the sub-position indicates to which item the loyalty points were rolled back. | [optional] -**card_identifier** | **str** | The card on which these points were originally added. | [optional] +**recipient_integration_id** | **str** | The user for whom these points were rolled back. | +**transaction_uuid** | **str** | The identifier of this loyalty point transaction. | +**cart_item_position** | **float** | (_Add points per cart item_ only.) The index of the item in the `cartItem` object for which these points were rolled back. | [optional] +**cart_item_sub_position** | **float** | (_Add points per cart item_ ) The index of the item unit in its line item. | [optional] +**card_identifier** | **str** | The identifier of the card on which these points were originally added. | [optional] ## Example diff --git a/docs/RollbackCouponEffectProps.md b/docs/RollbackCouponEffectProps.md index 2d024f2..2fe2e8a 100644 --- a/docs/RollbackCouponEffectProps.md +++ b/docs/RollbackCouponEffectProps.md @@ -1,12 +1,12 @@ # RollbackCouponEffectProps -The properties specific to the \"rollbackCoupon\" effect. This gets triggered whenever previously closed session is now cancelled and a coupon redemption was cancelled on our internal usage limit counters. +This effect indicates that a coupon code redemption has been rolled back. The coupon becomes redeemable again. The effect is triggered when you [cancel](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#manage-the-sessions-state) a session where a coupon was accepted. See an example of use in the [cancelling a session tutorial](https://docs.talon.one/docs/dev/tutorials/roll-back-effects). ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The coupon code whose usage has been rolled back. | +**value** | **str** | The coupon code whose redemption has been rolled back. | ## Example diff --git a/docs/RollbackDeductedLoyaltyPointsEffectProps.md b/docs/RollbackDeductedLoyaltyPointsEffectProps.md index 45384f7..442a8f4 100644 --- a/docs/RollbackDeductedLoyaltyPointsEffectProps.md +++ b/docs/RollbackDeductedLoyaltyPointsEffectProps.md @@ -1,6 +1,6 @@ # RollbackDeductedLoyaltyPointsEffectProps -The properties specific to the \"rollbackDeductedLoyaltyPoints\" effect. This effect is triggered whenever a previously closed session is cancelled and a deductLoyaltyPoints effect was revoked. +This effect is triggered in the following cases: - A session is _cancelled_ and this session deducted loyalty points. The rollback action returns the redeemed loyalty points to the customer. - A session is impacted by a _partial return_. Only added loyalty points that are still **pending** are rolled back. - A session in which loyalty points were spent is reopened. See the [session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states). If you set custom activation and expiration dates for the loyalty points, use the `startDate` and `expiryDate` properties to identify when the reward will be active and when will expire. If the loyalty program is [profile-based](https://docs.talon.one/docs/product/loyalty-programs/profile-based/profile-based-overview), use the `recipientIntegrationId` property to identify the user who receives the loyalty points. If the loyalty program is [card-based](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types), use the `cardIdentifier` property to identify the loyalty card where the points are reimbursed. ## Properties @@ -8,12 +8,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **program_id** | **int** | The ID of the loyalty program where these points were reimbursed. | **sub_ledger_id** | **str** | The ID of the subledger within the loyalty program where these points were reimbursed. | -**value** | **float** | The amount of reimbursed points that were added. | +**value** | **float** | The amount of points that were reimbursed. | **recipient_integration_id** | **str** | The user for whom these points were reimbursed. | -**start_date** | **datetime** | Date after which the reimbursed points will be valid. | [optional] -**expiry_date** | **datetime** | Date after which the reimbursed points will expire. | [optional] -**transaction_uuid** | **str** | The identifier of 'addition' entries added to the ledger as the `deductLoyaltyPoints` effect is rolled back. | -**card_identifier** | **str** | The card on which these points were added. | [optional] +**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. | +**card_identifier** | **str** | The identifier of the card from which these points were originally deducted. | [optional] ## Example diff --git a/docs/RollbackDiscountEffectProps.md b/docs/RollbackDiscountEffectProps.md index 456aa58..808e3fa 100644 --- a/docs/RollbackDiscountEffectProps.md +++ b/docs/RollbackDiscountEffectProps.md @@ -1,18 +1,18 @@ # RollbackDiscountEffectProps -The properties specific to the \"rollbackDiscount\" effect. This gets triggered whenever previously closed session is now cancelled or partially returned and a setDiscount effect was cancelled on our internal discount limit counters. +This effect indicates that a discounted session, cart item, or additional cost has been cancelled or partially returned. This effect can only happen when you set the status of a session to `cancel` or the status changes to `partially_returned`. If the session contains some cart items with _quantity > 1_, use the `cartItemSubPosition` property to identify the specific item unit in its line item. See the example below. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **str** | The name of the \"setDiscount\" effect that was rolled back. | -**value** | **float** | The value of the discount that was rolled back. | -**cart_item_position** | **float** | The index of the item in the cart items for which the discount was rolled back. | [optional] -**cart_item_sub_position** | **float** | For cart items with `quantity` > 1, the subposition returns the index of the item unit in its line item. | [optional] -**additional_cost_id** | **int** | The ID of the additional cost that was rolled back. | [optional] -**additional_cost** | **str** | The name of the additional cost that was rolled back. | [optional] -**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] +**name** | **str** | The name of the discount effect that was rolled back. | +**value** | **float** | The monetary value of the discount that was rolled back. | +**cart_item_position** | **float** | The index of the item in the `cartItem` object whose discount was rolled back, or the unit containing the additional cost whose discount was rolled back. | [optional] +**cart_item_sub_position** | **float** | The index of the item unit in its line item for which the discount was rolled back. | [optional] +**additional_cost_id** | **int** | _Only when rolling back [setDiscountPerAdditionalCost](https://docs.talon.one/docs/dev/integration-api/api-effects#setdiscountperadditionalcost) and [setDiscountPerAdditionalCostPerItem](https://docs.talon.one/docs/dev/integration-api/api-effects#setdiscountperadditionalcostperitem)_ The ID of the additional cost to be discounted. | [optional] +**additional_cost** | **str** | The API name of the additional cost whose discount was rolled back. | [optional] +**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] ## Example diff --git a/docs/RollbackIncreasedAchievementProgressEffectProps.md b/docs/RollbackIncreasedAchievementProgressEffectProps.md index ba9da75..9d35697 100644 --- a/docs/RollbackIncreasedAchievementProgressEffectProps.md +++ b/docs/RollbackIncreasedAchievementProgressEffectProps.md @@ -1,6 +1,6 @@ # RollbackIncreasedAchievementProgressEffectProps -The properties specific to the \"rollbackIncreasedAchievementProgress\" effect. This gets triggered whenever a closed session where the `increaseAchievementProgress` effect was triggered is cancelled. This is applicable only when the customer has not completed the achievement. +This effect indicates that the customer's progress in an achievement was rolled back. The Rule Engine triggers this effect when you cancel or [reopen a customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/reopenCustomerSession) that previously validated the [Update customer progress](https://docs.talon.one/docs/product/rules/effects/use-effects#update-customer-progress) effect and triggered the [increaseAchievementProgress](https://docs.talon.one/docs/dev/integration-api/api-effects#increaseachievementprogress) API effect. The effect is also triggered for completed achievements if the **Allow progress rollback for completed achievements** setting is enabled. You can enable this through the [Campaign Manager](https://docs.talon.one/docs/product/campaigns/achievements/manage-achievements) or the [Management API](https://docs.talon.one/management-api#tag/Achievements/operation/createAchievement) by setting the `achievementAllowRollbackAfterCompletion` property to `true`. This setting only applies to one-time and recurring on expiration achievements. ## Properties @@ -9,7 +9,7 @@ Name | Type | Description | Notes **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. | -**decrease_progress_by** | **float** | The value by which the customer's current progress in the achievement is decreased. | +**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. | **target** | **float** | The target value to complete the achievement. | diff --git a/docs/RollbackReferralEffectProps.md b/docs/RollbackReferralEffectProps.md index ea83311..1bebf28 100644 --- a/docs/RollbackReferralEffectProps.md +++ b/docs/RollbackReferralEffectProps.md @@ -1,12 +1,12 @@ # RollbackReferralEffectProps -The properties specific to the \"rollbackReferral\" effect. This gets triggered whenever previously closed session is now cancelled and a referral redemption was cancelled on our internal usage limit counters. +This effect indicates that the redemption of the referral code has been rolled back. It triggers when a closed session that redeemed a referral is gets cancelled. The code becomes redeemable again. For more information about session states, see [Managing states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states). ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The referral code whose usage has been rolled back. | +**value** | **str** | The referral code to be rolled back. | ## Example diff --git a/docs/ScimServiceProviderConfigResponse.md b/docs/ScimServiceProviderConfigResponse.md index 9712d85..705c07e 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** | [**ScimServiceProviderConfigResponsePatch**](ScimServiceProviderConfigResponsePatch.md) | | [optional] +**patch** | [**ScimServiceProviderConfigResponseChangePassword**](ScimServiceProviderConfigResponseChangePassword.md) | | [optional] **schemas** | **List[str]** | A list of SCIM schemas that define the structure and data types supported by the service provider. | [optional] -**sort** | [**ScimServiceProviderConfigResponseSort**](ScimServiceProviderConfigResponseSort.md) | | [optional] +**sort** | [**ScimServiceProviderConfigResponseChangePassword**](ScimServiceProviderConfigResponseChangePassword.md) | | [optional] ## Example diff --git a/docs/ScimServiceProviderConfigResponsePatch.md b/docs/ScimServiceProviderConfigResponsePatch.md deleted file mode 100644 index 34fe5de..0000000 --- a/docs/ScimServiceProviderConfigResponsePatch.md +++ /dev/null @@ -1,30 +0,0 @@ -# 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 deleted file mode 100644 index d92a74d..0000000 --- a/docs/ScimServiceProviderConfigResponseSort.md +++ /dev/null @@ -1,30 +0,0 @@ -# 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/SetDiscountEffectProps.md b/docs/SetDiscountEffectProps.md index 6daf763..74c3916 100644 --- a/docs/SetDiscountEffectProps.md +++ b/docs/SetDiscountEffectProps.md @@ -1,15 +1,15 @@ # SetDiscountEffectProps -The properties specific to the \"setDiscount\" effect. This gets triggered whenever a validated rule contained a \"set discount\" effect. This is a discount that should be applied on the scope of defined with it. +This effect indicates that a discount should be set on the total shopping cart value of the current order with the given label and amount. The discount should overwrite any existing discount with the same name. The most recent integration state update always returns the latest values for **all** effects, effectively overwriting any previous effects. Enabling [partial discounts](https://docs.talon.one/docs/product/applications/manage-general-settings#partial-discounts) allows a rule that would fail because of insufficient budget to pass. The rule still fails when the budget reaches `0`. Use the `desiredValue` property to identify the original value of the discount. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **str** | The name / description of this discount | -**value** | **float** | The total monetary value of the discount. | -**scope** | **str** | The scope which the discount was applied on, can be one of (cartItems,additionalCosts,sessionTotal). | [optional] -**desired_value** | **float** | The original value of the discount. | [optional] +**name** | **str** | The name or description of this discount. | +**value** | **float** | The monetary value of the effective discount. | +**scope** | **str** | What the discount applies to. Possible values: - `cartItems`: Discount on the price of the items. - `additionalCosts`: Discount on the [additional costs](https://docs.talon.one/docs/product/account/dev-tools/manage-additional-costs) of the items. - `sessionTotal`: Discount on the total value of the customer session. **Note:** [Cascading discounts](https://docs.talon.one/docs/product/applications/manage-general-settings#cascading-discounts) must be enabled for this property to be returned. | [optional] +**desired_value** | **float** | _(Partial discounts enabled only)_ The monetary value of the discount to be applied without considering budget limitations. | [optional] ## Example diff --git a/docs/SetDiscountPerAdditionalCostEffectProps.md b/docs/SetDiscountPerAdditionalCostEffectProps.md index bc734f4..a33a3c2 100644 --- a/docs/SetDiscountPerAdditionalCostEffectProps.md +++ b/docs/SetDiscountPerAdditionalCostEffectProps.md @@ -1,16 +1,16 @@ # SetDiscountPerAdditionalCostEffectProps -The properties specific to the \"setDiscountPerAdditionalCost\" effect. This gets triggered whenever a validated rule contained a \"set per additional cost discount\" effect. This is a discount that should be applied on a specific additional cost. +This effect indicates that a discount that should be applied on a specific additional cost. It is triggered whenever a rule containing a **Discount additional cost** effect is validated. Enabling [partial rewards](https://docs.talon.one/docs/product/applications/manage-general-settings#partial-rewards) allows a rule that would fail because of insufficient budget to pass. The rule still fails when the budget reaches 0. Use the `desiredValue` property to identify the original amount of loyalty points. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **str** | The name / description of this discount | -**additional_cost_id** | **int** | The ID of the additional cost. | -**additional_cost** | **str** | The name of the additional cost. | -**value** | **float** | The total monetary value of the discount. | -**desired_value** | **float** | The original value of the discount. | [optional] +**name** | **str** | The name of the discount. | +**additional_cost_id** | **int** | The identifier of the additional cost. | +**additional_cost** | **str** | The API name of the additional cost. | +**value** | **float** | The monetary value of the discount to apply. | +**desired_value** | **float** | _(Partial discounts enabled only)_ The monetary value of the discount to be applied without considering budget limitations. | [optional] ## Example diff --git a/docs/SetDiscountPerAdditionalCostPerItemEffectProps.md b/docs/SetDiscountPerAdditionalCostPerItemEffectProps.md index b250a4b..8689516 100644 --- a/docs/SetDiscountPerAdditionalCostPerItemEffectProps.md +++ b/docs/SetDiscountPerAdditionalCostPerItemEffectProps.md @@ -1,18 +1,18 @@ # SetDiscountPerAdditionalCostPerItemEffectProps -The properties specific to the \"setDiscountPerAdditionalCostPerItem\" effect. This gets triggered whenever a validated rule contained a \"set discount per additional cost per item\" effect. This is a discount that should be applied on a specific additional cost in a specific item. +This effect indicates that a discount of a specific additional cost within a specific item should be applied. It gets triggered whenever a rule containing a **Discount additional cost per item** effect is validated. Use this effect when **all** items in the cart have an additional cost. If one of more items do not have an additional cost, the rule will fail. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **str** | The name / description of this discount | -**additional_cost_id** | **int** | The ID of the additional cost. | -**value** | **float** | The total monetary value of the discount. | -**position** | **float** | The index of the item in the cart item list containing the additional cost to be discounted. | -**sub_position** | **float** | For cart items with `quantity` > 1, the sub position indicates which item the discount applies to. | [optional] -**additional_cost** | **str** | The name of the additional cost. | -**desired_value** | **float** | Only with [partial discounts enabled](https://docs.talon.one/docs/product/campaigns/campaign-evaluation/#partial-discounts). Represents the monetary value of the discount to be applied to additional discount without considering budget limitations. | [optional] +**name** | **str** | The description of this discount. `#number` is appended to the name. It is equal to the `position` property. | +**additional_cost_id** | **int** | The identifier of the additional cost to be discounted. | +**value** | **float** | The monetary value of the effective discount applied to the item's additional cost. | +**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] +**additional_cost** | **str** | The API name of the additional cost to be discounted. | +**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] ## Example diff --git a/docs/SetDiscountPerItemEffectProps.md b/docs/SetDiscountPerItemEffectProps.md index d653adc..33b3583 100644 --- a/docs/SetDiscountPerItemEffectProps.md +++ b/docs/SetDiscountPerItemEffectProps.md @@ -1,23 +1,23 @@ # SetDiscountPerItemEffectProps -The properties specific to the `setDiscountPerItem` effect, triggered whenever a validated rule contained a \"set per item discount\" effect. This is a discount that will be applied either on a specific item, on a specific item + additional cost or on all additional costs per item. This depends on the chosen scope. +This effect schema is returned when you use the **Discount individual items**, **Discount individual items pro rata**, or **Discount individual item in bundles** effect in a rule. It indicates that a discount per item should be applied on the specific item specified in the effect. The properties it contains depends on: - Whether you used a pro rata effect or not. - Whether you used an effect with bundles or not. - Whether the partial discount feature is enabled. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **str** | The name of the discount. Contains a hashtag character indicating the index of the position of the item the discount applies to. It is identical to the value of the `position` property. | -**value** | **float** | The total monetary value of the discount. | -**position** | **float** | The index of the item in the cart items list on which this discount should be applied. | -**sub_position** | **float** | For cart items with `quantity` > 1, the sub position indicates which item the discount applies to. | [optional] -**desired_value** | **float** | The original value of the discount. | [optional] -**scope** | **str** | The scope of the discount: - `additionalCosts`: The discount applies to all the additional costs of the item. - `itemTotal`: The discount applies to the price of the item + the additional costs of the item. - `price`: The discount applies to the price of the item. | [optional] -**total_discount** | **float** | The total discount given if this effect is a result of a prorated discount. | [optional] -**desired_total_discount** | **float** | The original total discount to give if this effect is a result of a prorated discount. | [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** | The index of the targeted bundle item on which the applied discount is based. | [optional] -**targeted_item_sub_position** | **float** | The sub-position of the targeted bundle item on which the applied discount is based. | [optional] +**name** | **str** | The description of this discount. `#number` is equal to the `position` property. | +**value** | **float** | The monetary value of the effective discount applied to the item. | +**position** | **float** | The index of the item in the `cartItem` object on which this discount should be applied. | +**sub_position** | **float** | The index of the item unit in its line item. | [optional] +**desired_value** | **float** | _(Partial discounts enabled only)_ The monetary value of the discount to be applied to the item without considering budget limitations. | [optional] +**scope** | **str** | What the discount applies to. Possible values: - `price`: discount on the price of the item. - `additionalCosts`: discount on the [additional cost](https://docs.talon.one/docs/product/account/dev-tools/manage-additional-costs) of the item. - `itemTotal`: discount on the sum of price + additional cost of the 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** | _(Discounts with bundles only)_ The position of the specific item bundle in the list of bundles created from the same bundle definition. | [optional] +**bundle_name** | **str** | _(Discounts with bundles only)_ 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] ## Example diff --git a/docs/SetLoyaltyPointsExpiryDateEffectProps.md b/docs/SetLoyaltyPointsExpiryDateEffectProps.md index 26d7bdf..5b171ee 100644 --- a/docs/SetLoyaltyPointsExpiryDateEffectProps.md +++ b/docs/SetLoyaltyPointsExpiryDateEffectProps.md @@ -1,6 +1,6 @@ # SetLoyaltyPointsExpiryDateEffectProps -The properties specific to the \"setLoyaltyPointsExpiryDate\" effect. This gets triggered when a validated rule contains the \"set expiry date\" effect. The current expiry date gets set to the date given in the effect. +This effect updates the expiry date of all active, pending, and unlimited point transactions to a specific date. ## Properties diff --git a/docs/ShowBundleMetadataEffectProps.md b/docs/ShowBundleMetadataEffectProps.md index 2772203..009615a 100644 --- a/docs/ShowBundleMetadataEffectProps.md +++ b/docs/ShowBundleMetadataEffectProps.md @@ -1,6 +1,6 @@ # ShowBundleMetadataEffectProps -This effect is **deprecated**. The properties specific to the \"ShowBundleMetadata\" effect. This effect contains information that allows you to associate the discounts from a rule in a bundle campaign with specific cart items. This way you can distinguish from \"normal\" discounts that were not the result of a product bundle. +This effect is **deprecated**. The `ShowBundleMetadata` effect contains information that allows you to associate the discounts from a rule in a bundle campaign with specific cart items. This way you can distinguish from \"normal\" discounts that were not the result of a product bundle. ## Properties diff --git a/docs/ShowNotificationEffectProps.md b/docs/ShowNotificationEffectProps.md index 90045f7..b915373 100644 --- a/docs/ShowNotificationEffectProps.md +++ b/docs/ShowNotificationEffectProps.md @@ -1,14 +1,14 @@ # ShowNotificationEffectProps -The properties specific to the \"showNotification\" effect. This gets triggered whenever a validated rule contained a \"show notification\" effect. +You can use notifications to inform customers of certain events. There are four types of notification messages: - `Info` - `Offer` - `Error` - `Misc` It is up to you to use the Rule Builder to decide why and when to show notifications. Notifications can be used as both rule effects and failure effects. A common use case is to display the notification at the top of the cart view in your web app. You can use the notification type to vary the styling of the notification message. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**notification_type** | **str** | The type of notification that should be shown (e.g. error/warning/info). | -**title** | **str** | Title of the notification. | -**body** | **str** | Body of the notification. | +**notification_type** | **str** | The type of notification. | +**title** | **str** | The title of the notification. | +**body** | **str** | The body of the notification. | ## Example diff --git a/docs/TemplateArgDef.md b/docs/TemplateArgDef.md index 72f7b8b..0833371 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 metadata that may be used to render an input for this argument. | +**ui** | **object** | Arbitrary properties associated with this campaign. | **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/TriggerWebhookEffectProps.md b/docs/TriggerWebhookEffectProps.md index 0f9e588..203af76 100644 --- a/docs/TriggerWebhookEffectProps.md +++ b/docs/TriggerWebhookEffectProps.md @@ -1,13 +1,13 @@ # TriggerWebhookEffectProps -The properties specific to the \"triggerWebhook\" effect. This gets triggered whenever a validated rule contained a \"trigger webhook\" effect. This is communicated as an FYI and should usually not require action on your side. +This effect is triggered when a rule containing a [webhook effect](https://docs.talon.one/docs/product/rules/effects/available-effects#webhooks) is validated. The details are shared with you for your information only. It usually doesn't require an action on your side. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**webhook_id** | **float** | The ID of the webhook that was triggered. | -**webhook_name** | **str** | The name of the webhook that was triggered. | +**webhook_id** | **float** | The internal ID of the webhook. | +**webhook_name** | **str** | The name of the webhook. | ## Example diff --git a/docs/UpdateAttributeEffectProps.md b/docs/UpdateAttributeEffectProps.md index c58017e..1807413 100644 --- a/docs/UpdateAttributeEffectProps.md +++ b/docs/UpdateAttributeEffectProps.md @@ -1,12 +1,12 @@ # UpdateAttributeEffectProps -The properties specific to the \"updateAttribute\" effect. This gets triggered whenever a validated rule contained an \"update an attribute\" effect. +This effect indicates that a rule containing an [Update attribute value](https://docs.talon.one/docs/product/rules/effects/available-effects#update-effects) or [Update cart item attribute value](https://docs.talon.one/docs/product/rules/effects/available-effects#update-effects) was validated. You should update the value of the attribute in your system based on the content of the returned effect. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**path** | **str** | The exact path of the attribute that was updated. | +**path** | **str** | The entity type and the attribute name. | **value** | **object** | | ## Example diff --git a/docs/UpdateCoupon.md b/docs/UpdateCoupon.md index 5ed33d9..b6a0c47 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 item. | [optional] +**attributes** | **object** | Arbitrary properties associated with this campaign. | [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 fb7e073..ae63916 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** | 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] +**attributes** | **object** | Arbitrary properties associated with this campaign. | [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 deleted file mode 100644 index c546e86..0000000 --- a/docs/UpdateCustomerProfileV2409Response.md +++ /dev/null @@ -1,31 +0,0 @@ -# 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/UpdateRiskNotification.md b/docs/UpdateRiskNotification.md new file mode 100644 index 0000000..4624e59 --- /dev/null +++ b/docs/UpdateRiskNotification.md @@ -0,0 +1,33 @@ +# UpdateRiskNotification + +Data for updating a risk notification. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entity** | **str** | The entity type to analyze within the given time frame. | +**activity** | **str** | The activity metric to analyze within the given entity. | +**time_frame** | **str** | The rolling time window for risk evaluation. | +**active** | **bool** | Indicates whether this risk notification is active. | + +## Example + +```python +from talon_one.models.update_risk_notification import UpdateRiskNotification + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateRiskNotification from a JSON string +update_risk_notification_instance = UpdateRiskNotification.from_json(json) +# print the JSON string representation of the object +print(UpdateRiskNotification.to_json()) + +# convert the object into a dict +update_risk_notification_dict = update_risk_notification_instance.to_dict() +# create an instance of UpdateRiskNotification from a dict +update_risk_notification_from_dict = UpdateRiskNotification.from_dict(update_risk_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/User.md b/docs/User.md index 1a622b5..0e1011b 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** | Application notifications that the user is subscribed to. | [optional] +**application_notification_subscriptions** | **object** | Arbitrary properties associated with this campaign. | [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** | Additional user attributes, created and used by external identity providers. | [optional] +**additional_attributes** | **object** | Arbitrary properties associated with this campaign. | [optional] ## Example diff --git a/docs/WillAwardGiveawayEffectProps.md b/docs/WillAwardGiveawayEffectProps.md index fed9d8f..c9c814e 100644 --- a/docs/WillAwardGiveawayEffectProps.md +++ b/docs/WillAwardGiveawayEffectProps.md @@ -1,14 +1,14 @@ # WillAwardGiveawayEffectProps -The properties specific to the \"awardGiveaway\" effect when the session is not closed yet. This effect replaces \"awardGiveaway\" only when updating a session with any state other than \"closed\". This is to ensure no giveaway codes are leaked when they are still not guaranteed to be awarded. +The equivalent of the `awardGiveaway` effect but returned when updating a session with any state other than `closed`. This ensures no giveaway codes are leaked when they are still not guaranteed to be awarded. For more information about session states, see [Manage the session's state](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#manage-the-sessions-state). ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pool_id** | **int** | The ID of the giveaways pool the code will be taken from. | -**pool_name** | **str** | The name of the giveaways pool the code will be taken from. | -**recipient_integration_id** | **str** | The integration ID of the profile that will be awarded the giveaway. | +**pool_id** | **int** | The internal ID of the giveaway pool. | +**pool_name** | **str** | The name of the giveaway pool. | +**recipient_integration_id** | **str** | The integration ID of the customer that receives the giveaway. | ## Example diff --git a/pyproject.toml b/pyproject.toml index 73524dc..7915ef2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "talon_one" -version = "26.11.0" +version = "26.12.0" description = "Talon.One API" authors = [ {name = "OpenAPI Generator Community",email = "team@openapitools.org"}, diff --git a/setup.py b/setup.py index b39481f..81eacdc 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "talon_one" -VERSION = "26.11.0" +VERSION = "26.12.0" PYTHON_REQUIRES = ">= 3.10" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", diff --git a/talon_one/__init__.py b/talon_one/__init__.py index 70a0d8c..a9a15f9 100644 --- a/talon_one/__init__.py +++ b/talon_one/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "26.11.0" +__version__ = "26.12.0" # Define package exports __all__ = [ @@ -142,6 +142,7 @@ "CampaignEditedNotificationItem", "CampaignEligibility", "CampaignEligibilityDetails", + "CampaignEligibilityExperiment", "CampaignEligibilityFailureDetails", "CampaignEntity", "CampaignEvaluationGroup", @@ -268,6 +269,8 @@ "EventV3RequestEntity", "Experiment", "ExperimentCampaignCopy", + "ExperimentConfidenceTimeline", + "ExperimentConfidenceTimelineDataPoint", "ExperimentCopy", "ExperimentCopyExperiment", "ExperimentListResults", @@ -383,13 +386,13 @@ "IntegrationHubConfig", "IntegrationHubEventPayloadCouponBasedNotifications", "IntegrationHubEventPayloadCouponBasedNotificationsLimits", - "IntegrationHubEventPayloadLoyaltyProfileBasedNotification", "IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification", "IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction", "IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification", "IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification", "IntegrationHubEventRecord", "IntegrationHubEventStatusUpdate", + "IntegrationHubEventType", "IntegrationHubFlow", "IntegrationHubFlowConfig", "IntegrationHubFlowConfigResponse", @@ -649,8 +652,6 @@ "ScimServiceProviderConfigResponseBulk", "ScimServiceProviderConfigResponseChangePassword", "ScimServiceProviderConfigResponseFilter", - "ScimServiceProviderConfigResponsePatch", - "ScimServiceProviderConfigResponseSort", "ScimUser", "ScimUsersListResponse", "SecondaryDeployment", @@ -718,7 +719,6 @@ "UpdateCouponBatch", "UpdateCouponsData", "UpdateCustomEffect", - "UpdateCustomerProfileV2409Response", "UpdateCustomerSessionV2409Response", "UpdateExperiment", "UpdateExperimentVariant", @@ -733,6 +733,7 @@ "UpdateReferral", "UpdateReferralBatch", "UpdateReward", + "UpdateRiskNotification", "UpdateRole", "UpdateStore", "UpdateSupportRequest", @@ -878,6 +879,7 @@ from talon_one.models.campaign_edited_notification_item import CampaignEditedNotificationItem as CampaignEditedNotificationItem from talon_one.models.campaign_eligibility import CampaignEligibility as CampaignEligibility from talon_one.models.campaign_eligibility_details import CampaignEligibilityDetails as CampaignEligibilityDetails +from talon_one.models.campaign_eligibility_experiment import CampaignEligibilityExperiment as CampaignEligibilityExperiment from talon_one.models.campaign_eligibility_failure_details import CampaignEligibilityFailureDetails as CampaignEligibilityFailureDetails from talon_one.models.campaign_entity import CampaignEntity as CampaignEntity from talon_one.models.campaign_evaluation_group import CampaignEvaluationGroup as CampaignEvaluationGroup @@ -1004,6 +1006,8 @@ from talon_one.models.event_v3_request_entity import EventV3RequestEntity as EventV3RequestEntity from talon_one.models.experiment import Experiment as Experiment from talon_one.models.experiment_campaign_copy import ExperimentCampaignCopy as ExperimentCampaignCopy +from talon_one.models.experiment_confidence_timeline import ExperimentConfidenceTimeline as ExperimentConfidenceTimeline +from talon_one.models.experiment_confidence_timeline_data_point import ExperimentConfidenceTimelineDataPoint as ExperimentConfidenceTimelineDataPoint from talon_one.models.experiment_copy import ExperimentCopy as ExperimentCopy from talon_one.models.experiment_copy_experiment import ExperimentCopyExperiment as ExperimentCopyExperiment from talon_one.models.experiment_list_results import ExperimentListResults as ExperimentListResults @@ -1119,13 +1123,13 @@ from talon_one.models.integration_hub_config import IntegrationHubConfig as IntegrationHubConfig from talon_one.models.integration_hub_event_payload_coupon_based_notifications import IntegrationHubEventPayloadCouponBasedNotifications as IntegrationHubEventPayloadCouponBasedNotifications from talon_one.models.integration_hub_event_payload_coupon_based_notifications_limits import IntegrationHubEventPayloadCouponBasedNotificationsLimits as IntegrationHubEventPayloadCouponBasedNotificationsLimits -from talon_one.models.integration_hub_event_payload_loyalty_profile_based_notification import IntegrationHubEventPayloadLoyaltyProfileBasedNotification as IntegrationHubEventPayloadLoyaltyProfileBasedNotification from talon_one.models.integration_hub_event_payload_loyalty_profile_based_points_changed_notification import IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification as IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification from talon_one.models.integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action import IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction as IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction from talon_one.models.integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification import IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification as IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification from talon_one.models.integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification import IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification as IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification from talon_one.models.integration_hub_event_record import IntegrationHubEventRecord as IntegrationHubEventRecord from talon_one.models.integration_hub_event_status_update import IntegrationHubEventStatusUpdate as IntegrationHubEventStatusUpdate +from talon_one.models.integration_hub_event_type import IntegrationHubEventType as IntegrationHubEventType from talon_one.models.integration_hub_flow import IntegrationHubFlow as IntegrationHubFlow from talon_one.models.integration_hub_flow_config import IntegrationHubFlowConfig as IntegrationHubFlowConfig from talon_one.models.integration_hub_flow_config_response import IntegrationHubFlowConfigResponse as IntegrationHubFlowConfigResponse @@ -1385,8 +1389,6 @@ 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 @@ -1454,7 +1456,6 @@ 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 @@ -1469,6 +1470,7 @@ from talon_one.models.update_referral import UpdateReferral as UpdateReferral from talon_one.models.update_referral_batch import UpdateReferralBatch as UpdateReferralBatch from talon_one.models.update_reward import UpdateReward as UpdateReward +from talon_one.models.update_risk_notification import UpdateRiskNotification as UpdateRiskNotification from talon_one.models.update_role import UpdateRole as UpdateRole from talon_one.models.update_store import UpdateStore as UpdateStore from talon_one.models.update_support_request import UpdateSupportRequest as UpdateSupportRequest diff --git a/talon_one/api/integration_api.py b/talon_one/api/integration_api.py index a597118..fc0054e 100644 --- a/talon_one/api/integration_api.py +++ b/talon_one/api/integration_api.py @@ -34,6 +34,7 @@ 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.delete_loyalty_transactions_request import DeleteLoyaltyTransactionsRequest +from talon_one.models.event_v3 import EventV3 from talon_one.models.generate_loyalty_card import GenerateLoyaltyCard from talon_one.models.get_customer_achievement_history200_response import GetCustomerAchievementHistory200Response from talon_one.models.get_customer_achievements200_response import GetCustomerAchievements200Response @@ -45,6 +46,8 @@ from talon_one.models.integration_customer_session_response import IntegrationCustomerSessionResponse from talon_one.models.integration_event_v2_request import IntegrationEventV2Request from talon_one.models.integration_event_v2_response import IntegrationEventV2Response +from talon_one.models.integration_event_v3_request import IntegrationEventV3Request +from talon_one.models.integration_event_v3_response import IntegrationEventV3Response from talon_one.models.integration_get_all_campaigns200_response import IntegrationGetAllCampaigns200Response from talon_one.models.integration_request import IntegrationRequest from talon_one.models.integration_state_v2 import IntegrationStateV2 @@ -2099,7 +2102,7 @@ def delete_audience_v2( ) -> None: """Delete audience - Delete an audience created by a third-party integration. > [!warning] This endpoint also removes any associations recorded between a customer profile and this audience. > [!note] Audiences can also be deleted via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/managing-audiences#deleting-an-audience). + Delete an audience. > [!warning] This endpoint also removes any associations recorded between a customer profile and this audience. > [!note] Audiences can also be deleted via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/managing-audiences#deleting-an-audience). :param audience_id: The ID of the audience. (required) :type audience_id: int @@ -2169,7 +2172,7 @@ def delete_audience_v2_with_http_info( ) -> ApiResponse[None]: """Delete audience - Delete an audience created by a third-party integration. > [!warning] This endpoint also removes any associations recorded between a customer profile and this audience. > [!note] Audiences can also be deleted via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/managing-audiences#deleting-an-audience). + Delete an audience. > [!warning] This endpoint also removes any associations recorded between a customer profile and this audience. > [!note] Audiences can also be deleted via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/managing-audiences#deleting-an-audience). :param audience_id: The ID of the audience. (required) :type audience_id: int @@ -2239,7 +2242,7 @@ def delete_audience_v2_without_preload_content( ) -> RESTResponseType: """Delete audience - Delete an audience created by a third-party integration. > [!warning] This endpoint also removes any associations recorded between a customer profile and this audience. > [!note] Audiences can also be deleted via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/managing-audiences#deleting-an-audience). + Delete an audience. > [!warning] This endpoint also removes any associations recorded between a customer profile and this audience. > [!note] Audiences can also be deleted via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/managing-audiences#deleting-an-audience). :param audience_id: The ID of the audience. (required) :type audience_id: int @@ -4924,6 +4927,270 @@ def _get_customer_session_serialize( + @validate_call + def get_event_v3( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the advanced event.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EventV3: + """Get advanced event + + Retrieve an advanced event by its identifier. + + :param integration_id: The unique ID of the advanced event. (required) + :type integration_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_event_v3_serialize( + integration_id=integration_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventV3", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_event_v3_with_http_info( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the advanced event.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EventV3]: + """Get advanced event + + Retrieve an advanced event by its identifier. + + :param integration_id: The unique ID of the advanced event. (required) + :type integration_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_event_v3_serialize( + integration_id=integration_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventV3", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_event_v3_without_preload_content( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the advanced event.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get advanced event + + Retrieve an advanced event by its identifier. + + :param integration_id: The unique ID of the advanced event. (required) + :type integration_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_event_v3_serialize( + integration_id=integration_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventV3", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_event_v3_serialize( + self, + integration_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if integration_id is not None: + _path_params['integrationId'] = integration_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key_v1' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/events/{integrationId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_loyalty_balances( self, @@ -6487,7 +6754,7 @@ def get_loyalty_program_profile_points( loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], integration_id: Annotated[StrictStr, Field(description="The integration 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: Annotated[Optional[StrictStr], Field(description="Filter points based on their status.")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, + subledger_id: Annotated[Optional[List[StrictStr]], Field(description="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. ")] = None, customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="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. ")] = None, transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="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. ")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, @@ -6516,8 +6783,8 @@ def get_loyalty_program_profile_points( :type integration_id: str :param status: Filter points based on their status. :type status: str - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: str + :param subledger_id: 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. + :type subledger_id: List[str] :param customer_session_ids: 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. :type customer_session_ids: List[str] :param transaction_uuids: 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. @@ -6589,7 +6856,7 @@ def get_loyalty_program_profile_points_with_http_info( loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], integration_id: Annotated[StrictStr, Field(description="The integration 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: Annotated[Optional[StrictStr], Field(description="Filter points based on their status.")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, + subledger_id: Annotated[Optional[List[StrictStr]], Field(description="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. ")] = None, customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="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. ")] = None, transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="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. ")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, @@ -6618,8 +6885,8 @@ def get_loyalty_program_profile_points_with_http_info( :type integration_id: str :param status: Filter points based on their status. :type status: str - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: str + :param subledger_id: 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. + :type subledger_id: List[str] :param customer_session_ids: 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. :type customer_session_ids: List[str] :param transaction_uuids: 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. @@ -6691,7 +6958,7 @@ def get_loyalty_program_profile_points_without_preload_content( loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], integration_id: Annotated[StrictStr, Field(description="The integration 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: Annotated[Optional[StrictStr], Field(description="Filter points based on their status.")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, + subledger_id: Annotated[Optional[List[StrictStr]], Field(description="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. ")] = None, customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="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. ")] = None, transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="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. ")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, @@ -6720,8 +6987,8 @@ def get_loyalty_program_profile_points_without_preload_content( :type integration_id: str :param status: Filter points based on their status. :type status: str - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: str + :param subledger_id: 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. + :type subledger_id: List[str] :param customer_session_ids: 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. :type customer_session_ids: List[str] :param transaction_uuids: 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. @@ -6803,6 +7070,7 @@ def _get_loyalty_program_profile_points_serialize( _host = None _collection_formats: Dict[str, str] = { + 'subledgerId': 'multi', 'customerSessionIDs': 'multi', 'transactionUUIDs': 'multi', } @@ -9255,7 +9523,7 @@ def track_event_v2( ) -> IntegrationEventV2Response: """Track event - Triggers a custom event. To use this endpoint: 1. [Create a custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. In a rule, add the **Check for event types** [condition](https://docs.talon.one/docs/dev/concepts/entities/events#use-an-event-in-a-rule) and select the event you created. 1. Trigger the event with this endpoint. You can [list](https://docs.talon.one/docs/product/applications/display-events#list-events) the received events in the **Events** view of the Campaign Manager. For example, you can use this endpoint to trigger an event when a customer shares a link to a product. See our [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation. + 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. :param integration_event_v2_request: body (required) :type integration_event_v2_request: IntegrationEventV2Request @@ -9303,7 +9571,7 @@ def track_event_v2( '204': "str", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerProfileV2409Response", + '409': "UpdateCustomerSessionV2409Response", } response_data = self.api_client.call_api( *_param, @@ -9338,7 +9606,7 @@ def track_event_v2_with_http_info( ) -> ApiResponse[IntegrationEventV2Response]: """Track event - Triggers a custom event. To use this endpoint: 1. [Create a custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. In a rule, add the **Check for event types** [condition](https://docs.talon.one/docs/dev/concepts/entities/events#use-an-event-in-a-rule) and select the event you created. 1. Trigger the event with this endpoint. You can [list](https://docs.talon.one/docs/product/applications/display-events#list-events) the received events in the **Events** view of the Campaign Manager. For example, you can use this endpoint to trigger an event when a customer shares a link to a product. See our [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation. + 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. :param integration_event_v2_request: body (required) :type integration_event_v2_request: IntegrationEventV2Request @@ -9386,7 +9654,7 @@ def track_event_v2_with_http_info( '204': "str", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerProfileV2409Response", + '409': "UpdateCustomerSessionV2409Response", } response_data = self.api_client.call_api( *_param, @@ -9421,7 +9689,7 @@ def track_event_v2_without_preload_content( ) -> RESTResponseType: """Track event - Triggers a custom event. To use this endpoint: 1. [Create a custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. In a rule, add the **Check for event types** [condition](https://docs.talon.one/docs/dev/concepts/entities/events#use-an-event-in-a-rule) and select the event you created. 1. Trigger the event with this endpoint. You can [list](https://docs.talon.one/docs/product/applications/display-events#list-events) the received events in the **Events** view of the Campaign Manager. For example, you can use this endpoint to trigger an event when a customer shares a link to a product. See our [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation. + 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. :param integration_event_v2_request: body (required) :type integration_event_v2_request: IntegrationEventV2Request @@ -9469,7 +9737,7 @@ def track_event_v2_without_preload_content( '204': "str", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerProfileV2409Response", + '409': "UpdateCustomerSessionV2409Response", } response_data = self.api_client.call_api( *_param, @@ -9571,7 +9839,341 @@ def _track_event_v2_serialize( @validate_call - def unlink_loyalty_card_from_profile( + def track_event_v3( + self, + integration_event_v3_request: Annotated[IntegrationEventV3Request, Field(description="body")], + silent: Annotated[Optional[StrictStr], Field(description="Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. ")] = None, + dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. ")] = None, + force_complete_evaluation: Annotated[Optional[StrictBool], Field(description="Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IntegrationEventV3Response: + """Track advanced event + + Trigger an advanced event. Advanced events are idempotent, uniquely identifiable events. They can also reference a previously closed session to add more context for rule evaluation. 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** > - If the customer profile does not exist, it will be created. However, the `customer_profile_created` [built-in event](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation. + + :param integration_event_v3_request: body (required) + :type integration_event_v3_request: IntegrationEventV3Request + :param silent: Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. + :type silent: str + :param dry: Indicates whether to persist the changes. Changes are ignored when `dry=true`. + :type dry: bool + :param force_complete_evaluation: Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. + :type force_complete_evaluation: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._track_event_v3_serialize( + integration_event_v3_request=integration_event_v3_request, + silent=silent, + dry=dry, + force_complete_evaluation=force_complete_evaluation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IntegrationEventV3Response", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '409': "UpdateCustomerSessionV2409Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def track_event_v3_with_http_info( + self, + integration_event_v3_request: Annotated[IntegrationEventV3Request, Field(description="body")], + silent: Annotated[Optional[StrictStr], Field(description="Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. ")] = None, + dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. ")] = None, + force_complete_evaluation: Annotated[Optional[StrictBool], Field(description="Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IntegrationEventV3Response]: + """Track advanced event + + Trigger an advanced event. Advanced events are idempotent, uniquely identifiable events. They can also reference a previously closed session to add more context for rule evaluation. 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** > - If the customer profile does not exist, it will be created. However, the `customer_profile_created` [built-in event](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation. + + :param integration_event_v3_request: body (required) + :type integration_event_v3_request: IntegrationEventV3Request + :param silent: Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. + :type silent: str + :param dry: Indicates whether to persist the changes. Changes are ignored when `dry=true`. + :type dry: bool + :param force_complete_evaluation: Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. + :type force_complete_evaluation: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._track_event_v3_serialize( + integration_event_v3_request=integration_event_v3_request, + silent=silent, + dry=dry, + force_complete_evaluation=force_complete_evaluation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IntegrationEventV3Response", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '409': "UpdateCustomerSessionV2409Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def track_event_v3_without_preload_content( + self, + integration_event_v3_request: Annotated[IntegrationEventV3Request, Field(description="body")], + silent: Annotated[Optional[StrictStr], Field(description="Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. ")] = None, + dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. ")] = None, + force_complete_evaluation: Annotated[Optional[StrictBool], Field(description="Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Track advanced event + + Trigger an advanced event. Advanced events are idempotent, uniquely identifiable events. They can also reference a previously closed session to add more context for rule evaluation. 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** > - If the customer profile does not exist, it will be created. However, the `customer_profile_created` [built-in event](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation. + + :param integration_event_v3_request: body (required) + :type integration_event_v3_request: IntegrationEventV3Request + :param silent: Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. + :type silent: str + :param dry: Indicates whether to persist the changes. Changes are ignored when `dry=true`. + :type dry: bool + :param force_complete_evaluation: Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. + :type force_complete_evaluation: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._track_event_v3_serialize( + integration_event_v3_request=integration_event_v3_request, + silent=silent, + dry=dry, + force_complete_evaluation=force_complete_evaluation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IntegrationEventV3Response", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '409': "UpdateCustomerSessionV2409Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _track_event_v3_serialize( + self, + integration_event_v3_request, + silent, + dry, + force_complete_evaluation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if silent is not None: + + _query_params.append(('silent', silent)) + + if dry is not None: + + _query_params.append(('dry', dry)) + + if force_complete_evaluation is not None: + + _query_params.append(('forceCompleteEvaluation', force_complete_evaluation)) + + # process the header parameters + # process the form parameters + # process the body parameter + if integration_event_v3_request is not None: + _body_params = integration_event_v3_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key_v1' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v3/events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def unlink_loyalty_card_from_profile( self, loyalty_program_id: Annotated[StrictInt, Field(description="The identifier of the card-based loyalty program containing the loyalty card. You can get this ID using the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="The identifier of the loyalty card. You can get this ID using 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`. ")], @@ -10825,7 +11427,7 @@ def update_customer_profile_v2( '200': "CustomerProfileIntegrationResponseV2", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerProfileV2409Response", + '409': "UpdateCustomerSessionV2409Response", } response_data = self.api_client.call_api( *_param, @@ -10907,7 +11509,7 @@ def update_customer_profile_v2_with_http_info( '200': "CustomerProfileIntegrationResponseV2", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerProfileV2409Response", + '409': "UpdateCustomerSessionV2409Response", } response_data = self.api_client.call_api( *_param, @@ -10989,7 +11591,7 @@ def update_customer_profile_v2_without_preload_content( '200': "CustomerProfileIntegrationResponseV2", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerProfileV2409Response", + '409': "UpdateCustomerSessionV2409Response", } response_data = self.api_client.call_api( *_param, diff --git a/talon_one/api/management_api.py b/talon_one/api/management_api.py index 40a54c7..49d865b 100644 --- a/talon_one/api/management_api.py +++ b/talon_one/api/management_api.py @@ -13988,6 +13988,8 @@ def export_customer_sessions( application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string.")] = None, created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string.")] = None, + updated_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string.")] = None, + updated_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string.")] = None, profile_integration_id: Annotated[Optional[StrictStr], Field(description="Only return sessions for the customer that matches this customer integration ID.")] = None, date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = None, customer_session_state: Annotated[Optional[StrictStr], Field(description="Filter results by state.")] = None, @@ -14014,6 +14016,10 @@ def export_customer_sessions( :type created_before: datetime :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. :type created_after: datetime + :param updated_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. + :type updated_before: datetime + :param updated_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. + :type updated_after: datetime :param profile_integration_id: Only return sessions for the customer that matches this customer integration ID. :type profile_integration_id: str :param date_format: Determines the format of dates in the export document. @@ -14046,6 +14052,8 @@ def export_customer_sessions( application_id=application_id, created_before=created_before, created_after=created_after, + updated_before=updated_before, + updated_after=updated_after, profile_integration_id=profile_integration_id, date_format=date_format, customer_session_state=customer_session_state, @@ -14075,6 +14083,8 @@ def export_customer_sessions_with_http_info( application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string.")] = None, created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string.")] = None, + updated_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string.")] = None, + updated_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string.")] = None, profile_integration_id: Annotated[Optional[StrictStr], Field(description="Only return sessions for the customer that matches this customer integration ID.")] = None, date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = None, customer_session_state: Annotated[Optional[StrictStr], Field(description="Filter results by state.")] = None, @@ -14101,6 +14111,10 @@ def export_customer_sessions_with_http_info( :type created_before: datetime :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. :type created_after: datetime + :param updated_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. + :type updated_before: datetime + :param updated_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. + :type updated_after: datetime :param profile_integration_id: Only return sessions for the customer that matches this customer integration ID. :type profile_integration_id: str :param date_format: Determines the format of dates in the export document. @@ -14133,6 +14147,8 @@ def export_customer_sessions_with_http_info( application_id=application_id, created_before=created_before, created_after=created_after, + updated_before=updated_before, + updated_after=updated_after, profile_integration_id=profile_integration_id, date_format=date_format, customer_session_state=customer_session_state, @@ -14162,6 +14178,8 @@ def export_customer_sessions_without_preload_content( application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string.")] = None, created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string.")] = None, + updated_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string.")] = None, + updated_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string.")] = None, profile_integration_id: Annotated[Optional[StrictStr], Field(description="Only return sessions for the customer that matches this customer integration ID.")] = None, date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = None, customer_session_state: Annotated[Optional[StrictStr], Field(description="Filter results by state.")] = None, @@ -14188,6 +14206,10 @@ def export_customer_sessions_without_preload_content( :type created_before: datetime :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. :type created_after: datetime + :param updated_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. + :type updated_before: datetime + :param updated_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. + :type updated_after: datetime :param profile_integration_id: Only return sessions for the customer that matches this customer integration ID. :type profile_integration_id: str :param date_format: Determines the format of dates in the export document. @@ -14220,6 +14242,8 @@ def export_customer_sessions_without_preload_content( application_id=application_id, created_before=created_before, created_after=created_after, + updated_before=updated_before, + updated_after=updated_after, profile_integration_id=profile_integration_id, date_format=date_format, customer_session_state=customer_session_state, @@ -14244,6 +14268,8 @@ def _export_customer_sessions_serialize( application_id, created_before, created_after, + updated_before, + updated_after, profile_integration_id, date_format, customer_session_state, @@ -14297,6 +14323,32 @@ def _export_customer_sessions_serialize( else: _query_params.append(('createdAfter', created_after)) + if updated_before is not None: + if isinstance(updated_before, datetime): + _query_params.append( + ( + 'updatedBefore', + updated_before.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('updatedBefore', updated_before)) + + if updated_after is not None: + if isinstance(updated_after, datetime): + _query_params.append( + ( + 'updatedAfter', + updated_after.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('updatedAfter', updated_after)) + if profile_integration_id is not None: _query_params.append(('profileIntegrationId', profile_integration_id)) @@ -16297,7 +16349,7 @@ def export_loyalty_cards( ) -> str: """Export loyalty cards - Download a CSV file containing the loyalty cards from a specified loyalty program. > [!tip] If the exported CSV file is too large to view, you can > [split it into multiple files](https://www.google.com/search?q=split+CSV+into+multiple+files). The CSV file contains the following columns: - `identifier`: The unique identifier of the loyalty card. - `created`: The date and time the loyalty card was created. - `status`: The status of the loyalty card. - `userpercardlimit`: The maximum number of customer profiles that can be linked to the card. - `customerprofileids`: Integration IDs of the customer profiles linked to the card. - `blockreason`: The reason for transferring and blocking the loyalty card. - `generated`: An indicator of whether the loyalty card was generated. - `batchid`: The ID of the batch the loyalty card is in. - `attributes`: The custom attributes of this loyalty card. Currently, this feature is only available upon request. + Download a CSV file containing the loyalty cards from a specified loyalty program. > [!tip] If the exported CSV file is too large to view, you can > [split it into multiple files](https://www.google.com/search?q=split+CSV+into+multiple+files). The CSV file contains the following columns: - `identifier`: The unique identifier of the loyalty card. - `created`: The date and time the loyalty card was created. - `status`: The status of the loyalty card. - `userpercardlimit`: The maximum number of customer profiles that can be linked to the card. - `customerprofileids`: Integration IDs of the customer profiles linked to the card. - `blockreason`: The reason for transferring and blocking the loyalty card. - `generated`: An indicator of whether the loyalty card was generated. - `batchid`: The ID of the batch the loyalty card is in. - `attributes`: The custom attributes of this loyalty card. :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int @@ -16382,7 +16434,7 @@ def export_loyalty_cards_with_http_info( ) -> ApiResponse[str]: """Export loyalty cards - Download a CSV file containing the loyalty cards from a specified loyalty program. > [!tip] If the exported CSV file is too large to view, you can > [split it into multiple files](https://www.google.com/search?q=split+CSV+into+multiple+files). The CSV file contains the following columns: - `identifier`: The unique identifier of the loyalty card. - `created`: The date and time the loyalty card was created. - `status`: The status of the loyalty card. - `userpercardlimit`: The maximum number of customer profiles that can be linked to the card. - `customerprofileids`: Integration IDs of the customer profiles linked to the card. - `blockreason`: The reason for transferring and blocking the loyalty card. - `generated`: An indicator of whether the loyalty card was generated. - `batchid`: The ID of the batch the loyalty card is in. - `attributes`: The custom attributes of this loyalty card. Currently, this feature is only available upon request. + Download a CSV file containing the loyalty cards from a specified loyalty program. > [!tip] If the exported CSV file is too large to view, you can > [split it into multiple files](https://www.google.com/search?q=split+CSV+into+multiple+files). The CSV file contains the following columns: - `identifier`: The unique identifier of the loyalty card. - `created`: The date and time the loyalty card was created. - `status`: The status of the loyalty card. - `userpercardlimit`: The maximum number of customer profiles that can be linked to the card. - `customerprofileids`: Integration IDs of the customer profiles linked to the card. - `blockreason`: The reason for transferring and blocking the loyalty card. - `generated`: An indicator of whether the loyalty card was generated. - `batchid`: The ID of the batch the loyalty card is in. - `attributes`: The custom attributes of this loyalty card. :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int @@ -16467,7 +16519,7 @@ def export_loyalty_cards_without_preload_content( ) -> RESTResponseType: """Export loyalty cards - Download a CSV file containing the loyalty cards from a specified loyalty program. > [!tip] If the exported CSV file is too large to view, you can > [split it into multiple files](https://www.google.com/search?q=split+CSV+into+multiple+files). The CSV file contains the following columns: - `identifier`: The unique identifier of the loyalty card. - `created`: The date and time the loyalty card was created. - `status`: The status of the loyalty card. - `userpercardlimit`: The maximum number of customer profiles that can be linked to the card. - `customerprofileids`: Integration IDs of the customer profiles linked to the card. - `blockreason`: The reason for transferring and blocking the loyalty card. - `generated`: An indicator of whether the loyalty card was generated. - `batchid`: The ID of the batch the loyalty card is in. - `attributes`: The custom attributes of this loyalty card. Currently, this feature is only available upon request. + Download a CSV file containing the loyalty cards from a specified loyalty program. > [!tip] If the exported CSV file is too large to view, you can > [split it into multiple files](https://www.google.com/search?q=split+CSV+into+multiple+files). The CSV file contains the following columns: - `identifier`: The unique identifier of the loyalty card. - `created`: The date and time the loyalty card was created. - `status`: The status of the loyalty card. - `userpercardlimit`: The maximum number of customer profiles that can be linked to the card. - `customerprofileids`: Integration IDs of the customer profiles linked to the card. - `blockreason`: The reason for transferring and blocking the loyalty card. - `generated`: An indicator of whether the loyalty card was generated. - `batchid`: The ID of the batch the loyalty card is in. - `attributes`: The custom attributes of this loyalty card. :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int @@ -25619,7 +25671,7 @@ def _get_audiences_serialize( @validate_call def get_audiences_analytics( self, - audience_ids: Annotated[StrictStr, Field(description="The IDs of one or more audiences, separated by commas, by which to filter results.")], + audience_ids: Annotated[StrictStr, Field(description="The IDs of one or more audiences, separated by commas, by which to filter results. Do not provide more than 1000 audience IDs.")], sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. ")] = None, _request_timeout: Union[ None, @@ -25638,7 +25690,7 @@ def get_audiences_analytics( Get a list of audience IDs and their member count. - :param audience_ids: The IDs of one or more audiences, separated by commas, by which to filter results. (required) + :param audience_ids: The IDs of one or more audiences, separated by commas, by which to filter results. Do not provide more than 1000 audience IDs. (required) :type audience_ids: str :param sort: The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. :type sort: str @@ -25690,7 +25742,7 @@ def get_audiences_analytics( @validate_call def get_audiences_analytics_with_http_info( self, - audience_ids: Annotated[StrictStr, Field(description="The IDs of one or more audiences, separated by commas, by which to filter results.")], + audience_ids: Annotated[StrictStr, Field(description="The IDs of one or more audiences, separated by commas, by which to filter results. Do not provide more than 1000 audience IDs.")], sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. ")] = None, _request_timeout: Union[ None, @@ -25709,7 +25761,7 @@ def get_audiences_analytics_with_http_info( Get a list of audience IDs and their member count. - :param audience_ids: The IDs of one or more audiences, separated by commas, by which to filter results. (required) + :param audience_ids: The IDs of one or more audiences, separated by commas, by which to filter results. Do not provide more than 1000 audience IDs. (required) :type audience_ids: str :param sort: The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. :type sort: str @@ -25761,7 +25813,7 @@ def get_audiences_analytics_with_http_info( @validate_call def get_audiences_analytics_without_preload_content( self, - audience_ids: Annotated[StrictStr, Field(description="The IDs of one or more audiences, separated by commas, by which to filter results.")], + audience_ids: Annotated[StrictStr, Field(description="The IDs of one or more audiences, separated by commas, by which to filter results. Do not provide more than 1000 audience IDs.")], sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. ")] = None, _request_timeout: Union[ None, @@ -25780,7 +25832,7 @@ def get_audiences_analytics_without_preload_content( Get a list of audience IDs and their member count. - :param audience_ids: The IDs of one or more audiences, separated by commas, by which to filter results. (required) + :param audience_ids: The IDs of one or more audiences, separated by commas, by which to filter results. Do not provide more than 1000 audience IDs. (required) :type audience_ids: str :param sort: The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. :type sort: str @@ -42575,7 +42627,7 @@ def import_loyalty_cards( ) -> ModelImport: """Import loyalty cards - Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` + Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). - `attributes` (optional): A JSON object that contains the loyalty card's custom attributes and their values. These attributes must be created and connected to this loyalty program before they can be assigned to the cards through this endpoint. > [!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds. ## Example ```csv identifier,state,customerprofileids,attributes 123-456-789AT,active,Alexa001;UserA,'{\"\"my_attributes\"\": \"\"10_off\"\"}\" ``` :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int @@ -42648,7 +42700,7 @@ def import_loyalty_cards_with_http_info( ) -> ApiResponse[ModelImport]: """Import loyalty cards - Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` + Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). - `attributes` (optional): A JSON object that contains the loyalty card's custom attributes and their values. These attributes must be created and connected to this loyalty program before they can be assigned to the cards through this endpoint. > [!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds. ## Example ```csv identifier,state,customerprofileids,attributes 123-456-789AT,active,Alexa001;UserA,'{\"\"my_attributes\"\": \"\"10_off\"\"}\" ``` :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int @@ -42721,7 +42773,7 @@ def import_loyalty_cards_without_preload_content( ) -> RESTResponseType: """Import loyalty cards - Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` + Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). - `attributes` (optional): A JSON object that contains the loyalty card's custom attributes and their values. These attributes must be created and connected to this loyalty program before they can be assigned to the cards through this endpoint. > [!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds. ## Example ```csv identifier,state,customerprofileids,attributes 123-456-789AT,active,Alexa001;UserA,'{\"\"my_attributes\"\": \"\"10_off\"\"}\" ``` :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int @@ -43148,6 +43200,304 @@ def _import_loyalty_customers_tiers_serialize( + @validate_call + def import_loyalty_join_dates( + self, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + up_file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="The CSV file containing the data that is being imported.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelImport: + """Import join dates for a loyalty program + + Upload a CSV file containing customer profile IDs and their join dates for the specified loyalty program. Send the file as multipart data. > [!important] This endpoint only works with profile-based loyalty programs. The CSV file **must** contain the following columns: - `customerprofileid`: The integration ID of the customer profile whose join date you want to update. - `newjoindate`: The new join date for the customer in RFC3339 format. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note**: - Customer profiles must already exist. If a referenced profile does not exist, the import fails with a `400` error. - If a join date already exists for a profile, the uploaded date replaces it. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv customerprofileid,newjoindate customer1,2024-03-21T07:32:14Z customer2,2025-04-16T21:12:37Z customer3,2026-05-03T11:47:01Z ``` + + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param up_file: The CSV file containing the data that is being imported. + :type up_file: bytes + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._import_loyalty_join_dates_serialize( + loyalty_program_id=loyalty_program_id, + up_file=up_file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ModelImport", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def import_loyalty_join_dates_with_http_info( + self, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + up_file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="The CSV file containing the data that is being imported.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelImport]: + """Import join dates for a loyalty program + + Upload a CSV file containing customer profile IDs and their join dates for the specified loyalty program. Send the file as multipart data. > [!important] This endpoint only works with profile-based loyalty programs. The CSV file **must** contain the following columns: - `customerprofileid`: The integration ID of the customer profile whose join date you want to update. - `newjoindate`: The new join date for the customer in RFC3339 format. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note**: - Customer profiles must already exist. If a referenced profile does not exist, the import fails with a `400` error. - If a join date already exists for a profile, the uploaded date replaces it. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv customerprofileid,newjoindate customer1,2024-03-21T07:32:14Z customer2,2025-04-16T21:12:37Z customer3,2026-05-03T11:47:01Z ``` + + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param up_file: The CSV file containing the data that is being imported. + :type up_file: bytes + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._import_loyalty_join_dates_serialize( + loyalty_program_id=loyalty_program_id, + up_file=up_file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ModelImport", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def import_loyalty_join_dates_without_preload_content( + self, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + up_file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="The CSV file containing the data that is being imported.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Import join dates for a loyalty program + + Upload a CSV file containing customer profile IDs and their join dates for the specified loyalty program. Send the file as multipart data. > [!important] This endpoint only works with profile-based loyalty programs. The CSV file **must** contain the following columns: - `customerprofileid`: The integration ID of the customer profile whose join date you want to update. - `newjoindate`: The new join date for the customer in RFC3339 format. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note**: - Customer profiles must already exist. If a referenced profile does not exist, the import fails with a `400` error. - If a join date already exists for a profile, the uploaded date replaces it. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv customerprofileid,newjoindate customer1,2024-03-21T07:32:14Z customer2,2025-04-16T21:12:37Z customer3,2026-05-03T11:47:01Z ``` + + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param up_file: The CSV file containing the data that is being imported. + :type up_file: bytes + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._import_loyalty_join_dates_serialize( + loyalty_program_id=loyalty_program_id, + up_file=up_file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ModelImport", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _import_loyalty_join_dates_serialize( + self, + loyalty_program_id, + up_file, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if loyalty_program_id is not None: + _path_params['loyaltyProgramId'] = loyalty_program_id + # process the query parameters + # process the header parameters + # process the form parameters + if up_file is not None: + _files['upFile'] = up_file + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key_v1' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/loyalty_programs/{loyaltyProgramId}/import_join_dates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def import_loyalty_points( self, @@ -45233,7 +45583,7 @@ def list_application_cart_item_filters( application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], page_size: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, - title: Annotated[Optional[StrictStr], Field(description="Filter by the display name of the Application cart item filter in the Application. **Note**: If no `title` is provided, all the Application cart item filters in the Application are returned. ")] = None, + name: Annotated[Optional[StrictStr], Field(description="Filter by the display name of the Application cart item filter in the Application. **Note**: If no `name` is provided, all the Application cart item filters in the Application are returned. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -45257,8 +45607,8 @@ def list_application_cart_item_filters( :type page_size: int :param skip: The number of items to skip when paging through large result sets. :type skip: int - :param title: Filter by the display name of the Application cart item filter in the Application. **Note**: If no `title` is provided, all the Application cart item filters in the Application are returned. - :type title: str + :param name: Filter by the display name of the Application cart item filter in the Application. **Note**: If no `name` is provided, all the Application cart item filters in the Application are returned. + :type name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -45285,7 +45635,7 @@ def list_application_cart_item_filters( application_id=application_id, page_size=page_size, skip=skip, - title=title, + name=name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -45312,7 +45662,7 @@ def list_application_cart_item_filters_with_http_info( application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], page_size: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, - title: Annotated[Optional[StrictStr], Field(description="Filter by the display name of the Application cart item filter in the Application. **Note**: If no `title` is provided, all the Application cart item filters in the Application are returned. ")] = None, + name: Annotated[Optional[StrictStr], Field(description="Filter by the display name of the Application cart item filter in the Application. **Note**: If no `name` is provided, all the Application cart item filters in the Application are returned. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -45336,8 +45686,8 @@ def list_application_cart_item_filters_with_http_info( :type page_size: int :param skip: The number of items to skip when paging through large result sets. :type skip: int - :param title: Filter by the display name of the Application cart item filter in the Application. **Note**: If no `title` is provided, all the Application cart item filters in the Application are returned. - :type title: str + :param name: Filter by the display name of the Application cart item filter in the Application. **Note**: If no `name` is provided, all the Application cart item filters in the Application are returned. + :type name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -45364,7 +45714,7 @@ def list_application_cart_item_filters_with_http_info( application_id=application_id, page_size=page_size, skip=skip, - title=title, + name=name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -45391,7 +45741,7 @@ def list_application_cart_item_filters_without_preload_content( application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], page_size: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, - title: Annotated[Optional[StrictStr], Field(description="Filter by the display name of the Application cart item filter in the Application. **Note**: If no `title` is provided, all the Application cart item filters in the Application are returned. ")] = None, + name: Annotated[Optional[StrictStr], Field(description="Filter by the display name of the Application cart item filter in the Application. **Note**: If no `name` is provided, all the Application cart item filters in the Application are returned. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -45415,8 +45765,8 @@ def list_application_cart_item_filters_without_preload_content( :type page_size: int :param skip: The number of items to skip when paging through large result sets. :type skip: int - :param title: Filter by the display name of the Application cart item filter in the Application. **Note**: If no `title` is provided, all the Application cart item filters in the Application are returned. - :type title: str + :param name: Filter by the display name of the Application cart item filter in the Application. **Note**: If no `name` is provided, all the Application cart item filters in the Application are returned. + :type name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -45443,7 +45793,7 @@ def list_application_cart_item_filters_without_preload_content( application_id=application_id, page_size=page_size, skip=skip, - title=title, + name=name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -45465,7 +45815,7 @@ def _list_application_cart_item_filters_serialize( application_id, page_size, skip, - title, + name, _request_auth, _content_type, _headers, @@ -45498,9 +45848,9 @@ def _list_application_cart_item_filters_serialize( _query_params.append(('skip', skip)) - if title is not None: + if name is not None: - _query_params.append(('title', title)) + _query_params.append(('name', name)) # process the header parameters # process the form parameters diff --git a/talon_one/api_client.py b/talon_one/api_client.py index de52636..69e438e 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.11.0/python' + self.user_agent = 'OpenAPI-Generator/26.12.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/talon_one/configuration.py b/talon_one/configuration.py index 4272fdb..dc123c4 100644 --- a/talon_one/configuration.py +++ b/talon_one/configuration.py @@ -554,7 +554,7 @@ def to_debug_report(self) -> str: "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: \n"\ - "SDK Package Version: 26.11.0".\ + "SDK Package Version: 26.12.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 ee4c4d4..4a163bd 100644 --- a/talon_one/models/__init__.py +++ b/talon_one/models/__init__.py @@ -126,6 +126,7 @@ from talon_one.models.campaign_edited_notification_item import CampaignEditedNotificationItem from talon_one.models.campaign_eligibility import CampaignEligibility from talon_one.models.campaign_eligibility_details import CampaignEligibilityDetails +from talon_one.models.campaign_eligibility_experiment import CampaignEligibilityExperiment from talon_one.models.campaign_eligibility_failure_details import CampaignEligibilityFailureDetails from talon_one.models.campaign_entity import CampaignEntity from talon_one.models.campaign_evaluation_group import CampaignEvaluationGroup @@ -252,6 +253,8 @@ from talon_one.models.event_v3_request_entity import EventV3RequestEntity from talon_one.models.experiment import Experiment from talon_one.models.experiment_campaign_copy import ExperimentCampaignCopy +from talon_one.models.experiment_confidence_timeline import ExperimentConfidenceTimeline +from talon_one.models.experiment_confidence_timeline_data_point import ExperimentConfidenceTimelineDataPoint from talon_one.models.experiment_copy import ExperimentCopy from talon_one.models.experiment_copy_experiment import ExperimentCopyExperiment from talon_one.models.experiment_list_results import ExperimentListResults @@ -367,13 +370,13 @@ from talon_one.models.integration_hub_config import IntegrationHubConfig from talon_one.models.integration_hub_event_payload_coupon_based_notifications import IntegrationHubEventPayloadCouponBasedNotifications from talon_one.models.integration_hub_event_payload_coupon_based_notifications_limits import IntegrationHubEventPayloadCouponBasedNotificationsLimits -from talon_one.models.integration_hub_event_payload_loyalty_profile_based_notification import IntegrationHubEventPayloadLoyaltyProfileBasedNotification 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_points_changed_notification_action import IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction from talon_one.models.integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification import IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification from talon_one.models.integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification import IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification from talon_one.models.integration_hub_event_record import IntegrationHubEventRecord from talon_one.models.integration_hub_event_status_update import IntegrationHubEventStatusUpdate +from talon_one.models.integration_hub_event_type import IntegrationHubEventType from talon_one.models.integration_hub_flow import IntegrationHubFlow from talon_one.models.integration_hub_flow_config import IntegrationHubFlowConfig from talon_one.models.integration_hub_flow_config_response import IntegrationHubFlowConfigResponse @@ -633,8 +636,6 @@ 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 @@ -702,7 +703,6 @@ 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 @@ -717,6 +717,7 @@ from talon_one.models.update_referral import UpdateReferral from talon_one.models.update_referral_batch import UpdateReferralBatch from talon_one.models.update_reward import UpdateReward +from talon_one.models.update_risk_notification import UpdateRiskNotification from talon_one.models.update_role import UpdateRole from talon_one.models.update_store import UpdateStore from talon_one.models.update_support_request import UpdateSupportRequest diff --git a/talon_one/models/accept_coupon_effect_props.py b/talon_one/models/accept_coupon_effect_props.py index a94af62..c0dc838 100644 --- a/talon_one/models/accept_coupon_effect_props.py +++ b/talon_one/models/accept_coupon_effect_props.py @@ -25,7 +25,7 @@ class AcceptCouponEffectProps(BaseModel): """ - The properties specific to the \"acceptCoupon\" effect. This gets triggered whenever the coupon is valid and all other conditions in the rules of its campaign are met. + This effect indicates that the coupon code supplied was valid. You should handle this effect by clearing any messages from previous `rejectCoupon` effects and informing the user that the coupon is valid. The code is automatically redeemed when you close the session. Other effects, such as [setDiscount](https://docs.talon.one/docs/dev/integration-api/api-effects#setdiscount), provide more information about the actual rewards received. """ # noqa: E501 value: StrictStr = Field(description="The coupon code that was accepted.") __properties: ClassVar[List[str]] = ["value"] diff --git a/talon_one/models/accept_referral_effect_props.py b/talon_one/models/accept_referral_effect_props.py index 9874c69..c9ddf55 100644 --- a/talon_one/models/accept_referral_effect_props.py +++ b/talon_one/models/accept_referral_effect_props.py @@ -25,9 +25,9 @@ class AcceptReferralEffectProps(BaseModel): """ - The properties specific to the \"acceptReferral\" effect. TThis gets triggered whenever the referral code is valid and all other conditions in the rules of its campaign are met. + This effect indicates that the referral code supplied is valid. You should handle this effect by informing the user that the referral code is valid. The code is automatically redeemed when you close the session. Other effects will provide more information about the actual reward. """ # noqa: E501 - value: StrictStr = Field(description="The referral code that was accepted.") + value: StrictStr = Field(description="The referral code provided in the session.") __properties: ClassVar[List[str]] = ["value"] model_config = ConfigDict( diff --git a/talon_one/models/access_log_entry.py b/talon_one/models/access_log_entry.py index b95fdb7..67038b5 100644 --- a/talon_one/models/access_log_entry.py +++ b/talon_one/models/access_log_entry.py @@ -28,13 +28,13 @@ class AccessLogEntry(BaseModel): """ Log of application accesses. """ # noqa: E501 - uuid: StrictStr = Field(description="UUID reference of request.") - status: StrictInt = Field(description="HTTP status code of response.") - method: StrictStr = Field(description="HTTP method of request.") - request_uri: StrictStr = Field(description="target URI of request", alias="requestUri") - time: datetime = Field(description="timestamp of request") - request_payload: StrictStr = Field(description="payload of request", alias="requestPayload") - response_payload: StrictStr = Field(description="payload of response", alias="responsePayload") + uuid: StrictStr = Field(description="UUID reference of request.", json_schema_extra={"examples": ["606e7d34-2d36-4d53-ac71-d4442c325985"]}) + status: StrictInt = Field(description="HTTP status code of response.", json_schema_extra={"examples": [200]}) + method: StrictStr = Field(description="HTTP method of request.", json_schema_extra={"examples": ["PUT"]}) + request_uri: StrictStr = Field(description="target URI of request", alias="requestUri", json_schema_extra={"examples": ["/v2/customer_sessions/Session136667"]}) + time: datetime = Field(description="timestamp of request", json_schema_extra={"examples": ["2023-01-16T16:00:00.700763Z"]}) + request_payload: StrictStr = Field(description="payload of request", alias="requestPayload", json_schema_extra={"examples": ["{\n \"customerSession\": {\n \"profileId\": \"customer123\",\n \"state\": \"closed\",\n...\n}"]}) + response_payload: StrictStr = Field(description="payload of response", alias="responsePayload", json_schema_extra={"examples": ["{\"coupons\":[],\"createdCoupons\":[],...}"]}) __properties: ClassVar[List[str]] = ["uuid", "status", "method", "requestUri", "time", "requestPayload", "responsePayload"] model_config = ConfigDict( diff --git a/talon_one/models/account.py b/talon_one/models/account.py index ea26417..f890ab6 100644 --- a/talon_one/models/account.py +++ b/talon_one/models/account.py @@ -29,9 +29,9 @@ class Account(BaseModel): """ Account """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - modified: datetime = Field(description="The time this entity was last modified.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + modified: datetime = Field(description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) company_name: Annotated[str, Field(min_length=1, strict=True)] = Field(alias="companyName") domain_name: StrictStr = Field(description="Subdomain Name for yourcompany.talon.one.", alias="domainName") state: StrictStr = Field(description="State of the account (active, deactivated).") diff --git a/talon_one/models/account_additional_cost.py b/talon_one/models/account_additional_cost.py index f232cfc..af8cf3e 100644 --- a/talon_one/models/account_additional_cost.py +++ b/talon_one/models/account_additional_cost.py @@ -29,14 +29,14 @@ class AccountAdditionalCost(BaseModel): """ AccountAdditionalCost """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - name: Annotated[str, Field(strict=True)] = Field(description="The internal name used in API requests.") - title: Annotated[str, Field(strict=True)] = Field(description="The human-readable name for the additional cost that will be shown in the Campaign Manager. Like `name`, the combination of entity and title must also be unique.") - description: StrictStr = Field(description="A description of this additional cost.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications that are subscribed to this additional cost.", alias="subscribedApplicationsIds") - 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. ") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + name: Annotated[str, Field(strict=True)] = Field(description="The internal name used in API requests.", json_schema_extra={"examples": ["shippingFee"]}) + title: Annotated[str, Field(strict=True)] = Field(description="The human-readable name for the additional cost that will be shown in the Campaign Manager. Like `name`, the combination of entity and title must also be unique.", json_schema_extra={"examples": ["Shipping fee"]}) + description: StrictStr = Field(description="A description of this additional cost.", json_schema_extra={"examples": ["A shipping fee"]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications that are subscribed to this additional cost.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[3, 13]]}) + 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') diff --git a/talon_one/models/account_analytics.py b/talon_one/models/account_analytics.py index f325df1..3ee6fd7 100644 --- a/talon_one/models/account_analytics.py +++ b/talon_one/models/account_analytics.py @@ -28,26 +28,26 @@ class AccountAnalytics(BaseModel): """ AccountAnalytics """ # noqa: E501 - applications: StrictInt = Field(description="Total number of applications in the account.") - live_applications: StrictInt = Field(description="Total number of live applications in the account.", alias="liveApplications") - sandbox_applications: StrictInt = Field(description="Total number of sandbox applications in the account.", alias="sandboxApplications") - campaigns: StrictInt = Field(description="Total number of campaigns in the account.") - active_campaigns: StrictInt = Field(description="Total number of active campaigns in the account.", alias="activeCampaigns") - live_active_campaigns: StrictInt = Field(description="Total number of active campaigns in live applications in the account.", alias="liveActiveCampaigns") - coupons: StrictInt = Field(description="Total number of coupons in the account.") - active_coupons: StrictInt = Field(description="Total number of active coupons in the account.", alias="activeCoupons") - expired_coupons: StrictInt = Field(description="Total number of expired coupons in the account.", alias="expiredCoupons") - referral_codes: StrictInt = Field(description="Total number of referral codes in the account.", alias="referralCodes") - active_referral_codes: StrictInt = Field(description="Total number of active referral codes in the account.", alias="activeReferralCodes") - expired_referral_codes: StrictInt = Field(description="Total number of expired referral codes in the account.", alias="expiredReferralCodes") - active_rules: StrictInt = Field(description="Total number of active rules in the account.", alias="activeRules") + applications: StrictInt = Field(description="Total number of applications in the account.", json_schema_extra={"examples": [11]}) + live_applications: StrictInt = Field(description="Total number of live applications in the account.", alias="liveApplications", json_schema_extra={"examples": [6]}) + sandbox_applications: StrictInt = Field(description="Total number of sandbox applications in the account.", alias="sandboxApplications", json_schema_extra={"examples": [2]}) + campaigns: StrictInt = Field(description="Total number of campaigns in the account.", json_schema_extra={"examples": [35]}) + active_campaigns: StrictInt = Field(description="Total number of active campaigns in the account.", alias="activeCampaigns", json_schema_extra={"examples": [15]}) + live_active_campaigns: StrictInt = Field(description="Total number of active campaigns in live applications in the account.", alias="liveActiveCampaigns", json_schema_extra={"examples": [10]}) + coupons: StrictInt = Field(description="Total number of coupons in the account.", json_schema_extra={"examples": [850]}) + active_coupons: StrictInt = Field(description="Total number of active coupons in the account.", alias="activeCoupons", json_schema_extra={"examples": [650]}) + expired_coupons: StrictInt = Field(description="Total number of expired coupons in the account.", alias="expiredCoupons", json_schema_extra={"examples": [200]}) + referral_codes: StrictInt = Field(description="Total number of referral codes in the account.", alias="referralCodes", json_schema_extra={"examples": [500]}) + active_referral_codes: StrictInt = Field(description="Total number of active referral codes in the account.", alias="activeReferralCodes", json_schema_extra={"examples": [100]}) + expired_referral_codes: StrictInt = Field(description="Total number of expired referral codes in the account.", alias="expiredReferralCodes", json_schema_extra={"examples": [400]}) + active_rules: StrictInt = Field(description="Total number of active rules in the account.", alias="activeRules", json_schema_extra={"examples": [35]}) users: StrictInt = Field(description="Total number of users in the account.") - roles: StrictInt = Field(description="Total number of roles in the account.") - custom_attributes: StrictInt = Field(description="Total number of custom attributes in the account.", alias="customAttributes") - webhooks: StrictInt = Field(description="Total number of webhooks in the account.") - loyalty_programs: StrictInt = Field(description="Total number of all loyalty programs in the account.", alias="loyaltyPrograms") - live_loyalty_programs: StrictInt = Field(description="Total number of live loyalty programs in the account.", alias="liveLoyaltyPrograms") - last_updated_at: datetime = Field(description="The point in time when the analytics numbers were updated last.", alias="lastUpdatedAt") + roles: StrictInt = Field(description="Total number of roles in the account.", json_schema_extra={"examples": [10]}) + custom_attributes: StrictInt = Field(description="Total number of custom attributes in the account.", alias="customAttributes", json_schema_extra={"examples": [18]}) + webhooks: StrictInt = Field(description="Total number of webhooks in the account.", json_schema_extra={"examples": [2]}) + loyalty_programs: StrictInt = Field(description="Total number of all loyalty programs in the account.", alias="loyaltyPrograms", json_schema_extra={"examples": [5]}) + live_loyalty_programs: StrictInt = Field(description="Total number of live loyalty programs in the account.", alias="liveLoyaltyPrograms", json_schema_extra={"examples": [5]}) + last_updated_at: datetime = Field(description="The point in time when the analytics numbers were updated last.", alias="lastUpdatedAt", json_schema_extra={"examples": ["2022-12-12T12:12:12Z"]}) __properties: ClassVar[List[str]] = ["applications", "liveApplications", "sandboxApplications", "campaigns", "activeCampaigns", "liveActiveCampaigns", "coupons", "activeCoupons", "expiredCoupons", "referralCodes", "activeReferralCodes", "expiredReferralCodes", "activeRules", "users", "roles", "customAttributes", "webhooks", "loyaltyPrograms", "liveLoyaltyPrograms", "lastUpdatedAt"] model_config = ConfigDict( diff --git a/talon_one/models/account_entity.py b/talon_one/models/account_entity.py index 2f8dffb..377f126 100644 --- a/talon_one/models/account_entity.py +++ b/talon_one/models/account_entity.py @@ -27,7 +27,7 @@ class AccountEntity(BaseModel): """ AccountEntity """ # noqa: E501 - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) __properties: ClassVar[List[str]] = ["accountId"] model_config = ConfigDict( diff --git a/talon_one/models/achievement.py b/talon_one/models/achievement.py index e550d8a..8673519 100644 --- a/talon_one/models/achievement.py +++ b/talon_one/models/achievement.py @@ -30,24 +30,24 @@ class Achievement(BaseModel): """ Achievement """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - name: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ") - title: StrictStr = Field(description="The display name for the achievement in the Campaign Manager.") - description: StrictStr = Field(description="A description of the achievement.") - target: Union[StrictFloat, StrictInt] = Field(description="The required number of actions or the transactional milestone to complete the achievement.") - period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + name: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ", json_schema_extra={"examples": ["Order50Discount"]}) + title: StrictStr = Field(description="The display name for the achievement in the Campaign Manager.", json_schema_extra={"examples": ["50% off on 50th purchase."]}) + description: StrictStr = Field(description="A description of the achievement.", json_schema_extra={"examples": ["50% off for every 50th purchase in a year."]}) + target: Union[StrictFloat, StrictInt] = Field(description="The required number of actions or the transactional milestone to complete the achievement.", json_schema_extra={"examples": [50]}) + period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ", json_schema_extra={"examples": ["1Y"]}) period_end_override: Optional[TimePoint] = Field(default=None, alias="periodEndOverride") - recurrence_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy") - activation_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy") - fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate") - end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate") - allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="allowRollbackAfterCompletion") - campaign_id: StrictInt = Field(description="The ID of the campaign the achievement belongs to.", alias="campaignId") - user_id: StrictInt = Field(description="ID of the user that created this achievement.", alias="userId") - created_by: Optional[StrictStr] = Field(default=None, description="Name of the user that created the achievement. **Note**: This is not available if the user has been deleted. ", alias="createdBy") + recurrence_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy", json_schema_extra={"examples": ["no_recurrence"]}) + activation_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy", json_schema_extra={"examples": ["fixed_schedule"]}) + fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate", json_schema_extra={"examples": ["2024-01-15T15:04:05Z07:00"]}) + end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate", json_schema_extra={"examples": ["2024-02-15T15:04:05Z07:00"]}) + 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]}) + campaign_id: StrictInt = Field(description="The ID of the campaign the achievement belongs to.", alias="campaignId", json_schema_extra={"examples": [1]}) + user_id: StrictInt = Field(description="ID of the user that created this achievement.", alias="userId", json_schema_extra={"examples": [1234]}) + created_by: Optional[StrictStr] = Field(default=None, description="Name of the user that created the achievement. **Note**: This is not available if the user has been deleted. ", alias="createdBy", json_schema_extra={"examples": ["John Doe"]}) has_progress: Optional[StrictBool] = Field(default=None, description="Indicates if a customer has made progress in the achievement.", alias="hasProgress") - status: Optional[StrictStr] = Field(default=None, description="The status of the achievement.") + 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') diff --git a/talon_one/models/achievement_additional_properties.py b/talon_one/models/achievement_additional_properties.py index cb8f0b2..f750284 100644 --- a/talon_one/models/achievement_additional_properties.py +++ b/talon_one/models/achievement_additional_properties.py @@ -27,11 +27,11 @@ class AchievementAdditionalProperties(BaseModel): """ AchievementAdditionalProperties """ # noqa: E501 - campaign_id: StrictInt = Field(description="The ID of the campaign the achievement belongs to.", alias="campaignId") - user_id: StrictInt = Field(description="ID of the user that created this achievement.", alias="userId") - created_by: Optional[StrictStr] = Field(default=None, description="Name of the user that created the achievement. **Note**: This is not available if the user has been deleted. ", alias="createdBy") + campaign_id: StrictInt = Field(description="The ID of the campaign the achievement belongs to.", alias="campaignId", json_schema_extra={"examples": [1]}) + user_id: StrictInt = Field(description="ID of the user that created this achievement.", alias="userId", json_schema_extra={"examples": [1234]}) + created_by: Optional[StrictStr] = Field(default=None, description="Name of the user that created the achievement. **Note**: This is not available if the user has been deleted. ", alias="createdBy", json_schema_extra={"examples": ["John Doe"]}) has_progress: Optional[StrictBool] = Field(default=None, description="Indicates if a customer has made progress in the achievement.", alias="hasProgress") - status: Optional[StrictStr] = Field(default=None, description="The status of the achievement.") + status: Optional[StrictStr] = Field(default=None, description="The status of the achievement.", json_schema_extra={"examples": ["inprogress"]}) __properties: ClassVar[List[str]] = ["campaignId", "userId", "createdBy", "hasProgress", "status"] @field_validator('status') diff --git a/talon_one/models/achievement_additional_properties_v2.py b/talon_one/models/achievement_additional_properties_v2.py index 57c180b..dd4d7df 100644 --- a/talon_one/models/achievement_additional_properties_v2.py +++ b/talon_one/models/achievement_additional_properties_v2.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.time_point import TimePoint from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -27,11 +28,12 @@ class AchievementAdditionalPropertiesV2(BaseModel): """ AchievementAdditionalPropertiesV2 """ # noqa: E501 - user_id: StrictInt = Field(description="The ID of the user that created this achievement.", alias="userId") - created_by: Optional[StrictStr] = Field(default=None, description="Name of the user that created the achievement. **Note**: This is not available if the user has been deleted. ", alias="createdBy") + user_id: StrictInt = Field(description="The ID of the user that created this achievement.", alias="userId", json_schema_extra={"examples": [1234]}) + created_by: Optional[StrictStr] = Field(default=None, description="Name of the user that created the achievement. **Note**: This is not available if the user has been deleted. ", alias="createdBy", json_schema_extra={"examples": ["John Doe"]}) + period_end_override: Optional[TimePoint] = Field(default=None, alias="periodEndOverride") has_progress: Optional[StrictBool] = Field(default=None, description="Indicates if a customer has made progress in the achievement.", alias="hasProgress") - status: Optional[StrictStr] = Field(default=None, description="The status of the achievement.") - __properties: ClassVar[List[str]] = ["userId", "createdBy", "hasProgress", "status"] + status: Optional[StrictStr] = Field(default=None, description="The status of the achievement. - `active`: The achievement is available to customers. - `scheduled`: The achievement has a `fixedStartDate` set in the future. - `expired`: The achievement's `endDate` is in the past. ", json_schema_extra={"examples": ["active"]}) + __properties: ClassVar[List[str]] = ["userId", "createdBy", "periodEndOverride", "hasProgress", "status"] @field_validator('status') def status_validate_enum(cls, value): @@ -39,8 +41,8 @@ def status_validate_enum(cls, value): if value is None: return value - if value not in set(['inprogress', 'expired', 'not_started', 'completed']): - raise ValueError("must be one of enum values ('inprogress', 'expired', 'not_started', 'completed')") + if value not in set(['active', 'scheduled', 'expired']): + raise ValueError("must be one of enum values ('active', 'scheduled', 'expired')") return value model_config = ConfigDict( @@ -82,6 +84,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 period_end_override + if self.period_end_override: + _dict['periodEndOverride'] = self.period_end_override.to_dict() return _dict @classmethod @@ -96,6 +101,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "userId": obj.get("userId"), "createdBy": obj.get("createdBy"), + "periodEndOverride": TimePoint.from_dict(obj["periodEndOverride"]) if obj.get("periodEndOverride") is not None else None, "hasProgress": obj.get("hasProgress"), "status": obj.get("status") }) diff --git a/talon_one/models/achievement_base.py b/talon_one/models/achievement_base.py index d138067..995a98d 100644 --- a/talon_one/models/achievement_base.py +++ b/talon_one/models/achievement_base.py @@ -30,17 +30,17 @@ class AchievementBase(BaseModel): """ AchievementBase """ # noqa: E501 - name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ") - title: Optional[StrictStr] = Field(default=None, description="The display name for the achievement in the Campaign Manager.") - description: Optional[StrictStr] = Field(default=None, description="A description of the achievement.") - target: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The required number of actions or the transactional milestone to complete the achievement.") - period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ", json_schema_extra={"examples": ["Order50Discount"]}) + title: Optional[StrictStr] = Field(default=None, description="The display name for the achievement in the Campaign Manager.", json_schema_extra={"examples": ["50% off on 50th purchase."]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the achievement.", json_schema_extra={"examples": ["50% off for every 50th purchase in a year."]}) + target: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The required number of actions or the transactional milestone to complete the achievement.", json_schema_extra={"examples": [50]}) + period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ", json_schema_extra={"examples": ["1Y"]}) period_end_override: Optional[TimePoint] = Field(default=None, alias="periodEndOverride") - recurrence_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy") - activation_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy") - fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate") - end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate") - allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="allowRollbackAfterCompletion") + recurrence_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy", json_schema_extra={"examples": ["no_recurrence"]}) + activation_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy", json_schema_extra={"examples": ["fixed_schedule"]}) + fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate", json_schema_extra={"examples": ["2024-01-15T15:04:05Z07:00"]}) + end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate", json_schema_extra={"examples": ["2024-02-15T15:04:05Z07:00"]}) + 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') diff --git a/talon_one/models/achievement_base_v2.py b/talon_one/models/achievement_base_v2.py index 20f8e65..8415c32 100644 --- a/talon_one/models/achievement_base_v2.py +++ b/talon_one/models/achievement_base_v2.py @@ -29,17 +29,17 @@ class AchievementBaseV2(BaseModel): """ AchievementBaseV2 """ # noqa: E501 - name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ") - title: Optional[StrictStr] = Field(default=None, description="The display name for the achievement in the Campaign Manager.") - description: Optional[StrictStr] = Field(default=None, description="A description of the achievement.") - target: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The required number of actions or the transactional milestone to complete the achievement.") - period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ") - recurrence_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy") - activation_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy") - fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate") - end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate") - allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="allowRollbackAfterCompletion") - 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") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ", json_schema_extra={"examples": ["Order50Discount"]}) + title: Optional[StrictStr] = Field(default=None, description="The display name for the achievement in the Campaign Manager.", json_schema_extra={"examples": ["50% off on 50th purchase."]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the achievement.", json_schema_extra={"examples": ["50% off for every 50th purchase in a year."]}) + target: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The required number of actions or the transactional milestone to complete the achievement.", json_schema_extra={"examples": [50]}) + period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ", json_schema_extra={"examples": ["1Y"]}) + recurrence_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy", json_schema_extra={"examples": ["no_recurrence"]}) + activation_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy", json_schema_extra={"examples": ["fixed_schedule"]}) + fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate", json_schema_extra={"examples": ["2024-01-15T15:04:05+07:00"]}) + end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate", json_schema_extra={"examples": ["2024-01-15T15:04:05+07:00"]}) + 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]}) + 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') diff --git a/talon_one/models/achievement_progress.py b/talon_one/models/achievement_progress.py index c7d1ece..999be0e 100644 --- a/talon_one/models/achievement_progress.py +++ b/talon_one/models/achievement_progress.py @@ -28,11 +28,11 @@ class AchievementProgress(BaseModel): """ The current progress of the customer in the achievement. """ # noqa: E501 - status: StrictStr = Field(description="The status of the achievement.") - progress: Union[StrictFloat, StrictInt] = Field(description="The current progress of the customer in the achievement.") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which the customer started the achievement.", alias="startDate") - completion_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the customer completed the achievement.", alias="completionDate") - end_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the achievement ends and resets for the customer.", alias="endDate") + status: StrictStr = Field(description="The status of the achievement.", json_schema_extra={"examples": ["completed"]}) + progress: Union[StrictFloat, StrictInt] = Field(description="The current progress of the customer in the achievement.", json_schema_extra={"examples": [10]}) + start_date: Optional[datetime] = Field(default=None, description="Timestamp at which the customer started the achievement.", alias="startDate", json_schema_extra={"examples": ["2024-01-01T15:04:05Z07:00"]}) + completion_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the customer completed the achievement.", alias="completionDate", json_schema_extra={"examples": ["2024-01-15T15:04:05Z07:00"]}) + end_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the achievement ends and resets for the customer.", alias="endDate", json_schema_extra={"examples": ["2024-02-01T15:04:05Z07:00"]}) __properties: ClassVar[List[str]] = ["status", "progress", "startDate", "completionDate", "endDate"] @field_validator('status') diff --git a/talon_one/models/achievement_progress_with_definition.py b/talon_one/models/achievement_progress_with_definition.py index ca866a6..155b437 100644 --- a/talon_one/models/achievement_progress_with_definition.py +++ b/talon_one/models/achievement_progress_with_definition.py @@ -29,22 +29,22 @@ class AchievementProgressWithDefinition(BaseModel): """ AchievementProgressWithDefinition """ # noqa: E501 - status: StrictStr = Field(description="The status of the achievement.") - progress: Union[StrictFloat, StrictInt] = Field(description="The current progress of the customer in the achievement.") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which the customer started the achievement.", alias="startDate") - completion_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the customer completed the achievement.", alias="completionDate") - end_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the achievement ends and resets for the customer.", alias="endDate") - achievement_id: StrictInt = Field(description="The internal ID of the achievement.", alias="achievementId") - name: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The internal name of the achievement used in API requests. ") - title: StrictStr = Field(description="The display name of the achievement in the Campaign Manager.") - description: StrictStr = Field(description="The description of the achievement in the Campaign Manager.") - campaign_id: StrictInt = Field(description="The ID of the campaign the achievement belongs to.", alias="campaignId") - target: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The required number of actions or the transactional milestone to complete the achievement.") - achievement_recurrence_policy: StrictStr = Field(description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="achievementRecurrencePolicy") - achievement_activation_policy: StrictStr = Field(description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="achievementActivationPolicy") - achievement_fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `achievementActivationPolicy` is equal to `fixed_schedule`. **Note:** It is an RFC3339 timestamp string. ", alias="achievementFixedStartDate") - achievement_end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It is an RFC3339 timestamp string. ", alias="achievementEndDate") - achievement_allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="achievementAllowRollbackAfterCompletion") + status: StrictStr = Field(description="The status of the achievement.", json_schema_extra={"examples": ["completed"]}) + progress: Union[StrictFloat, StrictInt] = Field(description="The current progress of the customer in the achievement.", json_schema_extra={"examples": [10]}) + start_date: Optional[datetime] = Field(default=None, description="Timestamp at which the customer started the achievement.", alias="startDate", json_schema_extra={"examples": ["2024-01-01T15:04:05Z07:00"]}) + completion_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the customer completed the achievement.", alias="completionDate", json_schema_extra={"examples": ["2024-01-15T15:04:05Z07:00"]}) + end_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the achievement ends and resets for the customer.", alias="endDate", json_schema_extra={"examples": ["2024-02-01T15:04:05Z07:00"]}) + achievement_id: StrictInt = Field(description="The internal ID of the achievement.", alias="achievementId", json_schema_extra={"examples": [3]}) + name: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The internal name of the achievement used in API requests. ", json_schema_extra={"examples": ["FreeCoffee10Orders"]}) + title: StrictStr = Field(description="The display name of the achievement in the Campaign Manager.", json_schema_extra={"examples": ["50% off on 50th purchase."]}) + description: StrictStr = Field(description="The description of the achievement in the Campaign Manager.", json_schema_extra={"examples": ["50% off for every 50th purchase in a year."]}) + campaign_id: StrictInt = Field(description="The ID of the campaign the achievement belongs to.", alias="campaignId", json_schema_extra={"examples": [3]}) + target: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The required number of actions or the transactional milestone to complete the achievement.", json_schema_extra={"examples": [10]}) + achievement_recurrence_policy: StrictStr = Field(description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="achievementRecurrencePolicy", json_schema_extra={"examples": ["no_recurrence"]}) + achievement_activation_policy: StrictStr = Field(description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="achievementActivationPolicy", json_schema_extra={"examples": ["fixed_schedule"]}) + achievement_fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `achievementActivationPolicy` is equal to `fixed_schedule`. **Note:** It is an RFC3339 timestamp string. ", alias="achievementFixedStartDate", json_schema_extra={"examples": ["2024-01-15T15:04:05Z07:00"]}) + achievement_end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It is an RFC3339 timestamp string. ", alias="achievementEndDate", json_schema_extra={"examples": ["2024-02-15T15:04:05Z07:00"]}) + achievement_allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="achievementAllowRollbackAfterCompletion", json_schema_extra={"examples": [False]}) __properties: ClassVar[List[str]] = ["status", "progress", "startDate", "completionDate", "endDate", "achievementId", "name", "title", "description", "campaignId", "target", "achievementRecurrencePolicy", "achievementActivationPolicy", "achievementFixedStartDate", "achievementEndDate", "achievementAllowRollbackAfterCompletion"] @field_validator('status') diff --git a/talon_one/models/achievement_reference.py b/talon_one/models/achievement_reference.py index 8cc8ca7..cc9e804 100644 --- a/talon_one/models/achievement_reference.py +++ b/talon_one/models/achievement_reference.py @@ -27,11 +27,12 @@ class AchievementReference(BaseModel): """ AchievementReference """ # noqa: E501 - achievement_id: StrictInt = Field(description="The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievementsV2) endpoint.", alias="achievementId") - application_id: StrictInt = Field(description="The ID of the Application associated with the campaign that references this achievement.", alias="applicationId") - application_name: StrictStr = Field(description="The name of the Application associated with the campaign that references this achievement.", alias="applicationName") - campaign_id: StrictInt = Field(description="The ID of the campaign that references this achievement.", alias="campaignId") - __properties: ClassVar[List[str]] = ["achievementId", "applicationId", "applicationName", "campaignId"] + achievement_id: StrictInt = Field(description="The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievementsV2) endpoint.", alias="achievementId", json_schema_extra={"examples": [12]}) + application_id: StrictInt = Field(description="The ID of the Application associated with the campaign that references this achievement.", alias="applicationId", json_schema_extra={"examples": [101]}) + application_name: StrictStr = Field(description="The name of the Application associated with the campaign that references this achievement.", alias="applicationName", json_schema_extra={"examples": ["North America Storefront"]}) + campaign_id: StrictInt = Field(description="The ID of the campaign that references this achievement.", alias="campaignId", json_schema_extra={"examples": [4501]}) + campaign_name: StrictStr = Field(description="The name of the campaign that references this achievement.", alias="campaignName", json_schema_extra={"examples": ["Summer promotions"]}) + __properties: ClassVar[List[str]] = ["achievementId", "applicationId", "applicationName", "campaignId", "campaignName"] model_config = ConfigDict( validate_by_name=True, @@ -87,7 +88,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "achievementId": obj.get("achievementId"), "applicationId": obj.get("applicationId"), "applicationName": obj.get("applicationName"), - "campaignId": obj.get("campaignId") + "campaignId": obj.get("campaignId"), + "campaignName": obj.get("campaignName") }) return _obj diff --git a/talon_one/models/achievement_status_entry.py b/talon_one/models/achievement_status_entry.py index e0499e7..743572b 100644 --- a/talon_one/models/achievement_status_entry.py +++ b/talon_one/models/achievement_status_entry.py @@ -31,21 +31,21 @@ class AchievementStatusEntry(BaseModel): """ AchievementStatusEntry """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - name: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ") - title: StrictStr = Field(description="The display name for the achievement in the Campaign Manager.") - description: StrictStr = Field(description="A description of the achievement.") - target: Union[StrictFloat, StrictInt] = Field(description="The required number of actions or the transactional milestone to complete the achievement.") - period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + name: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ", json_schema_extra={"examples": ["Order50Discount"]}) + title: StrictStr = Field(description="The display name for the achievement in the Campaign Manager.", json_schema_extra={"examples": ["50% off on 50th purchase."]}) + description: StrictStr = Field(description="A description of the achievement.", json_schema_extra={"examples": ["50% off for every 50th purchase in a year."]}) + target: Union[StrictFloat, StrictInt] = Field(description="The required number of actions or the transactional milestone to complete the achievement.", json_schema_extra={"examples": [50]}) + period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ", json_schema_extra={"examples": ["1Y"]}) period_end_override: Optional[TimePoint] = Field(default=None, alias="periodEndOverride") - recurrence_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy") - activation_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy") - fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate") - end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate") - allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="allowRollbackAfterCompletion") - campaign_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign the achievement belongs to.", alias="campaignId") - status: Optional[StrictStr] = Field(default=None, description="The status of the achievement.") + recurrence_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy", json_schema_extra={"examples": ["no_recurrence"]}) + activation_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy", json_schema_extra={"examples": ["fixed_schedule"]}) + fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate", json_schema_extra={"examples": ["2024-01-15T15:04:05Z07:00"]}) + end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate", json_schema_extra={"examples": ["2024-02-15T15:04:05Z07:00"]}) + 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]}) + campaign_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign the achievement belongs to.", alias="campaignId", json_schema_extra={"examples": [1]}) + status: Optional[StrictStr] = Field(default=None, description="The status of the achievement.", json_schema_extra={"examples": ["active"]}) 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"] diff --git a/talon_one/models/achievement_v2.py b/talon_one/models/achievement_v2.py index 5294596..6e14f45 100644 --- a/talon_one/models/achievement_v2.py +++ b/talon_one/models/achievement_v2.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional, Union from typing_extensions import Annotated +from talon_one.models.time_point import TimePoint from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -29,26 +30,27 @@ class AchievementV2(BaseModel): """ AchievementV2 """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - name: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ") - title: StrictStr = Field(description="The display name for the achievement in the Campaign Manager.") - description: StrictStr = Field(description="A description of the achievement.") - target: Union[StrictFloat, StrictInt] = Field(description="The required number of actions or the transactional milestone to complete the achievement.") - period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ") - recurrence_policy: StrictStr = Field(description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy") - activation_policy: StrictStr = Field(description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy") - fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate") - end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate") - allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="allowRollbackAfterCompletion") - 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") - user_id: StrictInt = Field(description="The ID of the user that created this achievement.", alias="userId") - created_by: Optional[StrictStr] = Field(default=None, description="Name of the user that created the achievement. **Note**: This is not available if the user has been deleted. ", alias="createdBy") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + name: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ", json_schema_extra={"examples": ["Order50Discount"]}) + title: StrictStr = Field(description="The display name for the achievement in the Campaign Manager.", json_schema_extra={"examples": ["50% off on 50th purchase."]}) + description: StrictStr = Field(description="A description of the achievement.", json_schema_extra={"examples": ["50% off for every 50th purchase in a year."]}) + target: Union[StrictFloat, StrictInt] = Field(description="The required number of actions or the transactional milestone to complete the achievement.", json_schema_extra={"examples": [50]}) + period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ", json_schema_extra={"examples": ["1Y"]}) + recurrence_policy: StrictStr = Field(description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy", json_schema_extra={"examples": ["no_recurrence"]}) + activation_policy: StrictStr = Field(description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy", json_schema_extra={"examples": ["fixed_schedule"]}) + fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate", json_schema_extra={"examples": ["2024-01-15T15:04:05+07:00"]}) + end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate", json_schema_extra={"examples": ["2024-01-15T15:04:05+07:00"]}) + 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]}) + 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]]}) + user_id: StrictInt = Field(description="The ID of the user that created this achievement.", alias="userId", json_schema_extra={"examples": [1234]}) + created_by: Optional[StrictStr] = Field(default=None, description="Name of the user that created the achievement. **Note**: This is not available if the user has been deleted. ", alias="createdBy", json_schema_extra={"examples": ["John Doe"]}) + period_end_override: Optional[TimePoint] = Field(default=None, alias="periodEndOverride") has_progress: Optional[StrictBool] = Field(default=None, description="Indicates if a customer has made progress in the achievement.", alias="hasProgress") - status: Optional[StrictStr] = Field(default=None, description="The status of the achievement.") - sandbox: StrictBool = Field(description="Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type.") - timezone: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string containing an IANA timezone descriptor.") - __properties: ClassVar[List[str]] = ["id", "created", "name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "subscribedApplications", "userId", "createdBy", "hasProgress", "status", "sandbox", "timezone"] + status: Optional[StrictStr] = Field(default=None, description="The status of the achievement. - `active`: The achievement is available to customers. - `scheduled`: The achievement has a `fixedStartDate` set in the future. - `expired`: The achievement's `endDate` is in the past. ", json_schema_extra={"examples": ["active"]}) + sandbox: StrictBool = Field(description="Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type.", json_schema_extra={"examples": [True]}) + 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') def name_validate_regular_expression(cls, value): @@ -80,8 +82,8 @@ def status_validate_enum(cls, value): if value is None: return value - if value not in set(['inprogress', 'expired', 'not_started', 'completed']): - raise ValueError("must be one of enum values ('inprogress', 'expired', 'not_started', 'completed')") + if value not in set(['active', 'scheduled', 'expired']): + raise ValueError("must be one of enum values ('active', 'scheduled', 'expired')") return value model_config = ConfigDict( @@ -123,6 +125,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 period_end_override + if self.period_end_override: + _dict['periodEndOverride'] = self.period_end_override.to_dict() return _dict @classmethod @@ -150,6 +155,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "subscribedApplications": obj.get("subscribedApplications"), "userId": obj.get("userId"), "createdBy": obj.get("createdBy"), + "periodEndOverride": TimePoint.from_dict(obj["periodEndOverride"]) if obj.get("periodEndOverride") is not None else None, "hasProgress": obj.get("hasProgress"), "status": obj.get("status"), "sandbox": obj.get("sandbox"), diff --git a/talon_one/models/activate_loyalty_points.py b/talon_one/models/activate_loyalty_points.py index 6a3821b..e2f7eb5 100644 --- a/talon_one/models/activate_loyalty_points.py +++ b/talon_one/models/activate_loyalty_points.py @@ -29,8 +29,8 @@ class ActivateLoyaltyPoints(BaseModel): """ Activate loyalty points """ # noqa: E501 - transaction_uuids: Optional[Annotated[List[UUID], Field(min_length=1, max_length=50)]] = Field(default=None, description="An array of transaction UUIDs used to activate specific pending point transactions. If provided, do not include the `sessionId` parameter. ", alias="transactionUUIDs") - session_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The ID of the session containing the pending point transactions to activate. If provided, do not include the `transactionUUIDs` parameter. ", alias="sessionId") + transaction_uuids: Optional[Annotated[List[UUID], Field(min_length=1, max_length=50)]] = Field(default=None, description="An array of transaction UUIDs used to activate specific pending point transactions. If provided, do not include the `sessionId` parameter. ", alias="transactionUUIDs", json_schema_extra={"examples": [["8f1a8d7c-9c3e-4a5e-9f0d-2c5f7a3b1cde"]]}) + session_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The ID of the session containing the pending point transactions to activate. If provided, do not include the `transactionUUIDs` parameter. ", alias="sessionId", json_schema_extra={"examples": ["ac08cc3c43470426591ad75b2d685ec04_v2"]}) __properties: ClassVar[List[str]] = ["transactionUUIDs", "sessionId"] model_config = ConfigDict( diff --git a/talon_one/models/activate_user_request.py b/talon_one/models/activate_user_request.py index f3aa5f8..8da75c4 100644 --- a/talon_one/models/activate_user_request.py +++ b/talon_one/models/activate_user_request.py @@ -27,7 +27,7 @@ class ActivateUserRequest(BaseModel): """ ActivateUserRequest """ # noqa: E501 - email: StrictStr = Field(description="The email address associated with the user profile.") + email: StrictStr = Field(description="The email address associated with the user profile.", json_schema_extra={"examples": ["john.doe@example.com"]}) __properties: ClassVar[List[str]] = ["email"] model_config = ConfigDict( diff --git a/talon_one/models/add_free_item_effect_props.py b/talon_one/models/add_free_item_effect_props.py index 58c45bb..558c6fa 100644 --- a/talon_one/models/add_free_item_effect_props.py +++ b/talon_one/models/add_free_item_effect_props.py @@ -25,10 +25,10 @@ class AddFreeItemEffectProps(BaseModel): """ - The properties specific to the \"addFreeItem\" effect. This gets triggered whenever a validated rule contained an \"add free item\" effect. + This effect indicates that a free item should be added to the shopping cart in the current session. In this example, add the SKU to the shopping cart and set its price to `0`. The effect of a successful referral can mean a free item for someone else, such as the referrer. """ # noqa: E501 - sku: StrictStr = Field(description="SKU of the item that needs to be added.") - name: StrictStr = Field(description="The name / description of the effect") + sku: StrictStr = Field(description="SKU of the item that needs to be added.", json_schema_extra={"examples": ["SKU1241028"]}) + name: StrictStr = Field(description="Description of the effect.") desired_quantity: Optional[StrictInt] = Field(default=None, description="The original quantity in case a partial reward was applied.", alias="desiredQuantity") __properties: ClassVar[List[str]] = ["sku", "name", "desiredQuantity"] diff --git a/talon_one/models/add_item_catalog_action.py b/talon_one/models/add_item_catalog_action.py index 2e7ef58..6485438 100644 --- a/talon_one/models/add_item_catalog_action.py +++ b/talon_one/models/add_item_catalog_action.py @@ -28,11 +28,11 @@ class AddItemCatalogAction(BaseModel): """ The specific properties of the \"ADD\" catalog sync action. """ # noqa: E501 - sku: StrictStr = Field(description="The unique SKU of the item to add.") - price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price of the item.") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="The attributes of the item to add.") + sku: StrictStr = Field(description="The unique SKU of the item to add.", json_schema_extra={"examples": ["SKU1241028"]}) + price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price of the item.", json_schema_extra={"examples": [99.99]}) + attributes: Optional[Dict[str, Any]] = Field(default=None, description="The attributes of the item to add.", json_schema_extra={"examples": [{"origin": "germany", "color": "blue"}]}) product: Optional[Product] = None - replace_if_exists: Optional[StrictBool] = Field(default=False, description="Indicates whether to replace the attributes of the item if the same SKU exists. **Note**: When set to `true`: - If you do not provide a new `price` value, the existing `price` value is retained. - If you do not provide a new `product` value, the `product` value is set to `null`. ", alias="replaceIfExists") + replace_if_exists: Optional[StrictBool] = Field(default=False, description="Indicates whether to replace the attributes of the item if the same SKU exists. **Note**: When set to `true`: - If you do not provide a new `price` value, the existing `price` value is retained. - If you do not provide a new `product` value, the `product` value is set to `null`. ", alias="replaceIfExists", json_schema_extra={"examples": [False]}) __properties: ClassVar[List[str]] = ["sku", "price", "attributes", "product", "replaceIfExists"] model_config = ConfigDict( diff --git a/talon_one/models/add_loyalty_points.py b/talon_one/models/add_loyalty_points.py index daa7b66..643b090 100644 --- a/talon_one/models/add_loyalty_points.py +++ b/talon_one/models/add_loyalty_points.py @@ -29,14 +29,14 @@ class AddLoyaltyPoints(BaseModel): """ Points to add. """ # noqa: E501 - points: Union[Annotated[float, Field(le=999999999999.99, strict=True, gt=0)], Annotated[int, Field(le=2147483647, strict=True, gt=0)]] = Field(description="Amount of loyalty points.") - name: Optional[StrictStr] = Field(default=None, description="Name / reason for the point addition.") - validity_duration: Optional[StrictStr] = Field(default=None, description="The time format is either: - `unlimited` or, - an **integer** followed by one letter indicating the time unit. Examples: `unlimited`, `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. If passed, `validUntil` should be omitted. ", alias="validityDuration") - valid_until: Optional[datetime] = Field(default=None, description="Date and time when points should expire. The value should be provided in RFC 3339 format. If passed, `validityDuration` should be omitted. ", alias="validUntil") - pending_duration: Optional[StrictStr] = Field(default=None, description="The amount of time before the points are considered valid. The time format is either: - `immediate` or, - `on_action` or, - an **integer** followed by one letter indicating the time unit. Examples: `immediate`, `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`, `on_action`. 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. ", alias="pendingDuration") - pending_until: Optional[datetime] = Field(default=None, description="Date and time after the points are considered valid. The value should be provided in RFC 3339 format. If passed, `pendingDuration` should be omitted. ", alias="pendingUntil") - subledger_id: Optional[StrictStr] = Field(default=None, description="ID of the subledger the points are added to. If there is no existing subledger with this ID, the subledger is created automatically.", alias="subledgerId") - application_id: Optional[StrictInt] = Field(default=None, description="ID of the Application that is connected to the loyalty program. It is displayed in your Talon.One deployment URL.", alias="applicationId") + points: Union[Annotated[float, Field(le=999999999999.99, strict=True, gt=0)], Annotated[int, Field(le=2147483647, strict=True, gt=0)]] = Field(description="Amount of loyalty points.", json_schema_extra={"examples": [300]}) + name: Optional[StrictStr] = Field(default=None, description="Name / reason for the point addition.", json_schema_extra={"examples": ["Compensation"]}) + validity_duration: Optional[StrictStr] = Field(default=None, description="The time format is either: - `unlimited` or, - an **integer** followed by one letter indicating the time unit. Examples: `unlimited`, `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. If passed, `validUntil` should be omitted. ", alias="validityDuration", json_schema_extra={"examples": ["5D"]}) + valid_until: Optional[datetime] = Field(default=None, description="Date and time when points should expire. The value should be provided in RFC 3339 format. If passed, `validityDuration` should be omitted. ", alias="validUntil", json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) + pending_duration: Optional[StrictStr] = Field(default=None, description="The amount of time before the points are considered valid. The time format is either: - `immediate` or, - `on_action` or, - an **integer** followed by one letter indicating the time unit. Examples: `immediate`, `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`, `on_action`. 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. ", alias="pendingDuration", json_schema_extra={"examples": ["12h"]}) + pending_until: Optional[datetime] = Field(default=None, description="Date and time after the points are considered valid. The value should be provided in RFC 3339 format. If passed, `pendingDuration` should be omitted. ", alias="pendingUntil", json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) + subledger_id: Optional[StrictStr] = Field(default=None, description="ID of the subledger the points are added to. If there is no existing subledger with this ID, the subledger is created automatically.", alias="subledgerId", json_schema_extra={"examples": ["sub-123"]}) + application_id: Optional[StrictInt] = Field(default=None, description="ID of the Application that is connected to the loyalty program. It is displayed in your Talon.One deployment URL.", alias="applicationId", json_schema_extra={"examples": [322]}) __properties: ClassVar[List[str]] = ["points", "name", "validityDuration", "validUntil", "pendingDuration", "pendingUntil", "subledgerId", "applicationId"] model_config = ConfigDict( diff --git a/talon_one/models/add_loyalty_points_effect_props.py b/talon_one/models/add_loyalty_points_effect_props.py index 8d261fb..c3aeb51 100644 --- a/talon_one/models/add_loyalty_points_effect_props.py +++ b/talon_one/models/add_loyalty_points_effect_props.py @@ -27,24 +27,24 @@ class AddLoyaltyPointsEffectProps(BaseModel): """ - The properties specific to the \"addLoyaltyPoints\" effect. This gets triggered whenever a validated rule contained an \"add loyalty\" effect. These points are automatically stored and managed inside Talon.One. + This effect indicates that a defined amount of loyalty points was successfully added to the customer's profile or to a loyalty card. If you use the [Add loyalty points per item effect](https://docs.talon.one/docs/product/rules/effects/available-effects#reward-effects), use the `cartItemPosition` property to identify which item to add the loyalty points for. Enabling [partial rewards](https://docs.talon.one/docs/product/applications/manage-general-settings#partial-rewards) allows a rule that would fail because of insufficient budget to pass. The rule still fails when the budget reaches 0. Use the `desiredValue` property to identify the original amount of loyalty points. If you use **Add loyalty points per item** and if the session contains some cart items with _quantity > 1_, use the `cartItemSubPosition` property to identify the item unit in its line item. See the example below for more information. If your list of cart items is a [bundle definition](https://docs.talon.one/docs/product/rules/create-and-manage-bundles), use the `bundleIndex` and `bundleName` properties to identify the bundle containing the items for which loyalty points are added. If you have set custom activation and expiration dates for the loyalty points, use the `startDate` and `expiryDate` properties to identify when the reward will be active and when will expire. If the loyalty program is [profile-based](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types), use the `recipientIntegrationId` property to identify the user who receives the loyalty points. If the loyalty program is [card-based](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types), use the `cardIdentifier` property to identify the loyalty card on which these points are added. The points only persist when the session is closed. """ # noqa: E501 - name: StrictStr = Field(description="The name / description of this loyalty point addition.") + name: StrictStr = Field(description="The reason of this loyalty point addition.") program_id: StrictInt = Field(description="The ID of the loyalty program where these points were added.", alias="programId") sub_ledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were added.", alias="subLedgerId") value: Union[StrictFloat, StrictInt] = Field(description="The amount of points that were added.") - desired_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The original amount of loyalty points to be awarded.", alias="desiredValue") - recipient_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The user for whom these points were added.", alias="recipientIntegrationId") - start_date: Optional[datetime] = Field(default=None, description="Date after which points will be valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Date after which points will expire.", alias="expiryDate") - transaction_uuid: StrictStr = Field(description="The identifier of this addition in the loyalty ledger.", alias="transactionUUID") - cart_item_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The index of the item in the cart items list on which the loyal points addition should be applied.", alias="cartItemPosition") - cart_item_sub_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="For cart items with `quantity` > 1, the sub position indicates to which item the loyalty points addition is applied. ", alias="cartItemSubPosition") - card_identifier: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=108)]] = Field(default=None, description="The card on which these points were added.", alias="cardIdentifier") - bundle_index: Optional[StrictInt] = Field(default=None, description="The position of the bundle in a list of item bundles created from the same bundle definition.", alias="bundleIndex") - bundle_name: Optional[StrictStr] = Field(default=None, description="The name of the bundle definition.", alias="bundleName") - awaits_activation: Optional[StrictBool] = Field(default=None, description="If `true`, the loyalty points remain pending until a specific action is complete. The `startDate` parameter automatically sets to `on_action`. ", alias="awaitsActivation") - validity_duration: Optional[StrictStr] = Field(default=None, description="The duration for which the points remain active, calculated relative to the activation date. **Note**: This value is returned only if `awaitsActivation` is `true` and `expiryDate` is not set. ", alias="validityDuration") + desired_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="(Partial rewards enabled only) The amount of loyalty points to be awarded without considering budget limitations.", alias="desiredValue") + recipient_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The user for whom these points were added.", alias="recipientIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + start_date: Optional[datetime] = Field(default=None, description="The date after which the added points will be valid.", alias="startDate") + expiry_date: Optional[datetime] = Field(default=None, description="The date after which the added points will expire.", alias="expiryDate") + transaction_uuid: StrictStr = Field(description="The identifier of this loyalty point transaction.", alias="transactionUUID") + cart_item_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="(_Add points per cart item_ only.) The index of the item in the `cartItem` object for which these points were added.", alias="cartItemPosition") + cart_item_sub_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="(_Add points per cart item_ ) The index of the item unit in its line item.", alias="cartItemSubPosition") + 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 added.", alias="cardIdentifier", json_schema_extra={"examples": ["summer-loyalty-card-0543"]}) + bundle_index: Optional[StrictInt] = Field(default=None, description="_(With bundles only)_ The position of the specific bundle in the list of bundles created from the same bundle definition.", alias="bundleIndex") + bundle_name: Optional[StrictStr] = Field(default=None, description="_(With bundles only)_ The name of the bundle definition.", alias="bundleName") + awaits_activation: Optional[StrictBool] = Field(default=None, description="Indicates whether the points have an action-based start date. This property is returned only for point transactions with an action-based start date.", alias="awaitsActivation") + 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') diff --git a/talon_one/models/add_price_adjustment_catalog_action.py b/talon_one/models/add_price_adjustment_catalog_action.py index a491d28..a456ec1 100644 --- a/talon_one/models/add_price_adjustment_catalog_action.py +++ b/talon_one/models/add_price_adjustment_catalog_action.py @@ -28,7 +28,7 @@ class AddPriceAdjustmentCatalogAction(BaseModel): """ The specific properties of the \"ADD_PRICE_ADJUSTMENT\" catalog sync action. **Note:** You can only use this object if the `Beta` **price types** feature is enabled for your Application. To enable it, contact your Technical Account Manager. """ # noqa: E501 - sku: StrictStr = Field(description="The SKU of the item for which the price is being adjusted.") + sku: StrictStr = Field(description="The SKU of the item for which the price is being adjusted.", json_schema_extra={"examples": ["SKU1241028"]}) adjustments: List[NewPriceAdjustment] = Field(description="A list of adjustments to apply to a given item.") __properties: ClassVar[List[str]] = ["sku", "adjustments"] diff --git a/talon_one/models/add_to_audience_effect_props.py b/talon_one/models/add_to_audience_effect_props.py index 2547454..6774dcf 100644 --- a/talon_one/models/add_to_audience_effect_props.py +++ b/talon_one/models/add_to_audience_effect_props.py @@ -25,12 +25,12 @@ class AddToAudienceEffectProps(BaseModel): """ - The properties specific to the \"addToAudience\" effect. This gets triggered whenever a validated rule contains an \"addToAudience\" effect. + This effect is triggered when a rule containing an [Update audience](https://docs.talon.one/docs/product/rules/effects/use-effects#update-an-audience) effect with **Add customer to an audience** selected is validated. It indicates that a customer was added to an audience and is returned when a customer session is opened, updated, or closed. """ # noqa: E501 - audience_id: Optional[StrictInt] = Field(default=None, description="The internal ID of the audience.", alias="audienceId") - audience_name: Optional[StrictStr] = Field(default=None, description="The name of the audience.", alias="audienceName") - profile_integration_id: Optional[StrictStr] = Field(default=None, description="The ID of the customer profile in the third-party integration platform.", alias="profileIntegrationId") - profile_id: Optional[StrictInt] = Field(default=None, description="The internal ID of the customer profile.", alias="profileId") + audience_id: Optional[StrictInt] = Field(default=None, description="The internal ID of the audience.", alias="audienceId", json_schema_extra={"examples": [10]}) + audience_name: Optional[StrictStr] = Field(default=None, description="The name of the audience.", alias="audienceName", json_schema_extra={"examples": ["My audience"]}) + profile_integration_id: Optional[StrictStr] = Field(default=None, description="The ID of the customer profile in the third-party integration platform.", alias="profileIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + profile_id: Optional[StrictInt] = Field(default=None, description="The internal ID of the customer profile.", alias="profileId", json_schema_extra={"examples": [150]}) __properties: ClassVar[List[str]] = ["audienceId", "audienceName", "profileIntegrationId", "profileId"] model_config = ConfigDict( diff --git a/talon_one/models/added_deducted_points_balances_action.py b/talon_one/models/added_deducted_points_balances_action.py index 4166e8d..2c91908 100644 --- a/talon_one/models/added_deducted_points_balances_action.py +++ b/talon_one/models/added_deducted_points_balances_action.py @@ -29,11 +29,11 @@ class AddedDeductedPointsBalancesAction(BaseModel): """ AddedDeductedPointsBalancesAction """ # noqa: E501 - amount: Union[StrictFloat, StrictInt] = Field(description="The amount of added or deducted loyalty points.", alias="Amount") - reason: StrictStr = Field(description="The reason for the points addition or deduction.", alias="Reason") + amount: Union[StrictFloat, StrictInt] = Field(description="The amount of added or deducted loyalty points.", alias="Amount", json_schema_extra={"examples": [10.99]}) + reason: StrictStr = Field(description="The reason for the points addition or deduction.", alias="Reason", json_schema_extra={"examples": ["Compensation"]}) operation: StrictStr = Field(description="The action (addition or subtraction) made with loyalty points.", alias="Operation") - start_date: Optional[datetime] = Field(default=None, description="The start date for loyalty points.", alias="StartDate") - expiry_date: Optional[datetime] = Field(default=None, description="The expiration date for loyalty points.", alias="ExpiryDate") + start_date: Optional[datetime] = Field(default=None, description="The start date for loyalty points.", alias="StartDate", json_schema_extra={"examples": ["2023-01-24T14:15:22Z"]}) + expiry_date: Optional[datetime] = Field(default=None, description="The expiration date for loyalty points.", alias="ExpiryDate", json_schema_extra={"examples": ["2024-01-24T14:15:22Z"]}) transaction_uuid: UUID = Field(description="The identifier of the transaction in the loyalty ledger.", alias="TransactionUUID") __properties: ClassVar[List[str]] = ["Amount", "Reason", "Operation", "StartDate", "ExpiryDate", "TransactionUUID"] diff --git a/talon_one/models/added_deducted_points_balances_notification.py b/talon_one/models/added_deducted_points_balances_notification.py index 85f1ace..4128576 100644 --- a/talon_one/models/added_deducted_points_balances_notification.py +++ b/talon_one/models/added_deducted_points_balances_notification.py @@ -29,16 +29,16 @@ class AddedDeductedPointsBalancesNotification(BaseModel): """ AddedDeductedPointsBalancesNotification """ # noqa: E501 - employee_name: StrictStr = Field(description="The name of the employee who added or deducted points.", alias="EmployeeName") - loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID") + employee_name: StrictStr = Field(description="The name of the employee who added or deducted points.", alias="EmployeeName", json_schema_extra={"examples": ["Franziska Schneider"]}) + loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID", json_schema_extra={"examples": [5]}) notification_type: StrictStr = Field(description="The type of notification.", alias="NotificationType") - profile_integration_id: StrictStr = Field(description="The integration ID of the customer profile to whom points were added or deducted.", alias="ProfileIntegrationID") - session_integration_id: StrictStr = Field(description="The integration ID of the session through which the points were earned or lost.", alias="SessionIntegrationID") - subledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were added.", alias="SubledgerID") + profile_integration_id: StrictStr = Field(description="The integration ID of the customer profile to whom points were added or deducted.", alias="ProfileIntegrationID", json_schema_extra={"examples": ["URNGV8294NV"]}) + session_integration_id: StrictStr = Field(description="The integration ID of the session through which the points were earned or lost.", alias="SessionIntegrationID", json_schema_extra={"examples": ["cc53e4fa-547f-4f5e-8333-76e05c381f67"]}) + subledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were added.", alias="SubledgerID", json_schema_extra={"examples": ["sub-123"]}) type_of_change: StrictStr = Field(description="The notification source, that is, it indicates whether the points were added or deducted via one of the following routes: - [The Campaign Manager](/docs/product/getting-started) - [Management API](/management-api#tag/Loyalty) - [Rule Engine](/docs/product/applications/evaluation-order-for-rules-and-filters) ", alias="TypeOfChange") - user_id: StrictInt = Field(description="The ID of the employee who added or deducted points.", alias="UserID") + user_id: StrictInt = Field(description="The ID of the employee who added or deducted points.", alias="UserID", json_schema_extra={"examples": [25]}) actions: Annotated[List[AddedDeductedPointsBalancesAction], Field(min_length=1)] = Field(description="The list of actions that have been triggered in the loyalty program.", alias="Actions") - current_points: Union[StrictFloat, StrictInt] = Field(description="The current points balance.", alias="CurrentPoints") + current_points: Union[StrictFloat, StrictInt] = Field(description="The current points balance.", alias="CurrentPoints", json_schema_extra={"examples": [10.99]}) __properties: ClassVar[List[str]] = ["EmployeeName", "LoyaltyProgramID", "NotificationType", "ProfileIntegrationID", "SessionIntegrationID", "SubledgerID", "TypeOfChange", "UserID", "Actions", "CurrentPoints"] @field_validator('notification_type') diff --git a/talon_one/models/added_deducted_points_balances_notification_policy.py b/talon_one/models/added_deducted_points_balances_notification_policy.py index f86a765..d0389f9 100644 --- a/talon_one/models/added_deducted_points_balances_notification_policy.py +++ b/talon_one/models/added_deducted_points_balances_notification_policy.py @@ -28,7 +28,7 @@ class AddedDeductedPointsBalancesNotificationPolicy(BaseModel): """ AddedDeductedPointsBalancesNotificationPolicy """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.", json_schema_extra={"examples": ["Christmas Sale"]}) scopes: Annotated[List[StrictStr], Field(min_length=1, max_length=4)] __properties: ClassVar[List[str]] = ["name", "scopes"] diff --git a/talon_one/models/added_deducted_points_notification.py b/talon_one/models/added_deducted_points_notification.py index 6b10f5a..a9e1d2b 100644 --- a/talon_one/models/added_deducted_points_notification.py +++ b/talon_one/models/added_deducted_points_notification.py @@ -30,19 +30,19 @@ class AddedDeductedPointsNotification(BaseModel): """ AddedDeductedPointsNotification """ # noqa: E501 - employee_name: StrictStr = Field(description="The name of the employee who added or deducted points.", alias="EmployeeName") - loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID") + employee_name: StrictStr = Field(description="The name of the employee who added or deducted points.", alias="EmployeeName", json_schema_extra={"examples": ["Franziska Schneider"]}) + loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID", json_schema_extra={"examples": [5]}) notification_type: StrictStr = Field(description="The type of notification.", alias="NotificationType") - profile_integration_id: StrictStr = Field(description="The integration ID of the customer profile to whom points were added or deducted.", alias="ProfileIntegrationID") - session_integration_id: StrictStr = Field(description="The integration ID of the session through which the points were earned or lost.", alias="SessionIntegrationID") - subledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were added.", alias="SubledgerID") + profile_integration_id: StrictStr = Field(description="The integration ID of the customer profile to whom points were added or deducted.", alias="ProfileIntegrationID", json_schema_extra={"examples": ["URNGV8294NV"]}) + session_integration_id: StrictStr = Field(description="The integration ID of the session through which the points were earned or lost.", alias="SessionIntegrationID", json_schema_extra={"examples": ["cc53e4fa-547f-4f5e-8333-76e05c381f67"]}) + subledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were added.", alias="SubledgerID", json_schema_extra={"examples": ["sub-123"]}) type_of_change: StrictStr = Field(description="The notification source, that is, it indicates whether the points were added or deducted via one of the following routes: - [The Campaign Manager](/docs/product/getting-started) - [Management API](/management-api#tag/Loyalty) - [Rule Engine](/docs/product/applications/evaluation-order-for-rules-and-filters) ", alias="TypeOfChange") - user_id: StrictInt = Field(description="The ID of the employee who added or deducted points.", alias="UserID") - amount: Union[StrictFloat, StrictInt] = Field(description="The amount of added or deducted loyalty points.", alias="Amount") - expiry_date: Optional[datetime] = Field(default=None, description="The expiration date for loyalty points.", alias="ExpiryDate") + user_id: StrictInt = Field(description="The ID of the employee who added or deducted points.", alias="UserID", json_schema_extra={"examples": [25]}) + amount: Union[StrictFloat, StrictInt] = Field(description="The amount of added or deducted loyalty points.", alias="Amount", json_schema_extra={"examples": [10.99]}) + expiry_date: Optional[datetime] = Field(default=None, description="The expiration date for loyalty points.", alias="ExpiryDate", json_schema_extra={"examples": ["2024-01-24T14:15:22Z"]}) operation: StrictStr = Field(description="The action (addition or subtraction) made with loyalty points.", alias="Operation") - reason: StrictStr = Field(description="The reason for the points addition or deduction.", alias="Reason") - start_date: Optional[datetime] = Field(default=None, description="The start date for loyalty points.", alias="StartDate") + reason: StrictStr = Field(description="The reason for the points addition or deduction.", alias="Reason", json_schema_extra={"examples": ["Compensation"]}) + start_date: Optional[datetime] = Field(default=None, description="The start date for loyalty points.", alias="StartDate", json_schema_extra={"examples": ["2023-01-24T14:15:22Z"]}) transaction_uuid: UUID = Field(description="The identifier of the transaction in the loyalty ledger.", alias="TransactionUUID") __properties: ClassVar[List[str]] = ["EmployeeName", "LoyaltyProgramID", "NotificationType", "ProfileIntegrationID", "SessionIntegrationID", "SubledgerID", "TypeOfChange", "UserID", "Amount", "ExpiryDate", "Operation", "Reason", "StartDate", "TransactionUUID"] diff --git a/talon_one/models/added_deducted_points_notification_policy.py b/talon_one/models/added_deducted_points_notification_policy.py index 1b6324a..abe8712 100644 --- a/talon_one/models/added_deducted_points_notification_policy.py +++ b/talon_one/models/added_deducted_points_notification_policy.py @@ -28,7 +28,7 @@ class AddedDeductedPointsNotificationPolicy(BaseModel): """ AddedDeductedPointsNotificationPolicy """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.", json_schema_extra={"examples": ["Christmas Sale"]}) scopes: Annotated[List[StrictStr], Field(min_length=1, max_length=4)] __properties: ClassVar[List[str]] = ["name", "scopes"] diff --git a/talon_one/models/additional_campaign_properties.py b/talon_one/models/additional_campaign_properties.py index 3aa0625..038b682 100644 --- a/talon_one/models/additional_campaign_properties.py +++ b/talon_one/models/additional_campaign_properties.py @@ -30,30 +30,30 @@ class AdditionalCampaignProperties(BaseModel): AdditionalCampaignProperties """ # noqa: E501 budgets: Optional[List[CampaignBudget]] = Field(default=None, description="A list of all the budgets that are defined by this campaign and their usage. **Note:** Budgets that are not defined do not appear in this list and their usage is not counted until they are defined. ") - coupon_redemption_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Number of coupons redeemed in the campaign. ", alias="couponRedemptionCount") - referral_redemption_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Number of referral codes redeemed in the campaign. ", alias="referralRedemptionCount") - discount_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total amount of discounts redeemed in the campaign. ", alias="discountCount") - discount_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of times discounts were redeemed in this campaign. ", alias="discountEffectCount") - coupon_creation_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of coupons created by rules in this campaign. ", alias="couponCreationCount") - custom_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of custom effects triggered by rules in this campaign. ", alias="customEffectCount") - referral_creation_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of referrals created by rules in this campaign. ", alias="referralCreationCount") - add_free_item_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of times the [add free item effect](https://docs.talon.one/docs/dev/integration-api/api-effects#addfreeitem) can be triggered in this campaign. ", alias="addFreeItemEffectCount") - awarded_giveaways_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of giveaways awarded by rules in this campaign. ", alias="awardedGiveawaysCount") - created_loyalty_points_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty points created by rules in this campaign. ", alias="createdLoyaltyPointsCount") - created_loyalty_points_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty point creation effects triggered by rules in this campaign. ", alias="createdLoyaltyPointsEffectCount") - redeemed_loyalty_points_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty points redeemed by rules in this campaign. ", alias="redeemedLoyaltyPointsCount") - redeemed_loyalty_points_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty point redemption effects triggered by rules in this campaign. ", alias="redeemedLoyaltyPointsEffectCount") - call_api_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of webhooks triggered by rules in this campaign. ", alias="callApiEffectCount") - reservecoupon_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of reserve coupon effects triggered by rules in this campaign. ", alias="reservecouponEffectCount") - last_activity: Optional[datetime] = Field(default=None, description="Timestamp of the most recent event received by this campaign.", alias="lastActivity") - updated: Optional[datetime] = Field(default=None, description="Timestamp of the most recent update to the campaign's property. Updates to external entities used in this campaign are **not** registered by this property, such as collection or coupon updates. ") - created_by: Optional[StrictStr] = Field(default=None, description="Name of the user who created this campaign if available.", alias="createdBy") - updated_by: Optional[StrictStr] = Field(default=None, description="Name of the user who last updated this campaign if available.", alias="updatedBy") - template_id: Optional[StrictInt] = Field(default=None, description="The ID of the Campaign Template this Campaign was created from.", alias="templateId") - frontend_state: StrictStr = Field(description="The campaign state displayed in the Campaign Manager.", alias="frontendState") - stores_imported: StrictBool = Field(description="Indicates whether the linked stores were imported via a CSV file.", alias="storesImported") - value_maps_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of value map IDs for the campaign.", alias="valueMapsIds") - experiment_id: Optional[StrictInt] = Field(default=None, description="The ID of the Experiment this Campaign is part of.", alias="experimentId") + coupon_redemption_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Number of coupons redeemed in the campaign. ", alias="couponRedemptionCount", json_schema_extra={"examples": [163]}) + referral_redemption_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Number of referral codes redeemed in the campaign. ", alias="referralRedemptionCount", json_schema_extra={"examples": [3]}) + discount_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total amount of discounts redeemed in the campaign. ", alias="discountCount", json_schema_extra={"examples": [288]}) + discount_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of times discounts were redeemed in this campaign. ", alias="discountEffectCount", json_schema_extra={"examples": [343]}) + coupon_creation_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of coupons created by rules in this campaign. ", alias="couponCreationCount", json_schema_extra={"examples": [16]}) + custom_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of custom effects triggered by rules in this campaign. ", alias="customEffectCount", json_schema_extra={"examples": [0]}) + referral_creation_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of referrals created by rules in this campaign. ", alias="referralCreationCount", json_schema_extra={"examples": [8]}) + add_free_item_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of times the [add free item effect](https://docs.talon.one/docs/dev/integration-api/api-effects#addfreeitem) can be triggered in this campaign. ", alias="addFreeItemEffectCount", json_schema_extra={"examples": [0]}) + awarded_giveaways_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of giveaways awarded by rules in this campaign. ", alias="awardedGiveawaysCount", json_schema_extra={"examples": [9]}) + created_loyalty_points_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty points created by rules in this campaign. ", alias="createdLoyaltyPointsCount", json_schema_extra={"examples": [9]}) + created_loyalty_points_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty point creation effects triggered by rules in this campaign. ", alias="createdLoyaltyPointsEffectCount", json_schema_extra={"examples": [2]}) + redeemed_loyalty_points_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty points redeemed by rules in this campaign. ", alias="redeemedLoyaltyPointsCount", json_schema_extra={"examples": [8]}) + redeemed_loyalty_points_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty point redemption effects triggered by rules in this campaign. ", alias="redeemedLoyaltyPointsEffectCount", json_schema_extra={"examples": [9]}) + call_api_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of webhooks triggered by rules in this campaign. ", alias="callApiEffectCount", json_schema_extra={"examples": [0]}) + reservecoupon_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of reserve coupon effects triggered by rules in this campaign. ", alias="reservecouponEffectCount", json_schema_extra={"examples": [9]}) + last_activity: Optional[datetime] = Field(default=None, description="Timestamp of the most recent event received by this campaign.", alias="lastActivity", json_schema_extra={"examples": ["2022-11-10T23:00:00Z"]}) + updated: Optional[datetime] = Field(default=None, description="Timestamp of the most recent update to the campaign's property. Updates to external entities used in this campaign are **not** registered by this property, such as collection or coupon updates. ", json_schema_extra={"examples": ["2022-10-97T35:00:00Z"]}) + created_by: Optional[StrictStr] = Field(default=None, description="Name of the user who created this campaign if available.", alias="createdBy", json_schema_extra={"examples": ["John Doe"]}) + updated_by: Optional[StrictStr] = Field(default=None, description="Name of the user who last updated this campaign if available.", alias="updatedBy", json_schema_extra={"examples": ["Jane Doe"]}) + template_id: Optional[StrictInt] = Field(default=None, description="The ID of the Campaign Template this Campaign was created from.", alias="templateId", json_schema_extra={"examples": [3]}) + frontend_state: StrictStr = Field(description="The campaign state displayed in the Campaign Manager.", alias="frontendState", json_schema_extra={"examples": ["running"]}) + stores_imported: StrictBool = Field(description="Indicates whether the linked stores were imported via a CSV file.", alias="storesImported", json_schema_extra={"examples": [True]}) + value_maps_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of value map IDs for the campaign.", alias="valueMapsIds", json_schema_extra={"examples": [[100, 215]]}) + experiment_id: Optional[StrictInt] = Field(default=None, description="The ID of the Experiment this Campaign is part of.", alias="experimentId", json_schema_extra={"examples": [1]}) __properties: ClassVar[List[str]] = ["budgets", "couponRedemptionCount", "referralRedemptionCount", "discountCount", "discountEffectCount", "couponCreationCount", "customEffectCount", "referralCreationCount", "addFreeItemEffectCount", "awardedGiveawaysCount", "createdLoyaltyPointsCount", "createdLoyaltyPointsEffectCount", "redeemedLoyaltyPointsCount", "redeemedLoyaltyPointsEffectCount", "callApiEffectCount", "reservecouponEffectCount", "lastActivity", "updated", "createdBy", "updatedBy", "templateId", "frontendState", "storesImported", "valueMapsIds", "experimentId"] @field_validator('frontend_state') diff --git a/talon_one/models/additional_cost.py b/talon_one/models/additional_cost.py index 317d8aa..6868c04 100644 --- a/talon_one/models/additional_cost.py +++ b/talon_one/models/additional_cost.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Union from typing import Optional, Set from typing_extensions import Self @@ -27,7 +27,7 @@ class AdditionalCost(BaseModel): """ AdditionalCost """ # noqa: E501 - price: Union[StrictFloat, StrictInt] + price: Union[StrictFloat, StrictInt] = Field(json_schema_extra={"examples": [4.5]}) __properties: ClassVar[List[str]] = ["price"] model_config = ConfigDict( diff --git a/talon_one/models/adjustment_details.py b/talon_one/models/adjustment_details.py index fc6b837..d5757a8 100644 --- a/talon_one/models/adjustment_details.py +++ b/talon_one/models/adjustment_details.py @@ -27,8 +27,8 @@ class AdjustmentDetails(BaseModel): """ Details about an applied price adjustment. """ # noqa: E501 - reference_id: StrictStr = Field(description="The reference identifier used during an `ADD_PRICE_ADJUSTMENT` action.", alias="referenceId") - selected_price_type: StrictStr = Field(description="The selected price type for the SKU targeted by this effect.", alias="selectedPriceType") + reference_id: StrictStr = Field(description="The reference identifier used during an `ADD_PRICE_ADJUSTMENT` action.", alias="referenceId", json_schema_extra={"examples": ["68851723-e6fa-488f-ace9-112581e6c19b"]}) + selected_price_type: StrictStr = Field(description="The selected price type for the SKU targeted by this effect.", alias="selectedPriceType", json_schema_extra={"examples": ["member"]}) value: Union[StrictFloat, StrictInt] = Field(description="The value of the applied price adjustment.") __properties: ClassVar[List[str]] = ["referenceId", "selectedPriceType", "value"] diff --git a/talon_one/models/analytics_data_point.py b/talon_one/models/analytics_data_point.py index efe2677..7bac168 100644 --- a/talon_one/models/analytics_data_point.py +++ b/talon_one/models/analytics_data_point.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Union from typing import Optional, Set from typing_extensions import Self @@ -27,8 +27,8 @@ class AnalyticsDataPoint(BaseModel): """ AnalyticsDataPoint """ # noqa: E501 - total: Union[StrictFloat, StrictInt] - influenced: Union[StrictFloat, StrictInt] + total: Union[StrictFloat, StrictInt] = Field(json_schema_extra={"examples": [12]}) + influenced: Union[StrictFloat, StrictInt] = Field(json_schema_extra={"examples": [12]}) __properties: ClassVar[List[str]] = ["total", "influenced"] model_config = ConfigDict( diff --git a/talon_one/models/analytics_data_point_with_trend.py b/talon_one/models/analytics_data_point_with_trend.py index 52182c0..df707e0 100644 --- a/talon_one/models/analytics_data_point_with_trend.py +++ b/talon_one/models/analytics_data_point_with_trend.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Union from typing import Optional, Set from typing_extensions import Self @@ -27,8 +27,8 @@ class AnalyticsDataPointWithTrend(BaseModel): """ AnalyticsDataPointWithTrend """ # noqa: E501 - value: Union[StrictFloat, StrictInt] - trend: Union[StrictFloat, StrictInt] + value: Union[StrictFloat, StrictInt] = Field(json_schema_extra={"examples": [12]}) + trend: Union[StrictFloat, StrictInt] = Field(json_schema_extra={"examples": [3.25]}) __properties: ClassVar[List[str]] = ["value", "trend"] model_config = ConfigDict( diff --git a/talon_one/models/analytics_data_point_with_trend_and_influenced_rate.py b/talon_one/models/analytics_data_point_with_trend_and_influenced_rate.py index c4bb63d..00e78c3 100644 --- a/talon_one/models/analytics_data_point_with_trend_and_influenced_rate.py +++ b/talon_one/models/analytics_data_point_with_trend_and_influenced_rate.py @@ -27,9 +27,9 @@ class AnalyticsDataPointWithTrendAndInfluencedRate(BaseModel): """ AnalyticsDataPointWithTrendAndInfluencedRate """ # noqa: E501 - value: Union[StrictFloat, StrictInt] - influenced_rate: Union[StrictFloat, StrictInt] = Field(alias="influencedRate") - trend: Union[StrictFloat, StrictInt] + value: Union[StrictFloat, StrictInt] = Field(json_schema_extra={"examples": [12]}) + influenced_rate: Union[StrictFloat, StrictInt] = Field(alias="influencedRate", json_schema_extra={"examples": [12]}) + trend: Union[StrictFloat, StrictInt] = Field(json_schema_extra={"examples": [3.25]}) __properties: ClassVar[List[str]] = ["value", "influencedRate", "trend"] model_config = ConfigDict( diff --git a/talon_one/models/analytics_data_point_with_trend_and_uplift.py b/talon_one/models/analytics_data_point_with_trend_and_uplift.py index bcc78c1..8cb9968 100644 --- a/talon_one/models/analytics_data_point_with_trend_and_uplift.py +++ b/talon_one/models/analytics_data_point_with_trend_and_uplift.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Union from typing import Optional, Set from typing_extensions import Self @@ -27,9 +27,9 @@ class AnalyticsDataPointWithTrendAndUplift(BaseModel): """ AnalyticsDataPointWithTrendAndUplift """ # noqa: E501 - value: Union[StrictFloat, StrictInt] - uplift: Union[StrictFloat, StrictInt] - trend: Union[StrictFloat, StrictInt] + value: Union[StrictFloat, StrictInt] = Field(json_schema_extra={"examples": [12]}) + uplift: Union[StrictFloat, StrictInt] = Field(json_schema_extra={"examples": [3.25]}) + trend: Union[StrictFloat, StrictInt] = Field(json_schema_extra={"examples": [3.25]}) __properties: ClassVar[List[str]] = ["value", "uplift", "trend"] model_config = ConfigDict( diff --git a/talon_one/models/analytics_product.py b/talon_one/models/analytics_product.py index 2e12678..ae2618f 100644 --- a/talon_one/models/analytics_product.py +++ b/talon_one/models/analytics_product.py @@ -28,9 +28,9 @@ class AnalyticsProduct(BaseModel): """ AnalyticsProduct """ # noqa: E501 - id: StrictInt = Field(description="The ID of the product.") - name: StrictStr = Field(description="The name of the product.") - catalog_id: StrictInt = Field(description="The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. ", alias="catalogId") + id: StrictInt = Field(description="The ID of the product.", json_schema_extra={"examples": [1]}) + name: StrictStr = Field(description="The name of the product.", json_schema_extra={"examples": ["MyProduct"]}) + catalog_id: StrictInt = Field(description="The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. ", alias="catalogId", json_schema_extra={"examples": [1]}) units_sold: Optional[AnalyticsDataPointWithTrend] = Field(default=None, description="The number of times the product or SKU was purchased.", alias="unitsSold") __properties: ClassVar[List[str]] = ["id", "name", "catalogId", "unitsSold"] diff --git a/talon_one/models/analytics_sku.py b/talon_one/models/analytics_sku.py index b0fea9f..e78d3e2 100644 --- a/talon_one/models/analytics_sku.py +++ b/talon_one/models/analytics_sku.py @@ -29,11 +29,11 @@ class AnalyticsSKU(BaseModel): """ AnalyticsSKU """ # noqa: E501 - id: StrictInt = Field(description="The ID of the SKU linked to the Application.") - sku: StrictStr = Field(description="The SKU linked to the Application.") - last_updated: Optional[datetime] = Field(default=None, description="Values in UTC for the date the SKU linked to the product was last updated.", alias="lastUpdated") - catalog_id: Optional[StrictInt] = Field(default=None, description="The ID of the catalog that contains the SKU.", alias="catalogId") - product_id: Optional[StrictInt] = Field(default=None, description="The ID of the product that the SKU belongs to.", alias="productId") + id: StrictInt = Field(description="The ID of the SKU linked to the Application.", json_schema_extra={"examples": [1]}) + sku: StrictStr = Field(description="The SKU linked to the Application.", json_schema_extra={"examples": ["SKU-123"]}) + last_updated: Optional[datetime] = Field(default=None, description="Values in UTC for the date the SKU linked to the product was last updated.", alias="lastUpdated", json_schema_extra={"examples": ["2024-02-01T00:00:00Z"]}) + catalog_id: Optional[StrictInt] = Field(default=None, description="The ID of the catalog that contains the SKU.", alias="catalogId", json_schema_extra={"examples": [1]}) + product_id: Optional[StrictInt] = Field(default=None, description="The ID of the product that the SKU belongs to.", alias="productId", json_schema_extra={"examples": [1]}) units_sold: Optional[AnalyticsDataPointWithTrend] = Field(default=None, description="The number of times the product or SKU was purchased.", alias="unitsSold") __properties: ClassVar[List[str]] = ["id", "sku", "lastUpdated", "catalogId", "productId", "unitsSold"] diff --git a/talon_one/models/application.py b/talon_one/models/application.py index 53b1630..9a7fb47 100644 --- a/talon_one/models/application.py +++ b/talon_one/models/application.py @@ -32,27 +32,27 @@ class Application(BaseModel): """ Application """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - modified: datetime = Field(description="The time this entity was last modified.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this application.") - description: Optional[StrictStr] = Field(default=None, description="A longer description of the application.") - timezone: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string containing an IANA timezone descriptor.") - currency: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The default currency for new customer sessions.") - case_sensitivity: Optional[StrictStr] = Field(default=None, description="The case sensitivity behavior to check coupon codes in the campaigns of this Application.", alias="caseSensitivity") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + modified: datetime = Field(description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this application.", json_schema_extra={"examples": ["My Application"]}) + description: Optional[StrictStr] = Field(default=None, description="A longer description of the application.", json_schema_extra={"examples": ["A test Application"]}) + timezone: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string containing an IANA timezone descriptor.", json_schema_extra={"examples": ["Europe/Berlin"]}) + currency: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The default currency for new customer sessions.", json_schema_extra={"examples": ["EUR"]}) + case_sensitivity: Optional[StrictStr] = Field(default=None, description="The case sensitivity behavior to check coupon codes in the campaigns of this Application.", alias="caseSensitivity", json_schema_extra={"examples": ["sensitive"]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") limits: Optional[List[LimitConfig]] = Field(default=None, description="Default limits for campaigns created in this application.") - default_discount_scope: Optional[StrictStr] = Field(default=None, description="The default scope to apply `setDiscount` effects on if no scope was provided with the effect. ", alias="defaultDiscountScope") - enable_cascading_discounts: Optional[StrictBool] = Field(default=None, description="Indicates if discounts should cascade for this Application.", alias="enableCascadingDiscounts") - enable_flattened_cart_items: Optional[StrictBool] = Field(default=None, description="Indicates if cart items of quantity larger than one should be separated into different items of quantity one. ", alias="enableFlattenedCartItems") + default_discount_scope: Optional[StrictStr] = Field(default=None, description="The default scope to apply `setDiscount` effects on if no scope was provided with the effect. ", alias="defaultDiscountScope", json_schema_extra={"examples": ["sessionTotal"]}) + enable_cascading_discounts: Optional[StrictBool] = Field(default=None, description="Indicates if discounts should cascade for this Application.", alias="enableCascadingDiscounts", json_schema_extra={"examples": [True]}) + enable_flattened_cart_items: Optional[StrictBool] = Field(default=None, description="Indicates if cart items of quantity larger than one should be separated into different items of quantity one. ", alias="enableFlattenedCartItems", json_schema_extra={"examples": [True]}) attributes_settings: Optional[AttributesSettings] = Field(default=None, alias="attributesSettings") - sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this is a live or sandbox Application.") - enable_partial_discounts: Optional[StrictBool] = Field(default=None, description="Indicates if this Application supports partial discounts.", alias="enablePartialDiscounts") - default_discount_additional_cost_per_item_scope: Optional[StrictStr] = Field(default=None, description="The default scope to apply `setDiscountPerItem` effects on if no scope was provided with the effect. ", alias="defaultDiscountAdditionalCostPerItemScope") - default_evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the default campaign evaluation group to which new campaigns will be added unless a different group is selected when creating the campaign.", alias="defaultEvaluationGroupId") - default_cart_item_filter_id: Optional[StrictInt] = Field(default=None, description="The ID of the default Cart-Item-Filter for this application.", alias="defaultCartItemFilterId") - enable_campaign_state_management: Optional[StrictBool] = Field(default=None, description="Indicates whether the campaign staging and revisions feature is enabled for the Application. **Important:** After this feature is enabled, it cannot be disabled. ", alias="enableCampaignStateManagement") + sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this is a live or sandbox Application.", json_schema_extra={"examples": [True]}) + enable_partial_discounts: Optional[StrictBool] = Field(default=None, description="Indicates if this Application supports partial discounts.", alias="enablePartialDiscounts", json_schema_extra={"examples": [False]}) + default_discount_additional_cost_per_item_scope: Optional[StrictStr] = Field(default=None, description="The default scope to apply `setDiscountPerItem` effects on if no scope was provided with the effect. ", alias="defaultDiscountAdditionalCostPerItemScope", json_schema_extra={"examples": ["price"]}) + default_evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the default campaign evaluation group to which new campaigns will be added unless a different group is selected when creating the campaign.", alias="defaultEvaluationGroupId", json_schema_extra={"examples": [3]}) + default_cart_item_filter_id: Optional[StrictInt] = Field(default=None, description="The ID of the default Cart-Item-Filter for this application.", alias="defaultCartItemFilterId", json_schema_extra={"examples": [3]}) + enable_campaign_state_management: Optional[StrictBool] = Field(default=None, description="Indicates whether the campaign staging and revisions feature is enabled for the Application. **Important:** After this feature is enabled, it cannot be disabled. ", alias="enableCampaignStateManagement", json_schema_extra={"examples": [False]}) loyalty_programs: List[LoyaltyProgram] = Field(description="An array containing all the loyalty programs to which this application is subscribed.", alias="loyaltyPrograms") __properties: ClassVar[List[str]] = ["id", "created", "modified", "accountId", "name", "description", "timezone", "currency", "caseSensitivity", "attributes", "limits", "defaultDiscountScope", "enableCascadingDiscounts", "enableFlattenedCartItems", "attributesSettings", "sandbox", "enablePartialDiscounts", "defaultDiscountAdditionalCostPerItemScope", "defaultEvaluationGroupId", "defaultCartItemFilterId", "enableCampaignStateManagement", "loyaltyPrograms"] diff --git a/talon_one/models/application_analytics_data_point.py b/talon_one/models/application_analytics_data_point.py index 705119f..4209e4c 100644 --- a/talon_one/models/application_analytics_data_point.py +++ b/talon_one/models/application_analytics_data_point.py @@ -29,14 +29,14 @@ class ApplicationAnalyticsDataPoint(BaseModel): """ ApplicationAnalyticsDataPoint """ # noqa: E501 - start_time: datetime = Field(description="The start of the aggregation time frame in UTC.", alias="startTime") - end_time: datetime = Field(description="The end of the aggregation time frame in UTC.", alias="endTime") + start_time: datetime = Field(description="The start of the aggregation time frame in UTC.", alias="startTime", json_schema_extra={"examples": ["2024-02-01T00:00:00Z"]}) + end_time: datetime = Field(description="The end of the aggregation time frame in UTC.", alias="endTime", json_schema_extra={"examples": ["2024-02-01T23:59:99Z"]}) total_revenue: Optional[AnalyticsDataPoint] = Field(default=None, description="The total, pre-discount value of all items purchased in a customer session.", alias="totalRevenue") sessions_count: Optional[AnalyticsDataPoint] = Field(default=None, description="The number of all closed sessions. The `influenced` value includes only sessions with at least one applied effect.", alias="sessionsCount") avg_items_per_session: Optional[AnalyticsDataPoint] = Field(default=None, description="The number of items from sessions divided by the number of sessions. The `influenced` value includes only sessions with at least one applied effect.", alias="avgItemsPerSession") avg_session_value: Optional[AnalyticsDataPoint] = Field(default=None, description="The average customer session value, calculated by dividing the revenue value by the number of sessions. The `influenced` value includes only sessions with at least one applied effect.", alias="avgSessionValue") - total_discounts: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total value of discounts given for cart items in influenced sessions.", alias="totalDiscounts") - coupons_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of times a coupon was successfully redeemed in influenced sessions.", alias="couponsCount") + total_discounts: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total value of discounts given for cart items in influenced sessions.", alias="totalDiscounts", json_schema_extra={"examples": [10]}) + coupons_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of times a coupon was successfully redeemed in influenced sessions.", alias="couponsCount", json_schema_extra={"examples": [12]}) __properties: ClassVar[List[str]] = ["startTime", "endTime", "totalRevenue", "sessionsCount", "avgItemsPerSession", "avgSessionValue", "totalDiscounts", "couponsCount"] model_config = ConfigDict( diff --git a/talon_one/models/application_api_health.py b/talon_one/models/application_api_health.py index cc30d75..0aa890d 100644 --- a/talon_one/models/application_api_health.py +++ b/talon_one/models/application_api_health.py @@ -29,7 +29,7 @@ class ApplicationApiHealth(BaseModel): Report of health of the API connection of an application. """ # noqa: E501 summary: StrictStr = Field(description="One-word summary of the health of the API connection of an application. Possible values are: - `OK`: The Application has received only successful API requests in the last 5 minutes. - `WARNING`: The Application received at least one failed request in the last 5 minutes. - `ERROR`: More than 50% of received requests failed. - `CRITICAL`: All received requests failed. - `NONE`: During the last 5 minutes, the Application hasn't recorded any integration API requests. ") - last_used: datetime = Field(description="time of last request relevant to the API health test.", alias="lastUsed") + last_used: datetime = Field(description="time of last request relevant to the API health test.", alias="lastUsed", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) __properties: ClassVar[List[str]] = ["summary", "lastUsed"] @field_validator('summary') diff --git a/talon_one/models/application_api_key.py b/talon_one/models/application_api_key.py index d824065..fd53b32 100644 --- a/talon_one/models/application_api_key.py +++ b/talon_one/models/application_api_key.py @@ -28,16 +28,16 @@ class ApplicationAPIKey(BaseModel): """ ApplicationAPIKey """ # noqa: E501 - title: StrictStr = Field(description="Title of the API key.") - expires: datetime = Field(description="The date the API key expires.") - platform: Optional[StrictStr] = Field(default=None, description="The third-party platform the API key is valid for. Use `none` for a generic API key to be used from your own integration layer. ") - type: Optional[StrictStr] = Field(default=None, description="The API key type. Can be empty or `staging`. Staging API keys can only be used for dry requests with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint, [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint, and [Track event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) endpoint. When using the _Update customer profile_ endpoint with a staging API key, the query parameter `runRuleEngine` must be `true`. ") - time_offset: Optional[StrictInt] = Field(default=None, description="A time offset in nanoseconds associated with the API key. When making a request using the API key, rule evaluation is based on a date that is calculated by adding the offset to the current date. ", alias="timeOffset") - id: StrictInt = Field(description="ID of the API Key.") - created_by: StrictInt = Field(description="ID of user who created.", alias="createdBy") - account_id: StrictInt = Field(description="ID of account the key is used for.", alias="accountID") - application_id: StrictInt = Field(description="ID of application the key is used for.", alias="applicationID") - created: datetime = Field(description="The date the API key was created.") + title: StrictStr = Field(description="Title of the API key.", json_schema_extra={"examples": ["My generated key"]}) + expires: datetime = Field(description="The date the API key expires.", json_schema_extra={"examples": ["2023-08-24T14:00:00Z"]}) + platform: Optional[StrictStr] = Field(default=None, description="The third-party platform the API key is valid for. Use `none` for a generic API key to be used from your own integration layer. ", json_schema_extra={"examples": ["none"]}) + type: Optional[StrictStr] = Field(default=None, description="The API key type. Can be empty or `staging`. Staging API keys can only be used for dry requests with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint, [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint, and [Track event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) endpoint. When using the _Update customer profile_ endpoint with a staging API key, the query parameter `runRuleEngine` must be `true`. ", json_schema_extra={"examples": ["staging"]}) + time_offset: Optional[StrictInt] = Field(default=None, description="A time offset in nanoseconds associated with the API key. When making a request using the API key, rule evaluation is based on a date that is calculated by adding the offset to the current date. ", alias="timeOffset", json_schema_extra={"examples": [100000]}) + id: StrictInt = Field(description="ID of the API Key.", json_schema_extra={"examples": [34]}) + created_by: StrictInt = Field(description="ID of user who created.", alias="createdBy", json_schema_extra={"examples": [280]}) + account_id: StrictInt = Field(description="ID of account the key is used for.", alias="accountID", json_schema_extra={"examples": [13]}) + application_id: StrictInt = Field(description="ID of application the key is used for.", alias="applicationID", json_schema_extra={"examples": [54]}) + created: datetime = Field(description="The date the API key was created.", json_schema_extra={"examples": ["2022-03-02T16:46:17.758585Z"]}) __properties: ClassVar[List[str]] = ["title", "expires", "platform", "type", "timeOffset", "id", "createdBy", "accountID", "applicationID", "created"] @field_validator('platform') diff --git a/talon_one/models/application_campaign_analytics.py b/talon_one/models/application_campaign_analytics.py index aabfc84..24680c0 100644 --- a/talon_one/models/application_campaign_analytics.py +++ b/talon_one/models/application_campaign_analytics.py @@ -32,12 +32,12 @@ class ApplicationCampaignAnalytics(BaseModel): """ ApplicationCampaignAnalytics """ # noqa: E501 - start_time: datetime = Field(description="The start of the aggregation time frame in UTC.", alias="startTime") - end_time: datetime = Field(description="The end of the aggregation time frame in UTC.", alias="endTime") - campaign_id: StrictInt = Field(description="The ID of the campaign.", alias="campaignId") - campaign_name: StrictStr = Field(description="The name of the campaign.", alias="campaignName") - campaign_tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)] = Field(description="A list of tags for the campaign.", alias="campaignTags") - campaign_state: StrictStr = Field(description="The state of the campaign. **Note:** A disabled or archived campaign is not evaluated for rules or coupons. ", alias="campaignState") + start_time: datetime = Field(description="The start of the aggregation time frame in UTC.", alias="startTime", json_schema_extra={"examples": ["2024-02-01T00:00:00Z"]}) + end_time: datetime = Field(description="The end of the aggregation time frame in UTC.", alias="endTime", json_schema_extra={"examples": ["2024-02-01T23:59:99Z"]}) + campaign_id: StrictInt = Field(description="The ID of the campaign.", alias="campaignId", json_schema_extra={"examples": [1]}) + campaign_name: StrictStr = Field(description="The name of the campaign.", alias="campaignName", json_schema_extra={"examples": ["Summer promotions"]}) + campaign_tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)] = Field(description="A list of tags for the campaign.", alias="campaignTags", json_schema_extra={"examples": [["summer"]]}) + campaign_state: StrictStr = Field(description="The state of the campaign. **Note:** A disabled or archived campaign is not evaluated for rules or coupons. ", alias="campaignState", json_schema_extra={"examples": ["running"]}) total_revenue: Optional[AnalyticsDataPointWithTrendAndInfluencedRate] = Field(default=None, description="The total, pre-discount value of all items purchased in a customer session.", alias="totalRevenue") sessions_count: Optional[AnalyticsDataPointWithTrendAndInfluencedRate] = Field(default=None, description="The number of all closed sessions. The `influenced` value includes only sessions with at least one applied effect.", alias="sessionsCount") avg_items_per_session: Optional[AnalyticsDataPointWithTrendAndUplift] = Field(default=None, description="The number of items from sessions divided by the number of sessions. The `influenced` value includes only sessions with at least one applied effect.", alias="avgItemsPerSession") diff --git a/talon_one/models/application_cif.py b/talon_one/models/application_cif.py index 7408b29..5b9d852 100644 --- a/talon_one/models/application_cif.py +++ b/talon_one/models/application_cif.py @@ -28,15 +28,15 @@ class ApplicationCIF(BaseModel): """ ApplicationCIF """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - name: StrictStr = Field(description="The name of the Application cart item filter used in API requests.") - description: Optional[StrictStr] = Field(default=None, description="A short description of the Application cart item filter.") - active_expression_id: Optional[StrictInt] = Field(default=None, description="The ID of the expression that the Application cart item filter uses.", alias="activeExpressionId") - modified_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who last updated the Application cart item filter.", alias="modifiedBy") - created_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who created the Application cart item filter.", alias="createdBy") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + name: StrictStr = Field(description="The name of the Application cart item filter used in API requests.", json_schema_extra={"examples": ["Filter items by product"]}) + description: Optional[StrictStr] = Field(default=None, description="A short description of the Application cart item filter.", json_schema_extra={"examples": ["This filter allows filtering by shoes"]}) + active_expression_id: Optional[StrictInt] = Field(default=None, description="The ID of the expression that the Application cart item filter uses.", alias="activeExpressionId", json_schema_extra={"examples": [1]}) + modified_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who last updated the Application cart item filter.", alias="modifiedBy", json_schema_extra={"examples": [334]}) + created_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who created the Application cart item filter.", alias="createdBy", json_schema_extra={"examples": [216]}) modified: Optional[datetime] = Field(default=None, description="Timestamp of the most recent update to the Application cart item filter.") - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) __properties: ClassVar[List[str]] = ["id", "created", "name", "description", "activeExpressionId", "modifiedBy", "createdBy", "modified", "applicationId"] model_config = ConfigDict( diff --git a/talon_one/models/application_cif_expression.py b/talon_one/models/application_cif_expression.py index 796b681..6f25ba8 100644 --- a/talon_one/models/application_cif_expression.py +++ b/talon_one/models/application_cif_expression.py @@ -28,12 +28,12 @@ class ApplicationCIFExpression(BaseModel): """ ApplicationCIFExpression """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - cart_item_filter_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application cart item filter.", alias="cartItemFilterId") - created_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who created the Application cart item filter.", alias="createdBy") - expression: Optional[List[Any]] = Field(default=None, description="Arbitrary additional JSON data associated with the Application cart item filter.") - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + cart_item_filter_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application cart item filter.", alias="cartItemFilterId", json_schema_extra={"examples": [216]}) + created_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who created the Application cart item filter.", alias="createdBy", json_schema_extra={"examples": [216]}) + expression: Optional[List[Any]] = Field(default=None, description="Arbitrary additional JSON data associated with the Application cart item filter.", json_schema_extra={"examples": [{"expr": ["filter", [".", "Session", "CartItems"], [["Item"], ["catch", False, ["=", [".", "Item", "Category"], "Kitchen"]]]]}]}) + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) __properties: ClassVar[List[str]] = ["id", "created", "cartItemFilterId", "createdBy", "expression", "applicationId"] model_config = ConfigDict( diff --git a/talon_one/models/application_cif_references.py b/talon_one/models/application_cif_references.py index 2ff5208..fe20bb4 100644 --- a/talon_one/models/application_cif_references.py +++ b/talon_one/models/application_cif_references.py @@ -28,7 +28,7 @@ class ApplicationCIFReferences(BaseModel): """ ApplicationCIFReferences """ # noqa: E501 - application_cart_item_filter_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application Cart Item Filter that is referenced by a campaign.", alias="applicationCartItemFilterId") + application_cart_item_filter_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application Cart Item Filter that is referenced by a campaign.", alias="applicationCartItemFilterId", json_schema_extra={"examples": [322]}) campaigns: Optional[List[CampaignDetail]] = Field(default=None, description="Campaigns that reference a speciifc Application Cart Item Filter.") __properties: ClassVar[List[str]] = ["applicationCartItemFilterId", "campaigns"] diff --git a/talon_one/models/application_customer.py b/talon_one/models/application_customer.py index e65a42b..d685a61 100644 --- a/talon_one/models/application_customer.py +++ b/talon_one/models/application_customer.py @@ -31,17 +31,17 @@ class ApplicationCustomer(BaseModel): """ ApplicationCustomer """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of the customer profile.") - created: datetime = Field(description="The time this entity was created.") - integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID set by your integration layer.", alias="integrationId") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.") + id: StrictInt = Field(description="The internal ID of the customer profile.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-02-07T08:15:22Z"]}) + integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID set by your integration layer.", alias="integrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.", json_schema_extra={"examples": [{"Language": "english", "ShippingCountry": "DE"}]}) account_id: StrictInt = Field(description="The ID of the Talon.One account that owns this profile.", alias="accountId") - closed_sessions: StrictInt = Field(description="The total number of closed sessions. Does not include closed sessions that have been cancelled or reopened. See the [docs](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states).", alias="closedSessions") - total_sales: Union[StrictFloat, StrictInt] = Field(description="The total amount of money spent by the customer **before** discounts are applied. The total sales amount excludes the following: - Cancelled or reopened sessions. - Returned items. ", alias="totalSales") + closed_sessions: StrictInt = Field(description="The total number of closed sessions. Does not include closed sessions that have been cancelled or reopened. See the [docs](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states).", alias="closedSessions", json_schema_extra={"examples": [3]}) + total_sales: Union[StrictFloat, StrictInt] = Field(description="The total amount of money spent by the customer **before** discounts are applied. The total sales amount excludes the following: - Cancelled or reopened sessions. - Returned items. ", alias="totalSales", json_schema_extra={"examples": [299.99]}) loyalty_memberships: Optional[List[LoyaltyMembership]] = Field(default=None, description="**DEPRECATED. Always returns `null`.** A list of loyalty programs joined by the customer. ", alias="loyaltyMemberships") audience_memberships: Optional[List[AudienceMembership]] = Field(default=None, description="The audiences the customer belongs to.", alias="audienceMemberships") - last_activity: datetime = Field(description="Timestamp of the most recent event received from this customer. This field is updated on calls that trigger the Rule Engine and that are not [dry requests](https://docs.talon.one/docs/dev/integration-api/dry-requests/#overlay). For example, [reserving a coupon](https://docs.talon.one/integration-api#tag/Coupons/operation/createCouponReservation) for a customer doesn't impact this field. ", alias="lastActivity") - sandbox: Optional[StrictBool] = Field(default=None, description="An indicator of whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). ") + last_activity: datetime = Field(description="Timestamp of the most recent event received from this customer. This field is updated on calls that trigger the Rule Engine and that are not [dry requests](https://docs.talon.one/docs/dev/integration-api/dry-requests/#overlay). For example, [reserving a coupon](https://docs.talon.one/integration-api#tag/Coupons/operation/createCouponReservation) for a customer doesn't impact this field. ", alias="lastActivity", json_schema_extra={"examples": ["2020-02-08T14:15:20Z"]}) + sandbox: Optional[StrictBool] = Field(default=None, description="An indicator of whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). ", json_schema_extra={"examples": [False]}) advocate_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The Integration ID of the Customer Profile that referred this Customer in the Application.", alias="advocateIntegrationId") __properties: ClassVar[List[str]] = ["id", "created", "integrationId", "attributes", "accountId", "closedSessions", "totalSales", "loyaltyMemberships", "audienceMemberships", "lastActivity", "sandbox", "advocateIntegrationId"] diff --git a/talon_one/models/application_customer_entity.py b/talon_one/models/application_customer_entity.py index 9127abb..8a826eb 100644 --- a/talon_one/models/application_customer_entity.py +++ b/talon_one/models/application_customer_entity.py @@ -27,7 +27,7 @@ class ApplicationCustomerEntity(BaseModel): """ ApplicationCustomerEntity """ # noqa: E501 - profile_id: Optional[StrictInt] = Field(default=None, description="The globally unique Talon.One ID of the customer that created this entity.", alias="profileId") + profile_id: Optional[StrictInt] = Field(default=None, description="The globally unique Talon.One ID of the customer that created this entity.", alias="profileId", json_schema_extra={"examples": [138]}) __properties: ClassVar[List[str]] = ["profileId"] model_config = ConfigDict( diff --git a/talon_one/models/application_entity.py b/talon_one/models/application_entity.py index 9d62bc0..b7d058d 100644 --- a/talon_one/models/application_entity.py +++ b/talon_one/models/application_entity.py @@ -27,7 +27,7 @@ class ApplicationEntity(BaseModel): """ ApplicationEntity """ # noqa: E501 - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) __properties: ClassVar[List[str]] = ["applicationId"] model_config = ConfigDict( diff --git a/talon_one/models/application_event.py b/talon_one/models/application_event.py index cdd0d7e..ccf8c6d 100644 --- a/talon_one/models/application_event.py +++ b/talon_one/models/application_event.py @@ -31,16 +31,16 @@ class ApplicationEvent(BaseModel): """ ApplicationEvent """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - profile_id: Optional[StrictInt] = Field(default=None, description="The globally unique Talon.One ID of the customer that created this entity.", alias="profileId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + profile_id: Optional[StrictInt] = Field(default=None, description="The globally unique Talon.One ID of the customer that created this entity.", alias="profileId", json_schema_extra={"examples": [138]}) store_id: Optional[StrictInt] = Field(default=None, description="The ID of the store.", alias="storeId") - store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") - integration_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The unique ID of the event. Only one event with this ID can be registered. ", alias="integrationId") + 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"]}) + 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="Additional JSON serialized data associated with the event.") + attributes: Dict[str, Any] = Field(description="Arbitrary properties associated with this campaign.") 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_referee.py b/talon_one/models/application_referee.py index dea98f0..a482d00 100644 --- a/talon_one/models/application_referee.py +++ b/talon_one/models/application_referee.py @@ -29,7 +29,7 @@ class ApplicationReferee(BaseModel): """ ApplicationReferee """ # noqa: E501 - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) session_id: StrictStr = Field(description="Integration ID of the session in which the customer redeemed the referral.", alias="sessionId") advocate_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="Integration ID of the Advocate's Profile.", alias="advocateIntegrationId") friend_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="Integration ID of the Friend's Profile.", alias="friendIntegrationId") diff --git a/talon_one/models/application_session.py b/talon_one/models/application_session.py index bc65196..c160c37 100644 --- a/talon_one/models/application_session.py +++ b/talon_one/models/application_session.py @@ -30,21 +30,21 @@ class ApplicationSession(BaseModel): """ ApplicationSession """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID set by your integration layer.", alias="integrationId") - 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") - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - profile_id: Optional[StrictInt] = Field(default=None, description="The globally unique Talon.One ID of the customer that created this entity.", alias="profileId") - profileintegrationid: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="Integration ID of the customer for the session.") - coupon: StrictStr = Field(description="Any coupon code entered.") - referral: StrictStr = Field(description="Any referral code entered.") - state: StrictStr = Field(description="Indicates the current state of the session. Sessions can be created as `open` or `closed`. The state transitions are: 1. `open` → `closed` 2. `open` → `cancelled` 3. `closed` → `cancelled` or `partially_returned` 4. `partially_returned` → `cancelled` For more information, see [Customer session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). ") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-02-07T08:15:22Z"]}) + integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID set by your integration layer.", alias="integrationId", 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"]}) + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + profile_id: Optional[StrictInt] = Field(default=None, description="The globally unique Talon.One ID of the customer that created this entity.", alias="profileId", json_schema_extra={"examples": [138]}) + profileintegrationid: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="Integration ID of the customer for the session.", json_schema_extra={"examples": ["382370BKDB946"]}) + coupon: StrictStr = Field(description="Any coupon code entered.", json_schema_extra={"examples": ["BKDB946"]}) + referral: StrictStr = Field(description="Any referral code entered.", json_schema_extra={"examples": ["BKDB946"]}) + state: StrictStr = Field(description="Indicates the current state of the session. Sessions can be created as `open` or `closed`. The state transitions are: 1. `open` → `closed` 2. `open` → `cancelled` 3. `closed` → `cancelled` or `partially_returned` 4. `partially_returned` → `cancelled` For more information, see [Customer session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). ", json_schema_extra={"examples": ["closed"]}) cart_items: List[CartItem] = Field(description="Serialized JSON representation.", alias="cartItems") 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") - total: Union[StrictFloat, StrictInt] = Field(description="The total sum of the session before any discounts applied.") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.") + 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.") __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/application_session_entity.py b/talon_one/models/application_session_entity.py index acd3d27..8711942 100644 --- a/talon_one/models/application_session_entity.py +++ b/talon_one/models/application_session_entity.py @@ -27,7 +27,7 @@ class ApplicationSessionEntity(BaseModel): """ ApplicationSessionEntity """ # noqa: E501 - session_id: StrictInt = Field(description="The globally unique Talon.One ID of the session where this entity was created.", alias="sessionId") + session_id: StrictInt = Field(description="The globally unique Talon.One ID of the session where this entity was created.", alias="sessionId", json_schema_extra={"examples": [2]}) __properties: ClassVar[List[str]] = ["sessionId"] model_config = ConfigDict( diff --git a/talon_one/models/async_coupon_creation_response.py b/talon_one/models/async_coupon_creation_response.py index ff4df7f..519d684 100644 --- a/talon_one/models/async_coupon_creation_response.py +++ b/talon_one/models/async_coupon_creation_response.py @@ -27,7 +27,7 @@ class AsyncCouponCreationResponse(BaseModel): """ AsyncCouponCreationResponse """ # noqa: E501 - batch_id: StrictStr = Field(description="The batch ID that all coupons created by the request will have.", alias="batchId") + batch_id: StrictStr = Field(description="The batch ID that all coupons created by the request will have.", alias="batchId", json_schema_extra={"examples": ["tqyrgahe"]}) __properties: ClassVar[List[str]] = ["batchId"] model_config = ConfigDict( diff --git a/talon_one/models/async_coupon_deletion_job_response.py b/talon_one/models/async_coupon_deletion_job_response.py index 39f5ff5..bc204ec 100644 --- a/talon_one/models/async_coupon_deletion_job_response.py +++ b/talon_one/models/async_coupon_deletion_job_response.py @@ -27,7 +27,7 @@ class AsyncCouponDeletionJobResponse(BaseModel): """ AsyncCouponDeletionJobResponse """ # noqa: E501 - id: StrictInt = Field(description="Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints.") + id: StrictInt = Field(description="Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints.", json_schema_extra={"examples": [6]}) __properties: ClassVar[List[str]] = ["id"] model_config = ConfigDict( diff --git a/talon_one/models/async_coupons_data.py b/talon_one/models/async_coupons_data.py index 77aa530..1067572 100644 --- a/talon_one/models/async_coupons_data.py +++ b/talon_one/models/async_coupons_data.py @@ -27,10 +27,10 @@ class AsyncCouponsData(BaseModel): """ AsyncCouponsData """ # noqa: E501 - batch_id: StrictStr = Field(description="The ID of the batch to which the coupon belongs. **Note:** The Batch ID is generated when coupons are created. ", alias="BatchID") - type_of_change: StrictStr = Field(alias="TypeOfChange") - operation: StrictStr = Field(alias="Operation") - employee_name: StrictStr = Field(alias="EmployeeName") + batch_id: StrictStr = Field(description="The ID of the batch to which the coupon belongs. **Note:** The Batch ID is generated when coupons are created. ", alias="BatchID", json_schema_extra={"examples": ["haanlypn"]}) + type_of_change: StrictStr = Field(alias="TypeOfChange", json_schema_extra={"examples": ["campaign_manager"]}) + operation: StrictStr = Field(alias="Operation", json_schema_extra={"examples": ["AsyncCouponsCreated"]}) + employee_name: StrictStr = Field(alias="EmployeeName", json_schema_extra={"examples": ["Franziska Schneider"]}) notification_type: StrictStr = Field(description="The type of the notification", alias="NotificationType") __properties: ClassVar[List[str]] = ["BatchID", "TypeOfChange", "Operation", "EmployeeName", "NotificationType"] diff --git a/talon_one/models/attribute.py b/talon_one/models/attribute.py index 7148fa9..b03b37b 100644 --- a/talon_one/models/attribute.py +++ b/talon_one/models/attribute.py @@ -29,23 +29,23 @@ class Attribute(BaseModel): """ Attribute """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - entity: StrictStr = Field(description="The name of the entity that can have this attribute. When creating or updating the entities of a given type, you can include an `attributes` object with keys corresponding to the `name` of the custom attributes for that type.") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - name: Annotated[str, Field(strict=True)] = Field(description="The attribute name that will be used in API requests and Talang. E.g. if `name == \"region\"` then you would set the region attribute by including an `attributes.region` property in your request payload.") - title: Annotated[str, Field(strict=True)] = Field(description="The human-readable name for the attribute that will be shown in the Campaign Manager. Like `name`, the combination of entity and title must also be unique.") - type: StrictStr = Field(description="The data type of the attribute, a `time` attribute must be sent as a string that conforms to the [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) timestamp format.") - description: StrictStr = Field(description="A description of this attribute.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + entity: StrictStr = Field(description="The name of the entity that can have this attribute. When creating or updating the entities of a given type, you can include an `attributes` object with keys corresponding to the `name` of the custom attributes for that type.", json_schema_extra={"examples": ["Event"]}) + event_type: Optional[StrictStr] = Field(default=None, alias="eventType", json_schema_extra={"examples": ["pageViewed"]}) + name: Annotated[str, Field(strict=True)] = Field(description="The attribute name that will be used in API requests and Talang. E.g. if `name == \"region\"` then you would set the region attribute by including an `attributes.region` property in your request payload.", json_schema_extra={"examples": ["pageViewed"]}) + title: Annotated[str, Field(strict=True)] = Field(description="The human-readable name for the attribute that will be shown in the Campaign Manager. Like `name`, the combination of entity and title must also be unique.", json_schema_extra={"examples": ["Page view event"]}) + type: StrictStr = Field(description="The data type of the attribute, a `time` attribute must be sent as a string that conforms to the [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) timestamp format.", json_schema_extra={"examples": ["string"]}) + description: StrictStr = Field(description="A description of this attribute.", json_schema_extra={"examples": ["Event triggered when a customer displays a page."]}) suggestions: Annotated[List[Annotated[str, Field(min_length=1, strict=True)]], Field(max_length=50)] = Field(description="A list of suggestions for the attribute.") - has_allowed_list: Optional[StrictBool] = Field(default=False, description="Whether or not this attribute has an allowed list of values associated with it.", alias="hasAllowedList") - restricted_by_suggestions: Optional[StrictBool] = Field(default=False, description="Whether or not this attribute's value is restricted by suggestions (`suggestions` property) or by an allowed list of value (`hasAllowedList` property). ", alias="restrictedBySuggestions") - editable: StrictBool = Field(description="Whether or not this attribute can be edited.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications where this attribute is available.", alias="subscribedApplicationsIds") - subscribed_catalogs_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the catalogs where this attribute is available.", alias="subscribedCatalogsIds") - allowed_subscriptions: Optional[Annotated[List[StrictStr], Field(max_length=2)]] = Field(default=None, description="A list of allowed subscription types for this attribute. **Note:** This only applies to attributes associated with the `CartItem` entity. ", alias="allowedSubscriptions") - event_type_id: Optional[StrictInt] = Field(default=None, alias="eventTypeId") + has_allowed_list: Optional[StrictBool] = Field(default=False, description="Whether or not this attribute has an allowed list of values associated with it.", alias="hasAllowedList", json_schema_extra={"examples": [False]}) + restricted_by_suggestions: Optional[StrictBool] = Field(default=False, description="Whether or not this attribute's value is restricted by suggestions (`suggestions` property) or by an allowed list of value (`hasAllowedList` property). ", alias="restrictedBySuggestions", json_schema_extra={"examples": [False]}) + editable: StrictBool = Field(description="Whether or not this attribute can be edited.", json_schema_extra={"examples": [True]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications where this attribute is available.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[1, 4, 9]]}) + subscribed_catalogs_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the catalogs where this attribute is available.", alias="subscribedCatalogsIds", json_schema_extra={"examples": [[2, 5]]}) + allowed_subscriptions: Optional[Annotated[List[StrictStr], Field(max_length=2)]] = Field(default=None, description="A list of allowed subscription types for this attribute. **Note:** This only applies to attributes associated with the `CartItem` entity. ", alias="allowedSubscriptions", json_schema_extra={"examples": [["application", "catalog"]]}) + event_type_id: Optional[StrictInt] = Field(default=None, alias="eventTypeId", json_schema_extra={"examples": [22]}) __properties: ClassVar[List[str]] = ["id", "created", "accountId", "entity", "eventType", "name", "title", "type", "description", "suggestions", "hasAllowedList", "restrictedBySuggestions", "editable", "subscribedApplicationsIds", "subscribedCatalogsIds", "allowedSubscriptions", "eventTypeId"] @field_validator('entity') diff --git a/talon_one/models/audience.py b/talon_one/models/audience.py index 58872df..4c22a8f 100644 --- a/talon_one/models/audience.py +++ b/talon_one/models/audience.py @@ -29,17 +29,17 @@ class Audience(BaseModel): """ Audience """ # noqa: E501 - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The human-friendly display name for this audience.") - sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this is a live or sandbox Application.") - description: Optional[StrictStr] = Field(default=None, description="A description of the audience.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications that are connected to this audience.", alias="subscribedApplicationsIds") - 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. ") - integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = 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") - created_in3rd_party: Optional[StrictBool] = Field(default=None, description="Determines if this audience is a 3rd party audience or not.", alias="createdIn3rdParty") - last_update: Optional[datetime] = Field(default=None, description="The last time that the audience memberships changed.", alias="lastUpdate") + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The human-friendly display name for this audience.", json_schema_extra={"examples": ["Travel audience"]}) + sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this is a live or sandbox Application.", json_schema_extra={"examples": [True]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the audience.", json_schema_extra={"examples": ["Travel audience 18-27"]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications that are connected to this audience.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[3, 13]]}) + 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[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = 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"]}) + created_in3rd_party: Optional[StrictBool] = Field(default=None, description="Determines if this audience is a 3rd party audience or not.", alias="createdIn3rdParty", json_schema_extra={"examples": [False]}) + last_update: Optional[datetime] = Field(default=None, description="The last time that the audience memberships changed.", alias="lastUpdate", json_schema_extra={"examples": ["2022-04-26T11:02:38Z"]}) __properties: ClassVar[List[str]] = ["accountId", "id", "created", "name", "sandbox", "description", "subscribedApplicationsIds", "integration", "integrationId", "createdIn3rdParty", "lastUpdate"] model_config = ConfigDict( diff --git a/talon_one/models/audience_analytics.py b/talon_one/models/audience_analytics.py index 7602695..4214e14 100644 --- a/talon_one/models/audience_analytics.py +++ b/talon_one/models/audience_analytics.py @@ -27,8 +27,8 @@ class AudienceAnalytics(BaseModel): """ The audiences and their member count. """ # noqa: E501 - audience_id: Optional[StrictInt] = Field(default=None, description="The ID of the audience.", alias="audienceId") - members_count: Optional[StrictInt] = Field(default=None, description="The member count of the audience.", alias="membersCount") + audience_id: Optional[StrictInt] = Field(default=None, description="The ID of the audience.", alias="audienceId", json_schema_extra={"examples": [1]}) + members_count: Optional[StrictInt] = Field(default=None, description="The member count of the audience.", alias="membersCount", json_schema_extra={"examples": [1234]}) __properties: ClassVar[List[str]] = ["audienceId", "membersCount"] model_config = ConfigDict( diff --git a/talon_one/models/audience_customer.py b/talon_one/models/audience_customer.py index 271778d..4468954 100644 --- a/talon_one/models/audience_customer.py +++ b/talon_one/models/audience_customer.py @@ -31,19 +31,19 @@ class AudienceCustomer(BaseModel): """ AudienceCustomer """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of the customer profile.") - created: datetime = Field(description="The time this entity was created.") - integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID set by your integration layer.", alias="integrationId") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.") - account_id: StrictInt = Field(description="The ID of the Talon.One account that owns this profile.", alias="accountId") - closed_sessions: StrictInt = Field(description="The total number of closed sessions. Does not include closed sessions that have been cancelled or reopened. See the [docs](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states).", alias="closedSessions") - total_sales: Union[StrictFloat, StrictInt] = Field(description="The total amount of money spent by the customer **before** discounts are applied. The total sales amount excludes the following: - Cancelled or reopened sessions. - Returned items. ", alias="totalSales") + id: StrictInt = Field(description="The internal ID of the customer profile.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-02-07T08:15:22Z"]}) + integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID set by your integration layer.", alias="integrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.", json_schema_extra={"examples": [{"Language": "english", "ShippingCountry": "DE"}]}) + account_id: StrictInt = Field(description="The ID of the Talon.One account that owns this profile.", alias="accountId", json_schema_extra={"examples": [31]}) + closed_sessions: StrictInt = Field(description="The total number of closed sessions. Does not include closed sessions that have been cancelled or reopened. See the [docs](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states).", alias="closedSessions", json_schema_extra={"examples": [3]}) + total_sales: Union[StrictFloat, StrictInt] = Field(description="The total amount of money spent by the customer **before** discounts are applied. The total sales amount excludes the following: - Cancelled or reopened sessions. - Returned items. ", alias="totalSales", json_schema_extra={"examples": [299.99]}) loyalty_memberships: Optional[List[LoyaltyMembership]] = Field(default=None, description="**DEPRECATED. Always returns `null`.** A list of loyalty programs joined by the customer. ", alias="loyaltyMemberships") audience_memberships: Optional[List[AudienceMembership]] = Field(default=None, description="The audiences the customer belongs to.", alias="audienceMemberships") - last_activity: datetime = Field(description="Timestamp of the most recent event received from this customer. This field is updated on calls that trigger the Rule Engine and that are not [dry requests](https://docs.talon.one/docs/dev/integration-api/dry-requests/#overlay). For example, [reserving a coupon](https://docs.talon.one/integration-api#tag/Coupons/operation/createCouponReservation) for a customer doesn't impact this field. ", alias="lastActivity") - sandbox: Optional[StrictBool] = Field(default=None, description="An indicator of whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). ") - connected_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications that are connected to this customer profile.", alias="connectedApplicationsIds") - connected_audiences: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the audiences that are connected to this customer profile.", alias="connectedAudiences") + last_activity: datetime = Field(description="Timestamp of the most recent event received from this customer. This field is updated on calls that trigger the Rule Engine and that are not [dry requests](https://docs.talon.one/docs/dev/integration-api/dry-requests/#overlay). For example, [reserving a coupon](https://docs.talon.one/integration-api#tag/Coupons/operation/createCouponReservation) for a customer doesn't impact this field. ", alias="lastActivity", json_schema_extra={"examples": ["2020-02-08T14:15:20Z"]}) + sandbox: Optional[StrictBool] = Field(default=None, description="An indicator of whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). ", json_schema_extra={"examples": [False]}) + connected_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications that are connected to this customer profile.", alias="connectedApplicationsIds", json_schema_extra={"examples": [[1, 2, 3]]}) + connected_audiences: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the audiences that are connected to this customer profile.", alias="connectedAudiences", json_schema_extra={"examples": [[1, 2, 3]]}) __properties: ClassVar[List[str]] = ["id", "created", "integrationId", "attributes", "accountId", "closedSessions", "totalSales", "loyaltyMemberships", "audienceMemberships", "lastActivity", "sandbox", "connectedApplicationsIds", "connectedAudiences"] model_config = ConfigDict( diff --git a/talon_one/models/audience_integration_id.py b/talon_one/models/audience_integration_id.py index c11b613..53aff54 100644 --- a/talon_one/models/audience_integration_id.py +++ b/talon_one/models/audience_integration_id.py @@ -28,7 +28,7 @@ class AudienceIntegrationID(BaseModel): """ AudienceIntegrationID """ # noqa: E501 - integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The ID of this audience in the third-party integration.", alias="integrationId") + integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The ID of this audience in the third-party integration.", alias="integrationId", json_schema_extra={"examples": ["382370BKDB946"]}) __properties: ClassVar[List[str]] = ["integrationId"] model_config = ConfigDict( diff --git a/talon_one/models/audience_membership.py b/talon_one/models/audience_membership.py index 9d11be4..ed96b0c 100644 --- a/talon_one/models/audience_membership.py +++ b/talon_one/models/audience_membership.py @@ -27,8 +27,8 @@ class AudienceMembership(BaseModel): """ AudienceMembership """ # noqa: E501 - id: StrictInt = Field(description="The ID of the audience belonging to this entity.") - name: StrictStr = Field(description="The Name of the audience belonging to this entity.") + id: StrictInt = Field(description="The ID of the audience belonging to this entity.", json_schema_extra={"examples": [2]}) + name: StrictStr = Field(description="The Name of the audience belonging to this entity.", json_schema_extra={"examples": ["Travel audience"]}) __properties: ClassVar[List[str]] = ["id", "name"] model_config = ConfigDict( diff --git a/talon_one/models/audience_reference.py b/talon_one/models/audience_reference.py index f28a980..7c485ed 100644 --- a/talon_one/models/audience_reference.py +++ b/talon_one/models/audience_reference.py @@ -28,7 +28,7 @@ class AudienceReference(BaseModel): """ AudienceReference """ # noqa: E501 - integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The ID of this audience in the third-party integration.", alias="integrationId") + integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The ID of this audience in the third-party integration.", alias="integrationId", json_schema_extra={"examples": ["382370BKDB946"]}) id: StrictInt = Field(description="The ID of the audience.") integration: Optional[StrictStr] = Field(default=None, description="The third-party integration of the audience.") __properties: ClassVar[List[str]] = ["integrationId", "id", "integration"] diff --git a/talon_one/models/award_giveaway_effect_props.py b/talon_one/models/award_giveaway_effect_props.py index c0ba757..e54bf8e 100644 --- a/talon_one/models/award_giveaway_effect_props.py +++ b/talon_one/models/award_giveaway_effect_props.py @@ -26,13 +26,13 @@ class AwardGiveawayEffectProps(BaseModel): """ - The properties specific to the \"awardGiveaway\" effect. This effect contains information on the giveaway item, and which profile it was awarded to. + This effect indicates the awarded giveaway item and to which profile the item was awarded. Learn more about [giveaways](https://docs.talon.one/docs/product/giveaways/overview). """ # noqa: E501 - pool_id: StrictInt = Field(description="The ID of the giveaways pool the code was taken from.", alias="poolId") - pool_name: StrictStr = Field(description="The name of the giveaways pool the code was taken from.", alias="poolName") - recipient_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID of the profile that was awarded the giveaway.", alias="recipientIntegrationId") - giveaway_id: StrictInt = Field(description="The internal ID for the giveaway that was awarded.", alias="giveawayId") - code: StrictStr = Field(description="The giveaway code that was awarded.") + pool_id: StrictInt = Field(description="The internal ID of the giveaway pool.", alias="poolId", json_schema_extra={"examples": [2]}) + pool_name: StrictStr = Field(description="The name of the giveaway pool.", alias="poolName", json_schema_extra={"examples": ["My pool"]}) + recipient_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID of the customer that receives the giveaway.", alias="recipientIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + giveaway_id: StrictInt = Field(description="The internal ID of the giveaway.", alias="giveawayId", json_schema_extra={"examples": [5]}) + code: StrictStr = Field(description="The giveaway code to be rewarded.", json_schema_extra={"examples": ["57638t-67439hty"]}) __properties: ClassVar[List[str]] = ["poolId", "poolName", "recipientIntegrationId", "giveawayId", "code"] model_config = ConfigDict( diff --git a/talon_one/models/base_campaign.py b/talon_one/models/base_campaign.py index 0a23b46..e62a74b 100644 --- a/talon_one/models/base_campaign.py +++ b/talon_one/models/base_campaign.py @@ -31,22 +31,22 @@ class BaseCampaign(BaseModel): """ BaseCampaign """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A user-facing name for this campaign.") - description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.") - start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime") - end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A user-facing name for this campaign.", json_schema_extra={"examples": ["Summer promotions"]}) + description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.", json_schema_extra={"examples": ["Campaign for all summer 2021 promotions"]}) + start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime", json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) + end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime", json_schema_extra={"examples": ["2021-09-22T22:00:00Z"]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") - state: StrictStr = Field(description="A disabled or archived campaign is not evaluated for rules or coupons. ") - active_ruleset_id: Optional[StrictInt] = Field(default=None, description="[ID of Ruleset](https://docs.talon.one/management-api#tag/Campaigns/operation/getRulesets) this campaign applies on customer session evaluation. ", alias="activeRulesetId") - tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)] = Field(description="A list of tags for the campaign.") - reevaluate_on_return: Optional[StrictBool] = Field(default=None, description="Indicates whether this campaign should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn") - features: List[StrictStr] = Field(description="The features enabled in this campaign.") + state: StrictStr = Field(description="A disabled or archived campaign is not evaluated for rules or coupons. ", json_schema_extra={"examples": ["enabled"]}) + active_ruleset_id: Optional[StrictInt] = Field(default=None, description="[ID of Ruleset](https://docs.talon.one/management-api#tag/Campaigns/operation/getRulesets) this campaign applies on customer session evaluation. ", alias="activeRulesetId", json_schema_extra={"examples": [6]}) + tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)] = Field(description="A list of tags for the campaign.", json_schema_extra={"examples": [["summer"]]}) + reevaluate_on_return: Optional[StrictBool] = Field(default=None, description="Indicates whether this campaign should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn", json_schema_extra={"examples": [True]}) + features: List[StrictStr] = Field(description="The features enabled in this campaign.", json_schema_extra={"examples": [["coupons", "referrals"]]}) coupon_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="couponSettings") referral_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="referralSettings") limits: List[LimitConfig] = Field(description="The set of [budget limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets) for this campaign. ") - campaign_groups: Optional[List[StrictInt]] = Field(default=None, description="The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/managing-campaign-groups) this campaign belongs to. ", alias="campaignGroups") - type: Optional[StrictStr] = Field(default='advanced', description="The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. ") - linked_store_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of store IDs that you want to link to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. ", alias="linkedStoreIds") + campaign_groups: Optional[List[StrictInt]] = Field(default=None, description="The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/managing-campaign-groups) this campaign belongs to. ", alias="campaignGroups", json_schema_extra={"examples": [[1, 3]]}) + type: Optional[StrictStr] = Field(default='advanced', description="The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. ", json_schema_extra={"examples": ["advanced"]}) + linked_store_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of store IDs that you want to link to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. ", alias="linkedStoreIds", json_schema_extra={"examples": [[1, 2, 3]]}) coupon_attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with coupons in this campaign.", alias="couponAttributes") __properties: ClassVar[List[str]] = ["name", "description", "startTime", "endTime", "attributes", "state", "activeRulesetId", "tags", "reevaluateOnReturn", "features", "couponSettings", "referralSettings", "limits", "campaignGroups", "type", "linkedStoreIds", "couponAttributes"] diff --git a/talon_one/models/base_loyalty_program.py b/talon_one/models/base_loyalty_program.py index c4c974c..616f057 100644 --- a/talon_one/models/base_loyalty_program.py +++ b/talon_one/models/base_loyalty_program.py @@ -30,18 +30,18 @@ class BaseLoyaltyProgram(BaseModel): """ BaseLoyaltyProgram """ # noqa: E501 - title: Optional[StrictStr] = Field(default=None, description="The display title for the Loyalty Program.") - description: Optional[StrictStr] = Field(default=None, description="Description of our Loyalty Program.") - subscribed_applications: Optional[List[StrictInt]] = Field(default=None, description="A list containing the IDs of all applications that are subscribed to this Loyalty Program.", alias="subscribedApplications") - default_validity: Optional[StrictStr] = Field(default=None, description="The default duration after which new loyalty points should expire. Can be 'unlimited' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month. ", alias="defaultValidity") - default_pending: Optional[StrictStr] = Field(default=None, description="The default duration of the pending time after which points should be valid. Accepted values: 'immediate', 'on_action' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month. ", alias="defaultPending") - allow_subledger: Optional[StrictBool] = Field(default=None, description="Indicates if this program supports subledgers inside the program.", alias="allowSubledger") - users_per_card_limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="The max amount of user profiles with whom a card can be shared. This can be set to 0 for no limit. This property is only used when `cardBased` is `true`. ", alias="usersPerCardLimit") - sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this program is a live or sandbox program. Programs of a given type can only be connected to Applications of the same type.") + title: Optional[StrictStr] = Field(default=None, description="The display title for the Loyalty Program.", json_schema_extra={"examples": ["Point collection"]}) + description: Optional[StrictStr] = Field(default=None, description="Description of our Loyalty Program.", json_schema_extra={"examples": ["Customers collect 10 points per 1$ spent"]}) + subscribed_applications: Optional[List[StrictInt]] = Field(default=None, description="A list containing the IDs of all applications that are subscribed to this Loyalty Program.", alias="subscribedApplications", json_schema_extra={"examples": [[132, 97]]}) + default_validity: Optional[StrictStr] = Field(default=None, description="The default duration after which new loyalty points should expire. Can be 'unlimited' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month. ", alias="defaultValidity", json_schema_extra={"examples": ["2W_U"]}) + default_pending: Optional[StrictStr] = Field(default=None, description="The default duration of the pending time after which points should be valid. Accepted values: 'immediate', 'on_action' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month. ", alias="defaultPending", json_schema_extra={"examples": ["immediate"]}) + allow_subledger: Optional[StrictBool] = Field(default=None, description="Indicates if this program supports subledgers inside the program.", alias="allowSubledger", json_schema_extra={"examples": [False]}) + users_per_card_limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="The max amount of user profiles with whom a card can be shared. This can be set to 0 for no limit. This property is only used when `cardBased` is `true`. ", alias="usersPerCardLimit", json_schema_extra={"examples": [111]}) + sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this program is a live or sandbox program. Programs of a given type can only be connected to Applications of the same type.", json_schema_extra={"examples": [True]}) program_join_policy: Optional[StrictStr] = Field(default=None, description="The policy that defines when the customer joins the loyalty program. - `not_join`: The customer does not join the loyalty program but can still earn and spend loyalty points. **Note**: The customer does not have a program join date. - `points_activated`: The customer joins the loyalty program only when their earned loyalty points become active for the first time. - `points_earned`: The customer joins the loyalty program when they earn loyalty points for the first time. ", alias="programJoinPolicy") tiers_expiration_policy: Optional[StrictStr] = Field(default=None, description="The policy that defines how tier expiration, used to reevaluate the customer's current tier, is determined. - `tier_start_date`: The tier expiration is relative to when the customer joined the current tier. - `program_join_date`: The tier expiration is relative to when the customer joined the loyalty program. - `customer_attribute`: The tier expiration is determined by a custom customer attribute. - `absolute_expiration`: The tier is reevaluated at the start of each tier cycle. For this policy, it is required to provide a `tierCycleStartDate`. ", alias="tiersExpirationPolicy") - tier_cycle_start_date: Optional[datetime] = Field(default=None, description="Timestamp at which the tier cycle starts for all customers in the loyalty program. **Note**: This is only required when the tier expiration policy is set to `absolute_expiration`. ", alias="tierCycleStartDate") - tiers_expire_in: Optional[StrictStr] = Field(default=None, description="The amount of time after which the tier expires and is reevaluated. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can 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. ", alias="tiersExpireIn") + tier_cycle_start_date: Optional[datetime] = Field(default=None, description="Timestamp at which the tier cycle starts for all customers in the loyalty program. **Note**: This is only required when the tier expiration policy is set to `absolute_expiration`. ", alias="tierCycleStartDate", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + tiers_expire_in: Optional[StrictStr] = Field(default=None, description="The amount of time after which the tier expires and is reevaluated. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can 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. ", alias="tiersExpireIn", json_schema_extra={"examples": ["27W_U"]}) tiers_downgrade_policy: Optional[StrictStr] = Field(default=None, description="The policy that defines how customer tiers are downgraded in the loyalty program after tier reevaluation. - `one_down`: If the customer doesn't have enough points to stay in the current tier, they are downgraded by one tier. - `balance_based`: The customer's tier is reevaluated based on the amount of active points they have at the moment. ", alias="tiersDowngradePolicy") card_code_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="cardCodeSettings") return_policy: Optional[StrictStr] = Field(default=None, description="The policy that defines the rollback of points in case of a partially returned, cancelled, or reopened [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). - `only_pending`: Only pending points can be rolled back. - `within_balance`: Available active points can be rolled back if there aren't enough pending points. The active balance of the customer cannot be negative. - `unlimited`: Allows negative balance without any limit. ", alias="returnPolicy") diff --git a/talon_one/models/base_notification.py b/talon_one/models/base_notification.py index fdb3cec..9f4f298 100644 --- a/talon_one/models/base_notification.py +++ b/talon_one/models/base_notification.py @@ -32,8 +32,8 @@ class BaseNotification(BaseModel): policy: Dict[str, Any] = Field(description="Indicates which notification properties to apply.") 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.") - type: StrictStr = Field(description="The notification type.") + id: Annotated[int, Field(strict=True, ge=1)] = Field(description="Unique ID for this entity.", json_schema_extra={"examples": [6]}) + type: StrictStr = Field(description="The notification type.", json_schema_extra={"examples": ["loyalty_added_deducted_points"]}) __properties: ClassVar[List[str]] = ["policy", "enabled", "webhook", "id", "type"] @field_validator('type') diff --git a/talon_one/models/base_notification_webhook.py b/talon_one/models/base_notification_webhook.py index 41205fb..34b670b 100644 --- a/talon_one/models/base_notification_webhook.py +++ b/talon_one/models/base_notification_webhook.py @@ -29,12 +29,12 @@ class BaseNotificationWebhook(BaseModel): """ BaseNotificationWebhook """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - modified: datetime = Field(description="The time this entity was last modified.") - url: StrictStr = Field(description="API URL for the given webhook-based notification.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + modified: datetime = Field(description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + url: StrictStr = Field(description="API URL for the given webhook-based notification.", json_schema_extra={"examples": ["www.my-company.com/my-endpoint-name"]}) headers: List[Annotated[str, Field(strict=True)]] = Field(description="List of API HTTP headers for the given webhook-based notification.") - enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether the notification is activated.") + enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether the notification is activated.", json_schema_extra={"examples": [True]}) __properties: ClassVar[List[str]] = ["id", "created", "modified", "url", "headers", "enabled"] model_config = ConfigDict( diff --git a/talon_one/models/base_saml_connection.py b/talon_one/models/base_saml_connection.py index 0a0c1e2..82fe28a 100644 --- a/talon_one/models/base_saml_connection.py +++ b/talon_one/models/base_saml_connection.py @@ -28,7 +28,7 @@ class BaseSamlConnection(BaseModel): """ BaseSamlConnection """ # noqa: E501 - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3885]}) name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="ID of the SAML service.") enabled: StrictBool = Field(description="Determines if this SAML connection active.") issuer: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Identity Provider Entity ID.") diff --git a/talon_one/models/best_prior_price.py b/talon_one/models/best_prior_price.py index b57a732..e790f05 100644 --- a/talon_one/models/best_prior_price.py +++ b/talon_one/models/best_prior_price.py @@ -29,12 +29,12 @@ class BestPriorPrice(BaseModel): """ BestPriorPrice """ # noqa: E501 - id: StrictInt = Field(description="The ID of the historical price.") - sku: StrictStr = Field(description="sku") - observed_at: datetime = Field(description="The date and time when the price was observed.", alias="observedAt") - context_ids: List[StrictStr] = Field(description="The identifiers of the relevant context at the time the price was observed. Includes the context IDs of any price adjustments and of the campaigns that influenced the final price. ", alias="contextIds") - context_id: Optional[StrictStr] = Field(default='', description="This property is **deprecated**. Use `contextIds` instead. Defaults to an empty string. ", alias="contextId") - price: Union[StrictFloat, StrictInt] = Field(description="Price of the item.") + id: StrictInt = Field(description="The ID of the historical price.", json_schema_extra={"examples": [1]}) + sku: StrictStr = Field(description="sku", json_schema_extra={"examples": ["NVR-GN-GV-UUP"]}) + observed_at: datetime = Field(description="The date and time when the price was observed.", alias="observedAt", json_schema_extra={"examples": ["2025-11-10T23:00:00Z"]}) + context_ids: List[StrictStr] = Field(description="The identifiers of the relevant context at the time the price was observed. Includes the context IDs of any price adjustments and of the campaigns that influenced the final price. ", alias="contextIds", json_schema_extra={"examples": [["SpringSale", "SummerSale2025"]]}) + context_id: Optional[StrictStr] = Field(default='', description="This property is **deprecated**. Use `contextIds` instead. Defaults to an empty string. ", alias="contextId", json_schema_extra={"examples": [""]}) + price: Union[StrictFloat, StrictInt] = Field(description="Price of the item.", json_schema_extra={"examples": [99.99]}) metadata: BestPriorPriceMetadata target: Dict[str, Any] __properties: ClassVar[List[str]] = ["id", "sku", "observedAt", "contextIds", "contextId", "price", "metadata", "target"] diff --git a/talon_one/models/best_prior_price_request.py b/talon_one/models/best_prior_price_request.py index ee73358..adfce32 100644 --- a/talon_one/models/best_prior_price_request.py +++ b/talon_one/models/best_prior_price_request.py @@ -30,10 +30,10 @@ class BestPriorPriceRequest(BaseModel): """ BestPriorPriceRequest """ # noqa: E501 - skus: Annotated[List[StrictStr], Field(min_length=1)] = Field(description="List of product SKUs to check when determining the best prior price.") - timeframe_end_date: datetime = Field(description="The end date and time that defines the latest time for retrieving historical SKU prices.", alias="timeframeEndDate") - timeframe: StrictStr = Field(description="The number of days prior to the timeframeEndDate. Only prices within this look back period are considered for the best prior price evaluation.") - timeframe_end_date_type: StrictStr = Field(description="Sets the timeframe for retrieving historical pricing data. Can be one of the following values: - `strict`: The timeframe ends at the `timeframeEndDate` value. - `price`: The timeframe ends at the start of current price value and takes the prices prior to the start of the current price value into account. - `sale`: The timeframe ends at the start of current `contextId` and takes the prices prior to the start of the `contextId` into account. ", alias="timeframeEndDateType") + skus: Annotated[List[StrictStr], Field(min_length=1)] = Field(description="List of product SKUs to check when determining the best prior price.", json_schema_extra={"examples": [["comma", "period"]]}) + timeframe_end_date: datetime = Field(description="The end date and time that defines the latest time for retrieving historical SKU prices.", alias="timeframeEndDate", json_schema_extra={"examples": ["2020-11-10T23:00:00Z"]}) + timeframe: StrictStr = Field(description="The number of days prior to the timeframeEndDate. Only prices within this look back period are considered for the best prior price evaluation.", json_schema_extra={"examples": ["30"]}) + timeframe_end_date_type: StrictStr = Field(description="Sets the timeframe for retrieving historical pricing data. Can be one of the following values: - `strict`: The timeframe ends at the `timeframeEndDate` value. - `price`: The timeframe ends at the start of current price value and takes the prices prior to the start of the current price value into account. - `sale`: The timeframe ends at the start of current `contextId` and takes the prices prior to the start of the `contextId` into account. ", alias="timeframeEndDateType", json_schema_extra={"examples": ["sale"]}) target: Optional[BestPriorTarget] = None __properties: ClassVar[List[str]] = ["skus", "timeframeEndDate", "timeframe", "timeframeEndDateType", "target"] diff --git a/talon_one/models/best_prior_target.py b/talon_one/models/best_prior_target.py index fba4b6d..9c96e2e 100644 --- a/talon_one/models/best_prior_target.py +++ b/talon_one/models/best_prior_target.py @@ -27,8 +27,8 @@ class BestPriorTarget(BaseModel): """ Specifies the target for which the best prior price calculation is taken into consideration. """ # noqa: E501 - target_type: StrictStr = Field(description="The type of price target.", alias="targetType") - audience_id: Optional[StrictInt] = Field(default=None, description="The AudienceID of an audience. Must be used with \"AUDIENCE\" target type.", alias="audienceID") + target_type: StrictStr = Field(description="The type of price target.", alias="targetType", json_schema_extra={"examples": ["AUDIENCE"]}) + audience_id: Optional[StrictInt] = Field(default=None, description="The AudienceID of an audience. Must be used with \"AUDIENCE\" target type.", alias="audienceID", json_schema_extra={"examples": [4]}) __properties: ClassVar[List[str]] = ["targetType", "audienceID"] @field_validator('target_type') diff --git a/talon_one/models/binding.py b/talon_one/models/binding.py index 4c731ff..df70014 100644 --- a/talon_one/models/binding.py +++ b/talon_one/models/binding.py @@ -27,14 +27,14 @@ class Binding(BaseModel): """ Binding """ # noqa: E501 - name: StrictStr = Field(description="A descriptive name for the value to be bound.") - type: Optional[StrictStr] = Field(default=None, description="The kind of binding. Possible values are: - `bundle` - `cartItemFilter` - `subledgerBalance` - `templateParameter` ") - expression: List[Any] = Field(description="A Talang expression that will be evaluated and its result attached to the name of the binding.") - value_type: Optional[StrictStr] = Field(default=None, description="Can be one of the following: - `string` - `number` - `boolean` ", alias="valueType") - min_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The minimum value allowed for this placeholder.", alias="minValue") - max_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The maximum value allowed for this placeholder.", alias="maxValue") - attribute_id: Optional[StrictInt] = Field(default=None, description="Id of the attribute attached to the placeholder.", alias="attributeId") - description: Optional[StrictStr] = Field(default=None, description="Describes the placeholder field and value in the template. This description can be used when creating campaigns from this template.") + name: StrictStr = Field(description="A descriptive name for the value to be bound.", json_schema_extra={"examples": ["my property"]}) + type: Optional[StrictStr] = Field(default=None, description="The kind of binding. Possible values are: - `bundle` - `cartItemFilter` - `subledgerBalance` - `templateParameter` ", json_schema_extra={"examples": ["templateParameter"]}) + expression: List[Any] = Field(description="A Talang expression that will be evaluated and its result attached to the name of the binding.", json_schema_extra={"examples": [["string1", "string2"]]}) + value_type: Optional[StrictStr] = Field(default=None, description="Can be one of the following: - `string` - `number` - `boolean` ", alias="valueType", json_schema_extra={"examples": ["string"]}) + min_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The minimum value allowed for this placeholder.", alias="minValue", json_schema_extra={"examples": [0]}) + max_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The maximum value allowed for this placeholder.", alias="maxValue", json_schema_extra={"examples": [19.9]}) + attribute_id: Optional[StrictInt] = Field(default=None, description="Id of the attribute attached to the placeholder.", alias="attributeId", json_schema_extra={"examples": [100]}) + description: Optional[StrictStr] = Field(default=None, description="Describes the placeholder field and value in the template. This description can be used when creating campaigns from this template.", json_schema_extra={"examples": ["This is a template parameter of type `number`."]}) __properties: ClassVar[List[str]] = ["name", "type", "expression", "valueType", "minValue", "maxValue", "attributeId", "description"] model_config = ConfigDict( diff --git a/talon_one/models/blueprint.py b/talon_one/models/blueprint.py index 7321de6..57fec22 100644 --- a/talon_one/models/blueprint.py +++ b/talon_one/models/blueprint.py @@ -33,7 +33,7 @@ class Blueprint(BaseModel): id: StrictInt = Field(description="The internal ID of this blueprint.") account_id: StrictInt = Field(description="The ID of the account that owns this blueprint.", alias="accountId") application_id: StrictInt = Field(description="The ID of the Application that owns this blueprint.", alias="applicationId") - title: StrictStr = Field(description="A short description of the blueprint.") + title: StrictStr = Field(description="A short description of the blueprint.", json_schema_extra={"examples": ["High value cart discount"]}) description: Optional[StrictStr] = Field(default=None, description="A longer, more detailed description of the blueprint.") category: StrictStr = Field(description="Category used to group blueprints.") source: StrictStr = Field(description="Indicates whether the blueprint is custom or shipped by Talon.One.") diff --git a/talon_one/models/bulk_application_notification.py b/talon_one/models/bulk_application_notification.py index 55da5fd..5b6fb87 100644 --- a/talon_one/models/bulk_application_notification.py +++ b/talon_one/models/bulk_application_notification.py @@ -28,7 +28,7 @@ class BulkApplicationNotification(BaseModel): """ BulkApplicationNotification """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[ApplicationNotification] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/bulk_operation_on_campaigns.py b/talon_one/models/bulk_operation_on_campaigns.py index 293f6e4..801dff0 100644 --- a/talon_one/models/bulk_operation_on_campaigns.py +++ b/talon_one/models/bulk_operation_on_campaigns.py @@ -30,8 +30,8 @@ class BulkOperationOnCampaigns(BaseModel): BulkOperationOnCampaigns """ # noqa: E501 operation: StrictStr = Field(description="The operation to perform on the specified campaign IDs. ") - campaign_ids: Annotated[List[StrictInt], Field(max_length=50)] = Field(description="The list of campaign IDs on which the operation will be performed.", alias="campaignIds") - activate_at: Optional[datetime] = Field(default=None, description="Timestamp when the revisions are finalized after the `activate_revision` operation. The current time is used when left blank. **Note:** It must be an RFC3339 timestamp string. ", alias="activateAt") + campaign_ids: Annotated[List[StrictInt], Field(max_length=50)] = Field(description="The list of campaign IDs on which the operation will be performed.", alias="campaignIds", json_schema_extra={"examples": [[1, 2, 3]]}) + activate_at: Optional[datetime] = Field(default=None, description="Timestamp when the revisions are finalized after the `activate_revision` operation. The current time is used when left blank. **Note:** It must be an RFC3339 timestamp string. ", alias="activateAt", json_schema_extra={"examples": ["2024-10-01T16:00:05Z07:00"]}) __properties: ClassVar[List[str]] = ["operation", "campaignIds", "activateAt"] @field_validator('operation') diff --git a/talon_one/models/campaign.py b/talon_one/models/campaign.py index ea7d93b..317c5cc 100644 --- a/talon_one/models/campaign.py +++ b/talon_one/models/campaign.py @@ -32,59 +32,59 @@ class Campaign(BaseModel): """ Campaign """ # noqa: E501 - id: StrictInt = Field(description="Unique ID for this entity.") - created: datetime = Field(description="The exact moment this entity was created.") - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - user_id: StrictInt = Field(description="The ID of the user associated with this entity.", alias="userId") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A user-facing name for this campaign.") - description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.") - start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime") - end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime") + id: StrictInt = Field(description="Unique ID for this entity.", json_schema_extra={"examples": [4]}) + created: datetime = Field(description="The exact moment this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + user_id: StrictInt = Field(description="The ID of the user associated with this entity.", alias="userId", json_schema_extra={"examples": [388]}) + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A user-facing name for this campaign.", json_schema_extra={"examples": ["Summer promotions"]}) + description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.", json_schema_extra={"examples": ["Campaign for all summer 2021 promotions"]}) + start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime", json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) + end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime", json_schema_extra={"examples": ["2021-09-22T22:00:00Z"]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") - state: StrictStr = Field(description="A disabled or archived campaign is not evaluated for rules or coupons. ") - active_ruleset_id: Optional[StrictInt] = Field(default=None, description="[ID of Ruleset](https://docs.talon.one/management-api#tag/Campaigns/operation/getRulesets) this campaign applies on customer session evaluation. ", alias="activeRulesetId") - tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)] = Field(description="A list of tags for the campaign.") - reevaluate_on_return: StrictBool = Field(description="Indicates whether this campaign should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn") - features: List[StrictStr] = Field(description="The features enabled in this campaign.") + state: StrictStr = Field(description="A disabled or archived campaign is not evaluated for rules or coupons. ", json_schema_extra={"examples": ["enabled"]}) + active_ruleset_id: Optional[StrictInt] = Field(default=None, description="[ID of Ruleset](https://docs.talon.one/management-api#tag/Campaigns/operation/getRulesets) this campaign applies on customer session evaluation. ", alias="activeRulesetId", json_schema_extra={"examples": [6]}) + tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)] = Field(description="A list of tags for the campaign.", json_schema_extra={"examples": [["summer"]]}) + reevaluate_on_return: StrictBool = Field(description="Indicates whether this campaign should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn", json_schema_extra={"examples": [True]}) + features: List[StrictStr] = Field(description="The features enabled in this campaign.", json_schema_extra={"examples": [["coupons", "referrals"]]}) coupon_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="couponSettings") referral_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="referralSettings") limits: List[LimitConfig] = Field(description="The set of [budget limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets) for this campaign. ") - campaign_groups: Optional[List[StrictInt]] = Field(default=None, description="The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/managing-campaign-groups) this campaign belongs to. ", alias="campaignGroups") - type: Optional[StrictStr] = Field(default='advanced', description="The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. ") - linked_store_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of store IDs that you want to link to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. ", alias="linkedStoreIds") + campaign_groups: Optional[List[StrictInt]] = Field(default=None, description="The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/managing-campaign-groups) this campaign belongs to. ", alias="campaignGroups", json_schema_extra={"examples": [[1, 3]]}) + type: Optional[StrictStr] = Field(default='advanced', description="The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. ", json_schema_extra={"examples": ["advanced"]}) + linked_store_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of store IDs that you want to link to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. ", alias="linkedStoreIds", json_schema_extra={"examples": [[1, 2, 3]]}) coupon_attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with coupons in this campaign.", alias="couponAttributes") budgets: Optional[List[CampaignBudget]] = Field(default=None, description="A list of all the budgets that are defined by this campaign and their usage. **Note:** Budgets that are not defined do not appear in this list and their usage is not counted until they are defined. ") - coupon_redemption_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Number of coupons redeemed in the campaign. ", alias="couponRedemptionCount") - referral_redemption_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Number of referral codes redeemed in the campaign. ", alias="referralRedemptionCount") - discount_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total amount of discounts redeemed in the campaign. ", alias="discountCount") - discount_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of times discounts were redeemed in this campaign. ", alias="discountEffectCount") - coupon_creation_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of coupons created by rules in this campaign. ", alias="couponCreationCount") - custom_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of custom effects triggered by rules in this campaign. ", alias="customEffectCount") - referral_creation_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of referrals created by rules in this campaign. ", alias="referralCreationCount") - add_free_item_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of times the [add free item effect](https://docs.talon.one/docs/dev/integration-api/api-effects#addfreeitem) can be triggered in this campaign. ", alias="addFreeItemEffectCount") - awarded_giveaways_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of giveaways awarded by rules in this campaign. ", alias="awardedGiveawaysCount") - created_loyalty_points_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty points created by rules in this campaign. ", alias="createdLoyaltyPointsCount") - created_loyalty_points_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty point creation effects triggered by rules in this campaign. ", alias="createdLoyaltyPointsEffectCount") - redeemed_loyalty_points_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty points redeemed by rules in this campaign. ", alias="redeemedLoyaltyPointsCount") - redeemed_loyalty_points_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty point redemption effects triggered by rules in this campaign. ", alias="redeemedLoyaltyPointsEffectCount") - call_api_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of webhooks triggered by rules in this campaign. ", alias="callApiEffectCount") - reservecoupon_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of reserve coupon effects triggered by rules in this campaign. ", alias="reservecouponEffectCount") - last_activity: Optional[datetime] = Field(default=None, description="Timestamp of the most recent event received by this campaign.", alias="lastActivity") - updated: Optional[datetime] = Field(default=None, description="Timestamp of the most recent update to the campaign's property. Updates to external entities used in this campaign are **not** registered by this property, such as collection or coupon updates. ") - created_by: Optional[StrictStr] = Field(default=None, description="Name of the user who created this campaign if available.", alias="createdBy") - updated_by: Optional[StrictStr] = Field(default=None, description="Name of the user who last updated this campaign if available.", alias="updatedBy") - template_id: Optional[StrictInt] = Field(default=None, description="The ID of the Campaign Template this Campaign was created from.", alias="templateId") - frontend_state: StrictStr = Field(description="The campaign state displayed in the Campaign Manager.", alias="frontendState") - stores_imported: StrictBool = Field(description="Indicates whether the linked stores were imported via a CSV file.", alias="storesImported") - value_maps_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of value map IDs for the campaign.", alias="valueMapsIds") - experiment_id: Optional[StrictInt] = Field(default=None, description="The ID of the Experiment this Campaign is part of.", alias="experimentId") - revision_frontend_state: Optional[StrictStr] = Field(default=None, description="The campaign revision state displayed in the Campaign Manager.", alias="revisionFrontendState") - active_revision_id: Optional[StrictInt] = Field(default=None, description="ID of the revision that was last activated on this campaign. ", alias="activeRevisionId") - active_revision_version_id: Optional[StrictInt] = Field(default=None, description="ID of the revision version that is active on the campaign. ", alias="activeRevisionVersionId") - version: Optional[StrictInt] = Field(default=None, description="Incrementing number representing how many revisions have been activated on this campaign, starts from 0 for a new campaign. ") - current_revision_id: Optional[StrictInt] = Field(default=None, description="ID of the revision currently being modified for the campaign. ", alias="currentRevisionId") - current_revision_version_id: Optional[StrictInt] = Field(default=None, description="ID of the latest version applied on the current revision. ", alias="currentRevisionVersionId") - stage_revision: Optional[StrictBool] = Field(default=False, description="Flag for determining whether we use current revision when sending requests with staging API key. ", alias="stageRevision") + coupon_redemption_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Number of coupons redeemed in the campaign. ", alias="couponRedemptionCount", json_schema_extra={"examples": [163]}) + referral_redemption_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Number of referral codes redeemed in the campaign. ", alias="referralRedemptionCount", json_schema_extra={"examples": [3]}) + discount_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total amount of discounts redeemed in the campaign. ", alias="discountCount", json_schema_extra={"examples": [288]}) + discount_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of times discounts were redeemed in this campaign. ", alias="discountEffectCount", json_schema_extra={"examples": [343]}) + coupon_creation_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of coupons created by rules in this campaign. ", alias="couponCreationCount", json_schema_extra={"examples": [16]}) + custom_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of custom effects triggered by rules in this campaign. ", alias="customEffectCount", json_schema_extra={"examples": [0]}) + referral_creation_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of referrals created by rules in this campaign. ", alias="referralCreationCount", json_schema_extra={"examples": [8]}) + add_free_item_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of times the [add free item effect](https://docs.talon.one/docs/dev/integration-api/api-effects#addfreeitem) can be triggered in this campaign. ", alias="addFreeItemEffectCount", json_schema_extra={"examples": [0]}) + awarded_giveaways_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of giveaways awarded by rules in this campaign. ", alias="awardedGiveawaysCount", json_schema_extra={"examples": [9]}) + created_loyalty_points_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty points created by rules in this campaign. ", alias="createdLoyaltyPointsCount", json_schema_extra={"examples": [9]}) + created_loyalty_points_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty point creation effects triggered by rules in this campaign. ", alias="createdLoyaltyPointsEffectCount", json_schema_extra={"examples": [2]}) + redeemed_loyalty_points_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty points redeemed by rules in this campaign. ", alias="redeemedLoyaltyPointsCount", json_schema_extra={"examples": [8]}) + redeemed_loyalty_points_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty point redemption effects triggered by rules in this campaign. ", alias="redeemedLoyaltyPointsEffectCount", json_schema_extra={"examples": [9]}) + call_api_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of webhooks triggered by rules in this campaign. ", alias="callApiEffectCount", json_schema_extra={"examples": [0]}) + reservecoupon_effect_count: Optional[StrictInt] = Field(default=None, description="This property is **deprecated**. The count should be available under *budgets* property. Total number of reserve coupon effects triggered by rules in this campaign. ", alias="reservecouponEffectCount", json_schema_extra={"examples": [9]}) + last_activity: Optional[datetime] = Field(default=None, description="Timestamp of the most recent event received by this campaign.", alias="lastActivity", json_schema_extra={"examples": ["2022-11-10T23:00:00Z"]}) + updated: Optional[datetime] = Field(default=None, description="Timestamp of the most recent update to the campaign's property. Updates to external entities used in this campaign are **not** registered by this property, such as collection or coupon updates. ", json_schema_extra={"examples": ["2022-10-97T35:00:00Z"]}) + created_by: Optional[StrictStr] = Field(default=None, description="Name of the user who created this campaign if available.", alias="createdBy", json_schema_extra={"examples": ["John Doe"]}) + updated_by: Optional[StrictStr] = Field(default=None, description="Name of the user who last updated this campaign if available.", alias="updatedBy", json_schema_extra={"examples": ["Jane Doe"]}) + template_id: Optional[StrictInt] = Field(default=None, description="The ID of the Campaign Template this Campaign was created from.", alias="templateId", json_schema_extra={"examples": [3]}) + frontend_state: StrictStr = Field(description="The campaign state displayed in the Campaign Manager.", alias="frontendState", json_schema_extra={"examples": ["running"]}) + stores_imported: StrictBool = Field(description="Indicates whether the linked stores were imported via a CSV file.", alias="storesImported", json_schema_extra={"examples": [True]}) + value_maps_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of value map IDs for the campaign.", alias="valueMapsIds", json_schema_extra={"examples": [[100, 215]]}) + experiment_id: Optional[StrictInt] = Field(default=None, description="The ID of the Experiment this Campaign is part of.", alias="experimentId", json_schema_extra={"examples": [1]}) + revision_frontend_state: Optional[StrictStr] = Field(default=None, description="The campaign revision state displayed in the Campaign Manager.", alias="revisionFrontendState", json_schema_extra={"examples": ["revised"]}) + active_revision_id: Optional[StrictInt] = Field(default=None, description="ID of the revision that was last activated on this campaign. ", alias="activeRevisionId", json_schema_extra={"examples": [6]}) + active_revision_version_id: Optional[StrictInt] = Field(default=None, description="ID of the revision version that is active on the campaign. ", alias="activeRevisionVersionId", json_schema_extra={"examples": [6]}) + version: Optional[StrictInt] = Field(default=None, description="Incrementing number representing how many revisions have been activated on this campaign, starts from 0 for a new campaign. ", json_schema_extra={"examples": [6]}) + current_revision_id: Optional[StrictInt] = Field(default=None, description="ID of the revision currently being modified for the campaign. ", alias="currentRevisionId", json_schema_extra={"examples": [6]}) + current_revision_version_id: Optional[StrictInt] = Field(default=None, description="ID of the latest version applied on the current revision. ", alias="currentRevisionVersionId", json_schema_extra={"examples": [6]}) + stage_revision: Optional[StrictBool] = Field(default=False, description="Flag for determining whether we use current revision when sending requests with staging API key. ", alias="stageRevision", json_schema_extra={"examples": [False]}) __properties: ClassVar[List[str]] = ["id", "created", "applicationId", "userId", "name", "description", "startTime", "endTime", "attributes", "state", "activeRulesetId", "tags", "reevaluateOnReturn", "features", "couponSettings", "referralSettings", "limits", "campaignGroups", "type", "linkedStoreIds", "couponAttributes", "budgets", "couponRedemptionCount", "referralRedemptionCount", "discountCount", "discountEffectCount", "couponCreationCount", "customEffectCount", "referralCreationCount", "addFreeItemEffectCount", "awardedGiveawaysCount", "createdLoyaltyPointsCount", "createdLoyaltyPointsEffectCount", "redeemedLoyaltyPointsCount", "redeemedLoyaltyPointsEffectCount", "callApiEffectCount", "reservecouponEffectCount", "lastActivity", "updated", "createdBy", "updatedBy", "templateId", "frontendState", "storesImported", "valueMapsIds", "experimentId", "revisionFrontendState", "activeRevisionId", "activeRevisionVersionId", "version", "currentRevisionId", "currentRevisionVersionId", "stageRevision"] @field_validator('state') diff --git a/talon_one/models/campaign_activation_request.py b/talon_one/models/campaign_activation_request.py index f436d9f..d3fe93f 100644 --- a/talon_one/models/campaign_activation_request.py +++ b/talon_one/models/campaign_activation_request.py @@ -28,7 +28,7 @@ class CampaignActivationRequest(BaseModel): """ CampaignActivationRequest """ # noqa: E501 - user_ids: Annotated[List[StrictInt], Field(max_length=5)] = Field(description="The list of IDs of the users who will receive the activation request.", alias="userIds") + user_ids: Annotated[List[StrictInt], Field(max_length=5)] = Field(description="The list of IDs of the users who will receive the activation request.", alias="userIds", json_schema_extra={"examples": [[1, 2, 3]]}) __properties: ClassVar[List[str]] = ["userIds"] model_config = ConfigDict( diff --git a/talon_one/models/campaign_analytics.py b/talon_one/models/campaign_analytics.py index 26101b8..5fc5bc2 100644 --- a/talon_one/models/campaign_analytics.py +++ b/talon_one/models/campaign_analytics.py @@ -28,9 +28,9 @@ class CampaignAnalytics(BaseModel): """ CampaignAnalytics """ # noqa: E501 - var_date: datetime = Field(alias="date") - campaign_revenue: Union[StrictFloat, StrictInt] = Field(description="Amount of revenue in this campaign (for coupon or discount sessions).", alias="campaignRevenue") - total_campaign_revenue: Union[StrictFloat, StrictInt] = Field(description="Amount of revenue in this campaign since it began (for coupon or discount sessions).", alias="totalCampaignRevenue") + var_date: datetime = Field(alias="date", json_schema_extra={"examples": ["2021-10-12T10:12:42Z"]}) + campaign_revenue: Union[StrictFloat, StrictInt] = Field(description="Amount of revenue in this campaign (for coupon or discount sessions).", alias="campaignRevenue", json_schema_extra={"examples": [3539.76]}) + total_campaign_revenue: Union[StrictFloat, StrictInt] = Field(description="Amount of revenue in this campaign since it began (for coupon or discount sessions).", alias="totalCampaignRevenue", json_schema_extra={"examples": [5784.63]}) campaign_refund: Union[StrictFloat, StrictInt] = Field(description="Amount of refunds in this campaign (for coupon or discount sessions).", alias="campaignRefund") total_campaign_refund: Union[StrictFloat, StrictInt] = Field(description="Amount of refunds in this campaign since it began (for coupon or discount sessions).", alias="totalCampaignRefund") campaign_discount_costs: Union[StrictFloat, StrictInt] = Field(description="Amount of cost caused by discounts given in the campaign.", alias="campaignDiscountCosts") @@ -38,7 +38,7 @@ class CampaignAnalytics(BaseModel): campaign_refunded_discounts: Union[StrictFloat, StrictInt] = Field(description="Amount of discounts rolledback due to refund in the campaign.", alias="campaignRefundedDiscounts") total_campaign_refunded_discounts: Union[StrictFloat, StrictInt] = Field(description="Amount of discounts rolledback due to refund in the campaign since it began.", alias="totalCampaignRefundedDiscounts") campaign_free_items: StrictInt = Field(description="Amount of free items given in the campaign.", alias="campaignFreeItems") - total_campaign_free_items: StrictInt = Field(description="Amount of free items given in the campaign since it began.", alias="totalCampaignFreeItems") + total_campaign_free_items: StrictInt = Field(description="Amount of free items given in the campaign since it began.", alias="totalCampaignFreeItems", json_schema_extra={"examples": [86]}) coupon_redemptions: StrictInt = Field(description="Number of coupon redemptions in the campaign.", alias="couponRedemptions") total_coupon_redemptions: StrictInt = Field(description="Number of coupon redemptions in the campaign since it began.", alias="totalCouponRedemptions") coupon_rolledback_redemptions: StrictInt = Field(description="Number of coupon redemptions that have been rolled back (due to canceling closed session) in the campaign.", alias="couponRolledbackRedemptions") @@ -49,10 +49,10 @@ class CampaignAnalytics(BaseModel): total_coupons_created: StrictInt = Field(description="Number of coupons created in the campaign by the rule engine since it began.", alias="totalCouponsCreated") referrals_created: StrictInt = Field(description="Number of referrals created in the campaign by the rule engine.", alias="referralsCreated") total_referrals_created: StrictInt = Field(description="Number of referrals created in the campaign by the rule engine since it began.", alias="totalReferralsCreated") - added_loyalty_points: Union[StrictFloat, StrictInt] = Field(description="Number of added loyalty points in the campaign in a specific interval.", alias="addedLoyaltyPoints") - total_added_loyalty_points: Union[StrictFloat, StrictInt] = Field(description="Number of added loyalty points in the campaign since it began.", alias="totalAddedLoyaltyPoints") - deducted_loyalty_points: Union[StrictFloat, StrictInt] = Field(description="Number of deducted loyalty points in the campaign in a specific interval.", alias="deductedLoyaltyPoints") - total_deducted_loyalty_points: Union[StrictFloat, StrictInt] = Field(description="Number of deducted loyalty points in the campaign since it began.", alias="totalDeductedLoyaltyPoints") + added_loyalty_points: Union[StrictFloat, StrictInt] = Field(description="Number of added loyalty points in the campaign in a specific interval.", alias="addedLoyaltyPoints", json_schema_extra={"examples": [250]}) + total_added_loyalty_points: Union[StrictFloat, StrictInt] = Field(description="Number of added loyalty points in the campaign since it began.", alias="totalAddedLoyaltyPoints", json_schema_extra={"examples": [340]}) + deducted_loyalty_points: Union[StrictFloat, StrictInt] = Field(description="Number of deducted loyalty points in the campaign in a specific interval.", alias="deductedLoyaltyPoints", json_schema_extra={"examples": [120]}) + total_deducted_loyalty_points: Union[StrictFloat, StrictInt] = Field(description="Number of deducted loyalty points in the campaign since it began.", alias="totalDeductedLoyaltyPoints", json_schema_extra={"examples": [220]}) __properties: ClassVar[List[str]] = ["date", "campaignRevenue", "totalCampaignRevenue", "campaignRefund", "totalCampaignRefund", "campaignDiscountCosts", "totalCampaignDiscountCosts", "campaignRefundedDiscounts", "totalCampaignRefundedDiscounts", "campaignFreeItems", "totalCampaignFreeItems", "couponRedemptions", "totalCouponRedemptions", "couponRolledbackRedemptions", "totalCouponRolledbackRedemptions", "referralRedemptions", "totalReferralRedemptions", "couponsCreated", "totalCouponsCreated", "referralsCreated", "totalReferralsCreated", "addedLoyaltyPoints", "totalAddedLoyaltyPoints", "deductedLoyaltyPoints", "totalDeductedLoyaltyPoints"] model_config = ConfigDict( diff --git a/talon_one/models/campaign_budget.py b/talon_one/models/campaign_budget.py index 7c9472a..a28640c 100644 --- a/talon_one/models/campaign_budget.py +++ b/talon_one/models/campaign_budget.py @@ -28,9 +28,9 @@ class CampaignBudget(BaseModel): """ CampaignBudget """ # noqa: E501 - action: StrictStr = Field(description="The limitable action to which this limit applies. For example: - `setDiscount` - `setDiscountEffect` - `redeemCoupon` - `createCoupon` ") - limit: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="The value to set for the limit.") - counter: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="The number of occurrences of the limited action in the context of the campaign.") + action: StrictStr = Field(description="The limitable action to which this limit applies. For example: - `setDiscount` - `setDiscountEffect` - `redeemCoupon` - `createCoupon` ", json_schema_extra={"examples": ["createCoupon"]}) + limit: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="The value to set for the limit.", json_schema_extra={"examples": [1000]}) + counter: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="The number of occurrences of the limited action in the context of the campaign.", json_schema_extra={"examples": [42]}) __properties: ClassVar[List[str]] = ["action", "limit", "counter"] model_config = ConfigDict( diff --git a/talon_one/models/campaign_collection.py b/talon_one/models/campaign_collection.py index 5b4bc08..0d3ae3d 100644 --- a/talon_one/models/campaign_collection.py +++ b/talon_one/models/campaign_collection.py @@ -29,17 +29,17 @@ class CampaignCollection(BaseModel): """ CampaignCollection """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - modified: datetime = Field(description="The time this entity was last modified.") - description: Optional[StrictStr] = Field(default=None, description="A short description of the purpose of this collection.") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this collection.") - modified_by: Optional[StrictInt] = Field(default=None, description="ID of the user who last updated this effect if available.", alias="modifiedBy") - created_by: StrictInt = Field(description="ID of the user who created this effect.", alias="createdBy") - application_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application that owns this entity.", alias="applicationId") - campaign_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign that owns this entity.", alias="campaignId") - payload: Optional[Annotated[List[StrictStr], Field(max_length=50)]] = Field(default=None, description="The content of the collection.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + modified: datetime = Field(description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + description: Optional[StrictStr] = Field(default=None, description="A short description of the purpose of this collection.", json_schema_extra={"examples": ["My collection of SKUs"]}) + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this collection.", json_schema_extra={"examples": ["My collection"]}) + modified_by: Optional[StrictInt] = Field(default=None, description="ID of the user who last updated this effect if available.", alias="modifiedBy", json_schema_extra={"examples": [48]}) + created_by: StrictInt = Field(description="ID of the user who created this effect.", alias="createdBy", json_schema_extra={"examples": [134]}) + application_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [1]}) + campaign_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign that owns this entity.", alias="campaignId", json_schema_extra={"examples": [7]}) + 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') diff --git a/talon_one/models/campaign_collection_edited_notification.py b/talon_one/models/campaign_collection_edited_notification.py index e29557a..4e58698 100644 --- a/talon_one/models/campaign_collection_edited_notification.py +++ b/talon_one/models/campaign_collection_edited_notification.py @@ -28,7 +28,7 @@ class CampaignCollectionEditedNotification(BaseModel): """ CampaignCollectionEditedNotification """ # noqa: E501 - notification_type: StrictStr = Field(description="The type of the notification", alias="NotificationType") + 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[CampaignCollectionEditedNotificationItem]] = Field(default=None, description="A list of campaign notification data.", alias="Data") __properties: ClassVar[List[str]] = ["NotificationType", "TotalResultSize", "Data"] diff --git a/talon_one/models/campaign_collection_edited_notification_item.py b/talon_one/models/campaign_collection_edited_notification_item.py index a8de47f..84a9558 100644 --- a/talon_one/models/campaign_collection_edited_notification_item.py +++ b/talon_one/models/campaign_collection_edited_notification_item.py @@ -31,7 +31,7 @@ class CampaignCollectionEditedNotificationItem(BaseModel): """ CampaignCollectionEditedNotificationItem """ # noqa: E501 - event: StrictStr = Field(description="The type of the event. Can be one of the following: ['campaign_state_changed', 'campaign_ruleset_changed', 'campaign_edited', 'campaign_created', 'campaign_deleted'] ", alias="Event") + event: StrictStr = Field(description="The type of the event. Can be one of the following: ['campaign_state_changed', 'campaign_ruleset_changed', 'campaign_edited', 'campaign_created', 'campaign_deleted'] ", alias="Event", json_schema_extra={"examples": ["campaign_state_changed"]}) campaign: Campaign = Field(description="The current campaign.") ruleset: Optional[Ruleset] = Field(default=None, description="The current ruleset.") placeholders: Optional[List[PlaceholderDetails]] = Field(default=None, description="The current details of the [placeholders](https://docs.talon.one/docs/product/campaigns/templates/create-templates#use-placeholders) in the campaign.") diff --git a/talon_one/models/campaign_collection_without_payload.py b/talon_one/models/campaign_collection_without_payload.py index 279f411..c956368 100644 --- a/talon_one/models/campaign_collection_without_payload.py +++ b/talon_one/models/campaign_collection_without_payload.py @@ -29,16 +29,16 @@ class CampaignCollectionWithoutPayload(BaseModel): """ CampaignCollectionWithoutPayload """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - modified: datetime = Field(description="The time this entity was last modified.") - description: Optional[StrictStr] = Field(default=None, description="A short description of the purpose of this collection.") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this collection.") - modified_by: Optional[StrictInt] = Field(default=None, description="ID of the user who last updated this effect if available.", alias="modifiedBy") - created_by: StrictInt = Field(description="ID of the user who created this effect.", alias="createdBy") - application_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application that owns this entity.", alias="applicationId") - campaign_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign that owns this entity.", alias="campaignId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + modified: datetime = Field(description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + description: Optional[StrictStr] = Field(default=None, description="A short description of the purpose of this collection.", json_schema_extra={"examples": ["My collection of SKUs"]}) + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this collection.", json_schema_extra={"examples": ["My collection"]}) + modified_by: Optional[StrictInt] = Field(default=None, description="ID of the user who last updated this effect if available.", alias="modifiedBy", json_schema_extra={"examples": [48]}) + created_by: StrictInt = Field(description="ID of the user who created this effect.", alias="createdBy", json_schema_extra={"examples": [134]}) + application_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [1]}) + 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') diff --git a/talon_one/models/campaign_copy.py b/talon_one/models/campaign_copy.py index 4c260cb..2068057 100644 --- a/talon_one/models/campaign_copy.py +++ b/talon_one/models/campaign_copy.py @@ -29,13 +29,13 @@ class CampaignCopy(BaseModel): """ CampaignCopy """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="Name of the copied campaign (Defaults to \"Copy of original campaign name\").") - application_ids: List[StrictInt] = Field(description="Application IDs of the applications to which a campaign should be copied to.", alias="applicationIds") - description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.") - start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime") - end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime") - tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)]] = Field(default=None, description="A list of tags for the campaign.") - evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign evaluation group the campaign belongs to.", alias="evaluationGroupId") + name: Optional[StrictStr] = Field(default=None, description="Name of the copied campaign (Defaults to \"Copy of original campaign name\").", json_schema_extra={"examples": ["Copy of Summer promotions"]}) + application_ids: List[StrictInt] = Field(description="Application IDs of the applications to which a campaign should be copied to.", alias="applicationIds", json_schema_extra={"examples": [[1, 2, 3]]}) + description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.", json_schema_extra={"examples": ["Campaign for all summer 2021 promotions"]}) + start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime", json_schema_extra={"examples": ["2021-06-01T09:00:27.993483Z"]}) + end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime", json_schema_extra={"examples": ["2021-09-10T01:00:00.993483Z"]}) + tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)]] = Field(default=None, description="A list of tags for the campaign.", json_schema_extra={"examples": [["Summer", "Shoes"]]}) + evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign evaluation group the campaign belongs to.", alias="evaluationGroupId", json_schema_extra={"examples": [2]}) __properties: ClassVar[List[str]] = ["name", "applicationIds", "description", "startTime", "endTime", "tags", "evaluationGroupId"] model_config = ConfigDict( diff --git a/talon_one/models/campaign_created_notification.py b/talon_one/models/campaign_created_notification.py index 8f0e8dd..34220c2 100644 --- a/talon_one/models/campaign_created_notification.py +++ b/talon_one/models/campaign_created_notification.py @@ -28,7 +28,7 @@ class CampaignCreatedNotification(BaseModel): """ CampaignCreatedNotification """ # noqa: E501 - notification_type: StrictStr = Field(description="The type of the notification", alias="NotificationType") + 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[CampaignCreatedNotificationItem]] = Field(default=None, description="A list of campaign notification data.", alias="Data") __properties: ClassVar[List[str]] = ["NotificationType", "TotalResultSize", "Data"] diff --git a/talon_one/models/campaign_created_notification_item.py b/talon_one/models/campaign_created_notification_item.py index 7e339eb..75a8ec8 100644 --- a/talon_one/models/campaign_created_notification_item.py +++ b/talon_one/models/campaign_created_notification_item.py @@ -31,7 +31,7 @@ class CampaignCreatedNotificationItem(BaseModel): """ CampaignCreatedNotificationItem """ # noqa: E501 - event: StrictStr = Field(description="The type of the event. Can be one of the following: ['campaign_state_changed', 'campaign_ruleset_changed', 'campaign_edited', 'campaign_created', 'campaign_deleted'] ", alias="Event") + event: StrictStr = Field(description="The type of the event. Can be one of the following: ['campaign_state_changed', 'campaign_ruleset_changed', 'campaign_edited', 'campaign_created', 'campaign_deleted'] ", alias="Event", json_schema_extra={"examples": ["campaign_state_changed"]}) campaign: Campaign = Field(description="The campaign whose state changed.") ruleset: Optional[Ruleset] = Field(default=None, description="The current ruleset.") placeholders: Optional[List[PlaceholderDetails]] = Field(default=None, description="The current details of the [placeholders](https://docs.talon.one/docs/product/campaigns/templates/create-templates#use-placeholders) in the campaign.") diff --git a/talon_one/models/campaign_deactivation_request.py b/talon_one/models/campaign_deactivation_request.py index 6ff4c22..7e6d63d 100644 --- a/talon_one/models/campaign_deactivation_request.py +++ b/talon_one/models/campaign_deactivation_request.py @@ -28,7 +28,7 @@ class CampaignDeactivationRequest(BaseModel): """ CampaignDeactivationRequest """ # noqa: E501 - user_ids: Annotated[List[StrictInt], Field(max_length=5)] = Field(description="The list of IDs of the users receiving the deactivation request emails.", alias="userIds") + user_ids: Annotated[List[StrictInt], Field(max_length=5)] = Field(description="The list of IDs of the users receiving the deactivation request emails.", alias="userIds", json_schema_extra={"examples": [[1, 2, 3]]}) __properties: ClassVar[List[str]] = ["userIds"] model_config = ConfigDict( diff --git a/talon_one/models/campaign_deleted_notification.py b/talon_one/models/campaign_deleted_notification.py index 90175a8..e1b4d98 100644 --- a/talon_one/models/campaign_deleted_notification.py +++ b/talon_one/models/campaign_deleted_notification.py @@ -28,7 +28,7 @@ class CampaignDeletedNotification(BaseModel): """ CampaignDeletedNotification """ # noqa: E501 - notification_type: StrictStr = Field(description="The type of the notification", alias="NotificationType") + 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[CampaignDeletedNotificationItem]] = Field(default=None, description="A list of campaign notification data.", alias="Data") __properties: ClassVar[List[str]] = ["NotificationType", "TotalResultSize", "Data"] diff --git a/talon_one/models/campaign_deleted_notification_item.py b/talon_one/models/campaign_deleted_notification_item.py index 5472a5c..34b4d01 100644 --- a/talon_one/models/campaign_deleted_notification_item.py +++ b/talon_one/models/campaign_deleted_notification_item.py @@ -29,9 +29,9 @@ class CampaignDeletedNotificationItem(BaseModel): """ CampaignDeletedNotificationItem """ # noqa: E501 - event: StrictStr = Field(description="The type of the event. Can be one of the following: ['campaign_state_changed', 'campaign_ruleset_changed', 'campaign_edited', 'campaign_created', 'campaign_deleted'] ", alias="Event") + event: StrictStr = Field(description="The type of the event. Can be one of the following: ['campaign_state_changed', 'campaign_ruleset_changed', 'campaign_edited', 'campaign_created', 'campaign_deleted'] ", alias="Event", json_schema_extra={"examples": ["campaign_state_changed"]}) campaign: Campaign = Field(description="The campaign whose state changed.") - deleted_at: datetime = Field(description="Time when the campaign was deleted.", alias="deletedAt") + deleted_at: datetime = Field(description="Time when the campaign was deleted.", alias="deletedAt", json_schema_extra={"examples": ["2022-11-10T23:00:00Z"]}) __properties: ClassVar[List[str]] = ["Event", "campaign", "deletedAt"] model_config = ConfigDict( diff --git a/talon_one/models/campaign_detail.py b/talon_one/models/campaign_detail.py index 75b50d1..7710cc5 100644 --- a/talon_one/models/campaign_detail.py +++ b/talon_one/models/campaign_detail.py @@ -28,8 +28,8 @@ class CampaignDetail(BaseModel): """ CampaignDetail """ # noqa: E501 - campaign_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign that references the application cart item filter.", alias="campaignId") - campaign_name: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="A user-facing name for this campaign.", alias="campaignName") + campaign_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign that references the application cart item filter.", alias="campaignId", json_schema_extra={"examples": [1]}) + campaign_name: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="A user-facing name for this campaign.", alias="campaignName", json_schema_extra={"examples": ["Summer promotions"]}) __properties: ClassVar[List[str]] = ["campaignId", "campaignName"] model_config = ConfigDict( diff --git a/talon_one/models/campaign_edited_notification.py b/talon_one/models/campaign_edited_notification.py index b699031..0f40d62 100644 --- a/talon_one/models/campaign_edited_notification.py +++ b/talon_one/models/campaign_edited_notification.py @@ -28,7 +28,7 @@ class CampaignEditedNotification(BaseModel): """ CampaignEditedNotification """ # noqa: E501 - notification_type: StrictStr = Field(description="The type of the notification", alias="NotificationType") + 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[CampaignEditedNotificationItem]] = Field(default=None, description="A list of campaign notification data.", alias="Data") __properties: ClassVar[List[str]] = ["NotificationType", "TotalResultSize", "Data"] diff --git a/talon_one/models/campaign_edited_notification_item.py b/talon_one/models/campaign_edited_notification_item.py index e3f0445..5b1e699 100644 --- a/talon_one/models/campaign_edited_notification_item.py +++ b/talon_one/models/campaign_edited_notification_item.py @@ -30,7 +30,7 @@ class CampaignEditedNotificationItem(BaseModel): """ CampaignEditedNotificationItem """ # noqa: E501 - event: StrictStr = Field(description="The type of the event. Can be one of the following: ['campaign_state_changed', 'campaign_ruleset_changed', 'campaign_edited', 'campaign_created', 'campaign_deleted'] ", alias="Event") + event: StrictStr = Field(description="The type of the event. Can be one of the following: ['campaign_state_changed', 'campaign_ruleset_changed', 'campaign_edited', 'campaign_created', 'campaign_deleted'] ", alias="Event", json_schema_extra={"examples": ["campaign_state_changed"]}) campaign: Campaign = Field(description="The campaign whose state changed.") old_campaign: Campaign = Field(description="The campaign before the change.", alias="oldCampaign") ruleset: Optional[Ruleset] = Field(default=None, description="The current ruleset.") diff --git a/talon_one/models/campaign_eligibility.py b/talon_one/models/campaign_eligibility.py index ebe412d..49172f8 100644 --- a/talon_one/models/campaign_eligibility.py +++ b/talon_one/models/campaign_eligibility.py @@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from talon_one.models.campaign_eligibility_details import CampaignEligibilityDetails +from talon_one.models.campaign_eligibility_experiment import CampaignEligibilityExperiment from talon_one.models.rule_metadata_eligibility import RuleMetadataEligibility from typing import Optional, Set from typing_extensions import Self @@ -31,19 +32,20 @@ class CampaignEligibility(BaseModel): """ CampaignEligibility """ # noqa: E501 - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - id: StrictInt = Field(description="Unique ID of Campaign.") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the campaign.") - description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.") - start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime") - end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime") + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + id: StrictInt = Field(description="Unique ID of Campaign.", json_schema_extra={"examples": [4]}) + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the campaign.", json_schema_extra={"examples": ["Summer promotions"]}) + description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.", json_schema_extra={"examples": ["Campaign for all summer 2021 promotions"]}) + start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime", json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) + end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime", json_schema_extra={"examples": ["2021-09-22T22:00:00Z"]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") - state: StrictStr = Field(description="The state of the campaign. ") - tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)] = Field(description="A list of tags for the campaign.") - features: List[StrictStr] = Field(description="The features enabled in this campaign.") + state: StrictStr = Field(description="The state of the campaign. ", json_schema_extra={"examples": ["enabled"]}) + tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)] = Field(description="A list of tags for the campaign.", json_schema_extra={"examples": [["summer"]]}) + features: List[StrictStr] = Field(description="The features enabled in this campaign.", json_schema_extra={"examples": [["coupons", "referrals"]]}) eligibility: List[CampaignEligibilityDetails] = Field(description="The customer's eligibility for each campaign in the current customer session.") rules: List[RuleMetadataEligibility] = Field(description="A list of rules containing customer-facing details of the rewards defined in the campaign.") - __properties: ClassVar[List[str]] = ["applicationId", "id", "name", "description", "startTime", "endTime", "attributes", "state", "tags", "features", "eligibility", "rules"] + experiment: Optional[CampaignEligibilityExperiment] = None + __properties: ClassVar[List[str]] = ["applicationId", "id", "name", "description", "startTime", "endTime", "attributes", "state", "tags", "features", "eligibility", "rules", "experiment"] @field_validator('state') def state_validate_enum(cls, value): @@ -113,6 +115,9 @@ def to_dict(self) -> Dict[str, Any]: if _item_rules: _items.append(_item_rules.to_dict()) _dict['rules'] = _items + # override the default output from pydantic by calling `to_dict()` of experiment + if self.experiment: + _dict['experiment'] = self.experiment.to_dict() return _dict @classmethod @@ -136,7 +141,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "tags": obj.get("tags"), "features": obj.get("features"), "eligibility": [CampaignEligibilityDetails.from_dict(_item) for _item in obj["eligibility"]] if obj.get("eligibility") is not None else None, - "rules": [RuleMetadataEligibility.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None + "rules": [RuleMetadataEligibility.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None, + "experiment": CampaignEligibilityExperiment.from_dict(obj["experiment"]) if obj.get("experiment") is not None else None }) return _obj diff --git a/talon_one/models/update_customer_profile_v2409_response.py b/talon_one/models/campaign_eligibility_experiment.py similarity index 75% rename from talon_one/models/update_customer_profile_v2409_response.py rename to talon_one/models/campaign_eligibility_experiment.py index 45d8442..8179e9f 100644 --- a/talon_one/models/update_customer_profile_v2409_response.py +++ b/talon_one/models/campaign_eligibility_experiment.py @@ -17,20 +17,19 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python -class UpdateCustomerProfileV2409Response(BaseModel): +class CampaignEligibilityExperiment(BaseModel): """ - UpdateCustomerProfileV2409Response + The identifiers for the [experiment](https://docs.talon.one/management-api#tag/Experiments) and the variant assigned to the customer profile. Only returned when the customer profile has been assigned to a variant in an experiment campaign. """ # noqa: E501 - message: Optional[StrictStr] = None - errors: Optional[List[Any]] = None - status_code: Optional[StrictInt] = Field(default=None, alias="StatusCode") - __properties: ClassVar[List[str]] = ["message", "errors", "StatusCode"] + id: StrictInt = Field(description="The ID of the experiment.") + variant_id: StrictInt = Field(description="The ID of the variant assigned to the customer profile.", alias="variantId") + __properties: ClassVar[List[str]] = ["id", "variantId"] model_config = ConfigDict( validate_by_name=True, @@ -50,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UpdateCustomerProfileV2409Response from a JSON string""" + """Create an instance of CampaignEligibilityExperiment from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -75,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 UpdateCustomerProfileV2409Response from a dict""" + """Create an instance of CampaignEligibilityExperiment from a dict""" if obj is None: return None @@ -83,9 +82,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "message": obj.get("message"), - "errors": obj.get("errors"), - "StatusCode": obj.get("StatusCode") + "id": obj.get("id"), + "variantId": obj.get("variantId") }) return _obj diff --git a/talon_one/models/campaign_entity.py b/talon_one/models/campaign_entity.py index 60d4135..9c109b0 100644 --- a/talon_one/models/campaign_entity.py +++ b/talon_one/models/campaign_entity.py @@ -27,7 +27,7 @@ class CampaignEntity(BaseModel): """ CampaignEntity """ # noqa: E501 - campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId") + campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId", json_schema_extra={"examples": [211]}) __properties: ClassVar[List[str]] = ["campaignId"] model_config = ConfigDict( diff --git a/talon_one/models/campaign_evaluation_group.py b/talon_one/models/campaign_evaluation_group.py index 4156bbe..4ff7453 100644 --- a/talon_one/models/campaign_evaluation_group.py +++ b/talon_one/models/campaign_evaluation_group.py @@ -28,14 +28,14 @@ class CampaignEvaluationGroup(BaseModel): """ CampaignEvaluationGroup """ # noqa: E501 - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - name: StrictStr = Field(description="The name of the campaign evaluation group.") - parent_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the parent group that contains the campaign evaluation group.", alias="parentId") - description: Optional[StrictStr] = Field(default=None, description="A description of the campaign evaluation group.") + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + name: StrictStr = Field(description="The name of the campaign evaluation group.", json_schema_extra={"examples": ["Summer campaigns"]}) + parent_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the parent group that contains the campaign evaluation group.", alias="parentId", json_schema_extra={"examples": [2]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the campaign evaluation group.", json_schema_extra={"examples": ["This campaign evaluation group contains all campaigns that are running in the summer."]}) evaluation_mode: StrictStr = Field(description="The mode by which campaigns in the campaign evaluation group are evaluated.", alias="evaluationMode") evaluation_scope: StrictStr = Field(description="The evaluation scope of the campaign evaluation group.", alias="evaluationScope") - locked: StrictBool = Field(description="An indicator of whether the campaign evaluation group is locked for modification.") - id: StrictInt = Field(description="Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints.") + locked: StrictBool = Field(description="An indicator of whether the campaign evaluation group is locked for modification.", json_schema_extra={"examples": [False]}) + id: StrictInt = Field(description="Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints.", json_schema_extra={"examples": [6]}) __properties: ClassVar[List[str]] = ["applicationId", "name", "parentId", "description", "evaluationMode", "evaluationScope", "locked", "id"] @field_validator('evaluation_mode') diff --git a/talon_one/models/campaign_evaluation_position.py b/talon_one/models/campaign_evaluation_position.py index 1bc2c58..d09b1b4 100644 --- a/talon_one/models/campaign_evaluation_position.py +++ b/talon_one/models/campaign_evaluation_position.py @@ -27,9 +27,9 @@ class CampaignEvaluationPosition(BaseModel): """ The campaign position within the evaluation tree. """ # noqa: E501 - group_id: StrictInt = Field(description="The ID of the campaign evaluation group the campaign belongs to.", alias="groupId") - group_name: StrictStr = Field(description="The name of the campaign evaluation group the campaign belongs to.", alias="groupName") - position: StrictInt = Field(description="The position of the campaign node in its parent group.") + group_id: StrictInt = Field(description="The ID of the campaign evaluation group the campaign belongs to.", alias="groupId", json_schema_extra={"examples": [2]}) + group_name: StrictStr = Field(description="The name of the campaign evaluation group the campaign belongs to.", alias="groupName", json_schema_extra={"examples": ["Summer campaigns"]}) + position: StrictInt = Field(description="The position of the campaign node in its parent group.", json_schema_extra={"examples": [2]}) __properties: ClassVar[List[str]] = ["groupId", "groupName", "position"] model_config = ConfigDict( diff --git a/talon_one/models/campaign_evaluation_tree_changed_message.py b/talon_one/models/campaign_evaluation_tree_changed_message.py index f35d900..78183bf 100644 --- a/talon_one/models/campaign_evaluation_tree_changed_message.py +++ b/talon_one/models/campaign_evaluation_tree_changed_message.py @@ -28,7 +28,7 @@ class CampaignEvaluationTreeChangedMessage(BaseModel): """ CampaignEvaluationTreeChangedMessage """ # noqa: E501 - notification_type: StrictStr = Field(description="The type of the notification", alias="NotificationType") + 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") __properties: ClassVar[List[str]] = ["NotificationType", "TotalResultSize", "Data"] diff --git a/talon_one/models/campaign_evaluation_tree_changed_notification.py b/talon_one/models/campaign_evaluation_tree_changed_notification.py index d8a175d..05577f3 100644 --- a/talon_one/models/campaign_evaluation_tree_changed_notification.py +++ b/talon_one/models/campaign_evaluation_tree_changed_notification.py @@ -28,7 +28,7 @@ class CampaignEvaluationTreeChangedNotification(BaseModel): """ Notification about an Application whose campaign evaluation tree changed. """ # noqa: E501 - application_id: StrictInt = Field(description="The ID of the Application whose campaign evaluation tree changed.", alias="applicationId") + application_id: StrictInt = Field(description="The ID of the Application whose campaign evaluation tree changed.", alias="applicationId", json_schema_extra={"examples": [78]}) old_evaluation_tree: Optional[CampaignSet] = Field(default=None, description="The previous campaign evaluation tree.", alias="oldEvaluationTree") evaluation_tree: CampaignSet = Field(description="The new campaign evaluation tree.", alias="evaluationTree") __properties: ClassVar[List[str]] = ["applicationId", "oldEvaluationTree", "evaluationTree"] diff --git a/talon_one/models/campaign_group.py b/talon_one/models/campaign_group.py index 13e5a7e..c92b7d9 100644 --- a/talon_one/models/campaign_group.py +++ b/talon_one/models/campaign_group.py @@ -29,14 +29,14 @@ class CampaignGroup(BaseModel): """ CampaignGroup """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - modified: datetime = Field(description="The time this entity was last modified.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the campaign access group.") - description: Optional[StrictStr] = Field(default=None, description="A longer description of the campaign access group.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of IDs of the Applications that this campaign access group is enabled for.", alias="subscribedApplicationsIds") - campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of IDs of the campaigns that are part of the campaign access group.", alias="campaignIds") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + modified: datetime = Field(description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the campaign access group.", json_schema_extra={"examples": ["Europe access group"]}) + description: Optional[StrictStr] = Field(default=None, description="A longer description of the campaign access group.", json_schema_extra={"examples": ["A group that gives access to all the campaigns for the Europe market."]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of IDs of the Applications that this campaign access group is enabled for.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[1, 2, 3]]}) + campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of IDs of the campaigns that are part of the campaign access group.", alias="campaignIds", json_schema_extra={"examples": [[4, 6, 8]]}) __properties: ClassVar[List[str]] = ["id", "created", "modified", "accountId", "name", "description", "subscribedApplicationsIds", "campaignIds"] model_config = ConfigDict( diff --git a/talon_one/models/campaign_log_summary.py b/talon_one/models/campaign_log_summary.py index 8b4a613..0bdd41a 100644 --- a/talon_one/models/campaign_log_summary.py +++ b/talon_one/models/campaign_log_summary.py @@ -28,10 +28,10 @@ class CampaignLogSummary(BaseModel): """ Campaign Log Summary """ # noqa: E501 - name: StrictStr = Field(description="Name of the user that performed the change.") - email: StrictStr = Field(description="E-mail of the user that performed the change.") - created: datetime = Field(description="Date and time the change was performed.") - action: StrictStr = Field(description="Action performed by the user.") + name: StrictStr = Field(description="Name of the user that performed the change.", json_schema_extra={"examples": ["Admin"]}) + email: StrictStr = Field(description="E-mail of the user that performed the change.", json_schema_extra={"examples": ["admin@talon.one"]}) + created: datetime = Field(description="Date and time the change was performed.", json_schema_extra={"examples": ["2022-01-02T15:04:05Z07:00"]}) + action: StrictStr = Field(description="Action performed by the user.", json_schema_extra={"examples": ["create"]}) summary: StrictStr = Field(description="AI-generated summary of the action performed.") __properties: ClassVar[List[str]] = ["name", "email", "created", "action", "summary"] diff --git a/talon_one/models/campaign_notification_base.py b/talon_one/models/campaign_notification_base.py index c8fc07b..49af36b 100644 --- a/talon_one/models/campaign_notification_base.py +++ b/talon_one/models/campaign_notification_base.py @@ -27,7 +27,7 @@ class CampaignNotificationBase(BaseModel): """ CampaignNotificationBase """ # noqa: E501 - notification_type: StrictStr = Field(description="The type of the notification", alias="NotificationType") + 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") __properties: ClassVar[List[str]] = ["NotificationType", "TotalResultSize"] diff --git a/talon_one/models/campaign_notification_generic.py b/talon_one/models/campaign_notification_generic.py index e0824f8..0cbf55f 100644 --- a/talon_one/models/campaign_notification_generic.py +++ b/talon_one/models/campaign_notification_generic.py @@ -27,7 +27,7 @@ class CampaignNotificationGeneric(BaseModel): """ CampaignNotificationGeneric """ # noqa: E501 - notification_type: StrictStr = Field(description="The type of the notification", alias="NotificationType") + 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: List[Dict[str, Any]] = Field(description="A list of campaign notification data.", alias="Data") __properties: ClassVar[List[str]] = ["NotificationType", "TotalResultSize", "Data"] diff --git a/talon_one/models/campaign_notification_item_base.py b/talon_one/models/campaign_notification_item_base.py index df72775..1ad8cf6 100644 --- a/talon_one/models/campaign_notification_item_base.py +++ b/talon_one/models/campaign_notification_item_base.py @@ -27,7 +27,7 @@ class CampaignNotificationItemBase(BaseModel): """ CampaignNotificationItemBase """ # noqa: E501 - event: StrictStr = Field(description="The type of the event. Can be one of the following: ['campaign_state_changed', 'campaign_ruleset_changed', 'campaign_edited', 'campaign_created', 'campaign_deleted'] ", alias="Event") + event: StrictStr = Field(description="The type of the event. Can be one of the following: ['campaign_state_changed', 'campaign_ruleset_changed', 'campaign_edited', 'campaign_created', 'campaign_deleted'] ", alias="Event", json_schema_extra={"examples": ["campaign_state_changed"]}) __properties: ClassVar[List[str]] = ["Event"] model_config = ConfigDict( diff --git a/talon_one/models/campaign_notification_policy.py b/talon_one/models/campaign_notification_policy.py index 74a1b58..1ac9b2a 100644 --- a/talon_one/models/campaign_notification_policy.py +++ b/talon_one/models/campaign_notification_policy.py @@ -28,9 +28,9 @@ class CampaignNotificationPolicy(BaseModel): """ CampaignNotificationPolicy """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.") - batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled") - batch_size: Optional[StrictInt] = Field(default=5, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.", json_schema_extra={"examples": ["Christmas Sale"]}) + batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled", json_schema_extra={"examples": [False]}) + batch_size: Optional[StrictInt] = Field(default=5, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize", json_schema_extra={"examples": [5]}) __properties: ClassVar[List[str]] = ["name", "batchingEnabled", "batchSize"] model_config = ConfigDict( diff --git a/talon_one/models/campaign_ruleset_changed_notification.py b/talon_one/models/campaign_ruleset_changed_notification.py index e71458c..b55d1f3 100644 --- a/talon_one/models/campaign_ruleset_changed_notification.py +++ b/talon_one/models/campaign_ruleset_changed_notification.py @@ -28,7 +28,7 @@ class CampaignRulesetChangedNotification(BaseModel): """ CampaignRulesetChangedNotification """ # noqa: E501 - notification_type: StrictStr = Field(description="The type of the notification", alias="NotificationType") + 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[CampaignRulesetChangedNotificationItem]] = Field(default=None, description="A list of campaign notification data.", alias="Data") __properties: ClassVar[List[str]] = ["NotificationType", "TotalResultSize", "Data"] diff --git a/talon_one/models/campaign_ruleset_changed_notification_item.py b/talon_one/models/campaign_ruleset_changed_notification_item.py index df613c4..ba7f5d2 100644 --- a/talon_one/models/campaign_ruleset_changed_notification_item.py +++ b/talon_one/models/campaign_ruleset_changed_notification_item.py @@ -30,7 +30,7 @@ class CampaignRulesetChangedNotificationItem(BaseModel): """ CampaignRulesetChangedNotificationItem """ # noqa: E501 - event: StrictStr = Field(description="The type of the event. Can be one of the following: ['campaign_state_changed', 'campaign_ruleset_changed', 'campaign_edited', 'campaign_created', 'campaign_deleted'] ", alias="Event") + event: StrictStr = Field(description="The type of the event. Can be one of the following: ['campaign_state_changed', 'campaign_ruleset_changed', 'campaign_edited', 'campaign_created', 'campaign_deleted'] ", alias="Event", json_schema_extra={"examples": ["campaign_state_changed"]}) campaign: Campaign = Field(description="The campaign whose state changed.") old_ruleset: Optional[Ruleset] = Field(default=None, description="The old ruleset, if the ruleset was changed.", alias="oldRuleset") old_placeholders: Optional[List[PlaceholderDetails]] = Field(default=None, description="The previous details of the placeholders before the ruleset was changed.", alias="oldPlaceholders") diff --git a/talon_one/models/campaign_set.py b/talon_one/models/campaign_set.py index 1237759..6d6576d 100644 --- a/talon_one/models/campaign_set.py +++ b/talon_one/models/campaign_set.py @@ -29,11 +29,11 @@ class CampaignSet(BaseModel): """ CampaignSet """ # noqa: E501 - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - id: StrictInt = Field(description="The internal ID of this entity.") - version: Annotated[int, Field(strict=True, ge=1)] = Field(description="Version of the campaign set.") + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + version: Annotated[int, Field(strict=True, ge=1)] = Field(description="Version of the campaign set.", json_schema_extra={"examples": [3]}) set: CampaignSetBranchNode - updated_by: Optional[StrictStr] = Field(default=None, description="Name of the user who last updated this campaign set, if available.", alias="updatedBy") + updated_by: Optional[StrictStr] = Field(default=None, description="Name of the user who last updated this campaign set, if available.", alias="updatedBy", json_schema_extra={"examples": ["Jane Doe"]}) __properties: ClassVar[List[str]] = ["applicationId", "id", "version", "set", "updatedBy"] model_config = ConfigDict( diff --git a/talon_one/models/campaign_set_branch_node.py b/talon_one/models/campaign_set_branch_node.py index 8648bf3..6455634 100644 --- a/talon_one/models/campaign_set_branch_node.py +++ b/talon_one/models/campaign_set_branch_node.py @@ -28,9 +28,9 @@ class CampaignSetBranchNode(BaseModel): """ CampaignSetBranchNode """ # noqa: E501 - type: StrictStr = Field(description="Indicates the node type.") - name: StrictStr = Field(description="Name of the set.") - operator: StrictStr = Field(description="An indicator of how the set operates on its elements.") + type: StrictStr = Field(description="Indicates the node type.", json_schema_extra={"examples": ["SET"]}) + name: StrictStr = Field(description="Name of the set.", json_schema_extra={"examples": ["name"]}) + operator: StrictStr = Field(description="An indicator of how the set operates on its elements.", json_schema_extra={"examples": ["ALL"]}) elements: List[CampaignSetNode] = Field(description="Child elements of this set.") group_id: StrictInt = Field(description="The ID of the campaign set.", alias="groupId") locked: StrictBool = Field(description="An indicator of whether the campaign set is locked for modification.") diff --git a/talon_one/models/campaign_set_node.py b/talon_one/models/campaign_set_node.py index cce9a9b..1ec34a5 100644 --- a/talon_one/models/campaign_set_node.py +++ b/talon_one/models/campaign_set_node.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self @@ -27,7 +27,7 @@ class CampaignSetNode(BaseModel): """ CampaignSetNode """ # noqa: E501 - type: StrictStr + type: StrictStr = Field(json_schema_extra={"examples": ["type"]}) __properties: ClassVar[List[str]] = ["type"] model_config = ConfigDict( diff --git a/talon_one/models/campaign_state_changed_notification.py b/talon_one/models/campaign_state_changed_notification.py index 3acf40f..a7ac284 100644 --- a/talon_one/models/campaign_state_changed_notification.py +++ b/talon_one/models/campaign_state_changed_notification.py @@ -28,7 +28,7 @@ class CampaignStateChangedNotification(BaseModel): """ CampaignStateChangedNotification """ # noqa: E501 - notification_type: StrictStr = Field(description="The type of the notification", alias="NotificationType") + 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[CampaignStateChangedNotificationItem]] = Field(default=None, description="A list of campaign notification data.", alias="Data") __properties: ClassVar[List[str]] = ["NotificationType", "TotalResultSize", "Data"] diff --git a/talon_one/models/campaign_state_changed_notification_item.py b/talon_one/models/campaign_state_changed_notification_item.py index 0a8d6d1..a98a724 100644 --- a/talon_one/models/campaign_state_changed_notification_item.py +++ b/talon_one/models/campaign_state_changed_notification_item.py @@ -30,10 +30,10 @@ class CampaignStateChangedNotificationItem(BaseModel): """ CampaignStateChangedNotificationItem """ # noqa: E501 - event: StrictStr = Field(description="The type of the event. Can be one of the following: ['campaign_state_changed', 'campaign_ruleset_changed', 'campaign_edited', 'campaign_created', 'campaign_deleted'] ", alias="Event") + event: StrictStr = Field(description="The type of the event. Can be one of the following: ['campaign_state_changed', 'campaign_ruleset_changed', 'campaign_edited', 'campaign_created', 'campaign_deleted'] ", alias="Event", json_schema_extra={"examples": ["campaign_state_changed"]}) campaign: Campaign = Field(description="The campaign whose state changed.") - old_state: StrictStr = Field(description="The campaign's old state. Can be one of the following: ['running', 'disabled', 'scheduled', 'expired', 'archived'] ", alias="oldState") - new_state: StrictStr = Field(description="The campaign's new state. Can be one of the following: ['running', 'disabled', 'scheduled', 'expired', 'archived'] ", alias="newState") + old_state: StrictStr = Field(description="The campaign's old state. Can be one of the following: ['running', 'disabled', 'scheduled', 'expired', 'archived'] ", alias="oldState", json_schema_extra={"examples": ["disabled"]}) + new_state: StrictStr = Field(description="The campaign's new state. Can be one of the following: ['running', 'disabled', 'scheduled', 'expired', 'archived'] ", alias="newState", json_schema_extra={"examples": ["running"]}) ruleset: Optional[Ruleset] = Field(default=None, description="The current ruleset.") placeholders: Optional[List[PlaceholderDetails]] = Field(default=None, description="The current details of the [placeholders](https://docs.talon.one/docs/product/campaigns/templates/create-templates#use-placeholders) in the campaign.") __properties: ClassVar[List[str]] = ["Event", "campaign", "oldState", "newState", "ruleset", "placeholders"] diff --git a/talon_one/models/campaign_store_budget.py b/talon_one/models/campaign_store_budget.py index b3d57b5..4353c59 100644 --- a/talon_one/models/campaign_store_budget.py +++ b/talon_one/models/campaign_store_budget.py @@ -29,9 +29,9 @@ class CampaignStoreBudget(BaseModel): """ CampaignStoreBudget """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId", json_schema_extra={"examples": [322]}) store_id: StrictInt = Field(description="The ID of the store.", alias="storeId") limits: List[CampaignStoreBudgetLimitConfig] = Field(description="The set of budget limits for stores linked to the campaign.") __properties: ClassVar[List[str]] = ["id", "created", "campaignId", "storeId", "limits"] diff --git a/talon_one/models/campaign_store_budget_limit_config.py b/talon_one/models/campaign_store_budget_limit_config.py index eb69fee..8d609a6 100644 --- a/talon_one/models/campaign_store_budget_limit_config.py +++ b/talon_one/models/campaign_store_budget_limit_config.py @@ -28,10 +28,10 @@ class CampaignStoreBudgetLimitConfig(BaseModel): """ CampaignStoreBudgetLimitConfig """ # noqa: E501 - action: StrictStr = Field(description="The limitable action to which this limit applies. For example: - `setDiscount` - `setDiscountEffect` - `redeemCoupon` - `createCoupon` ") - limit: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="The value to set for the limit.") - period: Optional[StrictStr] = Field(default=None, description="The period on which the budget limit recurs.") - entities: List[StrictStr] = Field(description="The entity that this limit applies to.") + action: StrictStr = Field(description="The limitable action to which this limit applies. For example: - `setDiscount` - `setDiscountEffect` - `redeemCoupon` - `createCoupon` ", json_schema_extra={"examples": ["createCoupon"]}) + limit: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="The value to set for the limit.", json_schema_extra={"examples": [1000]}) + period: Optional[StrictStr] = Field(default=None, description="The period on which the budget limit recurs.", json_schema_extra={"examples": ["yearly"]}) + entities: List[StrictStr] = Field(description="The entity that this limit applies to.", json_schema_extra={"examples": [["Coupon"]]}) imported: StrictBool = Field(description="Indicates whether this limit configuration is managed via a CSV file.") __properties: ClassVar[List[str]] = ["action", "limit", "period", "entities", "imported"] diff --git a/talon_one/models/campaign_template.py b/talon_one/models/campaign_template.py index 17f66aa..cb96263 100644 --- a/talon_one/models/campaign_template.py +++ b/talon_one/models/campaign_template.py @@ -34,34 +34,34 @@ class CampaignTemplate(BaseModel): """ CampaignTemplate """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - user_id: StrictInt = Field(description="The ID of the user associated with this entity.", alias="userId") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The campaign template name.") - description: StrictStr = Field(description="Customer-facing text that explains the objective of the template.") - instructions: StrictStr = Field(description="Customer-facing text that explains how to use the template. For example, you can use this property to explain the available attributes of this template, and how they can be modified when a user uses this template to create a new campaign.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + user_id: StrictInt = Field(description="The ID of the user associated with this entity.", alias="userId", json_schema_extra={"examples": [388]}) + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The campaign template name.", json_schema_extra={"examples": ["Discount campaign"]}) + description: StrictStr = Field(description="Customer-facing text that explains the objective of the template.", json_schema_extra={"examples": ["This is a template for a discount campaign."]}) + instructions: StrictStr = Field(description="Customer-facing text that explains how to use the template. For example, you can use this property to explain the available attributes of this template, and how they can be modified when a user uses this template to create a new campaign.", json_schema_extra={"examples": ["Use this template for discount campaigns. Set the campaign properties according to the campaign goals, and don't forget to set an end date."]}) campaign_attributes: Optional[Dict[str, Any]] = Field(default=None, description="The campaign attributes that campaigns created from this template will have by default.", alias="campaignAttributes") coupon_attributes: Optional[Dict[str, Any]] = Field(default=None, description="The campaign attributes that coupons created from this template will have by default.", alias="couponAttributes") state: StrictStr = Field(description="Only campaign templates in 'available' state may be used to create campaigns.") - active_ruleset_id: Optional[StrictInt] = Field(default=None, description="The ID of the ruleset this campaign template will use.", alias="activeRulesetId") - tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)]] = Field(default=None, description="A list of tags for the campaign template.") - reevaluate_on_return: StrictBool = Field(description="Indicates whether campaigns created from this template should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn") + active_ruleset_id: Optional[StrictInt] = Field(default=None, description="The ID of the ruleset this campaign template will use.", alias="activeRulesetId", json_schema_extra={"examples": [5]}) + tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)]] = Field(default=None, description="A list of tags for the campaign template.", json_schema_extra={"examples": [["discount"]]}) + reevaluate_on_return: StrictBool = Field(description="Indicates whether campaigns created from this template should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn", json_schema_extra={"examples": [True]}) features: Optional[List[StrictStr]] = Field(default=None, description="A list of features for the campaign template.") coupon_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="couponSettings") coupon_reservation_settings: Optional[CampaignTemplateCouponReservationSettings] = Field(default=None, alias="couponReservationSettings") referral_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="referralSettings") limits: Optional[List[TemplateLimitConfig]] = Field(default=None, description="The set of limits that operate for this campaign template.") template_params: Optional[List[CampaignTemplateParams]] = Field(default=None, description="Fields which can be used to replace values in a rule.", alias="templateParams") - applications_ids: List[StrictInt] = Field(alias="applicationsIds") + applications_ids: List[StrictInt] = Field(alias="applicationsIds", json_schema_extra={"examples": [[1, 2, 3]]}) campaign_collections: Optional[List[CampaignTemplateCollection]] = Field(default=None, description="The campaign collections from the blueprint campaign for the template.", alias="campaignCollections") - default_campaign_group_id: Optional[StrictInt] = Field(default=None, description="The default campaign group ID.", alias="defaultCampaignGroupId") - campaign_type: Optional[StrictStr] = Field(default='advanced', description="The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. ", alias="campaignType") - campaigns_count: Optional[StrictInt] = Field(default=None, description="The number of Campaigns created from this template.", alias="campaignsCount") - updated: Optional[datetime] = Field(default=None, description="Timestamp of the most recent update to the campaign template or any of its elements.") - updated_by: Optional[StrictStr] = Field(default=None, description="Name of the user who last updated this campaign template, if available.", alias="updatedBy") - valid_application_ids: List[StrictInt] = Field(description="The IDs of the Applications that are related to this entity.", alias="validApplicationIds") - is_user_favorite: Optional[StrictBool] = Field(default=False, description="A flag indicating whether the user marked the template as a favorite.", alias="isUserFavorite") + default_campaign_group_id: Optional[StrictInt] = Field(default=None, description="The default campaign group ID.", alias="defaultCampaignGroupId", json_schema_extra={"examples": [42]}) + campaign_type: Optional[StrictStr] = Field(default='advanced', description="The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. ", alias="campaignType", json_schema_extra={"examples": ["advanced"]}) + campaigns_count: Optional[StrictInt] = Field(default=None, description="The number of Campaigns created from this template.", alias="campaignsCount", json_schema_extra={"examples": [3]}) + updated: Optional[datetime] = Field(default=None, description="Timestamp of the most recent update to the campaign template or any of its elements.", json_schema_extra={"examples": ["2022-08-24T14:15:22Z"]}) + updated_by: Optional[StrictStr] = Field(default=None, description="Name of the user who last updated this campaign template, if available.", alias="updatedBy", json_schema_extra={"examples": ["Jane Doe"]}) + valid_application_ids: List[StrictInt] = Field(description="The IDs of the Applications that are related to this entity.", alias="validApplicationIds", json_schema_extra={"examples": [[1, 2, 3]]}) + is_user_favorite: Optional[StrictBool] = Field(default=False, description="A flag indicating whether the user marked the template as a favorite.", alias="isUserFavorite", json_schema_extra={"examples": [False]}) __properties: ClassVar[List[str]] = ["id", "created", "accountId", "userId", "name", "description", "instructions", "campaignAttributes", "couponAttributes", "state", "activeRulesetId", "tags", "reevaluateOnReturn", "features", "couponSettings", "couponReservationSettings", "referralSettings", "limits", "templateParams", "applicationsIds", "campaignCollections", "defaultCampaignGroupId", "campaignType", "campaignsCount", "updated", "updatedBy", "validApplicationIds", "isUserFavorite"] @field_validator('state') diff --git a/talon_one/models/campaign_template_collection.py b/talon_one/models/campaign_template_collection.py index ff5bb1b..cae6fa0 100644 --- a/talon_one/models/campaign_template_collection.py +++ b/talon_one/models/campaign_template_collection.py @@ -28,8 +28,8 @@ class CampaignTemplateCollection(BaseModel): """ CampaignTemplateCollection """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this collection.") - description: Optional[StrictStr] = Field(default=None, description="A short description of the purpose of this collection.") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this collection.", json_schema_extra={"examples": ["My collection"]}) + 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') diff --git a/talon_one/models/campaign_template_coupon_reservation_settings.py b/talon_one/models/campaign_template_coupon_reservation_settings.py index 293ae10..8c265c4 100644 --- a/talon_one/models/campaign_template_coupon_reservation_settings.py +++ b/talon_one/models/campaign_template_coupon_reservation_settings.py @@ -28,8 +28,8 @@ class CampaignTemplateCouponReservationSettings(BaseModel): """ CampaignTemplateCouponReservationSettings """ # noqa: E501 - 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") - 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") + 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]}) + 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]] = ["reservationLimit", "isReservationMandatory"] model_config = ConfigDict( diff --git a/talon_one/models/campaign_template_params.py b/talon_one/models/campaign_template_params.py index 7a450b9..7ad15ef 100644 --- a/talon_one/models/campaign_template_params.py +++ b/talon_one/models/campaign_template_params.py @@ -28,10 +28,10 @@ class CampaignTemplateParams(BaseModel): """ CampaignTemplateParams """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Name of the campaign template parameter.") - type: StrictStr = Field(description="Defines the type of parameter value.") - description: StrictStr = Field(description="Explains the meaning of this template parameter and the placeholder value that will define it. It is used on campaign creation from this template.") - attribute_id: Optional[StrictInt] = Field(default=None, description="ID of the corresponding attribute.", alias="attributeId") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Name of the campaign template parameter.", json_schema_extra={"examples": ["discount_value"]}) + type: StrictStr = Field(description="Defines the type of parameter value.", json_schema_extra={"examples": ["number"]}) + description: StrictStr = Field(description="Explains the meaning of this template parameter and the placeholder value that will define it. It is used on campaign creation from this template.", json_schema_extra={"examples": ["This is a template parameter of type `number`."]}) + attribute_id: Optional[StrictInt] = Field(default=None, description="ID of the corresponding attribute.", alias="attributeId", json_schema_extra={"examples": [42]}) __properties: ClassVar[List[str]] = ["name", "type", "description", "attributeId"] @field_validator('type') diff --git a/talon_one/models/campaign_versions.py b/talon_one/models/campaign_versions.py index 28ad2a4..649f2f9 100644 --- a/talon_one/models/campaign_versions.py +++ b/talon_one/models/campaign_versions.py @@ -27,13 +27,13 @@ class CampaignVersions(BaseModel): """ CampaignVersions """ # noqa: E501 - revision_frontend_state: Optional[StrictStr] = Field(default=None, description="The campaign revision state displayed in the Campaign Manager.", alias="revisionFrontendState") - active_revision_id: Optional[StrictInt] = Field(default=None, description="ID of the revision that was last activated on this campaign. ", alias="activeRevisionId") - active_revision_version_id: Optional[StrictInt] = Field(default=None, description="ID of the revision version that is active on the campaign. ", alias="activeRevisionVersionId") - version: Optional[StrictInt] = Field(default=None, description="Incrementing number representing how many revisions have been activated on this campaign, starts from 0 for a new campaign. ") - current_revision_id: Optional[StrictInt] = Field(default=None, description="ID of the revision currently being modified for the campaign. ", alias="currentRevisionId") - current_revision_version_id: Optional[StrictInt] = Field(default=None, description="ID of the latest version applied on the current revision. ", alias="currentRevisionVersionId") - stage_revision: Optional[StrictBool] = Field(default=False, description="Flag for determining whether we use current revision when sending requests with staging API key. ", alias="stageRevision") + revision_frontend_state: Optional[StrictStr] = Field(default=None, description="The campaign revision state displayed in the Campaign Manager.", alias="revisionFrontendState", json_schema_extra={"examples": ["revised"]}) + active_revision_id: Optional[StrictInt] = Field(default=None, description="ID of the revision that was last activated on this campaign. ", alias="activeRevisionId", json_schema_extra={"examples": [6]}) + active_revision_version_id: Optional[StrictInt] = Field(default=None, description="ID of the revision version that is active on the campaign. ", alias="activeRevisionVersionId", json_schema_extra={"examples": [6]}) + version: Optional[StrictInt] = Field(default=None, description="Incrementing number representing how many revisions have been activated on this campaign, starts from 0 for a new campaign. ", json_schema_extra={"examples": [6]}) + current_revision_id: Optional[StrictInt] = Field(default=None, description="ID of the revision currently being modified for the campaign. ", alias="currentRevisionId", json_schema_extra={"examples": [6]}) + current_revision_version_id: Optional[StrictInt] = Field(default=None, description="ID of the latest version applied on the current revision. ", alias="currentRevisionVersionId", json_schema_extra={"examples": [6]}) + stage_revision: Optional[StrictBool] = Field(default=False, description="Flag for determining whether we use current revision when sending requests with staging API key. ", alias="stageRevision", json_schema_extra={"examples": [False]}) __properties: ClassVar[List[str]] = ["revisionFrontendState", "activeRevisionId", "activeRevisionVersionId", "version", "currentRevisionId", "currentRevisionVersionId", "stageRevision"] @field_validator('revision_frontend_state') diff --git a/talon_one/models/card_added_deducted_points_balances_notification.py b/talon_one/models/card_added_deducted_points_balances_notification.py index e7c7e81..20a0e33 100644 --- a/talon_one/models/card_added_deducted_points_balances_notification.py +++ b/talon_one/models/card_added_deducted_points_balances_notification.py @@ -29,18 +29,18 @@ class CardAddedDeductedPointsBalancesNotification(BaseModel): """ CardAddedDeductedPointsBalancesNotification """ # noqa: E501 - card_identifier: StrictStr = Field(description="Loyalty card identification number.", alias="CardIdentifier") - employee_name: StrictStr = Field(description="The name of the employee who added or deducted points.", alias="EmployeeName") - loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID") + card_identifier: StrictStr = Field(description="Loyalty card identification number.", alias="CardIdentifier", json_schema_extra={"examples": ["123-456-789ATBC"]}) + employee_name: StrictStr = Field(description="The name of the employee who added or deducted points.", alias="EmployeeName", json_schema_extra={"examples": ["Franziska Schneider"]}) + loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID", json_schema_extra={"examples": [5]}) notification_type: StrictStr = Field(description="The type of notification.", alias="NotificationType") - profile_integration_ids: List[StrictStr] = Field(description="The integration ID of the customer profile to whom points were added or deducted.", alias="ProfileIntegrationIDs") - session_integration_id: StrictStr = Field(description="The integration ID of the session through which the points were earned or lost.", alias="SessionIntegrationID") - subledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were added or deducted.", alias="SubledgerID") + profile_integration_ids: List[StrictStr] = Field(description="The integration ID of the customer profile to whom points were added or deducted.", alias="ProfileIntegrationIDs", json_schema_extra={"examples": [["yJSObdNNtOetCHWHPFuz", "test-user-4zoj1c"]]}) + session_integration_id: StrictStr = Field(description="The integration ID of the session through which the points were earned or lost.", alias="SessionIntegrationID", json_schema_extra={"examples": ["cc53e4fa-547f-4f5e-8333-76e05c381f67"]}) + subledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were added or deducted.", alias="SubledgerID", json_schema_extra={"examples": ["sub-123"]}) type_of_change: StrictStr = Field(description="The notification source, that is, it indicates whether the points were added or deducted via one of the following routes: - [The Campaign Manager](/docs/product/getting-started) - [Management API](/management-api#tag/Loyalty) - [Rule Engine](/docs/product/applications/evaluation-order-for-rules-and-filters) ", alias="TypeOfChange") - user_id: StrictInt = Field(description="The ID of the employee who added or deducted points.", alias="UserID") - users_per_card_limit: StrictInt = Field(description="The max amount of user profiles with whom a card can be shared. This can be set to `0` for no limit.", alias="UsersPerCardLimit") + user_id: StrictInt = Field(description="The ID of the employee who added or deducted points.", alias="UserID", json_schema_extra={"examples": [25]}) + users_per_card_limit: StrictInt = Field(description="The max amount of user profiles with whom a card can be shared. This can be set to `0` for no limit.", alias="UsersPerCardLimit", json_schema_extra={"examples": [10]}) actions: Annotated[List[AddedDeductedPointsBalancesAction], Field(min_length=1)] = Field(description="The list of actions that have been triggered in the loyalty program.", alias="Actions") - current_points: Union[StrictFloat, StrictInt] = Field(description="The current points balance.", alias="CurrentPoints") + current_points: Union[StrictFloat, StrictInt] = Field(description="The current points balance.", alias="CurrentPoints", json_schema_extra={"examples": [10.99]}) __properties: ClassVar[List[str]] = ["CardIdentifier", "EmployeeName", "LoyaltyProgramID", "NotificationType", "ProfileIntegrationIDs", "SessionIntegrationID", "SubledgerID", "TypeOfChange", "UserID", "UsersPerCardLimit", "Actions", "CurrentPoints"] @field_validator('notification_type') diff --git a/talon_one/models/card_added_deducted_points_balances_notification_policy.py b/talon_one/models/card_added_deducted_points_balances_notification_policy.py index e6d937e..c3a209b 100644 --- a/talon_one/models/card_added_deducted_points_balances_notification_policy.py +++ b/talon_one/models/card_added_deducted_points_balances_notification_policy.py @@ -28,7 +28,7 @@ class CardAddedDeductedPointsBalancesNotificationPolicy(BaseModel): """ CardAddedDeductedPointsBalancesNotificationPolicy """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.", json_schema_extra={"examples": ["Christmas Sale"]}) scopes: Annotated[List[StrictStr], Field(min_length=1, max_length=4)] __properties: ClassVar[List[str]] = ["name", "scopes"] diff --git a/talon_one/models/card_added_deducted_points_notification.py b/talon_one/models/card_added_deducted_points_notification.py index 0518f85..b88e0d0 100644 --- a/talon_one/models/card_added_deducted_points_notification.py +++ b/talon_one/models/card_added_deducted_points_notification.py @@ -30,21 +30,21 @@ class CardAddedDeductedPointsNotification(BaseModel): """ CardAddedDeductedPointsNotification """ # noqa: E501 - card_identifier: StrictStr = Field(description="Loyalty card identification number.", alias="CardIdentifier") - employee_name: StrictStr = Field(description="The name of the employee who added or deducted points.", alias="EmployeeName") - loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID") + card_identifier: StrictStr = Field(description="Loyalty card identification number.", alias="CardIdentifier", json_schema_extra={"examples": ["123-456-789ATBC"]}) + employee_name: StrictStr = Field(description="The name of the employee who added or deducted points.", alias="EmployeeName", json_schema_extra={"examples": ["Franziska Schneider"]}) + loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID", json_schema_extra={"examples": [5]}) notification_type: StrictStr = Field(description="The type of notification.", alias="NotificationType") - profile_integration_ids: List[StrictStr] = Field(description="The integration ID of the customer profile to whom points were added or deducted.", alias="ProfileIntegrationIDs") - session_integration_id: StrictStr = Field(description="The integration ID of the session through which the points were earned or lost.", alias="SessionIntegrationID") - subledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were added or deducted.", alias="SubledgerID") + profile_integration_ids: List[StrictStr] = Field(description="The integration ID of the customer profile to whom points were added or deducted.", alias="ProfileIntegrationIDs", json_schema_extra={"examples": [["yJSObdNNtOetCHWHPFuz", "test-user-4zoj1c"]]}) + session_integration_id: StrictStr = Field(description="The integration ID of the session through which the points were earned or lost.", alias="SessionIntegrationID", json_schema_extra={"examples": ["cc53e4fa-547f-4f5e-8333-76e05c381f67"]}) + subledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were added or deducted.", alias="SubledgerID", json_schema_extra={"examples": ["sub-123"]}) type_of_change: StrictStr = Field(description="The notification source, that is, it indicates whether the points were added or deducted via one of the following routes: - [The Campaign Manager](/docs/product/getting-started) - [Management API](/management-api#tag/Loyalty) - [Rule Engine](/docs/product/applications/evaluation-order-for-rules-and-filters) ", alias="TypeOfChange") - user_id: StrictInt = Field(description="The ID of the employee who added or deducted points.", alias="UserID") - users_per_card_limit: StrictInt = Field(description="The max amount of user profiles with whom a card can be shared. This can be set to `0` for no limit.", alias="UsersPerCardLimit") - amount: Union[StrictFloat, StrictInt] = Field(description="The amount of added or deducted loyalty points.", alias="Amount") - expiry_date: Optional[datetime] = Field(default=None, description="The expiration date for loyalty points.", alias="ExpiryDate") + user_id: StrictInt = Field(description="The ID of the employee who added or deducted points.", alias="UserID", json_schema_extra={"examples": [25]}) + users_per_card_limit: StrictInt = Field(description="The max amount of user profiles with whom a card can be shared. This can be set to `0` for no limit.", alias="UsersPerCardLimit", json_schema_extra={"examples": [10]}) + amount: Union[StrictFloat, StrictInt] = Field(description="The amount of added or deducted loyalty points.", alias="Amount", json_schema_extra={"examples": [10.99]}) + expiry_date: Optional[datetime] = Field(default=None, description="The expiration date for loyalty points.", alias="ExpiryDate", json_schema_extra={"examples": ["2024-01-24T14:15:22Z"]}) operation: StrictStr = Field(description="The action (addition or subtraction) made with loyalty points.", alias="Operation") - reason: StrictStr = Field(description="The reason for the points addition or deduction.", alias="Reason") - start_date: Optional[datetime] = Field(default=None, description="The start date for loyalty points.", alias="StartDate") + reason: StrictStr = Field(description="The reason for the points addition or deduction.", alias="Reason", json_schema_extra={"examples": ["Compensation"]}) + start_date: Optional[datetime] = Field(default=None, description="The start date for loyalty points.", alias="StartDate", json_schema_extra={"examples": ["2023-01-24T14:15:22Z"]}) transaction_uuid: UUID = Field(description="The identifier of the transaction in the loyalty ledger.", alias="TransactionUUID") __properties: ClassVar[List[str]] = ["CardIdentifier", "EmployeeName", "LoyaltyProgramID", "NotificationType", "ProfileIntegrationIDs", "SessionIntegrationID", "SubledgerID", "TypeOfChange", "UserID", "UsersPerCardLimit", "Amount", "ExpiryDate", "Operation", "Reason", "StartDate", "TransactionUUID"] diff --git a/talon_one/models/card_added_deducted_points_notification_policy.py b/talon_one/models/card_added_deducted_points_notification_policy.py index 8f43610..82553f2 100644 --- a/talon_one/models/card_added_deducted_points_notification_policy.py +++ b/talon_one/models/card_added_deducted_points_notification_policy.py @@ -28,7 +28,7 @@ class CardAddedDeductedPointsNotificationPolicy(BaseModel): """ CardAddedDeductedPointsNotificationPolicy """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.", json_schema_extra={"examples": ["Christmas Sale"]}) scopes: Annotated[List[StrictStr], Field(min_length=1, max_length=4)] __properties: ClassVar[List[str]] = ["name", "scopes"] diff --git a/talon_one/models/card_expiring_points_notification_policy.py b/talon_one/models/card_expiring_points_notification_policy.py index b1672c2..fe938c0 100644 --- a/talon_one/models/card_expiring_points_notification_policy.py +++ b/talon_one/models/card_expiring_points_notification_policy.py @@ -29,10 +29,10 @@ class CardExpiringPointsNotificationPolicy(BaseModel): """ CardExpiringPointsNotificationPolicy """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.", json_schema_extra={"examples": ["Notification to Google"]}) triggers: Annotated[List[CardExpiringPointsNotificationTrigger], Field(min_length=1, max_length=3)] - batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled") - batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize") + batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled", json_schema_extra={"examples": [True]}) + batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize", json_schema_extra={"examples": [1000]}) __properties: ClassVar[List[str]] = ["name", "triggers", "batchingEnabled", "batchSize"] model_config = ConfigDict( diff --git a/talon_one/models/card_ledger_points_entry_integration_api.py b/talon_one/models/card_ledger_points_entry_integration_api.py index 4768011..2e16434 100644 --- a/talon_one/models/card_ledger_points_entry_integration_api.py +++ b/talon_one/models/card_ledger_points_entry_integration_api.py @@ -29,18 +29,18 @@ class CardLedgerPointsEntryIntegrationAPI(BaseModel): """ Loyalty card points with start and expiry dates. """ # noqa: E501 - id: StrictInt = Field(description="ID of the transaction that adds loyalty points.") - transaction_uuid: StrictStr = Field(description="Unique identifier of the transaction in the UUID format.", alias="transactionUUID") - created: datetime = Field(description="Date and time the loyalty card points were added.") - program_id: StrictInt = Field(description="ID of the loyalty program.", alias="programId") - customer_profile_id: Optional[StrictStr] = Field(default=None, description="Integration ID of the customer profile linked to the card.", alias="customerProfileID") - customer_session_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="ID of the customer session where points were added.", alias="customerSessionId") - name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Name or reason of the transaction that adds loyalty points.") - start_date: Annotated[str, Field(strict=True, max_length=64)] = Field(description="When points become active. Possible values: - `immediate`: Points are active immediately. - `timestamp value`: Points become active at a given date and time. ", alias="startDate") - expiry_date: StrictStr = Field(description="Date when points expire. Possible values are: - `unlimited`: Points have no expiration date. - `timestamp value`: Points expire on the given date and time. ", alias="expiryDate") - subledger_id: Annotated[str, Field(strict=True, max_length=64)] = Field(description="ID of the subledger.", alias="subledgerId") - amount: Union[StrictFloat, StrictInt] = Field(description="Amount of loyalty points added in the transaction.") - 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") + id: StrictInt = Field(description="ID of the transaction that adds loyalty points.", json_schema_extra={"examples": [123]}) + transaction_uuid: StrictStr = Field(description="Unique identifier of the transaction in the UUID format.", alias="transactionUUID", json_schema_extra={"examples": ["ce59f12a-f53b-4014-a745-636d93f2bd3f"]}) + created: datetime = Field(description="Date and time the loyalty card points were added.", json_schema_extra={"examples": ["2022-01-02T15:04:05Z07:00"]}) + program_id: StrictInt = Field(description="ID of the loyalty program.", alias="programId", json_schema_extra={"examples": [324]}) + customer_profile_id: Optional[StrictStr] = Field(default=None, description="Integration ID of the customer profile linked to the card.", alias="customerProfileID", json_schema_extra={"examples": ["URNGV8294NV"]}) + customer_session_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="ID of the customer session where points were added.", alias="customerSessionId", json_schema_extra={"examples": ["05c2da0d-48fa-4aa1-b629-898f58f1584d"]}) + name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Name or reason of the transaction that adds loyalty points.", json_schema_extra={"examples": ["Reward 10% points of a purchase's current total"]}) + start_date: Annotated[str, Field(strict=True, max_length=64)] = Field(description="When points become active. Possible values: - `immediate`: Points are active immediately. - `timestamp value`: Points become active at a given date and time. ", alias="startDate", json_schema_extra={"examples": ["2022-01-02T15:04:05Z07:00"]}) + expiry_date: StrictStr = Field(description="Date when points expire. Possible values are: - `unlimited`: Points have no expiration date. - `timestamp value`: Points expire on the given date and time. ", alias="expiryDate", json_schema_extra={"examples": ["2022-08-02T15:04:05Z07:00"]}) + subledger_id: Annotated[str, Field(strict=True, max_length=64)] = Field(description="ID of the subledger.", alias="subledgerId", json_schema_extra={"examples": ["sub-123"]}) + amount: Union[StrictFloat, StrictInt] = Field(description="Amount of loyalty points added in the transaction.", json_schema_extra={"examples": [10.25]}) + 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]] = ["id", "transactionUUID", "created", "programId", "customerProfileID", "customerSessionId", "name", "startDate", "expiryDate", "subledgerId", "amount", "validityDuration"] model_config = ConfigDict( diff --git a/talon_one/models/card_ledger_transaction_log_entry.py b/talon_one/models/card_ledger_transaction_log_entry.py index 4674c32..1487561 100644 --- a/talon_one/models/card_ledger_transaction_log_entry.py +++ b/talon_one/models/card_ledger_transaction_log_entry.py @@ -29,20 +29,20 @@ class CardLedgerTransactionLogEntry(BaseModel): """ Log entry for a given loyalty card transaction. """ # noqa: E501 - transaction_uuid: StrictStr = Field(description="Unique identifier of the transaction in the UUID format.", alias="transactionUUID") - created: datetime = Field(description="Date and time the loyalty card transaction occurred.") - program_id: StrictInt = Field(description="ID of the loyalty program.", alias="programId") - card_identifier: Annotated[str, Field(min_length=4, strict=True, max_length=108)] = Field(description="The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. ", alias="cardIdentifier") - application_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application that owns this entity.", alias="applicationId") - session_id: Optional[StrictInt] = Field(default=None, description="The **internal** ID of the session. ", alias="sessionId") - customer_session_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="ID of the customer session where the transaction occurred.", alias="customerSessionId") - type: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Type of transaction. Possible values: - `addition`: Signifies added points. - `subtraction`: Signifies deducted points. ") - name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Name or reason of the loyalty ledger transaction.") - start_date: Annotated[str, Field(strict=True, max_length=64)] = Field(description="When points become active. Possible values: - `immediate`: Points are immediately active. - a timestamp value: Points become active at a given date and time. ", alias="startDate") - expiry_date: StrictStr = Field(description="Date when points expire. Possible values are: - `unlimited`: Points have no expiration date. - `timestamp value`: Points become active from the given date. ", alias="expiryDate") - subledger_id: Annotated[str, Field(strict=True, max_length=64)] = Field(description="ID of the subledger.", alias="subledgerId") - amount: Union[StrictFloat, StrictInt] = Field(description="Amount of loyalty points added or deducted in the transaction.") - id: StrictInt = Field(description="ID of the loyalty ledger entry.") + transaction_uuid: StrictStr = Field(description="Unique identifier of the transaction in the UUID format.", alias="transactionUUID", json_schema_extra={"examples": ["ce59f12a-f53b-4014-a745-636d93f2bd3f"]}) + created: datetime = Field(description="Date and time the loyalty card transaction occurred.", json_schema_extra={"examples": ["2022-01-02T15:04:05Z07:00"]}) + program_id: StrictInt = Field(description="ID of the loyalty program.", alias="programId", json_schema_extra={"examples": [324]}) + card_identifier: Annotated[str, Field(min_length=4, strict=True, max_length=108)] = Field(description="The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. ", alias="cardIdentifier", json_schema_extra={"examples": ["summer-loyalty-card-0543"]}) + application_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + session_id: Optional[StrictInt] = Field(default=None, description="The **internal** ID of the session. ", alias="sessionId", json_schema_extra={"examples": [233]}) + customer_session_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="ID of the customer session where the transaction occurred.", alias="customerSessionId", json_schema_extra={"examples": ["05c2da0d-48fa-4aa1-b629-898f58f1584d"]}) + type: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Type of transaction. Possible values: - `addition`: Signifies added points. - `subtraction`: Signifies deducted points. ", json_schema_extra={"examples": ["addition"]}) + name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Name or reason of the loyalty ledger transaction.", json_schema_extra={"examples": ["Reward 10% points of a purchase's current total"]}) + start_date: Annotated[str, Field(strict=True, max_length=64)] = Field(description="When points become active. Possible values: - `immediate`: Points are immediately active. - a timestamp value: Points become active at a given date and time. ", alias="startDate", json_schema_extra={"examples": ["2022-01-02T15:04:05Z07:00"]}) + expiry_date: StrictStr = Field(description="Date when points expire. Possible values are: - `unlimited`: Points have no expiration date. - `timestamp value`: Points become active from the given date. ", alias="expiryDate", json_schema_extra={"examples": ["2022-08-02T15:04:05Z07:00"]}) + subledger_id: Annotated[str, Field(strict=True, max_length=64)] = Field(description="ID of the subledger.", alias="subledgerId", json_schema_extra={"examples": ["sub-123"]}) + amount: Union[StrictFloat, StrictInt] = Field(description="Amount of loyalty points added or deducted in the transaction.", json_schema_extra={"examples": [10.25]}) + 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') 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 e81c41f..89d97a8 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 @@ -29,21 +29,21 @@ class CardLedgerTransactionLogEntryIntegrationAPI(BaseModel): """ Log entry for a given loyalty card transaction. """ # noqa: E501 - transaction_uuid: StrictStr = Field(description="Unique identifier of the transaction in the UUID format.", alias="transactionUUID") - created: datetime = Field(description="Date and time the loyalty card transaction occurred.") - program_id: StrictInt = Field(description="ID of the loyalty program.", alias="programId") - card_identifier: Annotated[str, Field(min_length=4, strict=True, max_length=108)] = Field(description="The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. ", alias="cardIdentifier") - customer_session_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="ID of the customer session where the transaction occurred.", alias="customerSessionId") - type: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Type of transaction. Possible values: - `addition`: Signifies added points. - `subtraction`: Signifies deducted points. ") - name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Name or reason of the loyalty ledger transaction.") - start_date: Annotated[str, Field(strict=True, max_length=64)] = Field(description="When points become active. Possible values: - `immediate`: Points are active immediately. - `on_action`: Points become active based on the customer's action. - a timestamp value: Points become active at a given date and time. ", alias="startDate") - expiry_date: StrictStr = Field(description="Date when points expire. Possible values are: - `unlimited`: Points have no expiration date. - `timestamp value`: Points expire on the given date. ", alias="expiryDate") - subledger_id: Annotated[str, Field(strict=True, max_length=64)] = Field(description="ID of the subledger.", alias="subledgerId") - amount: Union[StrictFloat, StrictInt] = Field(description="Amount of loyalty points added or deducted in the transaction.") - id: StrictInt = Field(description="ID of the loyalty ledger transaction.") - ruleset_id: Optional[StrictInt] = Field(default=None, description="The ID of the ruleset containing the rule that triggered this effect.", alias="rulesetId") - rule_name: Optional[StrictStr] = Field(default=None, description="The name of the rule that triggered this effect.", alias="ruleName") - 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") + transaction_uuid: StrictStr = Field(description="Unique identifier of the transaction in the UUID format.", alias="transactionUUID", json_schema_extra={"examples": ["ce59f12a-f53b-4014-a745-636d93f2bd3f"]}) + created: datetime = Field(description="Date and time the loyalty card transaction occurred.", json_schema_extra={"examples": ["2022-01-02T15:04:05Z07:00"]}) + program_id: StrictInt = Field(description="ID of the loyalty program.", alias="programId", json_schema_extra={"examples": [324]}) + card_identifier: Annotated[str, Field(min_length=4, strict=True, max_length=108)] = Field(description="The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. ", alias="cardIdentifier", json_schema_extra={"examples": ["summer-loyalty-card-0543"]}) + customer_session_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="ID of the customer session where the transaction occurred.", alias="customerSessionId", json_schema_extra={"examples": ["05c2da0d-48fa-4aa1-b629-898f58f1584d"]}) + type: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Type of transaction. Possible values: - `addition`: Signifies added points. - `subtraction`: Signifies deducted points. ", json_schema_extra={"examples": ["addition"]}) + name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Name or reason of the loyalty ledger transaction.", json_schema_extra={"examples": ["Reward 10% points of a purchase's current total"]}) + start_date: Annotated[str, Field(strict=True, max_length=64)] = Field(description="When points become active. Possible values: - `immediate`: Points are active immediately. - `on_action`: Points become active based on the customer's action. - a timestamp value: Points become active at a given date and time. ", alias="startDate", json_schema_extra={"examples": ["2022-01-02T15:04:05Z07:00"]}) + expiry_date: StrictStr = Field(description="Date when points expire. Possible values are: - `unlimited`: Points have no expiration date. - `timestamp value`: Points expire on the given date. ", alias="expiryDate", json_schema_extra={"examples": ["2022-08-02T15:04:05Z07:00"]}) + subledger_id: Annotated[str, Field(strict=True, max_length=64)] = Field(description="ID of the subledger.", alias="subledgerId", json_schema_extra={"examples": ["sub-123"]}) + amount: Union[StrictFloat, StrictInt] = Field(description="Amount of loyalty points added or deducted in the transaction.", json_schema_extra={"examples": [10.25]}) + id: StrictInt = Field(description="ID of the loyalty ledger transaction.", json_schema_extra={"examples": [123]}) + ruleset_id: Optional[StrictInt] = Field(default=None, description="The ID of the ruleset containing the rule that triggered this effect.", alias="rulesetId", json_schema_extra={"examples": [11]}) + rule_name: Optional[StrictStr] = Field(default=None, description="The name of the rule that triggered this effect.", alias="ruleName", json_schema_extra={"examples": ["Add 2 points"]}) + 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') diff --git a/talon_one/models/cart_item.py b/talon_one/models/cart_item.py index 2cf6fe1..46b2124 100644 --- a/talon_one/models/cart_item.py +++ b/talon_one/models/cart_item.py @@ -33,27 +33,27 @@ class CartItem(BaseModel): """ CartItem """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="Name of item.") - sku: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Stock keeping unit of item.") - quantity: Annotated[int, Field(strict=True, ge=1)] = Field(description="Number of units of this item. Due to [cart item flattening](https://docs.talon.one/docs/product/rules/understanding-cart-item-flattening), if you provide a quantity greater than 1, the item will be split in as many items as the provided quantity. This will impact the number of **per-item** effects triggered from your campaigns. ") - returned_quantity: Optional[StrictInt] = Field(default=None, description="Number of returned items, calculated internally based on returns of this item.", alias="returnedQuantity") - remaining_quantity: Optional[StrictInt] = Field(default=None, description="Remaining quantity of the item, calculated internally based on returns of this item.", alias="remainingQuantity") - price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price of the item in the currency defined by your Application. This field is required if this item is not part of a [catalog](https://docs.talon.one/docs/product/account/dev-tools/managing-cart-item-catalogs). If it is part of a catalog, setting a price here overrides the price from the catalog. ") - category: Optional[StrictStr] = Field(default=None, description="Type, group or model of the item.") + name: Optional[StrictStr] = Field(default=None, description="Name of item.", json_schema_extra={"examples": ["Air Glide"]}) + sku: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Stock keeping unit of item.", json_schema_extra={"examples": ["SKU1241028"]}) + quantity: Annotated[int, Field(strict=True, ge=1)] = Field(description="Number of units of this item. Due to [cart item flattening](https://docs.talon.one/docs/product/rules/understanding-cart-item-flattening), if you provide a quantity greater than 1, the item will be split in as many items as the provided quantity. This will impact the number of **per-item** effects triggered from your campaigns. ", json_schema_extra={"examples": [1]}) + returned_quantity: Optional[StrictInt] = Field(default=None, description="Number of returned items, calculated internally based on returns of this item.", alias="returnedQuantity", json_schema_extra={"examples": [1]}) + remaining_quantity: Optional[StrictInt] = Field(default=None, description="Remaining quantity of the item, calculated internally based on returns of this item.", alias="remainingQuantity", json_schema_extra={"examples": [1]}) + price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price of the item in the currency defined by your Application. This field is required if this item is not part of a [catalog](https://docs.talon.one/docs/product/account/dev-tools/managing-cart-item-catalogs). If it is part of a catalog, setting a price here overrides the price from the catalog. ", json_schema_extra={"examples": [99.99]}) + category: Optional[StrictStr] = Field(default=None, description="Type, group or model of the item.", json_schema_extra={"examples": ["shoes"]}) product: Optional[Product] = None - weight: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Weight of item in grams.") + weight: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Weight of item in grams.", json_schema_extra={"examples": [1130]}) height: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Height of item in mm.") width: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Width of item in mm.") length: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Length of item in mm.") position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Position of the Cart Item in the Cart (calculated internally).") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Use this property to set a value for the attributes of your choice. [Attributes](https://docs.talon.one/docs/dev/concepts/attributes) represent any information to attach to this cart item. Custom _cart item_ attributes must be created in the Campaign Manager before you set them with this property. **Note:** Any previously defined attributes that you do not include in the array will be removed. ") - additional_costs: Optional[Dict[str, AdditionalCost]] = Field(default=None, description="Use this property to set a value for the additional costs of this item, such as a shipping cost. They must be created in the Campaign Manager before you set them with this property. See [Managing additional costs](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs). ", alias="additionalCosts") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Use this property to set a value for the attributes of your choice. [Attributes](https://docs.talon.one/docs/dev/concepts/attributes) represent any information to attach to this cart item. Custom _cart item_ attributes must be created in the Campaign Manager before you set them with this property. **Note:** Any previously defined attributes that you do not include in the array will be removed. ", json_schema_extra={"examples": [{"image": "11.jpeg", "material": "leather"}]}) + additional_costs: Optional[Dict[str, AdditionalCost]] = Field(default=None, description="Use this property to set a value for the additional costs of this item, such as a shipping cost. They must be created in the Campaign Manager before you set them with this property. See [Managing additional costs](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs). ", alias="additionalCosts", json_schema_extra={"examples": [{"shipping": {"price": 9}}]}) catalog_item_id: Optional[StrictInt] = Field(default=None, description="The catalog item ID.", alias="catalogItemID") - 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") - adjustment_reference_id: Optional[UUID] = Field(default=None, description="The reference ID of the selected price adjustment for this cart item. Only returned if the selected price resulted from a price adjustment.", alias="adjustmentReferenceId") - adjustment_effective_from: Optional[datetime] = Field(default=None, description="The date and time from which the price adjustment is effective. Only returned if the selected price resulted from a price adjustment that contains this field.", alias="adjustmentEffectiveFrom") - adjustment_effective_until: Optional[datetime] = Field(default=None, description="The date and time until which the price adjustment is effective. Only returned if the selected price resulted from a price adjustment that contains this field.", alias="adjustmentEffectiveUntil") - prices: Optional[Dict[str, PriceDetail]] = Field(default=None, description="A map of keys and values representing the price types and related price adjustment details for this cart item. The keys correspond to the `priceType` names. ") + 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"]}) + adjustment_reference_id: Optional[UUID] = Field(default=None, description="The reference ID of the selected price adjustment for this cart item. Only returned if the selected price resulted from a price adjustment.", alias="adjustmentReferenceId", json_schema_extra={"examples": ["68851723-e6fa-488f-ace9-112581e6c19b"]}) + adjustment_effective_from: Optional[datetime] = Field(default=None, description="The date and time from which the price adjustment is effective. Only returned if the selected price resulted from a price adjustment that contains this field.", alias="adjustmentEffectiveFrom", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + adjustment_effective_until: Optional[datetime] = Field(default=None, description="The date and time until which the price adjustment is effective. Only returned if the selected price resulted from a price adjustment that contains this field.", alias="adjustmentEffectiveUntil", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + prices: Optional[Dict[str, PriceDetail]] = Field(default=None, description="A map of keys and values representing the price types and related price adjustment details for this cart item. The keys correspond to the `priceType` names. ", json_schema_extra={"examples": [{"member": {"price": 90, "adjustmentReferenceId": "68851723-e6fa-488f-ace9-112581e6c19b", "effectiveFrom": "2025-05-25T00:00:00Z", "effectiveUntil": "2025-05-30T00:00:00Z"}, "base": {"price": 100}}]}) __properties: ClassVar[List[str]] = ["name", "sku", "quantity", "returnedQuantity", "remainingQuantity", "price", "category", "product", "weight", "height", "width", "length", "position", "attributes", "additionalCosts", "catalogItemID", "selectedPriceType", "adjustmentReferenceId", "adjustmentEffectiveFrom", "adjustmentEffectiveUntil", "prices"] model_config = ConfigDict( diff --git a/talon_one/models/cart_item_filter_template.py b/talon_one/models/cart_item_filter_template.py index 0352577..7ce1bae 100644 --- a/talon_one/models/cart_item_filter_template.py +++ b/talon_one/models/cart_item_filter_template.py @@ -27,8 +27,8 @@ class CartItemFilterTemplate(BaseModel): """ A cart item filter template stored in a library entry. Cart item filters in library entries only contain name (no description, as description is at the library entry level). """ # noqa: E501 - name: StrictStr = Field(description="The name of the Application cart item filter.") - expression: List[Any] = Field(description="The Talang expression for the cart item filter.") + name: StrictStr = Field(description="The name of the Application cart item filter.", json_schema_extra={"examples": ["Filter items by product"]}) + expression: List[Any] = Field(description="The Talang expression for the cart item filter.", json_schema_extra={"examples": [["filter", [".", "Session", "CartItems"], [["Item"], ["catch", False, ["=", [".", "Item", "Category"], "Kitchen"]]]]]}) __properties: ClassVar[List[str]] = ["name", "expression"] model_config = ConfigDict( diff --git a/talon_one/models/catalog.py b/talon_one/models/catalog.py index bdc38e9..3b74542 100644 --- a/talon_one/models/catalog.py +++ b/talon_one/models/catalog.py @@ -28,15 +28,15 @@ class Catalog(BaseModel): """ Catalog """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - modified: datetime = Field(description="The time this entity was last modified.") - name: StrictStr = Field(description="The cart item catalog name.") - description: StrictStr = Field(description="A description of this cart item catalog.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications that are subscribed to this catalog.", alias="subscribedApplicationsIds") - version: StrictInt = Field(description="The current version of this catalog.") - created_by: StrictInt = Field(description="The ID of user who created this catalog.", alias="createdBy") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + modified: datetime = Field(description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + name: StrictStr = Field(description="The cart item catalog name.", json_schema_extra={"examples": ["seafood"]}) + description: StrictStr = Field(description="A description of this cart item catalog.", json_schema_extra={"examples": ["seafood catalog"]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications that are subscribed to this catalog.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[1, 2, 3]]}) + version: StrictInt = Field(description="The current version of this catalog.", json_schema_extra={"examples": [6]}) + created_by: StrictInt = Field(description="The ID of user who created this catalog.", alias="createdBy", json_schema_extra={"examples": [6]}) __properties: ClassVar[List[str]] = ["id", "created", "accountId", "modified", "name", "description", "subscribedApplicationsIds", "version", "createdBy"] model_config = ConfigDict( diff --git a/talon_one/models/catalog_action.py b/talon_one/models/catalog_action.py index 91eff45..1ac6fcc 100644 --- a/talon_one/models/catalog_action.py +++ b/talon_one/models/catalog_action.py @@ -27,7 +27,7 @@ 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.") + type: StrictStr = Field(description="The type of sync action.", json_schema_extra={"examples": ["ADD"]}) payload: Dict[str, Any] __properties: ClassVar[List[str]] = ["type", "payload"] diff --git a/talon_one/models/catalog_item.py b/talon_one/models/catalog_item.py index bb9edfa..1089f7b 100644 --- a/talon_one/models/catalog_item.py +++ b/talon_one/models/catalog_item.py @@ -31,12 +31,12 @@ class CatalogItem(BaseModel): """ CatalogItem """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - sku: StrictStr = Field(description="The stock keeping unit of the item.") - price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price of the item.") - catalogid: StrictInt = Field(description="The ID of the catalog the item belongs to.") - version: Annotated[int, Field(strict=True, ge=1)] = Field(description="The version of the catalog item.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + sku: StrictStr = Field(description="The stock keeping unit of the item.", json_schema_extra={"examples": ["SKU1241028"]}) + price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price of the item.", json_schema_extra={"examples": [99.99]}) + catalogid: StrictInt = Field(description="The ID of the catalog the item belongs to.", json_schema_extra={"examples": [6]}) + version: Annotated[int, Field(strict=True, ge=1)] = Field(description="The version of the catalog item.", json_schema_extra={"examples": [5]}) attributes: Optional[List[ItemAttribute]] = None product: Optional[Product] = None __properties: ClassVar[List[str]] = ["id", "created", "sku", "price", "catalogid", "version", "attributes", "product"] diff --git a/talon_one/models/catalog_rule.py b/talon_one/models/catalog_rule.py index 545982a..6ea79f4 100644 --- a/talon_one/models/catalog_rule.py +++ b/talon_one/models/catalog_rule.py @@ -29,10 +29,10 @@ class CatalogRule(BaseModel): """ A rule template stored in a catalog entry. Rules in catalog entries only contain title (no description, as description is at the catalog entry level). """ # noqa: E501 - title: StrictStr = Field(description="A short description of the rule.") + title: StrictStr = Field(description="A short description of the rule.", json_schema_extra={"examples": ["Give discount via coupon"]}) bindings: Optional[List[Binding]] = Field(default=None, description="An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.") - condition: Annotated[List[Any], Field(min_length=1)] = Field(description="A Talang expression that will be evaluated in the context of the given event.") - effects: List[Dict[str, Any]] = Field(description="An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.") + condition: Annotated[List[Any], Field(min_length=1)] = Field(description="A Talang expression that will be evaluated in the context of the given event.", json_schema_extra={"examples": [["and", ["couponValid"]]]}) + effects: List[Dict[str, Any]] = Field(description="An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.", json_schema_extra={"examples": [["catch", ["noop"], ["setDiscount", "10% off", ["*", [".", "Session", "Total"], ["/", 10, 100]]]]]}) __properties: ClassVar[List[str]] = ["title", "bindings", "condition", "effects"] model_config = ConfigDict( diff --git a/talon_one/models/catalog_sync_request.py b/talon_one/models/catalog_sync_request.py index 56da4e7..cf658e3 100644 --- a/talon_one/models/catalog_sync_request.py +++ b/talon_one/models/catalog_sync_request.py @@ -30,7 +30,7 @@ class CatalogSyncRequest(BaseModel): CatalogSyncRequest """ # noqa: E501 actions: Annotated[List[CatalogAction], Field(min_length=1, max_length=1000)] - version: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="The version number of the catalog to apply the actions on.") + version: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="The version number of the catalog to apply the actions on.", json_schema_extra={"examples": [244]}) __properties: ClassVar[List[str]] = ["actions", "version"] model_config = ConfigDict( diff --git a/talon_one/models/catalogs_strikethrough_notification_policy.py b/talon_one/models/catalogs_strikethrough_notification_policy.py index 704f84f..fef88ac 100644 --- a/talon_one/models/catalogs_strikethrough_notification_policy.py +++ b/talon_one/models/catalogs_strikethrough_notification_policy.py @@ -28,9 +28,9 @@ class CatalogsStrikethroughNotificationPolicy(BaseModel): """ CatalogsStrikethroughNotificationPolicy """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.", json_schema_extra={"examples": ["Christmas Sale"]}) ahead_of_days_trigger: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="The number of days in advance that strikethrough pricing updates should be sent.", alias="aheadOfDaysTrigger") - batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data.", alias="batchSize") + batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data.", alias="batchSize", json_schema_extra={"examples": [1000]}) __properties: ClassVar[List[str]] = ["name", "aheadOfDaysTrigger", "batchSize"] model_config = ConfigDict( diff --git a/talon_one/models/change.py b/talon_one/models/change.py index 57711e5..8666a3c 100644 --- a/talon_one/models/change.py +++ b/talon_one/models/change.py @@ -28,14 +28,14 @@ class Change(BaseModel): """ Change """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - user_id: StrictInt = Field(description="The ID of the user associated with this entity.", alias="userId") - application_id: Optional[StrictInt] = Field(default=None, description="ID of application associated with change.", alias="applicationId") - entity: StrictStr = Field(description="API endpoint on which the change was initiated.") - old: Optional[Dict[str, Any]] = Field(default=None, description="Resource before the change occurred.") - new: Optional[Dict[str, Any]] = Field(default=None, description="Resource after the change occurred.") - management_key_id: Optional[StrictInt] = Field(default=None, description="ID of management key used to perform changes.", alias="managementKeyId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + 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.") + 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"] model_config = ConfigDict( diff --git a/talon_one/models/change_loyalty_tier_level_effect_props.py b/talon_one/models/change_loyalty_tier_level_effect_props.py index fc57f70..6d8f31f 100644 --- a/talon_one/models/change_loyalty_tier_level_effect_props.py +++ b/talon_one/models/change_loyalty_tier_level_effect_props.py @@ -26,11 +26,11 @@ class ChangeLoyaltyTierLevelEffectProps(BaseModel): """ - The properties specific to the \"changeLoyaltyTierLevel\" effect. This is triggered whenever the user's loyalty tier is upgraded due to a validated rule that contained an \"addLoyaltyPoints\" effect. + This effect indicates that a customer's loyalty tier has been upgraded. This effect is generated only when the [Add loyalty points](https://docs.talon.one/docs/product/rules/effects/use-effects#add-loyalty-points) and the [Add loyalty points per cart item](https://docs.talon.one/docs/product/rules/effects/use-effects#add-loyalty-points-per-cart-item) effects are triggered for a particular customer, and, as a result, the customer's loyalty tier is upgraded. """ # noqa: E501 rule_title: StrictStr = Field(description="The title of the rule that triggered the tier upgrade.", alias="ruleTitle") - program_id: StrictInt = Field(description="The ID of the loyalty program where these points were added.", alias="programId") - sub_ledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were added.", alias="subLedgerId") + program_id: StrictInt = Field(description="The ID of the loyalty program where the points were added.", alias="programId") + sub_ledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where the points were added.", alias="subLedgerId") previous_tier_name: Optional[StrictStr] = Field(default=None, description="The name of the tier from which the user was upgraded.", alias="previousTierName") new_tier_name: StrictStr = Field(description="The name of the tier to which the user has been upgraded.", alias="newTierName") expiry_date: Optional[datetime] = Field(default=None, description="The expiration date of the new tier.", alias="expiryDate") diff --git a/talon_one/models/change_profile_password.py b/talon_one/models/change_profile_password.py index b3f35d4..8dffdd8 100644 --- a/talon_one/models/change_profile_password.py +++ b/talon_one/models/change_profile_password.py @@ -27,8 +27,8 @@ class ChangeProfilePassword(BaseModel): """ ChangeProfilePassword """ # noqa: E501 - password: StrictStr = Field(description="Your old password.") - new_password: StrictStr = Field(description="Your new password.", alias="newPassword") + password: StrictStr = Field(description="Your old password.", json_schema_extra={"examples": ["Admin&12943!7"]}) + new_password: StrictStr = Field(description="Your new password.", alias="newPassword", json_schema_extra={"examples": ["Admin*4552$70"]}) __properties: ClassVar[List[str]] = ["password", "newPassword"] model_config = ConfigDict( diff --git a/talon_one/models/code_generator_settings.py b/talon_one/models/code_generator_settings.py index cdaf033..6015ec0 100644 --- a/talon_one/models/code_generator_settings.py +++ b/talon_one/models/code_generator_settings.py @@ -28,8 +28,8 @@ class CodeGeneratorSettings(BaseModel): """ CodeGeneratorSettings """ # noqa: E501 - valid_characters: List[StrictStr] = Field(description="List of characters used to generate the random parts of a code. ", alias="validCharacters") - 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") + valid_characters: List[StrictStr] = Field(description="List of characters used to generate the random parts of a code. ", 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", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]}) + 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') diff --git a/talon_one/models/collection.py b/talon_one/models/collection.py index 8df4429..a49d976 100644 --- a/talon_one/models/collection.py +++ b/talon_one/models/collection.py @@ -29,18 +29,18 @@ class Collection(BaseModel): """ Collection """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - modified: datetime = Field(description="The time this entity was last modified.") - description: Optional[StrictStr] = Field(default=None, description="A short description of the purpose of this collection.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications where this collection is enabled.", alias="subscribedApplicationsIds") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this collection.") - modified_by: Optional[StrictInt] = Field(default=None, description="ID of the user who last updated this effect if available.", alias="modifiedBy") - created_by: StrictInt = Field(description="ID of the user who created this effect.", alias="createdBy") - application_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application that owns this entity.", alias="applicationId") - campaign_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign that owns this entity.", alias="campaignId") - payload: Optional[Annotated[List[StrictStr], Field(max_length=50)]] = Field(default=None, description="The content of the collection.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + modified: datetime = Field(description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + description: Optional[StrictStr] = Field(default=None, description="A short description of the purpose of this collection.", json_schema_extra={"examples": ["My collection of SKUs"]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications where this collection is enabled.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[1, 2, 3]]}) + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this collection.", json_schema_extra={"examples": ["My collection"]}) + modified_by: Optional[StrictInt] = Field(default=None, description="ID of the user who last updated this effect if available.", alias="modifiedBy", json_schema_extra={"examples": [48]}) + created_by: StrictInt = Field(description="ID of the user who created this effect.", alias="createdBy", json_schema_extra={"examples": [134]}) + application_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [1]}) + campaign_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign that owns this entity.", alias="campaignId", json_schema_extra={"examples": [7]}) + 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') diff --git a/talon_one/models/collection_without_payload.py b/talon_one/models/collection_without_payload.py index fbe6e8c..1c79a03 100644 --- a/talon_one/models/collection_without_payload.py +++ b/talon_one/models/collection_without_payload.py @@ -29,17 +29,17 @@ class CollectionWithoutPayload(BaseModel): """ CollectionWithoutPayload """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - modified: datetime = Field(description="The time this entity was last modified.") - description: Optional[StrictStr] = Field(default=None, description="A short description of the purpose of this collection.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications where this collection is enabled.", alias="subscribedApplicationsIds") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this collection.") - modified_by: Optional[StrictInt] = Field(default=None, description="ID of the user who last updated this effect if available.", alias="modifiedBy") - created_by: StrictInt = Field(description="ID of the user who created this effect.", alias="createdBy") - application_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application that owns this entity.", alias="applicationId") - campaign_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign that owns this entity.", alias="campaignId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + modified: datetime = Field(description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + description: Optional[StrictStr] = Field(default=None, description="A short description of the purpose of this collection.", json_schema_extra={"examples": ["My collection of SKUs"]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications where this collection is enabled.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[1, 2, 3]]}) + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this collection.", json_schema_extra={"examples": ["My collection"]}) + modified_by: Optional[StrictInt] = Field(default=None, description="ID of the user who last updated this effect if available.", alias="modifiedBy", json_schema_extra={"examples": [48]}) + created_by: StrictInt = Field(description="ID of the user who created this effect.", alias="createdBy", json_schema_extra={"examples": [134]}) + application_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [1]}) + 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') diff --git a/talon_one/models/coupon.py b/talon_one/models/coupon.py index 1f250fc..2831f5e 100644 --- a/talon_one/models/coupon.py +++ b/talon_one/models/coupon.py @@ -30,28 +30,28 @@ class Coupon(BaseModel): """ Coupon """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of the coupon.") - created: datetime = Field(description="The time the coupon was created.") - campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId") - value: Optional[Annotated[str, Field(min_length=4, strict=True)]] = Field(default=None, description="The coupon code.") - usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit") - discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit") - 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") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the coupon. Coupon never expires if this is omitted.", alias="expiryDate") + id: StrictInt = Field(description="The internal ID of the coupon.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time the coupon was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId", json_schema_extra={"examples": [211]}) + value: Optional[Annotated[str, Field(min_length=4, strict=True)]] = Field(default=None, description="The coupon code.", json_schema_extra={"examples": ["XMAS-20-2021"]}) + usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit", json_schema_extra={"examples": [100]}) + discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit", json_schema_extra={"examples": [30]}) + 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"]}) 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. ") - usage_counter: StrictInt = Field(description="The number of times the coupon has been successfully redeemed.", alias="usageCounter") - discount_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.", alias="discountCounter") - discount_remainder: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The remaining discount this coupon can give.", alias="discountRemainder") - reservation_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of times this coupon has been reserved.", alias="reservationCounter") + usage_counter: StrictInt = Field(description="The number of times the coupon has been successfully redeemed.", alias="usageCounter", json_schema_extra={"examples": [10]}) + discount_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.", alias="discountCounter", json_schema_extra={"examples": [10]}) + discount_remainder: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The remaining discount this coupon can give.", alias="discountRemainder", json_schema_extra={"examples": [5]}) + reservation_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of times this coupon has been reserved.", alias="reservationCounter", json_schema_extra={"examples": [1]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="Custom attributes associated with this coupon.") - referral_id: Optional[StrictInt] = Field(default=None, description="The integration ID of the referring customer (if any) for whom this coupon was created as an effect.", alias="referralId") - recipient_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The Integration ID of the customer that is allowed to redeem this coupon.", alias="recipientIntegrationId") - import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this coupon.", alias="importId") - reservation: Optional[StrictBool] = Field(default=True, description="Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code. ") - batch_id: Optional[StrictStr] = Field(default=None, description="The id of the batch the coupon belongs to.", alias="batchId") - 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") - implicitly_reserved: Optional[StrictBool] = Field(default=None, description="An indication of whether the coupon is implicitly reserved for all customers.", alias="implicitlyReserved") + referral_id: Optional[StrictInt] = Field(default=None, description="The integration ID of the referring customer (if any) for whom this coupon was created as an effect.", alias="referralId", json_schema_extra={"examples": [326632952]}) + recipient_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The Integration ID of the customer that is allowed to redeem this coupon.", alias="recipientIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this coupon.", alias="importId", json_schema_extra={"examples": [4]}) + reservation: Optional[StrictBool] = Field(default=True, description="Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code. ", json_schema_extra={"examples": [False]}) + batch_id: Optional[StrictStr] = Field(default=None, description="The id of the batch the coupon belongs to.", alias="batchId", json_schema_extra={"examples": ["32535-43255"]}) + 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]] = ["id", "created", "campaignId", "value", "usageLimit", "discountLimit", "reservationLimit", "startDate", "expiryDate", "limits", "usageCounter", "discountCounter", "discountRemainder", "reservationCounter", "attributes", "referralId", "recipientIntegrationId", "importId", "reservation", "batchId", "isReservationMandatory", "implicitlyReserved"] model_config = ConfigDict( diff --git a/talon_one/models/coupon_constraints.py b/talon_one/models/coupon_constraints.py index b221242..0333f53 100644 --- a/talon_one/models/coupon_constraints.py +++ b/talon_one/models/coupon_constraints.py @@ -29,11 +29,11 @@ class CouponConstraints(BaseModel): """ CouponConstraints """ # noqa: E501 - usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit") - discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit") - 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") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the coupon. Coupon never expires if this is omitted.", alias="expiryDate") + usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit", json_schema_extra={"examples": [100]}) + discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit", json_schema_extra={"examples": [30]}) + 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"]}) __properties: ClassVar[List[str]] = ["usageLimit", "discountLimit", "reservationLimit", "startDate", "expiryDate"] model_config = ConfigDict( diff --git a/talon_one/models/coupon_created_effect_props.py b/talon_one/models/coupon_created_effect_props.py index 5b9adea..5ba4898 100644 --- a/talon_one/models/coupon_created_effect_props.py +++ b/talon_one/models/coupon_created_effect_props.py @@ -25,7 +25,7 @@ class CouponCreatedEffectProps(BaseModel): """ - The properties specific to the \"couponCreated\" effect. This gets triggered whenever a validated rule contained a \"create coupon\" effect, and a coupon was created for a customer. See \"createdCoupons\" on the response for all details of this coupon. + This effect indicates that a coupon was created. For referrals and retention marketing, a common use case is to generate a coupon that can only be redeemed by one specific customer. Handle this effect by notifying the recipient about their new coupon code. """ # noqa: E501 value: StrictStr = Field(description="The coupon code that was created.") profile_id: StrictStr = Field(description="The integration identifier of the customer for whom this coupon was created.", alias="profileId") diff --git a/talon_one/models/coupon_creation_job.py b/talon_one/models/coupon_creation_job.py index b7b01bb..007ee08 100644 --- a/talon_one/models/coupon_creation_job.py +++ b/talon_one/models/coupon_creation_job.py @@ -30,29 +30,29 @@ class CouponCreationJob(BaseModel): """ CouponCreationJob """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId") - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - usage_limit: Annotated[int, Field(le=999999, strict=True, ge=0)] = Field(description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit") - discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit") - 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") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the coupon. Coupon never expires if this is omitted.", alias="expiryDate") - 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") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId", json_schema_extra={"examples": [211]}) + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + usage_limit: Annotated[int, Field(le=999999, strict=True, ge=0)] = Field(description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit", json_schema_extra={"examples": [100]}) + discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit", json_schema_extra={"examples": [30]}) + 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"]}) + 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 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") - batch_id: StrictStr = Field(description="The batch ID coupons created by this job will bear.", alias="batchId") - status: StrictStr = Field(description="The current status of this request. Possible values: - `pending verification` - `pending` - `completed` - `failed` - `coupon pattern full` ") - created_amount: StrictInt = Field(description="The number of coupon codes that were already created for this request.", alias="createdAmount") - fail_count: StrictInt = Field(description="The number of times this job failed.", alias="failCount") - errors: List[StrictStr] = Field(description="An array of individual problems encountered during the request.") - created_by: StrictInt = Field(description="ID of the user who created this effect.", alias="createdBy") - communicated: StrictBool = Field(description="Whether or not the user that created this job was notified of its final state.") - chunk_execution_count: StrictInt = Field(description="The number of times an attempt to create a chunk of coupons was made during the processing of the job.", alias="chunkExecutionCount") - chunk_size: Optional[StrictInt] = Field(default=None, description="The number of coupons that will be created in a single transactions. Coupons will be created in chunks until arriving at the requested amount.", alias="chunkSize") + attributes: Dict[str, Any] = Field(description="Arbitrary properties associated with this campaign.") + 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"]}) + created_amount: StrictInt = Field(description="The number of coupon codes that were already created for this request.", alias="createdAmount", json_schema_extra={"examples": [1000000]}) + fail_count: StrictInt = Field(description="The number of times this job failed.", alias="failCount", json_schema_extra={"examples": [10]}) + errors: List[StrictStr] = Field(description="An array of individual problems encountered during the request.", json_schema_extra={"examples": [["Connection to database was reset", "failed to generate enough unique codes", "attribute 'PizzaLover' not found on entity 'Coupons'"]]}) + created_by: StrictInt = Field(description="ID of the user who created this effect.", alias="createdBy", json_schema_extra={"examples": [1]}) + communicated: StrictBool = Field(description="Whether or not the user that created this job was notified of its final state.", json_schema_extra={"examples": [False]}) + chunk_execution_count: StrictInt = Field(description="The number of times an attempt to create a chunk of coupons was made during the processing of the job.", alias="chunkExecutionCount", json_schema_extra={"examples": [0]}) + chunk_size: Optional[StrictInt] = Field(default=None, description="The number of coupons that will be created in a single transactions. Coupons will be created in chunks until arriving at the requested amount.", alias="chunkSize", json_schema_extra={"examples": [20000]}) __properties: ClassVar[List[str]] = ["id", "created", "campaignId", "applicationId", "accountId", "usageLimit", "discountLimit", "reservationLimit", "startDate", "expiryDate", "numberOfCoupons", "couponSettings", "attributes", "isReservationMandatory", "batchId", "status", "createdAmount", "failCount", "errors", "createdBy", "communicated", "chunkExecutionCount", "chunkSize"] model_config = ConfigDict( diff --git a/talon_one/models/coupon_deletion_job.py b/talon_one/models/coupon_deletion_job.py index 26130d6..9af8514 100644 --- a/talon_one/models/coupon_deletion_job.py +++ b/talon_one/models/coupon_deletion_job.py @@ -29,17 +29,17 @@ class CouponDeletionJob(BaseModel): """ CouponDeletionJob """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) filters: CouponDeletionFilters - status: StrictStr = Field(description="The current status of this request. Possible values: - `not_ready` - `pending` - `completed` - `failed` ") - deleted_amount: Optional[StrictInt] = Field(default=None, description="The number of coupon codes that were already deleted for this request.", alias="deletedAmount") - fail_count: StrictInt = Field(description="The number of times this job failed.", alias="failCount") - errors: List[StrictStr] = Field(description="An array of individual problems encountered during the request.") - created_by: StrictInt = Field(description="ID of the user who created this effect.", alias="createdBy") - communicated: StrictBool = Field(description="Indicates whether the user that created this job was notified of its final state.") + status: StrictStr = Field(description="The current status of this request. Possible values: - `not_ready` - `pending` - `completed` - `failed` ", json_schema_extra={"examples": ["pending"]}) + deleted_amount: Optional[StrictInt] = Field(default=None, description="The number of coupon codes that were already deleted for this request.", alias="deletedAmount", json_schema_extra={"examples": [1000000]}) + fail_count: StrictInt = Field(description="The number of times this job failed.", alias="failCount", json_schema_extra={"examples": [10]}) + errors: List[StrictStr] = Field(description="An array of individual problems encountered during the request.", json_schema_extra={"examples": [["Connection to database was reset", "failed to delete codes"]]}) + created_by: StrictInt = Field(description="ID of the user who created this effect.", alias="createdBy", json_schema_extra={"examples": [1]}) + communicated: StrictBool = Field(description="Indicates whether the user that created this job was notified of its final state.", json_schema_extra={"examples": [False]}) campaign_ids: Optional[List[StrictInt]] = Field(default=None, alias="campaignIDs") __properties: ClassVar[List[str]] = ["id", "created", "applicationId", "accountId", "filters", "status", "deletedAmount", "failCount", "errors", "createdBy", "communicated", "campaignIDs"] diff --git a/talon_one/models/coupon_entity.py b/talon_one/models/coupon_entity.py index dbf9d16..6e13625 100644 --- a/talon_one/models/coupon_entity.py +++ b/talon_one/models/coupon_entity.py @@ -28,8 +28,8 @@ class CouponEntity(BaseModel): """ CouponEntity """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of the coupon.") - created: datetime = Field(description="The time the coupon was created.") + id: StrictInt = Field(description="The internal ID of the coupon.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time the coupon was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) __properties: ClassVar[List[str]] = ["id", "created"] model_config = ConfigDict( diff --git a/talon_one/models/coupon_failure_summary.py b/talon_one/models/coupon_failure_summary.py index e8e7192..d42bb40 100644 --- a/talon_one/models/coupon_failure_summary.py +++ b/talon_one/models/coupon_failure_summary.py @@ -28,16 +28,16 @@ class CouponFailureSummary(BaseModel): """ Summary of the reasons for coupon redemption failure. """ # noqa: E501 - id: StrictInt = Field(description="ID of the evaluation record.") - event_id: StrictInt = Field(description="ID of the event.", alias="eventID") - session_id: Optional[StrictStr] = Field(default=None, description="ID of the customer session set by your integration layer.", alias="sessionID") - profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer.", alias="profileID") - status: StrictStr = Field(description="Status defines if the coupon code was applied or rejected.") - coupon_code: StrictStr = Field(description="Coupon code passed for evaluation.", alias="couponCode") - language: StrictStr = Field(description="Language of the summary.") - summary: StrictStr = Field(description="A summary of the reasons for coupon redemption failure.") - created_at: datetime = Field(description="Timestamp when the request was made.", alias="createdAt") - updated_at: datetime = Field(description="Timestamp when the request was last updated.", alias="updatedAt") + id: StrictInt = Field(description="ID of the evaluation record.", json_schema_extra={"examples": [1]}) + event_id: StrictInt = Field(description="ID of the event.", alias="eventID", json_schema_extra={"examples": [1011]}) + session_id: Optional[StrictStr] = Field(default=None, description="ID of the customer session set by your integration layer.", alias="sessionID", json_schema_extra={"examples": [1]}) + profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer.", alias="profileID", json_schema_extra={"examples": ["a48f10dddb5c9493aad194e49bb9c1dac"]}) + status: StrictStr = Field(description="Status defines if the coupon code was applied or rejected.", json_schema_extra={"examples": ["rejected"]}) + coupon_code: StrictStr = Field(description="Coupon code passed for evaluation.", alias="couponCode", json_schema_extra={"examples": ["ABC123"]}) + language: StrictStr = Field(description="Language of the summary.", json_schema_extra={"examples": ["en"]}) + summary: StrictStr = Field(description="A summary of the reasons for coupon redemption failure.", json_schema_extra={"examples": ["Session total was less than the required total."]}) + created_at: datetime = Field(description="Timestamp when the request was made.", alias="createdAt", json_schema_extra={"examples": ["2021-07-20T21:59:00Z"]}) + updated_at: datetime = Field(description="Timestamp when the request was last updated.", alias="updatedAt", json_schema_extra={"examples": ["2021-07-20T21:59:00Z"]}) __properties: ClassVar[List[str]] = ["id", "eventID", "sessionID", "profileID", "status", "couponCode", "language", "summary", "createdAt", "updatedAt"] model_config = ConfigDict( diff --git a/talon_one/models/coupon_rejection_reason.py b/talon_one/models/coupon_rejection_reason.py index c39bfa8..7dda6fd 100644 --- a/talon_one/models/coupon_rejection_reason.py +++ b/talon_one/models/coupon_rejection_reason.py @@ -27,9 +27,9 @@ class CouponRejectionReason(BaseModel): """ Holds a reference to the campaign, the coupon and the reason for which that coupon was rejected. Should only be present when there is a 'rejectCoupon' effect. """ # noqa: E501 - campaign_id: StrictInt = Field(alias="campaignId") - coupon_id: StrictInt = Field(alias="couponId") - reason: StrictStr + campaign_id: StrictInt = Field(alias="campaignId", json_schema_extra={"examples": [244]}) + coupon_id: StrictInt = Field(alias="couponId", json_schema_extra={"examples": [4928]}) + reason: StrictStr = Field(json_schema_extra={"examples": ["CouponNotFound"]}) __properties: ClassVar[List[str]] = ["campaignId", "couponId", "reason"] @field_validator('reason') diff --git a/talon_one/models/coupon_reservations.py b/talon_one/models/coupon_reservations.py index c39d135..afcfe67 100644 --- a/talon_one/models/coupon_reservations.py +++ b/talon_one/models/coupon_reservations.py @@ -28,7 +28,7 @@ class CouponReservations(BaseModel): """ CouponReservations """ # noqa: E501 - integration_ids: Annotated[List[StrictStr], Field(max_length=1000)] = Field(description="List of customer integration IDs.", alias="integrationIDs") + integration_ids: Annotated[List[StrictStr], Field(max_length=1000)] = Field(description="List of customer integration IDs.", alias="integrationIDs", json_schema_extra={"examples": [["URNGV8294NV", "BZGGC2454PA"]]}) __properties: ClassVar[List[str]] = ["integrationIDs"] model_config = ConfigDict( diff --git a/talon_one/models/coupon_value.py b/talon_one/models/coupon_value.py index 1eef2f8..888e4c0 100644 --- a/talon_one/models/coupon_value.py +++ b/talon_one/models/coupon_value.py @@ -28,7 +28,7 @@ class CouponValue(BaseModel): """ CouponValue """ # noqa: E501 - value: Optional[Annotated[str, Field(min_length=4, strict=True)]] = Field(default=None, description="The coupon code.") + value: Optional[Annotated[str, Field(min_length=4, strict=True)]] = Field(default=None, description="The coupon code.", json_schema_extra={"examples": ["XMAS-20-2021"]}) __properties: ClassVar[List[str]] = ["value"] model_config = ConfigDict( diff --git a/talon_one/models/coupon_with_application.py b/talon_one/models/coupon_with_application.py index 17ba099..231d7dd 100644 --- a/talon_one/models/coupon_with_application.py +++ b/talon_one/models/coupon_with_application.py @@ -30,30 +30,30 @@ class CouponWithApplication(BaseModel): """ CouponWithApplication """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of the coupon.") - created: datetime = Field(description="The time the coupon was created.") - campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId") - value: Optional[Annotated[str, Field(min_length=4, strict=True)]] = Field(default=None, description="The coupon code.") - usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit") - discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit") - 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") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the coupon. Coupon never expires if this is omitted.", alias="expiryDate") + id: StrictInt = Field(description="The internal ID of the coupon.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time the coupon was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId", json_schema_extra={"examples": [211]}) + value: Optional[Annotated[str, Field(min_length=4, strict=True)]] = Field(default=None, description="The coupon code.", json_schema_extra={"examples": ["XMAS-20-2021"]}) + usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit", json_schema_extra={"examples": [100]}) + discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit", json_schema_extra={"examples": [30]}) + 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"]}) 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. ") - usage_counter: StrictInt = Field(description="The number of times the coupon has been successfully redeemed.", alias="usageCounter") - discount_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.", alias="discountCounter") - discount_remainder: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The remaining discount this coupon can give.", alias="discountRemainder") - reservation_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of times this coupon has been reserved.", alias="reservationCounter") + usage_counter: StrictInt = Field(description="The number of times the coupon has been successfully redeemed.", alias="usageCounter", json_schema_extra={"examples": [10]}) + discount_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.", alias="discountCounter", json_schema_extra={"examples": [10]}) + discount_remainder: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The remaining discount this coupon can give.", alias="discountRemainder", json_schema_extra={"examples": [5]}) + reservation_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of times this coupon has been reserved.", alias="reservationCounter", json_schema_extra={"examples": [1]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="Custom attributes associated with this coupon.") - referral_id: Optional[StrictInt] = Field(default=None, description="The integration ID of the referring customer (if any) for whom this coupon was created as an effect.", alias="referralId") - recipient_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The Integration ID of the customer that is allowed to redeem this coupon.", alias="recipientIntegrationId") - import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this coupon.", alias="importId") - reservation: Optional[StrictBool] = Field(default=True, description="Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code. ") - batch_id: Optional[StrictStr] = Field(default=None, description="The id of the batch the coupon belongs to.", alias="batchId") - 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") - implicitly_reserved: Optional[StrictBool] = Field(default=None, description="An indication of whether the coupon is implicitly reserved for all customers.", alias="implicitlyReserved") - application_id: StrictInt = Field(description="The ID of the application.", alias="applicationId") - application_name: StrictStr = Field(description="Name of the Application that is connected to the coupon.", alias="applicationName") + referral_id: Optional[StrictInt] = Field(default=None, description="The integration ID of the referring customer (if any) for whom this coupon was created as an effect.", alias="referralId", json_schema_extra={"examples": [326632952]}) + recipient_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The Integration ID of the customer that is allowed to redeem this coupon.", alias="recipientIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this coupon.", alias="importId", json_schema_extra={"examples": [4]}) + reservation: Optional[StrictBool] = Field(default=True, description="Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code. ", json_schema_extra={"examples": [False]}) + batch_id: Optional[StrictStr] = Field(default=None, description="The id of the batch the coupon belongs to.", alias="batchId", json_schema_extra={"examples": ["32535-43255"]}) + 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]}) + application_id: StrictInt = Field(description="The ID of the application.", alias="applicationId", json_schema_extra={"examples": [123]}) + application_name: StrictStr = Field(description="Name of the Application that is connected to the coupon.", alias="applicationName", json_schema_extra={"examples": ["Test Application"]}) __properties: ClassVar[List[str]] = ["id", "created", "campaignId", "value", "usageLimit", "discountLimit", "reservationLimit", "startDate", "expiryDate", "limits", "usageCounter", "discountCounter", "discountRemainder", "reservationCounter", "attributes", "referralId", "recipientIntegrationId", "importId", "reservation", "batchId", "isReservationMandatory", "implicitlyReserved", "applicationId", "applicationName"] model_config = ConfigDict( diff --git a/talon_one/models/coupons_notification_data.py b/talon_one/models/coupons_notification_data.py index 19cf6dc..4e486aa 100644 --- a/talon_one/models/coupons_notification_data.py +++ b/talon_one/models/coupons_notification_data.py @@ -28,12 +28,12 @@ class CouponsNotificationData(BaseModel): """ CouponsNotificationData """ # noqa: E501 - type_of_change: StrictStr = Field(description="The type of change that occurred.", alias="TypeOfChange") - operation: StrictStr = Field(description="The operation performed.", alias="Operation") - employee_name: StrictStr = Field(description="The name of the employee associated with the operation.", alias="EmployeeName") + type_of_change: StrictStr = Field(description="The type of change that occurred.", alias="TypeOfChange", json_schema_extra={"examples": ["campaign_manager"]}) + operation: StrictStr = Field(description="The operation performed.", alias="Operation", json_schema_extra={"examples": ["CouponUpdated"]}) + employee_name: StrictStr = Field(description="The name of the employee associated with the operation.", alias="EmployeeName", json_schema_extra={"examples": ["Franziska Schneider"]}) data: Optional[List[ExtendedCoupon]] = Field(default=None, description="A list of extended coupon data.") - total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize") - notification_type: StrictStr = Field(description="The type of the notification", alias="NotificationType") + total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize", json_schema_extra={"examples": [1]}) + notification_type: StrictStr = Field(description="The type of the notification", alias="NotificationType", json_schema_extra={"examples": ["CouponUpdated"]}) __properties: ClassVar[List[str]] = ["TypeOfChange", "Operation", "EmployeeName", "data", "totalResultSize", "NotificationType"] @field_validator('notification_type') diff --git a/talon_one/models/coupons_notification_policy.py b/talon_one/models/coupons_notification_policy.py index cfc355e..7cc4d74 100644 --- a/talon_one/models/coupons_notification_policy.py +++ b/talon_one/models/coupons_notification_policy.py @@ -28,11 +28,11 @@ class CouponsNotificationPolicy(BaseModel): """ CouponsNotificationPolicy """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.", json_schema_extra={"examples": ["Christmas Sale"]}) scopes: Annotated[List[StrictStr], Field(min_length=1, max_length=4)] - batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled") - include_data: Optional[StrictBool] = Field(default=None, description="Indicates whether to include all generated coupons. If `false`, only the `batchId` of the generated coupons is included.", alias="includeData") - batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize") + batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled", json_schema_extra={"examples": [True]}) + include_data: Optional[StrictBool] = Field(default=None, description="Indicates whether to include all generated coupons. If `false`, only the `batchId` of the generated coupons is included.", alias="includeData", json_schema_extra={"examples": [True]}) + batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize", json_schema_extra={"examples": [1000]}) __properties: ClassVar[List[str]] = ["name", "scopes", "batchingEnabled", "includeData", "batchSize"] @field_validator('scopes') diff --git a/talon_one/models/create_achievement.py b/talon_one/models/create_achievement.py index a2c8648..a55886f 100644 --- a/talon_one/models/create_achievement.py +++ b/talon_one/models/create_achievement.py @@ -30,17 +30,17 @@ class CreateAchievement(BaseModel): """ CreateAchievement """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ") - title: StrictStr = Field(description="The display name for the achievement in the Campaign Manager.") - description: StrictStr = Field(description="A description of the achievement.") - target: Union[StrictFloat, StrictInt] = Field(description="The required number of actions or the transactional milestone to complete the achievement.") - period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ") + name: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ", json_schema_extra={"examples": ["Order50Discount"]}) + title: StrictStr = Field(description="The display name for the achievement in the Campaign Manager.", json_schema_extra={"examples": ["50% off on 50th purchase."]}) + description: StrictStr = Field(description="A description of the achievement.", json_schema_extra={"examples": ["50% off for every 50th purchase in a year."]}) + target: Union[StrictFloat, StrictInt] = Field(description="The required number of actions or the transactional milestone to complete the achievement.", json_schema_extra={"examples": [50]}) + period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ", json_schema_extra={"examples": ["1Y"]}) period_end_override: Optional[TimePoint] = Field(default=None, alias="periodEndOverride") - recurrence_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy") - activation_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy") - fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate") - end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate") - allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="allowRollbackAfterCompletion") + recurrence_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy", json_schema_extra={"examples": ["no_recurrence"]}) + activation_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy", json_schema_extra={"examples": ["fixed_schedule"]}) + fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate", json_schema_extra={"examples": ["2024-01-15T15:04:05Z07:00"]}) + end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate", json_schema_extra={"examples": ["2024-02-15T15:04:05Z07:00"]}) + 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') diff --git a/talon_one/models/create_achievement_v2.py b/talon_one/models/create_achievement_v2.py index 479f441..6c79df8 100644 --- a/talon_one/models/create_achievement_v2.py +++ b/talon_one/models/create_achievement_v2.py @@ -29,19 +29,19 @@ class CreateAchievementV2(BaseModel): """ CreateAchievementV2 """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ") - title: StrictStr = Field(description="The display name for the achievement in the Campaign Manager.") - description: StrictStr = Field(description="A description of the achievement.") - target: Union[StrictFloat, StrictInt] = Field(description="The required number of actions or the transactional milestone to complete the achievement.") - period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ") - recurrence_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy") - activation_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy") - fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate") - end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate") - allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="allowRollbackAfterCompletion") - subscribed_applications: Optional[Annotated[List[StrictInt], Field(min_length=0)]] = Field(default=None, description="A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement.", alias="subscribedApplications") - sandbox: StrictBool = Field(description="Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type.") - timezone: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string containing an IANA timezone descriptor.") + name: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ", json_schema_extra={"examples": ["Order50Discount"]}) + title: StrictStr = Field(description="The display name for the achievement in the Campaign Manager.", json_schema_extra={"examples": ["50% off on 50th purchase."]}) + description: StrictStr = Field(description="A description of the achievement.", json_schema_extra={"examples": ["50% off for every 50th purchase in a year."]}) + target: Union[StrictFloat, StrictInt] = Field(description="The required number of actions or the transactional milestone to complete the achievement.", json_schema_extra={"examples": [50]}) + period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ", json_schema_extra={"examples": ["1Y"]}) + recurrence_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy", json_schema_extra={"examples": ["no_recurrence"]}) + activation_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy", json_schema_extra={"examples": ["fixed_schedule"]}) + fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate", json_schema_extra={"examples": ["2024-01-15T15:04:05+07:00"]}) + end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate", json_schema_extra={"examples": ["2024-01-15T15:04:05+07:00"]}) + 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]}) + 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]]}) + sandbox: StrictBool = Field(description="Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type.", json_schema_extra={"examples": [True]}) + 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') diff --git a/talon_one/models/create_application_api_key.py b/talon_one/models/create_application_api_key.py index 1815c08..3d4f8a6 100644 --- a/talon_one/models/create_application_api_key.py +++ b/talon_one/models/create_application_api_key.py @@ -28,11 +28,11 @@ class CreateApplicationAPIKey(BaseModel): """ CreateApplicationAPIKey """ # noqa: E501 - title: StrictStr = Field(description="Title of the API key.") - expires: datetime = Field(description="The date the API key expires.") - platform: Optional[StrictStr] = Field(default=None, description="The third-party platform the API key is valid for. Use `none` for a generic API key to be used from your own integration layer. ") - type: Optional[StrictStr] = Field(default=None, description="The API key type. Can be empty or `staging`. Staging API keys can only be used for dry requests with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint, [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint, and [Track event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) endpoint. When using the _Update customer profile_ endpoint with a staging API key, the query parameter `runRuleEngine` must be `true`. ") - time_offset: Optional[StrictInt] = Field(default=None, description="A time offset in nanoseconds associated with the API key. When making a request using the API key, rule evaluation is based on a date that is calculated by adding the offset to the current date. ", alias="timeOffset") + title: StrictStr = Field(description="Title of the API key.", json_schema_extra={"examples": ["My generated key"]}) + expires: datetime = Field(description="The date the API key expires.", json_schema_extra={"examples": ["2023-08-24T14:00:00Z"]}) + platform: Optional[StrictStr] = Field(default=None, description="The third-party platform the API key is valid for. Use `none` for a generic API key to be used from your own integration layer. ", json_schema_extra={"examples": ["none"]}) + type: Optional[StrictStr] = Field(default=None, description="The API key type. Can be empty or `staging`. Staging API keys can only be used for dry requests with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint, [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint, and [Track event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) endpoint. When using the _Update customer profile_ endpoint with a staging API key, the query parameter `runRuleEngine` must be `true`. ", json_schema_extra={"examples": ["staging"]}) + time_offset: Optional[StrictInt] = Field(default=None, description="A time offset in nanoseconds associated with the API key. When making a request using the API key, rule evaluation is based on a date that is calculated by adding the offset to the current date. ", alias="timeOffset", json_schema_extra={"examples": [100000]}) __properties: ClassVar[List[str]] = ["title", "expires", "platform", "type", "timeOffset"] @field_validator('platform') diff --git a/talon_one/models/create_coupon_data.py b/talon_one/models/create_coupon_data.py index d682129..10216bf 100644 --- a/talon_one/models/create_coupon_data.py +++ b/talon_one/models/create_coupon_data.py @@ -28,12 +28,12 @@ class CreateCouponData(BaseModel): """ CreateCouponData """ # noqa: E501 - data: Optional[List[ExtendedCoupon]] = Field(default=None, description="The array of coupons codes. If 1000 or fewer coupons are requested, all coupon data is sent. If 1001 or more coupons are requested, only `BatchID` is sent.") - total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize") - batch_id: Optional[StrictStr] = Field(default=None, description="The ID of the batch to which the coupon belongs. **Note:** The Batch ID is generated when coupons are created. ", alias="BatchID") - type_of_change: StrictStr = Field(alias="TypeOfChange") - operation: StrictStr = Field(alias="Operation") - employee_name: StrictStr = Field(alias="EmployeeName") + data: Optional[List[ExtendedCoupon]] = Field(default=None, description="The array of coupons codes. If 1000 or fewer coupons are requested, all coupon data is sent. If 1001 or more coupons are requested, only `BatchID` is sent.", json_schema_extra={"examples": [[{"id": 1, "created": "2023-01-31T15:19:25.18417+01:00", "campaignId": 1, "value": "73KXKKFP", "usageLimit": 1, "reservationLimit": 0, "usageCounter": 0, "attributes": {}, "reservation": True, "batchId": "nqylhnni"}, {"id": 2, "created": "2023-01-31T15:19:25.18417+01:00", "campaignId": 1, "value": "BH3CXXLW", "usageLimit": 1, "reservationLimit": 0, "usageCounter": 0, "attributes": {}, "reservation": True, "batchId": "nqylhnni"}]]}) + total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize", json_schema_extra={"examples": [1]}) + batch_id: Optional[StrictStr] = Field(default=None, description="The ID of the batch to which the coupon belongs. **Note:** The Batch ID is generated when coupons are created. ", alias="BatchID", json_schema_extra={"examples": ["haanlypn"]}) + type_of_change: StrictStr = Field(alias="TypeOfChange", json_schema_extra={"examples": ["campaign_manager"]}) + operation: StrictStr = Field(alias="Operation", json_schema_extra={"examples": ["AsyncCouponsCreated"]}) + employee_name: StrictStr = Field(alias="EmployeeName", json_schema_extra={"examples": ["Franziska Schneider"]}) notification_type: StrictStr = Field(description="The type of the not", alias="NotificationType") __properties: ClassVar[List[str]] = ["data", "totalResultSize", "BatchID", "TypeOfChange", "Operation", "EmployeeName", "NotificationType"] diff --git a/talon_one/models/create_coupons200_response.py b/talon_one/models/create_coupons200_response.py index aef7b1a..fb9a383 100644 --- a/talon_one/models/create_coupons200_response.py +++ b/talon_one/models/create_coupons200_response.py @@ -28,7 +28,7 @@ class CreateCoupons200Response(BaseModel): """ CreateCoupons200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[Coupon] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/create_management_key.py b/talon_one/models/create_management_key.py index beede97..32dc6b0 100644 --- a/talon_one/models/create_management_key.py +++ b/talon_one/models/create_management_key.py @@ -29,10 +29,10 @@ class CreateManagementKey(BaseModel): """ CreateManagementKey """ # noqa: E501 - name: StrictStr = Field(description="Name for management key.") - expiry_date: datetime = Field(description="The date the management key expires.", alias="expiryDate") + name: StrictStr = Field(description="Name for management key.", json_schema_extra={"examples": ["My generated key"]}) + expiry_date: datetime = Field(description="The date the management key expires.", alias="expiryDate", json_schema_extra={"examples": ["2023-08-24T14:00:00Z"]}) endpoints: List[Endpoint] = Field(description="The list of endpoints that can be accessed with the key") - allowed_application_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of Application IDs that you can access with the management key. An empty or missing list means the management key can be used for all Applications in the account. ", alias="allowedApplicationIds") + allowed_application_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of Application IDs that you can access with the management key. An empty or missing list means the management key can be used for all Applications in the account. ", alias="allowedApplicationIds", json_schema_extra={"examples": [[1, 2, 3]]}) __properties: ClassVar[List[str]] = ["name", "expiryDate", "endpoints", "allowedApplicationIds"] model_config = ConfigDict( diff --git a/talon_one/models/create_mcp_key.py b/talon_one/models/create_mcp_key.py index 2227c7f..b07d811 100644 --- a/talon_one/models/create_mcp_key.py +++ b/talon_one/models/create_mcp_key.py @@ -28,8 +28,8 @@ class CreateMCPKey(BaseModel): """ CreateMCPKey """ # noqa: E501 - name: StrictStr = Field(description="Name for the MCP key.") - expiry_date: datetime = Field(description="The date the MCP key expires.", alias="expiryDate") + name: StrictStr = Field(description="Name for the MCP key.", json_schema_extra={"examples": ["My MCP key"]}) + expiry_date: datetime = Field(description="The date the MCP key expires.", alias="expiryDate", json_schema_extra={"examples": ["2026-08-24T14:00:00Z"]}) __properties: ClassVar[List[str]] = ["name", "expiryDate"] model_config = ConfigDict( diff --git a/talon_one/models/create_referrals_for_multiple_advocates201_response.py b/talon_one/models/create_referrals_for_multiple_advocates201_response.py index ab7d5c1..e86ef5a 100644 --- a/talon_one/models/create_referrals_for_multiple_advocates201_response.py +++ b/talon_one/models/create_referrals_for_multiple_advocates201_response.py @@ -28,7 +28,7 @@ class CreateReferralsForMultipleAdvocates201Response(BaseModel): """ CreateReferralsForMultipleAdvocates201Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[Referral] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/create_template_campaign.py b/talon_one/models/create_template_campaign.py index 4cf4b80..f1062dd 100644 --- a/talon_one/models/create_template_campaign.py +++ b/talon_one/models/create_template_campaign.py @@ -30,16 +30,16 @@ class CreateTemplateCampaign(BaseModel): """ CreateTemplateCampaign """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A user-facing name for this campaign.") - description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.") - template_id: StrictInt = Field(description="The ID of the Campaign Template which will be used in order to create the Campaign.", alias="templateId") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A user-facing name for this campaign.", json_schema_extra={"examples": ["Discount campaign"]}) + description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.", json_schema_extra={"examples": ["This template is for discount campaigns."]}) + template_id: StrictInt = Field(description="The ID of the Campaign Template which will be used in order to create the Campaign.", alias="templateId", json_schema_extra={"examples": [4]}) campaign_attributes_overrides: Optional[Dict[str, Any]] = Field(default=None, description="Custom Campaign Attributes. If the Campaign Template defines the same values, they will be overridden.", alias="campaignAttributesOverrides") template_param_values: Optional[List[Binding]] = Field(default=None, description="Actual values to replace the template placeholder values in the Ruleset bindings. Values for all Template Parameters must be provided.", alias="templateParamValues") limit_overrides: Optional[List[LimitConfig]] = Field(default=None, description="Limits for this Campaign. If the Campaign Template or Application define default values for the same limits, they will be overridden.", alias="limitOverrides") - campaign_groups: Optional[List[StrictInt]] = Field(default=None, description="The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/account-settings/managing-campaign-groups) this campaign belongs to. ", alias="campaignGroups") - tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)]] = Field(default=None, description="A list of tags for the campaign. If the campaign template has tags, they will be overridden by this list.") - evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign evaluation group the campaign belongs to.", alias="evaluationGroupId") - linked_store_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of store IDs that are linked to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. ", alias="linkedStoreIds") + campaign_groups: Optional[List[StrictInt]] = Field(default=None, description="The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/account-settings/managing-campaign-groups) this campaign belongs to. ", alias="campaignGroups", json_schema_extra={"examples": [[1, 3]]}) + tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)]] = Field(default=None, description="A list of tags for the campaign. If the campaign template has tags, they will be overridden by this list.", json_schema_extra={"examples": [["summer"]]}) + evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign evaluation group the campaign belongs to.", alias="evaluationGroupId", json_schema_extra={"examples": [2]}) + linked_store_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of store IDs that are linked to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. ", alias="linkedStoreIds", json_schema_extra={"examples": [[1, 2, 3]]}) __properties: ClassVar[List[str]] = ["name", "description", "templateId", "campaignAttributesOverrides", "templateParamValues", "limitOverrides", "campaignGroups", "tags", "evaluationGroupId", "linkedStoreIds"] model_config = ConfigDict( diff --git a/talon_one/models/custom_effect.py b/talon_one/models/custom_effect.py index 0dcc721..026e6c1 100644 --- a/talon_one/models/custom_effect.py +++ b/talon_one/models/custom_effect.py @@ -30,10 +30,10 @@ class CustomEffect(BaseModel): """ CustomEffect """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - modified: datetime = Field(description="The time this entity was last modified.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + modified: datetime = Field(description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) application_ids: Annotated[List[StrictInt], Field(min_length=1)] = Field(description="The IDs of the Applications that are related to this entity.", alias="applicationIds") is_per_item: Optional[StrictBool] = Field(default=None, description="Indicates if this effect is per item or not.", alias="isPerItem") name: Annotated[str, Field(strict=True)] = Field(description="The name of this effect.") @@ -42,8 +42,8 @@ class CustomEffect(BaseModel): description: Optional[StrictStr] = Field(default=None, description="The description of this effect.") enabled: StrictBool = Field(description="Determines if this effect is active.") params: Optional[List[TemplateArgDef]] = Field(default=None, description="Array of template argument definitions.") - modified_by: Optional[StrictInt] = Field(default=None, description="ID of the user who last updated this effect if available.", alias="modifiedBy") - created_by: StrictInt = Field(description="ID of the user who created this effect.", alias="createdBy") + modified_by: Optional[StrictInt] = Field(default=None, description="ID of the user who last updated this effect if available.", alias="modifiedBy", json_schema_extra={"examples": [334]}) + 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') diff --git a/talon_one/models/custom_effect_props.py b/talon_one/models/custom_effect_props.py index 1fbd69a..5f17daa 100644 --- a/talon_one/models/custom_effect_props.py +++ b/talon_one/models/custom_effect_props.py @@ -25,14 +25,14 @@ class CustomEffectProps(BaseModel): """ - Effect containing custom payload. + If you want to return data as an effect but no effect matches your use case, you can [create a custom effect](https://docs.talon.one/docs/dev/tutorials/create-custom-effects). Custom effects can be used as both rule effects and failure effects. The structure of a custom effect depends on your specifications but is always named `customEffect`. """ # noqa: E501 - effect_id: StrictInt = Field(description="The ID of the custom effect that was triggered.", alias="effectId") - name: StrictStr = Field(description="The type of the custom effect.") - cart_item_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The index of the item in the cart item list to which the custom effect is applied.", alias="cartItemPosition") - cart_item_sub_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="For cart items with quantity > 1, the sub position indicates to which item unit the custom effect is applied. ", alias="cartItemSubPosition") - bundle_index: Optional[StrictInt] = Field(default=None, description="The position of the bundle in a list of item bundles created from the same bundle definition.", alias="bundleIndex") - bundle_name: Optional[StrictStr] = Field(default=None, description="The name of the bundle definition.", alias="bundleName") + effect_id: StrictInt = Field(description="The ID of the custom effect that was triggered.", alias="effectId", json_schema_extra={"examples": [1]}) + name: StrictStr = Field(description="The type of the custom effect.", json_schema_extra={"examples": ["my_custom_effect"]}) + cart_item_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The index of the item in the cart item list to which the custom effect is applied.", alias="cartItemPosition", json_schema_extra={"examples": [1]}) + cart_item_sub_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="For cart items with quantity > 1, the sub position indicates to which item unit the custom effect is applied. ", alias="cartItemSubPosition", json_schema_extra={"examples": [2]}) + bundle_index: Optional[StrictInt] = Field(default=None, description="The position of the bundle in a list of item bundles created from the same bundle definition.", alias="bundleIndex", json_schema_extra={"examples": [1]}) + bundle_name: Optional[StrictStr] = Field(default=None, description="The name of the bundle definition.", alias="bundleName", json_schema_extra={"examples": ["my_bundle"]}) payload: Dict[str, Any] = Field(description="The JSON payload of the custom effect.") __properties: ClassVar[List[str]] = ["effectId", "name", "cartItemPosition", "cartItemSubPosition", "bundleIndex", "bundleName", "payload"] diff --git a/talon_one/models/customer_activity_report.py b/talon_one/models/customer_activity_report.py index c7d6638..6e28f4c 100644 --- a/talon_one/models/customer_activity_report.py +++ b/talon_one/models/customer_activity_report.py @@ -29,8 +29,8 @@ class CustomerActivityReport(BaseModel): """ A summary report of customer activity for a given time range. """ # noqa: E501 - integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID set by your integration layer.", alias="integrationId") - created: datetime = Field(description="The time this entity was created.") + integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID set by your integration layer.", alias="integrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-02-07T08:15:22Z"]}) name: StrictStr = Field(description="The name for this customer profile.") customer_id: StrictInt = Field(description="The internal Talon.One ID of the customer.", alias="customerId") last_activity: Optional[datetime] = Field(default=None, description="The last activity of the customer.", alias="lastActivity") diff --git a/talon_one/models/customer_profile.py b/talon_one/models/customer_profile.py index e612ede..1fcaad9 100644 --- a/talon_one/models/customer_profile.py +++ b/talon_one/models/customer_profile.py @@ -31,17 +31,17 @@ class CustomerProfile(BaseModel): """ CustomerProfile """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of the customer profile.") - created: datetime = Field(description="The time this entity was created.") - integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID set by your integration layer.", alias="integrationId") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.") - account_id: StrictInt = Field(description="The ID of the Talon.One account that owns this profile.", alias="accountId") - closed_sessions: StrictInt = Field(description="The total number of closed sessions. Does not include closed sessions that have been cancelled or reopened. See the [docs](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states).", alias="closedSessions") - total_sales: Union[StrictFloat, StrictInt] = Field(description="The total amount of money spent by the customer **before** discounts are applied. The total sales amount excludes the following: - Cancelled or reopened sessions. - Returned items. ", alias="totalSales") + id: StrictInt = Field(description="The internal ID of the customer profile.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-02-07T08:15:22Z"]}) + integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID set by your integration layer.", alias="integrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.", json_schema_extra={"examples": [{"Language": "english", "ShippingCountry": "DE"}]}) + account_id: StrictInt = Field(description="The ID of the Talon.One account that owns this profile.", alias="accountId", json_schema_extra={"examples": [31]}) + closed_sessions: StrictInt = Field(description="The total number of closed sessions. Does not include closed sessions that have been cancelled or reopened. See the [docs](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states).", alias="closedSessions", json_schema_extra={"examples": [3]}) + total_sales: Union[StrictFloat, StrictInt] = Field(description="The total amount of money spent by the customer **before** discounts are applied. The total sales amount excludes the following: - Cancelled or reopened sessions. - Returned items. ", alias="totalSales", json_schema_extra={"examples": [299.99]}) loyalty_memberships: Optional[List[LoyaltyMembership]] = Field(default=None, description="**DEPRECATED. Always returns `null`.** A list of loyalty programs joined by the customer. ", alias="loyaltyMemberships") audience_memberships: Optional[List[AudienceMembership]] = Field(default=None, description="The audiences the customer belongs to.", alias="audienceMemberships") - last_activity: datetime = Field(description="Timestamp of the most recent event received from this customer. This field is updated on calls that trigger the Rule Engine and that are not [dry requests](https://docs.talon.one/docs/dev/integration-api/dry-requests/#overlay). For example, [reserving a coupon](https://docs.talon.one/integration-api#tag/Coupons/operation/createCouponReservation) for a customer doesn't impact this field. ", alias="lastActivity") - sandbox: Optional[StrictBool] = Field(default=None, description="An indicator of whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). ") + last_activity: datetime = Field(description="Timestamp of the most recent event received from this customer. This field is updated on calls that trigger the Rule Engine and that are not [dry requests](https://docs.talon.one/docs/dev/integration-api/dry-requests/#overlay). For example, [reserving a coupon](https://docs.talon.one/integration-api#tag/Coupons/operation/createCouponReservation) for a customer doesn't impact this field. ", alias="lastActivity", json_schema_extra={"examples": ["2020-02-08T14:15:20Z"]}) + sandbox: Optional[StrictBool] = Field(default=None, description="An indicator of whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). ", json_schema_extra={"examples": [False]}) __properties: ClassVar[List[str]] = ["id", "created", "integrationId", "attributes", "accountId", "closedSessions", "totalSales", "loyaltyMemberships", "audienceMemberships", "lastActivity", "sandbox"] model_config = ConfigDict( diff --git a/talon_one/models/customer_profile_audience_request_item.py b/talon_one/models/customer_profile_audience_request_item.py index ab87f2e..14c9a68 100644 --- a/talon_one/models/customer_profile_audience_request_item.py +++ b/talon_one/models/customer_profile_audience_request_item.py @@ -28,9 +28,9 @@ class CustomerProfileAudienceRequestItem(BaseModel): """ CustomerProfileAudienceRequestItem """ # noqa: E501 - action: StrictStr = Field(description="Defines the action to perform: - `add`: Adds the customer profile to the audience. **Note**: If the customer profile does not exist, it will be created. The profile will not be visible in any Application until a session or profile update is received for that profile. - `delete`: Removes the customer profile from the audience. ") - profile_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The ID of this customer profile in the third-party integration.", alias="profileIntegrationId") - audience_id: StrictInt = Field(description="The ID of the audience. You get it via the `id` property when [creating an audience](#tag/Audiences/operation/createAudienceV2).", alias="audienceId") + action: StrictStr = Field(description="Defines the action to perform: - `add`: Adds the customer profile to the audience. **Note**: If the customer profile does not exist, it will be created. The profile will not be visible in any Application until a session or profile update is received for that profile. - `delete`: Removes the customer profile from the audience. ", json_schema_extra={"examples": ["add"]}) + profile_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The ID of this customer profile in the third-party integration.", alias="profileIntegrationId", json_schema_extra={"examples": ["R195412"]}) + audience_id: StrictInt = Field(description="The ID of the audience. You get it via the `id` property when [creating an audience](#tag/Audiences/operation/createAudienceV2).", alias="audienceId", json_schema_extra={"examples": [748]}) __properties: ClassVar[List[str]] = ["action", "profileIntegrationId", "audienceId"] @field_validator('action') diff --git a/talon_one/models/customer_profile_entity.py b/talon_one/models/customer_profile_entity.py index a21bf73..13dff9e 100644 --- a/talon_one/models/customer_profile_entity.py +++ b/talon_one/models/customer_profile_entity.py @@ -28,8 +28,8 @@ class CustomerProfileEntity(BaseModel): """ CustomerProfileEntity """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of the customer profile.") - created: datetime = Field(description="The time the customer profile was created.") + id: StrictInt = Field(description="The internal ID of the customer profile.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time the customer profile was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) __properties: ClassVar[List[str]] = ["id", "created"] model_config = ConfigDict( diff --git a/talon_one/models/customer_profile_integration_request_v2.py b/talon_one/models/customer_profile_integration_request_v2.py index 31060f7..7494374 100644 --- a/talon_one/models/customer_profile_integration_request_v2.py +++ b/talon_one/models/customer_profile_integration_request_v2.py @@ -28,9 +28,9 @@ class CustomerProfileIntegrationRequestV2(BaseModel): """ CustomerProfileIntegrationRequestV2 """ # noqa: E501 - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.") - evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds") - response_content: Optional[List[StrictStr]] = Field(default=None, description="Extends the response with the chosen data entities. Use this property to get as much data back as needed from one request instead of sending extra requests to other endpoints. ", alias="responseContent") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.", json_schema_extra={"examples": [{"Language": "english", "ShippingCountry": "DE"}]}) + evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds", json_schema_extra={"examples": [[10, 12]]}) + response_content: Optional[List[StrictStr]] = Field(default=None, description="Extends the response with the chosen data entities. Use this property to get as much data back as needed from one request instead of sending extra requests to other endpoints. ", alias="responseContent", json_schema_extra={"examples": [["triggeredCampaigns", "customerProfile"]]}) audiences_changes: Optional[ProfileAudiencesChanges] = Field(default=None, description="Audiences memberships changes for this profile.", alias="audiencesChanges") __properties: ClassVar[List[str]] = ["attributes", "evaluableCampaignIds", "responseContent", "audiencesChanges"] diff --git a/talon_one/models/customer_session.py b/talon_one/models/customer_session.py index 292b9eb..a0a270b 100644 --- a/talon_one/models/customer_session.py +++ b/talon_one/models/customer_session.py @@ -31,20 +31,20 @@ class CustomerSession(BaseModel): CustomerSession """ # noqa: E501 integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(alias="integrationId") - created: datetime = Field(description="The time this entity was created.") - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") - coupon: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Any coupon code entered.") - referral: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Any referral code entered.") - state: Optional[StrictStr] = Field(default='open', description="Indicates the current state of the session. Sessions can be created as `open` or `closed`. The state transitions are: 1. `open` → `closed` 2. `open` → `cancelled` 3. `closed` → `cancelled` or `partially_returned` 4. `partially_returned` → `cancelled` For more information, see [Customer session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). ") + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-02-07T08:15:22Z"]}) + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + 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"]}) + coupon: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Any coupon code entered.", json_schema_extra={"examples": ["XMAS-2021"]}) + referral: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Any referral code entered.", json_schema_extra={"examples": ["2740-tbjua-6720"]}) + state: Optional[StrictStr] = Field(default='open', description="Indicates the current state of the session. Sessions can be created as `open` or `closed`. The state transitions are: 1. `open` → `closed` 2. `open` → `cancelled` 3. `closed` → `cancelled` or `partially_returned` 4. `partially_returned` → `cancelled` For more information, see [Customer session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). ", json_schema_extra={"examples": ["open"]}) 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). ") + 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="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") - 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") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") + 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.") - updated: datetime = Field(description="Timestamp of the most recent event received on this session.") + updated: datetime = Field(description="Timestamp of the most recent event received on this session.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) __properties: ClassVar[List[str]] = ["integrationId", "created", "applicationId", "profileId", "coupon", "referral", "state", "cartItems", "identifiers", "total", "attributes", "firstSession", "updateCount", "discounts", "updated"] @field_validator('state') diff --git a/talon_one/models/customer_session_v2.py b/talon_one/models/customer_session_v2.py index 0346425..3570e81 100644 --- a/talon_one/models/customer_session_v2.py +++ b/talon_one/models/customer_session_v2.py @@ -32,29 +32,29 @@ class CustomerSessionV2(BaseModel): """ CustomerSessionV2 """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID set by your integration layer.", alias="integrationId") - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") - store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") - evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds") - coupon_codes: Optional[List[Annotated[str, Field(strict=True, max_length=100)]]] = Field(default=None, description="Any coupon codes entered. **Important - for requests only**: - If you [create a coupon budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a coupon code by the time you close it. - In requests where `dry=false`, providing an empty array discards any previous coupons. To avoid this, omit the parameter entirely. ", alias="couponCodes") - referral_code: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Any referral code entered. **Important - for requests only**: - If you [create a referral budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a referral code by the time you close it. - In requests where `dry=false`, providing an empty value discards the previous referral code. To avoid this, omit the parameter entirely. ", alias="referralCode") - loyalty_cards: Optional[Annotated[List[StrictStr], Field(max_length=1)]] = Field(default=None, description="Identifier of a loyalty card.", alias="loyaltyCards") - state: Optional[StrictStr] = Field(default='open', description="Indicates the current state of the session. Sessions can be created as `open` or `closed`. The state transitions are: 1. `open` → `closed` 2. `open` → `cancelled` 3. Either: - `closed` → `cancelled` (**only** via [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2)) or - `closed` → `partially_returned` (**only** via [Return cart items](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/returnCartItems)) - `closed` → `open` (**only** via [Reopen customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/reopenCustomerSession)) 4. `partially_returned` → `cancelled` For more information, see [Customer session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). ") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-02-07T08:15:22Z"]}) + integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID set by your integration layer.", alias="integrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + 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"]}) + evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds", json_schema_extra={"examples": [[10, 12]]}) + coupon_codes: Optional[List[Annotated[str, Field(strict=True, max_length=100)]]] = Field(default=None, description="Any coupon codes entered. **Important - for requests only**: - If you [create a coupon budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a coupon code by the time you close it. - In requests where `dry=false`, providing an empty array discards any previous coupons. To avoid this, omit the parameter entirely. ", alias="couponCodes", json_schema_extra={"examples": [["XMAS-20-2021"]]}) + referral_code: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Any referral code entered. **Important - for requests only**: - If you [create a referral budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a referral code by the time you close it. - In requests where `dry=false`, providing an empty value discards the previous referral code. To avoid this, omit the parameter entirely. ", alias="referralCode", json_schema_extra={"examples": ["NT2K54D9"]}) + loyalty_cards: Optional[Annotated[List[StrictStr], Field(max_length=1)]] = Field(default=None, description="Identifier of a loyalty card.", alias="loyaltyCards", json_schema_extra={"examples": [["loyalty-card-1"]]}) + state: Optional[StrictStr] = Field(default='open', description="Indicates the current state of the session. Sessions can be created as `open` or `closed`. The state transitions are: 1. `open` → `closed` 2. `open` → `cancelled` 3. Either: - `closed` → `cancelled` (**only** via [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2)) or - `closed` → `partially_returned` (**only** via [Return cart items](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/returnCartItems)) - `closed` → `open` (**only** via [Reopen customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/reopenCustomerSession)) 4. `partially_returned` → `cancelled` For more information, see [Customer session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). ", json_schema_extra={"examples": ["open"]}) cart_items: Optional[List[CartItem]] = Field(default=None, description="The items to add to this session. **Do not exceed 1000 items** and ensure the sum of all cart item's `quantity` **does not exceed 10.000** per request. ", alias="cartItems") experiment_variant_allocations: Optional[List[ExperimentVariantAllocation]] = Field(default=None, description="The experiment variant allocations to add to this session. ", alias="experimentVariantAllocations") - additional_costs: Optional[Dict[str, AdditionalCost]] = Field(default=None, description="Use this property to set a value for the additional costs of this session, such as a shipping cost. They must be created in the Campaign Manager before you set them with this property. See [Managing additional costs](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs). ", alias="additionalCosts") - 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). **Important**: Ensure the session contains an identifier by the time you close it if: - You [create a unique identifier budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign. - Your campaign has [coupons](https://docs.talon.one/docs/product/campaigns/coupons/coupon-page-overview). - We recommend passing an anonymized (hashed) version of the identifier value. ") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Use this property to set a value for the attributes of your choice. Attributes represent any information to attach to your session, like the shipping city. You can use [built-in attributes](https://docs.talon.one/docs/dev/concepts/attributes#built-in-attributes) or [custom ones](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes). Custom attributes must be created in the Campaign Manager before you set them with this property. ") - first_session: StrictBool = Field(description="Indicates whether this is the first session for the customer's profile. It's always `true` for anonymous sessions.", alias="firstSession") - 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") - total: Union[StrictFloat, StrictInt] = Field(description="The total value of cart items and additional costs in the session, before any discounts are applied.") - cart_item_total: Union[StrictFloat, StrictInt] = Field(description="The total value of cart items, before any discounts are applied.", alias="cartItemTotal") - additional_cost_total: Union[StrictFloat, StrictInt] = Field(description="The total value of additional costs, before any discounts are applied.", alias="additionalCostTotal") - cart_item_additional_cost_total: Union[StrictFloat, StrictInt] = Field(description="The total value of additional costs applied to individual items, before any discounts are applied.", alias="cartItemAdditionalCostTotal") - updated: datetime = Field(description="Timestamp of the most recent event received on this session.") + additional_costs: Optional[Dict[str, AdditionalCost]] = Field(default=None, description="Use this property to set a value for the additional costs of this session, such as a shipping cost. They must be created in the Campaign Manager before you set them with this property. See [Managing additional costs](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs). ", alias="additionalCosts", json_schema_extra={"examples": [{"shipping": {"price": 9}}]}) + 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). **Important**: Ensure the session contains an identifier by the time you close it if: - You [create a unique identifier budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign. - Your campaign has [coupons](https://docs.talon.one/docs/product/campaigns/coupons/coupon-page-overview). - We recommend passing an anonymized (hashed) version of the identifier value. ", json_schema_extra={"examples": [["d41306257915f83fe01e54092ae470f631161ea16fcf4415842eed41470386ea"]]}) + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Use this property to set a value for the attributes of your choice. Attributes represent any information to attach to your session, like the shipping city. You can use [built-in attributes](https://docs.talon.one/docs/dev/concepts/attributes#built-in-attributes) or [custom ones](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes). Custom attributes must be created in the Campaign Manager before you set them with this property. ", json_schema_extra={"examples": [{"ShippingCity": "Berlin"}]}) + first_session: StrictBool = Field(description="Indicates whether this is the first session for the customer's profile. It's always `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]}) + total: Union[StrictFloat, StrictInt] = Field(description="The total value of cart items and additional costs in the session, before any discounts are applied.", json_schema_extra={"examples": [134.99]}) + cart_item_total: Union[StrictFloat, StrictInt] = Field(description="The total value of cart items, before any discounts are applied.", alias="cartItemTotal", json_schema_extra={"examples": [99.99]}) + additional_cost_total: Union[StrictFloat, StrictInt] = Field(description="The total value of additional costs, before any discounts are applied.", alias="additionalCostTotal", json_schema_extra={"examples": [20]}) + cart_item_additional_cost_total: Union[StrictFloat, StrictInt] = Field(description="The total value of additional costs applied to individual items, before any discounts are applied.", alias="cartItemAdditionalCostTotal", json_schema_extra={"examples": [15]}) + updated: datetime = Field(description="Timestamp of the most recent event received on this session.", json_schema_extra={"examples": ["2020-02-08T14:15:22Z"]}) __properties: ClassVar[List[str]] = ["id", "created", "integrationId", "applicationId", "profileId", "storeIntegrationId", "evaluableCampaignIds", "couponCodes", "referralCode", "loyaltyCards", "state", "cartItems", "experimentVariantAllocations", "additionalCosts", "identifiers", "attributes", "firstSession", "updateCount", "total", "cartItemTotal", "additionalCostTotal", "cartItemAdditionalCostTotal", "updated"] @field_validator('state') diff --git a/talon_one/models/deactivate_user_request.py b/talon_one/models/deactivate_user_request.py index 2c4706b..76d6577 100644 --- a/talon_one/models/deactivate_user_request.py +++ b/talon_one/models/deactivate_user_request.py @@ -27,7 +27,7 @@ class DeactivateUserRequest(BaseModel): """ DeactivateUserRequest """ # noqa: E501 - email: StrictStr = Field(description="The email address associated with the user profile.") + email: StrictStr = Field(description="The email address associated with the user profile.", json_schema_extra={"examples": ["john.doe@example.com"]}) __properties: ClassVar[List[str]] = ["email"] model_config = ConfigDict( diff --git a/talon_one/models/deduct_loyalty_points.py b/talon_one/models/deduct_loyalty_points.py index 1e25ab6..58918c8 100644 --- a/talon_one/models/deduct_loyalty_points.py +++ b/talon_one/models/deduct_loyalty_points.py @@ -28,10 +28,10 @@ class DeductLoyaltyPoints(BaseModel): """ Points to deduct. """ # noqa: E501 - points: Union[Annotated[float, Field(le=999999999999.99, strict=True, gt=0)], Annotated[int, Field(le=2147483647, strict=True, gt=0)]] = Field(description="Amount of loyalty points.") - name: Optional[StrictStr] = Field(default=None, description="Name / reason for the point deduction.") - subledger_id: Optional[StrictStr] = Field(default=None, description="ID of the subledger the points are deducted from.", alias="subledgerId") - application_id: Optional[StrictInt] = Field(default=None, description="ID of the Application that is connected to the loyalty program.", alias="applicationId") + points: Union[Annotated[float, Field(le=999999999999.99, strict=True, gt=0)], Annotated[int, Field(le=2147483647, strict=True, gt=0)]] = Field(description="Amount of loyalty points.", json_schema_extra={"examples": [300]}) + name: Optional[StrictStr] = Field(default=None, description="Name / reason for the point deduction.", json_schema_extra={"examples": ["Penalty"]}) + subledger_id: Optional[StrictStr] = Field(default=None, description="ID of the subledger the points are deducted from.", alias="subledgerId", json_schema_extra={"examples": ["sub-123"]}) + application_id: Optional[StrictInt] = Field(default=None, description="ID of the Application that is connected to the loyalty program.", alias="applicationId", json_schema_extra={"examples": [322]}) __properties: ClassVar[List[str]] = ["points", "name", "subledgerId", "applicationId"] model_config = ConfigDict( diff --git a/talon_one/models/deduct_loyalty_points_effect_props.py b/talon_one/models/deduct_loyalty_points_effect_props.py index 37991c9..a953337 100644 --- a/talon_one/models/deduct_loyalty_points_effect_props.py +++ b/talon_one/models/deduct_loyalty_points_effect_props.py @@ -26,15 +26,15 @@ class DeductLoyaltyPointsEffectProps(BaseModel): """ - The properties specific to the \"deductLoyaltyPoints\" effect. This gets triggered whenever a validated rule contained a condition to only trigger when the given number of loyalty points could be deduced. These points are automatically stored and managed inside Talon.One. + This effect is triggered when a customer redeems loyalty points. The points are deducted from their active point balance. If the loyalty program is card-based, use the `cardIdentifier` property to identify the loyalty card from which these points are deducted. The Rule Engine deducts points in this order: - Points with the earliest expiry date are deducted first, regardless of when they were added. - Points with an unlimited expiry date are deducted last. - For points with an unlimited expiry date, the points awarded first are deducted first. The points only persist when the session is closed. """ # noqa: E501 rule_title: StrictStr = Field(description="The title of the rule that contained triggered this points deduction.", alias="ruleTitle") - program_id: StrictInt = Field(description="The ID of the loyalty program where these points were added.", alias="programId") - sub_ledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were added.", alias="subLedgerId") + program_id: StrictInt = Field(description="The ID of the loyalty program from which these points were deducted.", alias="programId") + sub_ledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program from which these points were deducted.", alias="subLedgerId") value: Union[StrictFloat, StrictInt] = Field(description="The amount of points that were deducted.") - transaction_uuid: StrictStr = Field(description="The identifier of this deduction in the loyalty ledger.", alias="transactionUUID") - name: StrictStr = Field(description="The name property gets one of the following two values. It can be the loyalty program name or it can represent a reason for the respective deduction of loyalty points. The latter is an optional value defined in a deduction rule. ") - card_identifier: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=108)]] = Field(default=None, description="The card on which these points were added.", alias="cardIdentifier") + transaction_uuid: StrictStr = Field(description="The identifier of this loyalty point transaction.", alias="transactionUUID") + name: StrictStr = Field(description="The reason of this loyalty points deduction.") + 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') diff --git a/talon_one/models/delete_loyalty_transactions_request.py b/talon_one/models/delete_loyalty_transactions_request.py index 0d8826e..64fab0d 100644 --- a/talon_one/models/delete_loyalty_transactions_request.py +++ b/talon_one/models/delete_loyalty_transactions_request.py @@ -27,8 +27,8 @@ class DeleteLoyaltyTransactionsRequest(BaseModel): """ Request to delete transactions based on the specified scope. """ # noqa: E501 - scope: StrictStr = Field(description="`AllSubledgers` deletes all transactions for the specified customer profile from all ledgers in the loyalty program. `SelectedSubledgers` deletes all transactions for the specified customer profile only from the given ledgers in the loyalty program. ") - subledger_ids: Optional[List[StrictStr]] = Field(default=None, description="The IDs of the ledgers from which to delete the customer's transactions. This parameter is required if the `scope` is set to `SelectedSubledgers`. To specify the main ledger, provide an empty string (\"\"). ", alias="subledgerIds") + scope: StrictStr = Field(description="`AllSubledgers` deletes all transactions for the specified customer profile from all ledgers in the loyalty program. `SelectedSubledgers` deletes all transactions for the specified customer profile only from the given ledgers in the loyalty program. ", json_schema_extra={"examples": ["SelectedSubledgers"]}) + subledger_ids: Optional[List[StrictStr]] = Field(default=None, description="The IDs of the ledgers from which to delete the customer's transactions. This parameter is required if the `scope` is set to `SelectedSubledgers`. To specify the main ledger, provide an empty string (\"\"). ", alias="subledgerIds", json_schema_extra={"examples": [["subledger1", "subledger2"]]}) __properties: ClassVar[List[str]] = ["scope", "subledgerIds"] @field_validator('scope') diff --git a/talon_one/models/delete_user_request.py b/talon_one/models/delete_user_request.py index a5dcb76..41909a0 100644 --- a/talon_one/models/delete_user_request.py +++ b/talon_one/models/delete_user_request.py @@ -27,7 +27,7 @@ class DeleteUserRequest(BaseModel): """ DeleteUserRequest """ # noqa: E501 - email: StrictStr = Field(description="The email address associated with the user profile.") + email: StrictStr = Field(description="The email address associated with the user profile.", json_schema_extra={"examples": ["john.doe@example.com"]}) __properties: ClassVar[List[str]] = ["email"] model_config = ConfigDict( diff --git a/talon_one/models/effect.py b/talon_one/models/effect.py index 8ff1404..3c4bf56 100644 --- a/talon_one/models/effect.py +++ b/talon_one/models/effect.py @@ -28,22 +28,22 @@ class Effect(BaseModel): """ Effect """ # noqa: E501 - experiment_id: Optional[StrictInt] = Field(default=None, description="The ID of the experiment that campaign belongs to.", alias="experimentId") - campaign_id: StrictInt = Field(description="The ID of the campaign that triggered this effect.", alias="campaignId") - ruleset_id: StrictInt = Field(description="The ID of the ruleset that was active in the campaign when this effect was triggered.", alias="rulesetId") - rule_index: StrictInt = Field(description="The position of the rule that triggered this effect within the ruleset.", alias="ruleIndex") - rule_name: StrictStr = Field(description="The name of the rule that triggered this effect.", alias="ruleName") - effect_type: StrictStr = Field(description="The type of effect that was triggered. See [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects).", alias="effectType") - triggered_by_coupon: Optional[StrictInt] = Field(default=None, description="The ID of the coupon that was being evaluated when this effect was triggered.", alias="triggeredByCoupon") - triggered_for_catalog_item: Optional[StrictInt] = Field(default=None, description="The ID of the catalog item that was being evaluated when this effect was triggered.", alias="triggeredForCatalogItem") - condition_index: Optional[StrictInt] = Field(default=None, description="The index of the condition that was triggered.", alias="conditionIndex") - evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation).", alias="evaluationGroupID") - evaluation_group_mode: Optional[StrictStr] = Field(default=None, description="The evaluation mode of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation).", alias="evaluationGroupMode") - campaign_revision_id: Optional[StrictInt] = Field(default=None, description="The revision ID of the campaign that was used when triggering the effect.", alias="campaignRevisionId") - campaign_revision_version_id: Optional[StrictInt] = Field(default=None, description="The revision version ID of the campaign that was used when triggering the effect.", alias="campaignRevisionVersionId") - selected_price_type: Optional[StrictStr] = Field(default=None, description="The selected price type for the SKU targeted by this effect.", alias="selectedPriceType") - 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") - 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") + experiment_id: Optional[StrictInt] = Field(default=None, description="The ID of the experiment that campaign belongs to.", alias="experimentId", json_schema_extra={"examples": [12]}) + campaign_id: StrictInt = Field(description="The ID of the campaign that triggered this effect.", alias="campaignId", json_schema_extra={"examples": [244]}) + ruleset_id: StrictInt = Field(description="The ID of the ruleset that was active in the campaign when this effect was triggered.", alias="rulesetId", json_schema_extra={"examples": [73]}) + 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": ["Give 20% discount"]}) + effect_type: StrictStr = Field(description="The type of effect that was triggered. See [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects).", alias="effectType", json_schema_extra={"examples": ["rejectCoupon"]}) + triggered_by_coupon: Optional[StrictInt] = Field(default=None, description="The ID of the coupon that was being evaluated when this effect was triggered.", alias="triggeredByCoupon", json_schema_extra={"examples": [4928]}) + triggered_for_catalog_item: Optional[StrictInt] = Field(default=None, description="The ID of the catalog item that was being evaluated when this effect was triggered.", alias="triggeredForCatalogItem", json_schema_extra={"examples": [786]}) + condition_index: Optional[StrictInt] = Field(default=None, description="The index of the condition that was triggered.", alias="conditionIndex", json_schema_extra={"examples": [786]}) + evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation).", alias="evaluationGroupID", json_schema_extra={"examples": [3]}) + evaluation_group_mode: Optional[StrictStr] = Field(default=None, description="The evaluation mode of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation).", alias="evaluationGroupMode", json_schema_extra={"examples": ["stackable"]}) + campaign_revision_id: Optional[StrictInt] = Field(default=None, description="The revision ID of the campaign that was used when triggering the effect.", alias="campaignRevisionId", json_schema_extra={"examples": [1]}) + campaign_revision_version_id: Optional[StrictInt] = Field(default=None, description="The revision version ID of the campaign that was used when triggering the effect.", alias="campaignRevisionVersionId", json_schema_extra={"examples": [5]}) + 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] __properties: ClassVar[List[str]] = ["experimentId", "campaignId", "rulesetId", "ruleIndex", "ruleName", "effectType", "triggeredByCoupon", "triggeredForCatalogItem", "conditionIndex", "evaluationGroupID", "evaluationGroupMode", "campaignRevisionId", "campaignRevisionVersionId", "selectedPriceType", "selectedPrice", "adjustmentReferenceId", "props"] diff --git a/talon_one/models/effect_entity.py b/talon_one/models/effect_entity.py index 65bea9d..9666a9c 100644 --- a/talon_one/models/effect_entity.py +++ b/talon_one/models/effect_entity.py @@ -28,22 +28,22 @@ class EffectEntity(BaseModel): """ Definition of all properties that are present on all effects, independent of their type. """ # noqa: E501 - experiment_id: Optional[StrictInt] = Field(default=None, description="The ID of the experiment that campaign belongs to.", alias="experimentId") - campaign_id: StrictInt = Field(description="The ID of the campaign that triggered this effect.", alias="campaignId") - ruleset_id: StrictInt = Field(description="The ID of the ruleset that was active in the campaign when this effect was triggered.", alias="rulesetId") - rule_index: StrictInt = Field(description="The position of the rule that triggered this effect within the ruleset.", alias="ruleIndex") - rule_name: StrictStr = Field(description="The name of the rule that triggered this effect.", alias="ruleName") - effect_type: StrictStr = Field(description="The type of effect that was triggered. See [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects).", alias="effectType") - triggered_by_coupon: Optional[StrictInt] = Field(default=None, description="The ID of the coupon that was being evaluated when this effect was triggered.", alias="triggeredByCoupon") - triggered_for_catalog_item: Optional[StrictInt] = Field(default=None, description="The ID of the catalog item that was being evaluated when this effect was triggered.", alias="triggeredForCatalogItem") - condition_index: Optional[StrictInt] = Field(default=None, description="The index of the condition that was triggered.", alias="conditionIndex") - evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation).", alias="evaluationGroupID") - evaluation_group_mode: Optional[StrictStr] = Field(default=None, description="The evaluation mode of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation).", alias="evaluationGroupMode") - campaign_revision_id: Optional[StrictInt] = Field(default=None, description="The revision ID of the campaign that was used when triggering the effect.", alias="campaignRevisionId") - campaign_revision_version_id: Optional[StrictInt] = Field(default=None, description="The revision version ID of the campaign that was used when triggering the effect.", alias="campaignRevisionVersionId") - selected_price_type: Optional[StrictStr] = Field(default=None, description="The selected price type for the SKU targeted by this effect.", alias="selectedPriceType") - 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") - 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") + experiment_id: Optional[StrictInt] = Field(default=None, description="The ID of the experiment that campaign belongs to.", alias="experimentId", json_schema_extra={"examples": [12]}) + campaign_id: StrictInt = Field(description="The ID of the campaign that triggered this effect.", alias="campaignId", json_schema_extra={"examples": [244]}) + ruleset_id: StrictInt = Field(description="The ID of the ruleset that was active in the campaign when this effect was triggered.", alias="rulesetId", json_schema_extra={"examples": [73]}) + 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": ["Give 20% discount"]}) + effect_type: StrictStr = Field(description="The type of effect that was triggered. See [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects).", alias="effectType", json_schema_extra={"examples": ["rejectCoupon"]}) + triggered_by_coupon: Optional[StrictInt] = Field(default=None, description="The ID of the coupon that was being evaluated when this effect was triggered.", alias="triggeredByCoupon", json_schema_extra={"examples": [4928]}) + triggered_for_catalog_item: Optional[StrictInt] = Field(default=None, description="The ID of the catalog item that was being evaluated when this effect was triggered.", alias="triggeredForCatalogItem", json_schema_extra={"examples": [786]}) + condition_index: Optional[StrictInt] = Field(default=None, description="The index of the condition that was triggered.", alias="conditionIndex", json_schema_extra={"examples": [786]}) + evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation).", alias="evaluationGroupID", json_schema_extra={"examples": [3]}) + evaluation_group_mode: Optional[StrictStr] = Field(default=None, description="The evaluation mode of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation).", alias="evaluationGroupMode", json_schema_extra={"examples": ["stackable"]}) + campaign_revision_id: Optional[StrictInt] = Field(default=None, description="The revision ID of the campaign that was used when triggering the effect.", alias="campaignRevisionId", json_schema_extra={"examples": [1]}) + campaign_revision_version_id: Optional[StrictInt] = Field(default=None, description="The revision version ID of the campaign that was used when triggering the effect.", alias="campaignRevisionVersionId", json_schema_extra={"examples": [5]}) + 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"]}) __properties: ClassVar[List[str]] = ["experimentId", "campaignId", "rulesetId", "ruleIndex", "ruleName", "effectType", "triggeredByCoupon", "triggeredForCatalogItem", "conditionIndex", "evaluationGroupID", "evaluationGroupMode", "campaignRevisionId", "campaignRevisionVersionId", "selectedPriceType", "selectedPrice", "adjustmentReferenceId"] model_config = ConfigDict( diff --git a/talon_one/models/email_entity.py b/talon_one/models/email_entity.py index db0de2d..9f29833 100644 --- a/talon_one/models/email_entity.py +++ b/talon_one/models/email_entity.py @@ -27,7 +27,7 @@ class EmailEntity(BaseModel): """ EmailEntity """ # noqa: E501 - email: StrictStr = Field(description="The email address associated with the user profile.") + email: StrictStr = Field(description="The email address associated with the user profile.", json_schema_extra={"examples": ["john.doe@example.com"]}) __properties: ClassVar[List[str]] = ["email"] model_config = ConfigDict( diff --git a/talon_one/models/embedded_dashboard_configuration.py b/talon_one/models/embedded_dashboard_configuration.py index b0db3f0..c35a454 100644 --- a/talon_one/models/embedded_dashboard_configuration.py +++ b/talon_one/models/embedded_dashboard_configuration.py @@ -27,8 +27,8 @@ class EmbeddedDashboardConfiguration(BaseModel): """ EmbeddedDashboardConfiguration """ # noqa: E501 - workspace_id: StrictStr = Field(description="The ID of the workspace that contains dashboards.", alias="workspaceId") - dashboard_id: StrictStr = Field(description="The ID of the dashboard that contains metrics.", alias="dashboardId") + workspace_id: StrictStr = Field(description="The ID of the workspace that contains dashboards.", alias="workspaceId", json_schema_extra={"examples": ["main_workspace"]}) + dashboard_id: StrictStr = Field(description="The ID of the dashboard that contains metrics.", alias="dashboardId", json_schema_extra={"examples": ["campaign_insights_metrics"]}) __properties: ClassVar[List[str]] = ["workspaceId", "dashboardId"] model_config = ConfigDict( diff --git a/talon_one/models/endpoint.py b/talon_one/models/endpoint.py index 02ef643..61f200c 100644 --- a/talon_one/models/endpoint.py +++ b/talon_one/models/endpoint.py @@ -27,7 +27,7 @@ class Endpoint(BaseModel): """ Endpoint """ # noqa: E501 - path: StrictStr = Field(description="allowed endpoint") + path: StrictStr = Field(description="allowed endpoint", json_schema_extra={"examples": ["/coupons"]}) __properties: ClassVar[List[str]] = ["path"] model_config = ConfigDict( diff --git a/talon_one/models/entity.py b/talon_one/models/entity.py index 34e0b55..114ce0e 100644 --- a/talon_one/models/entity.py +++ b/talon_one/models/entity.py @@ -28,8 +28,8 @@ class Entity(BaseModel): """ Entity """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) __properties: ClassVar[List[str]] = ["id", "created"] model_config = ConfigDict( diff --git a/talon_one/models/entity_with_talang_visible_id.py b/talon_one/models/entity_with_talang_visible_id.py index 17a4827..6bd5af1 100644 --- a/talon_one/models/entity_with_talang_visible_id.py +++ b/talon_one/models/entity_with_talang_visible_id.py @@ -28,8 +28,8 @@ class EntityWithTalangVisibleID(BaseModel): """ EntityWithTalangVisibleID """ # noqa: E501 - id: StrictInt = Field(description="Unique ID for this entity.") - created: datetime = Field(description="The exact moment this entity was created.") + id: StrictInt = Field(description="Unique ID for this entity.", json_schema_extra={"examples": [4]}) + created: datetime = Field(description="The exact moment this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) __properties: ClassVar[List[str]] = ["id", "created"] model_config = ConfigDict( diff --git a/talon_one/models/environment.py b/talon_one/models/environment.py index c8023f4..fb4bb47 100644 --- a/talon_one/models/environment.py +++ b/talon_one/models/environment.py @@ -40,9 +40,9 @@ class Environment(BaseModel): """ Environment """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) slots: List[SlotDef] = Field(description="The slots defined for this application.") functions: List[FunctionDef] = Field(description="The functions defined for this application.") templates: List[TemplateDef] = Field(description="The templates defined for this application.") diff --git a/talon_one/models/error_effect_props.py b/talon_one/models/error_effect_props.py index 34761c5..5169fe8 100644 --- a/talon_one/models/error_effect_props.py +++ b/talon_one/models/error_effect_props.py @@ -25,7 +25,7 @@ class ErrorEffectProps(BaseModel): """ - Whenever an error occurred during evaluation, we return an error effect. This should never happen for rules created in the rule builder. + This effect is triggered whenever an error occurs during rule evaluation. This effect only provides information about what the error is. """ # noqa: E501 message: StrictStr = Field(description="The error message.") __properties: ClassVar[List[str]] = ["message"] diff --git a/talon_one/models/evaluable_campaign_ids.py b/talon_one/models/evaluable_campaign_ids.py index debe752..6d8b291 100644 --- a/talon_one/models/evaluable_campaign_ids.py +++ b/talon_one/models/evaluable_campaign_ids.py @@ -27,7 +27,7 @@ class EvaluableCampaignIds(BaseModel): """ EvaluableCampaignIds """ # noqa: E501 - evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds") + evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds", json_schema_extra={"examples": [[10, 12]]}) __properties: ClassVar[List[str]] = ["evaluableCampaignIds"] model_config = ConfigDict( diff --git a/talon_one/models/event.py b/talon_one/models/event.py index 0eacb6f..06e182a 100644 --- a/talon_one/models/event.py +++ b/talon_one/models/event.py @@ -31,15 +31,15 @@ class Event(BaseModel): """ Event """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") - store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") - type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") - attributes: Dict[str, Any] = Field(description="Arbitrary additional JSON data associated with the event.") - integration_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The unique ID of the event. Only one event with this ID can be registered. ", alias="integrationId") - session_id: Optional[StrictStr] = Field(default=None, description="The ID of the session that this event occurred in.", alias="sessionId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + 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.") + 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). ") ledger_entries: Optional[List[LedgerEntry]] = Field(default=None, description="Ledger entries for the event.", alias="ledgerEntries") meta: Optional[Meta] = None diff --git a/talon_one/models/event_attributes_entity.py b/talon_one/models/event_attributes_entity.py index 3ab0711..2759785 100644 --- a/talon_one/models/event_attributes_entity.py +++ b/talon_one/models/event_attributes_entity.py @@ -28,8 +28,8 @@ class EventAttributesEntity(BaseModel): """ EventAttributesEntity """ # noqa: E501 - type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute).") + 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: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute).", json_schema_extra={"examples": [{"myAttribute": "myValue"}]}) __properties: ClassVar[List[str]] = ["type", "attributes"] model_config = ConfigDict( diff --git a/talon_one/models/event_type.py b/talon_one/models/event_type.py index 13dc763..f7293b7 100644 --- a/talon_one/models/event_type.py +++ b/talon_one/models/event_type.py @@ -29,11 +29,11 @@ class EventType(BaseModel): """ EventType """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - title: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The human-friendly name for this event type.") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The integration name for this event type. This will be used in URLs and cannot be changed after an event type has been created.") - description: Optional[StrictStr] = Field(default=None, description="A description of what the event represents. ") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + title: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The human-friendly name for this event type.", json_schema_extra={"examples": ["Survey Completed"]}) + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The integration name for this event type. This will be used in URLs and cannot be changed after an event type has been created.", json_schema_extra={"examples": ["surveyCompleted"]}) + description: Optional[StrictStr] = Field(default=None, description="A description of what the event represents. ", json_schema_extra={"examples": ["The survey was submitted by the customer."]}) __properties: ClassVar[List[str]] = ["id", "created", "title", "name", "description"] model_config = ConfigDict( diff --git a/talon_one/models/event_v2.py b/talon_one/models/event_v2.py index 44c83aa..9ead15b 100644 --- a/talon_one/models/event_v2.py +++ b/talon_one/models/event_v2.py @@ -28,11 +28,11 @@ class EventV2(BaseModel): """ EventV2 """ # noqa: E501 - profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") - store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") - evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds") - type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute).") + 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"]}) + evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds", json_schema_extra={"examples": [[10, 12]]}) + 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: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute).", json_schema_extra={"examples": [{"myAttribute": "myValue"}]}) __properties: ClassVar[List[str]] = ["profileId", "storeIntegrationId", "evaluableCampaignIds", "type", "attributes"] model_config = ConfigDict( diff --git a/talon_one/models/event_v3.py b/talon_one/models/event_v3.py index 718c2cb..01f206f 100644 --- a/talon_one/models/event_v3.py +++ b/talon_one/models/event_v3.py @@ -29,15 +29,15 @@ class EventV3(BaseModel): """ EventV3 """ # noqa: E501 - connected_session_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail.", alias="connectedSessionId") - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") - store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") - type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") - attributes: Dict[str, Any] = Field(description="Arbitrary additional JSON data associated with the event.") - integration_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The unique ID of the event. Only one event with this ID can be registered. ", alias="integrationId") + connected_session_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail.", alias="connectedSessionId", json_schema_extra={"examples": ["175KJPS947296"]}) + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + 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.") + 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/event_v3_connections.py b/talon_one/models/event_v3_connections.py index 5bbc96b..c240536 100644 --- a/talon_one/models/event_v3_connections.py +++ b/talon_one/models/event_v3_connections.py @@ -28,7 +28,7 @@ class EventV3Connections(BaseModel): """ EventV3Connections """ # noqa: E501 - connected_session_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail.", alias="connectedSessionId") + connected_session_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail.", alias="connectedSessionId", json_schema_extra={"examples": ["175KJPS947296"]}) __properties: ClassVar[List[str]] = ["connectedSessionId"] model_config = ConfigDict( diff --git a/talon_one/models/event_v3_entity.py b/talon_one/models/event_v3_entity.py index f8f4ac7..99c7b7e 100644 --- a/talon_one/models/event_v3_entity.py +++ b/talon_one/models/event_v3_entity.py @@ -28,7 +28,7 @@ class EventV3Entity(BaseModel): """ EventV3Entity """ # noqa: E501 - integration_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The unique ID of the event. Only one event with this ID can be registered. ", alias="integrationId") + 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"]}) __properties: ClassVar[List[str]] = ["integrationId"] model_config = ConfigDict( diff --git a/talon_one/models/event_v3_request_entity.py b/talon_one/models/event_v3_request_entity.py index e76bfed..cfcd41a 100644 --- a/talon_one/models/event_v3_request_entity.py +++ b/talon_one/models/event_v3_request_entity.py @@ -28,13 +28,13 @@ class EventV3RequestEntity(BaseModel): """ EventV3RequestEntity """ # noqa: E501 - profile_id: StrictStr = Field(description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") - store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") - evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds") - type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute).") - integration_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The unique ID of the event. Only one event with this ID can be registered. ", alias="integrationId") - connected_session_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail.", alias="connectedSessionId") + profile_id: StrictStr = Field(description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId", 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"]}) + evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds", json_schema_extra={"examples": [[10, 12]]}) + 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: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute).", json_schema_extra={"examples": [{"myAttribute": "myValue"}]}) + integration_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The unique ID of the event. Only one event with this ID can be registered. ", alias="integrationId", json_schema_extra={"examples": ["175KJPS947296"]}) + connected_session_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail.", alias="connectedSessionId", json_schema_extra={"examples": ["175KJPS947296"]}) __properties: ClassVar[List[str]] = ["profileId", "storeIntegrationId", "evaluableCampaignIds", "type", "attributes", "integrationId", "connectedSessionId"] model_config = ConfigDict( diff --git a/talon_one/models/experiment.py b/talon_one/models/experiment.py index bf61a92..d462b6d 100644 --- a/talon_one/models/experiment.py +++ b/talon_one/models/experiment.py @@ -30,16 +30,16 @@ class Experiment(BaseModel): """ Experiment """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) is_variant_assignment_external: Optional[StrictBool] = Field(default=None, description="The source of the assignment. - false - The variant assignment is handled internally by Talon.One. - true - The variant assignment is handled externally. ", alias="isVariantAssignmentExternal") campaign: Optional[Campaign] = None activated: Optional[datetime] = Field(default=None, description="The date and time the experiment was activated. ") - state: StrictStr = Field(description="A disabled experiment is not evaluated for rules or coupons. ") + state: StrictStr = Field(description="A disabled experiment is not evaluated for rules or coupons. ", json_schema_extra={"examples": ["enabled"]}) variants: Optional[List[ExperimentVariant]] = None goal_type: StrictStr = Field(description="The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. ", alias="goalType") - goal_description: Optional[StrictStr] = Field(default=None, description="A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. ", alias="goalDescription") + goal_description: Optional[StrictStr] = Field(default=None, description="A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. ", alias="goalDescription", json_schema_extra={"examples": ["Offering free shipping will increase average order revenue more than a 10% discount"]}) deletedat: Optional[datetime] = Field(default=None, description="The date and time the experiment was deleted. ") __properties: ClassVar[List[str]] = ["id", "created", "applicationId", "isVariantAssignmentExternal", "campaign", "activated", "state", "variants", "goalType", "goalDescription", "deletedat"] diff --git a/talon_one/models/experiment_campaign_copy.py b/talon_one/models/experiment_campaign_copy.py index 9dbcfdc..d988a3a 100644 --- a/talon_one/models/experiment_campaign_copy.py +++ b/talon_one/models/experiment_campaign_copy.py @@ -29,12 +29,12 @@ class ExperimentCampaignCopy(BaseModel): """ ExperimentCampaignCopy """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="Name of the copied campaign (Defaults to \"Copy of original campaign name\").") - description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.") - start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime") - end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime") - tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)]] = Field(default=None, description="A list of tags for the campaign.") - evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign evaluation group the campaign belongs to.", alias="evaluationGroupId") + name: Optional[StrictStr] = Field(default=None, description="Name of the copied campaign (Defaults to \"Copy of original campaign name\").", json_schema_extra={"examples": ["Copy of Summer promotions"]}) + description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.", json_schema_extra={"examples": ["Campaign for all summer 2021 promotions"]}) + start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime", json_schema_extra={"examples": ["2021-06-01T09:00:27.993483Z"]}) + end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime", json_schema_extra={"examples": ["2021-09-10T01:00:00.993483Z"]}) + tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)]] = Field(default=None, description="A list of tags for the campaign.", json_schema_extra={"examples": [["Summer", "Shoes"]]}) + evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign evaluation group the campaign belongs to.", alias="evaluationGroupId", json_schema_extra={"examples": [2]}) __properties: ClassVar[List[str]] = ["name", "description", "startTime", "endTime", "tags", "evaluationGroupId"] model_config = ConfigDict( diff --git a/talon_one/models/scim_service_provider_config_response_sort.py b/talon_one/models/experiment_confidence_timeline.py similarity index 69% rename from talon_one/models/scim_service_provider_config_response_sort.py rename to talon_one/models/experiment_confidence_timeline.py index 8c2bfcb..10e7b4e 100644 --- a/talon_one/models/scim_service_provider_config_response_sort.py +++ b/talon_one/models/experiment_confidence_timeline.py @@ -17,18 +17,19 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from talon_one.models.experiment_confidence_timeline_data_point import ExperimentConfidenceTimelineDataPoint from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python -class ScimServiceProviderConfigResponseSort(BaseModel): +class ExperimentConfidenceTimeline(BaseModel): """ - Configuration settings related to sorting SCIM resources in query responses. + ExperimentConfidenceTimeline """ # 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"] + data: List[ExperimentConfidenceTimelineDataPoint] = Field(description="Daily cumulative confidence values ordered chronologically from experiment start to end, or to today if the experiment is still running. Empty if the experiment has no data yet. ") + __properties: ClassVar[List[str]] = ["data"] 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 ScimServiceProviderConfigResponseSort from a JSON string""" + """Create an instance of ExperimentConfidenceTimeline from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -69,11 +70,18 @@ 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 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ScimServiceProviderConfigResponseSort from a dict""" + """Create an instance of ExperimentConfidenceTimeline from a dict""" if obj is None: return None @@ -81,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "supported": obj.get("supported") + "data": [ExperimentConfidenceTimelineDataPoint.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/scim_service_provider_config_response_patch.py b/talon_one/models/experiment_confidence_timeline_data_point.py similarity index 70% rename from talon_one/models/scim_service_provider_config_response_patch.py rename to talon_one/models/experiment_confidence_timeline_data_point.py index 24a7b77..3c94585 100644 --- a/talon_one/models/scim_service_provider_config_response_patch.py +++ b/talon_one/models/experiment_confidence_timeline_data_point.py @@ -17,18 +17,21 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, List, Optional +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from talon_one.models.experiment_variant_result_confidence import ExperimentVariantResultConfidence from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python -class ScimServiceProviderConfigResponsePatch(BaseModel): +class ExperimentConfidenceTimelineDataPoint(BaseModel): """ - Configuration settings related to patch operations, which allow partial updates to SCIM resources. + ExperimentConfidenceTimelineDataPoint """ # 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"] + var_date: datetime = Field(description="The date-time this data point represents.", alias="date", json_schema_extra={"examples": ["2024-01-15T00:00:00+07:00"]}) + confidence: ExperimentVariantResultConfidence + __properties: ClassVar[List[str]] = ["date", "confidence"] model_config = ConfigDict( validate_by_name=True, @@ -48,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ScimServiceProviderConfigResponsePatch from a JSON string""" + """Create an instance of ExperimentConfidenceTimelineDataPoint from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -69,11 +72,14 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of confidence + if self.confidence: + _dict['confidence'] = self.confidence.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ScimServiceProviderConfigResponsePatch from a dict""" + """Create an instance of ExperimentConfidenceTimelineDataPoint from a dict""" if obj is None: return None @@ -81,7 +87,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "supported": obj.get("supported") + "date": obj.get("date"), + "confidence": ExperimentVariantResultConfidence.from_dict(obj["confidence"]) if obj.get("confidence") is not None else None }) return _obj diff --git a/talon_one/models/experiment_result.py b/talon_one/models/experiment_result.py index bfff316..8a8c0b8 100644 --- a/talon_one/models/experiment_result.py +++ b/talon_one/models/experiment_result.py @@ -31,7 +31,7 @@ class ExperimentResult(BaseModel): """ # noqa: E501 variants: List[ExperimentVariantResult] confidence: ExperimentVariantResultConfidence - experiment_id: StrictInt = Field(alias="experimentId") + experiment_id: StrictInt = Field(alias="experimentId", json_schema_extra={"examples": [1]}) __properties: ClassVar[List[str]] = ["variants", "confidence", "experimentId"] model_config = ConfigDict( diff --git a/talon_one/models/experiment_segment_insight.py b/talon_one/models/experiment_segment_insight.py index a734e3a..8b5b986 100644 --- a/talon_one/models/experiment_segment_insight.py +++ b/talon_one/models/experiment_segment_insight.py @@ -29,10 +29,10 @@ class ExperimentSegmentInsight(BaseModel): """ ExperimentSegmentInsight """ # noqa: E501 - dimension: StrictStr = Field(description="The segmentation dimension used to group customers or purchases for analysis.") - bucket: StrictStr = Field(description="The specific group within the segmentation dimension.") - confidence: Union[Annotated[float, Field(le=100, strict=True, ge=95)], Annotated[int, Field(le=100, strict=True, ge=95)]] = Field(description="The raw (unadjusted) confidence score expressed as a percentage. Only segments with a confidence score greater than or equal to 95% are returned. ") - winner_variant_id: StrictInt = Field(description="The ID of the variant that performed better in this segment.", alias="winnerVariantId") + dimension: StrictStr = Field(description="The segmentation dimension used to group customers or purchases for analysis.", json_schema_extra={"examples": ["cart_value"]}) + bucket: StrictStr = Field(description="The specific group within the segmentation dimension.", json_schema_extra={"examples": ["high"]}) + confidence: Union[Annotated[float, Field(le=100, strict=True, ge=95)], Annotated[int, Field(le=100, strict=True, ge=95)]] = Field(description="The raw (unadjusted) confidence score expressed as a percentage. Only segments with a confidence score greater than or equal to 95% are returned. ", json_schema_extra={"examples": [99.2]}) + winner_variant_id: StrictInt = Field(description="The ID of the variant that performed better in this segment.", alias="winnerVariantId", json_schema_extra={"examples": [42]}) variants: List[ExperimentSegmentInsightVariant] = Field(description="Per-variant metric values for this segment.") __properties: ClassVar[List[str]] = ["dimension", "bucket", "confidence", "winnerVariantId", "variants"] diff --git a/talon_one/models/experiment_segment_insight_metric.py b/talon_one/models/experiment_segment_insight_metric.py index 035bf05..22af045 100644 --- a/talon_one/models/experiment_segment_insight_metric.py +++ b/talon_one/models/experiment_segment_insight_metric.py @@ -28,7 +28,7 @@ class ExperimentSegmentInsightMetric(BaseModel): """ ExperimentSegmentInsightMetric """ # noqa: E501 - metric: StrictStr = Field(description="The metric being measured.") + metric: StrictStr = Field(description="The metric being measured.", json_schema_extra={"examples": ["avg_session_value"]}) segments: List[ExperimentSegmentInsight] = Field(description="Segments with statistically significant results for this metric. An empty array means no significant segments were found. Segments are sorted by confidence score from highest to lowest. ") __properties: ClassVar[List[str]] = ["metric", "segments"] diff --git a/talon_one/models/experiment_segment_insight_variant.py b/talon_one/models/experiment_segment_insight_variant.py index 745283e..d0049d8 100644 --- a/talon_one/models/experiment_segment_insight_variant.py +++ b/talon_one/models/experiment_segment_insight_variant.py @@ -27,10 +27,10 @@ class ExperimentSegmentInsightVariant(BaseModel): """ ExperimentSegmentInsightVariant """ # noqa: E501 - variant_id: StrictInt = Field(description="The ID of the experiment variant.", alias="variantId") - variant_name: StrictStr = Field(description="The name of the experiment variant.", alias="variantName") - sessions_count: StrictInt = Field(description="The number of sessions in this segment for this variant.", alias="sessionsCount") - value: Union[StrictFloat, StrictInt] = Field(description="The metric value for this variant in the segment.") + variant_id: StrictInt = Field(description="The ID of the experiment variant.", alias="variantId", json_schema_extra={"examples": [41]}) + variant_name: StrictStr = Field(description="The name of the experiment variant.", alias="variantName", json_schema_extra={"examples": ["Control"]}) + sessions_count: StrictInt = Field(description="The number of sessions in this segment for this variant.", alias="sessionsCount", json_schema_extra={"examples": [161]}) + value: Union[StrictFloat, StrictInt] = Field(description="The metric value for this variant in the segment.", json_schema_extra={"examples": [13.13]}) __properties: ClassVar[List[str]] = ["variantId", "variantName", "sessionsCount", "value"] model_config = ConfigDict( diff --git a/talon_one/models/experiment_segment_insights.py b/talon_one/models/experiment_segment_insights.py index bd22dd7..edcd75f 100644 --- a/talon_one/models/experiment_segment_insights.py +++ b/talon_one/models/experiment_segment_insights.py @@ -29,9 +29,9 @@ class ExperimentSegmentInsights(BaseModel): ExperimentSegmentInsights """ # noqa: E501 metrics: List[ExperimentSegmentInsightMetric] = Field(description="Segment insights grouped by metric. This array always contains exactly three metric objects. Each metric includes a segments array, which is empty if no significant results were found. The metrics array itself is empty if the `reason` property is populated. ") - total_segments_tested: StrictInt = Field(description="Total number of segment-metric combinations that were tested for statistical significance. ", alias="totalSegmentsTested") - dimensions_tested: StrictInt = Field(description="Number of segmentation dimensions that had sufficient data variance to test. Dimensions where all sessions fall into a single bucket are excluded. ", alias="dimensionsTested") - reason: StrictStr = Field(description="Empty string when segment insights are available. Contains a reason code when insights could not be computed (e.g., \"insufficient_data\" when the experiment has fewer than 100 sessions per variant). ") + total_segments_tested: StrictInt = Field(description="Total number of segment-metric combinations that were tested for statistical significance. ", alias="totalSegmentsTested", json_schema_extra={"examples": [24]}) + dimensions_tested: StrictInt = Field(description="Number of segmentation dimensions that had sufficient data variance to test. Dimensions where all sessions fall into a single bucket are excluded. ", alias="dimensionsTested", json_schema_extra={"examples": [3]}) + reason: StrictStr = Field(description="Empty string when segment insights are available. Contains a reason code when insights could not be computed (e.g., \"insufficient_data\" when the experiment has fewer than 100 sessions per variant). ", json_schema_extra={"examples": [""]}) __properties: ClassVar[List[str]] = ["metrics", "totalSegmentsTested", "dimensionsTested", "reason"] model_config = ConfigDict( diff --git a/talon_one/models/experiment_variant.py b/talon_one/models/experiment_variant.py index 3382139..39d2015 100644 --- a/talon_one/models/experiment_variant.py +++ b/talon_one/models/experiment_variant.py @@ -29,13 +29,13 @@ class ExperimentVariant(BaseModel): """ ExperimentVariant """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - name: StrictStr - experiment_id: Optional[StrictInt] = Field(default=None, alias="experimentId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + name: StrictStr = Field(json_schema_extra={"examples": ["Variant A"]}) + experiment_id: Optional[StrictInt] = Field(default=None, alias="experimentId", json_schema_extra={"examples": [10]}) ruleset: Optional[Ruleset] = None - weight: Optional[StrictInt] = None - is_primary: StrictBool = Field(alias="isPrimary") + weight: Optional[StrictInt] = Field(default=None, json_schema_extra={"examples": [12]}) + is_primary: StrictBool = Field(alias="isPrimary", json_schema_extra={"examples": [True]}) __properties: ClassVar[List[str]] = ["id", "created", "name", "experimentId", "ruleset", "weight", "isPrimary"] model_config = ConfigDict( diff --git a/talon_one/models/experiment_variant_allocation.py b/talon_one/models/experiment_variant_allocation.py index 037bd43..0c37dfb 100644 --- a/talon_one/models/experiment_variant_allocation.py +++ b/talon_one/models/experiment_variant_allocation.py @@ -27,8 +27,8 @@ class ExperimentVariantAllocation(BaseModel): """ ExperimentVariantAllocation """ # noqa: E501 - experiment_id: StrictInt = Field(description="The ID of the experiment.", alias="experimentID") - variant_id: StrictInt = Field(description="The ID of the variant to be allocated.", alias="variantID") + experiment_id: StrictInt = Field(description="The ID of the experiment.", alias="experimentID", json_schema_extra={"examples": [1]}) + variant_id: StrictInt = Field(description="The ID of the variant to be allocated.", alias="variantID", json_schema_extra={"examples": [2]}) __properties: ClassVar[List[str]] = ["experimentID", "variantID"] model_config = ConfigDict( diff --git a/talon_one/models/experiment_variant_result.py b/talon_one/models/experiment_variant_result.py index df099bd..2445981 100644 --- a/talon_one/models/experiment_variant_result.py +++ b/talon_one/models/experiment_variant_result.py @@ -27,17 +27,17 @@ class ExperimentVariantResult(BaseModel): """ ExperimentVariantResult """ # noqa: E501 - variant_id: Optional[StrictInt] = Field(default=None, description="The ID of the variant.", alias="variantId") - variant_name: Optional[StrictStr] = Field(default=None, description="The name of the variant.", alias="variantName") - variant_weight: Optional[StrictInt] = Field(default=None, description="The weight of the variant.", alias="variantWeight") - is_winner: Optional[StrictBool] = Field(default=None, description="Calculated flag if the variant is the winner.", alias="isWinner") - total_revenue: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total, pre-discount value of all items purchased in a customer session.", alias="totalRevenue") - sessions_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of all closed sessions.", alias="sessionsCount") - avg_items_per_session: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of items from sessions divided by the number of sessions.", alias="avgItemsPerSession") - avg_session_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The average customer session value, calculated by dividing the revenue value by the number of sessions.", alias="avgSessionValue") - avg_discounted_session_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The average customer session value, calculated by dividing the revenue value by the number of sessions.", alias="avgDiscountedSessionValue") - total_discounts: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total value of discounts given for cart items in sessions.", alias="totalDiscounts") - coupons_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of times a coupon was successfully redeemed in sessions.", alias="couponsCount") + variant_id: Optional[StrictInt] = Field(default=None, description="The ID of the variant.", alias="variantId", json_schema_extra={"examples": [1]}) + variant_name: Optional[StrictStr] = Field(default=None, description="The name of the variant.", alias="variantName", json_schema_extra={"examples": ["Variant A"]}) + variant_weight: Optional[StrictInt] = Field(default=None, description="The weight of the variant.", alias="variantWeight", json_schema_extra={"examples": [50]}) + is_winner: Optional[StrictBool] = Field(default=None, description="Calculated flag if the variant is the winner.", alias="isWinner", json_schema_extra={"examples": [True]}) + total_revenue: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total, pre-discount value of all items purchased in a customer session.", alias="totalRevenue", json_schema_extra={"examples": [100]}) + sessions_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of all closed sessions.", alias="sessionsCount", json_schema_extra={"examples": [100]}) + avg_items_per_session: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of items from sessions divided by the number of sessions.", alias="avgItemsPerSession", json_schema_extra={"examples": [100]}) + avg_session_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The average customer session value, calculated by dividing the revenue value by the number of sessions.", alias="avgSessionValue", json_schema_extra={"examples": [100]}) + avg_discounted_session_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The average customer session value, calculated by dividing the revenue value by the number of sessions.", alias="avgDiscountedSessionValue", json_schema_extra={"examples": [100]}) + total_discounts: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total value of discounts given for cart items in sessions.", alias="totalDiscounts", json_schema_extra={"examples": [10]}) + coupons_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of times a coupon was successfully redeemed in sessions.", alias="couponsCount", json_schema_extra={"examples": [12]}) __properties: ClassVar[List[str]] = ["variantId", "variantName", "variantWeight", "isWinner", "totalRevenue", "sessionsCount", "avgItemsPerSession", "avgSessionValue", "avgDiscountedSessionValue", "totalDiscounts", "couponsCount"] model_config = ConfigDict( diff --git a/talon_one/models/experiment_variant_result_confidence.py b/talon_one/models/experiment_variant_result_confidence.py index 7761b22..5203e3f 100644 --- a/talon_one/models/experiment_variant_result_confidence.py +++ b/talon_one/models/experiment_variant_result_confidence.py @@ -27,9 +27,9 @@ class ExperimentVariantResultConfidence(BaseModel): """ ExperimentVariantResultConfidence """ # noqa: E501 - avg_session_value: Union[StrictFloat, StrictInt] = Field(description="The calculated confidence value of the average customer session value.", alias="avgSessionValue") - avg_discounted_session_value: Union[StrictFloat, StrictInt] = Field(description="The calculated confidence value of the average customer discounted session value.", alias="avgDiscountedSessionValue") - avg_items_per_session: Union[StrictFloat, StrictInt] = Field(description="The calculated confidence value of the number of items from sessions value.", alias="avgItemsPerSession") + avg_session_value: Union[StrictFloat, StrictInt] = Field(description="The calculated confidence value of the average customer session value.", alias="avgSessionValue", json_schema_extra={"examples": [100]}) + avg_discounted_session_value: Union[StrictFloat, StrictInt] = Field(description="The calculated confidence value of the average customer discounted session value.", alias="avgDiscountedSessionValue", json_schema_extra={"examples": [100]}) + avg_items_per_session: Union[StrictFloat, StrictInt] = Field(description="The calculated confidence value of the number of items from sessions value.", alias="avgItemsPerSession", json_schema_extra={"examples": [100]}) __properties: ClassVar[List[str]] = ["avgSessionValue", "avgDiscountedSessionValue", "avgItemsPerSession"] model_config = ConfigDict( diff --git a/talon_one/models/expiring_card_points_data.py b/talon_one/models/expiring_card_points_data.py index bbef92b..0e3816d 100644 --- a/talon_one/models/expiring_card_points_data.py +++ b/talon_one/models/expiring_card_points_data.py @@ -30,11 +30,11 @@ class ExpiringCardPointsData(BaseModel): ExpiringCardPointsData """ # noqa: E501 expiry_date: date = Field(description="The expiration date of loyalty points.", alias="ExpiryDate") - loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID") - amount_of_expiring_points: Union[StrictFloat, StrictInt] = Field(description="The amount of loyalty points that will be expired soon.", alias="AmountOfExpiringPoints") - subledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were added.", alias="SubledgerID") - card_identifier: StrictStr = Field(description="The identifier of the loyalty card, `which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. ", alias="CardIdentifier") - users_per_card_limit: Annotated[int, Field(strict=True, ge=0)] = Field(description="The maximum number of customer profiles with which a card can be shared. This can be set to `0` for no limit. ", alias="UsersPerCardLimit") + loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID", json_schema_extra={"examples": [5]}) + amount_of_expiring_points: Union[StrictFloat, StrictInt] = Field(description="The amount of loyalty points that will be expired soon.", alias="AmountOfExpiringPoints", json_schema_extra={"examples": [10.99]}) + subledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were added.", alias="SubledgerID", json_schema_extra={"examples": ["sub-123"]}) + card_identifier: StrictStr = Field(description="The identifier of the loyalty card, `which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. ", alias="CardIdentifier", json_schema_extra={"examples": ["summer-loyalty-card-0543"]}) + users_per_card_limit: Annotated[int, Field(strict=True, ge=0)] = Field(description="The maximum number of customer profiles with which a card can be shared. This can be set to `0` for no limit. ", alias="UsersPerCardLimit", json_schema_extra={"examples": [5]}) profiles: List[StrictStr] = Field(description="The integration IDs of the customer profiles linked to the card.", alias="Profiles") __properties: ClassVar[List[str]] = ["ExpiryDate", "LoyaltyProgramID", "AmountOfExpiringPoints", "SubledgerID", "CardIdentifier", "UsersPerCardLimit", "Profiles"] diff --git a/talon_one/models/expiring_card_points_notification.py b/talon_one/models/expiring_card_points_notification.py index ba23887..5a78728 100644 --- a/talon_one/models/expiring_card_points_notification.py +++ b/talon_one/models/expiring_card_points_notification.py @@ -28,7 +28,7 @@ class ExpiringCardPointsNotification(BaseModel): """ ExpiringCardPointsNotification """ # noqa: E501 - total_result_size: StrictInt = Field(alias="TotalResultSize") + total_result_size: StrictInt = Field(alias="TotalResultSize", json_schema_extra={"examples": [1]}) data: List[ExpiringCardPointsData] = Field(description="The array of expiring points.", alias="Data") notification_type: StrictStr = Field(description="The type of notification.", alias="NotificationType") __properties: ClassVar[List[str]] = ["TotalResultSize", "Data", "NotificationType"] diff --git a/talon_one/models/expiring_coupons_data.py b/talon_one/models/expiring_coupons_data.py index 45abba1..3ea9cd8 100644 --- a/talon_one/models/expiring_coupons_data.py +++ b/talon_one/models/expiring_coupons_data.py @@ -29,15 +29,15 @@ class ExpiringCouponsData(BaseModel): """ ExpiringCouponsData """ # noqa: E501 - coupon_value: StrictStr = Field(description="The coupon code.", alias="CouponValue") - created_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon was created.", alias="CreatedDate") - valid_from: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon becomes valid.", alias="ValidFrom") - valid_until: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon expires. Coupon never expires if this is omitted, zero, or negative.", alias="ValidUntil") - campaign_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the campaign to which the coupon belongs.", alias="CampaignId") - customer_profile_id: Optional[StrictStr] = Field(default=None, description="The Integration ID of the customer that is allowed to redeem this coupon.", alias="CustomerProfileId") - usage_limit: Annotated[int, Field(le=999999, strict=True, ge=0)] = Field(description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="UsageLimit") - usage_counter: StrictInt = Field(description="The number of times the coupon has been successfully redeemed.", alias="UsageCounter") - batch_id: Optional[StrictStr] = Field(default=None, description="The ID of the batch the coupon belongs to.", alias="BatchId") + coupon_value: StrictStr = Field(description="The coupon code.", alias="CouponValue", json_schema_extra={"examples": ["XMAS-20-2021"]}) + created_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon was created.", alias="CreatedDate", json_schema_extra={"examples": ["2024-07-24T14:15:22Z"]}) + valid_from: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon becomes valid.", alias="ValidFrom", json_schema_extra={"examples": ["2024-10-24T14:15:22Z"]}) + valid_until: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon expires. Coupon never expires if this is omitted, zero, or negative.", alias="ValidUntil", json_schema_extra={"examples": ["2024-12-24T14:15:22Z"]}) + campaign_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the campaign to which the coupon belongs.", alias="CampaignId", json_schema_extra={"examples": [3]}) + customer_profile_id: Optional[StrictStr] = Field(default=None, description="The Integration ID of the customer that is allowed to redeem this coupon.", alias="CustomerProfileId", json_schema_extra={"examples": ["URNGV8294NV"]}) + usage_limit: Annotated[int, Field(le=999999, strict=True, ge=0)] = Field(description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="UsageLimit", json_schema_extra={"examples": [100]}) + usage_counter: StrictInt = Field(description="The number of times the coupon has been successfully redeemed.", alias="UsageCounter", json_schema_extra={"examples": [10]}) + batch_id: Optional[StrictStr] = Field(default=None, description="The ID of the batch the coupon belongs to.", alias="BatchId", json_schema_extra={"examples": ["32535-43255"]}) attributes: Dict[str, Any] = Field(description="Custom attributes associated with this coupon.", alias="Attributes") __properties: ClassVar[List[str]] = ["CouponValue", "CreatedDate", "ValidFrom", "ValidUntil", "CampaignId", "CustomerProfileId", "UsageLimit", "UsageCounter", "BatchId", "Attributes"] diff --git a/talon_one/models/expiring_coupons_notification.py b/talon_one/models/expiring_coupons_notification.py index f0d7778..0ba378b 100644 --- a/talon_one/models/expiring_coupons_notification.py +++ b/talon_one/models/expiring_coupons_notification.py @@ -28,7 +28,7 @@ class ExpiringCouponsNotification(BaseModel): """ ExpiringCouponsNotification """ # noqa: E501 - total_result_size: StrictInt = Field(alias="TotalResultSize") + total_result_size: StrictInt = Field(alias="TotalResultSize", json_schema_extra={"examples": [1]}) data: List[ExpiringCouponsData] = Field(description="The array of expiring coupon notifications.", alias="Data") notification_type: StrictStr = Field(description="The type of notification.", alias="NotificationType") __properties: ClassVar[List[str]] = ["TotalResultSize", "Data", "NotificationType"] diff --git a/talon_one/models/expiring_coupons_notification_policy.py b/talon_one/models/expiring_coupons_notification_policy.py index 6764c87..e9873ef 100644 --- a/talon_one/models/expiring_coupons_notification_policy.py +++ b/talon_one/models/expiring_coupons_notification_policy.py @@ -29,10 +29,10 @@ class ExpiringCouponsNotificationPolicy(BaseModel): """ ExpiringCouponsNotificationPolicy """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.", json_schema_extra={"examples": ["Notification to Google"]}) triggers: Annotated[List[ExpiringCouponsNotificationTrigger], Field(min_length=1, max_length=3)] - batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled") - batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize") + batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled", json_schema_extra={"examples": [True]}) + batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize", json_schema_extra={"examples": [1000]}) __properties: ClassVar[List[str]] = ["name", "triggers", "batchingEnabled", "batchSize"] model_config = ConfigDict( diff --git a/talon_one/models/expiring_points_data.py b/talon_one/models/expiring_points_data.py index 001a62e..e9e13b4 100644 --- a/talon_one/models/expiring_points_data.py +++ b/talon_one/models/expiring_points_data.py @@ -30,10 +30,10 @@ class ExpiringPointsData(BaseModel): ExpiringPointsData """ # noqa: E501 expiry_date: date = Field(description="The expiration date of loyalty points.", alias="ExpiryDate") - loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID") - customer_profile_id: StrictStr = Field(description="The integration ID of the customer profile that has expiring points.", alias="CustomerProfileID") - amount_of_expiring_points: Union[StrictFloat, StrictInt] = Field(description="The amount of loyalty points that will be expired soon.", alias="AmountOfExpiringPoints") - subledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were added.", alias="SubledgerID") + loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID", json_schema_extra={"examples": [5]}) + customer_profile_id: StrictStr = Field(description="The integration ID of the customer profile that has expiring points.", alias="CustomerProfileID", json_schema_extra={"examples": ["URNGV8294NV"]}) + amount_of_expiring_points: Union[StrictFloat, StrictInt] = Field(description="The amount of loyalty points that will be expired soon.", alias="AmountOfExpiringPoints", json_schema_extra={"examples": [10.99]}) + subledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were added.", alias="SubledgerID", json_schema_extra={"examples": ["sub-123"]}) __properties: ClassVar[List[str]] = ["ExpiryDate", "LoyaltyProgramID", "CustomerProfileID", "AmountOfExpiringPoints", "SubledgerID"] model_config = ConfigDict( diff --git a/talon_one/models/expiring_points_notification.py b/talon_one/models/expiring_points_notification.py index 21db5cf..3c2ba6e 100644 --- a/talon_one/models/expiring_points_notification.py +++ b/talon_one/models/expiring_points_notification.py @@ -28,7 +28,7 @@ class ExpiringPointsNotification(BaseModel): """ ExpiringPointsNotification """ # noqa: E501 - total_result_size: StrictInt = Field(alias="TotalResultSize") + total_result_size: StrictInt = Field(alias="TotalResultSize", json_schema_extra={"examples": [1]}) data: List[ExpiringPointsData] = Field(description="The array of expiring points.", alias="Data") notification_type: StrictStr = Field(description="The type of notification.", alias="NotificationType") __properties: ClassVar[List[str]] = ["TotalResultSize", "Data", "NotificationType"] diff --git a/talon_one/models/expiring_points_notification_policy.py b/talon_one/models/expiring_points_notification_policy.py index 4cdc6eb..fece82c 100644 --- a/talon_one/models/expiring_points_notification_policy.py +++ b/talon_one/models/expiring_points_notification_policy.py @@ -29,10 +29,10 @@ class ExpiringPointsNotificationPolicy(BaseModel): """ ExpiringPointsNotificationPolicy """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.", json_schema_extra={"examples": ["Notification to Google"]}) triggers: Annotated[List[ExpiringPointsNotificationTrigger], Field(min_length=1, max_length=3)] - batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled") - batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize") + batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled", json_schema_extra={"examples": [True]}) + batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize", json_schema_extra={"examples": [1000]}) __properties: ClassVar[List[str]] = ["name", "triggers", "batchingEnabled", "batchSize"] model_config = ConfigDict( diff --git a/talon_one/models/export.py b/talon_one/models/export.py index 98852f0..5265a00 100644 --- a/talon_one/models/export.py +++ b/talon_one/models/export.py @@ -28,12 +28,12 @@ class Export(BaseModel): """ Export """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - user_id: StrictInt = Field(description="The ID of the user associated with this entity.", alias="userId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + 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="Map of keys and values that were used to filter the exported rows.") + filter: Dict[str, Any] = Field(description="Arbitrary properties associated with this campaign.") __properties: ClassVar[List[str]] = ["id", "created", "accountId", "userId", "entity", "filter"] @field_validator('entity') diff --git a/talon_one/models/extend_loyalty_points_expiry_date_effect_props.py b/talon_one/models/extend_loyalty_points_expiry_date_effect_props.py index 36fb619..425ffe3 100644 --- a/talon_one/models/extend_loyalty_points_expiry_date_effect_props.py +++ b/talon_one/models/extend_loyalty_points_expiry_date_effect_props.py @@ -26,11 +26,11 @@ class ExtendLoyaltyPointsExpiryDateEffectProps(BaseModel): """ - The properties specific to the \"extendLoyaltyPointsExpiryDate\" effect. This gets triggered when a validated rule contains the \"extend expiry date\" effect. The current expiry date gets extended by the time frame given in the effect. + If loyalty points have an expiry date, this effect extends the expiry of all active and pending point transactions by a selected duration. """ # noqa: E501 program_id: StrictInt = Field(description="ID of the loyalty program that contains these points.", alias="programId") - sub_ledger_id: StrictStr = Field(description="API name of the loyalty program subledger that contains these points. added.", alias="subLedgerId") - extension_duration: StrictStr = Field(description="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. ", alias="extensionDuration") + sub_ledger_id: StrictStr = Field(description="API name of the loyalty program subledger that contains these points.", alias="subLedgerId") + extension_duration: StrictStr = Field(description="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. ", alias="extensionDuration", json_schema_extra={"examples": ["12h"]}) affected_transactions: Optional[List[LoyaltyLedgerEntryExpiryDateChange]] = Field(default=None, description="List of transactions affected by the expiry date update.", alias="affectedTransactions") __properties: ClassVar[List[str]] = ["programId", "subLedgerId", "extensionDuration", "affectedTransactions"] diff --git a/talon_one/models/extended_coupon.py b/talon_one/models/extended_coupon.py index 2c983ce..67d6878 100644 --- a/talon_one/models/extended_coupon.py +++ b/talon_one/models/extended_coupon.py @@ -30,28 +30,28 @@ class ExtendedCoupon(BaseModel): """ ExtendedCoupon """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of the coupon.") - created: datetime = Field(description="The time the coupon was created.") - campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId") - value: Optional[Annotated[str, Field(min_length=4, strict=True)]] = Field(default=None, description="The coupon code.") - usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit") - discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit") - 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") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the coupon. Coupon never expires if this is omitted.", alias="expiryDate") + id: StrictInt = Field(description="The internal ID of the coupon.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time the coupon was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId", json_schema_extra={"examples": [211]}) + value: Optional[Annotated[str, Field(min_length=4, strict=True)]] = Field(default=None, description="The coupon code.", json_schema_extra={"examples": ["XMAS-20-2021"]}) + usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit", json_schema_extra={"examples": [100]}) + discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit", json_schema_extra={"examples": [30]}) + 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"]}) 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. ") - usage_counter: StrictInt = Field(description="The number of times the coupon has been successfully redeemed.", alias="usageCounter") - discount_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.", alias="discountCounter") - discount_remainder: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The remaining discount this coupon can give.", alias="discountRemainder") - reservation_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of times this coupon has been reserved.", alias="reservationCounter") + usage_counter: StrictInt = Field(description="The number of times the coupon has been successfully redeemed.", alias="usageCounter", json_schema_extra={"examples": [10]}) + discount_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.", alias="discountCounter", json_schema_extra={"examples": [10]}) + discount_remainder: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The remaining discount this coupon can give.", alias="discountRemainder", json_schema_extra={"examples": [5]}) + reservation_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of times this coupon has been reserved.", alias="reservationCounter", json_schema_extra={"examples": [1]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="Custom attributes associated with this coupon.") - referral_id: Optional[StrictInt] = Field(default=None, description="The integration ID of the referring customer (if any) for whom this coupon was created as an effect.", alias="referralId") - recipient_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The Integration ID of the customer that is allowed to redeem this coupon.", alias="recipientIntegrationId") - import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this coupon.", alias="importId") - reservation: Optional[StrictBool] = Field(default=True, description="Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code. ") - batch_id: Optional[StrictStr] = Field(default=None, description="The id of the batch the coupon belongs to.", alias="batchId") - 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") - implicitly_reserved: Optional[StrictBool] = Field(default=None, description="An indication of whether the coupon is implicitly reserved for all customers.", alias="implicitlyReserved") + referral_id: Optional[StrictInt] = Field(default=None, description="The integration ID of the referring customer (if any) for whom this coupon was created as an effect.", alias="referralId", json_schema_extra={"examples": [326632952]}) + recipient_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The Integration ID of the customer that is allowed to redeem this coupon.", alias="recipientIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this coupon.", alias="importId", json_schema_extra={"examples": [4]}) + reservation: Optional[StrictBool] = Field(default=True, description="Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code. ", json_schema_extra={"examples": [False]}) + batch_id: Optional[StrictStr] = Field(default=None, description="The id of the batch the coupon belongs to.", alias="batchId", json_schema_extra={"examples": ["32535-43255"]}) + 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]}) application_id: StrictInt = Field(description="The ID of the application.", alias="ApplicationId") __properties: ClassVar[List[str]] = ["id", "created", "campaignId", "value", "usageLimit", "discountLimit", "reservationLimit", "startDate", "expiryDate", "limits", "usageCounter", "discountCounter", "discountRemainder", "reservationCounter", "attributes", "referralId", "recipientIntegrationId", "importId", "reservation", "batchId", "isReservationMandatory", "implicitlyReserved", "ApplicationId"] diff --git a/talon_one/models/feature_flag.py b/talon_one/models/feature_flag.py index 72bf15f..a85ccd7 100644 --- a/talon_one/models/feature_flag.py +++ b/talon_one/models/feature_flag.py @@ -28,10 +28,10 @@ class FeatureFlag(BaseModel): """ FeatureFlag """ # noqa: E501 - name: StrictStr = Field(description="The name of the feature flag.") - value: StrictStr = Field(description="The value of the feature flag.") - created: Optional[datetime] = Field(default=None, description="The time this entity was last created.") - modified: Optional[datetime] = Field(default=None, description="The time this entity was last modified.") + name: StrictStr = Field(description="The name of the feature flag.", json_schema_extra={"examples": ["canCreateCampaignFromTemplate"]}) + value: StrictStr = Field(description="The value of the feature flag.", json_schema_extra={"examples": ["true"]}) + created: Optional[datetime] = Field(default=None, description="The time this entity was last created.", json_schema_extra={"examples": ["2021-09-22T12:24:14.956203Z"]}) + modified: Optional[datetime] = Field(default=None, description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-25T10:34:12.956203Z"]}) __properties: ClassVar[List[str]] = ["name", "value", "created", "modified"] model_config = ConfigDict( diff --git a/talon_one/models/feature_flag_update.py b/talon_one/models/feature_flag_update.py index 7c48602..af2bc65 100644 --- a/talon_one/models/feature_flag_update.py +++ b/talon_one/models/feature_flag_update.py @@ -27,8 +27,8 @@ class FeatureFlagUpdate(BaseModel): """ FeatureFlagUpdate """ # noqa: E501 - name: StrictStr = Field(description="The name of the feature flag.") - value: StrictStr = Field(description="The value of the feature flag.") + name: StrictStr = Field(description="The name of the feature flag.", json_schema_extra={"examples": ["canCreateCampaignFromTemplate"]}) + value: StrictStr = Field(description="The value of the feature flag.", json_schema_extra={"examples": ["true"]}) __properties: ClassVar[List[str]] = ["name", "value"] model_config = ConfigDict( diff --git a/talon_one/models/generate_coupon_failure_detailed_summary.py b/talon_one/models/generate_coupon_failure_detailed_summary.py index bcdeb7f..4d491ab 100644 --- a/talon_one/models/generate_coupon_failure_detailed_summary.py +++ b/talon_one/models/generate_coupon_failure_detailed_summary.py @@ -29,10 +29,10 @@ class GenerateCouponFailureDetailedSummary(BaseModel): GenerateCouponFailureDetailedSummary """ # noqa: E501 application_id: Union[StrictFloat, StrictInt] = Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.", alias="applicationID") - session_id: Annotated[str, Field(strict=True, max_length=255)] = Field(description="ID of the customer session where the coupon redemption failed.", alias="sessionID") + session_id: Annotated[str, Field(strict=True, max_length=255)] = Field(description="ID of the customer session where the coupon redemption failed.", alias="sessionID", json_schema_extra={"examples": ["05c2da0d-48fa-4aa1-b629-898f58f1584d"]}) event_id: StrictInt = Field(description="The ID of the event for which the coupon redemption failed.", alias="eventID") - coupon: StrictStr = Field(description="The coupon code that could not be redeemed.") - language: Optional[StrictStr] = Field(default=None, description="The language of the summary.") + coupon: StrictStr = Field(description="The coupon code that could not be redeemed.", json_schema_extra={"examples": ["BKDB946"]}) + language: Optional[StrictStr] = Field(default=None, description="The language of the summary.", json_schema_extra={"examples": ["en"]}) __properties: ClassVar[List[str]] = ["applicationID", "sessionID", "eventID", "coupon", "language"] model_config = ConfigDict( diff --git a/talon_one/models/generate_coupon_failure_summary.py b/talon_one/models/generate_coupon_failure_summary.py index 2055942..5e25762 100644 --- a/talon_one/models/generate_coupon_failure_summary.py +++ b/talon_one/models/generate_coupon_failure_summary.py @@ -28,7 +28,7 @@ class GenerateCouponFailureSummary(BaseModel): GenerateCouponFailureSummary """ # noqa: E501 event_id: StrictInt = Field(description="The ID of the event.", alias="eventID") - language: Optional[StrictStr] = Field(default=None, description="The language the summary will be generated in.") + language: Optional[StrictStr] = Field(default=None, description="The language the summary will be generated in.", json_schema_extra={"examples": ["en"]}) __properties: ClassVar[List[str]] = ["eventID", "language"] model_config = ConfigDict( diff --git a/talon_one/models/generate_item_filter_description.py b/talon_one/models/generate_item_filter_description.py index 93cd3ef..cbced98 100644 --- a/talon_one/models/generate_item_filter_description.py +++ b/talon_one/models/generate_item_filter_description.py @@ -27,7 +27,7 @@ class GenerateItemFilterDescription(BaseModel): """ GenerateItemFilterDescription """ # noqa: E501 - item_filter: List[Dict[str, Any]] = Field(description="An array of item filter Talang expressions.", alias="itemFilter") + item_filter: List[Dict[str, Any]] = Field(description="An array of item filter Talang expressions.", alias="itemFilter", json_schema_extra={"examples": [["filter", [".", "Session", "CartItems"], [["Item"], ["catch", False, ["and", ["!=", [".", "Item", "Attributes", "c_productType"], "egiftcard"]]]]]]}) __properties: ClassVar[List[str]] = ["itemFilter"] model_config = ConfigDict( diff --git a/talon_one/models/generate_loyalty_card.py b/talon_one/models/generate_loyalty_card.py index 89b260a..a0fe7c9 100644 --- a/talon_one/models/generate_loyalty_card.py +++ b/talon_one/models/generate_loyalty_card.py @@ -28,9 +28,9 @@ class GenerateLoyaltyCard(BaseModel): """ The parameters necessary to generate a loyalty card. """ # noqa: E501 - status: Optional[StrictStr] = Field(default='active', description="Status of the loyalty card.") - customer_profile_ids: Optional[List[StrictStr]] = Field(default=None, description="Integration IDs of the customer profiles linked to the card.", alias="customerProfileIds") - card_identifier: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=108)]] = Field(default=None, description="The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. ", alias="cardIdentifier") + status: Optional[StrictStr] = Field(default='active', description="Status of the loyalty card.", json_schema_extra={"examples": ["active"]}) + customer_profile_ids: Optional[List[StrictStr]] = Field(default=None, description="Integration IDs of the customer profiles linked to the card.", alias="customerProfileIds", json_schema_extra={"examples": [["R195412", "G244519"]]}) + card_identifier: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=108)]] = Field(default=None, description="The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. ", alias="cardIdentifier", json_schema_extra={"examples": ["summer-loyalty-card-0543"]}) __properties: ClassVar[List[str]] = ["status", "customerProfileIds", "cardIdentifier"] @field_validator('status') diff --git a/talon_one/models/generate_rule_title_rule.py b/talon_one/models/generate_rule_title_rule.py index f4b8740..f8e9818 100644 --- a/talon_one/models/generate_rule_title_rule.py +++ b/talon_one/models/generate_rule_title_rule.py @@ -28,8 +28,8 @@ class GenerateRuleTitleRule(BaseModel): """ GenerateRuleTitleRule """ # noqa: E501 - effects: Optional[List[Dict[str, Any]]] = Field(default=None, description="An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.") - condition: Optional[Annotated[List[Any], Field(min_length=1)]] = Field(default=None, description="A Talang expression that will be evaluated in the context of the given event.") + effects: Optional[List[Dict[str, Any]]] = Field(default=None, description="An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.", json_schema_extra={"examples": [["catch", ["noop"], ["setDiscount", "10% off", ["*", [".", "Session", "Total"], ["/", 10, 100]]]]]}) + condition: Optional[Annotated[List[Any], Field(min_length=1)]] = Field(default=None, description="A Talang expression that will be evaluated in the context of the given event.", json_schema_extra={"examples": [["and", ["couponValid"]]]}) __properties: ClassVar[List[str]] = ["effects", "condition"] model_config = ConfigDict( diff --git a/talon_one/models/get_additional_costs200_response.py b/talon_one/models/get_additional_costs200_response.py index 5192441..4d1fe5f 100644 --- a/talon_one/models/get_additional_costs200_response.py +++ b/talon_one/models/get_additional_costs200_response.py @@ -28,7 +28,7 @@ class GetAdditionalCosts200Response(BaseModel): """ GetAdditionalCosts200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[AccountAdditionalCost] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/get_application_customer_friends200_response.py b/talon_one/models/get_application_customer_friends200_response.py index 191238b..4c925da 100644 --- a/talon_one/models/get_application_customer_friends200_response.py +++ b/talon_one/models/get_application_customer_friends200_response.py @@ -29,7 +29,7 @@ class GetApplicationCustomerFriends200Response(BaseModel): GetApplicationCustomerFriends200Response """ # noqa: E501 has_more: Optional[StrictBool] = Field(default=None, alias="hasMore") - total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize") + total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[ApplicationReferee] __properties: ClassVar[List[str]] = ["hasMore", "totalResultSize", "data"] diff --git a/talon_one/models/get_application_customers200_response.py b/talon_one/models/get_application_customers200_response.py index d003531..8d66eff 100644 --- a/talon_one/models/get_application_customers200_response.py +++ b/talon_one/models/get_application_customers200_response.py @@ -28,7 +28,7 @@ class GetApplicationCustomers200Response(BaseModel): """ GetApplicationCustomers200Response """ # noqa: E501 - total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize") + total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize", json_schema_extra={"examples": [1]}) has_more: Optional[StrictBool] = Field(default=None, alias="hasMore") data: List[ApplicationCustomer] __properties: ClassVar[List[str]] = ["totalResultSize", "hasMore", "data"] diff --git a/talon_one/models/get_application_event_types200_response.py b/talon_one/models/get_application_event_types200_response.py index f3593f7..5d6b1f8 100644 --- a/talon_one/models/get_application_event_types200_response.py +++ b/talon_one/models/get_application_event_types200_response.py @@ -27,7 +27,7 @@ class GetApplicationEventTypes200Response(BaseModel): """ GetApplicationEventTypes200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[StrictStr] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/get_applications200_response.py b/talon_one/models/get_applications200_response.py index 1c21038..6e12aca 100644 --- a/talon_one/models/get_applications200_response.py +++ b/talon_one/models/get_applications200_response.py @@ -28,7 +28,7 @@ class GetApplications200Response(BaseModel): """ GetApplications200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[Application] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/get_attributes200_response.py b/talon_one/models/get_attributes200_response.py index 94a6943..2b1ded2 100644 --- a/talon_one/models/get_attributes200_response.py +++ b/talon_one/models/get_attributes200_response.py @@ -28,7 +28,7 @@ class GetAttributes200Response(BaseModel): """ GetAttributes200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[Attribute] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/get_audiences200_response.py b/talon_one/models/get_audiences200_response.py index 731b008..ee78c01 100644 --- a/talon_one/models/get_audiences200_response.py +++ b/talon_one/models/get_audiences200_response.py @@ -29,7 +29,7 @@ class GetAudiences200Response(BaseModel): GetAudiences200Response """ # noqa: E501 has_more: Optional[StrictBool] = Field(default=None, alias="hasMore") - total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize") + total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[Audience] __properties: ClassVar[List[str]] = ["hasMore", "totalResultSize", "data"] diff --git a/talon_one/models/get_campaign_analytics200_response.py b/talon_one/models/get_campaign_analytics200_response.py index 35cef8f..1cd4db1 100644 --- a/talon_one/models/get_campaign_analytics200_response.py +++ b/talon_one/models/get_campaign_analytics200_response.py @@ -28,7 +28,7 @@ class GetCampaignAnalytics200Response(BaseModel): """ GetCampaignAnalytics200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[CampaignAnalytics] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/get_campaign_groups200_response.py b/talon_one/models/get_campaign_groups200_response.py index 93852d6..588d62f 100644 --- a/talon_one/models/get_campaign_groups200_response.py +++ b/talon_one/models/get_campaign_groups200_response.py @@ -28,7 +28,7 @@ class GetCampaignGroups200Response(BaseModel): """ GetCampaignGroups200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[CampaignGroup] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/get_campaign_templates200_response.py b/talon_one/models/get_campaign_templates200_response.py index 79757fa..f277d6b 100644 --- a/talon_one/models/get_campaign_templates200_response.py +++ b/talon_one/models/get_campaign_templates200_response.py @@ -28,7 +28,7 @@ class GetCampaignTemplates200Response(BaseModel): """ GetCampaignTemplates200Response """ # noqa: E501 - has_more: StrictBool = Field(alias="hasMore") + has_more: StrictBool = Field(alias="hasMore", json_schema_extra={"examples": [True]}) data: List[CampaignTemplate] __properties: ClassVar[List[str]] = ["hasMore", "data"] diff --git a/talon_one/models/get_campaigns200_response.py b/talon_one/models/get_campaigns200_response.py index cdb0d96..9263e6a 100644 --- a/talon_one/models/get_campaigns200_response.py +++ b/talon_one/models/get_campaigns200_response.py @@ -28,7 +28,7 @@ class GetCampaigns200Response(BaseModel): """ GetCampaigns200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[Campaign] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/get_changes200_response.py b/talon_one/models/get_changes200_response.py index 4342209..3de8b77 100644 --- a/talon_one/models/get_changes200_response.py +++ b/talon_one/models/get_changes200_response.py @@ -28,7 +28,7 @@ class GetChanges200Response(BaseModel): """ GetChanges200Response """ # noqa: E501 - total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize") + total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize", json_schema_extra={"examples": [1]}) has_more: Optional[StrictBool] = Field(default=None, alias="hasMore") data: List[Change] __properties: ClassVar[List[str]] = ["totalResultSize", "hasMore", "data"] diff --git a/talon_one/models/get_coupons_without_total_count200_response.py b/talon_one/models/get_coupons_without_total_count200_response.py index d797303..7a999fc 100644 --- a/talon_one/models/get_coupons_without_total_count200_response.py +++ b/talon_one/models/get_coupons_without_total_count200_response.py @@ -28,7 +28,7 @@ class GetCouponsWithoutTotalCount200Response(BaseModel): """ GetCouponsWithoutTotalCount200Response """ # noqa: E501 - has_more: StrictBool = Field(alias="hasMore") + has_more: StrictBool = Field(alias="hasMore", json_schema_extra={"examples": [True]}) data: List[Coupon] __properties: ClassVar[List[str]] = ["hasMore", "data"] diff --git a/talon_one/models/get_customer_achievement_history200_response.py b/talon_one/models/get_customer_achievement_history200_response.py index 2f93995..36c88ff 100644 --- a/talon_one/models/get_customer_achievement_history200_response.py +++ b/talon_one/models/get_customer_achievement_history200_response.py @@ -28,7 +28,7 @@ class GetCustomerAchievementHistory200Response(BaseModel): """ GetCustomerAchievementHistory200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[AchievementProgress] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/get_customer_achievements200_response.py b/talon_one/models/get_customer_achievements200_response.py index 4a06626..4f71579 100644 --- a/talon_one/models/get_customer_achievements200_response.py +++ b/talon_one/models/get_customer_achievements200_response.py @@ -28,7 +28,7 @@ class GetCustomerAchievements200Response(BaseModel): """ GetCustomerAchievements200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[AchievementStatusEntry] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/get_customer_profile_achievement_progress200_response.py b/talon_one/models/get_customer_profile_achievement_progress200_response.py index 5f83c02..992a146 100644 --- a/talon_one/models/get_customer_profile_achievement_progress200_response.py +++ b/talon_one/models/get_customer_profile_achievement_progress200_response.py @@ -28,7 +28,7 @@ class GetCustomerProfileAchievementProgress200Response(BaseModel): """ GetCustomerProfileAchievementProgress200Response """ # noqa: E501 - has_more: StrictBool = Field(alias="hasMore") + has_more: StrictBool = Field(alias="hasMore", json_schema_extra={"examples": [True]}) data: List[AchievementProgressWithDefinition] __properties: ClassVar[List[str]] = ["hasMore", "data"] diff --git a/talon_one/models/get_dashboard_statistics200_response.py b/talon_one/models/get_dashboard_statistics200_response.py index afb2a1e..c5fa1d5 100644 --- a/talon_one/models/get_dashboard_statistics200_response.py +++ b/talon_one/models/get_dashboard_statistics200_response.py @@ -28,7 +28,7 @@ class GetDashboardStatistics200Response(BaseModel): """ GetDashboardStatistics200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[LoyaltyDashboardData] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/get_event_types200_response.py b/talon_one/models/get_event_types200_response.py index a1701ed..35479a3 100644 --- a/talon_one/models/get_event_types200_response.py +++ b/talon_one/models/get_event_types200_response.py @@ -28,7 +28,7 @@ class GetEventTypes200Response(BaseModel): """ GetEventTypes200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[EventType] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/get_exports200_response.py b/talon_one/models/get_exports200_response.py index aade45f..27d699f 100644 --- a/talon_one/models/get_exports200_response.py +++ b/talon_one/models/get_exports200_response.py @@ -28,7 +28,7 @@ class GetExports200Response(BaseModel): """ GetExports200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[Export] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/get_integration_coupon_request.py b/talon_one/models/get_integration_coupon_request.py index c0f4512..f495e75 100644 --- a/talon_one/models/get_integration_coupon_request.py +++ b/talon_one/models/get_integration_coupon_request.py @@ -28,7 +28,7 @@ class GetIntegrationCouponRequest(BaseModel): """ GetIntegrationCouponRequest """ # noqa: E501 - campaign_ids: List[StrictInt] = Field(description="A list of IDs of the campaigns to get coupons from.", alias="campaignIds") + campaign_ids: List[StrictInt] = Field(description="A list of IDs of the campaigns to get coupons from.", alias="campaignIds", json_schema_extra={"examples": [[1, 2, 3]]}) limit: Annotated[int, Field(le=1000, strict=True, ge=1)] = Field(description="The maximum number of coupons included in the response.") __properties: ClassVar[List[str]] = ["campaignIds", "limit"] diff --git a/talon_one/models/get_loyalty_card_points200_response.py b/talon_one/models/get_loyalty_card_points200_response.py index e00705f..20e9ebd 100644 --- a/talon_one/models/get_loyalty_card_points200_response.py +++ b/talon_one/models/get_loyalty_card_points200_response.py @@ -28,7 +28,7 @@ class GetLoyaltyCardPoints200Response(BaseModel): """ GetLoyaltyCardPoints200Response """ # noqa: E501 - has_more: StrictBool = Field(alias="hasMore") + has_more: StrictBool = Field(alias="hasMore", json_schema_extra={"examples": [True]}) data: List[CardLedgerPointsEntryIntegrationAPI] __properties: ClassVar[List[str]] = ["hasMore", "data"] diff --git a/talon_one/models/get_loyalty_card_transaction_logs200_response.py b/talon_one/models/get_loyalty_card_transaction_logs200_response.py index 325ae65..cd95b00 100644 --- a/talon_one/models/get_loyalty_card_transaction_logs200_response.py +++ b/talon_one/models/get_loyalty_card_transaction_logs200_response.py @@ -28,7 +28,7 @@ class GetLoyaltyCardTransactionLogs200Response(BaseModel): """ GetLoyaltyCardTransactionLogs200Response """ # noqa: E501 - has_more: StrictBool = Field(description="true means there is more data in the source collection to request..", alias="hasMore") + has_more: StrictBool = Field(description="true means there is more data in the source collection to request..", alias="hasMore", json_schema_extra={"examples": [True]}) data: List[CardLedgerTransactionLogEntry] = Field(description="List of loyalty card transaction logs.") __properties: ClassVar[List[str]] = ["hasMore", "data"] diff --git a/talon_one/models/get_loyalty_card_transactions200_response.py b/talon_one/models/get_loyalty_card_transactions200_response.py index bb3d497..ef4746d 100644 --- a/talon_one/models/get_loyalty_card_transactions200_response.py +++ b/talon_one/models/get_loyalty_card_transactions200_response.py @@ -28,7 +28,7 @@ class GetLoyaltyCardTransactions200Response(BaseModel): """ GetLoyaltyCardTransactions200Response """ # noqa: E501 - has_more: StrictBool = Field(alias="hasMore") + has_more: StrictBool = Field(alias="hasMore", json_schema_extra={"examples": [True]}) data: List[CardLedgerTransactionLogEntryIntegrationAPI] __properties: ClassVar[List[str]] = ["hasMore", "data"] diff --git a/talon_one/models/get_loyalty_cards200_response.py b/talon_one/models/get_loyalty_cards200_response.py index f3d1346..90013a7 100644 --- a/talon_one/models/get_loyalty_cards200_response.py +++ b/talon_one/models/get_loyalty_cards200_response.py @@ -28,7 +28,7 @@ class GetLoyaltyCards200Response(BaseModel): """ GetLoyaltyCards200Response """ # noqa: E501 - has_more: StrictBool = Field(alias="hasMore") + has_more: StrictBool = Field(alias="hasMore", json_schema_extra={"examples": [True]}) data: List[LoyaltyCard] __properties: ClassVar[List[str]] = ["hasMore", "data"] diff --git a/talon_one/models/get_loyalty_program_profile_points200_response.py b/talon_one/models/get_loyalty_program_profile_points200_response.py index 48d799e..64dd9f0 100644 --- a/talon_one/models/get_loyalty_program_profile_points200_response.py +++ b/talon_one/models/get_loyalty_program_profile_points200_response.py @@ -28,7 +28,7 @@ class GetLoyaltyProgramProfilePoints200Response(BaseModel): """ GetLoyaltyProgramProfilePoints200Response """ # noqa: E501 - has_more: StrictBool = Field(alias="hasMore") + has_more: StrictBool = Field(alias="hasMore", json_schema_extra={"examples": [True]}) data: List[LedgerPointsEntryIntegrationAPI] __properties: ClassVar[List[str]] = ["hasMore", "data"] diff --git a/talon_one/models/get_loyalty_program_profile_transactions200_response.py b/talon_one/models/get_loyalty_program_profile_transactions200_response.py index 37b6b13..fa46014 100644 --- a/talon_one/models/get_loyalty_program_profile_transactions200_response.py +++ b/talon_one/models/get_loyalty_program_profile_transactions200_response.py @@ -28,7 +28,7 @@ class GetLoyaltyProgramProfileTransactions200Response(BaseModel): """ GetLoyaltyProgramProfileTransactions200Response """ # noqa: E501 - has_more: StrictBool = Field(alias="hasMore") + has_more: StrictBool = Field(alias="hasMore", json_schema_extra={"examples": [True]}) data: List[LedgerTransactionLogEntryIntegrationAPI] __properties: ClassVar[List[str]] = ["hasMore", "data"] diff --git a/talon_one/models/get_loyalty_program_transactions200_response.py b/talon_one/models/get_loyalty_program_transactions200_response.py index 85a3af3..7bd78e9 100644 --- a/talon_one/models/get_loyalty_program_transactions200_response.py +++ b/talon_one/models/get_loyalty_program_transactions200_response.py @@ -28,7 +28,7 @@ class GetLoyaltyProgramTransactions200Response(BaseModel): """ GetLoyaltyProgramTransactions200Response """ # noqa: E501 - has_more: StrictBool = Field(alias="hasMore") + has_more: StrictBool = Field(alias="hasMore", json_schema_extra={"examples": [True]}) data: List[LoyaltyProgramTransaction] __properties: ClassVar[List[str]] = ["hasMore", "data"] diff --git a/talon_one/models/get_loyalty_programs200_response.py b/talon_one/models/get_loyalty_programs200_response.py index 19f1b2b..1afd948 100644 --- a/talon_one/models/get_loyalty_programs200_response.py +++ b/talon_one/models/get_loyalty_programs200_response.py @@ -28,7 +28,7 @@ class GetLoyaltyPrograms200Response(BaseModel): """ GetLoyaltyPrograms200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[LoyaltyProgram] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/get_referrals_without_total_count200_response.py b/talon_one/models/get_referrals_without_total_count200_response.py index 2398881..60dc013 100644 --- a/talon_one/models/get_referrals_without_total_count200_response.py +++ b/talon_one/models/get_referrals_without_total_count200_response.py @@ -28,7 +28,7 @@ class GetReferralsWithoutTotalCount200Response(BaseModel): """ GetReferralsWithoutTotalCount200Response """ # noqa: E501 - has_more: StrictBool = Field(alias="hasMore") + has_more: StrictBool = Field(alias="hasMore", json_schema_extra={"examples": [True]}) data: List[Referral] __properties: ClassVar[List[str]] = ["hasMore", "data"] diff --git a/talon_one/models/get_reserved_customers200_response.py b/talon_one/models/get_reserved_customers200_response.py index 02bbb4a..681c3b5 100644 --- a/talon_one/models/get_reserved_customers200_response.py +++ b/talon_one/models/get_reserved_customers200_response.py @@ -28,7 +28,7 @@ class GetReservedCustomers200Response(BaseModel): """ GetReservedCustomers200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[CustomerProfile] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/get_rulesets200_response.py b/talon_one/models/get_rulesets200_response.py index c3ca8f0..76fcf60 100644 --- a/talon_one/models/get_rulesets200_response.py +++ b/talon_one/models/get_rulesets200_response.py @@ -28,7 +28,7 @@ class GetRulesets200Response(BaseModel): """ GetRulesets200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[Ruleset] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/get_users200_response.py b/talon_one/models/get_users200_response.py index e71c080..f37e453 100644 --- a/talon_one/models/get_users200_response.py +++ b/talon_one/models/get_users200_response.py @@ -28,7 +28,7 @@ class GetUsers200Response(BaseModel): """ GetUsers200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[User] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/get_webhooks200_response.py b/talon_one/models/get_webhooks200_response.py index 5610df0..ec519d6 100644 --- a/talon_one/models/get_webhooks200_response.py +++ b/talon_one/models/get_webhooks200_response.py @@ -28,7 +28,7 @@ class GetWebhooks200Response(BaseModel): """ GetWebhooks200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[WebhookWithOutgoingIntegrationDetails] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/giveaway.py b/talon_one/models/giveaway.py index e8f2088..822a6a9 100644 --- a/talon_one/models/giveaway.py +++ b/talon_one/models/giveaway.py @@ -28,17 +28,17 @@ class Giveaway(BaseModel): """ Giveaway """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - code: StrictStr = Field(description="The code value of this giveaway.") - pool_id: StrictInt = Field(description="The ID of the pool to return giveaway codes from.", alias="poolId") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the giveaway becomes valid.", alias="startDate") - end_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the giveaway becomes invalid.", alias="endDate") - 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.") - import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this giveaway.", alias="importId") - 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") - profile_id: Optional[StrictInt] = Field(default=None, description="The internal ID of the customer profile that was awarded the giveaway, if the giveaway was awarded and an internal ID exists.", alias="profileId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + code: StrictStr = Field(description="The code value of this giveaway.", json_schema_extra={"examples": ["GIVEAWAY1"]}) + 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.") + 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"]}) + profile_id: Optional[StrictInt] = Field(default=None, description="The internal ID of the customer profile that was awarded the giveaway, if the giveaway was awarded and an internal ID exists.", alias="profileId", json_schema_extra={"examples": [1]}) __properties: ClassVar[List[str]] = ["id", "created", "code", "poolId", "startDate", "endDate", "attributes", "used", "importId", "profileIntegrationId", "profileId"] model_config = ConfigDict( diff --git a/talon_one/models/giveaway_pool_notification.py b/talon_one/models/giveaway_pool_notification.py index cce85ed..45cecc2 100644 --- a/talon_one/models/giveaway_pool_notification.py +++ b/talon_one/models/giveaway_pool_notification.py @@ -28,7 +28,7 @@ class GiveawayPoolNotification(BaseModel): """ GiveawayPoolNotification """ # noqa: E501 - total_result_size: StrictInt = Field(alias="TotalResultSize") + total_result_size: StrictInt = Field(alias="TotalResultSize", json_schema_extra={"examples": [1]}) data: List[GiveawayPoolNotificationData] = Field(description="The array of giveaway pool notifications.", alias="Data") notification_type: StrictStr = Field(description="The type of notification.", alias="NotificationType") __properties: ClassVar[List[str]] = ["TotalResultSize", "Data", "NotificationType"] diff --git a/talon_one/models/giveaway_pool_notification_data.py b/talon_one/models/giveaway_pool_notification_data.py index b4e7894..fa82ca5 100644 --- a/talon_one/models/giveaway_pool_notification_data.py +++ b/talon_one/models/giveaway_pool_notification_data.py @@ -28,16 +28,16 @@ class GiveawayPoolNotificationData(BaseModel): """ GiveawayPoolNotificationData """ # noqa: E501 - event: StrictStr = Field(description="The event type of the notification.", alias="Event") - pool_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the giveaway pool.", alias="PoolId") - pool_name: StrictStr = Field(description="The name of the giveaway pool.", alias="PoolName") - pool_description: StrictStr = Field(description="The description of the giveaway pool.", alias="PoolDescription") - account_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the account that owns the giveaway pool.", alias="AccountId") - application_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the Application connected to the giveaway pool.", alias="ApplicationId") - total_codes: StrictInt = Field(description="The total number of codes in the giveaway pool.", alias="TotalCodes") - used_codes: StrictInt = Field(description="The number of codes that have been used.", alias="UsedCodes") - remaining_codes: StrictInt = Field(description="The number of codes remaining in the giveaway pool.", alias="RemainingCodes") - threshold_percent: StrictInt = Field(description="The percentage threshold for the notification. The notification is triggered when the number of codes drops below this threshold.", alias="ThresholdPercent") + event: StrictStr = Field(description="The event type of the notification.", alias="Event", json_schema_extra={"examples": ["giveaway_codes_low"]}) + pool_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the giveaway pool.", alias="PoolId", json_schema_extra={"examples": [5]}) + pool_name: StrictStr = Field(description="The name of the giveaway pool.", alias="PoolName", json_schema_extra={"examples": ["Summer Giveaway"]}) + pool_description: StrictStr = Field(description="The description of the giveaway pool.", alias="PoolDescription", json_schema_extra={"examples": ["Summer giveaway codes"]}) + account_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the account that owns the giveaway pool.", alias="AccountId", json_schema_extra={"examples": [10]}) + application_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the Application connected to the giveaway pool.", alias="ApplicationId", json_schema_extra={"examples": [42]}) + total_codes: StrictInt = Field(description="The total number of codes in the giveaway pool.", alias="TotalCodes", json_schema_extra={"examples": [1000]}) + used_codes: StrictInt = Field(description="The number of codes that have been used.", alias="UsedCodes", json_schema_extra={"examples": [920]}) + remaining_codes: StrictInt = Field(description="The number of codes remaining in the giveaway pool.", alias="RemainingCodes", json_schema_extra={"examples": [80]}) + threshold_percent: StrictInt = Field(description="The percentage threshold for the notification. The notification is triggered when the number of codes drops below this threshold.", alias="ThresholdPercent", json_schema_extra={"examples": [10]}) __properties: ClassVar[List[str]] = ["Event", "PoolId", "PoolName", "PoolDescription", "AccountId", "ApplicationId", "TotalCodes", "UsedCodes", "RemainingCodes", "ThresholdPercent"] model_config = ConfigDict( diff --git a/talon_one/models/giveaways_pool.py b/talon_one/models/giveaways_pool.py index a4af438..4a6b4ef 100644 --- a/talon_one/models/giveaways_pool.py +++ b/talon_one/models/giveaways_pool.py @@ -28,13 +28,13 @@ class GiveawaysPool(BaseModel): """ Giveaways pools is an entity for managing multiple similar giveaways. """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - name: StrictStr = Field(description="The name of this giveaways pool.") - description: Optional[StrictStr] = Field(default=None, description="The description of this giveaways pool.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications that this giveaways pool is enabled for.", alias="subscribedApplicationsIds") - sandbox: StrictBool = Field(description="Indicates if this program is a live or sandbox program. Programs of a given type can only be connected to Applications of the same type.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + name: StrictStr = Field(description="The name of this giveaways pool.", json_schema_extra={"examples": ["My giveaway pool"]}) + description: Optional[StrictStr] = Field(default=None, description="The description of this giveaways pool.", json_schema_extra={"examples": ["Generic pool"]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications that this giveaways pool is enabled for.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[2, 4]]}) + sandbox: StrictBool = Field(description="Indicates if this program is a live or sandbox program. Programs of a given type can only be connected to Applications of the same type.", json_schema_extra={"examples": [True]}) modified: Optional[datetime] = Field(default=None, description="Timestamp of the most recent update to the giveaways pool.") created_by: StrictInt = Field(description="ID of the user who created this giveaways pool.", alias="createdBy") modified_by: Optional[StrictInt] = Field(default=None, description="ID of the user who last updated this giveaways pool if available.", alias="modifiedBy") diff --git a/talon_one/models/hidden_conditions_effects.py b/talon_one/models/hidden_conditions_effects.py index 8078ba1..6cfd3f7 100644 --- a/talon_one/models/hidden_conditions_effects.py +++ b/talon_one/models/hidden_conditions_effects.py @@ -27,10 +27,10 @@ class HiddenConditionsEffects(BaseModel): """ Contains information about hidden conditions and effects in the Application. """ # noqa: E501 - built_in_effects: Optional[List[StrictStr]] = Field(default=None, description="List of hidden built-in effects.", alias="builtInEffects") - conditions: Optional[List[StrictStr]] = Field(default=None, description="List of hidden conditions.") - custom_effects: Optional[List[StrictInt]] = Field(default=None, description="List of the IDs of hidden custom effects.", alias="customEffects") - webhooks: Optional[List[StrictInt]] = Field(default=None, description="List of the IDs of hidden webhooks.") + built_in_effects: Optional[List[StrictStr]] = Field(default=None, description="List of hidden built-in effects.", alias="builtInEffects", json_schema_extra={"examples": [["addFreeItem", "createNotification"]]}) + conditions: Optional[List[StrictStr]] = Field(default=None, description="List of hidden conditions.", json_schema_extra={"examples": [["checkAttributeValue", "couponCodeIsValid"]]}) + custom_effects: Optional[List[StrictInt]] = Field(default=None, description="List of the IDs of hidden custom effects.", alias="customEffects", json_schema_extra={"examples": [[1, 2]]}) + webhooks: Optional[List[StrictInt]] = Field(default=None, description="List of the IDs of hidden webhooks.", json_schema_extra={"examples": [[3, 4]]}) __properties: ClassVar[List[str]] = ["builtInEffects", "conditions", "customEffects", "webhooks"] model_config = ConfigDict( diff --git a/talon_one/models/history.py b/talon_one/models/history.py index d57935f..2f1000b 100644 --- a/talon_one/models/history.py +++ b/talon_one/models/history.py @@ -29,11 +29,11 @@ class History(BaseModel): """ History """ # noqa: E501 - id: StrictInt = Field(description="The ID of the historical price.") - observed_at: datetime = Field(description="The date and time when the price was observed.", alias="observedAt") - context_ids: List[StrictStr] = Field(description="The identifiers of the relevant context at the time the price was observed. Includes the context IDs of any price adjustments and of the campaigns that influenced the final price. ", alias="contextIds") - context_id: Optional[StrictStr] = Field(default='', description="This property is **deprecated**. Use `contextIds` instead. Defaults to an empty string. ", alias="contextId") - price: Union[StrictFloat, StrictInt] = Field(description="Price of the item.") + id: StrictInt = Field(description="The ID of the historical price.", json_schema_extra={"examples": [1]}) + observed_at: datetime = Field(description="The date and time when the price was observed.", alias="observedAt", json_schema_extra={"examples": ["2025-11-10T23:00:00Z"]}) + context_ids: List[StrictStr] = Field(description="The identifiers of the relevant context at the time the price was observed. Includes the context IDs of any price adjustments and of the campaigns that influenced the final price. ", alias="contextIds", json_schema_extra={"examples": [["SpringSale", "SummerSale2025"]]}) + context_id: Optional[StrictStr] = Field(default='', description="This property is **deprecated**. Use `contextIds` instead. Defaults to an empty string. ", alias="contextId", json_schema_extra={"examples": [""]}) + price: Union[StrictFloat, StrictInt] = Field(description="Price of the item.", json_schema_extra={"examples": [99.99]}) metadata: BestPriorPriceMetadata target: Dict[str, Any] __properties: ClassVar[List[str]] = ["id", "observedAt", "contextIds", "contextId", "price", "metadata", "target"] diff --git a/talon_one/models/identifiable_entity.py b/talon_one/models/identifiable_entity.py index 54f2e60..e2ffcab 100644 --- a/talon_one/models/identifiable_entity.py +++ b/talon_one/models/identifiable_entity.py @@ -27,7 +27,7 @@ class IdentifiableEntity(BaseModel): """ IdentifiableEntity """ # noqa: E501 - id: StrictInt = Field(description="Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints.") + id: StrictInt = Field(description="Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints.", json_schema_extra={"examples": [6]}) __properties: ClassVar[List[str]] = ["id"] model_config = ConfigDict( diff --git a/talon_one/models/import_entity.py b/talon_one/models/import_entity.py index 750a7ab..c131590 100644 --- a/talon_one/models/import_entity.py +++ b/talon_one/models/import_entity.py @@ -27,7 +27,7 @@ class ImportEntity(BaseModel): """ ImportEntity """ # noqa: E501 - import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this referral.", alias="importId") + import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this referral.", alias="importId", json_schema_extra={"examples": [4]}) __properties: ClassVar[List[str]] = ["importId"] model_config = ConfigDict( diff --git a/talon_one/models/increase_achievement_progress_effect_props.py b/talon_one/models/increase_achievement_progress_effect_props.py index 3f7283b..832d53b 100644 --- a/talon_one/models/increase_achievement_progress_effect_props.py +++ b/talon_one/models/increase_achievement_progress_effect_props.py @@ -25,12 +25,12 @@ class IncreaseAchievementProgressEffectProps(BaseModel): """ - The properties specific to the \"increaseAchievementProgress\" effect. This gets triggered whenever a validated rule contained an \"increase customer progress\" effect. + This effect indicates that the customer's progress in an achievement was updated during the current session. It is triggered when a rule using the [Update customer progress](https://docs.talon.one/docs/product/rules/effects/use-effects#update-customer-progress) effect is successfully validated. For [on-completion achievements](https://docs.talon.one/docs/product/campaigns/achievements/achievements-overview#recurring-on-completion-achievements), any customer progress exceeding the target automatically starts a new iteration. This generates a new `progressTrackerId` for each iteration, and there can be multiple progress updates for the same achievement from a single validation of this effect. """ # noqa: E501 - achievement_id: StrictInt = Field(description="The internal ID of the achievement.", alias="achievementId") - achievement_name: StrictStr = Field(description="The name of the achievement.", alias="achievementName") - progress_tracker_id: Optional[StrictInt] = Field(default=None, description="The internal ID of the achievement progress tracker.", alias="progressTrackerId") - delta: Union[StrictFloat, StrictInt] = Field(description="The value by which the customer's current progress in the achievement is increased.") + achievement_id: StrictInt = Field(description="The internal ID of the achievement.", alias="achievementId", json_schema_extra={"examples": [10]}) + achievement_name: StrictStr = Field(description="The name of the achievement.", alias="achievementName", json_schema_extra={"examples": ["FreeCoffee10Orders"]}) + progress_tracker_id: Optional[StrictInt] = Field(default=None, description="The internal ID of the customer progress tracker. For [on-completion achievements](https://docs.talon.one/docs/product/campaigns/achievements/achievements-overview#recurring-on-completion-achievements), this effect generates a unique ID for each iteration.", alias="progressTrackerId") + delta: Union[StrictFloat, StrictInt] = Field(description="The value by which the customer's current progress in the achievement has increased.") value: Union[StrictFloat, StrictInt] = Field(description="The current progress of the customer in the achievement.") target: Union[StrictFloat, StrictInt] = Field(description="The target value to complete the achievement.") is_just_completed: StrictBool = Field(description="Indicates if the customer has completed the achievement in the current session.", alias="isJustCompleted") diff --git a/talon_one/models/integration_campaign.py b/talon_one/models/integration_campaign.py index 68894fe..3cfb7a3 100644 --- a/talon_one/models/integration_campaign.py +++ b/talon_one/models/integration_campaign.py @@ -30,16 +30,16 @@ class IntegrationCampaign(BaseModel): """ IntegrationCampaign """ # noqa: E501 - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - id: StrictInt = Field(description="Unique ID of Campaign.") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the campaign.") - description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.") - start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime") - end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime") + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + id: StrictInt = Field(description="Unique ID of Campaign.", json_schema_extra={"examples": [4]}) + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the campaign.", json_schema_extra={"examples": ["Summer promotions"]}) + description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.", json_schema_extra={"examples": ["Campaign for all summer 2021 promotions"]}) + start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime", json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) + end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime", json_schema_extra={"examples": ["2021-09-22T22:00:00Z"]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") - state: StrictStr = Field(description="The state of the campaign. ") - tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)] = Field(description="A list of tags for the campaign.") - features: List[StrictStr] = Field(description="The features enabled in this campaign.") + state: StrictStr = Field(description="The state of the campaign. ", json_schema_extra={"examples": ["enabled"]}) + tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)] = Field(description="A list of tags for the campaign.", json_schema_extra={"examples": [["summer"]]}) + features: List[StrictStr] = Field(description="The features enabled in this campaign.", json_schema_extra={"examples": [["coupons", "referrals"]]}) rules: List[RuleMetadata] = Field(description="A list of rules containing customer-facing details of the rewards defined in the campaign.") __properties: ClassVar[List[str]] = ["applicationId", "id", "name", "description", "startTime", "endTime", "attributes", "state", "tags", "features", "rules"] diff --git a/talon_one/models/integration_campaign_base.py b/talon_one/models/integration_campaign_base.py index 9d74d84..dc63522 100644 --- a/talon_one/models/integration_campaign_base.py +++ b/talon_one/models/integration_campaign_base.py @@ -29,16 +29,16 @@ class IntegrationCampaignBase(BaseModel): """ IntegrationCampaignBase """ # noqa: E501 - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - id: StrictInt = Field(description="Unique ID of Campaign.") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the campaign.") - description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.") - start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime") - end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime") + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + id: StrictInt = Field(description="Unique ID of Campaign.", json_schema_extra={"examples": [4]}) + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the campaign.", json_schema_extra={"examples": ["Summer promotions"]}) + description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.", json_schema_extra={"examples": ["Campaign for all summer 2021 promotions"]}) + start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime", json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) + end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime", json_schema_extra={"examples": ["2021-09-22T22:00:00Z"]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") - state: StrictStr = Field(description="The state of the campaign. ") - tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)] = Field(description="A list of tags for the campaign.") - features: List[StrictStr] = Field(description="The features enabled in this campaign.") + state: StrictStr = Field(description="The state of the campaign. ", json_schema_extra={"examples": ["enabled"]}) + tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)] = Field(description="A list of tags for the campaign.", json_schema_extra={"examples": [["summer"]]}) + features: List[StrictStr] = Field(description="The features enabled in this campaign.", json_schema_extra={"examples": [["coupons", "referrals"]]}) __properties: ClassVar[List[str]] = ["applicationId", "id", "name", "description", "startTime", "endTime", "attributes", "state", "tags", "features"] @field_validator('state') diff --git a/talon_one/models/integration_coupon.py b/talon_one/models/integration_coupon.py index 7d080d9..8d59c52 100644 --- a/talon_one/models/integration_coupon.py +++ b/talon_one/models/integration_coupon.py @@ -30,29 +30,29 @@ class IntegrationCoupon(BaseModel): """ IntegrationCoupon """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of the coupon.") - created: datetime = Field(description="The time the coupon was created.") - campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId") - value: Optional[Annotated[str, Field(min_length=4, strict=True)]] = Field(default=None, description="The coupon code.") - usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit") - discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit") - 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") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the coupon. Coupon never expires if this is omitted.", alias="expiryDate") + id: StrictInt = Field(description="The internal ID of the coupon.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time the coupon was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId", json_schema_extra={"examples": [211]}) + value: Optional[Annotated[str, Field(min_length=4, strict=True)]] = Field(default=None, description="The coupon code.", json_schema_extra={"examples": ["XMAS-20-2021"]}) + usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit", json_schema_extra={"examples": [100]}) + discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit", json_schema_extra={"examples": [30]}) + 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"]}) 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. ") - usage_counter: StrictInt = Field(description="The number of times the coupon has been successfully redeemed.", alias="usageCounter") - discount_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.", alias="discountCounter") - discount_remainder: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The remaining discount this coupon can give.", alias="discountRemainder") - reservation_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of times this coupon has been reserved.", alias="reservationCounter") + usage_counter: StrictInt = Field(description="The number of times the coupon has been successfully redeemed.", alias="usageCounter", json_schema_extra={"examples": [10]}) + discount_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.", alias="discountCounter", json_schema_extra={"examples": [10]}) + discount_remainder: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The remaining discount this coupon can give.", alias="discountRemainder", json_schema_extra={"examples": [5]}) + reservation_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of times this coupon has been reserved.", alias="reservationCounter", json_schema_extra={"examples": [1]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="Custom attributes associated with this coupon.") - referral_id: Optional[StrictInt] = Field(default=None, description="The integration ID of the referring customer (if any) for whom this coupon was created as an effect.", alias="referralId") - recipient_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The Integration ID of the customer that is allowed to redeem this coupon.", alias="recipientIntegrationId") - import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this coupon.", alias="importId") - reservation: Optional[StrictBool] = Field(default=True, description="Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code. ") - batch_id: Optional[StrictStr] = Field(default=None, description="The id of the batch the coupon belongs to.", alias="batchId") - 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") - implicitly_reserved: Optional[StrictBool] = Field(default=None, description="An indication of whether the coupon is implicitly reserved for all customers.", alias="implicitlyReserved") - profile_redemption_count: StrictInt = Field(description="The number of times the coupon was redeemed by the profile.", alias="profileRedemptionCount") + referral_id: Optional[StrictInt] = Field(default=None, description="The integration ID of the referring customer (if any) for whom this coupon was created as an effect.", alias="referralId", json_schema_extra={"examples": [326632952]}) + recipient_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The Integration ID of the customer that is allowed to redeem this coupon.", alias="recipientIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this coupon.", alias="importId", json_schema_extra={"examples": [4]}) + reservation: Optional[StrictBool] = Field(default=True, description="Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code. ", json_schema_extra={"examples": [False]}) + batch_id: Optional[StrictStr] = Field(default=None, description="The id of the batch the coupon belongs to.", alias="batchId", json_schema_extra={"examples": ["32535-43255"]}) + 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]}) + profile_redemption_count: StrictInt = Field(description="The number of times the coupon was redeemed by the profile.", alias="profileRedemptionCount", json_schema_extra={"examples": [5]}) __properties: ClassVar[List[str]] = ["id", "created", "campaignId", "value", "usageLimit", "discountLimit", "reservationLimit", "startDate", "expiryDate", "limits", "usageCounter", "discountCounter", "discountRemainder", "reservationCounter", "attributes", "referralId", "recipientIntegrationId", "importId", "reservation", "batchId", "isReservationMandatory", "implicitlyReserved", "profileRedemptionCount"] model_config = ConfigDict( diff --git a/talon_one/models/integration_customer_profile_audience_request_item.py b/talon_one/models/integration_customer_profile_audience_request_item.py index bc09959..0b42fcc 100644 --- a/talon_one/models/integration_customer_profile_audience_request_item.py +++ b/talon_one/models/integration_customer_profile_audience_request_item.py @@ -28,9 +28,9 @@ class IntegrationCustomerProfileAudienceRequestItem(BaseModel): """ IntegrationCustomerProfileAudienceRequestItem """ # noqa: E501 - action: StrictStr = Field(description="Defines the action to perform: - `add`: Adds the customer profile to the audience. **Note**: If the customer profile does not exist, it will be created. The profile will not be visible in any Application until a session or profile update is received for that profile. - `delete`: Removes the customer profile from the audience. ") - profile_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The ID of this customer profile in the third-party integration.", alias="profileIntegrationId") - integration_id: StrictStr = Field(description="The ID of this audience in the third-party integration.", alias="integrationId") + action: StrictStr = Field(description="Defines the action to perform: - `add`: Adds the customer profile to the audience. **Note**: If the customer profile does not exist, it will be created. The profile will not be visible in any Application until a session or profile update is received for that profile. - `delete`: Removes the customer profile from the audience. ", json_schema_extra={"examples": ["add"]}) + profile_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The ID of this customer profile in the third-party integration.", alias="profileIntegrationId", json_schema_extra={"examples": ["R195412"]}) + integration_id: StrictStr = Field(description="The ID of this audience in the third-party integration.", alias="integrationId", json_schema_extra={"examples": ["382370BKDB946"]}) __properties: ClassVar[List[str]] = ["action", "profileIntegrationId", "integrationId"] @field_validator('action') diff --git a/talon_one/models/integration_entity.py b/talon_one/models/integration_entity.py index e94a7d2..8a369a2 100644 --- a/talon_one/models/integration_entity.py +++ b/talon_one/models/integration_entity.py @@ -29,8 +29,8 @@ class IntegrationEntity(BaseModel): """ IntegrationEntity """ # noqa: E501 - integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID set by your integration layer.", alias="integrationId") - created: datetime = Field(description="The time this entity was created.") + integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID set by your integration layer.", alias="integrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-02-07T08:15:22Z"]}) __properties: ClassVar[List[str]] = ["integrationId", "created"] model_config = ConfigDict( diff --git a/talon_one/models/integration_event.py b/talon_one/models/integration_event.py index d1ddddc..e4edc84 100644 --- a/talon_one/models/integration_event.py +++ b/talon_one/models/integration_event.py @@ -28,10 +28,10 @@ class IntegrationEvent(BaseModel): """ IntegrationEvent """ # noqa: E501 - profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") - store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") - type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") - attributes: Dict[str, Any] = Field(description="Arbitrary additional JSON data associated with the event.") + 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.") __properties: ClassVar[List[str]] = ["profileId", "storeIntegrationId", "type", "attributes"] model_config = ConfigDict( diff --git a/talon_one/models/integration_event_v2_request.py b/talon_one/models/integration_event_v2_request.py index 14099b7..affd25a 100644 --- a/talon_one/models/integration_event_v2_request.py +++ b/talon_one/models/integration_event_v2_request.py @@ -28,13 +28,13 @@ class IntegrationEventV2Request(BaseModel): """ IntegrationEventV2Request """ # noqa: E501 - profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") - store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") - evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds") - type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute).") - response_content: Optional[List[StrictStr]] = Field(default=None, description="Extends the response with the chosen data entities. Use this property to get as much data back as needed from one request instead of sending extra requests to other endpoints. ", alias="responseContent") - loyalty_cards: Optional[Annotated[List[StrictStr], Field(max_length=1)]] = Field(default=None, description="Identifiers of the loyalty cards used during this event.", alias="loyaltyCards") + 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"]}) + evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds", json_schema_extra={"examples": [[10, 12]]}) + 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: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute).", json_schema_extra={"examples": [{"myAttribute": "myValue"}]}) + response_content: Optional[List[StrictStr]] = Field(default=None, description="Extends the response with the chosen data entities. Use this property to get as much data back as needed from one request instead of sending extra requests to other endpoints. ", alias="responseContent", json_schema_extra={"examples": [["triggeredCampaigns", "customerProfile"]]}) + loyalty_cards: Optional[Annotated[List[StrictStr], Field(max_length=1)]] = Field(default=None, description="Identifiers of the loyalty cards used during this event.", alias="loyaltyCards", json_schema_extra={"examples": [["loyalty-card-1"]]}) __properties: ClassVar[List[str]] = ["profileId", "storeIntegrationId", "evaluableCampaignIds", "type", "attributes", "responseContent", "loyaltyCards"] @field_validator('response_content') diff --git a/talon_one/models/integration_event_v3_request.py b/talon_one/models/integration_event_v3_request.py index 935effa..2b06733 100644 --- a/talon_one/models/integration_event_v3_request.py +++ b/talon_one/models/integration_event_v3_request.py @@ -28,15 +28,15 @@ class IntegrationEventV3Request(BaseModel): """ IntegrationEventV3Request """ # noqa: E501 - profile_id: StrictStr = Field(description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") - store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") - evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds") - type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute).") - integration_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The unique ID of the event. Only one event with this ID can be registered. ", alias="integrationId") - connected_session_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail.", alias="connectedSessionId") - loyalty_cards: Optional[Annotated[List[StrictStr], Field(max_length=1)]] = Field(default=None, description="Identifiers of the loyalty cards used during this event.", alias="loyaltyCards") - response_content: Optional[List[StrictStr]] = Field(default=None, description="Optional list of requested information to be present on the response related to the tracking custom event. ", alias="responseContent") + profile_id: StrictStr = Field(description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId", 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"]}) + evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds", json_schema_extra={"examples": [[10, 12]]}) + 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: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute).", json_schema_extra={"examples": [{"myAttribute": "myValue"}]}) + integration_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The unique ID of the event. Only one event with this ID can be registered. ", alias="integrationId", json_schema_extra={"examples": ["175KJPS947296"]}) + connected_session_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail.", alias="connectedSessionId", json_schema_extra={"examples": ["175KJPS947296"]}) + loyalty_cards: Optional[Annotated[List[StrictStr], Field(max_length=1)]] = Field(default=None, description="Identifiers of the loyalty cards used during this event.", alias="loyaltyCards", json_schema_extra={"examples": [["loyalty-card-1"]]}) + response_content: Optional[List[StrictStr]] = Field(default=None, description="Optional list of requested information to be present on the response related to the tracking custom event. ", alias="responseContent", json_schema_extra={"examples": [["triggeredCampaigns", "customerProfile"]]}) __properties: ClassVar[List[str]] = ["profileId", "storeIntegrationId", "evaluableCampaignIds", "type", "attributes", "integrationId", "connectedSessionId", "loyaltyCards", "responseContent"] @field_validator('response_content') diff --git a/talon_one/models/integration_hub_config.py b/talon_one/models/integration_hub_config.py index 6eb568f..6e9f8dd 100644 --- a/talon_one/models/integration_hub_config.py +++ b/talon_one/models/integration_hub_config.py @@ -27,8 +27,8 @@ class IntegrationHubConfig(BaseModel): """ Config used for accessing integrations in IntegrationHub """ # noqa: E501 - integration_hub_url: StrictStr = Field(description="The url used to integrate the IntegrationHub Marketplace.", alias="integrationHubUrl") - access_token: StrictStr = Field(description="Access token used to authenticate a user in Talon.One.", alias="accessToken") + integration_hub_url: StrictStr = Field(description="The url used to integrate the IntegrationHub Marketplace.", alias="integrationHubUrl", json_schema_extra={"examples": ["https://hub.talon.farm/"]}) + access_token: StrictStr = Field(description="Access token used to authenticate a user in Talon.One.", alias="accessToken", json_schema_extra={"examples": ["eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"]}) __properties: ClassVar[List[str]] = ["integrationHubUrl", "accessToken"] 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 689ac79..8f9c300 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, alias="Attributes") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.", 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_event_payload_loyalty_profile_based_notification.py b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_notification.py deleted file mode 100644 index c48a8ae..0000000 --- a/talon_one/models/integration_hub_event_payload_loyalty_profile_based_notification.py +++ /dev/null @@ -1,127 +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 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.integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action import IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction -from typing import Optional, Set -from typing_extensions import Self -from pydantic_core import to_jsonable_python - -class IntegrationHubEventPayloadLoyaltyProfileBasedNotification(BaseModel): - """ - IntegrationHubEventPayloadLoyaltyProfileBasedNotification - """ # noqa: E501 - profile_integration_id: StrictStr = Field(alias="ProfileIntegrationID") - loyalty_program_id: StrictInt = Field(alias="LoyaltyProgramID") - loyalty_program_name: StrictStr = Field(description="The name of the loyalty program.", alias="LoyaltyProgramName") - subledger_id: StrictStr = Field(alias="SubledgerID") - source_of_event: StrictStr = Field(alias="SourceOfEvent") - current_tier: StrictStr = Field(description="The name of the customer's current tier.", alias="CurrentTier") - employee_name: Optional[StrictStr] = Field(default=None, alias="EmployeeName") - user_id: Optional[StrictInt] = Field(default=None, alias="UserID") - current_points: Union[StrictFloat, StrictInt] = Field(alias="CurrentPoints") - actions: Optional[List[IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction]] = Field(default=None, alias="Actions") - published_at: datetime = Field(description="Timestamp when the event was published.", alias="PublishedAt") - old_tier: Optional[StrictStr] = Field(default=None, alias="OldTier") - tier_expiration_date: Optional[datetime] = Field(default=None, alias="TierExpirationDate") - timestamp_of_tier_change: Optional[datetime] = Field(default=None, alias="TimestampOfTierChange") - points_required_to_the_next_tier: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="PointsRequiredToTheNextTier") - next_tier: Optional[StrictStr] = Field(default=None, alias="NextTier") - __properties: ClassVar[List[str]] = ["ProfileIntegrationID", "LoyaltyProgramID", "LoyaltyProgramName", "SubledgerID", "SourceOfEvent", "CurrentTier", "EmployeeName", "UserID", "CurrentPoints", "Actions", "PublishedAt", "OldTier", "TierExpirationDate", "TimestampOfTierChange", "PointsRequiredToTheNextTier", "NextTier"] - - 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 IntegrationHubEventPayloadLoyaltyProfileBasedNotification from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in actions (list) - _items = [] - if self.actions: - for _item_actions in self.actions: - if _item_actions: - _items.append(_item_actions.to_dict()) - _dict['Actions'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedNotification from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ProfileIntegrationID": obj.get("ProfileIntegrationID"), - "LoyaltyProgramID": obj.get("LoyaltyProgramID"), - "LoyaltyProgramName": obj.get("LoyaltyProgramName"), - "SubledgerID": obj.get("SubledgerID"), - "SourceOfEvent": obj.get("SourceOfEvent"), - "CurrentTier": obj.get("CurrentTier"), - "EmployeeName": obj.get("EmployeeName"), - "UserID": obj.get("UserID"), - "CurrentPoints": obj.get("CurrentPoints"), - "Actions": [IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.from_dict(_item) for _item in obj["Actions"]] if obj.get("Actions") is not None else None, - "PublishedAt": obj.get("PublishedAt"), - "OldTier": obj.get("OldTier"), - "TierExpirationDate": obj.get("TierExpirationDate"), - "TimestampOfTierChange": obj.get("TimestampOfTierChange"), - "PointsRequiredToTheNextTier": obj.get("PointsRequiredToTheNextTier"), - "NextTier": obj.get("NextTier") - }) - return _obj - - diff --git a/talon_one/models/integration_hub_event_record.py b/talon_one/models/integration_hub_event_record.py index ce0255c..778cf76 100644 --- a/talon_one/models/integration_hub_event_record.py +++ b/talon_one/models/integration_hub_event_record.py @@ -20,6 +20,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.integration_hub_event_type import IntegrationHubEventType from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -28,16 +29,18 @@ class IntegrationHubEventRecord(BaseModel): """ IntegrationHubEventRecord """ # noqa: E501 - id: StrictInt = Field(alias="Id") - flow_id: StrictInt = Field(alias="FlowId") - event_type: StrictStr = Field(alias="EventType") - event_data: Optional[Any] = Field(alias="EventData") - published_at: datetime = Field(alias="PublishedAt") - processed_at: Optional[datetime] = Field(default=None, alias="ProcessedAt") - delivered_at: Optional[datetime] = Field(default=None, alias="DeliveredAt") - process_after: datetime = Field(alias="ProcessAfter") - retry: StrictInt = Field(alias="Retry") - __properties: ClassVar[List[str]] = ["Id", "FlowId", "EventType", "EventData", "PublishedAt", "ProcessedAt", "DeliveredAt", "ProcessAfter", "Retry"] + id: StrictInt = Field(description="ID of the event record.") + flow_id: StrictInt = Field(description="ID of the integration hub flow.", alias="flowId") + integration_name: Optional[StrictStr] = Field(default=None, description="Name of the integration.", alias="integrationName") + instance_name: Optional[StrictStr] = Field(default=None, description="Name of the integration instance.", alias="instanceName") + event_type: IntegrationHubEventType = Field(alias="eventType") + published_at: datetime = Field(description="Timestamp when the event was published.", alias="publishedAt") + processed_at: Optional[datetime] = Field(default=None, description="Timestamp when the event was processed.", alias="processedAt") + delivered_at: Optional[datetime] = Field(default=None, description="Timestamp when the event was delivered.", alias="deliveredAt") + scheduled_to: datetime = Field(description="Timestamp after which the event is scheduled to be processed.", alias="scheduledTo") + retry: StrictInt = Field(description="Number of delivery retries attempted.") + payload: StrictStr = Field(description="The event payload as a formatted JSON string.") + __properties: ClassVar[List[str]] = ["id", "flowId", "integrationName", "instanceName", "eventType", "publishedAt", "processedAt", "deliveredAt", "scheduledTo", "retry", "payload"] model_config = ConfigDict( validate_by_name=True, @@ -78,11 +81,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # set to None if event_data (nullable) is None - # and model_fields_set contains the field - if self.event_data is None and "event_data" in self.model_fields_set: - _dict['EventData'] = None - return _dict @classmethod @@ -95,15 +93,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "Id": obj.get("Id"), - "FlowId": obj.get("FlowId"), - "EventType": obj.get("EventType"), - "EventData": obj.get("EventData"), - "PublishedAt": obj.get("PublishedAt"), - "ProcessedAt": obj.get("ProcessedAt"), - "DeliveredAt": obj.get("DeliveredAt"), - "ProcessAfter": obj.get("ProcessAfter"), - "Retry": obj.get("Retry") + "id": obj.get("id"), + "flowId": obj.get("flowId"), + "integrationName": obj.get("integrationName"), + "instanceName": obj.get("instanceName"), + "eventType": obj.get("eventType"), + "publishedAt": obj.get("publishedAt"), + "processedAt": obj.get("processedAt"), + "deliveredAt": obj.get("deliveredAt"), + "scheduledTo": obj.get("scheduledTo"), + "retry": obj.get("retry"), + "payload": obj.get("payload") }) return _obj diff --git a/talon_one/models/integration_hub_event_status_update.py b/talon_one/models/integration_hub_event_status_update.py index d0108c6..f5fbf40 100644 --- a/talon_one/models/integration_hub_event_status_update.py +++ b/talon_one/models/integration_hub_event_status_update.py @@ -27,7 +27,7 @@ class IntegrationHubEventStatusUpdate(BaseModel): """ IntegrationHubEventStatusUpdate """ # noqa: E501 - event_id: StrictInt = Field(description="The ID of the integration hub event.", alias="EventId") + event_id: StrictInt = Field(description="The ID of the integration hub event.", alias="EventId", json_schema_extra={"examples": [123]}) status: StrictStr = Field(description="The delivery outcome for the event.", alias="Status") __properties: ClassVar[List[str]] = ["EventId", "Status"] diff --git a/talon_one/models/integration_hub_event_type.py b/talon_one/models/integration_hub_event_type.py new file mode 100644 index 0000000..f6407d8 --- /dev/null +++ b/talon_one/models/integration_hub_event_type.py @@ -0,0 +1,41 @@ +# 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 +from enum import Enum +from typing_extensions import Self + + +class IntegrationHubEventType(str, Enum): + """ + The type of integration hub event. + """ + + """ + allowed enum values + """ + LOYALTYPOINTSCHANGED = 'LoyaltyPointsChanged' + LOYALTYTIERDOWNGRADE = 'LoyaltyTierDowngrade' + LOYALTYTIERUPGRADE = 'LoyaltyTierUpgrade' + COUPONCREATED = 'CouponCreated' + COUPONUPDATED = 'CouponUpdated' + COUPONDELETED = 'CouponDeleted' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of IntegrationHubEventType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/talon_one/models/integration_hub_flow.py b/talon_one/models/integration_hub_flow.py index b20a5a3..27039f2 100644 --- a/talon_one/models/integration_hub_flow.py +++ b/talon_one/models/integration_hub_flow.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.integration_hub_event_type import IntegrationHubEventType from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -27,10 +28,11 @@ class IntegrationHubFlow(BaseModel): """ IntegrationHubFlow """ # noqa: E501 - application_id: Optional[StrictInt] = Field(default=None, description="ID of application the flow is registered for.", alias="ApplicationID") - event_type: StrictStr = Field(description="The event type we want to register a flow for.", alias="EventType") + application_id: Optional[StrictInt] = Field(default=None, description="ID of the application the flow is registered for.", alias="ApplicationID", json_schema_extra={"examples": [54]}) + loyalty_program_id: Optional[StrictInt] = Field(default=None, description="ID of the loyalty program the flow is registered for.", alias="LoyaltyProgramID", json_schema_extra={"examples": [12]}) + event_type: IntegrationHubEventType = Field(alias="EventType") integration_hub_flow_url: StrictStr = Field(description="The URL of the integration hub flow that we want to trigger for the event.", alias="IntegrationHubFlowUrl") - __properties: ClassVar[List[str]] = ["ApplicationID", "EventType", "IntegrationHubFlowUrl"] + __properties: ClassVar[List[str]] = ["ApplicationID", "LoyaltyProgramID", "EventType", "IntegrationHubFlowUrl"] model_config = ConfigDict( validate_by_name=True, @@ -84,6 +86,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "ApplicationID": obj.get("ApplicationID"), + "LoyaltyProgramID": obj.get("LoyaltyProgramID"), "EventType": obj.get("EventType"), "IntegrationHubFlowUrl": obj.get("IntegrationHubFlowUrl") }) diff --git a/talon_one/models/integration_hub_flow_response.py b/talon_one/models/integration_hub_flow_response.py index 3d6db35..5a5bcdd 100644 --- a/talon_one/models/integration_hub_flow_response.py +++ b/talon_one/models/integration_hub_flow_response.py @@ -17,6 +17,7 @@ import re # noqa: F401 import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from talon_one.models.integration_hub_flow_config_response import IntegrationHubFlowConfigResponse @@ -28,12 +29,17 @@ class IntegrationHubFlowResponse(BaseModel): """ IntegrationHubFlowResponse """ # noqa: E501 - id: StrictInt = Field(description="ID of the integration hub flow.", alias="Id") - application_id: Optional[StrictInt] = Field(default=None, description="ID of application the flow is registered for.", alias="ApplicationID") - event_type: StrictStr = Field(description="The event type we want to register a flow for.", alias="EventType") - integration_hub_flow_url: StrictStr = Field(description="The URL of the integration hub flow that we want to trigger for the event.", alias="IntegrationHubFlowUrl") - config: IntegrationHubFlowConfigResponse = Field(alias="Config") - __properties: ClassVar[List[str]] = ["Id", "ApplicationID", "EventType", "IntegrationHubFlowUrl", "Config"] + id: StrictInt = Field(description="ID of the integration hub flow.") + integration_name: Optional[StrictStr] = Field(default=None, description="Name of the integration.", alias="integrationName") + instance_name: Optional[StrictStr] = Field(default=None, description="Name of the integration instance.", alias="instanceName") + created_at: datetime = Field(description="Timestamp when the flow was created.", alias="createdAt") + disabled_until: Optional[datetime] = Field(default=None, description="Timestamp until which the flow is disabled. Null when the flow is active.", alias="disabledUntil") + application_id: Optional[StrictInt] = Field(default=None, description="ID of the application the flow is registered for.", alias="applicationId", json_schema_extra={"examples": [54]}) + loyalty_program_id: Optional[StrictInt] = Field(default=None, description="ID of the loyalty program the flow is registered for.", alias="loyaltyProgramId", json_schema_extra={"examples": [12]}) + event_type: StrictStr = Field(description="The event type we want to register a flow for.", alias="eventType") + integration_hub_flow_url: StrictStr = Field(description="The URL of the integration hub flow that we want to trigger for the event.", alias="integrationHubFlowUrl") + config: IntegrationHubFlowConfigResponse + __properties: ClassVar[List[str]] = ["id", "integrationName", "instanceName", "createdAt", "disabledUntil", "applicationId", "loyaltyProgramId", "eventType", "integrationHubFlowUrl", "config"] model_config = ConfigDict( validate_by_name=True, @@ -76,7 +82,12 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of config if self.config: - _dict['Config'] = self.config.to_dict() + _dict['config'] = self.config.to_dict() + # set to None if disabled_until (nullable) is None + # and model_fields_set contains the field + if self.disabled_until is None and "disabled_until" in self.model_fields_set: + _dict['disabledUntil'] = None + return _dict @classmethod @@ -89,11 +100,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "Id": obj.get("Id"), - "ApplicationID": obj.get("ApplicationID"), - "EventType": obj.get("EventType"), - "IntegrationHubFlowUrl": obj.get("IntegrationHubFlowUrl"), - "Config": IntegrationHubFlowConfigResponse.from_dict(obj["Config"]) if obj.get("Config") is not None else None + "id": obj.get("id"), + "integrationName": obj.get("integrationName"), + "instanceName": obj.get("instanceName"), + "createdAt": obj.get("createdAt"), + "disabledUntil": obj.get("disabledUntil"), + "applicationId": obj.get("applicationId"), + "loyaltyProgramId": obj.get("loyaltyProgramId"), + "eventType": obj.get("eventType"), + "integrationHubFlowUrl": obj.get("integrationHubFlowUrl"), + "config": IntegrationHubFlowConfigResponse.from_dict(obj["config"]) if obj.get("config") is not None else None }) return _obj diff --git a/talon_one/models/integration_hub_flow_with_config.py b/talon_one/models/integration_hub_flow_with_config.py index 1527886..cedc8c8 100644 --- a/talon_one/models/integration_hub_flow_with_config.py +++ b/talon_one/models/integration_hub_flow_with_config.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.integration_hub_event_type import IntegrationHubEventType from talon_one.models.integration_hub_flow_config import IntegrationHubFlowConfig from typing import Optional, Set from typing_extensions import Self @@ -28,11 +29,12 @@ class IntegrationHubFlowWithConfig(BaseModel): """ IntegrationHubFlowWithConfig """ # noqa: E501 - application_id: Optional[StrictInt] = Field(default=None, description="ID of application the flow is registered for.", alias="ApplicationID") - event_type: StrictStr = Field(description="The event type we want to register a flow for.", alias="EventType") + application_id: Optional[StrictInt] = Field(default=None, description="ID of the application the flow is registered for.", alias="ApplicationID", json_schema_extra={"examples": [54]}) + loyalty_program_id: Optional[StrictInt] = Field(default=None, description="ID of the loyalty program the flow is registered for.", alias="LoyaltyProgramID", json_schema_extra={"examples": [12]}) + event_type: IntegrationHubEventType = Field(alias="EventType") integration_hub_flow_url: StrictStr = Field(description="The URL of the integration hub flow that we want to trigger for the event.", alias="IntegrationHubFlowUrl") config: IntegrationHubFlowConfig = Field(alias="Config") - __properties: ClassVar[List[str]] = ["ApplicationID", "EventType", "IntegrationHubFlowUrl", "Config"] + __properties: ClassVar[List[str]] = ["ApplicationID", "LoyaltyProgramID", "EventType", "IntegrationHubFlowUrl", "Config"] model_config = ConfigDict( validate_by_name=True, @@ -89,6 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "ApplicationID": obj.get("ApplicationID"), + "LoyaltyProgramID": obj.get("LoyaltyProgramID"), "EventType": obj.get("EventType"), "IntegrationHubFlowUrl": obj.get("IntegrationHubFlowUrl"), "Config": IntegrationHubFlowConfig.from_dict(obj["Config"]) if obj.get("Config") is not None else None diff --git a/talon_one/models/integration_hub_paginated_event_payload.py b/talon_one/models/integration_hub_paginated_event_payload.py index 4674451..ce280a2 100644 --- a/talon_one/models/integration_hub_paginated_event_payload.py +++ b/talon_one/models/integration_hub_paginated_event_payload.py @@ -18,8 +18,9 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +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 typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -30,17 +31,10 @@ class IntegrationHubPaginatedEventPayload(BaseModel): """ # noqa: E501 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: StrictStr = Field(alias="EventType") + event_type: IntegrationHubEventType = Field(alias="EventType") data: List[Any] = Field(alias="Data") __properties: ClassVar[List[str]] = ["TotalResultSize", "BatchedAt", "EventType", "Data"] - @field_validator('event_type') - def event_type_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['LoyaltyPointsChanged', 'LoyaltyTierDowngrade', 'LoyaltyTierUpgrade', 'CouponCreated', 'CouponUpdated', 'CouponDeleted']): - raise ValueError("must be one of enum values ('LoyaltyPointsChanged', 'LoyaltyTierDowngrade', 'LoyaltyTierUpgrade', 'CouponCreated', 'CouponUpdated', 'CouponDeleted')") - return value - model_config = ConfigDict( validate_by_name=True, validate_by_alias=True, diff --git a/talon_one/models/integration_profile_entity.py b/talon_one/models/integration_profile_entity.py index 62ccdee..c1c6ea1 100644 --- a/talon_one/models/integration_profile_entity.py +++ b/talon_one/models/integration_profile_entity.py @@ -27,7 +27,7 @@ class IntegrationProfileEntity(BaseModel): """ IntegrationProfileEntity """ # noqa: E501 - profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") + 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"]}) __properties: ClassVar[List[str]] = ["profileId"] model_config = ConfigDict( diff --git a/talon_one/models/integration_profile_entity_v3.py b/talon_one/models/integration_profile_entity_v3.py index 1bd1423..89d9ce8 100644 --- a/talon_one/models/integration_profile_entity_v3.py +++ b/talon_one/models/integration_profile_entity_v3.py @@ -27,7 +27,7 @@ class IntegrationProfileEntityV3(BaseModel): """ IntegrationProfileEntityV3 """ # noqa: E501 - profile_id: StrictStr = Field(description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") + profile_id: StrictStr = Field(description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId", json_schema_extra={"examples": ["URNGV8294NV"]}) __properties: ClassVar[List[str]] = ["profileId"] model_config = ConfigDict( diff --git a/talon_one/models/integration_request.py b/talon_one/models/integration_request.py index 95f10d5..3ee1b20 100644 --- a/talon_one/models/integration_request.py +++ b/talon_one/models/integration_request.py @@ -29,7 +29,7 @@ class IntegrationRequest(BaseModel): The body of a V2 integration API request (customer session update). Next to the customer session details, this contains an optional listing of extra properties that should be returned in the response. """ # noqa: E501 customer_session: NewCustomerSessionV2 = Field(description="The customer session update details.", alias="customerSession") - response_content: Optional[List[StrictStr]] = Field(default=None, description="Extends the response with the chosen data entities. Use this property to get as much data as you need in one _Update customer session_ request instead of sending extra requests to other endpoints. **Note:** To retrieve loyalty card details, your request must include a loyalty card ID. ", alias="responseContent") + response_content: Optional[List[StrictStr]] = Field(default=None, description="Extends the response with the chosen data entities. Use this property to get as much data as you need in one _Update customer session_ request instead of sending extra requests to other endpoints. **Note:** To retrieve loyalty card details, your request must include a loyalty card ID. ", alias="responseContent", json_schema_extra={"examples": [["customerSession", "customerProfile"]]}) __properties: ClassVar[List[str]] = ["customerSession", "responseContent"] @field_validator('response_content') diff --git a/talon_one/models/integration_store_entity.py b/talon_one/models/integration_store_entity.py index 62821c7..4bc9049 100644 --- a/talon_one/models/integration_store_entity.py +++ b/talon_one/models/integration_store_entity.py @@ -28,7 +28,7 @@ class IntegrationStoreEntity(BaseModel): """ IntegrationStoreEntity """ # noqa: E501 - 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") + 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"]}) __properties: ClassVar[List[str]] = ["storeIntegrationId"] model_config = ConfigDict( diff --git a/talon_one/models/inventory_coupon.py b/talon_one/models/inventory_coupon.py index 56df19a..be029bf 100644 --- a/talon_one/models/inventory_coupon.py +++ b/talon_one/models/inventory_coupon.py @@ -30,30 +30,30 @@ class InventoryCoupon(BaseModel): """ InventoryCoupon """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of the coupon.") - created: datetime = Field(description="The time the coupon was created.") - campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId") - value: Optional[Annotated[str, Field(min_length=4, strict=True)]] = Field(default=None, description="The coupon code.") - usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit") - discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit") - 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") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the coupon. Coupon never expires if this is omitted.", alias="expiryDate") + id: StrictInt = Field(description="The internal ID of the coupon.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time the coupon was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId", json_schema_extra={"examples": [211]}) + value: Optional[Annotated[str, Field(min_length=4, strict=True)]] = Field(default=None, description="The coupon code.", json_schema_extra={"examples": ["XMAS-20-2021"]}) + usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit", json_schema_extra={"examples": [100]}) + discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit", json_schema_extra={"examples": [30]}) + 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"]}) 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. ") - usage_counter: StrictInt = Field(description="The number of times the coupon has been successfully redeemed.", alias="usageCounter") - discount_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.", alias="discountCounter") - discount_remainder: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The remaining discount this coupon can give.", alias="discountRemainder") - reservation_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of times this coupon has been reserved.", alias="reservationCounter") + usage_counter: StrictInt = Field(description="The number of times the coupon has been successfully redeemed.", alias="usageCounter", json_schema_extra={"examples": [10]}) + discount_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.", alias="discountCounter", json_schema_extra={"examples": [10]}) + discount_remainder: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The remaining discount this coupon can give.", alias="discountRemainder", json_schema_extra={"examples": [5]}) + reservation_counter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of times this coupon has been reserved.", alias="reservationCounter", json_schema_extra={"examples": [1]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="Custom attributes associated with this coupon.") - referral_id: Optional[StrictInt] = Field(default=None, description="The integration ID of the referring customer (if any) for whom this coupon was created as an effect.", alias="referralId") - recipient_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The Integration ID of the customer that is allowed to redeem this coupon.", alias="recipientIntegrationId") - import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this coupon.", alias="importId") - reservation: Optional[StrictBool] = Field(default=True, description="Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code. ") - batch_id: Optional[StrictStr] = Field(default=None, description="The id of the batch the coupon belongs to.", alias="batchId") - 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") - implicitly_reserved: Optional[StrictBool] = Field(default=None, description="An indication of whether the coupon is implicitly reserved for all customers.", alias="implicitlyReserved") - profile_redemption_count: StrictInt = Field(description="The number of times the coupon was redeemed by the profile.", alias="profileRedemptionCount") - state: StrictStr = Field(description="Can be: - `active`: The coupon can be used. It is a reserved coupon that is not pending, used, or expired, and it has a non-exhausted limit counter. **Note:** This coupon state is returned for [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule), but the coupon cannot be used until the campaign is **running**. - `used`: The coupon has been redeemed and cannot be used again. It is not pending and has reached its redemption limit or was redeemed by the profile before expiration. - `expired`: The coupon was never redeemed, and it is now expired. It is non-pending, non-active, and non-used by the profile. - `pending`: The coupon will be usable in the future. - `disabled`: The coupon is part of a non-active campaign. ") + referral_id: Optional[StrictInt] = Field(default=None, description="The integration ID of the referring customer (if any) for whom this coupon was created as an effect.", alias="referralId", json_schema_extra={"examples": [326632952]}) + recipient_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The Integration ID of the customer that is allowed to redeem this coupon.", alias="recipientIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this coupon.", alias="importId", json_schema_extra={"examples": [4]}) + reservation: Optional[StrictBool] = Field(default=True, description="Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code. ", json_schema_extra={"examples": [False]}) + batch_id: Optional[StrictStr] = Field(default=None, description="The id of the batch the coupon belongs to.", alias="batchId", json_schema_extra={"examples": ["32535-43255"]}) + 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]}) + profile_redemption_count: StrictInt = Field(description="The number of times the coupon was redeemed by the profile.", alias="profileRedemptionCount", json_schema_extra={"examples": [5]}) + state: StrictStr = Field(description="Can be: - `active`: The coupon can be used. It is a reserved coupon that is not pending, used, or expired, and it has a non-exhausted limit counter. **Note:** This coupon state is returned for [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule), but the coupon cannot be used until the campaign is **running**. - `used`: The coupon has been redeemed and cannot be used again. It is not pending and has reached its redemption limit or was redeemed by the profile before expiration. - `expired`: The coupon was never redeemed, and it is now expired. It is non-pending, non-active, and non-used by the profile. - `pending`: The coupon will be usable in the future. - `disabled`: The coupon is part of a non-active campaign. ", json_schema_extra={"examples": ["active"]}) __properties: ClassVar[List[str]] = ["id", "created", "campaignId", "value", "usageLimit", "discountLimit", "reservationLimit", "startDate", "expiryDate", "limits", "usageCounter", "discountCounter", "discountRemainder", "reservationCounter", "attributes", "referralId", "recipientIntegrationId", "importId", "reservation", "batchId", "isReservationMandatory", "implicitlyReserved", "profileRedemptionCount", "state"] model_config = ConfigDict( diff --git a/talon_one/models/inventory_referral.py b/talon_one/models/inventory_referral.py index aa12645..73a409d 100644 --- a/talon_one/models/inventory_referral.py +++ b/talon_one/models/inventory_referral.py @@ -29,19 +29,19 @@ class InventoryReferral(BaseModel): """ InventoryReferral """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the referral code becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the referral code. Referral never expires if this is omitted.", alias="expiryDate") - 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") - campaign_id: StrictInt = Field(description="ID of the campaign from which the referral received the referral code.", alias="campaignId") - advocate_profile_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The Integration ID of the Advocate's Profile.", alias="advocateProfileIntegrationId") - friend_profile_integration_id: Optional[StrictStr] = Field(default=None, description="An optional Integration ID of the Friend's Profile.", alias="friendProfileIntegrationId") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.") - import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this referral.", alias="importId") - code: Annotated[str, Field(min_length=4, strict=True)] = Field(description="The referral code.") - usage_counter: StrictInt = Field(description="The number of times this referral code has been successfully used.", alias="usageCounter") - batch_id: Optional[StrictStr] = Field(default=None, description="The ID of the batch the referrals belong to.", alias="batchId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the referral code becomes valid.", alias="startDate", json_schema_extra={"examples": ["2020-11-10T23:00:00Z"]}) + expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the referral code. Referral never expires if this is omitted.", alias="expiryDate", json_schema_extra={"examples": ["2021-11-10T23:00:00Z"]}) + 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="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.") + 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]}) + batch_id: Optional[StrictStr] = Field(default=None, description="The ID of the batch the referrals belong to.", alias="batchId", json_schema_extra={"examples": ["tqyrgahe"]}) referred_customers: List[StrictStr] = Field(description="An array of referred customers.", alias="referredCustomers") __properties: ClassVar[List[str]] = ["id", "created", "startDate", "expiryDate", "usageLimit", "campaignId", "advocateProfileIntegrationId", "friendProfileIntegrationId", "attributes", "importId", "code", "usageCounter", "batchId", "referredCustomers"] diff --git a/talon_one/models/item_attribute.py b/talon_one/models/item_attribute.py index 65ce71c..fa0c38b 100644 --- a/talon_one/models/item_attribute.py +++ b/talon_one/models/item_attribute.py @@ -27,7 +27,7 @@ class ItemAttribute(BaseModel): """ ItemAttribute """ # noqa: E501 - attributeid: StrictInt = Field(description="The ID of the attribute of the item.") + attributeid: StrictInt = Field(description="The ID of the attribute of the item.", json_schema_extra={"examples": [6]}) name: StrictStr = Field(description="The name of the attribute.") value: Optional[Any] __properties: ClassVar[List[str]] = ["attributeid", "name", "value"] diff --git a/talon_one/models/ledger_entry.py b/talon_one/models/ledger_entry.py index b78057d..6c9659a 100644 --- a/talon_one/models/ledger_entry.py +++ b/talon_one/models/ledger_entry.py @@ -28,15 +28,15 @@ class LedgerEntry(BaseModel): """ LedgerEntry """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - 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") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + 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"]}) account_id: StrictInt = Field(description="The ID of the Talon.One account that owns this profile.", alias="accountId") - loyalty_program_id: StrictInt = Field(description="ID of the ledger.", alias="loyaltyProgramId") - event_id: StrictInt = Field(description="ID of the related event.", alias="eventId") - amount: StrictInt = Field(description="Amount of loyalty points.") - reason: StrictStr = Field(description="reason for awarding/deducting points.") - expiry_date: datetime = Field(description="Expiration date of the points.", alias="expiryDate") + loyalty_program_id: StrictInt = Field(description="ID of the ledger.", alias="loyaltyProgramId", json_schema_extra={"examples": [323414846]}) + event_id: StrictInt = Field(description="ID of the related event.", alias="eventId", json_schema_extra={"examples": [3]}) + amount: StrictInt = Field(description="Amount of loyalty points.", json_schema_extra={"examples": [100]}) + reason: StrictStr = Field(description="reason for awarding/deducting points.", json_schema_extra={"examples": ["Customer appeasement."]}) + expiry_date: datetime = Field(description="Expiration date of the points.", alias="expiryDate", json_schema_extra={"examples": ["2022-04-26T11:02:38Z"]}) reference_id: Optional[StrictInt] = Field(default=None, description="The ID of the balancing ledgerEntry.", alias="referenceId") __properties: ClassVar[List[str]] = ["id", "created", "profileId", "accountId", "loyaltyProgramId", "eventId", "amount", "reason", "expiryDate", "referenceId"] diff --git a/talon_one/models/ledger_info.py b/talon_one/models/ledger_info.py index a487699..2ac843e 100644 --- a/talon_one/models/ledger_info.py +++ b/talon_one/models/ledger_info.py @@ -28,17 +28,17 @@ class LedgerInfo(BaseModel): """ LedgerInfo """ # noqa: E501 - current_balance: Union[StrictFloat, StrictInt] = Field(description="Sum of currently active points.", alias="currentBalance") - pending_balance: Union[StrictFloat, StrictInt] = Field(description="Sum of pending points.", alias="pendingBalance") - negative_balance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Sum of negative points. This implies that `currentBalance` is `0`.", alias="negativeBalance") - expired_balance: Union[StrictFloat, StrictInt] = Field(description="**DEPRECATED** Value is shown as 0. ", alias="expiredBalance") - spent_balance: Union[StrictFloat, StrictInt] = Field(description="**DEPRECATED** Value is shown as 0. ", alias="spentBalance") - tentative_current_balance: Union[StrictFloat, StrictInt] = Field(description="The tentative points balance, reflecting the `currentBalance` and all point additions and deductions within the current open customer session. When the session is closed, the effects are applied and the `currentBalance` is updated to this value. **Note:** Tentative balances are specific to the current session and do not take into account other open sessions for the given customer. ", alias="tentativeCurrentBalance") - tentative_pending_balance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The tentative points balance, reflecting the `pendingBalance` and all point additions with a future activation date within the current open customer session. When the session is closed, the effects are applied and the `pendingBalance` is updated to this value. **Note:** Tentative balances are specific to the current session and do not take into account other open sessions for the given customer. ", alias="tentativePendingBalance") - tentative_negative_balance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The tentative negative balance after all additions and deductions from the current customer session are applied to `negativeBalance`. When the session is closed, the tentative effects are applied and `negativeBalance` is updated to this value. **Note:** Tentative balances are specific to the current session and do not take into account other open sessions for the given customer. ", alias="tentativeNegativeBalance") + current_balance: Union[StrictFloat, StrictInt] = Field(description="Sum of currently active points.", alias="currentBalance", json_schema_extra={"examples": [100]}) + pending_balance: Union[StrictFloat, StrictInt] = Field(description="Sum of pending points.", alias="pendingBalance", json_schema_extra={"examples": [10]}) + negative_balance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Sum of negative points. This implies that `currentBalance` is `0`.", alias="negativeBalance", json_schema_extra={"examples": [10]}) + expired_balance: Union[StrictFloat, StrictInt] = Field(description="**DEPRECATED** Value is shown as 0. ", alias="expiredBalance", json_schema_extra={"examples": [0]}) + spent_balance: Union[StrictFloat, StrictInt] = Field(description="**DEPRECATED** Value is shown as 0. ", alias="spentBalance", json_schema_extra={"examples": [0]}) + tentative_current_balance: Union[StrictFloat, StrictInt] = Field(description="The tentative points balance, reflecting the `currentBalance` and all point additions and deductions within the current open customer session. When the session is closed, the effects are applied and the `currentBalance` is updated to this value. **Note:** Tentative balances are specific to the current session and do not take into account other open sessions for the given customer. ", alias="tentativeCurrentBalance", json_schema_extra={"examples": [100]}) + tentative_pending_balance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The tentative points balance, reflecting the `pendingBalance` and all point additions with a future activation date within the current open customer session. When the session is closed, the effects are applied and the `pendingBalance` is updated to this value. **Note:** Tentative balances are specific to the current session and do not take into account other open sessions for the given customer. ", alias="tentativePendingBalance", json_schema_extra={"examples": [20]}) + tentative_negative_balance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The tentative negative balance after all additions and deductions from the current customer session are applied to `negativeBalance`. When the session is closed, the tentative effects are applied and `negativeBalance` is updated to this value. **Note:** Tentative balances are specific to the current session and do not take into account other open sessions for the given customer. ", alias="tentativeNegativeBalance", json_schema_extra={"examples": [100]}) current_tier: Optional[Tier] = Field(default=None, description="Tier for which the ledger is eligible.", alias="currentTier") - points_to_next_tier: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Points required to move up a tier.", alias="pointsToNextTier") - next_tier_name: Optional[StrictStr] = Field(default=None, description="The name of the next higher tier level in the loyalty program. **Note**: - Returns `null` if the customer has reached the highest available tier. - Returns the lowest level tier name if the customer is not currently assigned to any tier. ", alias="nextTierName") + points_to_next_tier: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Points required to move up a tier.", alias="pointsToNextTier", json_schema_extra={"examples": [20]}) + next_tier_name: Optional[StrictStr] = Field(default=None, description="The name of the next higher tier level in the loyalty program. **Note**: - Returns `null` if the customer has reached the highest available tier. - Returns the lowest level tier name if the customer is not currently assigned to any tier. ", alias="nextTierName", json_schema_extra={"examples": ["Silver"]}) __properties: ClassVar[List[str]] = ["currentBalance", "pendingBalance", "negativeBalance", "expiredBalance", "spentBalance", "tentativeCurrentBalance", "tentativePendingBalance", "tentativeNegativeBalance", "currentTier", "pointsToNextTier", "nextTierName"] model_config = ConfigDict( diff --git a/talon_one/models/ledger_points_entry_integration_api.py b/talon_one/models/ledger_points_entry_integration_api.py index aa29d2c..b6cbd53 100644 --- a/talon_one/models/ledger_points_entry_integration_api.py +++ b/talon_one/models/ledger_points_entry_integration_api.py @@ -29,17 +29,17 @@ class LedgerPointsEntryIntegrationAPI(BaseModel): """ Loyalty profile points with start and expiry dates. """ # noqa: E501 - id: StrictInt = Field(description="ID of the transaction that adds loyalty points.") - transaction_uuid: StrictStr = Field(description="Unique identifier of the transaction in the UUID format.", alias="transactionUUID") - created: datetime = Field(description="Date and time the loyalty points were added.") - program_id: StrictInt = Field(description="ID of the loyalty program.", alias="programId") - customer_session_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="ID of the customer session where points were added.", alias="customerSessionId") - name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Name or reason of the transaction that adds loyalty points.") - start_date: Annotated[str, Field(strict=True, max_length=64)] = Field(description="When points become active. Possible values: - `immediate`: Points are active immediately. - `timestamp value`: Points become active at a given date and time. ", alias="startDate") - expiry_date: StrictStr = Field(description="Date when points expire. Possible values are: - `unlimited`: Points have no expiration date. - `timestamp value`: Points expire on the given date and time. ", alias="expiryDate") - subledger_id: Annotated[str, Field(strict=True, max_length=64)] = Field(description="ID of the subledger.", alias="subledgerId") - amount: Union[StrictFloat, StrictInt] = Field(description="Amount of loyalty points added in the transaction.") - 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") + id: StrictInt = Field(description="ID of the transaction that adds loyalty points.", json_schema_extra={"examples": [123]}) + transaction_uuid: StrictStr = Field(description="Unique identifier of the transaction in the UUID format.", alias="transactionUUID", json_schema_extra={"examples": ["ce59f12a-f53b-4014-a745-636d93f2bd3f"]}) + created: datetime = Field(description="Date and time the loyalty points were added.", json_schema_extra={"examples": ["2022-01-02T15:04:05Z07:00"]}) + program_id: StrictInt = Field(description="ID of the loyalty program.", alias="programId", json_schema_extra={"examples": [324]}) + customer_session_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="ID of the customer session where points were added.", alias="customerSessionId", json_schema_extra={"examples": ["05c2da0d-48fa-4aa1-b629-898f58f1584d"]}) + name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Name or reason of the transaction that adds loyalty points.", json_schema_extra={"examples": ["Reward 10% points of a purchase's current total"]}) + start_date: Annotated[str, Field(strict=True, max_length=64)] = Field(description="When points become active. Possible values: - `immediate`: Points are active immediately. - `timestamp value`: Points become active at a given date and time. ", alias="startDate", json_schema_extra={"examples": ["2022-01-02T15:04:05Z07:00"]}) + expiry_date: StrictStr = Field(description="Date when points expire. Possible values are: - `unlimited`: Points have no expiration date. - `timestamp value`: Points expire on the given date and time. ", alias="expiryDate", json_schema_extra={"examples": ["2022-08-02T15:04:05Z07:00"]}) + subledger_id: Annotated[str, Field(strict=True, max_length=64)] = Field(description="ID of the subledger.", alias="subledgerId", json_schema_extra={"examples": ["sub-123"]}) + amount: Union[StrictFloat, StrictInt] = Field(description="Amount of loyalty points added in the transaction.", json_schema_extra={"examples": [10.25]}) + 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]] = ["id", "transactionUUID", "created", "programId", "customerSessionId", "name", "startDate", "expiryDate", "subledgerId", "amount", "validityDuration"] model_config = ConfigDict( diff --git a/talon_one/models/ledger_transaction_log_entry_integration_api.py b/talon_one/models/ledger_transaction_log_entry_integration_api.py index 1cd87c9..b6c5bbe 100644 --- a/talon_one/models/ledger_transaction_log_entry_integration_api.py +++ b/talon_one/models/ledger_transaction_log_entry_integration_api.py @@ -30,21 +30,21 @@ class LedgerTransactionLogEntryIntegrationAPI(BaseModel): """ Log entry for a given loyalty profile transaction. """ # noqa: E501 - transaction_uuid: StrictStr = Field(description="Unique identifier of the transaction in the UUID format.", alias="transactionUUID") - created: datetime = Field(description="Date and time the loyalty transaction occurred.") - program_id: StrictInt = Field(description="ID of the loyalty program.", alias="programId") - customer_session_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="ID of the customer session where the transaction occurred.", alias="customerSessionId") - type: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Type of transaction. Possible values: - `addition`: Signifies added points. - `subtraction`: Signifies deducted points. ") - name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Name or reason of the loyalty ledger transaction.") - start_date: Annotated[str, Field(strict=True, max_length=64)] = Field(description="When points become active. Possible values: - `immediate`: Points are immediately active. - `on_action`: Points become active based on the customer's action. - a timestamp value: Points become active at a given date and time. ", alias="startDate") - expiry_date: StrictStr = Field(description="Date when points expire. Possible values are: - `unlimited`: Points have no expiration date. - `timestamp value`: Points expire on the given date. ", alias="expiryDate") - subledger_id: Annotated[str, Field(strict=True, max_length=64)] = Field(description="ID of the subledger.", alias="subledgerId") - amount: Union[StrictFloat, StrictInt] = Field(description="Amount of loyalty points added or deducted in the transaction.") - id: StrictInt = Field(description="ID of the loyalty ledger transaction.") - ruleset_id: Optional[StrictInt] = Field(default=None, description="The ID of the ruleset containing the rule that triggered this effect.", alias="rulesetId") - rule_name: Optional[StrictStr] = Field(default=None, description="The name of the rule that triggered this effect.", alias="ruleName") + transaction_uuid: StrictStr = Field(description="Unique identifier of the transaction in the UUID format.", alias="transactionUUID", json_schema_extra={"examples": ["ce59f12a-f53b-4014-a745-636d93f2bd3f"]}) + created: datetime = Field(description="Date and time the loyalty transaction occurred.", json_schema_extra={"examples": ["2022-01-02T15:04:05Z07:00"]}) + program_id: StrictInt = Field(description="ID of the loyalty program.", alias="programId", json_schema_extra={"examples": [324]}) + customer_session_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="ID of the customer session where the transaction occurred.", alias="customerSessionId", json_schema_extra={"examples": ["05c2da0d-48fa-4aa1-b629-898f58f1584d"]}) + type: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Type of transaction. Possible values: - `addition`: Signifies added points. - `subtraction`: Signifies deducted points. ", json_schema_extra={"examples": ["addition"]}) + name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Name or reason of the loyalty ledger transaction.", json_schema_extra={"examples": ["Reward 10% points of a purchase's current total"]}) + start_date: Annotated[str, Field(strict=True, max_length=64)] = Field(description="When points become active. Possible values: - `immediate`: Points are immediately active. - `on_action`: Points become active based on the customer's action. - a timestamp value: Points become active at a given date and time. ", alias="startDate", json_schema_extra={"examples": ["2022-01-02T15:04:05Z07:00"]}) + expiry_date: StrictStr = Field(description="Date when points expire. Possible values are: - `unlimited`: Points have no expiration date. - `timestamp value`: Points expire on the given date. ", alias="expiryDate", json_schema_extra={"examples": ["2022-08-02T15:04:05Z07:00"]}) + subledger_id: Annotated[str, Field(strict=True, max_length=64)] = Field(description="ID of the subledger.", alias="subledgerId", json_schema_extra={"examples": ["sub-123"]}) + amount: Union[StrictFloat, StrictInt] = Field(description="Amount of loyalty points added or deducted in the transaction.", json_schema_extra={"examples": [10.25]}) + id: StrictInt = Field(description="ID of the loyalty ledger transaction.", json_schema_extra={"examples": [123]}) + ruleset_id: Optional[StrictInt] = Field(default=None, description="The ID of the ruleset containing the rule that triggered this effect.", alias="rulesetId", json_schema_extra={"examples": [11]}) + rule_name: Optional[StrictStr] = Field(default=None, description="The name of the rule that triggered this effect.", alias="ruleName", json_schema_extra={"examples": ["Add 2 points"]}) flags: Optional[LoyaltyLedgerEntryFlags] = Field(default=None, description="The flags of the transaction, when applicable. The `createsNegativeBalance` flag indicates whether the transaction results in a negative balance.") - 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") + 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", "customerSessionId", "type", "name", "startDate", "expiryDate", "subledgerId", "amount", "id", "rulesetId", "ruleName", "flags", "validityDuration"] @field_validator('type') diff --git a/talon_one/models/limit_config.py b/talon_one/models/limit_config.py index e00d42f..ce47b10 100644 --- a/talon_one/models/limit_config.py +++ b/talon_one/models/limit_config.py @@ -28,10 +28,10 @@ class LimitConfig(BaseModel): """ LimitConfig """ # noqa: E501 - action: StrictStr = Field(description="The limitable action to which this limit applies. For example: - `setDiscount` - `setDiscountEffect` - `redeemCoupon` - `createCoupon` ") - limit: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="The value to set for the limit.") - period: Optional[StrictStr] = Field(default=None, description="The period on which the budget limit recurs.") - entities: List[StrictStr] = Field(description="The entity that this limit applies to.") + action: StrictStr = Field(description="The limitable action to which this limit applies. For example: - `setDiscount` - `setDiscountEffect` - `redeemCoupon` - `createCoupon` ", json_schema_extra={"examples": ["createCoupon"]}) + limit: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="The value to set for the limit.", json_schema_extra={"examples": [1000]}) + period: Optional[StrictStr] = Field(default=None, description="The period on which the budget limit recurs.", json_schema_extra={"examples": ["yearly"]}) + entities: List[StrictStr] = Field(description="The entity that this limit applies to.", json_schema_extra={"examples": [["Coupon"]]}) __properties: ClassVar[List[str]] = ["action", "limit", "period", "entities"] @field_validator('period') diff --git a/talon_one/models/limit_counter.py b/talon_one/models/limit_counter.py index 65d4d68..7e8dbe9 100644 --- a/talon_one/models/limit_counter.py +++ b/talon_one/models/limit_counter.py @@ -28,21 +28,21 @@ class LimitCounter(BaseModel): """ LimitCounter """ # noqa: E501 - campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId") - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - id: StrictInt = Field(description="Unique ID for this entity.") - action: StrictStr = Field(description="The limitable action of the limit counter.") - profile_id: Optional[StrictInt] = Field(default=None, description="The profile ID for which this limit counter is used.", alias="profileId") - profile_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The profile integration ID for which this limit counter is used.", alias="profileIntegrationId") - coupon_id: Optional[StrictInt] = Field(default=None, description="The internal coupon ID for which this limit counter is used.", alias="couponId") - coupon_value: Optional[StrictStr] = Field(default=None, description="The coupon value for which this limit counter is used.", alias="couponValue") - referral_id: Optional[StrictInt] = Field(default=None, description="The referral ID for which this limit counter is used.", alias="referralId") - referral_value: Optional[StrictStr] = Field(default=None, description="The referral value for which this limit counter is used.", alias="referralValue") - identifier: Optional[StrictStr] = Field(default=None, description="The arbitrary identifier for which this limit counter is used.") - period: Optional[StrictStr] = Field(default=None, description="The time period for which this limit counter is used.") - limit: Union[StrictFloat, StrictInt] = Field(description="The highest possible value for this limit counter.") - counter: Union[StrictFloat, StrictInt] = Field(description="The current value for this limit counter.") + campaign_id: StrictInt = Field(description="The ID of the campaign that owns this entity.", alias="campaignId", json_schema_extra={"examples": [211]}) + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + id: StrictInt = Field(description="Unique ID for this entity.", json_schema_extra={"examples": [6]}) + action: StrictStr = Field(description="The limitable action of the limit counter.", json_schema_extra={"examples": ["setDiscount"]}) + profile_id: Optional[StrictInt] = Field(default=None, description="The profile ID for which this limit counter is used.", alias="profileId", json_schema_extra={"examples": [335]}) + profile_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The profile integration ID for which this limit counter is used.", alias="profileIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + coupon_id: Optional[StrictInt] = Field(default=None, description="The internal coupon ID for which this limit counter is used.", alias="couponId", json_schema_extra={"examples": [34]}) + coupon_value: Optional[StrictStr] = Field(default=None, description="The coupon value for which this limit counter is used.", alias="couponValue", json_schema_extra={"examples": ["XMAS-20-2021"]}) + referral_id: Optional[StrictInt] = Field(default=None, description="The referral ID for which this limit counter is used.", alias="referralId", json_schema_extra={"examples": [4]}) + referral_value: Optional[StrictStr] = Field(default=None, description="The referral value for which this limit counter is used.", alias="referralValue", json_schema_extra={"examples": [""]}) + identifier: Optional[StrictStr] = Field(default=None, description="The arbitrary identifier for which this limit counter is used.", json_schema_extra={"examples": ["91.11.156.141"]}) + period: Optional[StrictStr] = Field(default=None, description="The time period for which this limit counter is used.", json_schema_extra={"examples": ["Y2021M8"]}) + limit: Union[StrictFloat, StrictInt] = Field(description="The highest possible value for this limit counter.", json_schema_extra={"examples": [10]}) + counter: Union[StrictFloat, StrictInt] = Field(description="The current value for this limit counter.", json_schema_extra={"examples": [5]}) __properties: ClassVar[List[str]] = ["campaignId", "applicationId", "accountId", "id", "action", "profileId", "profileIntegrationId", "couponId", "couponValue", "referralId", "referralValue", "identifier", "period", "limit", "counter"] model_config = ConfigDict( diff --git a/talon_one/models/list_account_collections200_response.py b/talon_one/models/list_account_collections200_response.py index 98ba9d7..72e25d0 100644 --- a/talon_one/models/list_account_collections200_response.py +++ b/talon_one/models/list_account_collections200_response.py @@ -29,7 +29,7 @@ class ListAccountCollections200Response(BaseModel): ListAccountCollections200Response """ # noqa: E501 has_more: Optional[StrictBool] = Field(default=None, alias="hasMore") - total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize") + total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[CollectionWithoutPayload] __properties: ClassVar[List[str]] = ["hasMore", "totalResultSize", "data"] diff --git a/talon_one/models/list_all_roles_v2200_response.py b/talon_one/models/list_all_roles_v2200_response.py index 18f3774..b87fe14 100644 --- a/talon_one/models/list_all_roles_v2200_response.py +++ b/talon_one/models/list_all_roles_v2200_response.py @@ -28,7 +28,7 @@ class ListAllRolesV2200Response(BaseModel): """ ListAllRolesV2200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[RoleV2] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/list_catalog_items200_response.py b/talon_one/models/list_catalog_items200_response.py index 81616dd..9335a74 100644 --- a/talon_one/models/list_catalog_items200_response.py +++ b/talon_one/models/list_catalog_items200_response.py @@ -29,7 +29,7 @@ class ListCatalogItems200Response(BaseModel): ListCatalogItems200Response """ # noqa: E501 has_more: Optional[StrictBool] = Field(default=None, alias="hasMore") - total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize") + total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[CatalogItem] __properties: ClassVar[List[str]] = ["hasMore", "totalResultSize", "data"] diff --git a/talon_one/models/list_experiments200_response.py b/talon_one/models/list_experiments200_response.py index e2bc17b..4f1c4c2 100644 --- a/talon_one/models/list_experiments200_response.py +++ b/talon_one/models/list_experiments200_response.py @@ -28,7 +28,7 @@ class ListExperiments200Response(BaseModel): """ ListExperiments200Response """ # noqa: E501 - total_result_size: StrictInt = Field(alias="totalResultSize") + total_result_size: StrictInt = Field(alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[Experiment] __properties: ClassVar[List[str]] = ["totalResultSize", "data"] diff --git a/talon_one/models/list_stores200_response.py b/talon_one/models/list_stores200_response.py index 0b3b804..df45bde 100644 --- a/talon_one/models/list_stores200_response.py +++ b/talon_one/models/list_stores200_response.py @@ -29,7 +29,7 @@ class ListStores200Response(BaseModel): ListStores200Response """ # noqa: E501 has_more: Optional[StrictBool] = Field(default=None, alias="hasMore") - total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize") + total_result_size: Optional[StrictInt] = Field(default=None, alias="totalResultSize", json_schema_extra={"examples": [1]}) data: List[Store] __properties: ClassVar[List[str]] = ["hasMore", "totalResultSize", "data"] diff --git a/talon_one/models/login_params.py b/talon_one/models/login_params.py index b87500e..8461392 100644 --- a/talon_one/models/login_params.py +++ b/talon_one/models/login_params.py @@ -27,8 +27,8 @@ class LoginParams(BaseModel): """ LoginParams """ # noqa: E501 - email: StrictStr = Field(description="The email address associated with the user profile.") - password: StrictStr = Field(description="The password for your account.") + email: StrictStr = Field(description="The email address associated with the user profile.", json_schema_extra={"examples": ["john.doe@example.com"]}) + password: StrictStr = Field(description="The password for your account.", json_schema_extra={"examples": ["admin123456"]}) __properties: ClassVar[List[str]] = ["email", "password"] model_config = ConfigDict( diff --git a/talon_one/models/loyalty_balance.py b/talon_one/models/loyalty_balance.py index bf1a5aa..5445651 100644 --- a/talon_one/models/loyalty_balance.py +++ b/talon_one/models/loyalty_balance.py @@ -27,11 +27,11 @@ class LoyaltyBalance(BaseModel): """ Point balance of a ledger in the Loyalty Program. """ # noqa: E501 - active_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of points awarded to this customer and available to spend.", alias="activePoints") - pending_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of points awarded to this customer but not available until their start date.", alias="pendingPoints") - spent_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of points already spent by this customer.", alias="spentPoints") - expired_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of points awarded but never redeemed. They cannot be used anymore.", alias="expiredPoints") - negative_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of negative points. This implies that `activePoints` is `0`.", alias="negativePoints") + active_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of points awarded to this customer and available to spend.", alias="activePoints", json_schema_extra={"examples": [286]}) + pending_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of points awarded to this customer but not available until their start date.", alias="pendingPoints", json_schema_extra={"examples": [50]}) + spent_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of points already spent by this customer.", alias="spentPoints", json_schema_extra={"examples": [150]}) + expired_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of points awarded but never redeemed. They cannot be used anymore.", alias="expiredPoints", json_schema_extra={"examples": [286]}) + negative_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of negative points. This implies that `activePoints` is `0`.", alias="negativePoints", json_schema_extra={"examples": [286]}) __properties: ClassVar[List[str]] = ["activePoints", "pendingPoints", "spentPoints", "expiredPoints", "negativePoints"] model_config = ConfigDict( diff --git a/talon_one/models/loyalty_balance_with_tier.py b/talon_one/models/loyalty_balance_with_tier.py index 1abdfc6..88b95e2 100644 --- a/talon_one/models/loyalty_balance_with_tier.py +++ b/talon_one/models/loyalty_balance_with_tier.py @@ -29,15 +29,15 @@ class LoyaltyBalanceWithTier(BaseModel): """ LoyaltyBalanceWithTier """ # noqa: E501 - active_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of points awarded to this customer and available to spend.", alias="activePoints") - pending_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of points awarded to this customer but not available until their start date.", alias="pendingPoints") - spent_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of points already spent by this customer.", alias="spentPoints") - expired_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of points awarded but never redeemed. They cannot be used anymore.", alias="expiredPoints") - negative_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of negative points. This implies that `activePoints` is `0`.", alias="negativePoints") + active_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of points awarded to this customer and available to spend.", alias="activePoints", json_schema_extra={"examples": [286]}) + pending_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of points awarded to this customer but not available until their start date.", alias="pendingPoints", json_schema_extra={"examples": [50]}) + spent_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of points already spent by this customer.", alias="spentPoints", json_schema_extra={"examples": [150]}) + expired_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of points awarded but never redeemed. They cannot be used anymore.", alias="expiredPoints", json_schema_extra={"examples": [286]}) + negative_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total amount of negative points. This implies that `activePoints` is `0`.", alias="negativePoints", json_schema_extra={"examples": [286]}) current_tier: Optional[Tier] = Field(default=None, description="Customer's current tier.", alias="currentTier") projected_tier: Optional[ProjectedTier] = Field(default=None, alias="projectedTier") - points_to_next_tier: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of points required to move up a tier.", alias="pointsToNextTier") - next_tier_name: Optional[StrictStr] = Field(default=None, description="The name of the next higher tier level in the loyalty program. **Note**: - Returns `null` if the customer has reached the highest available tier. - Returns the lowest level tier name if the customer is not currently assigned to any tier. ", alias="nextTierName") + points_to_next_tier: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of points required to move up a tier.", alias="pointsToNextTier", json_schema_extra={"examples": [20]}) + next_tier_name: Optional[StrictStr] = Field(default=None, description="The name of the next higher tier level in the loyalty program. **Note**: - Returns `null` if the customer has reached the highest available tier. - Returns the lowest level tier name if the customer is not currently assigned to any tier. ", alias="nextTierName", json_schema_extra={"examples": ["Silver"]}) __properties: ClassVar[List[str]] = ["activePoints", "pendingPoints", "spentPoints", "expiredPoints", "negativePoints", "currentTier", "projectedTier", "pointsToNextTier", "nextTierName"] model_config = ConfigDict( diff --git a/talon_one/models/loyalty_balances.py b/talon_one/models/loyalty_balances.py index 27ca9bb..85fa109 100644 --- a/talon_one/models/loyalty_balances.py +++ b/talon_one/models/loyalty_balances.py @@ -29,7 +29,7 @@ class LoyaltyBalances(BaseModel): List of loyalty balances for a ledger and its subledgers. """ # noqa: E501 balance: Optional[LoyaltyBalance] = None - subledger_balances: Optional[Dict[str, LoyaltyBalance]] = Field(default=None, description="Map of the loyalty balances of the subledgers of a ledger.", alias="subledgerBalances") + subledger_balances: Optional[Dict[str, LoyaltyBalance]] = Field(default=None, description="Map of the loyalty balances of the subledgers of a ledger.", alias="subledgerBalances", json_schema_extra={"examples": [{"mysubledger": {"activePoints": 286, "pendingPoints": 50, "spentPoints": 150, "expiredPoints": 25, "negativePoints": 0}}]}) __properties: ClassVar[List[str]] = ["balance", "subledgerBalances"] model_config = ConfigDict( diff --git a/talon_one/models/loyalty_balances_with_tiers.py b/talon_one/models/loyalty_balances_with_tiers.py index edbb921..3c1c92a 100644 --- a/talon_one/models/loyalty_balances_with_tiers.py +++ b/talon_one/models/loyalty_balances_with_tiers.py @@ -29,7 +29,7 @@ class LoyaltyBalancesWithTiers(BaseModel): List of loyalty balances for a ledger and its subledgers. """ # noqa: E501 balance: Optional[LoyaltyBalanceWithTier] = None - subledger_balances: Optional[Dict[str, LoyaltyBalanceWithTier]] = Field(default=None, description="Map of the loyalty balances of the subledgers of a ledger.", alias="subledgerBalances") + subledger_balances: Optional[Dict[str, LoyaltyBalanceWithTier]] = Field(default=None, description="Map of the loyalty balances of the subledgers of a ledger.", alias="subledgerBalances", json_schema_extra={"examples": [{"mysubledger": {"activePoints": 286, "pendingPoints": 50, "spentPoints": 150, "expiredPoints": 25, "negativePoints": 0}}]}) __properties: ClassVar[List[str]] = ["balance", "subledgerBalances"] model_config = ConfigDict( diff --git a/talon_one/models/loyalty_card.py b/talon_one/models/loyalty_card.py index 683d24f..92b3a18 100644 --- a/talon_one/models/loyalty_card.py +++ b/talon_one/models/loyalty_card.py @@ -31,22 +31,22 @@ class LoyaltyCard(BaseModel): """ LoyaltyCard """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - program_id: StrictInt = Field(description="The ID of the loyalty program that owns this entity.", alias="programID") - program_name: Optional[StrictStr] = Field(default=None, description="The integration name of the loyalty program that owns this entity.", alias="programName") - program_title: Optional[StrictStr] = Field(default=None, description="The Campaign Manager-displayed name of the loyalty program that owns this entity.", alias="programTitle") - status: StrictStr = Field(description="Status of the loyalty card. Can be `active` or `inactive`. ") - block_reason: Optional[StrictStr] = Field(default=None, description="Reason for transferring and blocking the loyalty card. ", alias="blockReason") - identifier: Annotated[str, Field(min_length=4, strict=True, max_length=108)] = Field(description="The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. ") - users_per_card_limit: Annotated[int, Field(strict=True, ge=0)] = Field(description="The max amount of customer profiles that can be linked to the card. 0 means unlimited. ", alias="usersPerCardLimit") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + program_id: StrictInt = Field(description="The ID of the loyalty program that owns this entity.", alias="programID", json_schema_extra={"examples": [125]}) + program_name: Optional[StrictStr] = Field(default=None, description="The integration name of the loyalty program that owns this entity.", alias="programName", json_schema_extra={"examples": ["Loyalty_program"]}) + program_title: Optional[StrictStr] = Field(default=None, description="The Campaign Manager-displayed name of the loyalty program that owns this entity.", alias="programTitle", json_schema_extra={"examples": ["Loyalty program"]}) + status: StrictStr = Field(description="Status of the loyalty card. Can be `active` or `inactive`. ", json_schema_extra={"examples": ["active"]}) + 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."]}) + identifier: Annotated[str, Field(min_length=4, strict=True, max_length=108)] = Field(description="The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. ", json_schema_extra={"examples": ["summer-loyalty-card-0543"]}) + users_per_card_limit: Annotated[int, Field(strict=True, ge=0)] = Field(description="The max amount of customer profiles that can be linked to the card. 0 means unlimited. ", alias="usersPerCardLimit", json_schema_extra={"examples": [111]}) profiles: Optional[List[LoyaltyCardProfileRegistration]] = Field(default=None, description="Integration IDs of the customers profiles linked to the card.") ledger: Optional[LedgerInfo] = Field(default=None, description="Displays point balances of the card in the main ledger of the loyalty program.") subledgers: Optional[Dict[str, LedgerInfo]] = Field(default=None, description="Displays point balances of the card in the subledgers of the loyalty program.") - modified: Optional[datetime] = Field(default=None, description="Timestamp of the most recent update of the loyalty card.") - old_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 the points were transferred.", alias="oldCardIdentifier") - new_card_identifier: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=108)]] = Field(default=None, description="The identifier of the card to which the points were transferred.", alias="newCardIdentifier") - batch_id: Optional[StrictStr] = Field(default=None, description="The ID of the batch in which the loyalty card was created.", alias="batchId") + modified: Optional[datetime] = Field(default=None, description="Timestamp of the most recent update of the loyalty card.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + old_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 the points were transferred.", alias="oldCardIdentifier", json_schema_extra={"examples": ["summer-loyalty-card-0543"]}) + new_card_identifier: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=108)]] = Field(default=None, description="The identifier of the card to which the points were transferred.", alias="newCardIdentifier", json_schema_extra={"examples": ["summer-loyalty-card-0543"]}) + 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') diff --git a/talon_one/models/loyalty_card_balances.py b/talon_one/models/loyalty_card_balances.py index 16a7af9..019720e 100644 --- a/talon_one/models/loyalty_card_balances.py +++ b/talon_one/models/loyalty_card_balances.py @@ -30,7 +30,7 @@ class LoyaltyCardBalances(BaseModel): LoyaltyCardBalances """ # noqa: E501 balance: Optional[LoyaltyBalance] = None - subledger_balances: Optional[Dict[str, LoyaltyBalance]] = Field(default=None, description="Map of the loyalty balances of the subledgers of a ledger.", alias="subledgerBalances") + subledger_balances: Optional[Dict[str, LoyaltyBalance]] = Field(default=None, description="Map of the loyalty balances of the subledgers of a ledger.", alias="subledgerBalances", json_schema_extra={"examples": [{"mysubledger": {"activePoints": 286, "pendingPoints": 50, "spentPoints": 150, "expiredPoints": 25, "negativePoints": 0}}]}) profiles: Optional[List[LoyaltyCardProfileRegistration]] = Field(default=None, description="Customer profiles linked to the loyalty card.") __properties: ClassVar[List[str]] = ["balance", "subledgerBalances", "profiles"] diff --git a/talon_one/models/loyalty_card_batch.py b/talon_one/models/loyalty_card_batch.py index dd55061..359efed 100644 --- a/talon_one/models/loyalty_card_batch.py +++ b/talon_one/models/loyalty_card_batch.py @@ -29,9 +29,9 @@ class LoyaltyCardBatch(BaseModel): """ LoyaltyCardBatch """ # noqa: E501 - number_of_cards: StrictInt = Field(description="Number of loyalty cards in the batch.", alias="numberOfCards") - batch_id: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=20)]] = Field(default=None, description="ID of the loyalty card batch.", alias="batchId") - status: Optional[StrictStr] = Field(default='active', description="Status of the loyalty cards in the batch.") + number_of_cards: StrictInt = Field(description="Number of loyalty cards in the batch.", alias="numberOfCards", json_schema_extra={"examples": [5000]}) + batch_id: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=20)]] = Field(default=None, description="ID of the loyalty card batch.", alias="batchId", json_schema_extra={"examples": ["hwernpjz"]}) + status: Optional[StrictStr] = Field(default='active', description="Status of the loyalty cards in the batch.", json_schema_extra={"examples": ["active"]}) card_code_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="cardCodeSettings") __properties: ClassVar[List[str]] = ["numberOfCards", "batchId", "status", "cardCodeSettings"] diff --git a/talon_one/models/loyalty_card_batch_response.py b/talon_one/models/loyalty_card_batch_response.py index fe4ee5c..bb16261 100644 --- a/talon_one/models/loyalty_card_batch_response.py +++ b/talon_one/models/loyalty_card_batch_response.py @@ -27,8 +27,8 @@ class LoyaltyCardBatchResponse(BaseModel): """ LoyaltyCardBatchResponse """ # noqa: E501 - number_of_cards_generated: StrictInt = Field(description="Number of loyalty cards in the batch.", alias="numberOfCardsGenerated") - batch_id: StrictStr = Field(description="ID of the loyalty card batch.", alias="batchId") + number_of_cards_generated: StrictInt = Field(description="Number of loyalty cards in the batch.", alias="numberOfCardsGenerated", json_schema_extra={"examples": [5000]}) + batch_id: StrictStr = Field(description="ID of the loyalty card batch.", alias="batchId", json_schema_extra={"examples": ["hwernpjz"]}) __properties: ClassVar[List[str]] = ["numberOfCardsGenerated", "batchId"] model_config = ConfigDict( diff --git a/talon_one/models/loyalty_card_profile_registration.py b/talon_one/models/loyalty_card_profile_registration.py index dbefef8..240eff2 100644 --- a/talon_one/models/loyalty_card_profile_registration.py +++ b/talon_one/models/loyalty_card_profile_registration.py @@ -29,8 +29,8 @@ class LoyaltyCardProfileRegistration(BaseModel): """ LoyaltyCardProfileRegistration """ # noqa: E501 - integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="Integration ID of the customer profile linked to the card.", alias="integrationId") - timestamp: datetime = Field(description="Timestamp the customer profile was linked to the card.") + integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="Integration ID of the customer profile linked to the card.", alias="integrationId", json_schema_extra={"examples": ["R195412"]}) + timestamp: datetime = Field(description="Timestamp the customer profile was linked to the card.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) __properties: ClassVar[List[str]] = ["integrationId", "timestamp"] model_config = ConfigDict( diff --git a/talon_one/models/loyalty_card_registration.py b/talon_one/models/loyalty_card_registration.py index 1d37ce4..0012711 100644 --- a/talon_one/models/loyalty_card_registration.py +++ b/talon_one/models/loyalty_card_registration.py @@ -27,7 +27,7 @@ class LoyaltyCardRegistration(BaseModel): """ LoyaltyCardRegistration """ # noqa: E501 - integration_id: StrictStr = Field(description="The integrationId of the customer profile.", alias="integrationId") + integration_id: StrictStr = Field(description="The integrationId of the customer profile.", alias="integrationId", json_schema_extra={"examples": ["R195412"]}) __properties: ClassVar[List[str]] = ["integrationId"] model_config = ConfigDict( diff --git a/talon_one/models/loyalty_dashboard_data.py b/talon_one/models/loyalty_dashboard_data.py index 40fb0dc..c409299 100644 --- a/talon_one/models/loyalty_dashboard_data.py +++ b/talon_one/models/loyalty_dashboard_data.py @@ -30,13 +30,13 @@ class LoyaltyDashboardData(BaseModel): Datapoint for the graphs and cards on a loyalty program dashboard. """ # noqa: E501 var_date: datetime = Field(description="Date at which data point was collected.", alias="date") - total_active_points: Union[StrictFloat, StrictInt] = Field(description="Total of active points for this loyalty program.", alias="totalActivePoints") - total_pending_points: Union[StrictFloat, StrictInt] = Field(description="Total of pending points for this loyalty program.", alias="totalPendingPoints") - total_spent_points: Union[StrictFloat, StrictInt] = Field(description="Total of spent points for this loyalty program.", alias="totalSpentPoints") - total_expired_points: Union[StrictFloat, StrictInt] = Field(description="Total of expired points for this loyalty program.", alias="totalExpiredPoints") - total_negative_points: Union[StrictFloat, StrictInt] = Field(description="Total of negative points for this loyalty program.", alias="totalNegativePoints") - total_members: Union[StrictFloat, StrictInt] = Field(description="Number of loyalty program members.", alias="totalMembers") - new_members: Union[StrictFloat, StrictInt] = Field(description="Number of members who joined on this day.", alias="newMembers") + total_active_points: Union[StrictFloat, StrictInt] = Field(description="Total of active points for this loyalty program.", alias="totalActivePoints", json_schema_extra={"examples": [9756]}) + total_pending_points: Union[StrictFloat, StrictInt] = Field(description="Total of pending points for this loyalty program.", alias="totalPendingPoints", json_schema_extra={"examples": [548]}) + total_spent_points: Union[StrictFloat, StrictInt] = Field(description="Total of spent points for this loyalty program.", alias="totalSpentPoints", json_schema_extra={"examples": [25668]}) + total_expired_points: Union[StrictFloat, StrictInt] = Field(description="Total of expired points for this loyalty program.", alias="totalExpiredPoints", json_schema_extra={"examples": [1156]}) + total_negative_points: Union[StrictFloat, StrictInt] = Field(description="Total of negative points for this loyalty program.", alias="totalNegativePoints", json_schema_extra={"examples": [32]}) + total_members: Union[StrictFloat, StrictInt] = Field(description="Number of loyalty program members.", alias="totalMembers", json_schema_extra={"examples": [2582]}) + new_members: Union[StrictFloat, StrictInt] = Field(description="Number of members who joined on this day.", alias="newMembers", json_schema_extra={"examples": [3]}) spent_points: LoyaltyDashboardPointsBreakdown = Field(description="Points spent on this day.", alias="spentPoints") earned_points: LoyaltyDashboardPointsBreakdown = Field(description="Points that were earned on this day.", alias="earnedPoints") __properties: ClassVar[List[str]] = ["date", "totalActivePoints", "totalPendingPoints", "totalSpentPoints", "totalExpiredPoints", "totalNegativePoints", "totalMembers", "newMembers", "spentPoints", "earnedPoints"] diff --git a/talon_one/models/loyalty_dashboard_points_breakdown.py b/talon_one/models/loyalty_dashboard_points_breakdown.py index 20a20a0..ff7398a 100644 --- a/talon_one/models/loyalty_dashboard_points_breakdown.py +++ b/talon_one/models/loyalty_dashboard_points_breakdown.py @@ -27,8 +27,8 @@ class LoyaltyDashboardPointsBreakdown(BaseModel): """ LoyaltyDashboardPointsBreakdown """ # noqa: E501 - created_manually: Union[StrictFloat, StrictInt] = Field(alias="createdManually") - created_via_rule_engine: Union[StrictFloat, StrictInt] = Field(alias="createdViaRuleEngine") + created_manually: Union[StrictFloat, StrictInt] = Field(alias="createdManually", json_schema_extra={"examples": [125]}) + created_via_rule_engine: Union[StrictFloat, StrictInt] = Field(alias="createdViaRuleEngine", json_schema_extra={"examples": [9631]}) __properties: ClassVar[List[str]] = ["createdManually", "createdViaRuleEngine"] model_config = ConfigDict( diff --git a/talon_one/models/loyalty_ledger.py b/talon_one/models/loyalty_ledger.py index d0e087f..adafff2 100644 --- a/talon_one/models/loyalty_ledger.py +++ b/talon_one/models/loyalty_ledger.py @@ -29,7 +29,7 @@ class LoyaltyLedger(BaseModel): Ledger of Balance in Loyalty Program for a Customer. """ # noqa: E501 ledger: LoyaltySubLedger = Field(description="The balance of the main ledger in the loyalty program.") - sub_ledgers: Optional[Dict[str, LoyaltySubLedger]] = Field(default=None, description="A map containing a list of all loyalty subledger balances.", alias="subLedgers") + sub_ledgers: Optional[Dict[str, LoyaltySubLedger]] = Field(default=None, description="A map containing a list of all loyalty subledger balances.", alias="subLedgers", json_schema_extra={"examples": [{"mysubledger": {"total": 0, "totalActivePoints": 286, "totalPendingPoints": 50, "totalSpentPoints": 150, "totalExpiredPoints": 25, "totalNegativePoints": 0}}]}) __properties: ClassVar[List[str]] = ["ledger", "subLedgers"] model_config = ConfigDict( diff --git a/talon_one/models/loyalty_ledger_entry.py b/talon_one/models/loyalty_ledger_entry.py index 8fb50b6..8011c5c 100644 --- a/talon_one/models/loyalty_ledger_entry.py +++ b/talon_one/models/loyalty_ledger_entry.py @@ -29,22 +29,22 @@ class LoyaltyLedgerEntry(BaseModel): """ A single row of the ledger, describing one addition or deduction. """ # noqa: E501 - created: datetime - program_id: StrictInt = Field(alias="programID") - customer_profile_id: Optional[StrictStr] = Field(default=None, alias="customerProfileID") - card_id: Optional[StrictInt] = Field(default=None, alias="cardID") - customer_session_id: Optional[StrictStr] = Field(default=None, alias="customerSessionID") - event_id: Optional[StrictInt] = Field(default=None, alias="eventID") - type: StrictStr = Field(description="The type of the ledger transaction. Possible values are: - `addition` - `subtraction` - `expire` - `expiring` (for expiring points ledgers) ") - amount: Union[StrictFloat, StrictInt] - start_date: Optional[datetime] = Field(default=None, alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, alias="expiryDate") - name: StrictStr = Field(description="A name referencing the condition or effect that added this entry, or the specific name provided in an API call.") - sub_ledger_id: StrictStr = Field(description="This specifies if we are adding loyalty points to the main ledger or a subledger.", alias="subLedgerID") - user_id: Optional[StrictInt] = Field(default=None, description="This is the ID of the user who created this entry, if the addition or subtraction was done manually.", alias="userID") - archived: Optional[StrictBool] = Field(default=None, description="Indicates if the entry belongs to the archived session.") + created: datetime = Field(json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) + program_id: StrictInt = Field(alias="programID", json_schema_extra={"examples": [5]}) + customer_profile_id: Optional[StrictStr] = Field(default=None, alias="customerProfileID", json_schema_extra={"examples": ["URNGV8294NV"]}) + card_id: Optional[StrictInt] = Field(default=None, alias="cardID", json_schema_extra={"examples": [241]}) + customer_session_id: Optional[StrictStr] = Field(default=None, alias="customerSessionID", json_schema_extra={"examples": ["t2gy5s-47274"]}) + event_id: Optional[StrictInt] = Field(default=None, alias="eventID", json_schema_extra={"examples": [5]}) + type: StrictStr = Field(description="The type of the ledger transaction. Possible values are: - `addition` - `subtraction` - `expire` - `expiring` (for expiring points ledgers) ", json_schema_extra={"examples": ["addition"]}) + amount: Union[StrictFloat, StrictInt] = Field(json_schema_extra={"examples": [100]}) + start_date: Optional[datetime] = Field(default=None, alias="startDate", json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) + expiry_date: Optional[datetime] = Field(default=None, alias="expiryDate", json_schema_extra={"examples": ["2022-07-20T22:00:00Z"]}) + name: StrictStr = Field(description="A name referencing the condition or effect that added this entry, or the specific name provided in an API call.", json_schema_extra={"examples": ["Add points on purchase"]}) + sub_ledger_id: StrictStr = Field(description="This specifies if we are adding loyalty points to the main ledger or a subledger.", alias="subLedgerID", json_schema_extra={"examples": ["mysubledger"]}) + user_id: Optional[StrictInt] = Field(default=None, description="This is the ID of the user who created this entry, if the addition or subtraction was done manually.", alias="userID", json_schema_extra={"examples": [499]}) + archived: Optional[StrictBool] = Field(default=None, description="Indicates if the entry belongs to the archived session.", json_schema_extra={"examples": [False]}) flags: Optional[LoyaltyLedgerEntryFlags] = Field(default=None, description="A map of flags providing additional details about the entry.") - 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") + 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]] = ["created", "programID", "customerProfileID", "cardID", "customerSessionID", "eventID", "type", "amount", "startDate", "expiryDate", "name", "subLedgerID", "userID", "archived", "flags", "validityDuration"] model_config = ConfigDict( diff --git a/talon_one/models/loyalty_ledger_transactions.py b/talon_one/models/loyalty_ledger_transactions.py index 0135649..05457cf 100644 --- a/talon_one/models/loyalty_ledger_transactions.py +++ b/talon_one/models/loyalty_ledger_transactions.py @@ -28,7 +28,7 @@ class LoyaltyLedgerTransactions(BaseModel): """ List of loyalty ledger transactions. """ # noqa: E501 - has_more: Optional[StrictBool] = Field(default=None, description="If `true`, it means that there is more data to request in the source collection.", alias="hasMore") + has_more: Optional[StrictBool] = Field(default=None, description="If `true`, it means that there is more data to request in the source collection.", alias="hasMore", json_schema_extra={"examples": [True]}) data: Optional[List[LoyaltyLedgerEntry]] = Field(default=None, description="List of transaction entries from a loyalty ledger.") __properties: ClassVar[List[str]] = ["hasMore", "data"] diff --git a/talon_one/models/loyalty_membership.py b/talon_one/models/loyalty_membership.py index 58242e9..7cc28f1 100644 --- a/talon_one/models/loyalty_membership.py +++ b/talon_one/models/loyalty_membership.py @@ -28,8 +28,8 @@ class LoyaltyMembership(BaseModel): """ LoyaltyMembership """ # noqa: E501 - joined: Optional[datetime] = Field(default=None, description="The moment in which the loyalty program was joined.") - loyalty_program_id: StrictInt = Field(description="The ID of the loyalty program belonging to this entity.", alias="loyaltyProgramId") + joined: Optional[datetime] = Field(default=None, description="The moment in which the loyalty program was joined.", json_schema_extra={"examples": ["2012-03-20T14:15:22Z"]}) + loyalty_program_id: StrictInt = Field(description="The ID of the loyalty program belonging to this entity.", alias="loyaltyProgramId", json_schema_extra={"examples": [323414846]}) __properties: ClassVar[List[str]] = ["joined", "loyaltyProgramId"] model_config = ConfigDict( diff --git a/talon_one/models/loyalty_program.py b/talon_one/models/loyalty_program.py index 608903b..fffbbf5 100644 --- a/talon_one/models/loyalty_program.py +++ b/talon_one/models/loyalty_program.py @@ -31,32 +31,32 @@ class LoyaltyProgram(BaseModel): """ LoyaltyProgram """ # noqa: E501 - id: StrictInt = Field(description="The ID of loyalty program.") - created: datetime = Field(description="The time this entity was created.") - title: Optional[StrictStr] = Field(default=None, description="The display title for the Loyalty Program.") - description: Optional[StrictStr] = Field(default=None, description="Description of our Loyalty Program.") - subscribed_applications: Optional[List[StrictInt]] = Field(default=None, description="A list containing the IDs of all applications that are subscribed to this Loyalty Program.", alias="subscribedApplications") - default_validity: Optional[StrictStr] = Field(default=None, description="The default duration after which new loyalty points should expire. Can be 'unlimited' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month. ", alias="defaultValidity") - default_pending: Optional[StrictStr] = Field(default=None, description="The default duration of the pending time after which points should be valid. Accepted values: 'immediate', 'on_action' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month. ", alias="defaultPending") - allow_subledger: Optional[StrictBool] = Field(default=None, description="Indicates if this program supports subledgers inside the program.", alias="allowSubledger") - users_per_card_limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="The max amount of user profiles with whom a card can be shared. This can be set to 0 for no limit. This property is only used when `cardBased` is `true`. ", alias="usersPerCardLimit") - sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this program is a live or sandbox program. Programs of a given type can only be connected to Applications of the same type.") + id: StrictInt = Field(description="The ID of loyalty program.", json_schema_extra={"examples": [139]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + title: Optional[StrictStr] = Field(default=None, description="The display title for the Loyalty Program.", json_schema_extra={"examples": ["Point collection"]}) + description: Optional[StrictStr] = Field(default=None, description="Description of our Loyalty Program.", json_schema_extra={"examples": ["Customers collect 10 points per 1$ spent"]}) + subscribed_applications: Optional[List[StrictInt]] = Field(default=None, description="A list containing the IDs of all applications that are subscribed to this Loyalty Program.", alias="subscribedApplications", json_schema_extra={"examples": [[132, 97]]}) + default_validity: Optional[StrictStr] = Field(default=None, description="The default duration after which new loyalty points should expire. Can be 'unlimited' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month. ", alias="defaultValidity", json_schema_extra={"examples": ["2W_U"]}) + default_pending: Optional[StrictStr] = Field(default=None, description="The default duration of the pending time after which points should be valid. Accepted values: 'immediate', 'on_action' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month. ", alias="defaultPending", json_schema_extra={"examples": ["immediate"]}) + allow_subledger: Optional[StrictBool] = Field(default=None, description="Indicates if this program supports subledgers inside the program.", alias="allowSubledger", json_schema_extra={"examples": [False]}) + users_per_card_limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="The max amount of user profiles with whom a card can be shared. This can be set to 0 for no limit. This property is only used when `cardBased` is `true`. ", alias="usersPerCardLimit", json_schema_extra={"examples": [111]}) + sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this program is a live or sandbox program. Programs of a given type can only be connected to Applications of the same type.", json_schema_extra={"examples": [True]}) program_join_policy: Optional[StrictStr] = Field(default=None, description="The policy that defines when the customer joins the loyalty program. - `not_join`: The customer does not join the loyalty program but can still earn and spend loyalty points. **Note**: The customer does not have a program join date. - `points_activated`: The customer joins the loyalty program only when their earned loyalty points become active for the first time. - `points_earned`: The customer joins the loyalty program when they earn loyalty points for the first time. ", alias="programJoinPolicy") tiers_expiration_policy: Optional[StrictStr] = Field(default=None, description="The policy that defines how tier expiration, used to reevaluate the customer's current tier, is determined. - `tier_start_date`: The tier expiration is relative to when the customer joined the current tier. - `program_join_date`: The tier expiration is relative to when the customer joined the loyalty program. - `customer_attribute`: The tier expiration is determined by a custom customer attribute. - `absolute_expiration`: The tier is reevaluated at the start of each tier cycle. For this policy, it is required to provide a `tierCycleStartDate`. ", alias="tiersExpirationPolicy") - tier_cycle_start_date: Optional[datetime] = Field(default=None, description="Timestamp at which the tier cycle starts for all customers in the loyalty program. **Note**: This is only required when the tier expiration policy is set to `absolute_expiration`. ", alias="tierCycleStartDate") - tiers_expire_in: Optional[StrictStr] = Field(default=None, description="The amount of time after which the tier expires and is reevaluated. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can 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. ", alias="tiersExpireIn") + tier_cycle_start_date: Optional[datetime] = Field(default=None, description="Timestamp at which the tier cycle starts for all customers in the loyalty program. **Note**: This is only required when the tier expiration policy is set to `absolute_expiration`. ", alias="tierCycleStartDate", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + tiers_expire_in: Optional[StrictStr] = Field(default=None, description="The amount of time after which the tier expires and is reevaluated. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can 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. ", alias="tiersExpireIn", json_schema_extra={"examples": ["27W_U"]}) tiers_downgrade_policy: Optional[StrictStr] = Field(default=None, description="The policy that defines how customer tiers are downgraded in the loyalty program after tier reevaluation. - `one_down`: If the customer doesn't have enough points to stay in the current tier, they are downgraded by one tier. - `balance_based`: The customer's tier is reevaluated based on the amount of active points they have at the moment. ", alias="tiersDowngradePolicy") card_code_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="cardCodeSettings") return_policy: Optional[StrictStr] = Field(default=None, description="The policy that defines the rollback of points in case of a partially returned, cancelled, or reopened [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). - `only_pending`: Only pending points can be rolled back. - `within_balance`: Available active points can be rolled back if there aren't enough pending points. The active balance of the customer cannot be negative. - `unlimited`: Allows negative balance without any limit. ", alias="returnPolicy") - account_id: StrictInt = Field(description="The ID of the Talon.One account that owns this program.", alias="accountID") - name: StrictStr = Field(description="The internal name for the Loyalty Program. This is an immutable value.") - tiers: Optional[List[LoyaltyTier]] = Field(default=None, description="The tiers in this loyalty program.") - timezone: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string containing an IANA timezone descriptor.") - card_based: StrictBool = Field(description="Defines the type of loyalty program: - `true`: the program is a card-based. - `false`: the program is profile-based. ", alias="cardBased") - can_update_tiers: Optional[StrictBool] = Field(default=False, description="`True` if the tier definitions can be updated. ", alias="canUpdateTiers") - can_update_tier_expiration_policy: Optional[StrictBool] = Field(default=None, description="`True` if the tier expiration policy can be updated. ", alias="canUpdateTierExpirationPolicy") - can_upgrade_to_advanced_tiers: Optional[StrictBool] = Field(default=False, description="`True` if the program can be upgraded to use the `tiersExpireIn` and `tiersDowngradePolicy` properties. ", alias="canUpgradeToAdvancedTiers") - can_update_subledgers: Optional[StrictBool] = Field(default=False, description="`True` if the `allowSubledger` property can be updated in the loyalty program. ", alias="canUpdateSubledgers") + account_id: StrictInt = Field(description="The ID of the Talon.One account that owns this program.", alias="accountID", json_schema_extra={"examples": [1]}) + name: StrictStr = Field(description="The internal name for the Loyalty Program. This is an immutable value.", json_schema_extra={"examples": ["my_program"]}) + tiers: Optional[List[LoyaltyTier]] = Field(default=None, description="The tiers in this loyalty program.", json_schema_extra={"examples": [[{"name": "Gold", "minPoints": 300, "id": 3, "created": "2021-06-10T09:05:27.993483Z", "programID": 139}, {"name": "Silver", "minPoints": 200, "id": 2, "created": "2021-06-10T09:04:59.355258Z", "programID": 139}, {"name": "Bronze", "minPoints": 100, "id": 1, "created": "2021-06-10T09:04:39.355258Z", "programID": 139}]]}) + timezone: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string containing an IANA timezone descriptor.", json_schema_extra={"examples": ["Europe/Berlin"]}) + card_based: StrictBool = Field(description="Defines the type of loyalty program: - `true`: the program is a card-based. - `false`: the program is profile-based. ", alias="cardBased", json_schema_extra={"examples": [True]}) + can_update_tiers: Optional[StrictBool] = Field(default=False, description="`True` if the tier definitions can be updated. ", alias="canUpdateTiers", json_schema_extra={"examples": [True]}) + can_update_tier_expiration_policy: Optional[StrictBool] = Field(default=None, description="`True` if the tier expiration policy can be updated. ", alias="canUpdateTierExpirationPolicy", json_schema_extra={"examples": [True]}) + can_upgrade_to_advanced_tiers: Optional[StrictBool] = Field(default=False, description="`True` if the program can be upgraded to use the `tiersExpireIn` and `tiersDowngradePolicy` properties. ", alias="canUpgradeToAdvancedTiers", json_schema_extra={"examples": [True]}) + can_update_subledgers: Optional[StrictBool] = Field(default=False, description="`True` if the `allowSubledger` property can be updated in the loyalty program. ", alias="canUpdateSubledgers", json_schema_extra={"examples": [True]}) __properties: ClassVar[List[str]] = ["id", "created", "title", "description", "subscribedApplications", "defaultValidity", "defaultPending", "allowSubledger", "usersPerCardLimit", "sandbox", "programJoinPolicy", "tiersExpirationPolicy", "tierCycleStartDate", "tiersExpireIn", "tiersDowngradePolicy", "cardCodeSettings", "returnPolicy", "accountID", "name", "tiers", "timezone", "cardBased", "canUpdateTiers", "canUpdateTierExpirationPolicy", "canUpgradeToAdvancedTiers", "canUpdateSubledgers"] @field_validator('program_join_policy') diff --git a/talon_one/models/loyalty_program_balance.py b/talon_one/models/loyalty_program_balance.py index c7e2305..8685dac 100644 --- a/talon_one/models/loyalty_program_balance.py +++ b/talon_one/models/loyalty_program_balance.py @@ -27,14 +27,14 @@ class LoyaltyProgramBalance(BaseModel): """ The balance in a Loyalty Program for some Customer. """ # noqa: E501 - current_balance: Union[StrictFloat, StrictInt] = Field(description="Sum of currently active points.", alias="currentBalance") - pending_balance: Union[StrictFloat, StrictInt] = Field(description="Sum of pending points.", alias="pendingBalance") - negative_balance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Sum of negative points. This implies that `currentBalance` is `0`.", alias="negativeBalance") - expired_balance: Union[StrictFloat, StrictInt] = Field(description="**DEPRECATED** Value is shown as 0. ", alias="expiredBalance") - spent_balance: Union[StrictFloat, StrictInt] = Field(description="**DEPRECATED** Value is shown as 0. ", alias="spentBalance") - tentative_current_balance: Union[StrictFloat, StrictInt] = Field(description="The tentative points balance, reflecting the `currentBalance` and all point additions and deductions within the current open customer session. When the session is closed, the effects are applied and the `currentBalance` is updated to this value. **Note:** Tentative balances are specific to the current session and do not take into account other open sessions for the given customer. ", alias="tentativeCurrentBalance") - tentative_pending_balance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The tentative points balance, reflecting the `pendingBalance` and all point additions with a future activation date within the current open customer session. When the session is closed, the effects are applied and the `pendingBalance` is updated to this value. **Note:** Tentative balances are specific to the current session and do not take into account other open sessions for the given customer. ", alias="tentativePendingBalance") - tentative_negative_balance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The tentative negative balance after all additions and deductions from the current customer session are applied to `negativeBalance`. When the session is closed, the tentative effects are applied and `negativeBalance` is updated to this value. **Note:** Tentative balances are specific to the current session and do not take into account other open sessions for the given customer. ", alias="tentativeNegativeBalance") + current_balance: Union[StrictFloat, StrictInt] = Field(description="Sum of currently active points.", alias="currentBalance", json_schema_extra={"examples": [100]}) + pending_balance: Union[StrictFloat, StrictInt] = Field(description="Sum of pending points.", alias="pendingBalance", json_schema_extra={"examples": [10]}) + negative_balance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Sum of negative points. This implies that `currentBalance` is `0`.", alias="negativeBalance", json_schema_extra={"examples": [10]}) + expired_balance: Union[StrictFloat, StrictInt] = Field(description="**DEPRECATED** Value is shown as 0. ", alias="expiredBalance", json_schema_extra={"examples": [0]}) + spent_balance: Union[StrictFloat, StrictInt] = Field(description="**DEPRECATED** Value is shown as 0. ", alias="spentBalance", json_schema_extra={"examples": [0]}) + tentative_current_balance: Union[StrictFloat, StrictInt] = Field(description="The tentative points balance, reflecting the `currentBalance` and all point additions and deductions within the current open customer session. When the session is closed, the effects are applied and the `currentBalance` is updated to this value. **Note:** Tentative balances are specific to the current session and do not take into account other open sessions for the given customer. ", alias="tentativeCurrentBalance", json_schema_extra={"examples": [100]}) + tentative_pending_balance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The tentative points balance, reflecting the `pendingBalance` and all point additions with a future activation date within the current open customer session. When the session is closed, the effects are applied and the `pendingBalance` is updated to this value. **Note:** Tentative balances are specific to the current session and do not take into account other open sessions for the given customer. ", alias="tentativePendingBalance", json_schema_extra={"examples": [20]}) + tentative_negative_balance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The tentative negative balance after all additions and deductions from the current customer session are applied to `negativeBalance`. When the session is closed, the tentative effects are applied and `negativeBalance` is updated to this value. **Note:** Tentative balances are specific to the current session and do not take into account other open sessions for the given customer. ", alias="tentativeNegativeBalance", json_schema_extra={"examples": [100]}) __properties: ClassVar[List[str]] = ["currentBalance", "pendingBalance", "negativeBalance", "expiredBalance", "spentBalance", "tentativeCurrentBalance", "tentativePendingBalance", "tentativeNegativeBalance"] model_config = ConfigDict( diff --git a/talon_one/models/loyalty_program_entity.py b/talon_one/models/loyalty_program_entity.py index d582640..8bd920d 100644 --- a/talon_one/models/loyalty_program_entity.py +++ b/talon_one/models/loyalty_program_entity.py @@ -27,9 +27,9 @@ class LoyaltyProgramEntity(BaseModel): """ LoyaltyProgramEntity """ # noqa: E501 - program_id: StrictInt = Field(description="The ID of the loyalty program that owns this entity.", alias="programID") - program_name: Optional[StrictStr] = Field(default=None, description="The integration name of the loyalty program that owns this entity.", alias="programName") - program_title: Optional[StrictStr] = Field(default=None, description="The Campaign Manager-displayed name of the loyalty program that owns this entity.", alias="programTitle") + program_id: StrictInt = Field(description="The ID of the loyalty program that owns this entity.", alias="programID", json_schema_extra={"examples": [125]}) + program_name: Optional[StrictStr] = Field(default=None, description="The integration name of the loyalty program that owns this entity.", alias="programName", json_schema_extra={"examples": ["Loyalty_program"]}) + program_title: Optional[StrictStr] = Field(default=None, description="The Campaign Manager-displayed name of the loyalty program that owns this entity.", alias="programTitle", json_schema_extra={"examples": ["Loyalty program"]}) __properties: ClassVar[List[str]] = ["programID", "programName", "programTitle"] model_config = ConfigDict( diff --git a/talon_one/models/loyalty_program_ledgers.py b/talon_one/models/loyalty_program_ledgers.py index 55014f4..43af11e 100644 --- a/talon_one/models/loyalty_program_ledgers.py +++ b/talon_one/models/loyalty_program_ledgers.py @@ -29,10 +29,10 @@ class LoyaltyProgramLedgers(BaseModel): """ Customer-specific information about loyalty points. """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of loyalty program.") - title: StrictStr = Field(description="Visible name of loyalty program.") - name: StrictStr = Field(description="Internal name of loyalty program.") - join_date: Optional[datetime] = Field(default=None, description="The date on which the customer joined the loyalty program in RFC3339. **Note**: This is in the loyalty program's time zone. ", alias="joinDate") + id: StrictInt = Field(description="The internal ID of loyalty program.", json_schema_extra={"examples": [5]}) + title: StrictStr = Field(description="Visible name of loyalty program.", json_schema_extra={"examples": ["My loyalty program"]}) + name: StrictStr = Field(description="Internal name of loyalty program.", json_schema_extra={"examples": ["program1"]}) + join_date: Optional[datetime] = Field(default=None, description="The date on which the customer joined the loyalty program in RFC3339. **Note**: This is in the loyalty program's time zone. ", alias="joinDate", json_schema_extra={"examples": ["2024-04-30T15:04:05Z07:00"]}) ledger: LedgerInfo = Field(description="Information about the main ledger in the loyalty program.") sub_ledgers: Optional[Dict[str, LedgerInfo]] = Field(default=None, description="A map containing information about each loyalty subledger.", alias="subLedgers") __properties: ClassVar[List[str]] = ["id", "title", "name", "joinDate", "ledger", "subLedgers"] diff --git a/talon_one/models/loyalty_program_transaction.py b/talon_one/models/loyalty_program_transaction.py index 55cf3d2..19d1f3a 100644 --- a/talon_one/models/loyalty_program_transaction.py +++ b/talon_one/models/loyalty_program_transaction.py @@ -30,27 +30,27 @@ class LoyaltyProgramTransaction(BaseModel): """ LoyaltyProgramTransaction """ # noqa: E501 - id: StrictInt = Field(description="ID of the loyalty ledger transaction.") - transaction_uuid: StrictStr = Field(description="Unique identifier of the transaction in the UUID format.", alias="transactionUUID") - program_id: StrictInt = Field(description="ID of the loyalty program.", alias="programId") - campaign_id: Optional[StrictInt] = Field(default=None, description="ID of the campaign.", alias="campaignId") - created: datetime = Field(description="Date and time the loyalty transaction occurred.") - type: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Type of transaction. Possible values: - `addition`: Signifies added points. - `subtraction`: Signifies deducted points. ") - amount: Union[StrictFloat, StrictInt] = Field(description="Amount of loyalty points added or deducted in the transaction.") - name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Name or reason for the loyalty ledger transaction.") - start_date: Annotated[str, Field(strict=True, max_length=64)] = Field(description="When points become active. Possible values: - `immediate`: Points are immediately active. - `on_action`: Points become active based on the customer's action. - a timestamp value: Points become active at a given date and time. ", alias="startDate") - expiry_date: StrictStr = Field(description="When points expire. Possible values: - `unlimited`: Points have no expiration date. - a timestamp value: Points expire at a given date and time. ", alias="expiryDate") - customer_profile_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Customer profile integration ID used in the loyalty program.", alias="customerProfileId") - card_identifier: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=108)]] = Field(default=None, description="The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. ", alias="cardIdentifier") - subledger_id: Annotated[str, Field(strict=True, max_length=64)] = Field(description="ID of the subledger.", alias="subledgerId") - customer_session_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="ID of the customer session where the transaction occurred.", alias="customerSessionId") - import_id: Optional[StrictInt] = Field(default=None, description="ID of the import where the transaction occurred.", alias="importId") - user_id: Optional[StrictInt] = Field(default=None, description="ID of the user who manually added or deducted points. Applies only to manual transactions.", alias="userId") - user_email: Optional[StrictStr] = Field(default=None, description="The email of the Campaign Manager account that manually added or deducted points. Applies only to manual transactions.", alias="userEmail") - ruleset_id: Optional[StrictInt] = Field(default=None, description="ID of the ruleset containing the rule that triggered the effect. Applies only for transactions that resulted from a customer session.", alias="rulesetId") - rule_name: Optional[StrictStr] = Field(default=None, description="Name of the rule that triggered the effect. Applies only for transactions that resulted from a customer session.", alias="ruleName") + id: StrictInt = Field(description="ID of the loyalty ledger transaction.", json_schema_extra={"examples": [123]}) + transaction_uuid: StrictStr = Field(description="Unique identifier of the transaction in the UUID format.", alias="transactionUUID", json_schema_extra={"examples": ["ce59f12a-f53b-4014-a745-636d93f2bd3f"]}) + program_id: StrictInt = Field(description="ID of the loyalty program.", alias="programId", json_schema_extra={"examples": [324]}) + campaign_id: Optional[StrictInt] = Field(default=None, description="ID of the campaign.", alias="campaignId", json_schema_extra={"examples": [324]}) + created: datetime = Field(description="Date and time the loyalty transaction occurred.", json_schema_extra={"examples": ["2022-01-02T15:04:05Z07:00"]}) + type: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Type of transaction. Possible values: - `addition`: Signifies added points. - `subtraction`: Signifies deducted points. ", json_schema_extra={"examples": ["addition"]}) + amount: Union[StrictFloat, StrictInt] = Field(description="Amount of loyalty points added or deducted in the transaction.", json_schema_extra={"examples": [10.25]}) + name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Name or reason for the loyalty ledger transaction.", json_schema_extra={"examples": ["Reward 50 points for each $500 purchase"]}) + start_date: Annotated[str, Field(strict=True, max_length=64)] = Field(description="When points become active. Possible values: - `immediate`: Points are immediately active. - `on_action`: Points become active based on the customer's action. - a timestamp value: Points become active at a given date and time. ", alias="startDate", json_schema_extra={"examples": ["2022-01-02T15:04:05Z07:00"]}) + expiry_date: StrictStr = Field(description="When points expire. Possible values: - `unlimited`: Points have no expiration date. - a timestamp value: Points expire at a given date and time. ", alias="expiryDate", json_schema_extra={"examples": ["2022-01-02T15:04:05Z07:00"]}) + customer_profile_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Customer profile integration ID used in the loyalty program.", alias="customerProfileId", json_schema_extra={"examples": ["kda0fajs0-fad9f-fd9dfsa9-fd9dasjf9"]}) + card_identifier: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=108)]] = Field(default=None, description="The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. ", alias="cardIdentifier", json_schema_extra={"examples": ["summer-loyalty-card-0543"]}) + subledger_id: Annotated[str, Field(strict=True, max_length=64)] = Field(description="ID of the subledger.", alias="subledgerId", json_schema_extra={"examples": ["sub-123"]}) + customer_session_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="ID of the customer session where the transaction occurred.", alias="customerSessionId", json_schema_extra={"examples": ["05c2da0d-48fa-4aa1-b629-898f58f1584d"]}) + import_id: Optional[StrictInt] = Field(default=None, description="ID of the import where the transaction occurred.", alias="importId", json_schema_extra={"examples": [4]}) + user_id: Optional[StrictInt] = Field(default=None, description="ID of the user who manually added or deducted points. Applies only to manual transactions.", alias="userId", json_schema_extra={"examples": [5]}) + user_email: Optional[StrictStr] = Field(default=None, description="The email of the Campaign Manager account that manually added or deducted points. Applies only to manual transactions.", alias="userEmail", json_schema_extra={"examples": ["john.doe@example.com"]}) + ruleset_id: Optional[StrictInt] = Field(default=None, description="ID of the ruleset containing the rule that triggered the effect. Applies only for transactions that resulted from a customer session.", alias="rulesetId", json_schema_extra={"examples": [11]}) + rule_name: Optional[StrictStr] = Field(default=None, description="Name of the rule that triggered the effect. Applies only for transactions that resulted from a customer session.", alias="ruleName", json_schema_extra={"examples": ["10 points for every $100 spent"]}) flags: Optional[LoyaltyLedgerEntryFlags] = Field(default=None, description="The flags of the transaction, when applicable. The `createsNegativeBalance` flag indicates whether the transaction results in a negative balance.") - 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") + 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]] = ["id", "transactionUUID", "programId", "campaignId", "created", "type", "amount", "name", "startDate", "expiryDate", "customerProfileId", "cardIdentifier", "subledgerId", "customerSessionId", "importId", "userId", "userEmail", "rulesetId", "ruleName", "flags", "validityDuration"] @field_validator('type') diff --git a/talon_one/models/loyalty_tier.py b/talon_one/models/loyalty_tier.py index 45c3db7..38eb4c7 100644 --- a/talon_one/models/loyalty_tier.py +++ b/talon_one/models/loyalty_tier.py @@ -29,13 +29,13 @@ class LoyaltyTier(BaseModel): """ LoyaltyTier """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - program_id: StrictInt = Field(description="The ID of the loyalty program that owns this entity.", alias="programID") - program_name: Optional[StrictStr] = Field(default=None, description="The integration name of the loyalty program that owns this entity.", alias="programName") - program_title: Optional[StrictStr] = Field(default=None, description="The Campaign Manager-displayed name of the loyalty program that owns this entity.", alias="programTitle") - name: StrictStr = Field(description="The name of the tier.") - min_points: Union[Annotated[float, Field(le=999999999999.99, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]] = Field(description="The minimum amount of points required to enter the tier.", alias="minPoints") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + program_id: StrictInt = Field(description="The ID of the loyalty program that owns this entity.", alias="programID", json_schema_extra={"examples": [125]}) + program_name: Optional[StrictStr] = Field(default=None, description="The integration name of the loyalty program that owns this entity.", alias="programName", json_schema_extra={"examples": ["Loyalty_program"]}) + program_title: Optional[StrictStr] = Field(default=None, description="The Campaign Manager-displayed name of the loyalty program that owns this entity.", alias="programTitle", json_schema_extra={"examples": ["Loyalty program"]}) + name: StrictStr = Field(description="The name of the tier.", json_schema_extra={"examples": ["Gold"]}) + min_points: Union[Annotated[float, Field(le=999999999999.99, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]] = Field(description="The minimum amount of points required to enter the tier.", alias="minPoints", json_schema_extra={"examples": [300]}) __properties: ClassVar[List[str]] = ["id", "created", "programID", "programName", "programTitle", "name", "minPoints"] model_config = ConfigDict( diff --git a/talon_one/models/management_key.py b/talon_one/models/management_key.py index 72473db..14842d6 100644 --- a/talon_one/models/management_key.py +++ b/talon_one/models/management_key.py @@ -29,16 +29,16 @@ class ManagementKey(BaseModel): """ ManagementKey """ # noqa: E501 - name: StrictStr = Field(description="Name for management key.") - expiry_date: datetime = Field(description="The date the management key expires.", alias="expiryDate") + name: StrictStr = Field(description="Name for management key.", json_schema_extra={"examples": ["My generated key"]}) + expiry_date: datetime = Field(description="The date the management key expires.", alias="expiryDate", json_schema_extra={"examples": ["2023-08-24T14:00:00Z"]}) endpoints: List[Endpoint] = Field(description="The list of endpoints that can be accessed with the key") - allowed_application_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of Application IDs that you can access with the management key. An empty or missing list means the management key can be used for all Applications in the account. ", alias="allowedApplicationIds") - id: StrictInt = Field(description="ID of the management key.") - created_by: StrictInt = Field(description="ID of the user who created it.", alias="createdBy") - account_id: StrictInt = Field(description="ID of account the key is used for.", alias="accountID") - created: datetime = Field(description="The date the management key was created.") - disabled: Optional[StrictBool] = Field(default=None, description="The management key is disabled (this property is set to `true`) when the user who created the key is disabled or deleted.") - last_used: Optional[datetime] = Field(default=None, description="The last time the management key was used.", alias="lastUsed") + allowed_application_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of Application IDs that you can access with the management key. An empty or missing list means the management key can be used for all Applications in the account. ", alias="allowedApplicationIds", json_schema_extra={"examples": [[1, 2, 3]]}) + id: StrictInt = Field(description="ID of the management key.", json_schema_extra={"examples": [34]}) + created_by: StrictInt = Field(description="ID of the user who created it.", alias="createdBy", json_schema_extra={"examples": [280]}) + account_id: StrictInt = Field(description="ID of account the key is used for.", alias="accountID", json_schema_extra={"examples": [13]}) + created: datetime = Field(description="The date the management key was created.", json_schema_extra={"examples": ["2022-03-02T16:46:17.758585Z"]}) + disabled: Optional[StrictBool] = Field(default=None, description="The management key is disabled (this property is set to `true`) when the user who created the key is disabled or deleted.", json_schema_extra={"examples": [True]}) + last_used: Optional[datetime] = Field(default=None, description="The last time the management key was used.", alias="lastUsed", json_schema_extra={"examples": ["2022-03-02T16:46:17.758585Z"]}) __properties: ClassVar[List[str]] = ["name", "expiryDate", "endpoints", "allowedApplicationIds", "id", "createdBy", "accountID", "created", "disabled", "lastUsed"] model_config = ConfigDict( diff --git a/talon_one/models/mcp_key.py b/talon_one/models/mcp_key.py index f84e386..7ed07c8 100644 --- a/talon_one/models/mcp_key.py +++ b/talon_one/models/mcp_key.py @@ -28,14 +28,14 @@ class MCPKey(BaseModel): """ MCPKey """ # noqa: E501 - name: StrictStr = Field(description="Name for the MCP key.") - expiry_date: datetime = Field(description="The date the MCP key expires.", alias="expiryDate") - id: StrictInt = Field(description="ID of the MCP key.") - created_by: StrictInt = Field(description="ID of the user who created it.", alias="createdBy") - account_id: StrictInt = Field(description="ID of account the key is used for.", alias="accountID") - created: datetime = Field(description="The date the MCP key was created.") - disabled: Optional[StrictBool] = Field(default=None, description="The MCP key is disabled (this property is set to `true`) when the user who created the key is disabled or deleted.") - last_used: Optional[datetime] = Field(default=None, description="The last time the MCP key was used.", alias="lastUsed") + name: StrictStr = Field(description="Name for the MCP key.", json_schema_extra={"examples": ["My MCP key"]}) + expiry_date: datetime = Field(description="The date the MCP key expires.", alias="expiryDate", json_schema_extra={"examples": ["2026-08-24T14:00:00Z"]}) + id: StrictInt = Field(description="ID of the MCP key.", json_schema_extra={"examples": [34]}) + created_by: StrictInt = Field(description="ID of the user who created it.", alias="createdBy", json_schema_extra={"examples": [280]}) + account_id: StrictInt = Field(description="ID of account the key is used for.", alias="accountID", json_schema_extra={"examples": [13]}) + created: datetime = Field(description="The date the MCP key was created.", json_schema_extra={"examples": ["2026-03-02T16:46:17.758585Z"]}) + disabled: Optional[StrictBool] = Field(default=None, description="The MCP key is disabled (this property is set to `true`) when the user who created the key is disabled or deleted.", json_schema_extra={"examples": [True]}) + last_used: Optional[datetime] = Field(default=None, description="The last time the MCP key was used.", alias="lastUsed", json_schema_extra={"examples": ["2026-03-02T16:46:17.758585Z"]}) __properties: ClassVar[List[str]] = ["name", "expiryDate", "id", "createdBy", "accountID", "created", "disabled", "lastUsed"] model_config = ConfigDict( diff --git a/talon_one/models/message_log_entries.py b/talon_one/models/message_log_entries.py index 49c919e..986f166 100644 --- a/talon_one/models/message_log_entries.py +++ b/talon_one/models/message_log_entries.py @@ -28,7 +28,7 @@ class MessageLogEntries(BaseModel): """ MessageLogEntries """ # noqa: E501 - next_cursor: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="The next value in the database. **Note:** If this value is not present, it means that there are no more values in the database for this combination of request parameters. ", alias="nextCursor") + next_cursor: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="The next value in the database. **Note:** If this value is not present, it means that there are no more values in the database for this combination of request parameters. ", alias="nextCursor", json_schema_extra={"examples": ["SmJlNERRMHdyNWFsTmRDZDVYU0c="]}) data: List[MessageLogEntry] = Field(description="List of message logs.") __properties: ClassVar[List[str]] = ["nextCursor", "data"] diff --git a/talon_one/models/message_log_entry.py b/talon_one/models/message_log_entry.py index 920abda..dc6fcac 100644 --- a/talon_one/models/message_log_entry.py +++ b/talon_one/models/message_log_entry.py @@ -31,21 +31,21 @@ class MessageLogEntry(BaseModel): """ Message Log. """ # noqa: E501 - id: StrictStr = Field(description="Unique identifier of the message.") - service: StrictStr = Field(description="Name of the service that generated the log entry.") - change_type: Optional[StrictStr] = Field(default=None, description="Type of change that triggered the notification.", alias="changeType") - notification_id: Optional[StrictInt] = Field(default=None, description="ID of the notification.", alias="notificationId") - notification_name: Optional[StrictStr] = Field(default=None, description="The name of the notification.", alias="notificationName") - webhook_id: Optional[StrictInt] = Field(default=None, description="ID of the webhook.", alias="webhookId") - webhook_name: Optional[StrictStr] = Field(default=None, description="The name of the webhook.", alias="webhookName") + id: StrictStr = Field(description="Unique identifier of the message.", json_schema_extra={"examples": ["123e4567-e89b-12d3-a456-426614174000"]}) + service: StrictStr = Field(description="Name of the service that generated the log entry.", json_schema_extra={"examples": ["NotificationService"]}) + change_type: Optional[StrictStr] = Field(default=None, description="Type of change that triggered the notification.", alias="changeType", json_schema_extra={"examples": ["Update"]}) + notification_id: Optional[StrictInt] = Field(default=None, description="ID of the notification.", alias="notificationId", json_schema_extra={"examples": [101]}) + notification_name: Optional[StrictStr] = Field(default=None, description="The name of the notification.", alias="notificationName", json_schema_extra={"examples": ["My campaign notification"]}) + webhook_id: Optional[StrictInt] = Field(default=None, description="ID of the webhook.", alias="webhookId", json_schema_extra={"examples": [101]}) + webhook_name: Optional[StrictStr] = Field(default=None, description="The name of the webhook.", alias="webhookName", json_schema_extra={"examples": ["My webhook"]}) request: Optional[MessageLogRequest] = None response: Optional[MessageLogResponse] = None - created_at: datetime = Field(description="Timestamp when the log entry was created.", alias="createdAt") - entity_type: StrictStr = Field(description="The entity type the log is related to. ", alias="entityType") - url: Optional[StrictStr] = Field(default=None, description="The target URL of the request.") - application_id: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Identifier of the Application.", alias="applicationId") - loyalty_program_id: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Identifier of the loyalty program.", alias="loyaltyProgramId") - campaign_id: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Identifier of the campaign.", alias="campaignId") + created_at: datetime = Field(description="Timestamp when the log entry was created.", alias="createdAt", json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) + entity_type: StrictStr = Field(description="The entity type the log is related to. ", alias="entityType", json_schema_extra={"examples": ["loyalty_program"]}) + url: Optional[StrictStr] = Field(default=None, description="The target URL of the request.", json_schema_extra={"examples": ["www.my-company.com/my-endpoint-name"]}) + application_id: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Identifier of the Application.", alias="applicationId", json_schema_extra={"examples": [5]}) + loyalty_program_id: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Identifier of the loyalty program.", alias="loyaltyProgramId", json_schema_extra={"examples": [2]}) + campaign_id: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Identifier of the campaign.", alias="campaignId", json_schema_extra={"examples": [2]}) __properties: ClassVar[List[str]] = ["id", "service", "changeType", "notificationId", "notificationName", "webhookId", "webhookName", "request", "response", "createdAt", "entityType", "url", "applicationId", "loyaltyProgramId", "campaignId"] @field_validator('entity_type') diff --git a/talon_one/models/message_log_request.py b/talon_one/models/message_log_request.py index a72f694..dc53d8f 100644 --- a/talon_one/models/message_log_request.py +++ b/talon_one/models/message_log_request.py @@ -28,8 +28,8 @@ class MessageLogRequest(BaseModel): """ Details of the request. """ # noqa: E501 - created_at: datetime = Field(description="Timestamp when the request was made.", alias="createdAt") - request: Union[StrictBytes, StrictStr] = Field(description="Raw request data.") + created_at: datetime = Field(description="Timestamp when the request was made.", alias="createdAt", json_schema_extra={"examples": ["2021-07-20T21:59:00Z"]}) + request: Union[StrictBytes, StrictStr] = Field(description="Raw request data.", json_schema_extra={"examples": ["SGVsbG8sIHdvcmxkIQ=="]}) __properties: ClassVar[List[str]] = ["createdAt", "request"] model_config = ConfigDict( diff --git a/talon_one/models/message_log_response.py b/talon_one/models/message_log_response.py index 7d97180..781f8f2 100644 --- a/talon_one/models/message_log_response.py +++ b/talon_one/models/message_log_response.py @@ -28,9 +28,9 @@ class MessageLogResponse(BaseModel): """ Details of the response. """ # noqa: E501 - created_at: Optional[datetime] = Field(default=None, description="Timestamp when the response was received.", alias="createdAt") - response: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="Raw response data.") - status: Optional[StrictInt] = Field(default=None, description="HTTP status code of the response.") + created_at: Optional[datetime] = Field(default=None, description="Timestamp when the response was received.", alias="createdAt", json_schema_extra={"examples": ["2021-07-20T22:00:50Z"]}) + response: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="Raw response data.", json_schema_extra={"examples": ["UmVzcG9uc2UgY29udGVudA=="]}) + status: Optional[StrictInt] = Field(default=None, description="HTTP status code of the response.", json_schema_extra={"examples": [200]}) __properties: ClassVar[List[str]] = ["createdAt", "response", "status"] model_config = ConfigDict( diff --git a/talon_one/models/message_test.py b/talon_one/models/message_test.py index 2cd9d22..fb423ef 100644 --- a/talon_one/models/message_test.py +++ b/talon_one/models/message_test.py @@ -27,8 +27,8 @@ class MessageTest(BaseModel): """ MessageTest """ # noqa: E501 - http_response: StrictStr = Field(description="The returned http response.", alias="httpResponse") - http_status: StrictInt = Field(description="The returned http status code.", alias="httpStatus") + http_response: StrictStr = Field(description="The returned http response.", alias="httpResponse", json_schema_extra={"examples": ["HTTP/1.1 200 OK\nContent-Type: application/json\nContent-Length: 256\n\n{\n \"message\": \"Hello, world!\",\n \"status\": \"success\"\n}\n"]}) + http_status: StrictInt = Field(description="The returned http status code.", alias="httpStatus", json_schema_extra={"examples": [200]}) __properties: ClassVar[List[str]] = ["httpResponse", "httpStatus"] model_config = ConfigDict( diff --git a/talon_one/models/model_import.py b/talon_one/models/model_import.py index 25ad141..351fd57 100644 --- a/talon_one/models/model_import.py +++ b/talon_one/models/model_import.py @@ -29,12 +29,12 @@ class ModelImport(BaseModel): """ ModelImport """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - user_id: StrictInt = Field(description="The ID of the user associated with this entity.", alias="userId") - entity: StrictStr = Field(description="The name of the entity that was imported. ") - amount: Annotated[int, Field(strict=True, ge=0)] = Field(description="The number of values that were imported.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + 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 imported. ", json_schema_extra={"examples": ["AttributeAllowedList"]}) + amount: Annotated[int, Field(strict=True, ge=0)] = Field(description="The number of values that were imported.", json_schema_extra={"examples": [10]}) __properties: ClassVar[List[str]] = ["id", "created", "accountId", "userId", "entity", "amount"] model_config = ConfigDict( diff --git a/talon_one/models/model_return.py b/talon_one/models/model_return.py index e3dca7a..6985781 100644 --- a/talon_one/models/model_return.py +++ b/talon_one/models/model_return.py @@ -30,17 +30,17 @@ class ModelReturn(BaseModel): """ ModelReturn """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) returned_cart_items: List[ReturnedCartItem] = Field(description="List of cart items to be returned.", alias="returnedCartItems") - event_id: StrictInt = Field(description="The event ID of that was generated for this return.", alias="eventId") - session_id: StrictInt = Field(description="The internal ID of the session this return was requested on.", alias="sessionId") - session_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID of the session this return was requested on.", alias="sessionIntegrationId") - profile_id: Optional[StrictInt] = Field(default=None, description="The internal ID of the profile this return was requested on.", alias="profileId") - profile_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the profile this return was requested on.", alias="profileIntegrationId") - created_by: Optional[StrictInt] = Field(default=None, description="ID of the user who requested this return.", alias="createdBy") + event_id: StrictInt = Field(description="The event ID of that was generated for this return.", alias="eventId", json_schema_extra={"examples": [123]}) + session_id: StrictInt = Field(description="The internal ID of the session this return was requested on.", alias="sessionId", json_schema_extra={"examples": [123]}) + session_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID of the session this return was requested on.", alias="sessionIntegrationId", json_schema_extra={"examples": ["0c0e0207-eb30-4e06-a56c-2b7c8a64953c"]}) + profile_id: Optional[StrictInt] = Field(default=None, description="The internal ID of the profile this return was requested on.", alias="profileId", json_schema_extra={"examples": [123]}) + profile_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the profile this return was requested on.", alias="profileIntegrationId", json_schema_extra={"examples": ["0c0e0207-eb30-4e06-a56c-2b7c8a64953c"]}) + created_by: Optional[StrictInt] = Field(default=None, description="ID of the user who requested this return.", alias="createdBy", json_schema_extra={"examples": [123]}) __properties: ClassVar[List[str]] = ["id", "created", "applicationId", "accountId", "returnedCartItems", "eventId", "sessionId", "sessionIntegrationId", "profileId", "profileIntegrationId", "createdBy"] model_config = ConfigDict( diff --git a/talon_one/models/multiple_audiences.py b/talon_one/models/multiple_audiences.py index 7b310b9..a56b574 100644 --- a/talon_one/models/multiple_audiences.py +++ b/talon_one/models/multiple_audiences.py @@ -28,7 +28,7 @@ class MultipleAudiences(BaseModel): """ MultipleAudiences """ # noqa: E501 - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) audiences: List[MultipleAudiencesItem] __properties: ClassVar[List[str]] = ["accountId", "audiences"] diff --git a/talon_one/models/multiple_audiences_item.py b/talon_one/models/multiple_audiences_item.py index 456c955..008506c 100644 --- a/talon_one/models/multiple_audiences_item.py +++ b/talon_one/models/multiple_audiences_item.py @@ -29,12 +29,12 @@ class MultipleAudiencesItem(BaseModel): """ MultipleAudiencesItem """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The human-friendly display name for this audience.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications that are connected to this audience.", alias="subscribedApplicationsIds") - integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The ID of this audience in the third-party integration.", alias="integrationId") - status: StrictStr = Field(description="Indicates whether the audience is new, updated or unmodified by the request. ") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The human-friendly display name for this audience.", json_schema_extra={"examples": ["Travel audience"]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications that are connected to this audience.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[3, 13]]}) + integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The ID of this audience in the third-party integration.", alias="integrationId", json_schema_extra={"examples": ["382370BKDB946"]}) + status: StrictStr = Field(description="Indicates whether the audience is new, updated or unmodified by the request. ", json_schema_extra={"examples": ["new"]}) __properties: ClassVar[List[str]] = ["id", "created", "name", "subscribedApplicationsIds", "integrationId", "status"] @field_validator('status') diff --git a/talon_one/models/multiple_customer_profile_integration_request_item.py b/talon_one/models/multiple_customer_profile_integration_request_item.py index b799f1f..723dbed 100644 --- a/talon_one/models/multiple_customer_profile_integration_request_item.py +++ b/talon_one/models/multiple_customer_profile_integration_request_item.py @@ -28,8 +28,8 @@ class MultipleCustomerProfileIntegrationRequestItem(BaseModel): """ MultipleCustomerProfileIntegrationRequestItem """ # noqa: E501 - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.") - integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The identifier of this profile, set by your integration layer. It must be unique within the account. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2). ", alias="integrationId") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.", json_schema_extra={"examples": [{"Language": "english", "ShippingCountry": "DE"}]}) + integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The identifier of this profile, set by your integration layer. It must be unique within the account. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2). ", alias="integrationId", json_schema_extra={"examples": ["R195412"]}) __properties: ClassVar[List[str]] = ["attributes", "integrationId"] model_config = ConfigDict( diff --git a/talon_one/models/mutable_entity.py b/talon_one/models/mutable_entity.py index 1dbe0df..899bae0 100644 --- a/talon_one/models/mutable_entity.py +++ b/talon_one/models/mutable_entity.py @@ -28,7 +28,7 @@ class MutableEntity(BaseModel): """ MutableEntity """ # noqa: E501 - modified: datetime = Field(description="The time this entity was last modified.") + modified: datetime = Field(description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) __properties: ClassVar[List[str]] = ["modified"] model_config = ConfigDict( diff --git a/talon_one/models/new_account_sign_up.py b/talon_one/models/new_account_sign_up.py index 18143d9..ad80279 100644 --- a/talon_one/models/new_account_sign_up.py +++ b/talon_one/models/new_account_sign_up.py @@ -28,8 +28,8 @@ class NewAccountSignUp(BaseModel): """ NewAccountSignUp """ # noqa: E501 - email: StrictStr = Field(description="The email address associated with the user profile.") - password: StrictStr = Field(description="The password for your account.") + email: StrictStr = Field(description="The email address associated with the user profile.", json_schema_extra={"examples": ["john.doe@example.com"]}) + password: StrictStr = Field(description="The password for your account.", json_schema_extra={"examples": ["admin123456"]}) company_name: Annotated[str, Field(min_length=1, strict=True)] = Field(alias="companyName") __properties: ClassVar[List[str]] = ["email", "password", "companyName"] diff --git a/talon_one/models/new_additional_cost.py b/talon_one/models/new_additional_cost.py index 7c9739f..2c0bc2e 100644 --- a/talon_one/models/new_additional_cost.py +++ b/talon_one/models/new_additional_cost.py @@ -28,11 +28,11 @@ class NewAdditionalCost(BaseModel): """ NewAdditionalCost """ # noqa: E501 - name: Annotated[str, Field(strict=True)] = Field(description="The internal name used in API requests.") - title: Annotated[str, Field(strict=True)] = Field(description="The human-readable name for the additional cost that will be shown in the Campaign Manager. Like `name`, the combination of entity and title must also be unique.") - description: StrictStr = Field(description="A description of this additional cost.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications that are subscribed to this additional cost.", alias="subscribedApplicationsIds") - 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. ") + name: Annotated[str, Field(strict=True)] = Field(description="The internal name used in API requests.", json_schema_extra={"examples": ["shippingFee"]}) + title: Annotated[str, Field(strict=True)] = Field(description="The human-readable name for the additional cost that will be shown in the Campaign Manager. Like `name`, the combination of entity and title must also be unique.", json_schema_extra={"examples": ["Shipping fee"]}) + description: StrictStr = Field(description="A description of this additional cost.", json_schema_extra={"examples": ["A shipping fee"]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications that are subscribed to this additional cost.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[3, 13]]}) + 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') diff --git a/talon_one/models/new_application.py b/talon_one/models/new_application.py index 42c6498..22978c6 100644 --- a/talon_one/models/new_application.py +++ b/talon_one/models/new_application.py @@ -30,11 +30,11 @@ class NewApplication(BaseModel): """ NewApplication """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this application.") - description: Optional[StrictStr] = Field(default=None, description="A longer description of the application.") - timezone: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string containing an IANA timezone descriptor.") - currency: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The default currency for new customer sessions.") - case_sensitivity: Optional[StrictStr] = Field(default=None, description="The case sensitivity behavior to check coupon codes in the campaigns of this Application.", alias="caseSensitivity") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this application.", json_schema_extra={"examples": ["My Application"]}) + description: Optional[StrictStr] = Field(default=None, description="A longer description of the application.", json_schema_extra={"examples": ["A test Application"]}) + timezone: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string containing an IANA timezone descriptor.", json_schema_extra={"examples": ["Europe/Berlin"]}) + currency: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The default currency for new customer sessions.", json_schema_extra={"examples": ["EUR"]}) + case_sensitivity: Optional[StrictStr] = Field(default=None, description="The case sensitivity behavior to check coupon codes in the campaigns of this Application.", alias="caseSensitivity", json_schema_extra={"examples": ["sensitive"]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") limits: Optional[List[LimitConfig]] = Field(default=None, description="Default limits for campaigns created in this application.") default_discount_scope: Optional[StrictStr] = Field(default=None, description="The default scope to apply `setDiscount` effects on if no scope was provided with the effect. ", alias="defaultDiscountScope") @@ -42,10 +42,10 @@ class NewApplication(BaseModel): enable_flattened_cart_items: Optional[StrictBool] = Field(default=None, description="Indicates if cart items of quantity larger than one should be separated into different items of quantity one. ", alias="enableFlattenedCartItems") attributes_settings: Optional[AttributesSettings] = Field(default=None, alias="attributesSettings") sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this is a live or sandbox Application.") - enable_partial_discounts: Optional[StrictBool] = Field(default=None, description="Indicates if this Application supports partial discounts.", alias="enablePartialDiscounts") + enable_partial_discounts: Optional[StrictBool] = Field(default=None, description="Indicates if this Application supports partial discounts.", alias="enablePartialDiscounts", json_schema_extra={"examples": [False]}) default_discount_additional_cost_per_item_scope: Optional[StrictStr] = Field(default=None, description="The default scope to apply `setDiscountPerItem` effects on if no scope was provided with the effect. ", alias="defaultDiscountAdditionalCostPerItemScope") key: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Hex key for HMAC-signing API calls as coming from this application (16 hex digits).") - enable_campaign_state_management: Optional[StrictBool] = Field(default=None, description="Indicates whether the campaign staging and revisions feature is enabled for the Application. **Important:** After this feature is enabled, it cannot be disabled. ", alias="enableCampaignStateManagement") + enable_campaign_state_management: Optional[StrictBool] = Field(default=None, description="Indicates whether the campaign staging and revisions feature is enabled for the Application. **Important:** After this feature is enabled, it cannot be disabled. ", alias="enableCampaignStateManagement", json_schema_extra={"examples": [False]}) __properties: ClassVar[List[str]] = ["name", "description", "timezone", "currency", "caseSensitivity", "attributes", "limits", "defaultDiscountScope", "enableCascadingDiscounts", "enableFlattenedCartItems", "attributesSettings", "sandbox", "enablePartialDiscounts", "defaultDiscountAdditionalCostPerItemScope", "key", "enableCampaignStateManagement"] @field_validator('case_sensitivity') diff --git a/talon_one/models/new_application_api_key.py b/talon_one/models/new_application_api_key.py index b32ecde..4f4da8c 100644 --- a/talon_one/models/new_application_api_key.py +++ b/talon_one/models/new_application_api_key.py @@ -28,17 +28,17 @@ class NewApplicationAPIKey(BaseModel): """ NewApplicationAPIKey """ # noqa: E501 - title: StrictStr = Field(description="Title of the API key.") - expires: datetime = Field(description="The date the API key expires.") - platform: Optional[StrictStr] = Field(default=None, description="The third-party platform the API key is valid for. Use `none` for a generic API key to be used from your own integration layer. ") - type: Optional[StrictStr] = Field(default=None, description="The API key type. Can be empty or `staging`. Staging API keys can only be used for dry requests with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint, [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint, and [Track event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) endpoint. When using the _Update customer profile_ endpoint with a staging API key, the query parameter `runRuleEngine` must be `true`. ") - time_offset: Optional[StrictInt] = Field(default=None, description="A time offset in nanoseconds associated with the API key. When making a request using the API key, rule evaluation is based on a date that is calculated by adding the offset to the current date. ", alias="timeOffset") - id: StrictInt = Field(description="ID of the API Key.") - created_by: StrictInt = Field(description="ID of user who created.", alias="createdBy") - account_id: StrictInt = Field(description="ID of account the key is used for.", alias="accountID") - application_id: StrictInt = Field(description="ID of application the key is used for.", alias="applicationID") - created: datetime = Field(description="The date the API key was created.") - key: StrictStr = Field(description="The API key.") + title: StrictStr = Field(description="Title of the API key.", json_schema_extra={"examples": ["My generated key"]}) + expires: datetime = Field(description="The date the API key expires.", json_schema_extra={"examples": ["2023-08-24T14:00:00Z"]}) + platform: Optional[StrictStr] = Field(default=None, description="The third-party platform the API key is valid for. Use `none` for a generic API key to be used from your own integration layer. ", json_schema_extra={"examples": ["none"]}) + type: Optional[StrictStr] = Field(default=None, description="The API key type. Can be empty or `staging`. Staging API keys can only be used for dry requests with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint, [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint, and [Track event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) endpoint. When using the _Update customer profile_ endpoint with a staging API key, the query parameter `runRuleEngine` must be `true`. ", json_schema_extra={"examples": ["staging"]}) + time_offset: Optional[StrictInt] = Field(default=None, description="A time offset in nanoseconds associated with the API key. When making a request using the API key, rule evaluation is based on a date that is calculated by adding the offset to the current date. ", alias="timeOffset", json_schema_extra={"examples": [100000]}) + id: StrictInt = Field(description="ID of the API Key.", json_schema_extra={"examples": [34]}) + created_by: StrictInt = Field(description="ID of user who created.", alias="createdBy", json_schema_extra={"examples": [280]}) + account_id: StrictInt = Field(description="ID of account the key is used for.", alias="accountID", json_schema_extra={"examples": [13]}) + application_id: StrictInt = Field(description="ID of application the key is used for.", alias="applicationID", json_schema_extra={"examples": [54]}) + created: datetime = Field(description="The date the API key was created.", json_schema_extra={"examples": ["2022-03-02T16:46:17.758585Z"]}) + key: StrictStr = Field(description="The API key.", json_schema_extra={"examples": ["f45f90d21dcd9bac965c45e547e9754a3196891d09948e35adbcbedc4e9e4b01"]}) __properties: ClassVar[List[str]] = ["title", "expires", "platform", "type", "timeOffset", "id", "createdBy", "accountID", "applicationID", "created", "key"] @field_validator('platform') diff --git a/talon_one/models/new_application_cif.py b/talon_one/models/new_application_cif.py index 52975a2..8328d45 100644 --- a/talon_one/models/new_application_cif.py +++ b/talon_one/models/new_application_cif.py @@ -28,11 +28,11 @@ class NewApplicationCIF(BaseModel): """ NewApplicationCIF """ # noqa: E501 - name: StrictStr = Field(description="The name of the Application cart item filter used in API requests.") - description: Optional[StrictStr] = Field(default=None, description="A short description of the Application cart item filter.") - active_expression_id: Optional[StrictInt] = Field(default=None, description="The ID of the expression that the Application cart item filter uses.", alias="activeExpressionId") - modified_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who last updated the Application cart item filter.", alias="modifiedBy") - created_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who created the Application cart item filter.", alias="createdBy") + name: StrictStr = Field(description="The name of the Application cart item filter used in API requests.", json_schema_extra={"examples": ["Filter items by product"]}) + description: Optional[StrictStr] = Field(default=None, description="A short description of the Application cart item filter.", json_schema_extra={"examples": ["This filter allows filtering by shoes"]}) + active_expression_id: Optional[StrictInt] = Field(default=None, description="The ID of the expression that the Application cart item filter uses.", alias="activeExpressionId", json_schema_extra={"examples": [1]}) + modified_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who last updated the Application cart item filter.", alias="modifiedBy", json_schema_extra={"examples": [334]}) + created_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who created the Application cart item filter.", alias="createdBy", json_schema_extra={"examples": [216]}) modified: Optional[datetime] = Field(default=None, description="Timestamp of the most recent update to the Application cart item filter.") __properties: ClassVar[List[str]] = ["name", "description", "activeExpressionId", "modifiedBy", "createdBy", "modified"] diff --git a/talon_one/models/new_application_cif_expression.py b/talon_one/models/new_application_cif_expression.py index 5d13ea7..7b252cd 100644 --- a/talon_one/models/new_application_cif_expression.py +++ b/talon_one/models/new_application_cif_expression.py @@ -27,9 +27,9 @@ class NewApplicationCIFExpression(BaseModel): """ NewApplicationCIFExpression """ # noqa: E501 - cart_item_filter_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application cart item filter.", alias="cartItemFilterId") - created_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who created the Application cart item filter.", alias="createdBy") - expression: Optional[List[Any]] = Field(default=None, description="Arbitrary additional JSON data associated with the Application cart item filter.") + cart_item_filter_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application cart item filter.", alias="cartItemFilterId", json_schema_extra={"examples": [216]}) + created_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who created the Application cart item filter.", alias="createdBy", json_schema_extra={"examples": [216]}) + expression: Optional[List[Any]] = Field(default=None, description="Arbitrary additional JSON data associated with the Application cart item filter.", json_schema_extra={"examples": [{"expr": ["filter", [".", "Session", "CartItems"], [["Item"], ["catch", False, ["=", [".", "Item", "Category"], "Kitchen"]]]]}]}) __properties: ClassVar[List[str]] = ["cartItemFilterId", "createdBy", "expression"] model_config = ConfigDict( diff --git a/talon_one/models/new_attribute.py b/talon_one/models/new_attribute.py index 828ba91..1fa8f3e 100644 --- a/talon_one/models/new_attribute.py +++ b/talon_one/models/new_attribute.py @@ -28,19 +28,19 @@ class NewAttribute(BaseModel): """ NewAttribute """ # noqa: E501 - entity: StrictStr = Field(description="The name of the entity that can have this attribute. When creating or updating the entities of a given type, you can include an `attributes` object with keys corresponding to the `name` of the custom attributes for that type.") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - name: Annotated[str, Field(strict=True)] = Field(description="The attribute name that will be used in API requests and Talang. E.g. if `name == \"region\"` then you would set the region attribute by including an `attributes.region` property in your request payload.") - title: Annotated[str, Field(strict=True)] = Field(description="The human-readable name for the attribute that will be shown in the Campaign Manager. Like `name`, the combination of entity and title must also be unique.") - type: StrictStr = Field(description="The data type of the attribute, a `time` attribute must be sent as a string that conforms to the [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) timestamp format.") - description: StrictStr = Field(description="A description of this attribute.") + entity: StrictStr = Field(description="The name of the entity that can have this attribute. When creating or updating the entities of a given type, you can include an `attributes` object with keys corresponding to the `name` of the custom attributes for that type.", json_schema_extra={"examples": ["Event"]}) + event_type: Optional[StrictStr] = Field(default=None, alias="eventType", json_schema_extra={"examples": ["pageViewed"]}) + name: Annotated[str, Field(strict=True)] = Field(description="The attribute name that will be used in API requests and Talang. E.g. if `name == \"region\"` then you would set the region attribute by including an `attributes.region` property in your request payload.", json_schema_extra={"examples": ["pageViewed"]}) + title: Annotated[str, Field(strict=True)] = Field(description="The human-readable name for the attribute that will be shown in the Campaign Manager. Like `name`, the combination of entity and title must also be unique.", json_schema_extra={"examples": ["Page view event"]}) + type: StrictStr = Field(description="The data type of the attribute, a `time` attribute must be sent as a string that conforms to the [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) timestamp format.", json_schema_extra={"examples": ["string"]}) + description: StrictStr = Field(description="A description of this attribute.", json_schema_extra={"examples": ["Event triggered when a customer displays a page."]}) suggestions: Annotated[List[Annotated[str, Field(min_length=1, strict=True)]], Field(max_length=50)] = Field(description="A list of suggestions for the attribute.") - has_allowed_list: Optional[StrictBool] = Field(default=False, description="Whether or not this attribute has an allowed list of values associated with it.", alias="hasAllowedList") - restricted_by_suggestions: Optional[StrictBool] = Field(default=False, description="Whether or not this attribute's value is restricted by suggestions (`suggestions` property) or by an allowed list of value (`hasAllowedList` property). ", alias="restrictedBySuggestions") - editable: StrictBool = Field(description="Whether or not this attribute can be edited.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications where this attribute is available.", alias="subscribedApplicationsIds") - subscribed_catalogs_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the catalogs where this attribute is available.", alias="subscribedCatalogsIds") - allowed_subscriptions: Optional[Annotated[List[StrictStr], Field(max_length=2)]] = Field(default=None, description="A list of allowed subscription types for this attribute. **Note:** This only applies to attributes associated with the `CartItem` entity. ", alias="allowedSubscriptions") + has_allowed_list: Optional[StrictBool] = Field(default=False, description="Whether or not this attribute has an allowed list of values associated with it.", alias="hasAllowedList", json_schema_extra={"examples": [False]}) + restricted_by_suggestions: Optional[StrictBool] = Field(default=False, description="Whether or not this attribute's value is restricted by suggestions (`suggestions` property) or by an allowed list of value (`hasAllowedList` property). ", alias="restrictedBySuggestions", json_schema_extra={"examples": [False]}) + editable: StrictBool = Field(description="Whether or not this attribute can be edited.", json_schema_extra={"examples": [True]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications where this attribute is available.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[1, 4, 9]]}) + subscribed_catalogs_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the catalogs where this attribute is available.", alias="subscribedCatalogsIds", json_schema_extra={"examples": [[2, 5]]}) + allowed_subscriptions: Optional[Annotated[List[StrictStr], Field(max_length=2)]] = Field(default=None, description="A list of allowed subscription types for this attribute. **Note:** This only applies to attributes associated with the `CartItem` entity. ", alias="allowedSubscriptions", json_schema_extra={"examples": [["application", "catalog"]]}) __properties: ClassVar[List[str]] = ["entity", "eventType", "name", "title", "type", "description", "suggestions", "hasAllowedList", "restrictedBySuggestions", "editable", "subscribedApplicationsIds", "subscribedCatalogsIds", "allowedSubscriptions"] @field_validator('entity') diff --git a/talon_one/models/new_audience.py b/talon_one/models/new_audience.py index 3b53035..ab94c1f 100644 --- a/talon_one/models/new_audience.py +++ b/talon_one/models/new_audience.py @@ -29,14 +29,14 @@ class NewAudience(BaseModel): """ NewAudience """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The human-friendly display name for this audience.") - sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this is a live or sandbox Application.") - description: Optional[StrictStr] = Field(default=None, description="A description of the audience.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications that are connected to this audience.", alias="subscribedApplicationsIds") - 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. ") - integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = 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") - created_in3rd_party: Optional[StrictBool] = Field(default=None, description="Determines if this audience is a 3rd party audience or not.", alias="createdIn3rdParty") - last_update: Optional[datetime] = Field(default=None, description="The last time that the audience memberships changed.", alias="lastUpdate") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The human-friendly display name for this audience.", json_schema_extra={"examples": ["Travel audience"]}) + sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this is a live or sandbox Application.", json_schema_extra={"examples": [True]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the audience.", json_schema_extra={"examples": ["Travel audience 18-27"]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications that are connected to this audience.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[3, 13]]}) + 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[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = 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"]}) + created_in3rd_party: Optional[StrictBool] = Field(default=None, description="Determines if this audience is a 3rd party audience or not.", alias="createdIn3rdParty", json_schema_extra={"examples": [False]}) + last_update: Optional[datetime] = Field(default=None, description="The last time that the audience memberships changed.", alias="lastUpdate", json_schema_extra={"examples": ["2022-04-26T11:02:38Z"]}) __properties: ClassVar[List[str]] = ["name", "sandbox", "description", "subscribedApplicationsIds", "integration", "integrationId", "createdIn3rdParty", "lastUpdate"] model_config = ConfigDict( diff --git a/talon_one/models/new_blueprint.py b/talon_one/models/new_blueprint.py index fc0cd2f..b52c3e3 100644 --- a/talon_one/models/new_blueprint.py +++ b/talon_one/models/new_blueprint.py @@ -29,7 +29,7 @@ class NewBlueprint(BaseModel): """ NewBlueprint """ # noqa: E501 - title: StrictStr = Field(description="The display name for the blueprint.") + title: StrictStr = Field(description="The display name for the blueprint.", json_schema_extra={"examples": ["Customer loyalty boost"]}) description: Optional[StrictStr] = Field(default=None, description="A longer, more detailed description of the blueprint.") category: Optional[StrictStr] = Field(default='custom', description="Category used to group blueprints.") rules: Optional[List[CatalogRule]] = Field(default=None, description="Array of rules to store in this blueprint. Rules should only contain title (no description, as description is at the blueprint level). At least one rule or cart item filter is required.") diff --git a/talon_one/models/new_campaign.py b/talon_one/models/new_campaign.py index acc431c..d0274ec 100644 --- a/talon_one/models/new_campaign.py +++ b/talon_one/models/new_campaign.py @@ -31,24 +31,24 @@ class NewCampaign(BaseModel): """ NewCampaign """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A user-facing name for this campaign.") - description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.") - start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime") - end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A user-facing name for this campaign.", json_schema_extra={"examples": ["Summer promotions"]}) + description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.", json_schema_extra={"examples": ["Campaign for all summer 2021 promotions"]}) + start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime", json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) + end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime", json_schema_extra={"examples": ["2021-09-22T22:00:00Z"]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") - state: StrictStr = Field(description="A disabled or archived campaign is not evaluated for rules or coupons. ") - active_ruleset_id: Optional[StrictInt] = Field(default=None, description="[ID of Ruleset](https://docs.talon.one/management-api#tag/Campaigns/operation/getRulesets) this campaign applies on customer session evaluation. ", alias="activeRulesetId") - tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)] = Field(description="A list of tags for the campaign.") - reevaluate_on_return: Optional[StrictBool] = Field(default=None, description="Indicates whether this campaign should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn") - features: List[StrictStr] = Field(description="The features enabled in this campaign.") + state: StrictStr = Field(description="A disabled or archived campaign is not evaluated for rules or coupons. ", json_schema_extra={"examples": ["enabled"]}) + active_ruleset_id: Optional[StrictInt] = Field(default=None, description="[ID of Ruleset](https://docs.talon.one/management-api#tag/Campaigns/operation/getRulesets) this campaign applies on customer session evaluation. ", alias="activeRulesetId", json_schema_extra={"examples": [6]}) + tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)] = Field(description="A list of tags for the campaign.", json_schema_extra={"examples": [["summer"]]}) + reevaluate_on_return: Optional[StrictBool] = Field(default=None, description="Indicates whether this campaign should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn", json_schema_extra={"examples": [True]}) + features: List[StrictStr] = Field(description="The features enabled in this campaign.", json_schema_extra={"examples": [["coupons", "referrals"]]}) coupon_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="couponSettings") referral_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="referralSettings") limits: List[LimitConfig] = Field(description="The set of [budget limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets) for this campaign. ") - campaign_groups: Optional[List[StrictInt]] = Field(default=None, description="The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/managing-campaign-groups) this campaign belongs to. ", alias="campaignGroups") - type: Optional[StrictStr] = Field(default='advanced', description="The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. ") - linked_store_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of store IDs that you want to link to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. ", alias="linkedStoreIds") + campaign_groups: Optional[List[StrictInt]] = Field(default=None, description="The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/managing-campaign-groups) this campaign belongs to. ", alias="campaignGroups", json_schema_extra={"examples": [[1, 3]]}) + type: Optional[StrictStr] = Field(default='advanced', description="The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. ", json_schema_extra={"examples": ["advanced"]}) + linked_store_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of store IDs that you want to link to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. ", alias="linkedStoreIds", json_schema_extra={"examples": [[1, 2, 3]]}) coupon_attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with coupons in this campaign.", alias="couponAttributes") - evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign evaluation group the campaign belongs to.", alias="evaluationGroupId") + evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign evaluation group the campaign belongs to.", alias="evaluationGroupId", json_schema_extra={"examples": [2]}) __properties: ClassVar[List[str]] = ["name", "description", "startTime", "endTime", "attributes", "state", "activeRulesetId", "tags", "reevaluateOnReturn", "features", "couponSettings", "referralSettings", "limits", "campaignGroups", "type", "linkedStoreIds", "couponAttributes", "evaluationGroupId"] @field_validator('state') diff --git a/talon_one/models/new_campaign_collection.py b/talon_one/models/new_campaign_collection.py index 627b16b..9e0a413 100644 --- a/talon_one/models/new_campaign_collection.py +++ b/talon_one/models/new_campaign_collection.py @@ -28,8 +28,8 @@ class NewCampaignCollection(BaseModel): """ NewCampaignCollection """ # noqa: E501 - description: Optional[StrictStr] = Field(default=None, description="A short description of the purpose of this collection.") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this collection.") + description: Optional[StrictStr] = Field(default=None, description="A short description of the purpose of this collection.", json_schema_extra={"examples": ["My collection of SKUs"]}) + 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') diff --git a/talon_one/models/new_campaign_evaluation_group.py b/talon_one/models/new_campaign_evaluation_group.py index d8046d9..f8e283c 100644 --- a/talon_one/models/new_campaign_evaluation_group.py +++ b/talon_one/models/new_campaign_evaluation_group.py @@ -28,12 +28,12 @@ class NewCampaignEvaluationGroup(BaseModel): """ NewCampaignEvaluationGroup """ # noqa: E501 - name: StrictStr = Field(description="The name of the campaign evaluation group.") - parent_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the parent group that contains the campaign evaluation group.", alias="parentId") - description: Optional[StrictStr] = Field(default=None, description="A description of the campaign evaluation group.") + name: StrictStr = Field(description="The name of the campaign evaluation group.", json_schema_extra={"examples": ["Summer campaigns"]}) + parent_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the parent group that contains the campaign evaluation group.", alias="parentId", json_schema_extra={"examples": [2]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the campaign evaluation group.", json_schema_extra={"examples": ["This campaign evaluation group contains all campaigns that are running in the summer."]}) evaluation_mode: StrictStr = Field(description="The mode by which campaigns in the campaign evaluation group are evaluated.", alias="evaluationMode") evaluation_scope: StrictStr = Field(description="The evaluation scope of the campaign evaluation group.", alias="evaluationScope") - locked: StrictBool = Field(description="An indicator of whether the campaign evaluation group is locked for modification.") + locked: StrictBool = Field(description="An indicator of whether the campaign evaluation group is locked for modification.", json_schema_extra={"examples": [False]}) __properties: ClassVar[List[str]] = ["name", "parentId", "description", "evaluationMode", "evaluationScope", "locked"] @field_validator('evaluation_mode') diff --git a/talon_one/models/new_campaign_group.py b/talon_one/models/new_campaign_group.py index 85c089a..83f0745 100644 --- a/talon_one/models/new_campaign_group.py +++ b/talon_one/models/new_campaign_group.py @@ -28,10 +28,10 @@ class NewCampaignGroup(BaseModel): """ NewCampaignGroup """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the campaign access group.") - description: Optional[StrictStr] = Field(default=None, description="A longer description of the campaign access group.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of IDs of the Applications that this campaign access group is enabled for.", alias="subscribedApplicationsIds") - campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of IDs of the campaigns that are part of the campaign access group.", alias="campaignIds") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the campaign access group.", json_schema_extra={"examples": ["Europe access group"]}) + description: Optional[StrictStr] = Field(default=None, description="A longer description of the campaign access group.", json_schema_extra={"examples": ["A group that gives access to all the campaigns for the Europe market."]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of IDs of the Applications that this campaign access group is enabled for.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[1, 2, 3]]}) + campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of IDs of the campaigns that are part of the campaign access group.", alias="campaignIds", json_schema_extra={"examples": [[4, 6, 8]]}) __properties: ClassVar[List[str]] = ["name", "description", "subscribedApplicationsIds", "campaignIds"] model_config = ConfigDict( diff --git a/talon_one/models/new_campaign_set.py b/talon_one/models/new_campaign_set.py index 9ab432c..967acbe 100644 --- a/talon_one/models/new_campaign_set.py +++ b/talon_one/models/new_campaign_set.py @@ -29,8 +29,8 @@ class NewCampaignSet(BaseModel): """ NewCampaignSet """ # noqa: E501 - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - version: Annotated[int, Field(strict=True, ge=1)] = Field(description="Version of the campaign set.") + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + version: Annotated[int, Field(strict=True, ge=1)] = Field(description="Version of the campaign set.", json_schema_extra={"examples": [2]}) set: CampaignSetBranchNode __properties: ClassVar[List[str]] = ["applicationId", "version", "set"] diff --git a/talon_one/models/new_campaign_store_budget_store_limit.py b/talon_one/models/new_campaign_store_budget_store_limit.py index 14cf808..1a6c92b 100644 --- a/talon_one/models/new_campaign_store_budget_store_limit.py +++ b/talon_one/models/new_campaign_store_budget_store_limit.py @@ -27,8 +27,8 @@ class NewCampaignStoreBudgetStoreLimit(BaseModel): """ NewCampaignStoreBudgetStoreLimit """ # noqa: E501 - store_id: StrictInt = Field(description="The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. ", alias="storeId") - limit: Union[StrictFloat, StrictInt] = Field(description="The value to set for the limit.") + store_id: StrictInt = Field(description="The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. ", alias="storeId", json_schema_extra={"examples": [17]}) + limit: Union[StrictFloat, StrictInt] = Field(description="The value to set for the limit.", json_schema_extra={"examples": [1000]}) __properties: ClassVar[List[str]] = ["storeId", "limit"] model_config = ConfigDict( diff --git a/talon_one/models/new_campaign_template.py b/talon_one/models/new_campaign_template.py index 7016651..285e1b1 100644 --- a/talon_one/models/new_campaign_template.py +++ b/talon_one/models/new_campaign_template.py @@ -40,7 +40,7 @@ class NewCampaignTemplate(BaseModel): coupon_attributes: Optional[Dict[str, Any]] = Field(default=None, description="The campaign attributes that coupons created from this template will have by default.", alias="couponAttributes") state: StrictStr = Field(description="Only Campaign Templates in 'available' state may be used to create Campaigns.") tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)]] = Field(default=None, description="A list of tags for the campaign template.") - reevaluate_on_return: Optional[StrictBool] = Field(default=None, description="Indicates whether campaigns created from this template should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn") + reevaluate_on_return: Optional[StrictBool] = Field(default=None, description="Indicates whether campaigns created from this template should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn", json_schema_extra={"examples": [True]}) features: Optional[List[StrictStr]] = Field(default=None, description="A list of features for the campaign template.") coupon_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="couponSettings") coupon_reservation_settings: Optional[CampaignTemplateCouponReservationSettings] = Field(default=None, alias="couponReservationSettings") @@ -48,8 +48,8 @@ class NewCampaignTemplate(BaseModel): limits: Optional[List[TemplateLimitConfig]] = Field(default=None, description="The set of limits that will operate for this campaign template.") template_params: Optional[List[CampaignTemplateParams]] = Field(default=None, description="Fields which can be used to replace values in a rule.", alias="templateParams") campaign_collections: Optional[List[CampaignTemplateCollection]] = Field(default=None, description="The campaign collections from the blueprint campaign for the template.", alias="campaignCollections") - default_campaign_group_id: Optional[StrictInt] = Field(default=None, description="The default campaign group ID.", alias="defaultCampaignGroupId") - campaign_type: StrictStr = Field(description="The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. ", alias="campaignType") + default_campaign_group_id: Optional[StrictInt] = Field(default=None, description="The default campaign group ID.", alias="defaultCampaignGroupId", json_schema_extra={"examples": [42]}) + campaign_type: StrictStr = Field(description="The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. ", alias="campaignType", json_schema_extra={"examples": ["advanced"]}) __properties: ClassVar[List[str]] = ["name", "description", "instructions", "campaignAttributes", "couponAttributes", "state", "tags", "reevaluateOnReturn", "features", "couponSettings", "couponReservationSettings", "referralSettings", "limits", "templateParams", "campaignCollections", "defaultCampaignGroupId", "campaignType"] @field_validator('state') diff --git a/talon_one/models/new_catalog.py b/talon_one/models/new_catalog.py index d2b83ab..cdd452e 100644 --- a/talon_one/models/new_catalog.py +++ b/talon_one/models/new_catalog.py @@ -27,9 +27,9 @@ class NewCatalog(BaseModel): """ NewCatalog """ # noqa: E501 - name: StrictStr = Field(description="The cart item catalog name.") - description: StrictStr = Field(description="A description of this cart item catalog.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications that are subscribed to this catalog.", alias="subscribedApplicationsIds") + name: StrictStr = Field(description="The cart item catalog name.", json_schema_extra={"examples": ["seafood"]}) + description: StrictStr = Field(description="A description of this cart item catalog.", json_schema_extra={"examples": ["seafood catalog"]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications that are subscribed to this catalog.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[1, 2, 3]]}) __properties: ClassVar[List[str]] = ["name", "description", "subscribedApplicationsIds"] model_config = ConfigDict( diff --git a/talon_one/models/new_collection.py b/talon_one/models/new_collection.py index 02a4578..80ac927 100644 --- a/talon_one/models/new_collection.py +++ b/talon_one/models/new_collection.py @@ -28,9 +28,9 @@ class NewCollection(BaseModel): """ NewCollection """ # noqa: E501 - description: Optional[StrictStr] = Field(default=None, description="A short description of the purpose of this collection.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications where this collection is enabled.", alias="subscribedApplicationsIds") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this collection.") + description: Optional[StrictStr] = Field(default=None, description="A short description of the purpose of this collection.", json_schema_extra={"examples": ["My collection of SKUs"]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications where this collection is enabled.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[1, 2, 3]]}) + 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') diff --git a/talon_one/models/new_coupon_creation_job.py b/talon_one/models/new_coupon_creation_job.py index 72ca422..f6a0401 100644 --- a/talon_one/models/new_coupon_creation_job.py +++ b/talon_one/models/new_coupon_creation_job.py @@ -30,15 +30,15 @@ class NewCouponCreationJob(BaseModel): """ NewCouponCreationJob """ # noqa: E501 - usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit") - discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit") - 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") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the coupon. Coupon never expires if this is omitted.", alias="expiryDate") - 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") + usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit", json_schema_extra={"examples": [100]}) + discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit", json_schema_extra={"examples": [30]}) + 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"]}) + 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 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") + attributes: Dict[str, Any] = Field(description="Arbitrary properties associated with this campaign.") + 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"] model_config = ConfigDict( diff --git a/talon_one/models/new_coupons.py b/talon_one/models/new_coupons.py index 6165813..d1ecad7 100644 --- a/talon_one/models/new_coupons.py +++ b/talon_one/models/new_coupons.py @@ -30,20 +30,20 @@ class NewCoupons(BaseModel): """ NewCoupons """ # noqa: E501 - usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit") - discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit") - 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") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the coupon. Coupon never expires if this is omitted.", alias="expiryDate") + usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit", json_schema_extra={"examples": [100]}) + discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit", json_schema_extra={"examples": [30]}) + 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"]}) 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") - 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") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.") - 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") - 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") - 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") - 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") - implicitly_reserved: Optional[StrictBool] = Field(default=None, description="An indication of whether the coupon is implicitly reserved for all customers.", alias="implicitlyReserved") + 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.") + 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"] model_config = ConfigDict( diff --git a/talon_one/models/new_coupons_for_multiple_recipients.py b/talon_one/models/new_coupons_for_multiple_recipients.py index 69d565c..2d53e59 100644 --- a/talon_one/models/new_coupons_for_multiple_recipients.py +++ b/talon_one/models/new_coupons_for_multiple_recipients.py @@ -29,15 +29,15 @@ class NewCouponsForMultipleRecipients(BaseModel): """ NewCouponsForMultipleRecipients """ # noqa: E501 - usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit") - discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit") - 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") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the coupon. Coupon never expires if this is omitted.", alias="expiryDate") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.") - recipients_integration_ids: Annotated[List[StrictStr], Field(min_length=1, max_length=1000)] = Field(description="The integration IDs for recipients.", alias="recipientsIntegrationIds") - 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") - 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") + usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit", json_schema_extra={"examples": [100]}) + discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit", json_schema_extra={"examples": [30]}) + 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.") + 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-#####"]}) __properties: ClassVar[List[str]] = ["usageLimit", "discountLimit", "reservationLimit", "startDate", "expiryDate", "attributes", "recipientsIntegrationIds", "validCharacters", "couponPattern"] model_config = ConfigDict( diff --git a/talon_one/models/new_customer_profile.py b/talon_one/models/new_customer_profile.py index 640943e..35a6e1f 100644 --- a/talon_one/models/new_customer_profile.py +++ b/talon_one/models/new_customer_profile.py @@ -27,7 +27,7 @@ class NewCustomerProfile(BaseModel): """ NewCustomerProfile """ # noqa: E501 - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.", json_schema_extra={"examples": [{"Language": "english", "ShippingCountry": "DE"}]}) __properties: ClassVar[List[str]] = ["attributes"] model_config = ConfigDict( diff --git a/talon_one/models/new_customer_session.py b/talon_one/models/new_customer_session.py index fa5cccc..42fe876 100644 --- a/talon_one/models/new_customer_session.py +++ b/talon_one/models/new_customer_session.py @@ -29,14 +29,14 @@ class NewCustomerSession(BaseModel): """ NewCustomerSession """ # noqa: E501 - profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") - coupon: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Any coupon code entered.") - referral: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Any referral code entered.") - state: Optional[StrictStr] = Field(default='open', description="Indicates the current state of the session. Sessions can be created as `open` or `closed`. The state transitions are: 1. `open` → `closed` 2. `open` → `cancelled` 3. `closed` → `cancelled` or `partially_returned` 4. `partially_returned` → `cancelled` For more information, see [Customer session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). ") + 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"]}) + coupon: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Any coupon code entered.", json_schema_extra={"examples": ["XMAS-2021"]}) + referral: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Any referral code entered.", json_schema_extra={"examples": ["2740-tbjua-6720"]}) + state: Optional[StrictStr] = Field(default='open', description="Indicates the current state of the session. Sessions can be created as `open` or `closed`. The state transitions are: 1. `open` → `closed` 2. `open` → `cancelled` 3. `closed` → `cancelled` or `partially_returned` 4. `partially_returned` → `cancelled` For more information, see [Customer session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). ", json_schema_extra={"examples": ["open"]}) 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). ") + 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="A key-value map of the sessions attributes. The potentially valid attributes are configured in your accounts developer settings. ") + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") __properties: ClassVar[List[str]] = ["profileId", "coupon", "referral", "state", "cartItems", "identifiers", "total", "attributes"] @field_validator('state') diff --git a/talon_one/models/new_customer_session_v2.py b/talon_one/models/new_customer_session_v2.py index 64ff1b0..f0a01a9 100644 --- a/talon_one/models/new_customer_session_v2.py +++ b/talon_one/models/new_customer_session_v2.py @@ -31,18 +31,18 @@ class NewCustomerSessionV2(BaseModel): """ The representation of the customer session. """ # noqa: E501 - profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") - store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") - evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds") - coupon_codes: Optional[List[Annotated[str, Field(strict=True, max_length=100)]]] = Field(default=None, description="Any coupon codes entered. **Important - for requests only**: - If you [create a coupon budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a coupon code by the time you close it. - In requests where `dry=false`, providing an empty array discards any previous coupons. To avoid this, omit the parameter entirely. ", alias="couponCodes") - referral_code: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Any referral code entered. **Important - for requests only**: - If you [create a referral budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a referral code by the time you close it. - In requests where `dry=false`, providing an empty value discards the previous referral code. To avoid this, omit the parameter entirely. ", alias="referralCode") - loyalty_cards: Optional[Annotated[List[StrictStr], Field(max_length=1)]] = Field(default=None, description="Identifier of a loyalty card.", alias="loyaltyCards") - state: Optional[StrictStr] = Field(default='open', description="Indicates the current state of the session. Sessions can be created as `open` or `closed`. The state transitions are: 1. `open` → `closed` 2. `open` → `cancelled` 3. Either: - `closed` → `cancelled` (**only** via [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2)) or - `closed` → `partially_returned` (**only** via [Return cart items](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/returnCartItems)) - `closed` → `open` (**only** via [Reopen customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/reopenCustomerSession)) 4. `partially_returned` → `cancelled` For more information, see [Customer session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). ") + 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"]}) + evaluable_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. ", alias="evaluableCampaignIds", json_schema_extra={"examples": [[10, 12]]}) + coupon_codes: Optional[List[Annotated[str, Field(strict=True, max_length=100)]]] = Field(default=None, description="Any coupon codes entered. **Important - for requests only**: - If you [create a coupon budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a coupon code by the time you close it. - In requests where `dry=false`, providing an empty array discards any previous coupons. To avoid this, omit the parameter entirely. ", alias="couponCodes", json_schema_extra={"examples": [["XMAS-20-2021"]]}) + referral_code: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Any referral code entered. **Important - for requests only**: - If you [create a referral budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a referral code by the time you close it. - In requests where `dry=false`, providing an empty value discards the previous referral code. To avoid this, omit the parameter entirely. ", alias="referralCode", json_schema_extra={"examples": ["NT2K54D9"]}) + loyalty_cards: Optional[Annotated[List[StrictStr], Field(max_length=1)]] = Field(default=None, description="Identifier of a loyalty card.", alias="loyaltyCards", json_schema_extra={"examples": [["loyalty-card-1"]]}) + state: Optional[StrictStr] = Field(default='open', description="Indicates the current state of the session. Sessions can be created as `open` or `closed`. The state transitions are: 1. `open` → `closed` 2. `open` → `cancelled` 3. Either: - `closed` → `cancelled` (**only** via [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2)) or - `closed` → `partially_returned` (**only** via [Return cart items](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/returnCartItems)) - `closed` → `open` (**only** via [Reopen customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/reopenCustomerSession)) 4. `partially_returned` → `cancelled` For more information, see [Customer session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). ", json_schema_extra={"examples": ["open"]}) cart_items: Optional[List[CartItem]] = Field(default=None, description="The items to add to this session. **Do not exceed 1000 items** and ensure the sum of all cart item's `quantity` **does not exceed 10.000** per request. ", alias="cartItems") experiment_variant_allocations: Optional[List[ExperimentVariantAllocation]] = Field(default=None, description="The experiment variant allocations to add to this session. ", alias="experimentVariantAllocations") - additional_costs: Optional[Dict[str, AdditionalCost]] = Field(default=None, description="Use this property to set a value for the additional costs of this session, such as a shipping cost. They must be created in the Campaign Manager before you set them with this property. See [Managing additional costs](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs). ", alias="additionalCosts") - 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). **Important**: Ensure the session contains an identifier by the time you close it if: - You [create a unique identifier budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign. - Your campaign has [coupons](https://docs.talon.one/docs/product/campaigns/coupons/coupon-page-overview). - We recommend passing an anonymized (hashed) version of the identifier value. ") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Use this property to set a value for the attributes of your choice. Attributes represent any information to attach to your session, like the shipping city. You can use [built-in attributes](https://docs.talon.one/docs/dev/concepts/attributes#built-in-attributes) or [custom ones](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes). Custom attributes must be created in the Campaign Manager before you set them with this property. ") + additional_costs: Optional[Dict[str, AdditionalCost]] = Field(default=None, description="Use this property to set a value for the additional costs of this session, such as a shipping cost. They must be created in the Campaign Manager before you set them with this property. See [Managing additional costs](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs). ", alias="additionalCosts", json_schema_extra={"examples": [{"shipping": {"price": 9}}]}) + 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). **Important**: Ensure the session contains an identifier by the time you close it if: - You [create a unique identifier budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign. - Your campaign has [coupons](https://docs.talon.one/docs/product/campaigns/coupons/coupon-page-overview). - We recommend passing an anonymized (hashed) version of the identifier value. ", json_schema_extra={"examples": [["d41306257915f83fe01e54092ae470f631161ea16fcf4415842eed41470386ea"]]}) + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Use this property to set a value for the attributes of your choice. Attributes represent any information to attach to your session, like the shipping city. You can use [built-in attributes](https://docs.talon.one/docs/dev/concepts/attributes#built-in-attributes) or [custom ones](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes). Custom attributes must be created in the Campaign Manager before you set them with this property. ", json_schema_extra={"examples": [{"ShippingCity": "Berlin"}]}) __properties: ClassVar[List[str]] = ["profileId", "storeIntegrationId", "evaluableCampaignIds", "couponCodes", "referralCode", "loyaltyCards", "state", "cartItems", "experimentVariantAllocations", "additionalCosts", "identifiers", "attributes"] @field_validator('state') diff --git a/talon_one/models/new_event.py b/talon_one/models/new_event.py index a55ed37..2ae7c94 100644 --- a/talon_one/models/new_event.py +++ b/talon_one/models/new_event.py @@ -28,11 +28,11 @@ class NewEvent(BaseModel): """ NewEvent """ # noqa: E501 - profile_id: Optional[StrictStr] = Field(default=None, description="ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. ", alias="profileId") - store_integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The integration ID of the store. You choose this ID when you create a store.", alias="storeIntegrationId") - type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event.") - attributes: Dict[str, Any] = Field(description="Arbitrary additional JSON data associated with the event.") - session_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The ID of the session that this event occurred in.", alias="sessionId") + 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.") + 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"] model_config = ConfigDict( diff --git a/talon_one/models/new_event_type.py b/talon_one/models/new_event_type.py index f6cccb0..7f3faff 100644 --- a/talon_one/models/new_event_type.py +++ b/talon_one/models/new_event_type.py @@ -28,9 +28,9 @@ class NewEventType(BaseModel): """ NewEventType """ # noqa: E501 - title: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The human-friendly name for this event type.") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The integration name for this event type. This will be used in URLs and cannot be changed after an event type has been created.") - description: Optional[StrictStr] = Field(default=None, description="A description of what the event represents. ") + title: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The human-friendly name for this event type.", json_schema_extra={"examples": ["Survey Completed"]}) + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The integration name for this event type. This will be used in URLs and cannot be changed after an event type has been created.", json_schema_extra={"examples": ["surveyCompleted"]}) + description: Optional[StrictStr] = Field(default=None, description="A description of what the event represents. ", json_schema_extra={"examples": ["The survey was submitted by the customer."]}) __properties: ClassVar[List[str]] = ["title", "name", "description"] model_config = ConfigDict( diff --git a/talon_one/models/new_event_v3_entity.py b/talon_one/models/new_event_v3_entity.py index 0b956ff..e5880b6 100644 --- a/talon_one/models/new_event_v3_entity.py +++ b/talon_one/models/new_event_v3_entity.py @@ -28,7 +28,7 @@ class NewEventV3Entity(BaseModel): """ NewEventV3Entity """ # noqa: E501 - integration_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The unique ID of the event. Only one event with this ID can be registered. ", alias="integrationId") + integration_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The unique ID of the event. Only one event with this ID can be registered. ", alias="integrationId", json_schema_extra={"examples": ["175KJPS947296"]}) __properties: ClassVar[List[str]] = ["integrationId"] model_config = ConfigDict( diff --git a/talon_one/models/new_experiment.py b/talon_one/models/new_experiment.py index 98f0640..8da04d6 100644 --- a/talon_one/models/new_experiment.py +++ b/talon_one/models/new_experiment.py @@ -31,7 +31,7 @@ class NewExperiment(BaseModel): is_variant_assignment_external: StrictBool = Field(description="The source of the assignment. - false - The variant assignment is handled internally by Talon.One. - true - The variant assignment is handled externally. ", alias="isVariantAssignmentExternal") campaign: NewCampaign goal_type: StrictStr = Field(description="The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. ", alias="goalType") - goal_description: Optional[StrictStr] = Field(default=None, description="A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. ", alias="goalDescription") + goal_description: Optional[StrictStr] = Field(default=None, description="A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. ", alias="goalDescription", json_schema_extra={"examples": ["Offering free shipping will increase average order revenue more than a 10% discount"]}) __properties: ClassVar[List[str]] = ["isVariantAssignmentExternal", "campaign", "goalType", "goalDescription"] @field_validator('goal_type') diff --git a/talon_one/models/new_experiment_variant.py b/talon_one/models/new_experiment_variant.py index 52f2ca1..59c0084 100644 --- a/talon_one/models/new_experiment_variant.py +++ b/talon_one/models/new_experiment_variant.py @@ -29,10 +29,10 @@ class NewExperimentVariant(BaseModel): """ NewExperimentVariant """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of this variant.") - weight: Annotated[int, Field(le=99, strict=True, ge=1)] = Field(description="The percentage split of this variant. The sum of all variant percentages must be 100.") + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of this variant.", json_schema_extra={"examples": ["Variant A"]}) + weight: Annotated[int, Field(le=99, strict=True, ge=1)] = Field(description="The percentage split of this variant. The sum of all variant percentages must be 100.", json_schema_extra={"examples": [13]}) ruleset: NewRuleset - is_primary: StrictBool = Field(alias="isPrimary") + is_primary: StrictBool = Field(alias="isPrimary", json_schema_extra={"examples": [True]}) __properties: ClassVar[List[str]] = ["name", "weight", "ruleset", "isPrimary"] model_config = ConfigDict( diff --git a/talon_one/models/new_external_invitation.py b/talon_one/models/new_external_invitation.py index 50ddf73..a923c68 100644 --- a/talon_one/models/new_external_invitation.py +++ b/talon_one/models/new_external_invitation.py @@ -27,9 +27,9 @@ class NewExternalInvitation(BaseModel): """ Parameters for inviting a new user from an external identity provider. """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="Name of the user.") - user_groups: Optional[List[StrictStr]] = Field(default=None, description="List of user groups in the external identity provider. If there are roles in Talon.One whose names match these user groups, those roles will be automatically assigned to the user upon invitation. ", alias="userGroups") - email: StrictStr = Field(description="Email address of the user.") + name: Optional[StrictStr] = Field(default=None, description="Name of the user.", json_schema_extra={"examples": ["John Doe"]}) + user_groups: Optional[List[StrictStr]] = Field(default=None, description="List of user groups in the external identity provider. If there are roles in Talon.One whose names match these user groups, those roles will be automatically assigned to the user upon invitation. ", alias="userGroups", json_schema_extra={"examples": [["Managers", "Customer support"]]}) + email: StrictStr = Field(description="Email address of the user.", json_schema_extra={"examples": ["john.doe@example.com"]}) __properties: ClassVar[List[str]] = ["name", "userGroups", "email"] model_config = ConfigDict( diff --git a/talon_one/models/new_giveaways_pool.py b/talon_one/models/new_giveaways_pool.py index 56c0ebc..125abcd 100644 --- a/talon_one/models/new_giveaways_pool.py +++ b/talon_one/models/new_giveaways_pool.py @@ -27,10 +27,10 @@ class NewGiveawaysPool(BaseModel): """ NewGiveawaysPool """ # noqa: E501 - name: StrictStr = Field(description="The name of this giveaways pool.") - description: Optional[StrictStr] = Field(default=None, description="The description of this giveaways pool.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications that this giveaways pool is enabled for.", alias="subscribedApplicationsIds") - sandbox: StrictBool = Field(description="Indicates if this program is a live or sandbox program. Programs of a given type can only be connected to Applications of the same type.") + name: StrictStr = Field(description="The name of this giveaways pool.", json_schema_extra={"examples": ["My giveaway pool"]}) + description: Optional[StrictStr] = Field(default=None, description="The description of this giveaways pool.", json_schema_extra={"examples": ["Generic pool"]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications that this giveaways pool is enabled for.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[2, 4]]}) + sandbox: StrictBool = Field(description="Indicates if this program is a live or sandbox program. Programs of a given type can only be connected to Applications of the same type.", json_schema_extra={"examples": [True]}) __properties: ClassVar[List[str]] = ["name", "description", "subscribedApplicationsIds", "sandbox"] model_config = ConfigDict( diff --git a/talon_one/models/new_internal_audience.py b/talon_one/models/new_internal_audience.py index 46734b9..2f24af0 100644 --- a/talon_one/models/new_internal_audience.py +++ b/talon_one/models/new_internal_audience.py @@ -28,10 +28,10 @@ class NewInternalAudience(BaseModel): """ NewInternalAudience """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The human-friendly display name for this audience.") - sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this is a live or sandbox Application.") - description: Optional[StrictStr] = Field(default=None, description="A description of the audience.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications that are connected to this audience.", alias="subscribedApplicationsIds") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The human-friendly display name for this audience.", json_schema_extra={"examples": ["Travel audience"]}) + sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this is a live or sandbox Application.", json_schema_extra={"examples": [True]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the audience.", json_schema_extra={"examples": ["Travel audience 18-27"]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications that are connected to this audience.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[3, 13]]}) __properties: ClassVar[List[str]] = ["name", "sandbox", "description", "subscribedApplicationsIds"] model_config = ConfigDict( diff --git a/talon_one/models/new_invitation.py b/talon_one/models/new_invitation.py index 81d4a92..f205ccc 100644 --- a/talon_one/models/new_invitation.py +++ b/talon_one/models/new_invitation.py @@ -27,9 +27,9 @@ class NewInvitation(BaseModel): """ Parameters for inviting a new user. """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="Name of the user.") - email: StrictStr = Field(description="Email address of the user.") - is_admin: Optional[StrictBool] = Field(default=None, description="Indicates whether the user is an `admin`.", alias="isAdmin") + name: Optional[StrictStr] = Field(default=None, description="Name of the user.", json_schema_extra={"examples": ["John Doe"]}) + email: StrictStr = Field(description="Email address of the user.", json_schema_extra={"examples": ["john.doe@example.com"]}) + is_admin: Optional[StrictBool] = Field(default=None, description="Indicates whether the user is an `admin`.", alias="isAdmin", json_schema_extra={"examples": [False]}) roles: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the roles assigned to the user.") acl: Optional[StrictStr] = Field(default=None, description="Indicates the access level of the user.") __properties: ClassVar[List[str]] = ["name", "email", "isAdmin", "roles", "acl"] diff --git a/talon_one/models/new_invite_email.py b/talon_one/models/new_invite_email.py index c073f6d..f1b9fb7 100644 --- a/talon_one/models/new_invite_email.py +++ b/talon_one/models/new_invite_email.py @@ -27,8 +27,8 @@ class NewInviteEmail(BaseModel): """ NewInviteEmail """ # noqa: E501 - email: StrictStr = Field(description="Email address of the user.") - token: StrictStr = Field(description="Invitation token of the user.") + email: StrictStr = Field(description="Email address of the user.", json_schema_extra={"examples": ["john.doe@example.com"]}) + token: StrictStr = Field(description="Invitation token of the user.", json_schema_extra={"examples": ["Gy9b8w1irmQtEPo5RmbMmSPheL5h4"]}) __properties: ClassVar[List[str]] = ["email", "token"] model_config = ConfigDict( diff --git a/talon_one/models/new_loyalty_program.py b/talon_one/models/new_loyalty_program.py index cf2b961..72175d3 100644 --- a/talon_one/models/new_loyalty_program.py +++ b/talon_one/models/new_loyalty_program.py @@ -31,25 +31,25 @@ class NewLoyaltyProgram(BaseModel): """ NewLoyaltyProgram """ # noqa: E501 - title: StrictStr = Field(description="The display title for the Loyalty Program.") - description: Optional[StrictStr] = Field(default=None, description="Description of our Loyalty Program.") - subscribed_applications: Optional[List[StrictInt]] = Field(default=None, description="A list containing the IDs of all applications that are subscribed to this Loyalty Program.", alias="subscribedApplications") - default_validity: StrictStr = Field(description="The default duration after which new loyalty points should expire. Can be 'unlimited' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month. ", alias="defaultValidity") - default_pending: StrictStr = Field(description="The default duration of the pending time after which points should be valid. Accepted values: 'immediate', 'on_action' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month. ", alias="defaultPending") - allow_subledger: StrictBool = Field(description="Indicates if this program supports subledgers inside the program.", alias="allowSubledger") - users_per_card_limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="The max amount of user profiles with whom a card can be shared. This can be set to 0 for no limit. This property is only used when `cardBased` is `true`. ", alias="usersPerCardLimit") - sandbox: StrictBool = Field(description="Indicates if this program is a live or sandbox program. Programs of a given type can only be connected to Applications of the same type.") + title: StrictStr = Field(description="The display title for the Loyalty Program.", json_schema_extra={"examples": ["Point collection"]}) + description: Optional[StrictStr] = Field(default=None, description="Description of our Loyalty Program.", json_schema_extra={"examples": ["Customers collect 10 points per 1$ spent"]}) + subscribed_applications: Optional[List[StrictInt]] = Field(default=None, description="A list containing the IDs of all applications that are subscribed to this Loyalty Program.", alias="subscribedApplications", json_schema_extra={"examples": [[132, 97]]}) + default_validity: StrictStr = Field(description="The default duration after which new loyalty points should expire. Can be 'unlimited' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month. ", alias="defaultValidity", json_schema_extra={"examples": ["2W_U"]}) + default_pending: StrictStr = Field(description="The default duration of the pending time after which points should be valid. Accepted values: 'immediate', 'on_action' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month. ", alias="defaultPending", json_schema_extra={"examples": ["immediate"]}) + allow_subledger: StrictBool = Field(description="Indicates if this program supports subledgers inside the program.", alias="allowSubledger", json_schema_extra={"examples": [False]}) + users_per_card_limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="The max amount of user profiles with whom a card can be shared. This can be set to 0 for no limit. This property is only used when `cardBased` is `true`. ", alias="usersPerCardLimit", json_schema_extra={"examples": [111]}) + sandbox: StrictBool = Field(description="Indicates if this program is a live or sandbox program. Programs of a given type can only be connected to Applications of the same type.", json_schema_extra={"examples": [True]}) program_join_policy: Optional[StrictStr] = Field(default=None, description="The policy that defines when the customer joins the loyalty program. - `not_join`: The customer does not join the loyalty program but can still earn and spend loyalty points. **Note**: The customer does not have a program join date. - `points_activated`: The customer joins the loyalty program only when their earned loyalty points become active for the first time. - `points_earned`: The customer joins the loyalty program when they earn loyalty points for the first time. ", alias="programJoinPolicy") tiers_expiration_policy: Optional[StrictStr] = Field(default=None, description="The policy that defines how tier expiration, used to reevaluate the customer's current tier, is determined. - `tier_start_date`: The tier expiration is relative to when the customer joined the current tier. - `program_join_date`: The tier expiration is relative to when the customer joined the loyalty program. - `customer_attribute`: The tier expiration is determined by a custom customer attribute. - `absolute_expiration`: The tier is reevaluated at the start of each tier cycle. For this policy, it is required to provide a `tierCycleStartDate`. ", alias="tiersExpirationPolicy") - tier_cycle_start_date: Optional[datetime] = Field(default=None, description="Timestamp at which the tier cycle starts for all customers in the loyalty program. **Note**: This is only required when the tier expiration policy is set to `absolute_expiration`. ", alias="tierCycleStartDate") - tiers_expire_in: Optional[StrictStr] = Field(default=None, description="The amount of time after which the tier expires and is reevaluated. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can 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. ", alias="tiersExpireIn") + tier_cycle_start_date: Optional[datetime] = Field(default=None, description="Timestamp at which the tier cycle starts for all customers in the loyalty program. **Note**: This is only required when the tier expiration policy is set to `absolute_expiration`. ", alias="tierCycleStartDate", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + tiers_expire_in: Optional[StrictStr] = Field(default=None, description="The amount of time after which the tier expires and is reevaluated. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can 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. ", alias="tiersExpireIn", json_schema_extra={"examples": ["27W_U"]}) tiers_downgrade_policy: Optional[StrictStr] = Field(default=None, description="The policy that defines how customer tiers are downgraded in the loyalty program after tier reevaluation. - `one_down`: If the customer doesn't have enough points to stay in the current tier, they are downgraded by one tier. - `balance_based`: The customer's tier is reevaluated based on the amount of active points they have at the moment. ", alias="tiersDowngradePolicy") card_code_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="cardCodeSettings") return_policy: Optional[StrictStr] = Field(default=None, description="The policy that defines the rollback of points in case of a partially returned, cancelled, or reopened [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). - `only_pending`: Only pending points can be rolled back. - `within_balance`: Available active points can be rolled back if there aren't enough pending points. The active balance of the customer cannot be negative. - `unlimited`: Allows negative balance without any limit. ", alias="returnPolicy") - name: StrictStr = Field(description="The internal name for the Loyalty Program. This is an immutable value.") + name: StrictStr = Field(description="The internal name for the Loyalty Program. This is an immutable value.", json_schema_extra={"examples": ["GeneralPointCollection"]}) tiers: Optional[List[NewLoyaltyTier]] = Field(default=None, description="The tiers in this loyalty program.") timezone: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string containing an IANA timezone descriptor.") - card_based: StrictBool = Field(description="Defines the type of loyalty program: - `true`: the program is a card-based. - `false`: the program is profile-based. ", alias="cardBased") + card_based: StrictBool = Field(description="Defines the type of loyalty program: - `true`: the program is a card-based. - `false`: the program is profile-based. ", alias="cardBased", json_schema_extra={"examples": [True]}) __properties: ClassVar[List[str]] = ["title", "description", "subscribedApplications", "defaultValidity", "defaultPending", "allowSubledger", "usersPerCardLimit", "sandbox", "programJoinPolicy", "tiersExpirationPolicy", "tierCycleStartDate", "tiersExpireIn", "tiersDowngradePolicy", "cardCodeSettings", "returnPolicy", "name", "tiers", "timezone", "cardBased"] @field_validator('program_join_policy') diff --git a/talon_one/models/new_loyalty_tier.py b/talon_one/models/new_loyalty_tier.py index 9f490fa..97b36d6 100644 --- a/talon_one/models/new_loyalty_tier.py +++ b/talon_one/models/new_loyalty_tier.py @@ -28,8 +28,8 @@ class NewLoyaltyTier(BaseModel): """ A tier in a loyalty program. """ # noqa: E501 - name: StrictStr = Field(description="The name of the tier.") - min_points: Union[Annotated[float, Field(le=999999999999.99, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]] = Field(description="The minimum amount of points required to enter the tier.", alias="minPoints") + name: StrictStr = Field(description="The name of the tier.", json_schema_extra={"examples": ["Gold"]}) + min_points: Union[Annotated[float, Field(le=999999999999.99, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]] = Field(description="The minimum amount of points required to enter the tier.", alias="minPoints", json_schema_extra={"examples": [300]}) __properties: ClassVar[List[str]] = ["name", "minPoints"] model_config = ConfigDict( diff --git a/talon_one/models/new_management_key.py b/talon_one/models/new_management_key.py index 14bf7c8..912782b 100644 --- a/talon_one/models/new_management_key.py +++ b/talon_one/models/new_management_key.py @@ -29,17 +29,17 @@ class NewManagementKey(BaseModel): """ NewManagementKey """ # noqa: E501 - name: StrictStr = Field(description="Name for management key.") - expiry_date: datetime = Field(description="The date the management key expires.", alias="expiryDate") + name: StrictStr = Field(description="Name for management key.", json_schema_extra={"examples": ["My generated key"]}) + expiry_date: datetime = Field(description="The date the management key expires.", alias="expiryDate", json_schema_extra={"examples": ["2023-08-24T14:00:00Z"]}) endpoints: List[Endpoint] = Field(description="The list of endpoints that can be accessed with the key") - allowed_application_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of Application IDs that you can access with the management key. An empty or missing list means the management key can be used for all Applications in the account. ", alias="allowedApplicationIds") - id: StrictInt = Field(description="ID of the management key.") - created_by: StrictInt = Field(description="ID of the user who created it.", alias="createdBy") - account_id: StrictInt = Field(description="ID of account the key is used for.", alias="accountID") - created: datetime = Field(description="The date the management key was created.") - disabled: Optional[StrictBool] = Field(default=None, description="The management key is disabled (this property is set to `true`) when the user who created the key is disabled or deleted.") - last_used: Optional[datetime] = Field(default=None, description="The last time the management key was used.", alias="lastUsed") - key: StrictStr = Field(description="The management key.") + allowed_application_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of Application IDs that you can access with the management key. An empty or missing list means the management key can be used for all Applications in the account. ", alias="allowedApplicationIds", json_schema_extra={"examples": [[1, 2, 3]]}) + id: StrictInt = Field(description="ID of the management key.", json_schema_extra={"examples": [34]}) + created_by: StrictInt = Field(description="ID of the user who created it.", alias="createdBy", json_schema_extra={"examples": [280]}) + account_id: StrictInt = Field(description="ID of account the key is used for.", alias="accountID", json_schema_extra={"examples": [13]}) + created: datetime = Field(description="The date the management key was created.", json_schema_extra={"examples": ["2022-03-02T16:46:17.758585Z"]}) + disabled: Optional[StrictBool] = Field(default=None, description="The management key is disabled (this property is set to `true`) when the user who created the key is disabled or deleted.", json_schema_extra={"examples": [True]}) + last_used: Optional[datetime] = Field(default=None, description="The last time the management key was used.", alias="lastUsed", json_schema_extra={"examples": ["2022-03-02T16:46:17.758585Z"]}) + key: StrictStr = Field(description="The management key.", json_schema_extra={"examples": ["f45f90d21dcd9bac965c45e547e9754a3196891d09948e35adbcbedc4e9e4b01"]}) __properties: ClassVar[List[str]] = ["name", "expiryDate", "endpoints", "allowedApplicationIds", "id", "createdBy", "accountID", "created", "disabled", "lastUsed", "key"] model_config = ConfigDict( diff --git a/talon_one/models/new_mcp_key.py b/talon_one/models/new_mcp_key.py index b7ca696..0226c32 100644 --- a/talon_one/models/new_mcp_key.py +++ b/talon_one/models/new_mcp_key.py @@ -28,15 +28,15 @@ class NewMCPKey(BaseModel): """ NewMCPKey """ # noqa: E501 - name: StrictStr = Field(description="Name for the MCP key.") - expiry_date: datetime = Field(description="The date the MCP key expires.", alias="expiryDate") - id: StrictInt = Field(description="ID of the MCP key.") - created_by: StrictInt = Field(description="ID of the user who created it.", alias="createdBy") - account_id: StrictInt = Field(description="ID of account the key is used for.", alias="accountID") - created: datetime = Field(description="The date the MCP key was created.") - disabled: Optional[StrictBool] = Field(default=None, description="The MCP key is disabled (this property is set to `true`) when the user who created the key is disabled or deleted.") - last_used: Optional[datetime] = Field(default=None, description="The last time the MCP key was used.", alias="lastUsed") - key: StrictStr = Field(description="The generated MCP key. Only returned once on creation.") + name: StrictStr = Field(description="Name for the MCP key.", json_schema_extra={"examples": ["My MCP key"]}) + expiry_date: datetime = Field(description="The date the MCP key expires.", alias="expiryDate", json_schema_extra={"examples": ["2026-08-24T14:00:00Z"]}) + id: StrictInt = Field(description="ID of the MCP key.", json_schema_extra={"examples": [34]}) + created_by: StrictInt = Field(description="ID of the user who created it.", alias="createdBy", json_schema_extra={"examples": [280]}) + account_id: StrictInt = Field(description="ID of account the key is used for.", alias="accountID", json_schema_extra={"examples": [13]}) + created: datetime = Field(description="The date the MCP key was created.", json_schema_extra={"examples": ["2026-03-02T16:46:17.758585Z"]}) + disabled: Optional[StrictBool] = Field(default=None, description="The MCP key is disabled (this property is set to `true`) when the user who created the key is disabled or deleted.", json_schema_extra={"examples": [True]}) + last_used: Optional[datetime] = Field(default=None, description="The last time the MCP key was used.", alias="lastUsed", json_schema_extra={"examples": ["2026-03-02T16:46:17.758585Z"]}) + key: StrictStr = Field(description="The generated MCP key. Only returned once on creation.", json_schema_extra={"examples": ["f45f90d21dcd9bac965c45e547e9754a3196891d09948e35adbcbedc4e9e4b01"]}) __properties: ClassVar[List[str]] = ["name", "expiryDate", "id", "createdBy", "accountID", "created", "disabled", "lastUsed", "key"] model_config = ConfigDict( diff --git a/talon_one/models/new_message_test.py b/talon_one/models/new_message_test.py index f5e6476..ad75b32 100644 --- a/talon_one/models/new_message_test.py +++ b/talon_one/models/new_message_test.py @@ -28,13 +28,13 @@ class NewMessageTest(BaseModel): """ NewMessageTest """ # noqa: E501 - headers: Optional[Dict[str, StrictStr]] = Field(default=None, description="List of API HTTP headers for the given message.") - verb: StrictStr = Field(description="API method for this message.") - url: StrictStr = Field(description="API URL for the given message.") - payload: Optional[StrictStr] = Field(default=None, description="API payload of this message.") - params: Optional[List[TemplateArgDef]] = Field(default=None, description="Array of template argument definitions.") + headers: Optional[Dict[str, StrictStr]] = Field(default=None, description="List of API HTTP headers for the given message.", json_schema_extra={"examples": [{"content-type": "application/json"}]}) + verb: StrictStr = Field(description="API method for this message.", json_schema_extra={"examples": ["POST"]}) + url: StrictStr = Field(description="API URL for the given message.", json_schema_extra={"examples": ["www.my-company.com/my-endpoint-name"]}) + payload: Optional[StrictStr] = Field(default=None, description="API payload of this message.", json_schema_extra={"examples": ["{\n\t\"integrationId\": \"${$Profile.IntegrationId}\"\n}"]}) + params: Optional[List[TemplateArgDef]] = Field(default=None, description="Array of template argument definitions.", json_schema_extra={"examples": [[]]}) application_ids: Optional[List[StrictInt]] = Field(default=None, description="The IDs of the Applications in which this webhook is available. An empty array means the webhook is available in `All Applications`. ", alias="applicationIds") - authentication_id: Optional[StrictInt] = Field(default=None, description="The ID of the credential that this webhook is using.", alias="authenticationId") + 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]] = ["headers", "verb", "url", "payload", "params", "applicationIds", "authenticationId"] @field_validator('verb') diff --git a/talon_one/models/new_multiple_audiences_item.py b/talon_one/models/new_multiple_audiences_item.py index e31c4a3..b77c695 100644 --- a/talon_one/models/new_multiple_audiences_item.py +++ b/talon_one/models/new_multiple_audiences_item.py @@ -28,9 +28,9 @@ class NewMultipleAudiencesItem(BaseModel): """ NewMultipleAudiencesItem """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The human-friendly display name for this audience.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications that are connected to this audience.", alias="subscribedApplicationsIds") - integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The ID of this audience in the third-party integration.", alias="integrationId") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The human-friendly display name for this audience.", json_schema_extra={"examples": ["Travel audience"]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications that are connected to this audience.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[3, 13]]}) + integration_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The ID of this audience in the third-party integration.", alias="integrationId", json_schema_extra={"examples": ["382370BKDB946"]}) __properties: ClassVar[List[str]] = ["name", "subscribedApplicationsIds", "integrationId"] model_config = ConfigDict( diff --git a/talon_one/models/new_notification_webhook.py b/talon_one/models/new_notification_webhook.py index 3d2fe1d..9bbf2c2 100644 --- a/talon_one/models/new_notification_webhook.py +++ b/talon_one/models/new_notification_webhook.py @@ -28,9 +28,9 @@ class NewNotificationWebhook(BaseModel): """ NewNotificationWebhook """ # noqa: E501 - url: StrictStr = Field(description="API URL for the given webhook-based notification.") + url: StrictStr = Field(description="API URL for the given webhook-based notification.", json_schema_extra={"examples": ["www.my-company.com/my-endpoint-name"]}) headers: List[Annotated[str, Field(strict=True)]] = Field(description="List of API HTTP headers for the given webhook-based notification.") - enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether the notification is activated.") + enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether the notification is activated.", json_schema_extra={"examples": [True]}) __properties: ClassVar[List[str]] = ["url", "headers", "enabled"] model_config = ConfigDict( diff --git a/talon_one/models/new_outgoing_integration_webhook.py b/talon_one/models/new_outgoing_integration_webhook.py index b5973be..d3742e8 100644 --- a/talon_one/models/new_outgoing_integration_webhook.py +++ b/talon_one/models/new_outgoing_integration_webhook.py @@ -27,9 +27,9 @@ class NewOutgoingIntegrationWebhook(BaseModel): """ NewOutgoingIntegrationWebhook """ # noqa: E501 - title: StrictStr = Field(description="Webhook title.") - description: Optional[StrictStr] = Field(default=None, description="A description of the webhook.") - application_ids: List[StrictInt] = Field(description="IDs of the Applications to which a webhook must be linked.", alias="applicationIds") + title: StrictStr = Field(description="Webhook title.", json_schema_extra={"examples": ["Send email to customer via Braze"]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the webhook.", json_schema_extra={"examples": ["A webhook to send a coupon to the user."]}) + application_ids: List[StrictInt] = Field(description="IDs of the Applications to which a webhook must be linked.", alias="applicationIds", json_schema_extra={"examples": [[1, 2, 3]]}) __properties: ClassVar[List[str]] = ["title", "description", "applicationIds"] model_config = ConfigDict( diff --git a/talon_one/models/new_password.py b/talon_one/models/new_password.py index cb50572..c8e12f1 100644 --- a/talon_one/models/new_password.py +++ b/talon_one/models/new_password.py @@ -28,8 +28,8 @@ class NewPassword(BaseModel): """ NewPassword """ # noqa: E501 - password: StrictStr = Field(description="The new password for your account.") - reset_token: Annotated[str, Field(min_length=1, strict=True)] = Field(alias="resetToken") + password: StrictStr = Field(description="The new password for your account.", json_schema_extra={"examples": ["Admin&12943!7"]}) + reset_token: Annotated[str, Field(min_length=1, strict=True)] = Field(alias="resetToken", json_schema_extra={"examples": ["Z2VgacVNkexLKBUIzsRDDZSGxnIkC53y"]}) __properties: ClassVar[List[str]] = ["password", "resetToken"] model_config = ConfigDict( diff --git a/talon_one/models/new_picklist.py b/talon_one/models/new_picklist.py index 693a0b8..769ae57 100644 --- a/talon_one/models/new_picklist.py +++ b/talon_one/models/new_picklist.py @@ -28,8 +28,8 @@ class NewPicklist(BaseModel): """ NewPicklist """ # noqa: E501 - type: StrictStr = Field(description="The type of allowed values in the picklist. If the type `time` is chosen, it must be an RFC3339 timestamp string.") - values: Annotated[List[StrictStr], Field(max_length=50)] = Field(description="The list of allowed values provided by this picklist.") + type: StrictStr = Field(description="The type of allowed values in the picklist. If the type `time` is chosen, it must be an RFC3339 timestamp string.", json_schema_extra={"examples": ["string"]}) + values: Annotated[List[StrictStr], Field(max_length=50)] = Field(description="The list of allowed values provided by this picklist.", json_schema_extra={"examples": [["Jeans", "Shirt", "Coat"]]}) __properties: ClassVar[List[str]] = ["type", "values"] @field_validator('type') diff --git a/talon_one/models/new_price_adjustment.py b/talon_one/models/new_price_adjustment.py index bbba41f..0b04f26 100644 --- a/talon_one/models/new_price_adjustment.py +++ b/talon_one/models/new_price_adjustment.py @@ -29,13 +29,13 @@ class NewPriceAdjustment(BaseModel): """ NewPriceAdjustment """ # noqa: E501 - price_type: StrictStr = Field(description="The price type (e.g. the price for members only) to apply to a given SKU.", alias="priceType") - price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The value of the price type applied to the SKU. When set to `null`, the defined price type no longer applies to the SKU.") - reference_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A unique reference identifier, e.g. a UUID.", alias="referenceId") - calculated_at: Optional[datetime] = Field(default=None, description="The time at which this price was calculated. If provided, this is used to determine the most recent price adjustment to choose if price adjustments overlap. Defaults to internal creation time if not provided.", alias="calculatedAt") - effective_from: Optional[datetime] = Field(default=None, description="The date and time from which the price adjustment is effective.", alias="effectiveFrom") - effective_until: Optional[datetime] = Field(default=None, description="The date and time until which the price adjustment is effective.", alias="effectiveUntil") - context_id: Optional[StrictStr] = Field(default=None, description="Identifier of the context of this price adjustment (e.g. summer sale).", alias="contextId") + price_type: StrictStr = Field(description="The price type (e.g. the price for members only) to apply to a given SKU.", alias="priceType", json_schema_extra={"examples": ["member"]}) + price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The value of the price type applied to the SKU. When set to `null`, the defined price type no longer applies to the SKU.", json_schema_extra={"examples": [100]}) + reference_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A unique reference identifier, e.g. a UUID.", alias="referenceId", json_schema_extra={"examples": ["68851723-e6fa-488f-ace9-112581e6c19b"]}) + calculated_at: Optional[datetime] = Field(default=None, description="The time at which this price was calculated. If provided, this is used to determine the most recent price adjustment to choose if price adjustments overlap. Defaults to internal creation time if not provided.", alias="calculatedAt", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + effective_from: Optional[datetime] = Field(default=None, description="The date and time from which the price adjustment is effective.", alias="effectiveFrom", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + effective_until: Optional[datetime] = Field(default=None, description="The date and time until which the price adjustment is effective.", alias="effectiveUntil", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + context_id: Optional[StrictStr] = Field(default=None, description="Identifier of the context of this price adjustment (e.g. summer sale).", alias="contextId", json_schema_extra={"examples": ["Summer2025"]}) __properties: ClassVar[List[str]] = ["priceType", "price", "referenceId", "calculatedAt", "effectiveFrom", "effectiveUntil", "contextId"] model_config = ConfigDict( diff --git a/talon_one/models/new_price_type.py b/talon_one/models/new_price_type.py index df34c70..e328417 100644 --- a/talon_one/models/new_price_type.py +++ b/talon_one/models/new_price_type.py @@ -28,10 +28,10 @@ class NewPriceType(BaseModel): """ NewPriceType """ # noqa: E501 - name: Annotated[str, Field(strict=True)] = Field(description="The API name of the price type. This is an immutable value.") - title: StrictStr = Field(description="The name displayed in the Campaign Manager for the price type.") - description: Optional[StrictStr] = Field(default=None, description="A description of the price type.") - 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") + name: Annotated[str, Field(strict=True)] = Field(description="The API name of the price type. This is an immutable value.", json_schema_extra={"examples": ["member"]}) + title: StrictStr = Field(description="The name displayed in the Campaign Manager for the price type.", json_schema_extra={"examples": ["Member Price"]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the price type.", json_schema_extra={"examples": ["The price available exclusively to members."]}) + 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') diff --git a/talon_one/models/new_referral.py b/talon_one/models/new_referral.py index fe88eb4..7deca1b 100644 --- a/talon_one/models/new_referral.py +++ b/talon_one/models/new_referral.py @@ -29,13 +29,13 @@ class NewReferral(BaseModel): """ NewReferral """ # noqa: E501 - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the referral code becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the referral code. Referral never expires if this is omitted.", alias="expiryDate") - 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") - campaign_id: StrictInt = Field(description="ID of the campaign from which the referral received the referral code.", alias="campaignId") - advocate_profile_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The Integration ID of the Advocate's Profile.", alias="advocateProfileIntegrationId") - friend_profile_integration_id: Optional[StrictStr] = Field(default=None, description="An optional Integration ID of the Friend's Profile.", alias="friendProfileIntegrationId") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.") + start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the referral code becomes valid.", alias="startDate", json_schema_extra={"examples": ["2020-11-10T23:00:00Z"]}) + expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the referral code. Referral never expires if this is omitted.", alias="expiryDate", json_schema_extra={"examples": ["2021-11-10T23:00:00Z"]}) + 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="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.") __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 fac1732..bbaf639 100644 --- a/talon_one/models/new_referrals_for_multiple_advocates.py +++ b/talon_one/models/new_referrals_for_multiple_advocates.py @@ -29,14 +29,14 @@ class NewReferralsForMultipleAdvocates(BaseModel): """ NewReferralsForMultipleAdvocates """ # noqa: E501 - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the referral code becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the referral code. Referral never expires if this is omitted.", alias="expiryDate") - 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") - campaign_id: StrictInt = Field(description="The ID of the campaign from which the referral received the referral code.", alias="campaignId") - 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") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this referral code.") - 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") - 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") + start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the referral code becomes valid.", alias="startDate", json_schema_extra={"examples": ["2020-11-10T23:00:00Z"]}) + expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the referral code. Referral never expires if this is omitted.", alias="expiryDate", json_schema_extra={"examples": ["2021-11-10T23:00:00Z"]}) + 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.") + 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"] model_config = ConfigDict( diff --git a/talon_one/models/new_revision_version.py b/talon_one/models/new_revision_version.py index b62a299..a91be22 100644 --- a/talon_one/models/new_revision_version.py +++ b/talon_one/models/new_revision_version.py @@ -31,17 +31,17 @@ class NewRevisionVersion(BaseModel): """ NewRevisionVersion """ # noqa: E501 - name: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="A user-facing name for this campaign.") - start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime") - end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime") + name: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="A user-facing name for this campaign.", json_schema_extra={"examples": ["Summer promotions"]}) + start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime", json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) + end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime", json_schema_extra={"examples": ["2021-09-22T22:00:00Z"]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") - description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.") - active_ruleset_id: Optional[StrictInt] = Field(default=None, description="The ID of the ruleset this campaign will use.", alias="activeRulesetId") + description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.", json_schema_extra={"examples": ["Campaign for all summer 2021 promotions"]}) + active_ruleset_id: Optional[StrictInt] = Field(default=None, description="The ID of the ruleset this campaign will use.", alias="activeRulesetId", json_schema_extra={"examples": [5]}) tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)]] = Field(default=None, description="A list of tags for the campaign.") coupon_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="couponSettings") referral_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="referralSettings") limits: Optional[List[LimitConfig]] = Field(default=None, description="The set of limits that will operate for this campaign version.") - reevaluate_on_return: Optional[StrictBool] = Field(default=None, description="Indicates whether this campaign should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn") + reevaluate_on_return: Optional[StrictBool] = Field(default=None, description="Indicates whether this campaign should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn", json_schema_extra={"examples": [True]}) features: Optional[List[StrictStr]] = Field(default=None, description="A list of features for the campaign.") coupon_attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with coupons in this campaign.", alias="couponAttributes") __properties: ClassVar[List[str]] = ["name", "startTime", "endTime", "attributes", "description", "activeRulesetId", "tags", "couponSettings", "referralSettings", "limits", "reevaluateOnReturn", "features", "couponAttributes"] diff --git a/talon_one/models/new_reward.py b/talon_one/models/new_reward.py index 5f8597e..8f95e5b 100644 --- a/talon_one/models/new_reward.py +++ b/talon_one/models/new_reward.py @@ -28,11 +28,11 @@ class NewReward(BaseModel): """ NewReward """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the reward.") - api_name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A unique identifier used to reference the reward in API integrations.", alias="apiName") - description: Optional[StrictStr] = Field(default=None, description="A description of the reward.") - application_ids: List[StrictInt] = Field(description="The IDs of the Applications this reward is connected to. **Note**: Currently, a reward can only be connected to one Application. ", alias="applicationIds") - sandbox: StrictBool = Field(description="Indicates if this is a live or sandbox reward. Rewards of a given type can only be connected to Applications of the same type.") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the reward.", json_schema_extra={"examples": ["Free Coffee"]}) + api_name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A unique identifier used to reference the reward in API integrations.", alias="apiName", json_schema_extra={"examples": ["free-coffee"]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the reward.", json_schema_extra={"examples": ["This reward gets you one free coffee."]}) + application_ids: List[StrictInt] = Field(description="The IDs of the Applications this reward is connected to. **Note**: Currently, a reward can only be connected to one Application. ", alias="applicationIds", json_schema_extra={"examples": [[1, 2, 3]]}) + sandbox: StrictBool = Field(description="Indicates if this is a live or sandbox reward. Rewards of a given type can only be connected to Applications of the same type.", json_schema_extra={"examples": [True]}) __properties: ClassVar[List[str]] = ["name", "apiName", "description", "applicationIds", "sandbox"] model_config = ConfigDict( diff --git a/talon_one/models/new_risk_notification.py b/talon_one/models/new_risk_notification.py index fd10a29..ec83af0 100644 --- a/talon_one/models/new_risk_notification.py +++ b/talon_one/models/new_risk_notification.py @@ -27,9 +27,9 @@ class NewRiskNotification(BaseModel): """ Data for creating a new risk notification. """ # noqa: E501 - entity: StrictStr = Field(description="The entity type to analyze within the given time frame.") - activity: StrictStr = Field(description="The activity metric to analyze within the given entity.") - time_frame: StrictStr = Field(description="The rolling time window for risk evaluation.", alias="timeFrame") + entity: StrictStr = Field(description="The entity type to analyze within the given time frame.", json_schema_extra={"examples": ["customer_profile"]}) + activity: StrictStr = Field(description="The activity metric to analyze within the given entity.", json_schema_extra={"examples": ["loyalty_points_earned"]}) + time_frame: StrictStr = Field(description="The rolling time window for risk evaluation.", alias="timeFrame", json_schema_extra={"examples": ["1_week"]}) __properties: ClassVar[List[str]] = ["entity", "activity", "timeFrame"] @field_validator('entity') diff --git a/talon_one/models/new_role.py b/talon_one/models/new_role.py index a5cf5a2..dec630f 100644 --- a/talon_one/models/new_role.py +++ b/talon_one/models/new_role.py @@ -27,10 +27,10 @@ class NewRole(BaseModel): """ NewRole """ # noqa: E501 - name: StrictStr = Field(description="Name of the role.") - description: Optional[StrictStr] = Field(default=None, description="Description of the role.") - acl: StrictStr = Field(description="The `Access Control List` json defining the role of the user. This represents the access control on the user level.") - members: List[StrictInt] = Field(description="An array of user identifiers.") + name: StrictStr = Field(description="Name of the role.", json_schema_extra={"examples": ["Campaign Manager"]}) + description: Optional[StrictStr] = Field(default=None, description="Description of the role.", json_schema_extra={"examples": ["Manages the campaigns"]}) + acl: StrictStr = Field(description="The `Access Control List` json defining the role of the user. This represents the access control on the user level.", json_schema_extra={"examples": [{"Role": 128}]}) + members: List[StrictInt] = Field(description="An array of user identifiers.", json_schema_extra={"examples": [[48, 562, 475, 18]]}) __properties: ClassVar[List[str]] = ["name", "description", "acl", "members"] model_config = ConfigDict( diff --git a/talon_one/models/new_role_v2.py b/talon_one/models/new_role_v2.py index 13f57f4..4b9bbc6 100644 --- a/talon_one/models/new_role_v2.py +++ b/talon_one/models/new_role_v2.py @@ -28,10 +28,10 @@ class NewRoleV2(BaseModel): """ NewRoleV2 """ # noqa: E501 - name: StrictStr = Field(description="Name of the role.") - description: StrictStr = Field(description="Description of the role.") + name: StrictStr = Field(description="Name of the role.", json_schema_extra={"examples": ["Campaign and campaign access group manager"]}) + description: StrictStr = Field(description="Description of the role.", json_schema_extra={"examples": ["Allows you to create and edit campaigns for specific Applications, delete specific campaign access groups, and view loyalty programs."]}) permissions: Optional[RoleV2Permissions] = Field(default=None, description="The permissions that this role gives.") - members: Optional[List[StrictInt]] = Field(default=None, description="A list of user IDs the role is assigned to.") + members: Optional[List[StrictInt]] = Field(default=None, description="A list of user IDs the role is assigned to.", json_schema_extra={"examples": [[10, 12]]}) __properties: ClassVar[List[str]] = ["name", "description", "permissions", "members"] model_config = ConfigDict( diff --git a/talon_one/models/new_ruleset.py b/talon_one/models/new_ruleset.py index c58823d..b0f806d 100644 --- a/talon_one/models/new_ruleset.py +++ b/talon_one/models/new_ruleset.py @@ -31,9 +31,9 @@ class NewRuleset(BaseModel): """ # noqa: E501 rules: List[Rule] = Field(description="Set of rules to apply.") strikethrough_rules: Optional[List[Rule]] = Field(default=None, description="Set of rules to apply for strikethrough.", alias="strikethroughRules") - bindings: List[Binding] = Field(description="An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.") - rb_version: Optional[StrictStr] = Field(default=None, description="The version of the rulebuilder used to create this ruleset.", alias="rbVersion") - activate: Optional[StrictBool] = Field(default=None, description="Indicates whether this created ruleset should be activated for the campaign that owns it.") + bindings: List[Binding] = Field(description="An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.", json_schema_extra={"examples": [[]]}) + rb_version: Optional[StrictStr] = Field(default=None, description="The version of the rulebuilder used to create this ruleset.", alias="rbVersion", json_schema_extra={"examples": ["v2"]}) + activate: Optional[StrictBool] = Field(default=None, description="Indicates whether this created ruleset should be activated for the campaign that owns it.", json_schema_extra={"examples": [True]}) __properties: ClassVar[List[str]] = ["rules", "strikethroughRules", "bindings", "rbVersion", "activate"] model_config = ConfigDict( diff --git a/talon_one/models/new_saml_connection.py b/talon_one/models/new_saml_connection.py index 7973705..f97b703 100644 --- a/talon_one/models/new_saml_connection.py +++ b/talon_one/models/new_saml_connection.py @@ -28,7 +28,7 @@ class NewSamlConnection(BaseModel): """ NewSamlConnection """ # noqa: E501 - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3885]}) name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="ID of the SAML service.") enabled: StrictBool = Field(description="Determines if this SAML connection active.") issuer: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Identity Provider Entity ID.") diff --git a/talon_one/models/new_secondary_deployment.py b/talon_one/models/new_secondary_deployment.py index 4d1a87b..5539be1 100644 --- a/talon_one/models/new_secondary_deployment.py +++ b/talon_one/models/new_secondary_deployment.py @@ -28,7 +28,7 @@ class NewSecondaryDeployment(BaseModel): """ NewSecondaryDeployment """ # noqa: E501 - 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") + 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') diff --git a/talon_one/models/new_store.py b/talon_one/models/new_store.py index 51fb4cb..5db5537 100644 --- a/talon_one/models/new_store.py +++ b/talon_one/models/new_store.py @@ -28,10 +28,10 @@ class NewStore(BaseModel): """ NewStore """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(description="The name of the store.") - description: StrictStr = Field(description="The description of the store.") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="The attributes of the store.") - integration_id: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The integration ID of the store. You choose this ID when you create a store. **Note**: You cannot edit the `integrationId` after the store has been created. ", alias="integrationId") + name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(description="The name of the store.", json_schema_extra={"examples": ["South US store"]}) + description: StrictStr = Field(description="The description of the store.", json_schema_extra={"examples": ["This is the description of the store in south US."]}) + attributes: Optional[Dict[str, Any]] = Field(default=None, description="The attributes of the store.", json_schema_extra={"examples": [{"country": "USA", "code": 1234}]}) + integration_id: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The integration ID of the store. You choose this ID when you create a store. **Note**: You cannot edit the `integrationId` after the store has been created. ", alias="integrationId", json_schema_extra={"examples": ["STORE-001"]}) __properties: ClassVar[List[str]] = ["name", "description", "attributes", "integrationId"] model_config = ConfigDict( diff --git a/talon_one/models/new_user.py b/talon_one/models/new_user.py index 53ea88f..74291b3 100644 --- a/talon_one/models/new_user.py +++ b/talon_one/models/new_user.py @@ -28,10 +28,10 @@ class NewUser(BaseModel): """ NewUser """ # noqa: E501 - email: StrictStr = Field(description="The email address associated with the user profile.") - password: StrictStr = Field(description="The password for your account.") + email: StrictStr = Field(description="The email address associated with the user profile.", json_schema_extra={"examples": ["john.doe@example.com"]}) + password: StrictStr = Field(description="The password for your account.", json_schema_extra={"examples": ["admin123456"]}) name: Optional[StrictStr] = Field(default=None, description="Your name.") - invite_token: Annotated[str, Field(min_length=1, strict=True)] = Field(alias="inviteToken") + invite_token: Annotated[str, Field(min_length=1, strict=True)] = Field(alias="inviteToken", json_schema_extra={"examples": ["Gy9b8w1irmQtEPo5RmbMmSPheL5h4"]}) __properties: ClassVar[List[str]] = ["email", "password", "name", "inviteToken"] model_config = ConfigDict( diff --git a/talon_one/models/new_webhook.py b/talon_one/models/new_webhook.py index 359f985..883513f 100644 --- a/talon_one/models/new_webhook.py +++ b/talon_one/models/new_webhook.py @@ -30,16 +30,16 @@ class NewWebhook(BaseModel): NewWebhook """ # noqa: E501 application_ids: List[StrictInt] = Field(description="The IDs of the Applications in which this webhook is available. An empty array means the webhook is available in `All Applications`. ", alias="applicationIds") - title: Annotated[str, Field(strict=True)] = Field(description="Name or title for this webhook.") - description: Optional[StrictStr] = Field(default=None, description="A description of the webhook.") - draft: StrictBool = Field(description="Indicates if the webhook is a draft.") - verb: StrictStr = Field(description="API method for this webhook.") - url: StrictStr = Field(description="API URL (supports templating using parameters) for this webhook.") - headers: List[Annotated[str, Field(strict=True)]] = Field(description="List of API HTTP headers for this webhook.") - payload: Optional[StrictStr] = Field(default=None, description="API payload (supports templating using parameters) for this webhook.") - params: List[TemplateArgDef] = Field(description="Array of template argument definitions.") - enabled: StrictBool = Field(description="Enables or disables webhook from showing in the Rule Builder.") - authentication_id: Optional[StrictInt] = Field(default=None, description="The ID of the credential that this webhook is using.", alias="authenticationId") + title: Annotated[str, Field(strict=True)] = Field(description="Name or title for this webhook.", json_schema_extra={"examples": ["Send message"]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the webhook.", json_schema_extra={"examples": ["A webhook to send a coupon to the user."]}) + draft: StrictBool = Field(description="Indicates if the webhook is a draft.", json_schema_extra={"examples": [False]}) + verb: StrictStr = Field(description="API method for this webhook.", json_schema_extra={"examples": ["POST"]}) + url: StrictStr = Field(description="API URL (supports templating using parameters) for this webhook.", json_schema_extra={"examples": ["www.my-company.com/my-endpoint-name"]}) + headers: List[Annotated[str, Field(strict=True)]] = Field(description="List of API HTTP headers for this webhook.", json_schema_extra={"examples": [["{\"Authorization\": \"Basic bmF2ZWVua3VtYXIU=\"}", "{\"Content-Type\": \"application/json\"}"]]}) + payload: Optional[StrictStr] = Field(default=None, description="API payload (supports templating using parameters) for this webhook.", json_schema_extra={"examples": ["{\n\t\"message\": \"${message}\"\n}"]}) + params: List[TemplateArgDef] = Field(description="Array of template argument definitions.", json_schema_extra={"examples": [[]]}) + enabled: StrictBool = Field(description="Enables or disables webhook from showing in the Rule Builder.", json_schema_extra={"examples": [True]}) + 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') diff --git a/talon_one/models/notification_list_item.py b/talon_one/models/notification_list_item.py index 2894a09..86e3e1e 100644 --- a/talon_one/models/notification_list_item.py +++ b/talon_one/models/notification_list_item.py @@ -27,10 +27,10 @@ class NotificationListItem(BaseModel): """ NotificationListItem """ # noqa: E501 - notification_id: StrictInt = Field(description="The ID of the notification.", alias="notificationId") - notification_name: StrictStr = Field(description="The name of the notification.", alias="notificationName") - entity_id: StrictInt = Field(description="The ID of the entity to which this notification belongs. For example, in case of a loyalty notification, this value is the ID of the loyalty program. ", alias="entityId") - enabled: StrictBool = Field(description="Indicates whether the notification is activated.") + notification_id: StrictInt = Field(description="The ID of the notification.", alias="notificationId", json_schema_extra={"examples": [1]}) + notification_name: StrictStr = Field(description="The name of the notification.", alias="notificationName", json_schema_extra={"examples": ["My campaign notification"]}) + entity_id: StrictInt = Field(description="The ID of the entity to which this notification belongs. For example, in case of a loyalty notification, this value is the ID of the loyalty program. ", alias="entityId", json_schema_extra={"examples": [1]}) + enabled: StrictBool = Field(description="Indicates whether the notification is activated.", json_schema_extra={"examples": [True]}) __properties: ClassVar[List[str]] = ["notificationId", "notificationName", "entityId", "enabled"] model_config = ConfigDict( diff --git a/talon_one/models/okta_event.py b/talon_one/models/okta_event.py index c6d3ffa..5b8ff60 100644 --- a/talon_one/models/okta_event.py +++ b/talon_one/models/okta_event.py @@ -28,7 +28,7 @@ class OktaEvent(BaseModel): """ Single event definition in the event data emitted by Okta. """ # noqa: E501 - event_type: StrictStr = Field(description="Event type defining an action.", alias="eventType") + event_type: StrictStr = Field(description="Event type defining an action.", alias="eventType", json_schema_extra={"examples": ["application.user_membership.add"]}) target: List[OktaEventTarget] __properties: ClassVar[List[str]] = ["eventType", "target"] diff --git a/talon_one/models/okta_event_target.py b/talon_one/models/okta_event_target.py index 1ad1524..d90f517 100644 --- a/talon_one/models/okta_event_target.py +++ b/talon_one/models/okta_event_target.py @@ -27,9 +27,9 @@ class OktaEventTarget(BaseModel): """ Target of the specific Okta event. """ # noqa: E501 - type: StrictStr = Field(description="Type of the event target.") - alternate_id: StrictStr = Field(description="Identifier of the event target, depending on its type.", alias="alternateId") - display_name: StrictStr = Field(description="Display name of the event target.", alias="displayName") + type: StrictStr = Field(description="Type of the event target.", json_schema_extra={"examples": ["AppUser"]}) + alternate_id: StrictStr = Field(description="Identifier of the event target, depending on its type.", alias="alternateId", json_schema_extra={"examples": ["john.doe@example.com"]}) + display_name: StrictStr = Field(description="Display name of the event target.", alias="displayName", json_schema_extra={"examples": ["John Doe"]}) __properties: ClassVar[List[str]] = ["type", "alternateId", "displayName"] model_config = ConfigDict( diff --git a/talon_one/models/one_time_code.py b/talon_one/models/one_time_code.py index f7f80a1..bb06123 100644 --- a/talon_one/models/one_time_code.py +++ b/talon_one/models/one_time_code.py @@ -27,10 +27,10 @@ class OneTimeCode(BaseModel): """ OneTimeCode """ # noqa: E501 - user_id: StrictInt = Field(description="The ID of the user.", alias="userId") - account_id: StrictInt = Field(description="The ID of the account.", alias="accountId") - token: StrictStr = Field(description="The two-factor authentication token created during sign-in. This token is used to ensure that the correct user is trying to sign in with a given one-time security code.") - code: Optional[StrictStr] = Field(default=None, description="The one-time security code used for signing in.") + user_id: StrictInt = Field(description="The ID of the user.", alias="userId", json_schema_extra={"examples": [109]}) + account_id: StrictInt = Field(description="The ID of the account.", alias="accountId", json_schema_extra={"examples": [31]}) + token: StrictStr = Field(description="The two-factor authentication token created during sign-in. This token is used to ensure that the correct user is trying to sign in with a given one-time security code.", json_schema_extra={"examples": ["dy_Fa_lQ4iDAnqldJFvV"]}) + code: Optional[StrictStr] = Field(default=None, description="The one-time security code used for signing in.", json_schema_extra={"examples": ["552917"]}) __properties: ClassVar[List[str]] = ["userId", "accountId", "token", "code"] model_config = ConfigDict( diff --git a/talon_one/models/outgoing_integration_braze_policy.py b/talon_one/models/outgoing_integration_braze_policy.py index 083e744..7404ca6 100644 --- a/talon_one/models/outgoing_integration_braze_policy.py +++ b/talon_one/models/outgoing_integration_braze_policy.py @@ -27,8 +27,8 @@ class OutgoingIntegrationBrazePolicy(BaseModel): """ OutgoingIntegrationBrazePolicy """ # noqa: E501 - base_url: StrictStr = Field(description="The base URL of your Braze deployment.", alias="baseUrl") - api_key: StrictStr = Field(description="The API key of your Braze deployment.", alias="apiKey") + base_url: StrictStr = Field(description="The base URL of your Braze deployment.", alias="baseUrl", json_schema_extra={"examples": ["your-braze-url.com"]}) + api_key: StrictStr = Field(description="The API key of your Braze deployment.", alias="apiKey", json_schema_extra={"examples": ["Your-REST-API-Key"]}) __properties: ClassVar[List[str]] = ["baseUrl", "apiKey"] model_config = ConfigDict( diff --git a/talon_one/models/outgoing_integration_clever_tap_policy.py b/talon_one/models/outgoing_integration_clever_tap_policy.py index d8b4754..7c78a5e 100644 --- a/talon_one/models/outgoing_integration_clever_tap_policy.py +++ b/talon_one/models/outgoing_integration_clever_tap_policy.py @@ -27,9 +27,9 @@ class OutgoingIntegrationCleverTapPolicy(BaseModel): """ OutgoingIntegrationCleverTapPolicy """ # noqa: E501 - base_url: StrictStr = Field(description="The base URL that is based on the region key of your CleverTap account.", alias="baseUrl") - account_id: StrictStr = Field(description="The CleverTap Project ID.", alias="accountId") - passcode: StrictStr = Field(description="The CleverTap Project passcode.") + base_url: StrictStr = Field(description="The base URL that is based on the region key of your CleverTap account.", alias="baseUrl", json_schema_extra={"examples": ["your-clevertap-url.com"]}) + account_id: StrictStr = Field(description="The CleverTap Project ID.", alias="accountId", json_schema_extra={"examples": ["A9X-7A6-4A6B"]}) + passcode: StrictStr = Field(description="The CleverTap Project passcode.", json_schema_extra={"examples": ["ABB-BAF-AWZP"]}) __properties: ClassVar[List[str]] = ["baseUrl", "accountId", "passcode"] model_config = ConfigDict( diff --git a/talon_one/models/outgoing_integration_configuration.py b/talon_one/models/outgoing_integration_configuration.py index 2d1866d..940289d 100644 --- a/talon_one/models/outgoing_integration_configuration.py +++ b/talon_one/models/outgoing_integration_configuration.py @@ -27,9 +27,9 @@ class OutgoingIntegrationConfiguration(BaseModel): """ OutgoingIntegrationConfiguration """ # noqa: E501 - id: StrictInt = Field(description="Unique ID for this entity.") - account_id: StrictInt = Field(description="The ID of the account to which this configuration belongs.", alias="accountId") - type_id: StrictInt = Field(description="The outgoing integration type ID.", alias="typeId") + 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.") __properties: ClassVar[List[str]] = ["id", "accountId", "typeId", "policy"] diff --git a/talon_one/models/outgoing_integration_iterable_policy.py b/talon_one/models/outgoing_integration_iterable_policy.py index 8d0baef..ec805c1 100644 --- a/talon_one/models/outgoing_integration_iterable_policy.py +++ b/talon_one/models/outgoing_integration_iterable_policy.py @@ -27,8 +27,8 @@ class OutgoingIntegrationIterablePolicy(BaseModel): """ OutgoingIntegrationIterablePolicy """ # noqa: E501 - base_url: StrictStr = Field(description="The base URL that is based on the region key of your Iterable account.", alias="baseUrl") - api_key: StrictStr = Field(description="The API key generated from your Iterable account. See [Iterable API Key Guide](https://support.iterable.com/hc/en-us/articles/360043464871-API-Keys-)", alias="apiKey") + base_url: StrictStr = Field(description="The base URL that is based on the region key of your Iterable account.", alias="baseUrl", json_schema_extra={"examples": ["https://api.iterable.com"]}) + api_key: StrictStr = Field(description="The API key generated from your Iterable account. See [Iterable API Key Guide](https://support.iterable.com/hc/en-us/articles/360043464871-API-Keys-)", alias="apiKey", json_schema_extra={"examples": ["1234df4ba16940ca59c9352936d080a8"]}) __properties: ClassVar[List[str]] = ["baseUrl", "apiKey"] model_config = ConfigDict( diff --git a/talon_one/models/outgoing_integration_mo_engage_policy.py b/talon_one/models/outgoing_integration_mo_engage_policy.py index 1295704..b943958 100644 --- a/talon_one/models/outgoing_integration_mo_engage_policy.py +++ b/talon_one/models/outgoing_integration_mo_engage_policy.py @@ -27,10 +27,10 @@ class OutgoingIntegrationMoEngagePolicy(BaseModel): """ OutgoingIntegrationMoEngagePolicy """ # noqa: E501 - base_url: StrictStr = Field(description="The base URL of your MoEngage deployment, containing the MoEngage data center number (represented by `0X`).", alias="baseUrl") - app_id: StrictStr = Field(description="MoEngage APP ID. See [MoEngage Developer Guide](https://developers.moengage.com/hc/en-us/articles/4404674776724-Overview).", alias="appId") - data_api_id: StrictStr = Field(description="MoEngage DATA API ID. See [MoEngage Developer Guide](https://developers.moengage.com/hc/en-us/articles/4404674776724-Overview).", alias="dataApiId") - data_api_key: StrictStr = Field(description="MoEngage DATA API Key. See [MoEngage Developer Guide](https://developers.moengage.com/hc/en-us/articles/4404674776724-Overview).", alias="dataApiKey") + base_url: StrictStr = Field(description="The base URL of your MoEngage deployment, containing the MoEngage data center number (represented by `0X`).", alias="baseUrl", json_schema_extra={"examples": ["https://api-01.moengage.com"]}) + app_id: StrictStr = Field(description="MoEngage APP ID. See [MoEngage Developer Guide](https://developers.moengage.com/hc/en-us/articles/4404674776724-Overview).", alias="appId", json_schema_extra={"examples": ["LDUBEU9PLTPYXV30SMTYAAAA"]}) + data_api_id: StrictStr = Field(description="MoEngage DATA API ID. See [MoEngage Developer Guide](https://developers.moengage.com/hc/en-us/articles/4404674776724-Overview).", alias="dataApiId", json_schema_extra={"examples": ["LDUBEU9PLTPYXV30SMTYAAAA"]}) + data_api_key: StrictStr = Field(description="MoEngage DATA API Key. See [MoEngage Developer Guide](https://developers.moengage.com/hc/en-us/articles/4404674776724-Overview).", alias="dataApiKey", json_schema_extra={"examples": ["R95crrAAdZ747QLXe8LwnGLX"]}) __properties: ClassVar[List[str]] = ["baseUrl", "appId", "dataApiId", "dataApiKey"] model_config = ConfigDict( diff --git a/talon_one/models/outgoing_integration_template.py b/talon_one/models/outgoing_integration_template.py index d9ddf2d..7c6b13e 100644 --- a/talon_one/models/outgoing_integration_template.py +++ b/talon_one/models/outgoing_integration_template.py @@ -28,14 +28,14 @@ class OutgoingIntegrationTemplate(BaseModel): """ OutgoingIntegrationTemplate """ # noqa: E501 - id: StrictInt = Field(description="Unique ID for this entity.") - integration_type: StrictInt = Field(description="Unique ID of outgoing integration type.", alias="integrationType") - title: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The title of the integration template.") - description: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The description of the specific outgoing integration template.") - payload: StrictStr = Field(description="The API payload (supports templating using parameters) for this integration template.") - method: StrictStr = Field(description="API method for this webhook.") - relative_url: StrictStr = Field(description="The relative URL corresponding to each integration template.", alias="relativeUrl") - headers: List[Annotated[str, Field(strict=True)]] = Field(description="The list of HTTP headers for this integration template.") + id: StrictInt = Field(description="Unique ID for this entity.", json_schema_extra={"examples": [6]}) + integration_type: StrictInt = Field(description="Unique ID of outgoing integration type.", alias="integrationType", json_schema_extra={"examples": [2]}) + title: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The title of the integration template.", json_schema_extra={"examples": ["Email coupon codes"]}) + description: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The description of the specific outgoing integration template.", json_schema_extra={"examples": ["This template sends a coupon code to the specified audience by email."]}) + payload: StrictStr = Field(description="The API payload (supports templating using parameters) for this integration template.", json_schema_extra={"examples": ["{\n\t\"message\": \"${message}\"\n}"]}) + 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\"}"]]}) __properties: ClassVar[List[str]] = ["id", "integrationType", "title", "description", "payload", "method", "relativeUrl", "headers"] @field_validator('method') 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 d7354a3..225a796 100644 --- a/talon_one/models/outgoing_integration_template_with_configuration_details.py +++ b/talon_one/models/outgoing_integration_template_with_configuration_details.py @@ -28,14 +28,14 @@ class OutgoingIntegrationTemplateWithConfigurationDetails(BaseModel): """ OutgoingIntegrationTemplateWithConfigurationDetails """ # noqa: E501 - id: StrictInt = Field(description="Unique ID for this entity.") - integration_type: StrictInt = Field(description="Unique ID of outgoing integration type.", alias="integrationType") - title: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The title of the integration template.") - description: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The description of the specific outgoing integration template.") - payload: StrictStr = Field(description="The API payload (supports templating using parameters) for this integration template.") - method: StrictStr = Field(description="API method for this webhook.") - relative_url: StrictStr = Field(description="The relative URL corresponding to each integration template.", alias="relativeUrl") - headers: List[Annotated[str, Field(strict=True)]] = Field(description="The list of HTTP headers for this integration template.") + id: StrictInt = Field(description="Unique ID for this entity.", json_schema_extra={"examples": [6]}) + integration_type: StrictInt = Field(description="Unique ID of outgoing integration type.", alias="integrationType", json_schema_extra={"examples": [2]}) + title: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The title of the integration template.", json_schema_extra={"examples": ["Email coupon codes"]}) + description: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The description of the specific outgoing integration template.", json_schema_extra={"examples": ["This template sends a coupon code to the specified audience by email."]}) + payload: StrictStr = Field(description="The API payload (supports templating using parameters) for this integration template.", json_schema_extra={"examples": ["{\n\t\"message\": \"${message}\"\n}"]}) + 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.") __properties: ClassVar[List[str]] = ["id", "integrationType", "title", "description", "payload", "method", "relativeUrl", "headers", "policy"] diff --git a/talon_one/models/outgoing_integration_type.py b/talon_one/models/outgoing_integration_type.py index c7c6b73..ab90f1a 100644 --- a/talon_one/models/outgoing_integration_type.py +++ b/talon_one/models/outgoing_integration_type.py @@ -28,11 +28,11 @@ class OutgoingIntegrationType(BaseModel): """ OutgoingIntegrationType """ # noqa: E501 - id: StrictInt = Field(description="Unique ID for this entity.") - name: Annotated[str, Field(min_length=1, strict=True, max_length=64)] = Field(description="Name of the outgoing integration.") - description: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="Description of the outgoing integration.") - category: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=64)]] = Field(default=None, description="Category of the outgoing integration.") - documentation_link: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="Http link to the outgoing integration's documentation.", alias="documentationLink") + id: StrictInt = Field(description="Unique ID for this entity.", json_schema_extra={"examples": [6]}) + name: Annotated[str, Field(min_length=1, strict=True, max_length=64)] = Field(description="Name of the outgoing integration.", json_schema_extra={"examples": ["Braze"]}) + description: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="Description of the outgoing integration.", json_schema_extra={"examples": ["Braze is a customer data platform"]}) + category: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=64)]] = Field(default=None, description="Category of the outgoing integration.", json_schema_extra={"examples": ["customer engagement platform"]}) + documentation_link: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="Http link to the outgoing integration's documentation.", alias="documentationLink", json_schema_extra={"examples": ["https://docs.talon.one/docs/dev/technology-partners/braze"]}) __properties: ClassVar[List[str]] = ["id", "name", "description", "category", "documentationLink"] model_config = ConfigDict( diff --git a/talon_one/models/patch_item_catalog_action.py b/talon_one/models/patch_item_catalog_action.py index a67bdff..6f1a762 100644 --- a/talon_one/models/patch_item_catalog_action.py +++ b/talon_one/models/patch_item_catalog_action.py @@ -29,7 +29,7 @@ class PatchItemCatalogAction(BaseModel): The specific properties of the \"PATCH\" catalog sync action. **Note:** - If you do not provide a new `price` value, the existing `price` value is retained. - If you do not provide a new `product` value, the `product` value is set to `null`. """ # noqa: E501 sku: StrictStr = Field(description="The unique SKU of the item to patch.") - price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price of the item.") + price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price of the item.", json_schema_extra={"examples": [99.99]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="The attributes of the item to patch.") product: Optional[Product] = None create_if_not_exists: Optional[StrictBool] = Field(default=False, description="Indicates whether to create an item if the SKU does not exist.", alias="createIfNotExists") diff --git a/talon_one/models/patch_many_items_catalog_action.py b/talon_one/models/patch_many_items_catalog_action.py index 937cd27..1bfc619 100644 --- a/talon_one/models/patch_many_items_catalog_action.py +++ b/talon_one/models/patch_many_items_catalog_action.py @@ -28,7 +28,7 @@ class PatchManyItemsCatalogAction(BaseModel): """ The specific properties of the \"PATCH_MANY\" catalog sync action. """ # noqa: E501 - price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price of the item.") + price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price of the item.", json_schema_extra={"examples": [99.99]}) filters: Optional[List[CatalogActionFilter]] = Field(default=None, description="The list of filters used to select the items to patch, joined by `AND`. **Note:** Every item in the catalog will be modified if there are no filters. ") attributes: Optional[Dict[str, Any]] = Field(default=None, description="The attributes of the items to patch.") __properties: ClassVar[List[str]] = ["price", "filters", "attributes"] diff --git a/talon_one/models/pending_active_points_data.py b/talon_one/models/pending_active_points_data.py index 510fc12..3d65bee 100644 --- a/talon_one/models/pending_active_points_data.py +++ b/talon_one/models/pending_active_points_data.py @@ -29,13 +29,13 @@ class PendingActivePointsData(BaseModel): """ PendingActivePointsData """ # noqa: E501 - loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID") - subledger_id: StrictStr = Field(description="The ID of the subledger, when applicable. If this field is empty, the main ledger is used.", alias="SubledgerID") - customer_profile_id: StrictStr = Field(description="The integration ID of the customer profile whose loyalty points are becoming active.", alias="CustomerProfileID") - points: Union[StrictFloat, StrictInt] = Field(description="The amount of pending loyalty points becoming active.", alias="Points") - active_on: Optional[datetime] = Field(default=None, description="The date and time the loyalty points become active.", alias="ActiveOn") - expire_on: Optional[datetime] = Field(default=None, description="The date and time the loyalty points expire.", alias="ExpireOn") - session_integration_id: Optional[StrictStr] = Field(default=None, description="The integration ID of the session through which the points were earned.", alias="SessionIntegrationID") + loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID", json_schema_extra={"examples": [5]}) + subledger_id: StrictStr = Field(description="The ID of the subledger, when applicable. If this field is empty, the main ledger is used.", alias="SubledgerID", json_schema_extra={"examples": ["SL001"]}) + customer_profile_id: StrictStr = Field(description="The integration ID of the customer profile whose loyalty points are becoming active.", alias="CustomerProfileID", json_schema_extra={"examples": ["URNGV8294NV"]}) + points: Union[StrictFloat, StrictInt] = Field(description="The amount of pending loyalty points becoming active.", alias="Points", json_schema_extra={"examples": [10.99]}) + active_on: Optional[datetime] = Field(default=None, description="The date and time the loyalty points become active.", alias="ActiveOn", json_schema_extra={"examples": ["2023-08-20T12:22:00+02:00"]}) + expire_on: Optional[datetime] = Field(default=None, description="The date and time the loyalty points expire.", alias="ExpireOn", json_schema_extra={"examples": ["2023-09-01T12:23:00+02:00"]}) + session_integration_id: Optional[StrictStr] = Field(default=None, description="The integration ID of the session through which the points were earned.", alias="SessionIntegrationID", json_schema_extra={"examples": ["cc53e4fa-547f-4f5e-8333-76e05c381f67"]}) __properties: ClassVar[List[str]] = ["LoyaltyProgramID", "SubledgerID", "CustomerProfileID", "Points", "ActiveOn", "ExpireOn", "SessionIntegrationID"] model_config = ConfigDict( diff --git a/talon_one/models/pending_active_points_notification.py b/talon_one/models/pending_active_points_notification.py index 5627426..8e29351 100644 --- a/talon_one/models/pending_active_points_notification.py +++ b/talon_one/models/pending_active_points_notification.py @@ -28,7 +28,7 @@ class PendingActivePointsNotification(BaseModel): """ PendingActivePointsNotification """ # noqa: E501 - total_result_size: StrictInt = Field(alias="TotalResultSize") + total_result_size: StrictInt = Field(alias="TotalResultSize", json_schema_extra={"examples": [1]}) data: List[PendingActivePointsData] = Field(description="The array of pending points.", alias="Data") notification_type: StrictStr = Field(description="The type of notification.", alias="NotificationType") __properties: ClassVar[List[str]] = ["TotalResultSize", "Data", "NotificationType"] diff --git a/talon_one/models/pending_points_notification_policy.py b/talon_one/models/pending_points_notification_policy.py index 3a337c2..68708cd 100644 --- a/talon_one/models/pending_points_notification_policy.py +++ b/talon_one/models/pending_points_notification_policy.py @@ -28,9 +28,9 @@ class PendingPointsNotificationPolicy(BaseModel): """ PendingPointsNotificationPolicy """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.") - batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled") - batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.", json_schema_extra={"examples": ["Christmas Sale"]}) + batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled", json_schema_extra={"examples": [False]}) + batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize", json_schema_extra={"examples": [1000]}) __properties: ClassVar[List[str]] = ["name", "batchingEnabled", "batchSize"] model_config = ConfigDict( diff --git a/talon_one/models/picklist.py b/talon_one/models/picklist.py index 94733cf..acb98bd 100644 --- a/talon_one/models/picklist.py +++ b/talon_one/models/picklist.py @@ -29,14 +29,14 @@ class Picklist(BaseModel): """ Picklist """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - type: StrictStr = Field(description="The type of allowed values in the picklist. If the type `time` is chosen, it must be an RFC3339 timestamp string.") - values: Annotated[List[StrictStr], Field(max_length=50)] = Field(description="The list of allowed values provided by this picklist.") - modified_by: Optional[StrictInt] = Field(default=None, description="ID of the user who last updated this effect if available.", alias="modifiedBy") - created_by: StrictInt = Field(description="ID of the user who created this effect.", alias="createdBy") - account_id: Optional[StrictInt] = Field(default=None, description="The ID of the account that owns this entity.", alias="accountId") - imported: Optional[StrictBool] = Field(default=None, description="Imported flag shows that a picklist is imported by a CSV file or not") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + type: StrictStr = Field(description="The type of allowed values in the picklist. If the type `time` is chosen, it must be an RFC3339 timestamp string.", json_schema_extra={"examples": ["string"]}) + values: Annotated[List[StrictStr], Field(max_length=50)] = Field(description="The list of allowed values provided by this picklist.", json_schema_extra={"examples": [["Jeans", "Shirt", "Coat"]]}) + modified_by: Optional[StrictInt] = Field(default=None, description="ID of the user who last updated this effect if available.", alias="modifiedBy", json_schema_extra={"examples": [124]}) + created_by: StrictInt = Field(description="ID of the user who created this effect.", alias="createdBy", json_schema_extra={"examples": [134]}) + account_id: Optional[StrictInt] = Field(default=None, description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + imported: Optional[StrictBool] = Field(default=None, description="Imported flag shows that a picklist is imported by a CSV file or not", json_schema_extra={"examples": [True]}) __properties: ClassVar[List[str]] = ["id", "created", "type", "values", "modifiedBy", "createdBy", "accountId", "imported"] @field_validator('type') diff --git a/talon_one/models/placeholder_details.py b/talon_one/models/placeholder_details.py index 35457b3..5e57f3b 100644 --- a/talon_one/models/placeholder_details.py +++ b/talon_one/models/placeholder_details.py @@ -27,9 +27,9 @@ class PlaceholderDetails(BaseModel): """ PlaceholderDetails """ # noqa: E501 - name: StrictStr = Field(description="The name of the placeholder.") - type: StrictStr = Field(description="The type of the value assigned to the placeholder.") - value: List[Any] = Field(description="The current value of the placeholder.") + name: StrictStr = Field(description="The name of the placeholder.", json_schema_extra={"examples": ["my property"]}) + type: StrictStr = Field(description="The type of the value assigned to the placeholder.", json_schema_extra={"examples": ["list string"]}) + value: List[Any] = Field(description="The current value of the placeholder.", json_schema_extra={"examples": [[1, "sku_value"]]}) __properties: ClassVar[List[str]] = ["name", "type", "value"] model_config = ConfigDict( diff --git a/talon_one/models/price_detail.py b/talon_one/models/price_detail.py index 6f79edc..b7b6253 100644 --- a/talon_one/models/price_detail.py +++ b/talon_one/models/price_detail.py @@ -29,11 +29,11 @@ class PriceDetail(BaseModel): """ PriceDetail """ # noqa: E501 - price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The value of this price type.") - adjustment_context_id: Optional[StrictStr] = Field(default=None, description="The context identifier of the selected price adjustment.", alias="adjustmentContextId") - adjustment_reference_id: Optional[UUID] = Field(default=None, description="The reference identifier of the selected price adjustment for this SKU.", alias="adjustmentReferenceId") - adjustment_effective_from: Optional[datetime] = Field(default=None, description="The date and time from which the price adjustment is effective.", alias="adjustmentEffectiveFrom") - adjustment_effective_until: Optional[datetime] = Field(default=None, description="The date and time until which the price adjustment is effective.", alias="adjustmentEffectiveUntil") + price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The value of this price type.", json_schema_extra={"examples": [90]}) + adjustment_context_id: Optional[StrictStr] = Field(default=None, description="The context identifier of the selected price adjustment.", alias="adjustmentContextId", json_schema_extra={"examples": ["summer25"]}) + adjustment_reference_id: Optional[UUID] = Field(default=None, description="The reference identifier of the selected price adjustment for this SKU.", alias="adjustmentReferenceId", json_schema_extra={"examples": ["68851723-e6fa-488f-ace9-112581e6c19b"]}) + adjustment_effective_from: Optional[datetime] = Field(default=None, description="The date and time from which the price adjustment is effective.", alias="adjustmentEffectiveFrom", json_schema_extra={"examples": ["2025-05-25T00:00:00Z"]}) + adjustment_effective_until: Optional[datetime] = Field(default=None, description="The date and time until which the price adjustment is effective.", alias="adjustmentEffectiveUntil", json_schema_extra={"examples": ["2025-05-30T00:00:00Z"]}) __properties: ClassVar[List[str]] = ["price", "adjustmentContextId", "adjustmentReferenceId", "adjustmentEffectiveFrom", "adjustmentEffectiveUntil"] model_config = ConfigDict( diff --git a/talon_one/models/price_history_request.py b/talon_one/models/price_history_request.py index e7f44eb..cea482d 100644 --- a/talon_one/models/price_history_request.py +++ b/talon_one/models/price_history_request.py @@ -28,9 +28,9 @@ class PriceHistoryRequest(BaseModel): """ PriceHistoryRequest """ # noqa: E501 - sku: StrictStr = Field(description="The SKU of the item for which the historical prices are being retrieved.") - start_date: datetime = Field(description="The start date of the period for which historical prices should be retrieved.", alias="startDate") - end_date: datetime = Field(description="The end date of the period for which historical prices should be retrieved.", alias="endDate") + sku: StrictStr = Field(description="The SKU of the item for which the historical prices are being retrieved.", json_schema_extra={"examples": [["sku-124"]]}) + start_date: datetime = Field(description="The start date of the period for which historical prices should be retrieved.", alias="startDate", json_schema_extra={"examples": ["2020-11-10T23:00:00Z"]}) + end_date: datetime = Field(description="The end date of the period for which historical prices should be retrieved.", alias="endDate", json_schema_extra={"examples": ["2020-12-10T23:00:00Z"]}) __properties: ClassVar[List[str]] = ["sku", "startDate", "endDate"] model_config = ConfigDict( diff --git a/talon_one/models/price_history_response.py b/talon_one/models/price_history_response.py index 2d91175..827b0cb 100644 --- a/talon_one/models/price_history_response.py +++ b/talon_one/models/price_history_response.py @@ -28,7 +28,7 @@ class PriceHistoryResponse(BaseModel): """ PriceHistoryResponse """ # noqa: E501 - sku: StrictStr = Field(description="The SKU of the item for which historical prices should be retrieved.") + sku: StrictStr = Field(description="The SKU of the item for which historical prices should be retrieved.", json_schema_extra={"examples": [["SKU1241028"]]}) history: List[History] __properties: ClassVar[List[str]] = ["sku", "history"] diff --git a/talon_one/models/price_type.py b/talon_one/models/price_type.py index 5e74f7e..695035c 100644 --- a/talon_one/models/price_type.py +++ b/talon_one/models/price_type.py @@ -29,15 +29,15 @@ class PriceType(BaseModel): """ PriceType """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - account_id: Optional[StrictInt] = Field(default=None, description="The ID of the account that owns this price type.", alias="accountId") - name: Annotated[str, Field(strict=True)] = Field(description="The API name of the price type. This is an immutable value.") - title: StrictStr = Field(description="The name displayed in the Campaign Manager for the price type.") - description: Optional[StrictStr] = Field(default=None, description="A description of the price type.") - modified: datetime = Field(description="The date and time when the price type was last modified.") - subscribed_catalogs_ids: List[StrictInt] = Field(description="A list of the IDs of the catalogs that are subscribed to this price type.", alias="subscribedCatalogsIds") - targeted_audiences_ids: List[StrictInt] = Field(description="A list of the IDs of the audiences targeted by this price type.", alias="targetedAudiencesIds") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + account_id: Optional[StrictInt] = Field(default=None, description="The ID of the account that owns this price type.", alias="accountId", json_schema_extra={"examples": [1]}) + name: Annotated[str, Field(strict=True)] = Field(description="The API name of the price type. This is an immutable value.", json_schema_extra={"examples": ["member"]}) + title: StrictStr = Field(description="The name displayed in the Campaign Manager for the price type.", json_schema_extra={"examples": ["Member Price"]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the price type.", json_schema_extra={"examples": ["The price available exclusively to members."]}) + modified: datetime = Field(description="The date and time when the price type was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + subscribed_catalogs_ids: List[StrictInt] = Field(description="A list of the IDs of the catalogs that are subscribed to this price type.", alias="subscribedCatalogsIds", json_schema_extra={"examples": [[1, 2, 3]]}) + 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') diff --git a/talon_one/models/price_type_reference_detail.py b/talon_one/models/price_type_reference_detail.py index c5b7e7b..e8088ae 100644 --- a/talon_one/models/price_type_reference_detail.py +++ b/talon_one/models/price_type_reference_detail.py @@ -28,9 +28,9 @@ class PriceTypeReferenceDetail(BaseModel): PriceTypeReferenceDetail """ # noqa: E501 referencing_type: StrictStr = Field(description="The entity type that references the price type. For example, a campaign or an Application cart item filter.", alias="referencingType") - referencing_id: StrictInt = Field(description="The ID of the entity that references the price type.", alias="referencingId") - referencing_name: StrictStr = Field(description="The name of the entity that references the price type.", alias="referencingName") - application_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application that contains the entity that references the price type.", alias="applicationId") + referencing_id: StrictInt = Field(description="The ID of the entity that references the price type.", alias="referencingId", json_schema_extra={"examples": [1]}) + referencing_name: StrictStr = Field(description="The name of the entity that references the price type.", alias="referencingName", json_schema_extra={"examples": ["Summer promotions"]}) + application_id: Optional[StrictInt] = Field(default=None, description="The ID of the Application that contains the entity that references the price type.", alias="applicationId", json_schema_extra={"examples": [322]}) __properties: ClassVar[List[str]] = ["referencingType", "referencingId", "referencingName", "applicationId"] @field_validator('referencing_type') diff --git a/talon_one/models/price_type_references.py b/talon_one/models/price_type_references.py index bf14b9a..fffc62b 100644 --- a/talon_one/models/price_type_references.py +++ b/talon_one/models/price_type_references.py @@ -28,7 +28,7 @@ class PriceTypeReferences(BaseModel): """ PriceTypeReferences """ # noqa: E501 - price_type_id: StrictInt = Field(description="The ID of the price type.", alias="priceTypeId") + price_type_id: StrictInt = Field(description="The ID of the price type.", alias="priceTypeId", json_schema_extra={"examples": [6]}) references: Optional[List[PriceTypeReferenceDetail]] = Field(default=None, description="A list of entities that reference the price type, including details about the entities.") __properties: ClassVar[List[str]] = ["priceTypeId", "references"] diff --git a/talon_one/models/product.py b/talon_one/models/product.py index 0b4e1a5..a8425f2 100644 --- a/talon_one/models/product.py +++ b/talon_one/models/product.py @@ -27,7 +27,7 @@ class Product(BaseModel): """ The specific properties of the product this item belongs to, if available. """ # noqa: E501 - name: StrictStr = Field(description="The product the item belongs to.") + name: StrictStr = Field(description="The product the item belongs to.", json_schema_extra={"examples": ["sample_product"]}) __properties: ClassVar[List[str]] = ["name"] model_config = ConfigDict( diff --git a/talon_one/models/product_search_match.py b/talon_one/models/product_search_match.py index a1a868e..65d8e54 100644 --- a/talon_one/models/product_search_match.py +++ b/talon_one/models/product_search_match.py @@ -27,9 +27,9 @@ class ProductSearchMatch(BaseModel): """ ProductSearchMatch """ # noqa: E501 - product_id: Optional[StrictInt] = Field(default=None, description="The ID of the product.", alias="productId") - value: StrictStr = Field(description="The string matching the given value. Either a product name or SKU.") - product_sku_id: Optional[StrictInt] = Field(default=None, description="The ID of the SKU linked to a product. If empty, this is an product.", alias="productSkuId") + product_id: Optional[StrictInt] = Field(default=None, description="The ID of the product.", alias="productId", json_schema_extra={"examples": [1]}) + value: StrictStr = Field(description="The string matching the given value. Either a product name or SKU.", json_schema_extra={"examples": ["MyProduct"]}) + product_sku_id: Optional[StrictInt] = Field(default=None, description="The ID of the SKU linked to a product. If empty, this is an product.", alias="productSkuId", json_schema_extra={"examples": [1]}) __properties: ClassVar[List[str]] = ["productId", "value", "productSkuId"] model_config = ConfigDict( diff --git a/talon_one/models/product_unit_analytics_data_point.py b/talon_one/models/product_unit_analytics_data_point.py index 88cc7a5..61ce87e 100644 --- a/talon_one/models/product_unit_analytics_data_point.py +++ b/talon_one/models/product_unit_analytics_data_point.py @@ -29,11 +29,11 @@ class ProductUnitAnalyticsDataPoint(BaseModel): """ ProductUnitAnalyticsDataPoint """ # noqa: E501 - start_time: datetime = Field(description="The start of the aggregation time frame in UTC.", alias="startTime") - end_time: datetime = Field(description="The end of the aggregation time frame in UTC.", alias="endTime") + start_time: datetime = Field(description="The start of the aggregation time frame in UTC.", alias="startTime", json_schema_extra={"examples": ["2024-02-01T00:00:00Z"]}) + end_time: datetime = Field(description="The end of the aggregation time frame in UTC.", alias="endTime", json_schema_extra={"examples": ["2024-02-01T23:59:99Z"]}) units_sold: AnalyticsDataPointWithTrend = Field(description="The number of times the product or SKU was purchased.", alias="unitsSold") - product_id: StrictInt = Field(description="The ID of the product.", alias="productId") - product_name: StrictStr = Field(description="The name of the product.", alias="productName") + product_id: StrictInt = Field(description="The ID of the product.", alias="productId", json_schema_extra={"examples": [1]}) + product_name: StrictStr = Field(description="The name of the product.", alias="productName", json_schema_extra={"examples": ["MyProduct"]}) __properties: ClassVar[List[str]] = ["startTime", "endTime", "unitsSold", "productId", "productName"] model_config = ConfigDict( diff --git a/talon_one/models/profile_audiences_changes.py b/talon_one/models/profile_audiences_changes.py index f57865c..c861723 100644 --- a/talon_one/models/profile_audiences_changes.py +++ b/talon_one/models/profile_audiences_changes.py @@ -27,8 +27,8 @@ class ProfileAudiencesChanges(BaseModel): """ ProfileAudiencesChanges """ # noqa: E501 - adds: List[StrictInt] = Field(description="The IDs of the audiences for the customer to join.") - deletes: List[StrictInt] = Field(description="The IDs of the audiences for the customer to leave.") + adds: List[StrictInt] = Field(description="The IDs of the audiences for the customer to join.", json_schema_extra={"examples": [[2, 4]]}) + deletes: List[StrictInt] = Field(description="The IDs of the audiences for the customer to leave.", json_schema_extra={"examples": [[7]]}) __properties: ClassVar[List[str]] = ["adds", "deletes"] model_config = ConfigDict( diff --git a/talon_one/models/projected_tier.py b/talon_one/models/projected_tier.py index dca9f84..b24865d 100644 --- a/talon_one/models/projected_tier.py +++ b/talon_one/models/projected_tier.py @@ -27,9 +27,9 @@ class ProjectedTier(BaseModel): """ ProjectedTier """ # noqa: E501 - projected_active_points: Union[StrictFloat, StrictInt] = Field(description="The active points of the customer when their current tier expires.", alias="projectedActivePoints") - stay_in_tier_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of points the customer needs to stay in the current tier. **Note**: This is included in the response when the customer is projected to be downgraded. ", alias="stayInTierPoints") - projected_tier_name: Optional[StrictStr] = Field(default=None, description="The name of the tier the user will enter once their current tier expires.", alias="projectedTierName") + projected_active_points: Union[StrictFloat, StrictInt] = Field(description="The active points of the customer when their current tier expires.", alias="projectedActivePoints", json_schema_extra={"examples": [198]}) + stay_in_tier_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of points the customer needs to stay in the current tier. **Note**: This is included in the response when the customer is projected to be downgraded. ", alias="stayInTierPoints", json_schema_extra={"examples": [2]}) + projected_tier_name: Optional[StrictStr] = Field(default=None, description="The name of the tier the user will enter once their current tier expires.", alias="projectedTierName", json_schema_extra={"examples": ["Tier 1"]}) __properties: ClassVar[List[str]] = ["projectedActivePoints", "stayInTierPoints", "projectedTierName"] model_config = ConfigDict( diff --git a/talon_one/models/redeem_referral_effect_props.py b/talon_one/models/redeem_referral_effect_props.py index d89227e..c7449d6 100644 --- a/talon_one/models/redeem_referral_effect_props.py +++ b/talon_one/models/redeem_referral_effect_props.py @@ -25,7 +25,7 @@ class RedeemReferralEffectProps(BaseModel): """ - This effect is **deprecated**. The properties specific to the \"redeemReferral\" effect. This gets triggered whenever the referral code is valid, and a rule was triggered that contains a \"redeem referral\" effect. + This effect is **deprecated**. It has been replaced by the `acceptReferral` effect. This effect indicates that the referral code is valid and has been redeemed. """ # noqa: E501 id: StrictInt = Field(description="The id of the referral code that was redeemed.") value: StrictStr = Field(description="The referral code that was redeemed.") diff --git a/talon_one/models/referral.py b/talon_one/models/referral.py index 2e0c914..a183a4d 100644 --- a/talon_one/models/referral.py +++ b/talon_one/models/referral.py @@ -29,19 +29,19 @@ class Referral(BaseModel): """ Referral """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the referral code becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the referral code. Referral never expires if this is omitted.", alias="expiryDate") - 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") - campaign_id: StrictInt = Field(description="ID of the campaign from which the referral received the referral code.", alias="campaignId") - advocate_profile_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The Integration ID of the Advocate's Profile.", alias="advocateProfileIntegrationId") - friend_profile_integration_id: Optional[StrictStr] = Field(default=None, description="An optional Integration ID of the Friend's Profile.", alias="friendProfileIntegrationId") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.") - import_id: Optional[StrictInt] = Field(default=None, description="The ID of the Import which created this referral.", alias="importId") - code: Annotated[str, Field(min_length=4, strict=True)] = Field(description="The referral code.") - usage_counter: StrictInt = Field(description="The number of times this referral code has been successfully used.", alias="usageCounter") - batch_id: Optional[StrictStr] = Field(default=None, description="The ID of the batch the referrals belong to.", alias="batchId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the referral code becomes valid.", alias="startDate", json_schema_extra={"examples": ["2020-11-10T23:00:00Z"]}) + expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the referral code. Referral never expires if this is omitted.", alias="expiryDate", json_schema_extra={"examples": ["2021-11-10T23:00:00Z"]}) + 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="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.") + 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]}) + batch_id: Optional[StrictStr] = Field(default=None, description="The ID of the batch the referrals belong to.", alias="batchId", json_schema_extra={"examples": ["tqyrgahe"]}) __properties: ClassVar[List[str]] = ["id", "created", "startDate", "expiryDate", "usageLimit", "campaignId", "advocateProfileIntegrationId", "friendProfileIntegrationId", "attributes", "importId", "code", "usageCounter", "batchId"] model_config = ConfigDict( diff --git a/talon_one/models/referral_constraints.py b/talon_one/models/referral_constraints.py index c75fbdf..b89f8c6 100644 --- a/talon_one/models/referral_constraints.py +++ b/talon_one/models/referral_constraints.py @@ -29,9 +29,9 @@ class ReferralConstraints(BaseModel): """ ReferralConstraints """ # noqa: E501 - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the referral code becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the referral code. Referral never expires if this is omitted.", alias="expiryDate") - 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") + start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the referral code becomes valid.", alias="startDate", json_schema_extra={"examples": ["2020-11-10T23:00:00Z"]}) + expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the referral code. Referral never expires if this is omitted.", alias="expiryDate", json_schema_extra={"examples": ["2021-11-10T23:00:00Z"]}) + 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]}) __properties: ClassVar[List[str]] = ["startDate", "expiryDate", "usageLimit"] model_config = ConfigDict( diff --git a/talon_one/models/referral_created_effect_props.py b/talon_one/models/referral_created_effect_props.py index a196504..9c20a05 100644 --- a/talon_one/models/referral_created_effect_props.py +++ b/talon_one/models/referral_created_effect_props.py @@ -25,9 +25,9 @@ class ReferralCreatedEffectProps(BaseModel): """ - The properties specific to the \"referralCreated\" effect. This gets triggered whenever a validated rule contained a \"create referral\" effect, and a referral code was created for a customer. See \"createdReferrals\" on the response for all details of this referral code. + The `referralCreated` effect behaves similarly to [couponCreated](https://docs.talon.one/docs/dev/integration-api/api-effects#couponcreated). If the `friendProfileIntegrationId` parameter is empty, the referral code can be redeemed by anyone. """ # noqa: E501 - value: StrictStr = Field(description="The referral code that was created.") + value: StrictStr = Field(description="The referral code provided in the session.") __properties: ClassVar[List[str]] = ["value"] model_config = ConfigDict( diff --git a/talon_one/models/referral_rejection_reason.py b/talon_one/models/referral_rejection_reason.py index c181705..71eeab1 100644 --- a/talon_one/models/referral_rejection_reason.py +++ b/talon_one/models/referral_rejection_reason.py @@ -29,7 +29,7 @@ class ReferralRejectionReason(BaseModel): """ # noqa: E501 campaign_id: StrictInt = Field(alias="campaignId") referral_id: StrictInt = Field(alias="referralId") - reason: StrictStr + reason: StrictStr = Field(json_schema_extra={"examples": ["ReferralNotFound"]}) __properties: ClassVar[List[str]] = ["campaignId", "referralId", "reason"] @field_validator('reason') diff --git a/talon_one/models/reject_coupon_effect_props.py b/talon_one/models/reject_coupon_effect_props.py index 03a776e..308ad8a 100644 --- a/talon_one/models/reject_coupon_effect_props.py +++ b/talon_one/models/reject_coupon_effect_props.py @@ -25,14 +25,14 @@ class RejectCouponEffectProps(BaseModel): """ - The properties specific to the \"rejectCoupon\" effect. This gets triggered whenever the coupon was rejected. See rejectionReason for more info on why. + This effect indicates that the coupon code supplied couldn't be used. You should handle this effect by informing their user the coupon code is invalid. """ # noqa: E501 value: StrictStr = Field(description="The coupon code that was rejected.") - rejection_reason: StrictStr = Field(description="The reason why this coupon was rejected.", alias="rejectionReason") + rejection_reason: StrictStr = Field(description="The reason why the code was rejected. - `CampaignLimitReached`: The campaign-wide coupon code redemption limit has been reached. - `CouponExpired`: The coupon is expired. - `CouponLimitReached`: The coupon redemption limit or a campaign budget was reached. - `CouponNotFound`: The coupon code is incorrect. - `CouponPartOfNotRunningCampaign`: The campaign the coupon belongs to is currently not active. The campaignId field contains the ID of that campaign. - `CouponRecipientDoesNotMatch`: The given coupon value does not match the recipient or the coupon is linked to a `recipientIntegrationID` but there is no profile in the session. - `CouponRejectedByCondition`: Other conditions failed in the rule or all conditions passed but the `Coupon code is valid` condition is not present. - `CouponStartDateInFuture`: The coupon isn't active yet. - `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` cannot be applied because a discount limit is reached). - `ProfileLimitReached`: The profile-specific coupon redemption limit has been reached. - `CouponPartOfNotTriggeredCampaign`: The campaign the coupon belongs to was not triggered during evaluation (an exclusive or stackable campaign). The `campaignId` field contains the ID of that campaign. - `CouponReservationRequired`: The coupon's `isReservationMandatory` property is `true`, but the profile does not have a reservation. - `ProfileRequired`: The coupon's `isReservationMandatory` property is `true` or a [campaign profile budget](https://docs.talon.one/docs/product/campaigns/settings/manage-campaign-budgets) was set, but no profile exists in the session.", alias="rejectionReason") condition_index: Optional[StrictInt] = Field(default=None, description="The index of the condition that caused the rejection of the coupon.", alias="conditionIndex") effect_index: Optional[StrictInt] = Field(default=None, description="The index of the effect that caused the rejection of the coupon.", alias="effectIndex") details: Optional[StrictStr] = Field(default=None, description="More details about the failure.") - campaign_exclusion_reason: Optional[StrictStr] = Field(default=None, description="The reason why the campaign was not applied.", alias="campaignExclusionReason") + campaign_exclusion_reason: Optional[StrictStr] = Field(default=None, description="The reason why the campaign the coupon 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 coupon 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 coupon is part of an archived campaign.", alias="campaignExclusionReason", json_schema_extra={"examples": ["CampaignGaveLowerDiscount"]}) __properties: ClassVar[List[str]] = ["value", "rejectionReason", "conditionIndex", "effectIndex", "details", "campaignExclusionReason"] model_config = ConfigDict( diff --git a/talon_one/models/reject_referral_effect_props.py b/talon_one/models/reject_referral_effect_props.py index c8febe6..776bd09 100644 --- a/talon_one/models/reject_referral_effect_props.py +++ b/talon_one/models/reject_referral_effect_props.py @@ -25,14 +25,14 @@ class RejectReferralEffectProps(BaseModel): """ - The properties specific to the \"rejectReferral\" effect. This gets triggered whenever the referral code was rejected. See rejectionReason for more info on why. + This effect indicates that the provided referral code is invalid. """ # noqa: E501 - value: StrictStr = Field(description="The referral code that was rejected.") - rejection_reason: StrictStr = Field(description="The reason why this referral code was rejected.", alias="rejectionReason") + value: StrictStr = Field(description="The referral code that was rejected") + rejection_reason: StrictStr = Field(description="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.", alias="rejectionReason") condition_index: Optional[StrictInt] = Field(default=None, description="The index of the condition that caused the rejection of the referral.", alias="conditionIndex") effect_index: Optional[StrictInt] = Field(default=None, description="The index of the effect that caused the rejection of the referral.", alias="effectIndex") details: Optional[StrictStr] = Field(default=None, description="More details about the failure.") - campaign_exclusion_reason: Optional[StrictStr] = Field(default=None, description="The reason why the campaign was not applied.", alias="campaignExclusionReason") + campaign_exclusion_reason: Optional[StrictStr] = Field(default=None, description="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.", alias="campaignExclusionReason", json_schema_extra={"examples": ["CampaignGaveLowerDiscount"]}) __properties: ClassVar[List[str]] = ["value", "rejectionReason", "conditionIndex", "effectIndex", "details", "campaignExclusionReason"] model_config = ConfigDict( diff --git a/talon_one/models/remove_from_audience_effect_props.py b/talon_one/models/remove_from_audience_effect_props.py index bae54d2..79db797 100644 --- a/talon_one/models/remove_from_audience_effect_props.py +++ b/talon_one/models/remove_from_audience_effect_props.py @@ -25,12 +25,12 @@ class RemoveFromAudienceEffectProps(BaseModel): """ - The properties specific to the \"removeFromAudience\" effect. This gets triggered whenever a validated rule contains a \"removeFromAudience\" effect. + This effect is triggered when a rule containing an [Update audience](https://docs.talon.one/docs/product/rules/effects/use-effects#update-an-audience) effect with **Remove customer from an audience** selected is validated. It indicates that a customer was removed from an audience and is returned when a customer session is opened, updated, or closed. """ # noqa: E501 - audience_id: Optional[StrictInt] = Field(default=None, description="The internal ID of the audience.", alias="audienceId") - audience_name: Optional[StrictStr] = Field(default=None, description="The name of the audience.", alias="audienceName") - profile_integration_id: Optional[StrictStr] = Field(default=None, description="The ID of the customer profile in the third-party integration platform.", alias="profileIntegrationId") - profile_id: Optional[StrictInt] = Field(default=None, description="The internal ID of the customer profile.", alias="profileId") + audience_id: Optional[StrictInt] = Field(default=None, description="The internal ID of the audience.", alias="audienceId", json_schema_extra={"examples": [10]}) + audience_name: Optional[StrictStr] = Field(default=None, description="The name of the audience.", alias="audienceName", json_schema_extra={"examples": ["My audience"]}) + profile_integration_id: Optional[StrictStr] = Field(default=None, description="The ID of the customer profile in the third-party integration platform.", alias="profileIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + profile_id: Optional[StrictInt] = Field(default=None, description="The internal ID of the customer profile.", alias="profileId", json_schema_extra={"examples": [150]}) __properties: ClassVar[List[str]] = ["audienceId", "audienceName", "profileIntegrationId", "profileId"] model_config = ConfigDict( diff --git a/talon_one/models/reserve_coupon_effect_props.py b/talon_one/models/reserve_coupon_effect_props.py index e7ac59a..7788f46 100644 --- a/talon_one/models/reserve_coupon_effect_props.py +++ b/talon_one/models/reserve_coupon_effect_props.py @@ -25,10 +25,10 @@ class ReserveCouponEffectProps(BaseModel): """ - The properties specific to the \"reserveCoupon\" effect. This gets triggered whenever a validated rule contained a \"reserve coupon\" effect. This reserves the coupon currently on scope to the profile on scope. + This effect indicates that the given coupon code was reserved for the given customer. Talon.One provides soft and hard reservations. For more information, see [Reserve a coupon code](https://docs.talon.one/docs/product/rules/effects/use-effects#reserve-a-coupon-code). """ # noqa: E501 - coupon_value: StrictStr = Field(description="The value of the coupon currently on scope.", alias="couponValue") - profile_integration_id: StrictStr = Field(description="The ID of this customer profile in the third-party integration.", alias="profileIntegrationId") + coupon_value: StrictStr = Field(description="The coupon code that was created.", alias="couponValue") + profile_integration_id: StrictStr = Field(description="The integration identifier of the customer for whom this coupon was reserved.", alias="profileIntegrationId") is_new_reservation: StrictBool = Field(description="Indicates whether this is a new coupon reservation or not.", alias="isNewReservation") __properties: ClassVar[List[str]] = ["couponValue", "profileIntegrationId", "isNewReservation"] diff --git a/talon_one/models/response_content_object.py b/talon_one/models/response_content_object.py index 6bc8f4d..8f24b6f 100644 --- a/talon_one/models/response_content_object.py +++ b/talon_one/models/response_content_object.py @@ -27,7 +27,7 @@ class ResponseContentObject(BaseModel): """ ResponseContentObject """ # noqa: E501 - response_content: Optional[List[StrictStr]] = Field(default=None, description="Extends the response with the chosen data entities. Use this property to get as much data back as needed from one request instead of sending extra requests to other endpoints. ", alias="responseContent") + response_content: Optional[List[StrictStr]] = Field(default=None, description="Extends the response with the chosen data entities. Use this property to get as much data back as needed from one request instead of sending extra requests to other endpoints. ", alias="responseContent", json_schema_extra={"examples": [["triggeredCampaigns", "customerProfile"]]}) __properties: ClassVar[List[str]] = ["responseContent"] @field_validator('response_content') diff --git a/talon_one/models/return_integration_request.py b/talon_one/models/return_integration_request.py index be1d360..2d72882 100644 --- a/talon_one/models/return_integration_request.py +++ b/talon_one/models/return_integration_request.py @@ -29,7 +29,7 @@ class ReturnIntegrationRequest(BaseModel): The body of a return integration API request. Next to the cart items details, this contains an optional listing of extra properties that should be returned in the response. """ # noqa: E501 var_return: NewReturn = Field(description="The returned cart items details.", alias="return") - response_content: Optional[List[StrictStr]] = Field(default=None, description="Extends the response with the chosen data entities. Use this property to get as much data as you need in one _Update customer session_ request instead of sending extra requests to other endpoints. ", alias="responseContent") + response_content: Optional[List[StrictStr]] = Field(default=None, description="Extends the response with the chosen data entities. Use this property to get as much data as you need in one _Update customer session_ request instead of sending extra requests to other endpoints. ", alias="responseContent", json_schema_extra={"examples": [["customerSession", "customerProfile"]]}) __properties: ClassVar[List[str]] = ["return", "responseContent"] @field_validator('response_content') diff --git a/talon_one/models/returned_cart_item.py b/talon_one/models/returned_cart_item.py index 4df9e52..09c4532 100644 --- a/talon_one/models/returned_cart_item.py +++ b/talon_one/models/returned_cart_item.py @@ -28,9 +28,9 @@ class ReturnedCartItem(BaseModel): """ ReturnedCartItem """ # noqa: E501 - position: Optional[StrictInt] = Field(default=None, description="The index of the cart item in the provided customer session's `cartItems` property.") - quantity: Optional[StrictInt] = Field(default=None, description="Number of cart items to return. ") - sku: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The SKU of the cart item in the provided customer session's `cartItems` property.") + position: Optional[StrictInt] = Field(default=None, description="The index of the cart item in the provided customer session's `cartItems` property.", json_schema_extra={"examples": [2]}) + quantity: Optional[StrictInt] = Field(default=None, description="Number of cart items to return. ", json_schema_extra={"examples": [1]}) + sku: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The SKU of the cart item in the provided customer session's `cartItems` property.", json_schema_extra={"examples": ["SKU1241028"]}) __properties: ClassVar[List[str]] = ["position", "quantity", "sku"] model_config = ConfigDict( diff --git a/talon_one/models/revision.py b/talon_one/models/revision.py index adacdf0..bfdb6a5 100644 --- a/talon_one/models/revision.py +++ b/talon_one/models/revision.py @@ -29,7 +29,7 @@ class Revision(BaseModel): """ Revision """ # noqa: E501 - id: StrictInt = Field(description="Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints.") + id: StrictInt = Field(description="Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints.", json_schema_extra={"examples": [6]}) activate_at: Optional[datetime] = Field(default=None, alias="activateAt") account_id: StrictInt = Field(alias="accountId") application_id: StrictInt = Field(alias="applicationId") diff --git a/talon_one/models/revision_activation_request.py b/talon_one/models/revision_activation_request.py index 4780256..d319d2f 100644 --- a/talon_one/models/revision_activation_request.py +++ b/talon_one/models/revision_activation_request.py @@ -29,8 +29,8 @@ class RevisionActivationRequest(BaseModel): """ RevisionActivationRequest """ # noqa: E501 - user_ids: Annotated[List[StrictInt], Field(max_length=5)] = Field(description="The list of IDs of the users who will receive the activation request.", alias="userIds") - activate_at: Optional[datetime] = Field(default=None, description="Time when the revisions are finalized after the `activate_revision` operation. The current time is used when left blank. **Note:** It must be an RFC3339 timestamp string. ", alias="activateAt") + user_ids: Annotated[List[StrictInt], Field(max_length=5)] = Field(description="The list of IDs of the users who will receive the activation request.", alias="userIds", json_schema_extra={"examples": [[1, 2, 3]]}) + activate_at: Optional[datetime] = Field(default=None, description="Time when the revisions are finalized after the `activate_revision` operation. The current time is used when left blank. **Note:** It must be an RFC3339 timestamp string. ", alias="activateAt", json_schema_extra={"examples": ["2025-10-01T16:00:05Z07:00"]}) __properties: ClassVar[List[str]] = ["userIds", "activateAt"] model_config = ConfigDict( diff --git a/talon_one/models/revision_version.py b/talon_one/models/revision_version.py index 46686c6..29e10cb 100644 --- a/talon_one/models/revision_version.py +++ b/talon_one/models/revision_version.py @@ -31,18 +31,18 @@ class RevisionVersion(BaseModel): """ RevisionVersion """ # noqa: E501 - id: StrictInt = Field(description="Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints.") - name: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="A user-facing name for this campaign.") - start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime") - end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime") + id: StrictInt = Field(description="Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints.", json_schema_extra={"examples": [6]}) + name: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="A user-facing name for this campaign.", json_schema_extra={"examples": ["Summer promotions"]}) + start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime", json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) + end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime", json_schema_extra={"examples": ["2021-09-22T22:00:00Z"]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") - description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.") - active_ruleset_id: Optional[StrictInt] = Field(default=None, description="The ID of the ruleset this campaign will use.", alias="activeRulesetId") + description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.", json_schema_extra={"examples": ["Campaign for all summer 2021 promotions"]}) + active_ruleset_id: Optional[StrictInt] = Field(default=None, description="The ID of the ruleset this campaign will use.", alias="activeRulesetId", json_schema_extra={"examples": [5]}) tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)]] = Field(default=None, description="A list of tags for the campaign.") coupon_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="couponSettings") referral_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="referralSettings") limits: Optional[List[LimitConfig]] = Field(default=None, description="The set of limits that will operate for this campaign version.") - reevaluate_on_return: Optional[StrictBool] = Field(default=None, description="Indicates whether this campaign should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn") + reevaluate_on_return: Optional[StrictBool] = Field(default=None, description="Indicates whether this campaign should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn", json_schema_extra={"examples": [True]}) features: Optional[List[StrictStr]] = Field(default=None, description="A list of features for the campaign.") coupon_attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with coupons in this campaign.", alias="couponAttributes") account_id: StrictInt = Field(alias="accountId") diff --git a/talon_one/models/reward.py b/talon_one/models/reward.py index 4012442..1b9b70e 100644 --- a/talon_one/models/reward.py +++ b/talon_one/models/reward.py @@ -32,19 +32,19 @@ class Reward(BaseModel): """ Reward """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the reward.") - api_name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A unique identifier used to reference the reward in API integrations.", alias="apiName") - description: Optional[StrictStr] = Field(default=None, description="A description of the reward.") - application_ids: List[StrictInt] = Field(description="The IDs of the Applications this reward is connected to. **Note**: Currently, a reward can only be connected to one Application. ", alias="applicationIds") - sandbox: StrictBool = Field(description="Indicates if this is a live or sandbox reward. Rewards of a given type can only be connected to Applications of the same type.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the reward.", json_schema_extra={"examples": ["Free Coffee"]}) + api_name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A unique identifier used to reference the reward in API integrations.", alias="apiName", json_schema_extra={"examples": ["free-coffee"]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the reward.", json_schema_extra={"examples": ["This reward gets you one free coffee."]}) + application_ids: List[StrictInt] = Field(description="The IDs of the Applications this reward is connected to. **Note**: Currently, a reward can only be connected to one Application. ", alias="applicationIds", json_schema_extra={"examples": [[1, 2, 3]]}) + sandbox: StrictBool = Field(description="Indicates if this is a live or sandbox reward. Rewards of a given type can only be connected to Applications of the same type.", json_schema_extra={"examples": [True]}) visibility_conditions: Optional[Rule] = Field(default=None, description="An optional rule that manages who can see this reward. If not specified, the reward is visible to all customers. **Note:** Only the `condition` field is evaluated within this rule. The `effects` field must be an empty array, and `bindings` are not supported. ", alias="visibilityConditions") rule: Optional[Rule] = Field(default=None, description="Rule to apply. **Note**: The `bindings` field inside the rule must not be used in this endpoint. All bindings should be defined at the reward level via the top-level `bindings` field. ") - bindings: Optional[List[Binding]] = Field(default=None, description="A list of named variables created before the reward's rules are evaluated. Each binding pairs a name with a talang expression. The expression is evaluated once and its result is available by name in any rule condition or effect. Bindings must be defined outside of individual rules.") + bindings: Optional[List[Binding]] = Field(default=None, description="A list of named variables created before the reward's rules are evaluated. Each binding pairs a name with a talang expression. The expression is evaluated once and its result is available by name in any rule condition or effect. Bindings must be defined outside of individual rules.", json_schema_extra={"examples": [[]]}) modified: Optional[datetime] = Field(default=None, description="The timestamp when the reward was last updated in RFC3339 format.") - status: StrictStr = Field(description="The status of the reward.") + status: StrictStr = Field(description="The status of the reward.", json_schema_extra={"examples": ["active"]}) points_required: Optional[List[RewardPointsRequired]] = Field(default=None, description="The loyalty points required to activate a reward.", alias="pointsRequired") __properties: ClassVar[List[str]] = ["id", "created", "accountId", "name", "apiName", "description", "applicationIds", "sandbox", "visibilityConditions", "rule", "bindings", "modified", "status", "pointsRequired"] diff --git a/talon_one/models/reward_points_required.py b/talon_one/models/reward_points_required.py index 136add3..12d8e05 100644 --- a/talon_one/models/reward_points_required.py +++ b/talon_one/models/reward_points_required.py @@ -28,10 +28,10 @@ class RewardPointsRequired(BaseModel): """ The loyalty points required to activate a reward. """ # noqa: E501 - id: Optional[StrictInt] = Field(default=None, description="The ID of the `pointsRequired` entry. When updating a reward, include this property to update an existing entry. Omit it to create a new one. ") - amount: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="The number of loyalty points required to activate the reward.") - loyalty_program_id: StrictInt = Field(description="The ID of the associated loyalty program.", alias="loyaltyProgramId") - subledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program from which points are deducted when activating the reward. To specify the main ledger, provide an empty string (\"\"). ", alias="subledgerId") + id: Optional[StrictInt] = Field(default=None, description="The ID of the `pointsRequired` entry. When updating a reward, include this property to update an existing entry. Omit it to create a new one. ", json_schema_extra={"examples": [1]}) + amount: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="The number of loyalty points required to activate the reward.", json_schema_extra={"examples": [500]}) + loyalty_program_id: StrictInt = Field(description="The ID of the associated loyalty program.", alias="loyaltyProgramId", json_schema_extra={"examples": [10]}) + subledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program from which points are deducted when activating the reward. To specify the main ledger, provide an empty string (\"\"). ", alias="subledgerId", json_schema_extra={"examples": ["mysubledger"]}) __properties: ClassVar[List[str]] = ["id", "amount", "loyaltyProgramId", "subledgerId"] model_config = ConfigDict( diff --git a/talon_one/models/risk_notification.py b/talon_one/models/risk_notification.py index a170f23..34484da 100644 --- a/talon_one/models/risk_notification.py +++ b/talon_one/models/risk_notification.py @@ -28,13 +28,13 @@ class RiskNotification(BaseModel): """ A risk notification configuration rule. """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - entity: StrictStr = Field(description="The entity type to analyze within the given time frame.") - activity: StrictStr = Field(description="The activity metric to analyze within the given entity.") - time_frame: StrictStr = Field(description="The rolling time window for risk evaluation.", alias="timeFrame") - active: StrictBool = Field(description="Indicates whether this risk notification is active.") - modified: datetime = Field(description="Timestamp of the most recent update.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + entity: StrictStr = Field(description="The entity type to analyze within the given time frame.", json_schema_extra={"examples": ["customer_profile"]}) + activity: StrictStr = Field(description="The activity metric to analyze within the given entity.", json_schema_extra={"examples": ["loyalty_points_earned"]}) + time_frame: StrictStr = Field(description="The rolling time window for risk evaluation.", alias="timeFrame", json_schema_extra={"examples": ["1_week"]}) + active: StrictBool = Field(description="Indicates whether this risk notification is active.", json_schema_extra={"examples": [True]}) + modified: datetime = Field(description="Timestamp of the most recent update.", json_schema_extra={"examples": ["2026-04-16T09:05:27.993483Z"]}) __properties: ClassVar[List[str]] = ["id", "created", "entity", "activity", "timeFrame", "active", "modified"] @field_validator('entity') diff --git a/talon_one/models/role.py b/talon_one/models/role.py index 091d471..074e651 100644 --- a/talon_one/models/role.py +++ b/talon_one/models/role.py @@ -28,15 +28,15 @@ class Role(BaseModel): """ Role """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - modified: datetime = Field(description="The time this entity was last modified.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - campaign_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the [Campaign Group](https://docs.talon.one/docs/product/account/account-settings/managing-campaign-groups) this role was created for. ", alias="campaignGroupID") - name: StrictStr = Field(description="Name of the role.") - description: Optional[StrictStr] = Field(default=None, description="Description of the role.") - members: Optional[List[StrictInt]] = Field(default=None, description="A list of user identifiers assigned to this role.") - acl: Dict[str, Any] = Field(description="The `Access Control List` json defining the role of the user. This represents the access control on the user level.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + modified: datetime = Field(description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + campaign_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the [Campaign Group](https://docs.talon.one/docs/product/account/account-settings/managing-campaign-groups) this role was created for. ", alias="campaignGroupID", json_schema_extra={"examples": [3]}) + name: StrictStr = Field(description="Name of the role.", json_schema_extra={"examples": ["Campaign Reviewer"]}) + description: Optional[StrictStr] = Field(default=None, description="Description of the role.", json_schema_extra={"examples": ["Reviews the campaigns"]}) + members: Optional[List[StrictInt]] = Field(default=None, description="A list of user identifiers assigned to this role.", json_schema_extra={"examples": [[48, 562, 475, 18]]}) + acl: Dict[str, Any] = Field(description="The `Access Control List` json defining the role of the user. This represents the access control on the user level.", json_schema_extra={"examples": ["{\"Role\":127,\"Applications\":null}"]}) __properties: ClassVar[List[str]] = ["id", "created", "modified", "accountId", "campaignGroupID", "name", "description", "members", "acl"] model_config = ConfigDict( diff --git a/talon_one/models/role_assign.py b/talon_one/models/role_assign.py index 44f1e89..757df9e 100644 --- a/talon_one/models/role_assign.py +++ b/talon_one/models/role_assign.py @@ -27,8 +27,8 @@ class RoleAssign(BaseModel): """ RoleAssign """ # noqa: E501 - users: List[StrictInt] = Field(description="An array of user IDs.") - roles: List[StrictInt] = Field(description="An array of role IDs.") + users: List[StrictInt] = Field(description="An array of user IDs.", json_schema_extra={"examples": [[48, 562, 475, 18]]}) + roles: List[StrictInt] = Field(description="An array of role IDs.", json_schema_extra={"examples": [[128, 147]]}) __properties: ClassVar[List[str]] = ["users", "roles"] model_config = ConfigDict( diff --git a/talon_one/models/role_v2.py b/talon_one/models/role_v2.py index 6f3fbc6..af4066f 100644 --- a/talon_one/models/role_v2.py +++ b/talon_one/models/role_v2.py @@ -29,15 +29,15 @@ class RoleV2(BaseModel): """ RoleV2 """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - modified: datetime = Field(description="The time this entity was last modified.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - name: Optional[StrictStr] = Field(default=None, description="Name of the role.") - description: Optional[StrictStr] = Field(default=None, description="Description of the role.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + modified: datetime = Field(description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + name: Optional[StrictStr] = Field(default=None, description="Name of the role.", json_schema_extra={"examples": ["Campaign and campaign access group manager"]}) + description: Optional[StrictStr] = Field(default=None, description="Description of the role.", json_schema_extra={"examples": ["Allows you to create and edit campaigns for specific Applications, delete specific campaign access groups, and view loyalty programs."]}) permissions: Optional[RoleV2Permissions] = Field(default=None, description="The permissions that this role gives.") - members: Optional[List[StrictInt]] = Field(default=None, description="A list of user IDs the role is assigned to.") - is_readonly: Optional[StrictBool] = Field(default=False, description="Identifies if the role is read-only. For read-only roles, you can only assign or unassign users. You cannot edit any other properties, such as the name, description, or permissions. The 'isReadonly' property cannot be set for new or existing roles. It is reserved for predefined roles, such as the Talon.One support role.", alias="isReadonly") + members: Optional[List[StrictInt]] = Field(default=None, description="A list of user IDs the role is assigned to.", json_schema_extra={"examples": [[10, 12]]}) + is_readonly: Optional[StrictBool] = Field(default=False, description="Identifies if the role is read-only. For read-only roles, you can only assign or unassign users. You cannot edit any other properties, such as the name, description, or permissions. The 'isReadonly' property cannot be set for new or existing roles. It is reserved for predefined roles, such as the Talon.One support role.", alias="isReadonly", json_schema_extra={"examples": [False]}) __properties: ClassVar[List[str]] = ["id", "created", "modified", "accountId", "name", "description", "permissions", "members", "isReadonly"] model_config = ConfigDict( diff --git a/talon_one/models/role_v2_application_details.py b/talon_one/models/role_v2_application_details.py index 3eaed31..5096b4e 100644 --- a/talon_one/models/role_v2_application_details.py +++ b/talon_one/models/role_v2_application_details.py @@ -19,7 +19,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from talon_one.models.roles_v2_thresholds import RolesV2Thresholds from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -31,9 +30,8 @@ class RoleV2ApplicationDetails(BaseModel): application: Optional[StrictStr] = Field(default=None, description="Name of the Application-related permission set for the given Application.") campaign: Optional[StrictStr] = Field(default=None, description="Name of the campaign-related permission set for the given Application.") draft_campaign: Optional[StrictStr] = Field(default=None, description="Name of the draft campaign-related permission set for the given Application.", alias="draftCampaign") - tools: Optional[StrictStr] = Field(default=None, description="Name of the tools-related permission set.") - thresholds: Optional[RolesV2Thresholds] = Field(default=None, description="Support user limits for actions that require admin approval within the given application.") - __properties: ClassVar[List[str]] = ["application", "campaign", "draftCampaign", "tools", "thresholds"] + tools: Optional[StrictStr] = Field(default=None, description="Name of the tools-related permission set.", json_schema_extra={"examples": ["Tools permission set"]}) + __properties: ClassVar[List[str]] = ["application", "campaign", "draftCampaign", "tools"] model_config = ConfigDict( validate_by_name=True, @@ -74,9 +72,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of thresholds - if self.thresholds: - _dict['thresholds'] = self.thresholds.to_dict() return _dict @classmethod @@ -92,8 +87,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "application": obj.get("application"), "campaign": obj.get("campaign"), "draftCampaign": obj.get("draftCampaign"), - "tools": obj.get("tools"), - "thresholds": RolesV2Thresholds.from_dict(obj["thresholds"]) if obj.get("thresholds") is not None else None + "tools": obj.get("tools") }) return _obj diff --git a/talon_one/models/role_v2_base.py b/talon_one/models/role_v2_base.py index 6b6ff8d..0b821c4 100644 --- a/talon_one/models/role_v2_base.py +++ b/talon_one/models/role_v2_base.py @@ -28,10 +28,10 @@ class RoleV2Base(BaseModel): """ RoleV2Base """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="Name of the role.") - description: Optional[StrictStr] = Field(default=None, description="Description of the role.") + name: Optional[StrictStr] = Field(default=None, description="Name of the role.", json_schema_extra={"examples": ["Campaign and campaign access group manager"]}) + description: Optional[StrictStr] = Field(default=None, description="Description of the role.", json_schema_extra={"examples": ["Allows you to create and edit campaigns for specific Applications, delete specific campaign access groups, and view loyalty programs."]}) permissions: Optional[RoleV2Permissions] = Field(default=None, description="The permissions that this role gives.") - members: Optional[List[StrictInt]] = Field(default=None, description="A list of user IDs the role is assigned to.") + members: Optional[List[StrictInt]] = Field(default=None, description="A list of user IDs the role is assigned to.", json_schema_extra={"examples": [[10, 12]]}) __properties: ClassVar[List[str]] = ["name", "description", "permissions", "members"] model_config = ConfigDict( diff --git a/talon_one/models/role_v2_permission_set.py b/talon_one/models/role_v2_permission_set.py index b45f6e1..f57c18d 100644 --- a/talon_one/models/role_v2_permission_set.py +++ b/talon_one/models/role_v2_permission_set.py @@ -28,8 +28,8 @@ class RoleV2PermissionSet(BaseModel): """ RoleV2PermissionSet """ # noqa: E501 - name: StrictStr = Field(description="Name of the permission set.") - logical_operations: Annotated[List[StrictStr], Field(max_length=1000)] = Field(description="List of logical operations in the permission set. Each logical operation must be shown under the `x-permission` tag on an endpoint level. ", alias="logicalOperations") + name: StrictStr = Field(description="Name of the permission set.", json_schema_extra={"examples": ["Campaign manager permission set"]}) + logical_operations: Annotated[List[StrictStr], Field(max_length=1000)] = Field(description="List of logical operations in the permission set. Each logical operation must be shown under the `x-permission` tag on an endpoint level. ", alias="logicalOperations", json_schema_extra={"examples": [["createCampaignOperations", "getCampaignOperations", "deleteCampaignOperations"]]}) __properties: ClassVar[List[str]] = ["name", "logicalOperations"] model_config = ConfigDict( diff --git a/talon_one/models/role_v2_permissions.py b/talon_one/models/role_v2_permissions.py index 6468deb..fb6a311 100644 --- a/talon_one/models/role_v2_permissions.py +++ b/talon_one/models/role_v2_permissions.py @@ -22,6 +22,7 @@ from typing_extensions import Annotated from talon_one.models.role_v2_permission_set import RoleV2PermissionSet from talon_one.models.role_v2_roles_group import RoleV2RolesGroup +from talon_one.models.roles_v2_thresholds import RolesV2Thresholds from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -30,9 +31,10 @@ class RoleV2Permissions(BaseModel): """ RoleV2Permissions """ # noqa: E501 - permission_sets: Optional[Annotated[List[RoleV2PermissionSet], Field(max_length=500)]] = Field(default=None, description="List of grouped logical operations referenced by roles.", alias="permissionSets") + permission_sets: Optional[Annotated[List[RoleV2PermissionSet], Field(max_length=500)]] = Field(default=None, description="List of grouped logical operations referenced by roles.", alias="permissionSets", json_schema_extra={"examples": [[{"name": "Application permission set", "logicalOperations": ["getApplicationOperations", "editApplicationOperations"]}, {"name": "Campaign manager permission set", "logicalOperations": ["getCampaignOperations", "createCampaignOperations", "updateCampaignOperations"]}, {"name": "Campaign read-only permission set", "logicalOperations": ["getCampaignOperations"]}, {"name": "Loyalty program read-only permission set", "logicalOperations": ["getLoyaltyProgramOperations"]}, {"name": "Campaign access group manager permission set", "logicalOperations": ["getCampaignAccessGroupOperations", "updateCampaignAccessGroupOperations", "deleteCampaignAccessGroupOperations"]}]]}) roles: Optional[RoleV2RolesGroup] = None - __properties: ClassVar[List[str]] = ["permissionSets", "roles"] + thresholds: Optional[List[RolesV2Thresholds]] = Field(default=None, description="Support user limits for actions that require admin approval within the given application.") + __properties: ClassVar[List[str]] = ["permissionSets", "roles", "thresholds"] model_config = ConfigDict( validate_by_name=True, @@ -83,6 +85,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of roles if self.roles: _dict['roles'] = self.roles.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in thresholds (list) + _items = [] + if self.thresholds: + for _item_thresholds in self.thresholds: + if _item_thresholds: + _items.append(_item_thresholds.to_dict()) + _dict['thresholds'] = _items return _dict @classmethod @@ -96,7 +105,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "permissionSets": [RoleV2PermissionSet.from_dict(_item) for _item in obj["permissionSets"]] if obj.get("permissionSets") is not None else None, - "roles": RoleV2RolesGroup.from_dict(obj["roles"]) if obj.get("roles") is not None else None + "roles": RoleV2RolesGroup.from_dict(obj["roles"]) if obj.get("roles") is not None else None, + "thresholds": [RolesV2Thresholds.from_dict(_item) for _item in obj["thresholds"]] if obj.get("thresholds") is not None else None }) return _obj diff --git a/talon_one/models/role_v2_readonly.py b/talon_one/models/role_v2_readonly.py index 2bdc70c..5973a70 100644 --- a/talon_one/models/role_v2_readonly.py +++ b/talon_one/models/role_v2_readonly.py @@ -27,7 +27,7 @@ class RoleV2Readonly(BaseModel): """ RoleV2Readonly """ # noqa: E501 - is_readonly: Optional[StrictBool] = Field(default=False, description="Identifies if the role is read-only. For read-only roles, you can only assign or unassign users. You cannot edit any other properties, such as the name, description, or permissions. The 'isReadonly' property cannot be set for new or existing roles. It is reserved for predefined roles, such as the Talon.One support role.", alias="isReadonly") + is_readonly: Optional[StrictBool] = Field(default=False, description="Identifies if the role is read-only. For read-only roles, you can only assign or unassign users. You cannot edit any other properties, such as the name, description, or permissions. The 'isReadonly' property cannot be set for new or existing roles. It is reserved for predefined roles, such as the Talon.One support role.", alias="isReadonly", json_schema_extra={"examples": [False]}) __properties: ClassVar[List[str]] = ["isReadonly"] model_config = ConfigDict( diff --git a/talon_one/models/role_v2_roles_group.py b/talon_one/models/role_v2_roles_group.py index 2467781..455b11e 100644 --- a/talon_one/models/role_v2_roles_group.py +++ b/talon_one/models/role_v2_roles_group.py @@ -28,9 +28,9 @@ class RoleV2RolesGroup(BaseModel): """ RoleV2RolesGroup """ # noqa: E501 - applications: Optional[Dict[str, RoleV2ApplicationDetails]] = Field(default=None, description="A map of the link between the Application, campaign, or draft campaign-related permission set and the Application ID the permissions apply to.") - loyalty_programs: Optional[Dict[str, StrictStr]] = Field(default=None, description="A map of the link between the loyalty program-related permission set and the Application ID the permissions apply to.", alias="loyaltyPrograms") - campaign_access_groups: Optional[Dict[str, StrictStr]] = Field(default=None, description="A map of the link between the campaign access group-related permission set and the Application ID the permissions apply to.", alias="campaignAccessGroups") + applications: Optional[Dict[str, RoleV2ApplicationDetails]] = Field(default=None, description="A map of the link between the Application, campaign, or draft campaign-related permission set and the Application ID the permissions apply to.", json_schema_extra={"examples": [{"1": {"application": "Application permission set"}, "3": {"campaign": "Campaign manager permission set"}, "4": {"draftCampaign": "Campaign read-only permission set"}, "5": {"tools": "Tools permission set"}}]}) + loyalty_programs: Optional[Dict[str, StrictStr]] = Field(default=None, description="A map of the link between the loyalty program-related permission set and the Application ID the permissions apply to.", alias="loyaltyPrograms", json_schema_extra={"examples": [{"10": "Loyalty program manager permission set"}]}) + campaign_access_groups: Optional[Dict[str, StrictStr]] = Field(default=None, description="A map of the link between the campaign access group-related permission set and the Application ID the permissions apply to.", alias="campaignAccessGroups", json_schema_extra={"examples": [{"5": "Campaign access group manager permission set"}]}) account: Optional[StrictStr] = Field(default=None, description="Name of the account-level permission set") __properties: ClassVar[List[str]] = ["applications", "loyaltyPrograms", "campaignAccessGroups", "account"] diff --git a/talon_one/models/roles_v2_thresholds.py b/talon_one/models/roles_v2_thresholds.py index 6d5af83..f7ac272 100644 --- a/talon_one/models/roles_v2_thresholds.py +++ b/talon_one/models/roles_v2_thresholds.py @@ -27,8 +27,9 @@ class RolesV2Thresholds(BaseModel): """ RolesV2Thresholds """ # noqa: E501 - loyalty_points_limit: Optional[StrictInt] = Field(default=None, description="Maximum number of loyalty points a support user can award without approval.", alias="loyaltyPointsLimit") - __properties: ClassVar[List[str]] = ["loyaltyPointsLimit"] + loyalty_program_id: Optional[StrictInt] = Field(default=None, description="Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.", alias="loyaltyProgramId", json_schema_extra={"examples": [8]}) + loyalty_points_limit: Optional[StrictInt] = Field(default=None, description="Maximum number of loyalty points a support user can award without approval.", alias="loyaltyPointsLimit", json_schema_extra={"examples": [100]}) + __properties: ClassVar[List[str]] = ["loyaltyProgramId", "loyaltyPointsLimit"] model_config = ConfigDict( validate_by_name=True, @@ -81,6 +82,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "loyaltyProgramId": obj.get("loyaltyProgramId"), "loyaltyPointsLimit": obj.get("loyaltyPointsLimit") }) return _obj 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 c1837d9..60efbff 100644 --- a/talon_one/models/rollback_added_loyalty_points_effect_props.py +++ b/talon_one/models/rollback_added_loyalty_points_effect_props.py @@ -26,16 +26,16 @@ class RollbackAddedLoyaltyPointsEffectProps(BaseModel): """ - The properties specific to the \"rollbackAddedLoyaltyPoints\" effect. This gets triggered whenever previously a closed session with an addLoyaltyPoints effect is cancelled. + This effect is triggered in the following cases: - A session was cancelled in which loyalty points have been added. - A session was partially returned and loyalty point were added by the returned items. See [returning items](https://docs.talon.one/docs/dev/tutorials/partially-return-a-session). If you use the [Add loyalty points per item effect](https://docs.talon.one/docs/product/rules/effects/available-effects#reward-effects), use the `cartItemPosition` property to identify which items the loyalty points were rolled back for. If you use **Add loyalty points per item** and if the session contains some cart items with _quantity > 1_, use the `cartItemSubPosition` property to identify the item unit in its line item. If the loyalty program is [profile-based](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types), use the `recipientIntegrationId` property to identify the user for whom the loyalty points are rolled back. If the loyalty program is [card-based](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types), use the `cardIdentifier` property to identify the loyalty card where the points were originally added. """ # noqa: E501 - program_id: StrictInt = Field(description="The ID of the loyalty program where the points were originally added.", alias="programId") - sub_ledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were originally added.", alias="subLedgerId") + program_id: StrictInt = Field(description="The ID of the loyalty program where these points were rolled back.", alias="programId") + sub_ledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were rolled back.", alias="subLedgerId") value: Union[StrictFloat, StrictInt] = Field(description="The amount of points that were rolled back.") - recipient_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The user for whom these points were originally added.", alias="recipientIntegrationId") - transaction_uuid: StrictStr = Field(description="The identifier of 'deduction' entry added to the ledger as the `addLoyaltyPoints` effect is rolled back.", alias="transactionUUID") - cart_item_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The index of the item in the cart items for which the loyalty points were rolled back.", alias="cartItemPosition") - cart_item_sub_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="For cart items with `quantity` > 1, the sub-position indicates to which item the loyalty points were rolled back. ", alias="cartItemSubPosition") - card_identifier: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=108)]] = Field(default=None, description="The card on which these points were originally added.", alias="cardIdentifier") + recipient_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The user for whom these points were rolled back.", alias="recipientIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + transaction_uuid: StrictStr = Field(description="The identifier of this loyalty point transaction.", alias="transactionUUID") + cart_item_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="(_Add points per cart item_ only.) The index of the item in the `cartItem` object for which these points were rolled back.", alias="cartItemPosition") + cart_item_sub_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="(_Add points per cart item_ ) The index of the item unit in its line item.", alias="cartItemSubPosition") + 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') diff --git a/talon_one/models/rollback_coupon_effect_props.py b/talon_one/models/rollback_coupon_effect_props.py index e663aba..20cf1ee 100644 --- a/talon_one/models/rollback_coupon_effect_props.py +++ b/talon_one/models/rollback_coupon_effect_props.py @@ -25,9 +25,9 @@ class RollbackCouponEffectProps(BaseModel): """ - The properties specific to the \"rollbackCoupon\" effect. This gets triggered whenever previously closed session is now cancelled and a coupon redemption was cancelled on our internal usage limit counters. + This effect indicates that a coupon code redemption has been rolled back. The coupon becomes redeemable again. The effect is triggered when you [cancel](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#manage-the-sessions-state) a session where a coupon was accepted. See an example of use in the [cancelling a session tutorial](https://docs.talon.one/docs/dev/tutorials/roll-back-effects). """ # noqa: E501 - value: StrictStr = Field(description="The coupon code whose usage has been rolled back.") + value: StrictStr = Field(description="The coupon code whose redemption has been rolled back.") __properties: ClassVar[List[str]] = ["value"] model_config = ConfigDict( 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 648222a..4d6d80e 100644 --- a/talon_one/models/rollback_deducted_loyalty_points_effect_props.py +++ b/talon_one/models/rollback_deducted_loyalty_points_effect_props.py @@ -27,16 +27,16 @@ class RollbackDeductedLoyaltyPointsEffectProps(BaseModel): """ - The properties specific to the \"rollbackDeductedLoyaltyPoints\" effect. This effect is triggered whenever a previously closed session is cancelled and a deductLoyaltyPoints effect was revoked. + This effect is triggered in the following cases: - A session is _cancelled_ and this session deducted loyalty points. The rollback action returns the redeemed loyalty points to the customer. - A session is impacted by a _partial return_. Only added loyalty points that are still **pending** are rolled back. - A session in which loyalty points were spent is reopened. See the [session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states). If you set custom activation and expiration dates for the loyalty points, use the `startDate` and `expiryDate` properties to identify when the reward will be active and when will expire. If the loyalty program is [profile-based](https://docs.talon.one/docs/product/loyalty-programs/profile-based/profile-based-overview), use the `recipientIntegrationId` property to identify the user who receives the loyalty points. If the loyalty program is [card-based](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types), use the `cardIdentifier` property to identify the loyalty card where the points are reimbursed. """ # noqa: E501 program_id: StrictInt = Field(description="The ID of the loyalty program where these points were reimbursed.", alias="programId") sub_ledger_id: StrictStr = Field(description="The ID of the subledger within the loyalty program where these points were reimbursed.", alias="subLedgerId") - value: Union[StrictFloat, StrictInt] = Field(description="The amount of reimbursed points that were added.") - recipient_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The user for whom these points were reimbursed.", alias="recipientIntegrationId") - start_date: Optional[datetime] = Field(default=None, description="Date after which the reimbursed points will be valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Date after which the reimbursed points will expire.", alias="expiryDate") - transaction_uuid: StrictStr = Field(description="The identifier of 'addition' entries added to the ledger as the `deductLoyaltyPoints` effect is rolled back.", alias="transactionUUID") - card_identifier: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=108)]] = Field(default=None, description="The card on which these points were added.", alias="cardIdentifier") + value: Union[StrictFloat, StrictInt] = Field(description="The amount of points that were reimbursed.") + recipient_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The user for whom these points were reimbursed.", alias="recipientIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) + start_date: Optional[datetime] = Field(default=None, description="The date after which the reimbursed points will be valid.", alias="startDate") + expiry_date: Optional[datetime] = Field(default=None, description="The date after which the reimbursed points will expire.", alias="expiryDate") + transaction_uuid: StrictStr = Field(description="The identifier of this loyalty point transaction.", alias="transactionUUID") + 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') diff --git a/talon_one/models/rollback_discount_effect_props.py b/talon_one/models/rollback_discount_effect_props.py index cae27ec..e1cc29b 100644 --- a/talon_one/models/rollback_discount_effect_props.py +++ b/talon_one/models/rollback_discount_effect_props.py @@ -25,15 +25,15 @@ class RollbackDiscountEffectProps(BaseModel): """ - The properties specific to the \"rollbackDiscount\" effect. This gets triggered whenever previously closed session is now cancelled or partially returned and a setDiscount effect was cancelled on our internal discount limit counters. + This effect indicates that a discounted session, cart item, or additional cost has been cancelled or partially returned. This effect can only happen when you set the status of a session to `cancel` or the status changes to `partially_returned`. If the session contains some cart items with _quantity > 1_, use the `cartItemSubPosition` property to identify the specific item unit in its line item. See the example below. """ # noqa: E501 - name: StrictStr = Field(description="The name of the \"setDiscount\" effect that was rolled back.") - value: Union[StrictFloat, StrictInt] = Field(description="The value of the discount that was rolled back.") - cart_item_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The index of the item in the cart items for which the discount was rolled back.", alias="cartItemPosition") - cart_item_sub_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="For cart items with `quantity` > 1, the subposition returns the index of the item unit in its line item. ", alias="cartItemSubPosition") - additional_cost_id: Optional[StrictInt] = Field(default=None, description="The ID of the additional cost that was rolled back.", alias="additionalCostId") - additional_cost: Optional[StrictStr] = Field(default=None, description="The name of the additional cost that was rolled back.", alias="additionalCost") - scope: Optional[StrictStr] = Field(default=None, description="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` ") + name: StrictStr = Field(description="The name of the discount effect that was rolled back.") + value: Union[StrictFloat, StrictInt] = Field(description="The monetary value of the discount that was rolled back.") + cart_item_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The index of the item in the `cartItem` object whose discount was rolled back, or the unit containing the additional cost whose discount was rolled back.", alias="cartItemPosition") + cart_item_sub_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The index of the item unit in its line item for which the discount was rolled back.", alias="cartItemSubPosition") + additional_cost_id: Optional[StrictInt] = Field(default=None, description="_Only when rolling back [setDiscountPerAdditionalCost](https://docs.talon.one/docs/dev/integration-api/api-effects#setdiscountperadditionalcost) and [setDiscountPerAdditionalCostPerItem](https://docs.talon.one/docs/dev/integration-api/api-effects#setdiscountperadditionalcostperitem)_ The ID of the additional cost to be discounted.", alias="additionalCostId") + additional_cost: Optional[StrictStr] = Field(default=None, description="The API name of the additional cost whose discount was rolled back.", alias="additionalCost") + scope: Optional[StrictStr] = Field(default=None, description="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`") __properties: ClassVar[List[str]] = ["name", "value", "cartItemPosition", "cartItemSubPosition", "additionalCostId", "additionalCost", "scope"] model_config = ConfigDict( diff --git a/talon_one/models/rollback_increased_achievement_progress_effect_props.py b/talon_one/models/rollback_increased_achievement_progress_effect_props.py index d061a2d..a9dc873 100644 --- a/talon_one/models/rollback_increased_achievement_progress_effect_props.py +++ b/talon_one/models/rollback_increased_achievement_progress_effect_props.py @@ -25,12 +25,12 @@ class RollbackIncreasedAchievementProgressEffectProps(BaseModel): """ - The properties specific to the \"rollbackIncreasedAchievementProgress\" effect. This gets triggered whenever a closed session where the `increaseAchievementProgress` effect was triggered is cancelled. This is applicable only when the customer has not completed the achievement. + This effect indicates that the customer's progress in an achievement was rolled back. The Rule Engine triggers this effect when you cancel or [reopen a customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/reopenCustomerSession) that previously validated the [Update customer progress](https://docs.talon.one/docs/product/rules/effects/use-effects#update-customer-progress) effect and triggered the [increaseAchievementProgress](https://docs.talon.one/docs/dev/integration-api/api-effects#increaseachievementprogress) API effect. The effect is also triggered for completed achievements if the **Allow progress rollback for completed achievements** setting is enabled. You can enable this through the [Campaign Manager](https://docs.talon.one/docs/product/campaigns/achievements/manage-achievements) or the [Management API](https://docs.talon.one/management-api#tag/Achievements/operation/createAchievement) by setting the `achievementAllowRollbackAfterCompletion` property to `true`. This setting only applies to one-time and recurring on expiration achievements. """ # noqa: E501 - achievement_id: StrictInt = Field(description="The internal ID of the achievement.", alias="achievementId") - achievement_name: StrictStr = Field(description="The name of the achievement.", alias="achievementName") + achievement_id: StrictInt = Field(description="The internal ID of the achievement.", alias="achievementId", json_schema_extra={"examples": [10]}) + achievement_name: StrictStr = Field(description="The name of the achievement.", alias="achievementName", json_schema_extra={"examples": ["FreeCoffee10Orders"]}) progress_tracker_id: StrictInt = Field(description="The internal ID of the achievement progress tracker.", alias="progressTrackerId") - decrease_progress_by: Union[StrictFloat, StrictInt] = Field(description="The value by which the customer's current progress in the achievement is decreased.", alias="decreaseProgressBy") + decrease_progress_by: Union[StrictFloat, StrictInt] = Field(description="The value by which the customer's current progress in the achievement has decreased.", alias="decreaseProgressBy") current_progress: Union[StrictFloat, StrictInt] = Field(description="The current progress of the customer in the achievement.", alias="currentProgress") target: Union[StrictFloat, StrictInt] = Field(description="The target value to complete the achievement.") __properties: ClassVar[List[str]] = ["achievementId", "achievementName", "progressTrackerId", "decreaseProgressBy", "currentProgress", "target"] diff --git a/talon_one/models/rollback_referral_effect_props.py b/talon_one/models/rollback_referral_effect_props.py index 4784c90..740e643 100644 --- a/talon_one/models/rollback_referral_effect_props.py +++ b/talon_one/models/rollback_referral_effect_props.py @@ -25,9 +25,9 @@ class RollbackReferralEffectProps(BaseModel): """ - The properties specific to the \"rollbackReferral\" effect. This gets triggered whenever previously closed session is now cancelled and a referral redemption was cancelled on our internal usage limit counters. + This effect indicates that the redemption of the referral code has been rolled back. It triggers when a closed session that redeemed a referral is gets cancelled. The code becomes redeemable again. For more information about session states, see [Managing states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states). """ # noqa: E501 - value: StrictStr = Field(description="The referral code whose usage has been rolled back.") + value: StrictStr = Field(description="The referral code to be rolled back.") __properties: ClassVar[List[str]] = ["value"] model_config = ConfigDict( diff --git a/talon_one/models/rule.py b/talon_one/models/rule.py index a1104ad..9697485 100644 --- a/talon_one/models/rule.py +++ b/talon_one/models/rule.py @@ -30,13 +30,13 @@ class Rule(BaseModel): """ Rule """ # noqa: E501 - id: Optional[UUID] = Field(default=None, description="A unique identifier for the rule.") - parent_id: Optional[UUID] = Field(default=None, description="The ID of the rule that was copied to create this rule.", alias="parentId") - title: StrictStr = Field(description="A short description of the rule.") - description: Optional[StrictStr] = Field(default=None, description="A longer, more detailed description of the rule.") + id: Optional[UUID] = Field(default=None, description="A unique identifier for the rule.", json_schema_extra={"examples": ["7fa800a8-ac8d-4792-85dc-c4650dcc8f23"]}) + parent_id: Optional[UUID] = Field(default=None, description="The ID of the rule that was copied to create this rule.", alias="parentId", json_schema_extra={"examples": ["7fa800a8-ac8d-4792-85dc-c4650dcc8f23"]}) + title: StrictStr = Field(description="A short description of the rule.", json_schema_extra={"examples": ["Give discount via coupon"]}) + description: Optional[StrictStr] = Field(default=None, description="A longer, more detailed description of the rule.", json_schema_extra={"examples": ["Creates a discount when a coupon is valid"]}) bindings: Optional[List[Binding]] = Field(default=None, description="An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.") - condition: Annotated[List[Any], Field(min_length=1)] = Field(description="A Talang expression that will be evaluated in the context of the given event.") - effects: List[Dict[str, Any]] = Field(description="An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.") + condition: Annotated[List[Any], Field(min_length=1)] = Field(description="A Talang expression that will be evaluated in the context of the given event.", json_schema_extra={"examples": [["and", ["couponValid"]]]}) + effects: List[Dict[str, Any]] = Field(description="An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.", json_schema_extra={"examples": [["catch", ["noop"], ["setDiscount", "10% off", ["*", [".", "Session", "Total"], ["/", 10, 100]]]]]}) __properties: ClassVar[List[str]] = ["id", "parentId", "title", "description", "bindings", "condition", "effects"] model_config = ConfigDict( diff --git a/talon_one/models/rule_eligibility.py b/talon_one/models/rule_eligibility.py index b75c73b..c9c078d 100644 --- a/talon_one/models/rule_eligibility.py +++ b/talon_one/models/rule_eligibility.py @@ -28,7 +28,7 @@ class RuleEligibility(BaseModel): """ The customer's eligibility for a rule in the current session, based on whether all of the rule's conditions were met. """ # noqa: E501 - passed: StrictBool = Field(description="Indicates whether the customer was eligible for the rule in the current session, based on whether all of the rule's conditions were met.") + passed: StrictBool = Field(description="Indicates whether the customer was eligible for the rule in the current session, based on whether all of the rule's conditions were met.", json_schema_extra={"examples": [True]}) coupon_code: Optional[StrictStr] = Field(default=None, description="The coupon code used to check a customer's eligibility for the rule in the current session, if applicable.", alias="couponCode") details: Optional[RuleEligibilityFailureDetails] = Field(default=None, description="The details about why the customer was not eligible for the rule in the current session. Only returned when `passed` is `false`.") __properties: ClassVar[List[str]] = ["passed", "couponCode", "details"] diff --git a/talon_one/models/rule_eligibility_failure_details.py b/talon_one/models/rule_eligibility_failure_details.py index d4f024e..b705bf5 100644 --- a/talon_one/models/rule_eligibility_failure_details.py +++ b/talon_one/models/rule_eligibility_failure_details.py @@ -28,7 +28,7 @@ class RuleEligibilityFailureDetails(BaseModel): The details about why the customer was not eligible for the rule in the current session. """ # noqa: E501 failure_code: StrictStr = Field(description="A code identifying why the customer was not eligible for the rule in the current session.", alias="failureCode") - coupon_id: Optional[StrictInt] = Field(default=None, description="The ID of the coupon that was being evaluated when the rule failed. ", alias="couponID") + coupon_id: Optional[StrictInt] = Field(default=None, description="The ID of the coupon that was being evaluated when the rule failed. ", alias="couponID", json_schema_extra={"examples": [4928]}) coupon_value: Optional[StrictStr] = Field(default=None, description="The coupon code that was being evaluated when the rule failed. ", alias="couponValue") referral_id: Optional[StrictInt] = Field(default=None, description="The ID of the referral that was being evaluated when the rule failed. ", alias="referralID") referral_value: Optional[StrictStr] = Field(default=None, description="The referral code that was being evaluated when the rule failed. ", alias="referralValue") diff --git a/talon_one/models/rule_failure_reason.py b/talon_one/models/rule_failure_reason.py index 8676a09..6f1f0a8 100644 --- a/talon_one/models/rule_failure_reason.py +++ b/talon_one/models/rule_failure_reason.py @@ -30,7 +30,7 @@ class RuleFailureReason(BaseModel): campaign_id: StrictInt = Field(description="The ID of the campaign that contains the rule that failed.", alias="campaignID") campaign_name: StrictStr = Field(description="The name of the campaign that contains the rule that failed.", alias="campaignName") ruleset_id: StrictInt = Field(description="The ID of the ruleset that contains the rule that failed.", alias="rulesetID") - coupon_id: Optional[StrictInt] = Field(default=None, description="The ID of the coupon that was being evaluated at the time of the rule failure.", alias="couponID") + coupon_id: Optional[StrictInt] = Field(default=None, description="The ID of the coupon that was being evaluated at the time of the rule failure.", alias="couponID", json_schema_extra={"examples": [4928]}) coupon_value: Optional[StrictStr] = Field(default=None, description="The code of the coupon that was being evaluated at the time of the rule failure.", alias="couponValue") referral_id: Optional[StrictInt] = Field(default=None, description="The ID of the referral that was being evaluated at the time of the rule failure.", alias="referralID") referral_value: Optional[StrictStr] = Field(default=None, description="The code of the referral that was being evaluated at the time of the rule failure.", alias="referralValue") @@ -39,8 +39,8 @@ class RuleFailureReason(BaseModel): condition_index: Optional[StrictInt] = Field(default=None, description="The index of the condition that failed.", alias="conditionIndex") effect_index: Optional[StrictInt] = Field(default=None, description="The index of the effect that failed.", alias="effectIndex") details: Optional[StrictStr] = Field(default=None, description="More details about the failure.") - evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation).", alias="evaluationGroupID") - evaluation_group_mode: Optional[StrictStr] = Field(default=None, description="The evaluation mode of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-", alias="evaluationGroupMode") + evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation).", alias="evaluationGroupID", json_schema_extra={"examples": [3]}) + evaluation_group_mode: Optional[StrictStr] = Field(default=None, description="The evaluation mode of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-", alias="evaluationGroupMode", json_schema_extra={"examples": ["stackable"]}) __properties: ClassVar[List[str]] = ["campaignID", "campaignName", "rulesetID", "couponID", "couponValue", "referralID", "referralValue", "ruleIndex", "ruleName", "conditionIndex", "effectIndex", "details", "evaluationGroupID", "evaluationGroupMode"] model_config = ConfigDict( diff --git a/talon_one/models/rule_metadata.py b/talon_one/models/rule_metadata.py index eced4fe..2ade2c1 100644 --- a/talon_one/models/rule_metadata.py +++ b/talon_one/models/rule_metadata.py @@ -27,10 +27,10 @@ class RuleMetadata(BaseModel): """ RuleMetadata """ # noqa: E501 - title: StrictStr = Field(description="A short description of the rule.") - display_name: Optional[StrictStr] = Field(default=None, description="A customer-facing name for the rule.", alias="displayName") - display_description: Optional[StrictStr] = Field(default=None, description="A customer-facing description that explains the details of the rule. For example, this property can contain details about eligibility requirements, reward timelines, or terms and conditions. ", alias="displayDescription") - related_data: Optional[StrictStr] = Field(default=None, description="Any additional data associated with the rule, such as an image URL, vendor name, or a content management system (CMS) ID. ", alias="relatedData") + title: StrictStr = Field(description="A short description of the rule.", json_schema_extra={"examples": ["Give discount via coupon"]}) + display_name: Optional[StrictStr] = Field(default=None, description="A customer-facing name for the rule.", alias="displayName", json_schema_extra={"examples": ["20% off all shoes!"]}) + display_description: Optional[StrictStr] = Field(default=None, description="A customer-facing description that explains the details of the rule. For example, this property can contain details about eligibility requirements, reward timelines, or terms and conditions. ", alias="displayDescription", json_schema_extra={"examples": ["Get a 20% discount on all shoes during Thanksgiving! Offer valid till Dec 5 only."]}) + related_data: Optional[StrictStr] = Field(default=None, description="Any additional data associated with the rule, such as an image URL, vendor name, or a content management system (CMS) ID. ", alias="relatedData", json_schema_extra={"examples": ["https://example.com/discounts/20-off-shoes.png"]}) __properties: ClassVar[List[str]] = ["title", "displayName", "displayDescription", "relatedData"] model_config = ConfigDict( diff --git a/talon_one/models/rule_metadata_eligibility.py b/talon_one/models/rule_metadata_eligibility.py index 310b558..bd59be2 100644 --- a/talon_one/models/rule_metadata_eligibility.py +++ b/talon_one/models/rule_metadata_eligibility.py @@ -28,10 +28,10 @@ class RuleMetadataEligibility(BaseModel): """ RuleMetadataEligibility """ # noqa: E501 - title: StrictStr = Field(description="A short description of the rule.") - display_name: Optional[StrictStr] = Field(default=None, description="A customer-facing name for the rule.", alias="displayName") - display_description: Optional[StrictStr] = Field(default=None, description="A customer-facing description that explains the details of the rule. For example, this property can contain details about eligibility requirements, reward timelines, or terms and conditions. ", alias="displayDescription") - related_data: Optional[StrictStr] = Field(default=None, description="Any additional data associated with the rule, such as an image URL, vendor name, or a content management system (CMS) ID. ", alias="relatedData") + title: StrictStr = Field(description="A short description of the rule.", json_schema_extra={"examples": ["Give discount via coupon"]}) + display_name: Optional[StrictStr] = Field(default=None, description="A customer-facing name for the rule.", alias="displayName", json_schema_extra={"examples": ["20% off all shoes!"]}) + display_description: Optional[StrictStr] = Field(default=None, description="A customer-facing description that explains the details of the rule. For example, this property can contain details about eligibility requirements, reward timelines, or terms and conditions. ", alias="displayDescription", json_schema_extra={"examples": ["Get a 20% discount on all shoes during Thanksgiving! Offer valid till Dec 5 only."]}) + related_data: Optional[StrictStr] = Field(default=None, description="Any additional data associated with the rule, such as an image URL, vendor name, or a content management system (CMS) ID. ", alias="relatedData", json_schema_extra={"examples": ["https://example.com/discounts/20-off-shoes.png"]}) eligibility: List[RuleEligibility] __properties: ClassVar[List[str]] = ["title", "displayName", "displayDescription", "relatedData", "eligibility"] diff --git a/talon_one/models/ruleset.py b/talon_one/models/ruleset.py index cd52428..cbfad96 100644 --- a/talon_one/models/ruleset.py +++ b/talon_one/models/ruleset.py @@ -30,16 +30,16 @@ class Ruleset(BaseModel): """ Ruleset """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - user_id: StrictInt = Field(description="The ID of the user associated with this entity.", alias="userId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + user_id: StrictInt = Field(description="The ID of the user associated with this entity.", alias="userId", json_schema_extra={"examples": [388]}) rules: List[Rule] = Field(description="Set of rules to apply.") strikethrough_rules: Optional[List[Rule]] = Field(default=None, description="Set of rules to apply for strikethrough.", alias="strikethroughRules") - bindings: List[Binding] = Field(description="An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.") - rb_version: Optional[StrictStr] = Field(default=None, description="The version of the rulebuilder used to create this ruleset.", alias="rbVersion") - activate: Optional[StrictBool] = Field(default=None, description="Indicates whether this created ruleset should be activated for the campaign that owns it.") - campaign_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign that owns this entity.", alias="campaignId") - template_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign template that owns this entity.", alias="templateId") + bindings: List[Binding] = Field(description="An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.", json_schema_extra={"examples": [[]]}) + rb_version: Optional[StrictStr] = Field(default=None, description="The version of the rulebuilder used to create this ruleset.", alias="rbVersion", json_schema_extra={"examples": ["v2"]}) + activate: Optional[StrictBool] = Field(default=None, description="Indicates whether this created ruleset should be activated for the campaign that owns it.", json_schema_extra={"examples": [True]}) + campaign_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign that owns this entity.", alias="campaignId", json_schema_extra={"examples": [320]}) + template_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign template that owns this entity.", alias="templateId", json_schema_extra={"examples": [3]}) activated_at: Optional[datetime] = Field(default=None, description="Timestamp indicating when this Ruleset was activated.", alias="activatedAt") __properties: ClassVar[List[str]] = ["id", "created", "userId", "rules", "strikethroughRules", "bindings", "rbVersion", "activate", "campaignId", "templateId", "activatedAt"] diff --git a/talon_one/models/saml_connection.py b/talon_one/models/saml_connection.py index e612dbc..c4b72a6 100644 --- a/talon_one/models/saml_connection.py +++ b/talon_one/models/saml_connection.py @@ -29,7 +29,7 @@ class SamlConnection(BaseModel): """ SamlConnection """ # noqa: E501 - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3885]}) name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="ID of the SAML service.") enabled: StrictBool = Field(description="Determines if this SAML connection active.") issuer: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Identity Provider Entity ID.") @@ -37,8 +37,8 @@ class SamlConnection(BaseModel): sign_out_url: Optional[StrictStr] = Field(default=None, description="Single Sign-Out URL.", alias="signOutURL") metadata_url: Optional[StrictStr] = Field(default=None, description="Metadata URL.", alias="metadataURL") audience_uri: StrictStr = Field(description="The application-defined unique identifier that is the intended audience of the SAML assertion. This is most often the SP Entity ID of your application. When not specified, the ACS URL will be used. ", alias="audienceURI") - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) assertion_consumer_service_url: StrictStr = Field(description="The location where the SAML assertion is sent with a HTTP POST.", alias="assertionConsumerServiceURL") __properties: ClassVar[List[str]] = ["accountId", "name", "enabled", "issuer", "signOnURL", "signOutURL", "metadataURL", "audienceURI", "id", "created", "assertionConsumerServiceURL"] diff --git a/talon_one/models/saml_login_endpoint.py b/talon_one/models/saml_login_endpoint.py index 8c77f4e..aa8b002 100644 --- a/talon_one/models/saml_login_endpoint.py +++ b/talon_one/models/saml_login_endpoint.py @@ -28,7 +28,7 @@ class SamlLoginEndpoint(BaseModel): """ SamlLoginEndpoint """ # noqa: E501 - id: StrictInt = Field(description="ID of the SAML login endpoint.") + id: StrictInt = Field(description="ID of the SAML login endpoint.", json_schema_extra={"examples": [2]}) name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="ID of the SAML service.") login_url: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The single sign-on URL.", alias="loginURL") __properties: ClassVar[List[str]] = ["id", "name", "loginURL"] diff --git a/talon_one/models/scim_base_group.py b/talon_one/models/scim_base_group.py index d599bd2..ff17ffe 100644 --- a/talon_one/models/scim_base_group.py +++ b/talon_one/models/scim_base_group.py @@ -28,7 +28,7 @@ class ScimBaseGroup(BaseModel): """ Define the schema for base fields in a group using the SCIM provisioning protocol. Talon.One uses this schema to create roles. """ # noqa: E501 - display_name: Optional[StrictStr] = Field(default=None, description="Display name of the group (Talon.One role).", alias="displayName") + display_name: Optional[StrictStr] = Field(default=None, description="Display name of the group (Talon.One role).", alias="displayName", json_schema_extra={"examples": ["Manager"]}) members: Optional[List[ScimGroupMember]] = Field(default=None, description="List of members to assign to the new Talon.One role.") __properties: ClassVar[List[str]] = ["displayName", "members"] diff --git a/talon_one/models/scim_base_user.py b/talon_one/models/scim_base_user.py index c09dd06..e9972bf 100644 --- a/talon_one/models/scim_base_user.py +++ b/talon_one/models/scim_base_user.py @@ -28,9 +28,9 @@ class ScimBaseUser(BaseModel): """ Schema definition for base user fields, provisioned using the SCIM protocol and used by Talon.One. """ # noqa: E501 - active: Optional[StrictBool] = Field(default=None, description="Status of the user.") - display_name: Optional[StrictStr] = Field(default=None, description="Display name of the user.", alias="displayName") - user_name: Optional[StrictStr] = Field(default=None, description="Unique identifier of the user. This is usually an email address.", alias="userName") + active: Optional[StrictBool] = Field(default=None, description="Status of the user.", json_schema_extra={"examples": [True]}) + display_name: Optional[StrictStr] = Field(default=None, description="Display name of the user.", alias="displayName", json_schema_extra={"examples": ["John Doe"]}) + user_name: Optional[StrictStr] = Field(default=None, description="Unique identifier of the user. This is usually an email address.", alias="userName", json_schema_extra={"examples": ["john.doe@example.com"]}) name: Optional[ScimBaseUserName] = None __properties: ClassVar[List[str]] = ["active", "displayName", "userName", "name"] diff --git a/talon_one/models/scim_base_user_name.py b/talon_one/models/scim_base_user_name.py index ae6b887..4826981 100644 --- a/talon_one/models/scim_base_user_name.py +++ b/talon_one/models/scim_base_user_name.py @@ -27,7 +27,7 @@ class ScimBaseUserName(BaseModel): """ The components of the user’s real name. """ # noqa: E501 - formatted: Optional[StrictStr] = Field(default=None, description="The full name, including all middle names, titles, and suffixes as appropriate, formatted for display.") + formatted: Optional[StrictStr] = Field(default=None, description="The full name, including all middle names, titles, and suffixes as appropriate, formatted for display.", json_schema_extra={"examples": ["Mr. John J Doe"]}) __properties: ClassVar[List[str]] = ["formatted"] model_config = ConfigDict( diff --git a/talon_one/models/scim_group.py b/talon_one/models/scim_group.py index f4b407f..537c9b9 100644 --- a/talon_one/models/scim_group.py +++ b/talon_one/models/scim_group.py @@ -28,9 +28,9 @@ class ScimGroup(BaseModel): """ Define the schema for groups created using the SCIM provisioning protocol. In Talon.One, a `Group` corresponds to a [role](https://docs.talon.one/docs/product/account/account-settings/managing-roles), and `members` are the [users](https://docs.talon.one/docs/product/account/account-settings/managing-users) assigned to that role. """ # noqa: E501 - display_name: Optional[StrictStr] = Field(default=None, description="Display name of the group (Talon.One role).", alias="displayName") + display_name: Optional[StrictStr] = Field(default=None, description="Display name of the group (Talon.One role).", alias="displayName", json_schema_extra={"examples": ["Manager"]}) members: Optional[List[ScimGroupMember]] = Field(default=None, description="List of members to assign to the new Talon.One role.") - id: StrictStr = Field(description="ID of the group.") + id: StrictStr = Field(description="ID of the group.", json_schema_extra={"examples": ["359"]}) __properties: ClassVar[List[str]] = ["displayName", "members", "id"] model_config = ConfigDict( diff --git a/talon_one/models/scim_group_member.py b/talon_one/models/scim_group_member.py index 9ced5ec..02a22f3 100644 --- a/talon_one/models/scim_group_member.py +++ b/talon_one/models/scim_group_member.py @@ -27,8 +27,8 @@ class ScimGroupMember(BaseModel): """ Member of the SCIM group. In Talon.One, the member is a [user](https://docs.talon.one/docs/product/account/account-settings/managing-users) assigned to a specific role. """ # noqa: E501 - value: Optional[StrictStr] = Field(default=None, description="Unique identifier of the member.") - display: Optional[StrictStr] = Field(default=None, description="Identifier of the user. This is usually an email address.") + value: Optional[StrictStr] = Field(default=None, description="Unique identifier of the member.", json_schema_extra={"examples": ["258"]}) + display: Optional[StrictStr] = Field(default=None, description="Identifier of the user. This is usually an email address.", json_schema_extra={"examples": ["john.doe@example.com"]}) __properties: ClassVar[List[str]] = ["value", "display"] model_config = ConfigDict( diff --git a/talon_one/models/scim_new_user.py b/talon_one/models/scim_new_user.py index 6f56e30..2998de4 100644 --- a/talon_one/models/scim_new_user.py +++ b/talon_one/models/scim_new_user.py @@ -28,9 +28,9 @@ class ScimNewUser(BaseModel): """ Payload for users that are created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. """ # noqa: E501 - active: Optional[StrictBool] = Field(default=None, description="Status of the user.") - display_name: Optional[StrictStr] = Field(default=None, description="Display name of the user.", alias="displayName") - user_name: StrictStr = Field(description="Unique identifier of the user. This is usually an email address.", alias="userName") + active: Optional[StrictBool] = Field(default=None, description="Status of the user.", json_schema_extra={"examples": [True]}) + display_name: Optional[StrictStr] = Field(default=None, description="Display name of the user.", alias="displayName", json_schema_extra={"examples": ["John Doe"]}) + user_name: StrictStr = Field(description="Unique identifier of the user. This is usually an email address.", alias="userName", json_schema_extra={"examples": ["john.doe@example.com"]}) name: Optional[ScimBaseUserName] = None __properties: ClassVar[List[str]] = ["active", "displayName", "userName", "name"] diff --git a/talon_one/models/scim_service_provider_config_response.py b/talon_one/models/scim_service_provider_config_response.py index 1ebbb45..985fc7c 100644 --- a/talon_one/models/scim_service_provider_config_response.py +++ b/talon_one/models/scim_service_provider_config_response.py @@ -22,8 +22,6 @@ 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 @@ -36,9 +34,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[ScimServiceProviderConfigResponsePatch] = None + patch: Optional[ScimServiceProviderConfigResponseChangePassword] = 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[ScimServiceProviderConfigResponseSort] = None + sort: Optional[ScimServiceProviderConfigResponseChangePassword] = None __properties: ClassVar[List[str]] = ["bulk", "changePassword", "documentationUri", "filter", "patch", "schemas", "sort"] model_config = ConfigDict( @@ -111,9 +109,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": ScimServiceProviderConfigResponsePatch.from_dict(obj["patch"]) if obj.get("patch") is not None else None, + "patch": ScimServiceProviderConfigResponseChangePassword.from_dict(obj["patch"]) if obj.get("patch") is not None else None, "schemas": obj.get("schemas"), - "sort": ScimServiceProviderConfigResponseSort.from_dict(obj["sort"]) if obj.get("sort") is not None else None + "sort": ScimServiceProviderConfigResponseChangePassword.from_dict(obj["sort"]) if obj.get("sort") is not None else None }) return _obj diff --git a/talon_one/models/scim_user.py b/talon_one/models/scim_user.py index b3f0efe..d4409ec 100644 --- a/talon_one/models/scim_user.py +++ b/talon_one/models/scim_user.py @@ -28,11 +28,11 @@ class ScimUser(BaseModel): """ Schema definition for users that have been provisioned using the SCIM protocol with an identity provider, for example, Microsoft Entra ID. """ # noqa: E501 - active: Optional[StrictBool] = Field(default=None, description="Status of the user.") - display_name: Optional[StrictStr] = Field(default=None, description="Display name of the user.", alias="displayName") - user_name: StrictStr = Field(description="Unique identifier of the user. This is usually an email address.", alias="userName") + active: Optional[StrictBool] = Field(default=None, description="Status of the user.", json_schema_extra={"examples": [True]}) + display_name: Optional[StrictStr] = Field(default=None, description="Display name of the user.", alias="displayName", json_schema_extra={"examples": ["John Doe"]}) + user_name: StrictStr = Field(description="Unique identifier of the user. This is usually an email address.", alias="userName", json_schema_extra={"examples": ["john.doe@example.com"]}) name: Optional[ScimBaseUserName] = None - id: StrictStr = Field(description="ID of the user.") + id: StrictStr = Field(description="ID of the user.", json_schema_extra={"examples": ["359"]}) __properties: ClassVar[List[str]] = ["active", "displayName", "userName", "name", "id"] model_config = ConfigDict( diff --git a/talon_one/models/secondary_deployment.py b/talon_one/models/secondary_deployment.py index 597e15f..14644bd 100644 --- a/talon_one/models/secondary_deployment.py +++ b/talon_one/models/secondary_deployment.py @@ -29,14 +29,14 @@ class SecondaryDeployment(BaseModel): """ SecondaryDeployment """ # noqa: E501 - id: StrictInt = Field(description="Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints.") - 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") - user_id: StrictInt = Field(description="The ID of the user who created the deployment.", alias="userId") - status: StrictStr = Field(description="The status of the deployment.") - created_at: datetime = Field(description="Timestamp when the deployment was created.", alias="createdAt") - active_at: Optional[datetime] = Field(default=None, description="Timestamp when the deployment became active.", alias="activeAt") - failed_at: Optional[datetime] = Field(default=None, description="Timestamp when the deployment failed.", alias="failedAt") - deleted_at: Optional[datetime] = Field(default=None, description="Timestamp when the deployment was deleted.", alias="deletedAt") + id: StrictInt = Field(description="Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints.", json_schema_extra={"examples": [6]}) + 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"]}) + user_id: StrictInt = Field(description="The ID of the user who created the deployment.", alias="userId", json_schema_extra={"examples": [4]}) + status: StrictStr = Field(description="The status of the deployment.", json_schema_extra={"examples": ["active"]}) + created_at: datetime = Field(description="Timestamp when the deployment was created.", alias="createdAt", json_schema_extra={"examples": ["2023-01-16T16:00:00.700763Z"]}) + active_at: Optional[datetime] = Field(default=None, description="Timestamp when the deployment became active.", alias="activeAt", json_schema_extra={"examples": ["2023-01-17T16:00:00.700763Z"]}) + failed_at: Optional[datetime] = Field(default=None, description="Timestamp when the deployment failed.", alias="failedAt", json_schema_extra={"examples": ["2023-01-17T16:00:00.700763Z"]}) + 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') diff --git a/talon_one/models/session.py b/talon_one/models/session.py index 2da0dc0..1812db2 100644 --- a/talon_one/models/session.py +++ b/talon_one/models/session.py @@ -28,9 +28,9 @@ class Session(BaseModel): """ Session """ # noqa: E501 - user_id: StrictInt = Field(description="The ID of the user of this session.", alias="userId") - token: StrictStr = Field(description="The token to use as a bearer token to query Management API endpoints.") - created: datetime = Field(description="Unix timestamp indicating when the session was first created.") + user_id: StrictInt = Field(description="The ID of the user of this session.", alias="userId", json_schema_extra={"examples": [109]}) + token: StrictStr = Field(description="The token to use as a bearer token to query Management API endpoints.", json_schema_extra={"examples": ["dy_Fa_lQ4iDAnqldJFvVEmnsN8xDTxej19l0LZDBJhQ"]}) + created: datetime = Field(description="Unix timestamp indicating when the session was first created.", json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) __properties: ClassVar[List[str]] = ["userId", "token", "created"] model_config = ConfigDict( diff --git a/talon_one/models/set_discount_effect_props.py b/talon_one/models/set_discount_effect_props.py index 503c7e2..cd650eb 100644 --- a/talon_one/models/set_discount_effect_props.py +++ b/talon_one/models/set_discount_effect_props.py @@ -25,12 +25,12 @@ class SetDiscountEffectProps(BaseModel): """ - The properties specific to the \"setDiscount\" effect. This gets triggered whenever a validated rule contained a \"set discount\" effect. This is a discount that should be applied on the scope of defined with it. + This effect indicates that a discount should be set on the total shopping cart value of the current order with the given label and amount. The discount should overwrite any existing discount with the same name. The most recent integration state update always returns the latest values for **all** effects, effectively overwriting any previous effects. Enabling [partial discounts](https://docs.talon.one/docs/product/applications/manage-general-settings#partial-discounts) allows a rule that would fail because of insufficient budget to pass. The rule still fails when the budget reaches `0`. Use the `desiredValue` property to identify the original value of the discount. """ # noqa: E501 - name: StrictStr = Field(description="The name / description of this discount") - value: Union[StrictFloat, StrictInt] = Field(description="The total monetary value of the discount.") - scope: Optional[StrictStr] = Field(default=None, description="The scope which the discount was applied on, can be one of (cartItems,additionalCosts,sessionTotal).") - desired_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The original value of the discount.", alias="desiredValue") + name: StrictStr = Field(description="The name or description of this discount.") + value: Union[StrictFloat, StrictInt] = Field(description="The monetary value of the effective discount.") + scope: Optional[StrictStr] = Field(default=None, description="What the discount applies to. Possible values: - `cartItems`: Discount on the price of the items. - `additionalCosts`: Discount on the [additional costs](https://docs.talon.one/docs/product/account/dev-tools/manage-additional-costs) of the items. - `sessionTotal`: Discount on the total value of the customer session. **Note:** [Cascading discounts](https://docs.talon.one/docs/product/applications/manage-general-settings#cascading-discounts) must be enabled for this property to be returned.") + desired_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="_(Partial discounts enabled only)_ The monetary value of the discount to be applied without considering budget limitations.", alias="desiredValue") __properties: ClassVar[List[str]] = ["name", "value", "scope", "desiredValue"] model_config = ConfigDict( diff --git a/talon_one/models/set_discount_per_additional_cost_effect_props.py b/talon_one/models/set_discount_per_additional_cost_effect_props.py index 3e19d44..d420d94 100644 --- a/talon_one/models/set_discount_per_additional_cost_effect_props.py +++ b/talon_one/models/set_discount_per_additional_cost_effect_props.py @@ -25,13 +25,13 @@ class SetDiscountPerAdditionalCostEffectProps(BaseModel): """ - The properties specific to the \"setDiscountPerAdditionalCost\" effect. This gets triggered whenever a validated rule contained a \"set per additional cost discount\" effect. This is a discount that should be applied on a specific additional cost. + This effect indicates that a discount that should be applied on a specific additional cost. It is triggered whenever a rule containing a **Discount additional cost** effect is validated. Enabling [partial rewards](https://docs.talon.one/docs/product/applications/manage-general-settings#partial-rewards) allows a rule that would fail because of insufficient budget to pass. The rule still fails when the budget reaches 0. Use the `desiredValue` property to identify the original amount of loyalty points. """ # noqa: E501 - name: StrictStr = Field(description="The name / description of this discount") - additional_cost_id: StrictInt = Field(description="The ID of the additional cost.", alias="additionalCostId") - additional_cost: StrictStr = Field(description="The name of the additional cost.", alias="additionalCost") - value: Union[StrictFloat, StrictInt] = Field(description="The total monetary value of the discount.") - desired_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The original value of the discount.", alias="desiredValue") + name: StrictStr = Field(description="The name of the discount.") + additional_cost_id: StrictInt = Field(description="The identifier of the additional cost.", alias="additionalCostId") + additional_cost: StrictStr = Field(description="The API name of the additional cost.", alias="additionalCost") + value: Union[StrictFloat, StrictInt] = Field(description="The monetary value of the discount to apply.") + desired_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="_(Partial discounts enabled only)_ The monetary value of the discount to be applied without considering budget limitations.", alias="desiredValue") __properties: ClassVar[List[str]] = ["name", "additionalCostId", "additionalCost", "value", "desiredValue"] model_config = ConfigDict( diff --git a/talon_one/models/set_discount_per_additional_cost_per_item_effect_props.py b/talon_one/models/set_discount_per_additional_cost_per_item_effect_props.py index d26966f..bf17aa9 100644 --- a/talon_one/models/set_discount_per_additional_cost_per_item_effect_props.py +++ b/talon_one/models/set_discount_per_additional_cost_per_item_effect_props.py @@ -25,15 +25,15 @@ class SetDiscountPerAdditionalCostPerItemEffectProps(BaseModel): """ - The properties specific to the \"setDiscountPerAdditionalCostPerItem\" effect. This gets triggered whenever a validated rule contained a \"set discount per additional cost per item\" effect. This is a discount that should be applied on a specific additional cost in a specific item. + This effect indicates that a discount of a specific additional cost within a specific item should be applied. It gets triggered whenever a rule containing a **Discount additional cost per item** effect is validated. Use this effect when **all** items in the cart have an additional cost. If one of more items do not have an additional cost, the rule will fail. """ # noqa: E501 - name: StrictStr = Field(description="The name / description of this discount") - additional_cost_id: StrictInt = Field(description="The ID of the additional cost.", alias="additionalCostId") - value: Union[StrictFloat, StrictInt] = Field(description="The total monetary value of the discount.") - position: Union[StrictFloat, StrictInt] = Field(description="The index of the item in the cart item list containing the additional cost to be discounted.") - sub_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="For cart items with `quantity` > 1, the sub position indicates which item the discount applies to. ", alias="subPosition") - additional_cost: StrictStr = Field(description="The name of the additional cost.", alias="additionalCost") - desired_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Only with [partial discounts enabled](https://docs.talon.one/docs/product/campaigns/campaign-evaluation/#partial-discounts). Represents the monetary value of the discount to be applied to additional discount without considering budget limitations. ", alias="desiredValue") + name: StrictStr = Field(description="The description of this discount. `#number` is appended to the name. It is equal to the `position` property.") + additional_cost_id: StrictInt = Field(description="The identifier of the additional cost to be discounted.", alias="additionalCostId") + value: Union[StrictFloat, StrictInt] = Field(description="The monetary value of the effective discount applied to the item's additional cost.") + position: Union[StrictFloat, StrictInt] = Field(description="The index of the item in the `cartItem` object containing the additional cost that this discount applies to.") + sub_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The index of the item unit in its line item.", alias="subPosition") + additional_cost: StrictStr = Field(description="The API name of the additional cost to be discounted.", alias="additionalCost") + desired_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="_[(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.", alias="desiredValue") __properties: ClassVar[List[str]] = ["name", "additionalCostId", "value", "position", "subPosition", "additionalCost", "desiredValue"] model_config = ConfigDict( diff --git a/talon_one/models/set_discount_per_item_effect_props.py b/talon_one/models/set_discount_per_item_effect_props.py index 7038a08..c82c05a 100644 --- a/talon_one/models/set_discount_per_item_effect_props.py +++ b/talon_one/models/set_discount_per_item_effect_props.py @@ -25,20 +25,20 @@ class SetDiscountPerItemEffectProps(BaseModel): """ - The properties specific to the `setDiscountPerItem` effect, triggered whenever a validated rule contained a \"set per item discount\" effect. This is a discount that will be applied either on a specific item, on a specific item + additional cost or on all additional costs per item. This depends on the chosen scope. + This effect schema is returned when you use the **Discount individual items**, **Discount individual items pro rata**, or **Discount individual item in bundles** effect in a rule. It indicates that a discount per item should be applied on the specific item specified in the effect. The properties it contains depends on: - Whether you used a pro rata effect or not. - Whether you used an effect with bundles or not. - Whether the partial discount feature is enabled. """ # noqa: E501 - name: StrictStr = Field(description="The name of the discount. Contains a hashtag character indicating the index of the position of the item the discount applies to. It is identical to the value of the `position` property. ") - value: Union[StrictFloat, StrictInt] = Field(description="The total monetary value of the discount.") - position: Union[StrictFloat, StrictInt] = Field(description="The index of the item in the cart items list on which this discount should be applied.") - sub_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="For cart items with `quantity` > 1, the sub position indicates which item the discount applies to. ", alias="subPosition") - desired_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The original value of the discount.", alias="desiredValue") - scope: Optional[StrictStr] = Field(default=None, description="The scope of the discount: - `additionalCosts`: The discount applies to all the additional costs of the item. - `itemTotal`: The discount applies to the price of the item + the additional costs of the item. - `price`: The discount applies to the price of the item. ") - total_discount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total discount given if this effect is a result of a prorated discount.", alias="totalDiscount") - desired_total_discount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The original total discount to give if this effect is a result of a prorated discount.", alias="desiredTotalDiscount") - bundle_index: Optional[StrictInt] = Field(default=None, description="The position of the bundle in a list of item bundles created from the same bundle definition.", alias="bundleIndex") - bundle_name: Optional[StrictStr] = Field(default=None, description="The name of the bundle definition.", alias="bundleName") - targeted_item_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The index of the targeted bundle item on which the applied discount is based.", alias="targetedItemPosition") - targeted_item_sub_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The sub-position of the targeted bundle item on which the applied discount is based. ", alias="targetedItemSubPosition") + name: StrictStr = Field(description="The description of this discount. `#number` is equal to the `position` property.") + value: Union[StrictFloat, StrictInt] = Field(description="The monetary value of the effective discount applied to the item.") + position: Union[StrictFloat, StrictInt] = Field(description="The index of the item in the `cartItem` object on which this discount should be applied.") + sub_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The index of the item unit in its line item.", alias="subPosition") + desired_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="_(Partial discounts enabled only)_ The monetary value of the discount to be applied to the item without considering budget limitations.", alias="desiredValue") + scope: Optional[StrictStr] = Field(default=None, description="What the discount applies to. Possible values: - `price`: discount on the price of the item. - `additionalCosts`: discount on the [additional cost](https://docs.talon.one/docs/product/account/dev-tools/manage-additional-costs) of the item. - `itemTotal`: discount on the sum of price + additional cost of the item.") + total_discount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="_(Pro rata discounts only)_ The monetary value of the total effective discount", alias="totalDiscount") + desired_total_discount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="_(Pro rata discounts only)_ The monetary value of the total discount to be applied without considering budget limitations", alias="desiredTotalDiscount") + bundle_index: Optional[StrictInt] = Field(default=None, description="_(Discounts with bundles only)_ The position of the specific item bundle in the list of bundles created from the same bundle definition.", alias="bundleIndex") + bundle_name: Optional[StrictStr] = Field(default=None, description="_(Discounts with bundles only)_ The name of the bundle definition.", alias="bundleName") + targeted_item_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="_(Discounting individual item in bundles only)_ The index of the targeted bundle item on which the applied discount is based.", alias="targetedItemPosition") + targeted_item_sub_position: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="_(Discounting individual item in bundles only)_ The sub-position of the targeted bundle item on which the applied discount is based.", alias="targetedItemSubPosition") excluded_from_price_history: Optional[StrictBool] = Field(default=None, description="When set to `true`, the applied discount is excluded from the item's price history.", alias="excludedFromPriceHistory") __properties: ClassVar[List[str]] = ["name", "value", "position", "subPosition", "desiredValue", "scope", "totalDiscount", "desiredTotalDiscount", "bundleIndex", "bundleName", "targetedItemPosition", "targetedItemSubPosition", "excludedFromPriceHistory"] diff --git a/talon_one/models/set_loyalty_points_expiry_date_effect_props.py b/talon_one/models/set_loyalty_points_expiry_date_effect_props.py index d5d1276..7534cec 100644 --- a/talon_one/models/set_loyalty_points_expiry_date_effect_props.py +++ b/talon_one/models/set_loyalty_points_expiry_date_effect_props.py @@ -27,11 +27,11 @@ class SetLoyaltyPointsExpiryDateEffectProps(BaseModel): """ - The properties specific to the \"setLoyaltyPointsExpiryDate\" effect. This gets triggered when a validated rule contains the \"set expiry date\" effect. The current expiry date gets set to the date given in the effect. + This effect updates the expiry date of all active, pending, and unlimited point transactions to a specific date. """ # noqa: E501 program_id: StrictInt = Field(description="ID of the loyalty program that contains these points.", alias="programId") sub_ledger_id: StrictStr = Field(description="API name of the loyalty program subledger that contains these points.", alias="subLedgerId") - new_expiry_date: datetime = Field(description="The specified expiry date and time for all active and pending point transactions in the loyalty program subledger.", alias="newExpiryDate") + new_expiry_date: datetime = Field(description="The specified expiry date and time for all active and pending point transactions in the loyalty program subledger.", alias="newExpiryDate", json_schema_extra={"examples": ["2024-07-24T14:15:22Z"]}) affected_transactions: Optional[List[LoyaltyLedgerEntryExpiryDateChange]] = Field(default=None, description="List of transactions affected by the expiry date update.", alias="affectedTransactions") __properties: ClassVar[List[str]] = ["programId", "subLedgerId", "newExpiryDate", "affectedTransactions"] diff --git a/talon_one/models/show_bundle_metadata_effect_props.py b/talon_one/models/show_bundle_metadata_effect_props.py index 900892c..320e28d 100644 --- a/talon_one/models/show_bundle_metadata_effect_props.py +++ b/talon_one/models/show_bundle_metadata_effect_props.py @@ -25,7 +25,7 @@ class ShowBundleMetadataEffectProps(BaseModel): """ - This effect is **deprecated**. The properties specific to the \"ShowBundleMetadata\" effect. This effect contains information that allows you to associate the discounts from a rule in a bundle campaign with specific cart items. This way you can distinguish from \"normal\" discounts that were not the result of a product bundle. + This effect is **deprecated**. The `ShowBundleMetadata` effect contains information that allows you to associate the discounts from a rule in a bundle campaign with specific cart items. This way you can distinguish from \"normal\" discounts that were not the result of a product bundle. """ # noqa: E501 description: StrictStr = Field(description="Description of the product bundle.") bundle_attributes: List[StrictStr] = Field(description="The cart item attributes that determined which items are being bundled together.", alias="bundleAttributes") diff --git a/talon_one/models/show_notification_effect_props.py b/talon_one/models/show_notification_effect_props.py index 190073c..65a9725 100644 --- a/talon_one/models/show_notification_effect_props.py +++ b/talon_one/models/show_notification_effect_props.py @@ -25,11 +25,11 @@ class ShowNotificationEffectProps(BaseModel): """ - The properties specific to the \"showNotification\" effect. This gets triggered whenever a validated rule contained a \"show notification\" effect. + You can use notifications to inform customers of certain events. There are four types of notification messages: - `Info` - `Offer` - `Error` - `Misc` It is up to you to use the Rule Builder to decide why and when to show notifications. Notifications can be used as both rule effects and failure effects. A common use case is to display the notification at the top of the cart view in your web app. You can use the notification type to vary the styling of the notification message. """ # noqa: E501 - notification_type: StrictStr = Field(description="The type of notification that should be shown (e.g. error/warning/info).", alias="notificationType") - title: StrictStr = Field(description="Title of the notification.") - body: StrictStr = Field(description="Body of the notification.") + notification_type: StrictStr = Field(description="The type of notification.", alias="notificationType") + title: StrictStr = Field(description="The title of the notification.") + body: StrictStr = Field(description="The body of the notification.") __properties: ClassVar[List[str]] = ["notificationType", "title", "body"] model_config = ConfigDict( diff --git a/talon_one/models/sku_unit_analytics_data_point.py b/talon_one/models/sku_unit_analytics_data_point.py index d9ca2cc..d433eaf 100644 --- a/talon_one/models/sku_unit_analytics_data_point.py +++ b/talon_one/models/sku_unit_analytics_data_point.py @@ -29,10 +29,10 @@ class SkuUnitAnalyticsDataPoint(BaseModel): """ SkuUnitAnalyticsDataPoint """ # noqa: E501 - start_time: datetime = Field(description="The start of the aggregation time frame in UTC.", alias="startTime") - end_time: datetime = Field(description="The end of the aggregation time frame in UTC.", alias="endTime") + start_time: datetime = Field(description="The start of the aggregation time frame in UTC.", alias="startTime", json_schema_extra={"examples": ["2024-02-01T00:00:00Z"]}) + end_time: datetime = Field(description="The end of the aggregation time frame in UTC.", alias="endTime", json_schema_extra={"examples": ["2024-02-01T23:59:99Z"]}) units_sold: AnalyticsDataPointWithTrend = Field(description="The number of times the product or SKU was purchased.", alias="unitsSold") - sku: StrictStr = Field(description="The SKU linked to the application.") + sku: StrictStr = Field(description="The SKU linked to the application.", json_schema_extra={"examples": ["SKU-123"]}) __properties: ClassVar[List[str]] = ["startTime", "endTime", "unitsSold", "sku"] model_config = ConfigDict( diff --git a/talon_one/models/sso_config.py b/talon_one/models/sso_config.py index 458e278..26fa261 100644 --- a/talon_one/models/sso_config.py +++ b/talon_one/models/sso_config.py @@ -27,8 +27,8 @@ class SSOConfig(BaseModel): """ SSOConfig """ # noqa: E501 - enforced: StrictBool = Field(description="An indication of whether single sign-on is enforced for the account. When enforced, users cannot use their email and password to sign in to Talon.One. It is not possible to change this to `false` after it is set to `true`. ") - new_acs_url: Optional[StrictStr] = Field(default=None, description="Assertion Consumer Service (ACS) URL for setting up a new SAML connection with an identity provider like Okta or Microsoft Entra ID. ", alias="newAcsUrl") + enforced: StrictBool = Field(description="An indication of whether single sign-on is enforced for the account. When enforced, users cannot use their email and password to sign in to Talon.One. It is not possible to change this to `false` after it is set to `true`. ", json_schema_extra={"examples": [True]}) + new_acs_url: Optional[StrictStr] = Field(default=None, description="Assertion Consumer Service (ACS) URL for setting up a new SAML connection with an identity provider like Okta or Microsoft Entra ID. ", alias="newAcsUrl", json_schema_extra={"examples": ["https://yourdeployment.talon.one/v1/saml_connections/5/saml_callback"]}) __properties: ClassVar[List[str]] = ["enforced", "newAcsUrl"] model_config = ConfigDict( diff --git a/talon_one/models/store.py b/talon_one/models/store.py index 7901e53..8688710 100644 --- a/talon_one/models/store.py +++ b/talon_one/models/store.py @@ -29,15 +29,15 @@ class Store(BaseModel): """ Store """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(description="The name of the store.") - description: StrictStr = Field(description="The description of the store.") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="The attributes of the store.") - integration_id: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The integration ID of the store. You choose this ID when you create a store. **Note**: You cannot edit the `integrationId` after the store has been created. ", alias="integrationId") - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") - updated: datetime = Field(description="Timestamp of the most recent update on this entity.") - linked_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of IDs of the campaigns that are linked with current store.", alias="linkedCampaignIds") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-02-07T08:15:22Z"]}) + name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(description="The name of the store.", json_schema_extra={"examples": ["South US store"]}) + description: StrictStr = Field(description="The description of the store.", json_schema_extra={"examples": ["This is the description of the store in south US."]}) + attributes: Optional[Dict[str, Any]] = Field(default=None, description="The attributes of the store.", json_schema_extra={"examples": [{"country": "USA", "code": 1234}]}) + integration_id: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The integration ID of the store. You choose this ID when you create a store. **Note**: You cannot edit the `integrationId` after the store has been created. ", alias="integrationId", json_schema_extra={"examples": ["STORE-001"]}) + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) + updated: datetime = Field(description="Timestamp of the most recent update on this entity.", json_schema_extra={"examples": ["2021-09-23T10:12:42Z"]}) + linked_campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of IDs of the campaigns that are linked with current store.", alias="linkedCampaignIds", json_schema_extra={"examples": [[4, 6, 8]]}) __properties: ClassVar[List[str]] = ["id", "created", "name", "description", "attributes", "integrationId", "applicationId", "updated", "linkedCampaignIds"] model_config = ConfigDict( diff --git a/talon_one/models/strikethrough_changed_item.py b/talon_one/models/strikethrough_changed_item.py index 2e4ce33..ff9236f 100644 --- a/talon_one/models/strikethrough_changed_item.py +++ b/talon_one/models/strikethrough_changed_item.py @@ -31,13 +31,13 @@ class StrikethroughChangedItem(BaseModel): """ The information of affected items. """ # noqa: E501 - id: StrictInt = Field(description="The ID of the event that triggered the strikethrough labeling.") - catalog_id: StrictInt = Field(description="The ID of the catalog that the changed item belongs to.", alias="catalogId") - sku: StrictStr = Field(description="The unique SKU of the changed item.") - version: Annotated[int, Field(strict=True, ge=1)] = Field(description="The version of the changed item.") - price: Union[StrictFloat, StrictInt] = Field(description="The price of the changed item.") - prices: Optional[Dict[str, PriceDetail]] = Field(default=None, description="A map of keys and values representing the price types and related price adjustment details for this cart item. The keys correspond to the `priceType` names. ") - evaluated_at: datetime = Field(description="The evaluation time of the changed item.", alias="evaluatedAt") + id: StrictInt = Field(description="The ID of the event that triggered the strikethrough labeling.", json_schema_extra={"examples": [1]}) + catalog_id: StrictInt = Field(description="The ID of the catalog that the changed item belongs to.", alias="catalogId", json_schema_extra={"examples": [10]}) + sku: StrictStr = Field(description="The unique SKU of the changed item.", json_schema_extra={"examples": ["SKU1241028"]}) + version: Annotated[int, Field(strict=True, ge=1)] = Field(description="The version of the changed item.", json_schema_extra={"examples": [6]}) + price: Union[StrictFloat, StrictInt] = Field(description="The price of the changed item.", json_schema_extra={"examples": [100]}) + prices: Optional[Dict[str, PriceDetail]] = Field(default=None, description="A map of keys and values representing the price types and related price adjustment details for this cart item. The keys correspond to the `priceType` names. ", json_schema_extra={"examples": [{"member": {"price": 90, "adjustmentReferenceId": "68851723-e6fa-488f-ace9-112581e6c19b", "adjustmentEffectiveFrom": "2025-05-25T00:00:00Z", "adjustmentEffectiveUntil": "2025-05-30T00:00:00Z"}, "base": {"price": 100}}]}) + evaluated_at: datetime = Field(description="The evaluation time of the changed item.", alias="evaluatedAt", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) effects: Optional[List[StrikethroughEffect]] = None __properties: ClassVar[List[str]] = ["id", "catalogId", "sku", "version", "price", "prices", "evaluatedAt", "effects"] diff --git a/talon_one/models/strikethrough_custom_effect_per_item_props.py b/talon_one/models/strikethrough_custom_effect_per_item_props.py index 54e9422..f1ec35e 100644 --- a/talon_one/models/strikethrough_custom_effect_per_item_props.py +++ b/talon_one/models/strikethrough_custom_effect_per_item_props.py @@ -27,8 +27,8 @@ class StrikethroughCustomEffectPerItemProps(BaseModel): """ customEffectPerItem effect in strikethrough pricing payload. """ # noqa: E501 - effect_id: StrictInt = Field(description="ID of the effect.", alias="effectId") - name: StrictStr = Field(description="The type of the custom effect.") + effect_id: StrictInt = Field(description="ID of the effect.", alias="effectId", json_schema_extra={"examples": [1]}) + name: StrictStr = Field(description="The type of the custom effect.", json_schema_extra={"examples": ["my_custom_effect"]}) payload: Dict[str, Any] = Field(description="The JSON payload of the custom effect.") __properties: ClassVar[List[str]] = ["effectId", "name", "payload"] diff --git a/talon_one/models/strikethrough_effect.py b/talon_one/models/strikethrough_effect.py index b19978d..cf186dd 100644 --- a/talon_one/models/strikethrough_effect.py +++ b/talon_one/models/strikethrough_effect.py @@ -28,17 +28,17 @@ class StrikethroughEffect(BaseModel): """ The effect produced for the catalog item. """ # noqa: E501 - campaign_id: StrictInt = Field(description="The ID of the campaign that effect belongs to.", alias="campaignId") - ruleset_id: StrictInt = Field(description="The ID of the ruleset containing the rule that triggered this effect.", alias="rulesetId") - rule_index: StrictInt = Field(description="The position of the rule that triggered this effect within the ruleset.", alias="ruleIndex") - rule_name: StrictStr = Field(description="The name of the rule that triggered this effect.", alias="ruleName") - type: StrictStr = Field(description="The type of this effect.") + campaign_id: StrictInt = Field(description="The ID of the campaign that effect belongs to.", alias="campaignId", json_schema_extra={"examples": [3]}) + ruleset_id: StrictInt = Field(description="The ID of the ruleset containing the rule that triggered this effect.", alias="rulesetId", json_schema_extra={"examples": [11]}) + 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.") - start_time: Optional[datetime] = Field(default=None, description="The start of the time frame where the effect is active in UTC.", alias="startTime") - end_time: Optional[datetime] = Field(default=None, description="The end of the time frame where the effect is active in UTC.", alias="endTime") - 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") - 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") - adjustment_reference_id: Optional[StrictStr] = Field(default=None, description="The reference identifier of the selected price adjustment for this cart item.", alias="adjustmentReferenceId") + 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.") __properties: ClassVar[List[str]] = ["campaignId", "rulesetId", "ruleIndex", "ruleName", "type", "props", "startTime", "endTime", "selectedPriceType", "selectedPrice", "adjustmentReferenceId", "targets"] diff --git a/talon_one/models/strikethrough_labeling_notification.py b/talon_one/models/strikethrough_labeling_notification.py index defa4ee..8b001b7 100644 --- a/talon_one/models/strikethrough_labeling_notification.py +++ b/talon_one/models/strikethrough_labeling_notification.py @@ -31,10 +31,10 @@ class StrikethroughLabelingNotification(BaseModel): The strikethrough labels notification for an application. """ # noqa: E501 version: Optional[StrictStr] = Field(default=None, description="The version of the strikethrough pricing notification. Set for **scheduled** strikethrough pricing updates only. ") - valid_from: Optional[datetime] = Field(default=None, description="Timestamp at which the strikethrough pricing update becomes valid. Set for **scheduled** strikethrough pricing updates (version: v2) only. ", alias="validFrom") - application_id: StrictInt = Field(description="The ID of the Application to which the catalog items labels belongs.", alias="applicationId") - current_batch: StrictInt = Field(description="The batch number of the notification. Notifications might be sent in different batches.", alias="currentBatch") - total_batches: StrictInt = Field(description="The total number of batches for the notification.", alias="totalBatches") + valid_from: Optional[datetime] = Field(default=None, description="Timestamp at which the strikethrough pricing update becomes valid. Set for **scheduled** strikethrough pricing updates (version: v2) only. ", alias="validFrom", json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) + application_id: StrictInt = Field(description="The ID of the Application to which the catalog items labels belongs.", alias="applicationId", json_schema_extra={"examples": [322]}) + current_batch: StrictInt = Field(description="The batch number of the notification. Notifications might be sent in different batches.", alias="currentBatch", json_schema_extra={"examples": [1]}) + total_batches: StrictInt = Field(description="The total number of batches for the notification.", alias="totalBatches", json_schema_extra={"examples": [10]}) trigger: StrikethroughTrigger changed_items: List[StrikethroughChangedItem] = Field(alias="changedItems") notification_type: StrictStr = Field(description="The type of notification.", alias="NotificationType") diff --git a/talon_one/models/strikethrough_set_discount_per_item_effect_props.py b/talon_one/models/strikethrough_set_discount_per_item_effect_props.py index d0deb68..4ff6907 100644 --- a/talon_one/models/strikethrough_set_discount_per_item_effect_props.py +++ b/talon_one/models/strikethrough_set_discount_per_item_effect_props.py @@ -27,7 +27,7 @@ class StrikethroughSetDiscountPerItemEffectProps(BaseModel): """ setDiscountPerItem effect in strikethrough pricing payload. """ # noqa: E501 - name: StrictStr = Field(description="The effect name.") + name: StrictStr = Field(description="The effect name.", json_schema_extra={"examples": ["1EuroOff"]}) value: Optional[Any] excluded_from_price_history: Optional[StrictBool] = Field(default=None, description="When set to `true`, the applied discount is excluded from the item's price history.", alias="excludedFromPriceHistory") __properties: ClassVar[List[str]] = ["name", "value", "excludedFromPriceHistory"] diff --git a/talon_one/models/strikethrough_set_discount_per_item_member_effect_props.py b/talon_one/models/strikethrough_set_discount_per_item_member_effect_props.py index d36c6eb..8429861 100644 --- a/talon_one/models/strikethrough_set_discount_per_item_member_effect_props.py +++ b/talon_one/models/strikethrough_set_discount_per_item_member_effect_props.py @@ -27,7 +27,7 @@ class StrikethroughSetDiscountPerItemMemberEffectProps(BaseModel): """ setDiscountPerItem member effect in strikethrough pricing payload. """ # noqa: E501 - name: StrictStr = Field(description="The effect name.") + name: StrictStr = Field(description="The effect name.", json_schema_extra={"examples": ["10% off members only"]}) value: Optional[Any] __properties: ClassVar[List[str]] = ["name", "value"] diff --git a/talon_one/models/strikethrough_trigger.py b/talon_one/models/strikethrough_trigger.py index 38748e9..fe75ac2 100644 --- a/talon_one/models/strikethrough_trigger.py +++ b/talon_one/models/strikethrough_trigger.py @@ -28,11 +28,11 @@ class StrikethroughTrigger(BaseModel): """ Information about the event that triggered the strikethrough labeling. """ # noqa: E501 - id: StrictInt = Field(description="The ID of the event that triggered the strikethrough labeling.") - type: StrictStr = Field(description="The type of event that triggered the strikethrough labeling.") - triggered_at: datetime = Field(description="The creation time of the event that triggered the strikethrough labeling.", alias="triggeredAt") - total_affected_items: StrictInt = Field(description="The total number of items affected by the event that triggered the strikethrough labeling.", alias="totalAffectedItems") - payload: Dict[str, Any] = Field(description="The arbitrary properties associated with this trigger type.") + id: StrictInt = Field(description="The ID of the event that triggered the strikethrough labeling.", json_schema_extra={"examples": [1]}) + type: StrictStr = Field(description="The type of event that triggered the strikethrough labeling.", json_schema_extra={"examples": ["CATALOG_SYNC"]}) + triggered_at: datetime = Field(description="The creation time of the event that triggered the strikethrough labeling.", alias="triggeredAt", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + total_affected_items: StrictInt = Field(description="The total number of items affected by the event that triggered the strikethrough labeling.", alias="totalAffectedItems", json_schema_extra={"examples": [1500]}) + payload: Dict[str, Any] = Field(description="The arbitrary properties associated with this trigger type.", json_schema_extra={"examples": [{"catalogId": 2, "catalogVersion": 100}]}) __properties: ClassVar[List[str]] = ["id", "type", "triggeredAt", "totalAffectedItems", "payload"] model_config = ConfigDict( diff --git a/talon_one/models/support_request.py b/talon_one/models/support_request.py index c589bf0..243d33c 100644 --- a/talon_one/models/support_request.py +++ b/talon_one/models/support_request.py @@ -29,21 +29,21 @@ class SupportRequest(BaseModel): """ Summary of a support request created by a customer support agent. """ # noqa: E501 - id: StrictInt = Field(description="Identifier of the support request.") - application_id: StrictInt = Field(description="Identifier of the Application connected to the loyalty program or the campaign. It is displayed in your Talon.One deployment URL.", alias="applicationId") - campaign_id: Optional[StrictInt] = Field(default=None, description="Identifier of the campaign where the coupon or gift card is created.", alias="campaignId") - loyalty_program_id: Optional[StrictInt] = Field(default=None, description="Identifier of the loyalty program where the points are added or deducted.", alias="loyaltyProgramId") - subledger_id: Optional[StrictInt] = Field(default=None, description="Identifier of the subledger the points are added to or deducted from. If there is no existing subledger with this ID, the subledger is created automatically.", alias="subledgerId") - created_by_user: StrictStr = Field(description="Email address of the customer support agent who created the support request.", alias="createdByUser") - created_at: datetime = Field(description="Timestamp when the request was made.", alias="createdAt") - customer_profile_id: StrictStr = Field(description="Integration ID of the customer profile linked to the support request.", alias="customerProfileId") - request_type: StrictStr = Field(description="Type of reward requested, including gift cards, personal coupons, and loyalty point additions or deductions.", alias="requestType") - request_value: Optional[Union[Annotated[float, Field(strict=True, gt=0)], Annotated[int, Field(strict=True, gt=0)]]] = Field(default=None, description="Requested monetary balance of the gift card or the number of loyalty points to be added or deducted.", alias="requestValue") - request_note: StrictStr = Field(description="Notes attached to the support request.", alias="requestNote") - request_status: StrictStr = Field(description="Current status of the support request.", alias="requestStatus") - processed_at: Optional[datetime] = Field(default=None, description="Timestamp when the request was approved or rejected.", alias="processedAt") - processing_note: Optional[StrictStr] = Field(default=None, description="Notes attached by the admin when rejecting or approving a request.", alias="processingNote") - processed_by_user: Optional[StrictStr] = Field(default=None, description="Email address of the admin who approved or rejected the support request.", alias="processedByUser") + id: StrictInt = Field(description="Identifier of the support request.", json_schema_extra={"examples": [1]}) + application_id: StrictInt = Field(description="Identifier of the Application connected to the loyalty program or the campaign. It is displayed in your Talon.One deployment URL.", alias="applicationId", json_schema_extra={"examples": [322]}) + campaign_id: Optional[StrictInt] = Field(default=None, description="Identifier of the campaign where the coupon or gift card is created.", alias="campaignId", json_schema_extra={"examples": [100]}) + loyalty_program_id: Optional[StrictInt] = Field(default=None, description="Identifier of the loyalty program where the points are added or deducted.", alias="loyaltyProgramId", json_schema_extra={"examples": [8]}) + subledger_id: Optional[StrictInt] = Field(default=None, description="Identifier of the subledger the points are added to or deducted from. If there is no existing subledger with this ID, the subledger is created automatically.", alias="subledgerId", json_schema_extra={"examples": [123]}) + created_by_user: StrictStr = Field(description="Email address of the customer support agent who created the support request.", alias="createdByUser", json_schema_extra={"examples": ["support.agent.name@company.com"]}) + created_at: datetime = Field(description="Timestamp when the request was made.", alias="createdAt", json_schema_extra={"examples": ["2025-07-20T22:00:00Z"]}) + customer_profile_id: StrictStr = Field(description="Integration ID of the customer profile linked to the support request.", alias="customerProfileId", json_schema_extra={"examples": ["URNGV8294NV"]}) + request_type: StrictStr = Field(description="Type of reward requested, including gift cards, personal coupons, and loyalty point additions or deductions.", alias="requestType", json_schema_extra={"examples": ["personal_coupon"]}) + request_value: Optional[Union[Annotated[float, Field(strict=True, gt=0)], Annotated[int, Field(strict=True, gt=0)]]] = Field(default=None, description="Requested monetary balance of the gift card or the number of loyalty points to be added or deducted.", alias="requestValue", json_schema_extra={"examples": [20.5]}) + request_note: StrictStr = Field(description="Notes attached to the support request.", alias="requestNote", json_schema_extra={"examples": ["Support request for coupon failure."]}) + request_status: StrictStr = Field(description="Current status of the support request.", alias="requestStatus", json_schema_extra={"examples": ["approved"]}) + 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"] @field_validator('request_type') diff --git a/talon_one/models/support_request_input.py b/talon_one/models/support_request_input.py index 458e728..b62ef4d 100644 --- a/talon_one/models/support_request_input.py +++ b/talon_one/models/support_request_input.py @@ -28,14 +28,14 @@ class SupportRequestInput(BaseModel): """ SupportRequestInput """ # noqa: E501 - application_id: StrictInt = Field(description="Identifier of the Application connected to the loyalty program or the campaign. It is displayed in your Talon.One deployment URL.", alias="applicationId") - campaign_id: Optional[StrictInt] = Field(default=None, description="Identifier of the campaign where the coupon or gift card is created.", alias="campaignId") - loyalty_program_id: Optional[StrictInt] = Field(default=None, description="Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.", alias="loyaltyProgramId") - subledger_id: Optional[StrictInt] = Field(default=None, description="Identifier of the subledger the points are added to or deducted from. If there is no existing subledger with this ID, the subledger is created automatically.", alias="subledgerId") - customer_profile_id: StrictStr = Field(description="Integration ID of the customer profile linked to the support request.", alias="customerProfileId") - request_type: StrictStr = Field(description="Type of reward requested, including gift cards, personal coupons, and loyalty point additions or deductions.", alias="requestType") - request_value: Optional[Union[Annotated[float, Field(strict=True, gt=0)], Annotated[int, Field(strict=True, gt=0)]]] = Field(default=None, description="Requested monetary balance of the gift card or the number of loyalty points to be added or deducted.", alias="requestValue") - request_note: StrictStr = Field(description="Notes attached to the support request.", alias="requestNote") + application_id: StrictInt = Field(description="Identifier of the Application connected to the loyalty program or the campaign. It is displayed in your Talon.One deployment URL.", alias="applicationId", json_schema_extra={"examples": [322]}) + campaign_id: Optional[StrictInt] = Field(default=None, description="Identifier of the campaign where the coupon or gift card is created.", alias="campaignId", json_schema_extra={"examples": [100]}) + loyalty_program_id: Optional[StrictInt] = Field(default=None, description="Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.", alias="loyaltyProgramId", json_schema_extra={"examples": [8]}) + subledger_id: Optional[StrictInt] = Field(default=None, description="Identifier of the subledger the points are added to or deducted from. If there is no existing subledger with this ID, the subledger is created automatically.", alias="subledgerId", json_schema_extra={"examples": [123]}) + customer_profile_id: StrictStr = Field(description="Integration ID of the customer profile linked to the support request.", alias="customerProfileId", json_schema_extra={"examples": ["URNGV8294NV"]}) + request_type: StrictStr = Field(description="Type of reward requested, including gift cards, personal coupons, and loyalty point additions or deductions.", alias="requestType", json_schema_extra={"examples": ["personal_coupon"]}) + request_value: Optional[Union[Annotated[float, Field(strict=True, gt=0)], Annotated[int, Field(strict=True, gt=0)]]] = Field(default=None, description="Requested monetary balance of the gift card or the number of loyalty points to be added or deducted.", alias="requestValue", json_schema_extra={"examples": [20.5]}) + request_note: StrictStr = Field(description="Notes attached to the support request.", alias="requestNote", json_schema_extra={"examples": ["Support request for coupon failure."]}) __properties: ClassVar[List[str]] = ["applicationId", "campaignId", "loyaltyProgramId", "subledgerId", "customerProfileId", "requestType", "requestValue", "requestNote"] @field_validator('request_type') diff --git a/talon_one/models/template_arg_def.py b/talon_one/models/template_arg_def.py index 5944afd..645b6f1 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 metadata that may be used to render an input for this argument.") + ui: Dict[str, Any] = Field(description="Arbitrary properties associated with this campaign.") 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/template_def.py b/talon_one/models/template_def.py index c934410..911252b 100644 --- a/talon_one/models/template_def.py +++ b/talon_one/models/template_def.py @@ -30,9 +30,9 @@ class TemplateDef(BaseModel): """ TemplateDef """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + application_id: StrictInt = Field(description="The ID of the Application that owns this entity.", alias="applicationId", json_schema_extra={"examples": [322]}) title: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Campaigner-friendly name for the template that will be shown in the rule editor.") description: Optional[StrictStr] = Field(default=None, description="A short description of the template that will be shown in the rule editor.") help: Optional[StrictStr] = Field(default=None, description="Extended help text for the template.") diff --git a/talon_one/models/template_limit_config.py b/talon_one/models/template_limit_config.py index b056277..d1b5c0a 100644 --- a/talon_one/models/template_limit_config.py +++ b/talon_one/models/template_limit_config.py @@ -28,10 +28,10 @@ class TemplateLimitConfig(BaseModel): """ TemplateLimitConfig """ # noqa: E501 - action: StrictStr = Field(description="The limitable action to which this limit applies. For example: - `setDiscount` - `setDiscountEffect` - `redeemCoupon` - `createCoupon` ") - limit: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="The value to set for the limit.") - period: Optional[StrictStr] = Field(default=None, description="The period on which the budget limit recurs.") - entities: List[StrictStr] = Field(description="The entity that this limit applies to.") + action: StrictStr = Field(description="The limitable action to which this limit applies. For example: - `setDiscount` - `setDiscountEffect` - `redeemCoupon` - `createCoupon` ", json_schema_extra={"examples": ["createCoupon"]}) + limit: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="The value to set for the limit.", json_schema_extra={"examples": [1000]}) + period: Optional[StrictStr] = Field(default=None, description="The period on which the budget limit recurs.", json_schema_extra={"examples": ["yearly"]}) + entities: List[StrictStr] = Field(description="The entity that this limit applies to.", json_schema_extra={"examples": [["Coupon"]]}) __properties: ClassVar[List[str]] = ["action", "limit", "period", "entities"] @field_validator('period') diff --git a/talon_one/models/tier.py b/talon_one/models/tier.py index 3de292c..7770f88 100644 --- a/talon_one/models/tier.py +++ b/talon_one/models/tier.py @@ -28,10 +28,10 @@ class Tier(BaseModel): """ Tier """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of the tier.") - name: StrictStr = Field(description="The name of the tier.") - start_date: Optional[datetime] = Field(default=None, description="Date and time when the customer moved to this tier. This value uses the loyalty program's time zone setting.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Date when tier level expires in the RFC3339 format (in the Loyalty Program's timezone).", alias="expiryDate") + id: StrictInt = Field(description="The internal ID of the tier.", json_schema_extra={"examples": [11]}) + name: StrictStr = Field(description="The name of the tier.", json_schema_extra={"examples": ["bronze"]}) + start_date: Optional[datetime] = Field(default=None, description="Date and time when the customer moved to this tier. This value uses the loyalty program's time zone setting.", alias="startDate", json_schema_extra={"examples": ["2021-05-03T12:32:00Z07:00"]}) + expiry_date: Optional[datetime] = Field(default=None, description="Date when tier level expires in the RFC3339 format (in the Loyalty Program's timezone).", alias="expiryDate", json_schema_extra={"examples": ["2022-08-02T15:04:05Z07:00"]}) downgrade_policy: Optional[StrictStr] = Field(default=None, description="The policy that defines how customer tiers are downgraded in the loyalty program after tier reevaluation. - `one_down`: If the customer doesn't have enough points to stay in the current tier, they are downgraded by one tier. - `balance_based`: The customer's tier is reevaluated based on the amount of active points they have at the moment. ", alias="downgradePolicy") __properties: ClassVar[List[str]] = ["id", "name", "startDate", "expiryDate", "downgradePolicy"] diff --git a/talon_one/models/tier_downgrade_data.py b/talon_one/models/tier_downgrade_data.py index 190b9f9..a62b5cf 100644 --- a/talon_one/models/tier_downgrade_data.py +++ b/talon_one/models/tier_downgrade_data.py @@ -29,14 +29,14 @@ class TierDowngradeData(BaseModel): """ TierDowngradeData """ # noqa: E501 - customer_profile_id: StrictStr = Field(description="The integration ID of the customer profile whose tier was downgraded.", alias="CustomerProfileID") - loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID") - subledger_id: StrictStr = Field(description="The ID of the subledger, when applicable. If this field is empty, the main ledger is used.", alias="SubledgerID") - current_tier: Optional[StrictStr] = Field(default=None, description="The name of the customer's current tier.", alias="CurrentTier") - current_points: Union[StrictFloat, StrictInt] = Field(description="The number of points the customer had at the time of tier downgrade.", alias="CurrentPoints") - old_tier: StrictStr = Field(description="The name of the customer's previous tier.", alias="OldTier") - tier_expiration_date: Optional[datetime] = Field(default=None, description="The exact date and time the tier expires.", alias="TierExpirationDate") - timestamp_of_tier_change: datetime = Field(description="The exact date and time the tier was changed.", alias="TimestampOfTierChange") + customer_profile_id: StrictStr = Field(description="The integration ID of the customer profile whose tier was downgraded.", alias="CustomerProfileID", json_schema_extra={"examples": ["URNGV8294NV"]}) + loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID", json_schema_extra={"examples": [5]}) + subledger_id: StrictStr = Field(description="The ID of the subledger, when applicable. If this field is empty, the main ledger is used.", alias="SubledgerID", json_schema_extra={"examples": ["SL001"]}) + current_tier: Optional[StrictStr] = Field(default=None, description="The name of the customer's current tier.", alias="CurrentTier", json_schema_extra={"examples": ["Silver"]}) + current_points: Union[StrictFloat, StrictInt] = Field(description="The number of points the customer had at the time of tier downgrade.", alias="CurrentPoints", json_schema_extra={"examples": [120.55]}) + old_tier: StrictStr = Field(description="The name of the customer's previous tier.", alias="OldTier", json_schema_extra={"examples": ["Gold"]}) + tier_expiration_date: Optional[datetime] = Field(default=None, description="The exact date and time the tier expires.", alias="TierExpirationDate", json_schema_extra={"examples": ["2023-12-01T12:23:00+02:00"]}) + timestamp_of_tier_change: datetime = Field(description="The exact date and time the tier was changed.", alias="TimestampOfTierChange", json_schema_extra={"examples": ["2023-10-26T12:23:00+02:00"]}) __properties: ClassVar[List[str]] = ["CustomerProfileID", "LoyaltyProgramID", "SubledgerID", "CurrentTier", "CurrentPoints", "OldTier", "TierExpirationDate", "TimestampOfTierChange"] model_config = ConfigDict( diff --git a/talon_one/models/tier_downgrade_notification.py b/talon_one/models/tier_downgrade_notification.py index 43a294f..a6656c8 100644 --- a/talon_one/models/tier_downgrade_notification.py +++ b/talon_one/models/tier_downgrade_notification.py @@ -28,7 +28,7 @@ class TierDowngradeNotification(BaseModel): """ TierDowngradeNotification """ # noqa: E501 - total_result_size: StrictInt = Field(alias="TotalResultSize") + total_result_size: StrictInt = Field(alias="TotalResultSize", json_schema_extra={"examples": [1]}) data: List[TierDowngradeData] = Field(description="The array of tier downgrade notifications.", alias="Data") notification_type: StrictStr = Field(description="The type of notification.", alias="NotificationType") __properties: ClassVar[List[str]] = ["TotalResultSize", "Data", "NotificationType"] diff --git a/talon_one/models/tier_downgrade_notification_policy.py b/talon_one/models/tier_downgrade_notification_policy.py index f78ba51..5ffe7d3 100644 --- a/talon_one/models/tier_downgrade_notification_policy.py +++ b/talon_one/models/tier_downgrade_notification_policy.py @@ -28,9 +28,9 @@ class TierDowngradeNotificationPolicy(BaseModel): """ TierDowngradeNotificationPolicy """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the notification.") - batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled") - batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the notification.", json_schema_extra={"examples": ["Christmas Sale"]}) + batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled", json_schema_extra={"examples": [False]}) + batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize", json_schema_extra={"examples": [1000]}) __properties: ClassVar[List[str]] = ["name", "batchingEnabled", "batchSize"] model_config = ConfigDict( diff --git a/talon_one/models/tier_upgrade_data.py b/talon_one/models/tier_upgrade_data.py index 25a739d..947d118 100644 --- a/talon_one/models/tier_upgrade_data.py +++ b/talon_one/models/tier_upgrade_data.py @@ -29,16 +29,16 @@ class TierUpgradeData(BaseModel): """ TierUpgradeData """ # noqa: E501 - customer_profile_id: StrictStr = Field(description="The integration ID of the customer profile whose tier was upgraded.", alias="CustomerProfileID") - loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID") - subledger_id: StrictStr = Field(description="The ID of the subledger, when applicable. If this field is empty, the main ledger is used.", alias="SubledgerID") - current_tier: StrictStr = Field(description="The name of the customer's current tier.", alias="CurrentTier") - current_points: Union[StrictFloat, StrictInt] = Field(description="The number of points the customer had at the time of tier upgrade.", alias="CurrentPoints") - old_tier: Optional[StrictStr] = Field(default=None, description="The name of the customer's previous tier.", alias="OldTier") - points_required_to_the_next_tier: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of points needed for a customer to reach the next tier.", alias="PointsRequiredToTheNextTier") - next_tier: Optional[StrictStr] = Field(default=None, description="The name of the customer's next tier.", alias="NextTier") - tier_expiration_date: datetime = Field(description="The exact date and time the tier expires.", alias="TierExpirationDate") - timestamp_of_tier_change: datetime = Field(description="The exact date and time the tier was changed.", alias="TimestampOfTierChange") + customer_profile_id: StrictStr = Field(description="The integration ID of the customer profile whose tier was upgraded.", alias="CustomerProfileID", json_schema_extra={"examples": ["URNGV8294NV"]}) + loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID", json_schema_extra={"examples": [5]}) + subledger_id: StrictStr = Field(description="The ID of the subledger, when applicable. If this field is empty, the main ledger is used.", alias="SubledgerID", json_schema_extra={"examples": ["SL001"]}) + current_tier: StrictStr = Field(description="The name of the customer's current tier.", alias="CurrentTier", json_schema_extra={"examples": ["Silver"]}) + current_points: Union[StrictFloat, StrictInt] = Field(description="The number of points the customer had at the time of tier upgrade.", alias="CurrentPoints", json_schema_extra={"examples": [120.55]}) + old_tier: Optional[StrictStr] = Field(default=None, description="The name of the customer's previous tier.", alias="OldTier", json_schema_extra={"examples": ["Bronze"]}) + points_required_to_the_next_tier: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of points needed for a customer to reach the next tier.", alias="PointsRequiredToTheNextTier", json_schema_extra={"examples": [23.51]}) + next_tier: Optional[StrictStr] = Field(default=None, description="The name of the customer's next tier.", alias="NextTier", json_schema_extra={"examples": ["Gold"]}) + tier_expiration_date: datetime = Field(description="The exact date and time the tier expires.", alias="TierExpirationDate", json_schema_extra={"examples": ["2023-12-01T12:23:00+02:00"]}) + timestamp_of_tier_change: datetime = Field(description="The exact date and time the tier was changed.", alias="TimestampOfTierChange", json_schema_extra={"examples": ["2023-10-26T12:23:00+02:00"]}) __properties: ClassVar[List[str]] = ["CustomerProfileID", "LoyaltyProgramID", "SubledgerID", "CurrentTier", "CurrentPoints", "OldTier", "PointsRequiredToTheNextTier", "NextTier", "TierExpirationDate", "TimestampOfTierChange"] model_config = ConfigDict( diff --git a/talon_one/models/tier_upgrade_notification.py b/talon_one/models/tier_upgrade_notification.py index e7596a4..83fe1e2 100644 --- a/talon_one/models/tier_upgrade_notification.py +++ b/talon_one/models/tier_upgrade_notification.py @@ -28,7 +28,7 @@ class TierUpgradeNotification(BaseModel): """ TierUpgradeNotification """ # noqa: E501 - total_result_size: StrictInt = Field(alias="TotalResultSize") + total_result_size: StrictInt = Field(alias="TotalResultSize", json_schema_extra={"examples": [1]}) data: List[TierUpgradeData] = Field(description="The array of tier upgrade notifications.", alias="Data") notification_type: StrictStr = Field(description="The type of notification.", alias="NotificationType") __properties: ClassVar[List[str]] = ["TotalResultSize", "Data", "NotificationType"] diff --git a/talon_one/models/tier_upgrade_notification_policy.py b/talon_one/models/tier_upgrade_notification_policy.py index 3c5c698..bb47c98 100644 --- a/talon_one/models/tier_upgrade_notification_policy.py +++ b/talon_one/models/tier_upgrade_notification_policy.py @@ -28,9 +28,9 @@ class TierUpgradeNotificationPolicy(BaseModel): """ TierUpgradeNotificationPolicy """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.") - batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled") - batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Notification name.", json_schema_extra={"examples": ["Christmas Sale"]}) + batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled", json_schema_extra={"examples": [False]}) + batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize", json_schema_extra={"examples": [1000]}) __properties: ClassVar[List[str]] = ["name", "batchingEnabled", "batchSize"] model_config = ConfigDict( diff --git a/talon_one/models/tier_will_downgrade_data.py b/talon_one/models/tier_will_downgrade_data.py index 945fa1a..f8e0346 100644 --- a/talon_one/models/tier_will_downgrade_data.py +++ b/talon_one/models/tier_will_downgrade_data.py @@ -29,14 +29,14 @@ class TierWillDowngradeData(BaseModel): """ TierWillDowngradeData """ # noqa: E501 - customer_profile_id: StrictStr = Field(description="The integration ID of the customer profile whose tier was downgraded.", alias="CustomerProfileID") - loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID") - subledger_id: StrictStr = Field(description="The ID of the subledger, when applicable. If this field is empty, the main ledger is used.", alias="SubledgerID") - current_tier: StrictStr = Field(description="The name of the customer's current tier.", alias="CurrentTier") - current_points: Union[StrictFloat, StrictInt] = Field(description="The number of points the customer will have after the tier downgrade.", alias="CurrentPoints") - points_required_to_remain: Union[StrictFloat, StrictInt] = Field(description="The number of points needed for a customer to remain on the same tier.", alias="PointsRequiredToRemain") - next_tier: Optional[StrictStr] = Field(default=None, description="The name of the customer's next tier.", alias="NextTier") - tier_expiration_date: Optional[datetime] = Field(default=None, description="The date and time the tier expires.", alias="TierExpirationDate") + customer_profile_id: StrictStr = Field(description="The integration ID of the customer profile whose tier was downgraded.", alias="CustomerProfileID", json_schema_extra={"examples": ["URNGV8294NV"]}) + loyalty_program_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the loyalty program.", alias="LoyaltyProgramID", json_schema_extra={"examples": [5]}) + subledger_id: StrictStr = Field(description="The ID of the subledger, when applicable. If this field is empty, the main ledger is used.", alias="SubledgerID", json_schema_extra={"examples": ["SL001"]}) + current_tier: StrictStr = Field(description="The name of the customer's current tier.", alias="CurrentTier", json_schema_extra={"examples": ["Silver"]}) + current_points: Union[StrictFloat, StrictInt] = Field(description="The number of points the customer will have after the tier downgrade.", alias="CurrentPoints", json_schema_extra={"examples": [120.55]}) + points_required_to_remain: Union[StrictFloat, StrictInt] = Field(description="The number of points needed for a customer to remain on the same tier.", alias="PointsRequiredToRemain", json_schema_extra={"examples": [23.51]}) + next_tier: Optional[StrictStr] = Field(default=None, description="The name of the customer's next tier.", alias="NextTier", json_schema_extra={"examples": ["Bronze"]}) + tier_expiration_date: Optional[datetime] = Field(default=None, description="The date and time the tier expires.", alias="TierExpirationDate", json_schema_extra={"examples": ["2023-12-01T12:23:00+02:00"]}) __properties: ClassVar[List[str]] = ["CustomerProfileID", "LoyaltyProgramID", "SubledgerID", "CurrentTier", "CurrentPoints", "PointsRequiredToRemain", "NextTier", "TierExpirationDate"] model_config = ConfigDict( diff --git a/talon_one/models/tier_will_downgrade_notification.py b/talon_one/models/tier_will_downgrade_notification.py index dcddda2..5a1ea2b 100644 --- a/talon_one/models/tier_will_downgrade_notification.py +++ b/talon_one/models/tier_will_downgrade_notification.py @@ -28,7 +28,7 @@ class TierWillDowngradeNotification(BaseModel): """ TierWillDowngradeNotification """ # noqa: E501 - total_result_size: StrictInt = Field(alias="TotalResultSize") + total_result_size: StrictInt = Field(alias="TotalResultSize", json_schema_extra={"examples": [1]}) data: List[TierWillDowngradeData] = Field(description="The array of upcoming tier downgrade notifications.", alias="Data") notification_type: StrictStr = Field(description="The type of notification.", alias="NotificationType") __properties: ClassVar[List[str]] = ["TotalResultSize", "Data", "NotificationType"] diff --git a/talon_one/models/tier_will_downgrade_notification_policy.py b/talon_one/models/tier_will_downgrade_notification_policy.py index e53bd46..b2dcc83 100644 --- a/talon_one/models/tier_will_downgrade_notification_policy.py +++ b/talon_one/models/tier_will_downgrade_notification_policy.py @@ -29,9 +29,9 @@ class TierWillDowngradeNotificationPolicy(BaseModel): """ TierWillDowngradeNotificationPolicy """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the notification.") - batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled") - batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the notification.", json_schema_extra={"examples": ["Notification to Google"]}) + batching_enabled: Optional[StrictBool] = Field(default=True, description="Indicates whether batching is activated.", alias="batchingEnabled", json_schema_extra={"examples": [False]}) + batch_size: Optional[StrictInt] = Field(default=1000, description="The required size of each batch of data. This value applies only when `batchingEnabled` is `true`.", alias="batchSize", json_schema_extra={"examples": [1000]}) triggers: Annotated[List[TierWillDowngradeNotificationTrigger], Field(min_length=1, max_length=3)] __properties: ClassVar[List[str]] = ["name", "batchingEnabled", "batchSize", "triggers"] diff --git a/talon_one/models/time_point.py b/talon_one/models/time_point.py index e7b53be..5dc634c 100644 --- a/talon_one/models/time_point.py +++ b/talon_one/models/time_point.py @@ -28,12 +28,12 @@ class TimePoint(BaseModel): """ The absolute duration after which the achievement ends and resets for a particular customer profile. **Note**: The duration follows the time zone of the Application this achievement belongs to. """ # noqa: E501 - month: Optional[Annotated[int, Field(le=12, strict=True, ge=1)]] = Field(default=None, description="The achievement ends and resets in this month. **Note**: Only applicable if the period is set to `Y`. ") - day_of_month: Optional[Annotated[int, Field(le=31, strict=True, ge=1)]] = Field(default=None, description="The achievement ends and resets on this day of the month. **Note**: Only applicable if the period is set to `Y` or `M`. ", alias="dayOfMonth") + month: Optional[Annotated[int, Field(le=12, strict=True, ge=1)]] = Field(default=None, description="The achievement ends and resets in this month. **Note**: Only applicable if the period is set to `Y`. ", json_schema_extra={"examples": [11]}) + day_of_month: Optional[Annotated[int, Field(le=31, strict=True, ge=1)]] = Field(default=None, description="The achievement ends and resets on this day of the month. **Note**: Only applicable if the period is set to `Y` or `M`. ", alias="dayOfMonth", json_schema_extra={"examples": [23]}) day_of_week: Optional[Annotated[int, Field(le=7, strict=True, ge=1)]] = Field(default=None, description="The achievement ends and resets on this day of the week. `1` represents `Monday` and `7` represents `Sunday`. **Note**: Only applicable if the period is set to `W`. ", alias="dayOfWeek") - hour: StrictInt = Field(description="The achievement ends and resets at this hour.") - minute: StrictInt = Field(description="The achievement ends and resets at this minute.") - second: StrictInt = Field(description="The achievement ends and resets at this second.") + hour: StrictInt = Field(description="The achievement ends and resets at this hour.", json_schema_extra={"examples": [23]}) + minute: StrictInt = Field(description="The achievement ends and resets at this minute.", json_schema_extra={"examples": [59]}) + second: StrictInt = Field(description="The achievement ends and resets at this second.", json_schema_extra={"examples": [59]}) __properties: ClassVar[List[str]] = ["month", "dayOfMonth", "dayOfWeek", "hour", "minute", "second"] model_config = ConfigDict( diff --git a/talon_one/models/transfer_loyalty_card.py b/talon_one/models/transfer_loyalty_card.py index 1b5dae3..b77a891 100644 --- a/talon_one/models/transfer_loyalty_card.py +++ b/talon_one/models/transfer_loyalty_card.py @@ -28,8 +28,8 @@ class TransferLoyaltyCard(BaseModel): """ TransferLoyaltyCard """ # noqa: E501 - new_card_identifier: Annotated[str, Field(min_length=4, strict=True, max_length=108)] = Field(description="The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. ", alias="newCardIdentifier") - block_reason: Optional[StrictStr] = Field(default=None, description="Reason for transferring and blocking the loyalty card. ", alias="blockReason") + new_card_identifier: Annotated[str, Field(min_length=4, strict=True, max_length=108)] = Field(description="The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. ", alias="newCardIdentifier", json_schema_extra={"examples": ["summer-loyalty-card-0543"]}) + 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') diff --git a/talon_one/models/trigger_webhook_effect_props.py b/talon_one/models/trigger_webhook_effect_props.py index b08158d..d022420 100644 --- a/talon_one/models/trigger_webhook_effect_props.py +++ b/talon_one/models/trigger_webhook_effect_props.py @@ -25,10 +25,10 @@ class TriggerWebhookEffectProps(BaseModel): """ - The properties specific to the \"triggerWebhook\" effect. This gets triggered whenever a validated rule contained a \"trigger webhook\" effect. This is communicated as an FYI and should usually not require action on your side. + This effect is triggered when a rule containing a [webhook effect](https://docs.talon.one/docs/product/rules/effects/available-effects#webhooks) is validated. The details are shared with you for your information only. It usually doesn't require an action on your side. """ # noqa: E501 - webhook_id: Union[StrictFloat, StrictInt] = Field(description="The ID of the webhook that was triggered.", alias="webhookId") - webhook_name: StrictStr = Field(description="The name of the webhook that was triggered.", alias="webhookName") + webhook_id: Union[StrictFloat, StrictInt] = Field(description="The internal ID of the webhook.", alias="webhookId") + webhook_name: StrictStr = Field(description="The name of the webhook.", alias="webhookName") __properties: ClassVar[List[str]] = ["webhookId", "webhookName"] model_config = ConfigDict( diff --git a/talon_one/models/two_fa_config.py b/talon_one/models/two_fa_config.py index 340421e..70127dd 100644 --- a/talon_one/models/two_fa_config.py +++ b/talon_one/models/two_fa_config.py @@ -27,8 +27,8 @@ class TwoFAConfig(BaseModel): """ TwoFAConfig """ # noqa: E501 - enabled: StrictBool = Field(description="An indication of whether two-factor authentication is enabled for the account.") - require_every_sign_in: Optional[StrictBool] = Field(default=None, description="Can be `true` or `false`. - `true`: Two-factor authentication is required each time a user signs in to their Talon.One account. - `false`: Two-factor authentication is only required when a user signs in to their Talon.One account on a new device, and every 30 days after that. ", alias="requireEverySignIn") + enabled: StrictBool = Field(description="An indication of whether two-factor authentication is enabled for the account.", json_schema_extra={"examples": [True]}) + require_every_sign_in: Optional[StrictBool] = Field(default=None, description="Can be `true` or `false`. - `true`: Two-factor authentication is required each time a user signs in to their Talon.One account. - `false`: Two-factor authentication is only required when a user signs in to their Talon.One account on a new device, and every 30 days after that. ", alias="requireEverySignIn", json_schema_extra={"examples": [True]}) __properties: ClassVar[List[str]] = ["enabled", "requireEverySignIn"] model_config = ConfigDict( diff --git a/talon_one/models/update_achievement.py b/talon_one/models/update_achievement.py index e4d0d97..944f7dc 100644 --- a/talon_one/models/update_achievement.py +++ b/talon_one/models/update_achievement.py @@ -30,17 +30,17 @@ class UpdateAchievement(BaseModel): """ UpdateAchievement """ # noqa: E501 - name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ") - title: Optional[StrictStr] = Field(default=None, description="The display name for the achievement in the Campaign Manager.") - description: Optional[StrictStr] = Field(default=None, description="A description of the achievement.") - target: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The required number of actions or the transactional milestone to complete the achievement.") - period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ", json_schema_extra={"examples": ["Order50Discount"]}) + title: Optional[StrictStr] = Field(default=None, description="The display name for the achievement in the Campaign Manager.", json_schema_extra={"examples": ["50% off on 50th purchase."]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the achievement.", json_schema_extra={"examples": ["50% off for every 50th purchase in a year."]}) + target: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The required number of actions or the transactional milestone to complete the achievement.", json_schema_extra={"examples": [50]}) + period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ", json_schema_extra={"examples": ["1Y"]}) period_end_override: Optional[TimePoint] = Field(default=None, alias="periodEndOverride") - recurrence_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy") - activation_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy") - fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate") - end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate") - allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="allowRollbackAfterCompletion") + recurrence_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy", json_schema_extra={"examples": ["no_recurrence"]}) + activation_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy", json_schema_extra={"examples": ["fixed_schedule"]}) + fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate", json_schema_extra={"examples": ["2024-01-15T15:04:05Z07:00"]}) + end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate", json_schema_extra={"examples": ["2024-02-15T15:04:05Z07:00"]}) + 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') diff --git a/talon_one/models/update_achievement_v2.py b/talon_one/models/update_achievement_v2.py index 0fdf4ba..33d6352 100644 --- a/talon_one/models/update_achievement_v2.py +++ b/talon_one/models/update_achievement_v2.py @@ -29,17 +29,17 @@ class UpdateAchievementV2(BaseModel): """ UpdateAchievementV2 """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ") - title: StrictStr = Field(description="The display name for the achievement in the Campaign Manager.") - description: StrictStr = Field(description="A description of the achievement.") - target: Union[StrictFloat, StrictInt] = Field(description="The required number of actions or the transactional milestone to complete the achievement.") - period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ") - recurrence_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy") - activation_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy") - fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate") - end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate") - allow_rollback_after_completion: Optional[StrictBool] = Field(default=None, description="When `true`, customer progress can be rolled back in completed achievements.", alias="allowRollbackAfterCompletion") - 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") + name: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. ", json_schema_extra={"examples": ["Order50Discount"]}) + title: StrictStr = Field(description="The display name for the achievement in the Campaign Manager.", json_schema_extra={"examples": ["50% off on 50th purchase."]}) + description: StrictStr = Field(description="A description of the achievement.", json_schema_extra={"examples": ["50% off for every 50th purchase in a year."]}) + target: Union[StrictFloat, StrictInt] = Field(description="The required number of actions or the transactional milestone to complete the achievement.", json_schema_extra={"examples": [50]}) + period: Optional[StrictStr] = Field(default=None, description="The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. ", json_schema_extra={"examples": ["1Y"]}) + recurrence_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. ", alias="recurrencePolicy", json_schema_extra={"examples": ["no_recurrence"]}) + activation_policy: Optional[StrictStr] = Field(default=None, description="The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. ", alias="activationPolicy", json_schema_extra={"examples": ["fixed_schedule"]}) + fixed_start_date: Optional[datetime] = Field(default=None, description="The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. ", alias="fixedStartDate", json_schema_extra={"examples": ["2024-01-15T15:04:05+07:00"]}) + end_date: Optional[datetime] = Field(default=None, description="The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. ", alias="endDate", json_schema_extra={"examples": ["2024-01-15T15:04:05+07:00"]}) + 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]}) + 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') diff --git a/talon_one/models/update_application.py b/talon_one/models/update_application.py index 7b72a8e..4cb7952 100644 --- a/talon_one/models/update_application.py +++ b/talon_one/models/update_application.py @@ -30,23 +30,23 @@ class UpdateApplication(BaseModel): """ UpdateApplication """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this application.") - description: Optional[StrictStr] = Field(default=None, description="A longer description of the application.") - timezone: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string containing an IANA timezone descriptor.") - currency: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The default currency for new customer sessions.") - case_sensitivity: Optional[StrictStr] = Field(default=None, description="The case sensitivity behavior to check coupon codes in the campaigns of this Application.", alias="caseSensitivity") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this application.", json_schema_extra={"examples": ["My Application"]}) + description: Optional[StrictStr] = Field(default=None, description="A longer description of the application.", json_schema_extra={"examples": ["A test Application"]}) + timezone: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A string containing an IANA timezone descriptor.", json_schema_extra={"examples": ["Europe/Berlin"]}) + currency: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The default currency for new customer sessions.", json_schema_extra={"examples": ["EUR"]}) + case_sensitivity: Optional[StrictStr] = Field(default=None, description="The case sensitivity behavior to check coupon codes in the campaigns of this Application.", alias="caseSensitivity", json_schema_extra={"examples": ["sensitive"]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") limits: Optional[List[LimitConfig]] = Field(default=None, description="Default limits for campaigns created in this application.") - default_discount_scope: Optional[StrictStr] = Field(default=None, description="The default scope to apply `setDiscount` effects on if no scope was provided with the effect. ", alias="defaultDiscountScope") - enable_cascading_discounts: Optional[StrictBool] = Field(default=None, description="Indicates if discounts should cascade for this Application.", alias="enableCascadingDiscounts") - enable_flattened_cart_items: Optional[StrictBool] = Field(default=None, description="Indicates if cart items of quantity larger than one should be separated into different items of quantity one. ", alias="enableFlattenedCartItems") + default_discount_scope: Optional[StrictStr] = Field(default=None, description="The default scope to apply `setDiscount` effects on if no scope was provided with the effect. ", alias="defaultDiscountScope", json_schema_extra={"examples": ["sessionTotal"]}) + enable_cascading_discounts: Optional[StrictBool] = Field(default=None, description="Indicates if discounts should cascade for this Application.", alias="enableCascadingDiscounts", json_schema_extra={"examples": [True]}) + enable_flattened_cart_items: Optional[StrictBool] = Field(default=None, description="Indicates if cart items of quantity larger than one should be separated into different items of quantity one. ", alias="enableFlattenedCartItems", json_schema_extra={"examples": [True]}) attributes_settings: Optional[AttributesSettings] = Field(default=None, alias="attributesSettings") - sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this is a live or sandbox Application.") - enable_partial_discounts: Optional[StrictBool] = Field(default=None, description="Indicates if this Application supports partial discounts.", alias="enablePartialDiscounts") - default_discount_additional_cost_per_item_scope: Optional[StrictStr] = Field(default=None, description="The default scope to apply `setDiscountPerItem` effects on if no scope was provided with the effect. ", alias="defaultDiscountAdditionalCostPerItemScope") - default_evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the default campaign evaluation group to which new campaigns will be added unless a different group is selected when creating the campaign.", alias="defaultEvaluationGroupId") - default_cart_item_filter_id: Optional[StrictInt] = Field(default=None, description="The ID of the default Cart-Item-Filter for this application.", alias="defaultCartItemFilterId") - enable_campaign_state_management: Optional[StrictBool] = Field(default=None, description="Indicates whether the campaign staging and revisions feature is enabled for the Application. **Important:** After this feature is enabled, it cannot be disabled. ", alias="enableCampaignStateManagement") + sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this is a live or sandbox Application.", json_schema_extra={"examples": [True]}) + enable_partial_discounts: Optional[StrictBool] = Field(default=None, description="Indicates if this Application supports partial discounts.", alias="enablePartialDiscounts", json_schema_extra={"examples": [False]}) + default_discount_additional_cost_per_item_scope: Optional[StrictStr] = Field(default=None, description="The default scope to apply `setDiscountPerItem` effects on if no scope was provided with the effect. ", alias="defaultDiscountAdditionalCostPerItemScope", json_schema_extra={"examples": ["price"]}) + default_evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the default campaign evaluation group to which new campaigns will be added unless a different group is selected when creating the campaign.", alias="defaultEvaluationGroupId", json_schema_extra={"examples": [3]}) + default_cart_item_filter_id: Optional[StrictInt] = Field(default=None, description="The ID of the default Cart-Item-Filter for this application.", alias="defaultCartItemFilterId", json_schema_extra={"examples": [3]}) + enable_campaign_state_management: Optional[StrictBool] = Field(default=None, description="Indicates whether the campaign staging and revisions feature is enabled for the Application. **Important:** After this feature is enabled, it cannot be disabled. ", alias="enableCampaignStateManagement", json_schema_extra={"examples": [False]}) __properties: ClassVar[List[str]] = ["name", "description", "timezone", "currency", "caseSensitivity", "attributes", "limits", "defaultDiscountScope", "enableCascadingDiscounts", "enableFlattenedCartItems", "attributesSettings", "sandbox", "enablePartialDiscounts", "defaultDiscountAdditionalCostPerItemScope", "defaultEvaluationGroupId", "defaultCartItemFilterId", "enableCampaignStateManagement"] @field_validator('case_sensitivity') diff --git a/talon_one/models/update_application_api_key.py b/talon_one/models/update_application_api_key.py index d108732..458efcf 100644 --- a/talon_one/models/update_application_api_key.py +++ b/talon_one/models/update_application_api_key.py @@ -27,7 +27,7 @@ class UpdateApplicationAPIKey(BaseModel): """ UpdateApplicationAPIKey """ # noqa: E501 - time_offset: StrictInt = Field(description="A time offset in nanoseconds associated with the API key. When making a request using the API key, rule evaluation is based on a date that is calculated by adding the offset to the current date. ", alias="timeOffset") + time_offset: StrictInt = Field(description="A time offset in nanoseconds associated with the API key. When making a request using the API key, rule evaluation is based on a date that is calculated by adding the offset to the current date. ", alias="timeOffset", json_schema_extra={"examples": [100000]}) __properties: ClassVar[List[str]] = ["timeOffset"] model_config = ConfigDict( diff --git a/talon_one/models/update_application_cif.py b/talon_one/models/update_application_cif.py index 464ab7d..f201fe7 100644 --- a/talon_one/models/update_application_cif.py +++ b/talon_one/models/update_application_cif.py @@ -28,9 +28,9 @@ class UpdateApplicationCIF(BaseModel): """ UpdateApplicationCIF """ # noqa: E501 - description: Optional[StrictStr] = Field(default=None, description="A short description of the Application cart item filter.") - active_expression_id: Optional[StrictInt] = Field(default=None, description="The ID of the expression that the Application cart item filter uses.", alias="activeExpressionId") - modified_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who last updated the Application cart item filter.", alias="modifiedBy") + description: Optional[StrictStr] = Field(default=None, description="A short description of the Application cart item filter.", json_schema_extra={"examples": ["This filter allows filtering by shoes"]}) + active_expression_id: Optional[StrictInt] = Field(default=None, description="The ID of the expression that the Application cart item filter uses.", alias="activeExpressionId", json_schema_extra={"examples": [1]}) + modified_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who last updated the Application cart item filter.", alias="modifiedBy", json_schema_extra={"examples": [334]}) modified: Optional[datetime] = Field(default=None, description="Timestamp of the most recent update to the Application cart item filter.") __properties: ClassVar[List[str]] = ["description", "activeExpressionId", "modifiedBy", "modified"] diff --git a/talon_one/models/update_attribute_effect_props.py b/talon_one/models/update_attribute_effect_props.py index e747b7a..6de6e62 100644 --- a/talon_one/models/update_attribute_effect_props.py +++ b/talon_one/models/update_attribute_effect_props.py @@ -25,9 +25,9 @@ class UpdateAttributeEffectProps(BaseModel): """ - The properties specific to the \"updateAttribute\" effect. This gets triggered whenever a validated rule contained an \"update an attribute\" effect. + This effect indicates that a rule containing an [Update attribute value](https://docs.talon.one/docs/product/rules/effects/available-effects#update-effects) or [Update cart item attribute value](https://docs.talon.one/docs/product/rules/effects/available-effects#update-effects) was validated. You should update the value of the attribute in your system based on the content of the returned effect. """ # noqa: E501 - path: StrictStr = Field(description="The exact path of the attribute that was updated.") + path: StrictStr = Field(description="The entity type and the attribute name.") value: Optional[Any] __properties: ClassVar[List[str]] = ["path", "value"] diff --git a/talon_one/models/update_audience.py b/talon_one/models/update_audience.py index 168ca14..4ee5eee 100644 --- a/talon_one/models/update_audience.py +++ b/talon_one/models/update_audience.py @@ -28,8 +28,8 @@ class UpdateAudience(BaseModel): """ UpdateAudience """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The human-friendly display name for this audience.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications that are connected to this audience.", alias="subscribedApplicationsIds") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The human-friendly display name for this audience.", json_schema_extra={"examples": ["Travel audience"]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications that are connected to this audience.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[3, 13]]}) __properties: ClassVar[List[str]] = ["name", "subscribedApplicationsIds"] model_config = ConfigDict( diff --git a/talon_one/models/update_campaign.py b/talon_one/models/update_campaign.py index da1eb5a..7d3d7c0 100644 --- a/talon_one/models/update_campaign.py +++ b/talon_one/models/update_campaign.py @@ -31,23 +31,23 @@ class UpdateCampaign(BaseModel): """ UpdateCampaign """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A user-facing name for this campaign.") - description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.") - start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime") - end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.") - state: Optional[StrictStr] = Field(default='enabled', description="A disabled or archived campaign is not evaluated for rules or coupons. ") - active_ruleset_id: Optional[StrictInt] = Field(default=None, description="[ID of Ruleset](https://docs.talon.one/management-api#tag/Campaigns/operation/getRulesets) this campaign applies on customer session evaluation. ", alias="activeRulesetId") - tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)] = Field(description="A list of tags for the campaign.") - reevaluate_on_return: Optional[StrictBool] = Field(default=None, description="Indicates whether this campaign should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn") - features: List[StrictStr] = Field(description="A list of features for the campaign.") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A user-facing name for this campaign.", json_schema_extra={"examples": ["Summer promotions"]}) + description: Optional[StrictStr] = Field(default=None, description="A detailed description of the campaign.", json_schema_extra={"examples": ["Campaign for all summer 2021 promotions"]}) + start_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become active.", alias="startTime", json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) + end_time: Optional[datetime] = Field(default=None, description="Timestamp when the campaign will become inactive.", alias="endTime", json_schema_extra={"examples": ["2021-10-01T02:00:00Z"]}) + attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this campaign.", json_schema_extra={"examples": [{"myattribute": 20}]}) + state: Optional[StrictStr] = Field(default='enabled', description="A disabled or archived campaign is not evaluated for rules or coupons. ", json_schema_extra={"examples": ["disabled"]}) + active_ruleset_id: Optional[StrictInt] = Field(default=None, description="[ID of Ruleset](https://docs.talon.one/management-api#tag/Campaigns/operation/getRulesets) this campaign applies on customer session evaluation. ", alias="activeRulesetId", json_schema_extra={"examples": [2]}) + tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)] = Field(description="A list of tags for the campaign.", json_schema_extra={"examples": [["Summer", "Shoes"]]}) + reevaluate_on_return: Optional[StrictBool] = Field(default=None, description="Indicates whether this campaign should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn", json_schema_extra={"examples": [True]}) + features: List[StrictStr] = Field(description="A list of features for the campaign.", json_schema_extra={"examples": [["coupons", "loyalty"]]}) coupon_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="couponSettings") referral_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="referralSettings") limits: List[LimitConfig] = Field(description="The set of limits that will operate for this campaign.") - campaign_groups: Optional[List[StrictInt]] = Field(default=None, description="The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/account-settings/managing-campaign-groups) this campaign belongs to. ", alias="campaignGroups") - evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign evaluation group the campaign belongs to.", alias="evaluationGroupId") - type: Optional[StrictStr] = Field(default='advanced', description="The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. ") - linked_store_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of store IDs that you want to link to the campaign. > [!note] **Note** > - Campaigns with linked store IDs will only be evaluated when there is a > [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) > that references a linked store. > - If you linked stores to the campaign by uploading a CSV file, you cannot use this property and it should be empty. > - Use of this property is limited to 50 stores. To link more than 50 stores, upload them via a CSV file. ", alias="linkedStoreIds") + campaign_groups: Optional[List[StrictInt]] = Field(default=None, description="The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/account-settings/managing-campaign-groups) this campaign belongs to. ", alias="campaignGroups", json_schema_extra={"examples": [[1, 3]]}) + evaluation_group_id: Optional[StrictInt] = Field(default=None, description="The ID of the campaign evaluation group the campaign belongs to.", alias="evaluationGroupId", json_schema_extra={"examples": [2]}) + type: Optional[StrictStr] = Field(default='advanced', description="The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. ", json_schema_extra={"examples": ["advanced"]}) + linked_store_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of store IDs that you want to link to the campaign. > [!note] **Note** > - Campaigns with linked store IDs will only be evaluated when there is a > [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) > that references a linked store. > - If you linked stores to the campaign by uploading a CSV file, you cannot use this property and it should be empty. > - Use of this property is limited to 50 stores. To link more than 50 stores, upload them via a CSV file. ", alias="linkedStoreIds", json_schema_extra={"examples": [[1, 2, 3]]}) coupon_attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with coupons in this campaign.", alias="couponAttributes") __properties: ClassVar[List[str]] = ["name", "description", "startTime", "endTime", "attributes", "state", "activeRulesetId", "tags", "reevaluateOnReturn", "features", "couponSettings", "referralSettings", "limits", "campaignGroups", "evaluationGroupId", "type", "linkedStoreIds", "couponAttributes"] diff --git a/talon_one/models/update_campaign_collection.py b/talon_one/models/update_campaign_collection.py index 8229b4b..226ef41 100644 --- a/talon_one/models/update_campaign_collection.py +++ b/talon_one/models/update_campaign_collection.py @@ -27,7 +27,7 @@ class UpdateCampaignCollection(BaseModel): """ UpdateCampaignCollection """ # noqa: E501 - description: Optional[StrictStr] = Field(default=None, description="A short description of the purpose of this collection.") + 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]] = ["description"] model_config = ConfigDict( diff --git a/talon_one/models/update_campaign_evaluation_group.py b/talon_one/models/update_campaign_evaluation_group.py index f565c40..6883e17 100644 --- a/talon_one/models/update_campaign_evaluation_group.py +++ b/talon_one/models/update_campaign_evaluation_group.py @@ -28,12 +28,12 @@ class UpdateCampaignEvaluationGroup(BaseModel): """ UpdateCampaignEvaluationGroup """ # noqa: E501 - name: StrictStr = Field(description="The name of the campaign evaluation group.") - parent_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the parent group that contains the campaign evaluation group.", alias="parentId") - description: Optional[StrictStr] = Field(default=None, description="A description of the campaign evaluation group.") + name: StrictStr = Field(description="The name of the campaign evaluation group.", json_schema_extra={"examples": ["Summer campaigns"]}) + parent_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="The ID of the parent group that contains the campaign evaluation group.", alias="parentId", json_schema_extra={"examples": [2]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the campaign evaluation group.", json_schema_extra={"examples": ["This campaign evaluation group contains all campaigns that are running in the summer."]}) evaluation_mode: StrictStr = Field(description="The mode by which campaigns in the campaign evaluation group are evaluated.", alias="evaluationMode") evaluation_scope: StrictStr = Field(description="The evaluation scope of the campaign evaluation group.", alias="evaluationScope") - locked: StrictBool = Field(description="An indicator of whether the campaign evaluation group is locked for modification.") + locked: StrictBool = Field(description="An indicator of whether the campaign evaluation group is locked for modification.", json_schema_extra={"examples": [False]}) __properties: ClassVar[List[str]] = ["name", "parentId", "description", "evaluationMode", "evaluationScope", "locked"] @field_validator('evaluation_mode') diff --git a/talon_one/models/update_campaign_group.py b/talon_one/models/update_campaign_group.py index e1596a3..80f4947 100644 --- a/talon_one/models/update_campaign_group.py +++ b/talon_one/models/update_campaign_group.py @@ -28,10 +28,10 @@ class UpdateCampaignGroup(BaseModel): """ UpdateCampaignGroup """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the campaign access group.") - description: Optional[StrictStr] = Field(default=None, description="A longer description of the campaign access group.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of IDs of the Applications that this campaign access group is enabled for.", alias="subscribedApplicationsIds") - campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of IDs of the campaigns that are part of the campaign access group.", alias="campaignIds") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the campaign access group.", json_schema_extra={"examples": ["Europe access group"]}) + description: Optional[StrictStr] = Field(default=None, description="A longer description of the campaign access group.", json_schema_extra={"examples": ["A group that gives access to all the campaigns for the Europe market."]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of IDs of the Applications that this campaign access group is enabled for.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[1, 2, 3]]}) + campaign_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of IDs of the campaigns that are part of the campaign access group.", alias="campaignIds", json_schema_extra={"examples": [[4, 6, 8]]}) __properties: ClassVar[List[str]] = ["name", "description", "subscribedApplicationsIds", "campaignIds"] model_config = ConfigDict( diff --git a/talon_one/models/update_campaign_template.py b/talon_one/models/update_campaign_template.py index 147a189..b96935d 100644 --- a/talon_one/models/update_campaign_template.py +++ b/talon_one/models/update_campaign_template.py @@ -33,25 +33,25 @@ class UpdateCampaignTemplate(BaseModel): """ UpdateCampaignTemplate """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The campaign template name.") - description: StrictStr = Field(description="Customer-facing text that explains the objective of the template.") - instructions: StrictStr = Field(description="Customer-facing text that explains how to use the template. For example, you can use this property to explain the available attributes of this template, and how they can be modified when a user uses this template to create a new campaign.") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The campaign template name.", json_schema_extra={"examples": ["Discount campaign"]}) + description: StrictStr = Field(description="Customer-facing text that explains the objective of the template.", json_schema_extra={"examples": ["This is a template for a discount campaign."]}) + instructions: StrictStr = Field(description="Customer-facing text that explains how to use the template. For example, you can use this property to explain the available attributes of this template, and how they can be modified when a user uses this template to create a new campaign.", json_schema_extra={"examples": ["Use this template for discount campaigns. Set the campaign properties according to the campaign goals, and don't forget to set an end date."]}) campaign_attributes: Optional[Dict[str, Any]] = Field(default=None, description="The campaign attributes that campaigns created from this template will have by default.", alias="campaignAttributes") coupon_attributes: Optional[Dict[str, Any]] = Field(default=None, description="The campaign attributes that coupons created from this template will have by default.", alias="couponAttributes") state: StrictStr = Field(description="Only campaign templates in 'available' state may be used to create campaigns.") - active_ruleset_id: Optional[StrictInt] = Field(default=None, description="The ID of the ruleset this campaign template will use.", alias="activeRulesetId") - tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)]] = Field(default=None, description="A list of tags for the campaign template.") - reevaluate_on_return: Optional[StrictBool] = Field(default=None, description="Indicates whether campaigns created from this template should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn") + active_ruleset_id: Optional[StrictInt] = Field(default=None, description="The ID of the ruleset this campaign template will use.", alias="activeRulesetId", json_schema_extra={"examples": [5]}) + tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=50)]], Field(max_length=50)]] = Field(default=None, description="A list of tags for the campaign template.", json_schema_extra={"examples": [["discount"]]}) + reevaluate_on_return: Optional[StrictBool] = Field(default=None, description="Indicates whether campaigns created from this template should be reevaluated when a customer returns an item.", alias="reevaluateOnReturn", json_schema_extra={"examples": [True]}) features: Optional[List[StrictStr]] = Field(default=None, description="A list of features for the campaign template.") coupon_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="couponSettings") coupon_reservation_settings: Optional[CampaignTemplateCouponReservationSettings] = Field(default=None, alias="couponReservationSettings") referral_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="referralSettings") limits: Optional[List[TemplateLimitConfig]] = Field(default=None, description="The set of limits that operate for this campaign template.") template_params: Optional[List[CampaignTemplateParams]] = Field(default=None, description="Fields which can be used to replace values in a rule.", alias="templateParams") - applications_ids: List[StrictInt] = Field(description="A list of IDs of the Applications that are subscribed to this campaign template.", alias="applicationsIds") + applications_ids: List[StrictInt] = Field(description="A list of IDs of the Applications that are subscribed to this campaign template.", alias="applicationsIds", json_schema_extra={"examples": [[1, 2, 3]]}) campaign_collections: Optional[List[CampaignTemplateCollection]] = Field(default=None, description="The campaign collections from the blueprint campaign for the template.", alias="campaignCollections") - default_campaign_group_id: Optional[StrictInt] = Field(default=None, description="The default campaign group ID.", alias="defaultCampaignGroupId") - campaign_type: Optional[StrictStr] = Field(default='advanced', description="The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. ", alias="campaignType") + default_campaign_group_id: Optional[StrictInt] = Field(default=None, description="The default campaign group ID.", alias="defaultCampaignGroupId", json_schema_extra={"examples": [42]}) + campaign_type: Optional[StrictStr] = Field(default='advanced', description="The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. ", alias="campaignType", json_schema_extra={"examples": ["advanced"]}) __properties: ClassVar[List[str]] = ["name", "description", "instructions", "campaignAttributes", "couponAttributes", "state", "activeRulesetId", "tags", "reevaluateOnReturn", "features", "couponSettings", "couponReservationSettings", "referralSettings", "limits", "templateParams", "applicationsIds", "campaignCollections", "defaultCampaignGroupId", "campaignType"] @field_validator('state') diff --git a/talon_one/models/update_catalog.py b/talon_one/models/update_catalog.py index 1ffef27..c536edd 100644 --- a/talon_one/models/update_catalog.py +++ b/talon_one/models/update_catalog.py @@ -27,9 +27,9 @@ class UpdateCatalog(BaseModel): """ UpdateCatalog """ # noqa: E501 - description: Optional[StrictStr] = Field(default=None, description="A description of this cart item catalog.") - name: Optional[StrictStr] = Field(default=None, description="Name of this cart item catalog.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications that are subscribed to this catalog.", alias="subscribedApplicationsIds") + description: Optional[StrictStr] = Field(default=None, description="A description of this cart item catalog.", json_schema_extra={"examples": ["seafood catalog"]}) + name: Optional[StrictStr] = Field(default=None, description="Name of this cart item catalog.", json_schema_extra={"examples": ["seafood"]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the applications that are subscribed to this catalog.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[1, 2, 3]]}) __properties: ClassVar[List[str]] = ["description", "name", "subscribedApplicationsIds"] model_config = ConfigDict( diff --git a/talon_one/models/update_collection.py b/talon_one/models/update_collection.py index 9a7d0d5..db6a915 100644 --- a/talon_one/models/update_collection.py +++ b/talon_one/models/update_collection.py @@ -27,8 +27,8 @@ class UpdateCollection(BaseModel): """ UpdateCollection """ # noqa: E501 - description: Optional[StrictStr] = Field(default=None, description="A short description of the purpose of this collection.") - subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications where this collection is enabled.", alias="subscribedApplicationsIds") + description: Optional[StrictStr] = Field(default=None, description="A short description of the purpose of this collection.", json_schema_extra={"examples": ["My collection of SKUs"]}) + subscribed_applications_ids: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the Applications where this collection is enabled.", alias="subscribedApplicationsIds", json_schema_extra={"examples": [[1, 2, 3]]}) __properties: ClassVar[List[str]] = ["description", "subscribedApplicationsIds"] model_config = ConfigDict( diff --git a/talon_one/models/update_coupon.py b/talon_one/models/update_coupon.py index 1fd15a5..cbda6a6 100644 --- a/talon_one/models/update_coupon.py +++ b/talon_one/models/update_coupon.py @@ -30,16 +30,16 @@ class UpdateCoupon(BaseModel): """ UpdateCoupon """ # noqa: E501 - usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit") - discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit") - 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") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the coupon. Coupon never expires if this is omitted.", alias="expiryDate") + usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit", json_schema_extra={"examples": [100]}) + discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit", json_schema_extra={"examples": [30]}) + 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"]}) 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") - 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") - implicitly_reserved: Optional[StrictBool] = Field(default=None, description="An indication of whether the coupon is implicitly reserved for all customers.", alias="implicitlyReserved") + 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.") + 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"] model_config = ConfigDict( diff --git a/talon_one/models/update_coupon_batch.py b/talon_one/models/update_coupon_batch.py index a6c00d7..639aedf 100644 --- a/talon_one/models/update_coupon_batch.py +++ b/talon_one/models/update_coupon_batch.py @@ -29,12 +29,12 @@ class UpdateCouponBatch(BaseModel): """ UpdateCouponBatch """ # noqa: E501 - usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit") - discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit") - 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") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the coupon becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the coupon. Coupon never expires if this is omitted.", alias="expiryDate") - 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. ") + usage_limit: Optional[Annotated[int, Field(le=999999, strict=True, ge=0)]] = Field(default=None, description="The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply. ", alias="usageLimit", json_schema_extra={"examples": [100]}) + discount_limit: Optional[Union[Annotated[float, Field(le=1000000000000000, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The total discount value that the code can give. Typically used to represent a gift card value. ", alias="discountLimit", json_schema_extra={"examples": [30]}) + 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.") 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_customer_session_v2409_response.py b/talon_one/models/update_customer_session_v2409_response.py index 2a6a5ae..3b4b047 100644 --- a/talon_one/models/update_customer_session_v2409_response.py +++ b/talon_one/models/update_customer_session_v2409_response.py @@ -27,9 +27,9 @@ class UpdateCustomerSessionV2409Response(BaseModel): """ UpdateCustomerSessionV2409Response """ # noqa: E501 - message: Optional[StrictStr] = None + message: Optional[StrictStr] = Field(default=None, json_schema_extra={"examples": ["Too many requests are updating this session at the same time"]}) errors: Optional[List[Any]] = None - status_code: Optional[StrictInt] = Field(default=None, alias="StatusCode") + status_code: Optional[StrictInt] = Field(default=None, alias="StatusCode", json_schema_extra={"examples": [409]}) __properties: ClassVar[List[str]] = ["message", "errors", "StatusCode"] model_config = ConfigDict( diff --git a/talon_one/models/update_experiment.py b/talon_one/models/update_experiment.py index b341ada..d63d5db 100644 --- a/talon_one/models/update_experiment.py +++ b/talon_one/models/update_experiment.py @@ -31,7 +31,7 @@ class UpdateExperiment(BaseModel): is_variant_assignment_external: StrictBool = Field(description="The source of the assignment. - false - The variant assignment is handled internally by Talon.One. - true - The variant assignment is handled externally. ", alias="isVariantAssignmentExternal") campaign: UpdateCampaign goal_type: Optional[StrictStr] = Field(default=None, description="The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. If omitted, the current value is preserved. ", alias="goalType") - goal_description: Optional[StrictStr] = Field(default=None, description="A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. If omitted, the current value is preserved. ", alias="goalDescription") + goal_description: Optional[StrictStr] = Field(default=None, description="A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. If omitted, the current value is preserved. ", alias="goalDescription", json_schema_extra={"examples": ["Offering free shipping will increase average order revenue more than a 10% discount"]}) __properties: ClassVar[List[str]] = ["isVariantAssignmentExternal", "campaign", "goalType", "goalDescription"] @field_validator('goal_type') diff --git a/talon_one/models/update_experiment_variant.py b/talon_one/models/update_experiment_variant.py index dca3d13..37899e3 100644 --- a/talon_one/models/update_experiment_variant.py +++ b/talon_one/models/update_experiment_variant.py @@ -29,10 +29,10 @@ class UpdateExperimentVariant(BaseModel): """ UpdateExperimentVariant """ # noqa: E501 - id: StrictInt - name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of this variant.") + id: StrictInt = Field(json_schema_extra={"examples": [10]}) + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of this variant.", json_schema_extra={"examples": ["Variant A"]}) ruleset: NewRuleset - weight: Annotated[int, Field(le=99, strict=True, ge=1)] = Field(description="The percentage split of this variant. The sum of all variant percentages must be 100.") + weight: Annotated[int, Field(le=99, strict=True, ge=1)] = Field(description="The percentage split of this variant. The sum of all variant percentages must be 100.", json_schema_extra={"examples": [13]}) __properties: ClassVar[List[str]] = ["id", "name", "ruleset", "weight"] model_config = ConfigDict( diff --git a/talon_one/models/update_experiment_variant_name.py b/talon_one/models/update_experiment_variant_name.py index 2dc87a9..368c65f 100644 --- a/talon_one/models/update_experiment_variant_name.py +++ b/talon_one/models/update_experiment_variant_name.py @@ -28,7 +28,7 @@ class UpdateExperimentVariantName(BaseModel): """ UpdateExperimentVariantName """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of the variant.") + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of the variant.", json_schema_extra={"examples": ["Variant A"]}) __properties: ClassVar[List[str]] = ["name"] model_config = ConfigDict( diff --git a/talon_one/models/update_loyalty_card.py b/talon_one/models/update_loyalty_card.py index 708df48..573fee4 100644 --- a/talon_one/models/update_loyalty_card.py +++ b/talon_one/models/update_loyalty_card.py @@ -27,8 +27,8 @@ class UpdateLoyaltyCard(BaseModel): """ UpdateLoyaltyCard """ # noqa: E501 - status: StrictStr = Field(description="Status of the loyalty card. Can be `active` or `inactive`. ") - block_reason: Optional[StrictStr] = Field(default=None, description="Reason for transferring and blocking the loyalty card. ", alias="blockReason") + status: StrictStr = Field(description="Status of the loyalty card. Can be `active` or `inactive`. ", json_schema_extra={"examples": ["active"]}) + 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]] = ["status", "blockReason"] model_config = ConfigDict( diff --git a/talon_one/models/update_loyalty_card_request.py b/talon_one/models/update_loyalty_card_request.py index 3266f83..de7e47a 100644 --- a/talon_one/models/update_loyalty_card_request.py +++ b/talon_one/models/update_loyalty_card_request.py @@ -27,7 +27,7 @@ class UpdateLoyaltyCardRequest(BaseModel): """ UpdateLoyaltyCardRequest """ # noqa: E501 - status: Optional[StrictStr] = Field(default=None, description="Status of the loyalty card. Can be `active` or `inactive`. ") + status: Optional[StrictStr] = Field(default=None, description="Status of the loyalty card. Can be `active` or `inactive`. ", json_schema_extra={"examples": ["active"]}) __properties: ClassVar[List[str]] = ["status"] model_config = ConfigDict( diff --git a/talon_one/models/update_loyalty_program.py b/talon_one/models/update_loyalty_program.py index 3741b9f..f895d12 100644 --- a/talon_one/models/update_loyalty_program.py +++ b/talon_one/models/update_loyalty_program.py @@ -31,18 +31,18 @@ class UpdateLoyaltyProgram(BaseModel): """ UpdateLoyaltyProgram """ # noqa: E501 - title: Optional[StrictStr] = Field(default=None, description="The display title for the Loyalty Program.") - description: Optional[StrictStr] = Field(default=None, description="Description of our Loyalty Program.") - subscribed_applications: Optional[List[StrictInt]] = Field(default=None, description="A list containing the IDs of all applications that are subscribed to this Loyalty Program.", alias="subscribedApplications") - default_validity: Optional[StrictStr] = Field(default=None, description="The default duration after which new loyalty points should expire. Can be 'unlimited' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month. ", alias="defaultValidity") - default_pending: Optional[StrictStr] = Field(default=None, description="The default duration of the pending time after which points should be valid. Accepted values: 'immediate', 'on_action' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month. ", alias="defaultPending") - allow_subledger: Optional[StrictBool] = Field(default=None, description="Indicates if this program supports subledgers inside the program.", alias="allowSubledger") - users_per_card_limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="The max amount of user profiles with whom a card can be shared. This can be set to 0 for no limit. This property is only used when `cardBased` is `true`. ", alias="usersPerCardLimit") - sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this program is a live or sandbox program. Programs of a given type can only be connected to Applications of the same type.") + title: Optional[StrictStr] = Field(default=None, description="The display title for the Loyalty Program.", json_schema_extra={"examples": ["Point collection"]}) + description: Optional[StrictStr] = Field(default=None, description="Description of our Loyalty Program.", json_schema_extra={"examples": ["Customers collect 10 points per 1$ spent"]}) + subscribed_applications: Optional[List[StrictInt]] = Field(default=None, description="A list containing the IDs of all applications that are subscribed to this Loyalty Program.", alias="subscribedApplications", json_schema_extra={"examples": [[132, 97]]}) + default_validity: Optional[StrictStr] = Field(default=None, description="The default duration after which new loyalty points should expire. Can be 'unlimited' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month. ", alias="defaultValidity", json_schema_extra={"examples": ["2W_U"]}) + default_pending: Optional[StrictStr] = Field(default=None, description="The default duration of the pending time after which points should be valid. Accepted values: 'immediate', 'on_action' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month. ", alias="defaultPending", json_schema_extra={"examples": ["immediate"]}) + allow_subledger: Optional[StrictBool] = Field(default=None, description="Indicates if this program supports subledgers inside the program.", alias="allowSubledger", json_schema_extra={"examples": [False]}) + users_per_card_limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="The max amount of user profiles with whom a card can be shared. This can be set to 0 for no limit. This property is only used when `cardBased` is `true`. ", alias="usersPerCardLimit", json_schema_extra={"examples": [111]}) + sandbox: Optional[StrictBool] = Field(default=None, description="Indicates if this program is a live or sandbox program. Programs of a given type can only be connected to Applications of the same type.", json_schema_extra={"examples": [True]}) program_join_policy: Optional[StrictStr] = Field(default=None, description="The policy that defines when the customer joins the loyalty program. - `not_join`: The customer does not join the loyalty program but can still earn and spend loyalty points. **Note**: The customer does not have a program join date. - `points_activated`: The customer joins the loyalty program only when their earned loyalty points become active for the first time. - `points_earned`: The customer joins the loyalty program when they earn loyalty points for the first time. ", alias="programJoinPolicy") tiers_expiration_policy: Optional[StrictStr] = Field(default=None, description="The policy that defines how tier expiration, used to reevaluate the customer's current tier, is determined. - `tier_start_date`: The tier expiration is relative to when the customer joined the current tier. - `program_join_date`: The tier expiration is relative to when the customer joined the loyalty program. - `customer_attribute`: The tier expiration is determined by a custom customer attribute. - `absolute_expiration`: The tier is reevaluated at the start of each tier cycle. For this policy, it is required to provide a `tierCycleStartDate`. ", alias="tiersExpirationPolicy") - tier_cycle_start_date: Optional[datetime] = Field(default=None, description="Timestamp at which the tier cycle starts for all customers in the loyalty program. **Note**: This is only required when the tier expiration policy is set to `absolute_expiration`. ", alias="tierCycleStartDate") - tiers_expire_in: Optional[StrictStr] = Field(default=None, description="The amount of time after which the tier expires and is reevaluated. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can 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. ", alias="tiersExpireIn") + tier_cycle_start_date: Optional[datetime] = Field(default=None, description="Timestamp at which the tier cycle starts for all customers in the loyalty program. **Note**: This is only required when the tier expiration policy is set to `absolute_expiration`. ", alias="tierCycleStartDate", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + tiers_expire_in: Optional[StrictStr] = Field(default=None, description="The amount of time after which the tier expires and is reevaluated. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can 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. ", alias="tiersExpireIn", json_schema_extra={"examples": ["27W_U"]}) tiers_downgrade_policy: Optional[StrictStr] = Field(default=None, description="The policy that defines how customer tiers are downgraded in the loyalty program after tier reevaluation. - `one_down`: If the customer doesn't have enough points to stay in the current tier, they are downgraded by one tier. - `balance_based`: The customer's tier is reevaluated based on the amount of active points they have at the moment. ", alias="tiersDowngradePolicy") card_code_settings: Optional[CodeGeneratorSettings] = Field(default=None, alias="cardCodeSettings") return_policy: Optional[StrictStr] = Field(default=None, description="The policy that defines the rollback of points in case of a partially returned, cancelled, or reopened [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). - `only_pending`: Only pending points can be rolled back. - `within_balance`: Available active points can be rolled back if there aren't enough pending points. The active balance of the customer cannot be negative. - `unlimited`: Allows negative balance without any limit. ", alias="returnPolicy") diff --git a/talon_one/models/update_loyalty_program_tier.py b/talon_one/models/update_loyalty_program_tier.py index 6a77c99..50beb62 100644 --- a/talon_one/models/update_loyalty_program_tier.py +++ b/talon_one/models/update_loyalty_program_tier.py @@ -28,9 +28,9 @@ class UpdateLoyaltyProgramTier(BaseModel): """ Update a tier in a specified loyalty program. """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of the tier.") - name: Optional[StrictStr] = Field(default=None, description="The name of the tier.") - min_points: Optional[Union[Annotated[float, Field(le=999999999999.99, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The minimum amount of points required to enter the tier.", alias="minPoints") + id: StrictInt = Field(description="The internal ID of the tier.", json_schema_extra={"examples": [6]}) + name: Optional[StrictStr] = Field(default=None, description="The name of the tier.", json_schema_extra={"examples": ["Gold"]}) + min_points: Optional[Union[Annotated[float, Field(le=999999999999.99, strict=True, ge=0)], Annotated[int, Field(le=2147483647, strict=True, ge=0)]]] = Field(default=None, description="The minimum amount of points required to enter the tier.", alias="minPoints", json_schema_extra={"examples": [300]}) __properties: ClassVar[List[str]] = ["id", "name", "minPoints"] model_config = ConfigDict( diff --git a/talon_one/models/update_picklist.py b/talon_one/models/update_picklist.py index 30a44d5..63d4e89 100644 --- a/talon_one/models/update_picklist.py +++ b/talon_one/models/update_picklist.py @@ -28,8 +28,8 @@ class UpdatePicklist(BaseModel): """ UpdatePicklist """ # noqa: E501 - type: StrictStr = Field(description="The type of allowed values in the picklist. If the type `time` is chosen, it must be an RFC3339 timestamp string.") - values: Annotated[List[StrictStr], Field(max_length=50)] = Field(description="The list of allowed values provided by this picklist.") + type: StrictStr = Field(description="The type of allowed values in the picklist. If the type `time` is chosen, it must be an RFC3339 timestamp string.", json_schema_extra={"examples": ["string"]}) + values: Annotated[List[StrictStr], Field(max_length=50)] = Field(description="The list of allowed values provided by this picklist.", json_schema_extra={"examples": [["Jeans", "Shirt", "Coat"]]}) __properties: ClassVar[List[str]] = ["type", "values"] @field_validator('type') diff --git a/talon_one/models/update_price_type.py b/talon_one/models/update_price_type.py index 72e9bdb..f925678 100644 --- a/talon_one/models/update_price_type.py +++ b/talon_one/models/update_price_type.py @@ -27,9 +27,9 @@ class UpdatePriceType(BaseModel): """ UpdatePriceType """ # noqa: E501 - title: StrictStr = Field(description="The name displayed in the Campaign Manager for the price type.") - description: Optional[StrictStr] = Field(default=None, description="A description of the price type.") - targeted_audiences_ids: List[StrictInt] = Field(description="A list of the IDs of the audiences targeted by this price type.", alias="targetedAudiencesIds") + title: StrictStr = Field(description="The name displayed in the Campaign Manager for the price type.", json_schema_extra={"examples": ["Member Price"]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the price type.", json_schema_extra={"examples": ["The price available exclusively to members."]}) + 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]] = ["title", "description", "targetedAudiencesIds"] model_config = ConfigDict( diff --git a/talon_one/models/update_referral.py b/talon_one/models/update_referral.py index da5023a..66fc230 100644 --- a/talon_one/models/update_referral.py +++ b/talon_one/models/update_referral.py @@ -29,10 +29,10 @@ class UpdateReferral(BaseModel): """ UpdateReferral """ # noqa: E501 - friend_profile_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="An optional Integration ID of the Friend's Profile.", alias="friendProfileIntegrationId") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the referral code becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the referral code. Referral never expires if this is omitted.", alias="expiryDate") - 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. This can be set to 0 for no limit, but any campaign usage limits will still apply. ", alias="usageLimit") + friend_profile_integration_id: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="An optional Integration ID of the Friend's Profile.", alias="friendProfileIntegrationId", json_schema_extra={"examples": ["BZGGC2454PA"]}) + start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the referral code becomes valid.", alias="startDate", json_schema_extra={"examples": ["2020-11-10T23:00:00Z"]}) + expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the referral code. Referral never expires if this is omitted.", alias="expiryDate", json_schema_extra={"examples": ["2021-11-10T23:00:00Z"]}) + 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. This can be set to 0 for no limit, but any campaign usage limits will still apply. ", alias="usageLimit", json_schema_extra={"examples": [1]}) attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.") __properties: ClassVar[List[str]] = ["friendProfileIntegrationId", "startDate", "expiryDate", "usageLimit", "attributes"] diff --git a/talon_one/models/update_referral_batch.py b/talon_one/models/update_referral_batch.py index d7c35cd..7de102d 100644 --- a/talon_one/models/update_referral_batch.py +++ b/talon_one/models/update_referral_batch.py @@ -30,10 +30,10 @@ class UpdateReferralBatch(BaseModel): UpdateReferralBatch """ # noqa: E501 attributes: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary properties associated with this item.") - batch_id: StrictStr = Field(description="The id of the batch the referral belongs to.", alias="batchID") - start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the referral code becomes valid.", alias="startDate") - expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the referral code. Referral never expires if this is omitted.", alias="expiryDate") - 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. This can be set to 0 for no limit, but any campaign usage limits will still apply. ", alias="usageLimit") + batch_id: StrictStr = Field(description="The id of the batch the referral belongs to.", alias="batchID", json_schema_extra={"examples": ["32535-43255"]}) + start_date: Optional[datetime] = Field(default=None, description="Timestamp at which point the referral code becomes valid.", alias="startDate", json_schema_extra={"examples": ["2020-11-10T23:00:00Z"]}) + expiry_date: Optional[datetime] = Field(default=None, description="Expiration date of the referral code. Referral never expires if this is omitted.", alias="expiryDate", json_schema_extra={"examples": ["2021-11-10T23:00:00Z"]}) + 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. This can be set to 0 for no limit, but any campaign usage limits will still apply. ", alias="usageLimit", json_schema_extra={"examples": [1]}) __properties: ClassVar[List[str]] = ["attributes", "batchID", "startDate", "expiryDate", "usageLimit"] model_config = ConfigDict( diff --git a/talon_one/models/update_reward.py b/talon_one/models/update_reward.py index ec5a70e..b7a2245 100644 --- a/talon_one/models/update_reward.py +++ b/talon_one/models/update_reward.py @@ -31,12 +31,12 @@ class UpdateReward(BaseModel): """ UpdateReward """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the reward.") - description: Optional[StrictStr] = Field(default=None, description="A description of the reward.") - status: StrictStr = Field(description="The status of the reward.") + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the reward.", json_schema_extra={"examples": ["Free Coffee"]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the reward.", json_schema_extra={"examples": ["This reward gets you one free coffee."]}) + status: StrictStr = Field(description="The status of the reward.", json_schema_extra={"examples": ["active"]}) visibility_conditions: Optional[Rule] = Field(default=None, description="An optional rule that manages who can see this reward. If not specified, the reward is visible to all customers. **Note:** Only the `condition` field is evaluated within this rule. The `effects` field must be an empty array, and `bindings` are not supported. ", alias="visibilityConditions") rule: Optional[Rule] = Field(default=None, description="Rule to apply. **Note**: The `bindings` field inside the rule must not be used in this endpoint. All bindings should be defined at the reward level via the top-level `bindings` field. ") - bindings: Optional[List[Binding]] = Field(default=None, description="A list of named variables created before the reward's rules are evaluated. Each binding pairs a name with a talang expression. The expression is evaluated once and its result is available by name in any rule condition or effect. Bindings must be defined outside of individual rules.") + bindings: Optional[List[Binding]] = Field(default=None, description="A list of named variables created before the reward's rules are evaluated. Each binding pairs a name with a talang expression. The expression is evaluated once and its result is available by name in any rule condition or effect. Bindings must be defined outside of individual rules.", json_schema_extra={"examples": [[]]}) points_required: Optional[List[RewardPointsRequired]] = Field(default=None, description="The loyalty points required to activate the reward. Each object defines the specific loyalty program and subledger from which points are deducted when activating the reward. **Note:** - Objects with an `id` are updated. - Objects without an `id` are created. - Existing objects omitted from the payload are deleted. ", alias="pointsRequired") __properties: ClassVar[List[str]] = ["name", "description", "status", "visibilityConditions", "rule", "bindings", "pointsRequired"] diff --git a/talon_one/models/update_risk_notification.py b/talon_one/models/update_risk_notification.py new file mode 100644 index 0000000..7b629b8 --- /dev/null +++ b/talon_one/models/update_risk_notification.py @@ -0,0 +1,115 @@ +# 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, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UpdateRiskNotification(BaseModel): + """ + Data for updating a risk notification. + """ # noqa: E501 + entity: StrictStr = Field(description="The entity type to analyze within the given time frame.", json_schema_extra={"examples": ["customer_profile"]}) + activity: StrictStr = Field(description="The activity metric to analyze within the given entity.", json_schema_extra={"examples": ["loyalty_points_earned"]}) + time_frame: StrictStr = Field(description="The rolling time window for risk evaluation.", alias="timeFrame", json_schema_extra={"examples": ["1_week"]}) + active: StrictBool = Field(description="Indicates whether this risk notification is active.", json_schema_extra={"examples": [True]}) + __properties: ClassVar[List[str]] = ["entity", "activity", "timeFrame", "active"] + + @field_validator('entity') + def entity_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['customer_profile', 'customer_session']): + raise ValueError("must be one of enum values ('customer_profile', 'customer_session')") + return value + + @field_validator('activity') + def activity_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['loyalty_points_earned', 'discounted_amount', 'completed_orders', 'coupon_attempts']): + raise ValueError("must be one of enum values ('loyalty_points_earned', 'discounted_amount', 'completed_orders', 'coupon_attempts')") + return value + + @field_validator('time_frame') + def time_frame_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1_day', '1_week', '1_month']): + raise ValueError("must be one of enum values ('1_day', '1_week', '1_month')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateRiskNotification 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 UpdateRiskNotification from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "entity": obj.get("entity"), + "activity": obj.get("activity"), + "timeFrame": obj.get("timeFrame"), + "active": obj.get("active") + }) + return _obj + + diff --git a/talon_one/models/update_role.py b/talon_one/models/update_role.py index 153eceb..5f7a650 100644 --- a/talon_one/models/update_role.py +++ b/talon_one/models/update_role.py @@ -27,10 +27,10 @@ class UpdateRole(BaseModel): """ UpdateRole """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="Name of the role.") - description: Optional[StrictStr] = Field(default=None, description="Description of the role.") - acl: Optional[StrictStr] = Field(default=None, description="The `Access Control List` json defining the role of the user. This represents the access control on the user level.") - members: Optional[List[StrictInt]] = Field(default=None, description="An array of user identifiers.") + name: Optional[StrictStr] = Field(default=None, description="Name of the role.", json_schema_extra={"examples": ["Campaign Manager"]}) + description: Optional[StrictStr] = Field(default=None, description="Description of the role.", json_schema_extra={"examples": ["Manages the campaigns"]}) + acl: Optional[StrictStr] = Field(default=None, description="The `Access Control List` json defining the role of the user. This represents the access control on the user level.", json_schema_extra={"examples": [{"Role": 128}]}) + members: Optional[List[StrictInt]] = Field(default=None, description="An array of user identifiers.", json_schema_extra={"examples": [[48, 562, 475, 18]]}) __properties: ClassVar[List[str]] = ["name", "description", "acl", "members"] model_config = ConfigDict( diff --git a/talon_one/models/update_store.py b/talon_one/models/update_store.py index fc256c0..bf703b7 100644 --- a/talon_one/models/update_store.py +++ b/talon_one/models/update_store.py @@ -28,9 +28,9 @@ class UpdateStore(BaseModel): """ UpdateStore """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(description="The name of the store.") - description: StrictStr = Field(description="The description of the store.") - attributes: Optional[Dict[str, Any]] = Field(default=None, description="The attributes of the store.") + name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(description="The name of the store.", json_schema_extra={"examples": ["South US store"]}) + description: StrictStr = Field(description="The description of the store.", json_schema_extra={"examples": ["This is the description of the store in south US."]}) + attributes: Optional[Dict[str, Any]] = Field(default=None, description="The attributes of the store.", json_schema_extra={"examples": [{"country": "USA", "code": 1234}]}) __properties: ClassVar[List[str]] = ["name", "description", "attributes"] model_config = ConfigDict( diff --git a/talon_one/models/update_support_request.py b/talon_one/models/update_support_request.py index f51ea99..6042948 100644 --- a/talon_one/models/update_support_request.py +++ b/talon_one/models/update_support_request.py @@ -27,8 +27,8 @@ class UpdateSupportRequest(BaseModel): """ UpdateSupportRequest """ # noqa: E501 - request_status: StrictStr = Field(description="Current status of the support request.", alias="requestStatus") - processing_note: Optional[StrictStr] = Field(default=None, description="Notes attached by the admin when rejecting or approving a request.", alias="processingNote") + request_status: StrictStr = Field(description="Current status of the support request.", alias="requestStatus", json_schema_extra={"examples": ["approved"]}) + 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."]}) __properties: ClassVar[List[str]] = ["requestStatus", "processingNote"] @field_validator('request_status') diff --git a/talon_one/models/update_user.py b/talon_one/models/update_user.py index 08c006c..8dc71a7 100644 --- a/talon_one/models/update_user.py +++ b/talon_one/models/update_user.py @@ -27,11 +27,11 @@ class UpdateUser(BaseModel): """ UpdateUser """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="Name of the user.") - state: Optional[StrictStr] = Field(default=None, description="The state of the user. - `deactivated`: The user has been deactivated. - `active`: The user is active. **Note**: Only `admin` users can update the state of another user. ") - is_admin: Optional[StrictBool] = Field(default=None, description="Indicates whether the user is an `admin`.", alias="isAdmin") - policy: Optional[StrictStr] = Field(default=None, description="Indicates the access level of the user.") - roles: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the roles assigned to the user. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. ") + name: Optional[StrictStr] = Field(default=None, description="Name of the user.", json_schema_extra={"examples": ["John Doe"]}) + state: Optional[StrictStr] = Field(default=None, description="The state of the user. - `deactivated`: The user has been deactivated. - `active`: The user is active. **Note**: Only `admin` users can update the state of another user. ", json_schema_extra={"examples": ["deactivated"]}) + is_admin: Optional[StrictBool] = Field(default=None, description="Indicates whether the user is an `admin`.", alias="isAdmin", json_schema_extra={"examples": [False]}) + policy: Optional[StrictStr] = Field(default=None, description="Indicates the 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. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. ", json_schema_extra={"examples": [[1, 3]]}) application_notification_subscriptions: Optional[Dict[str, Any]] = Field(default=None, description="Application notifications that the user is subscribed to.", alias="applicationNotificationSubscriptions") __properties: ClassVar[List[str]] = ["name", "state", "isAdmin", "policy", "roles", "applicationNotificationSubscriptions"] diff --git a/talon_one/models/user.py b/talon_one/models/user.py index d2e9da5..d58df53 100644 --- a/talon_one/models/user.py +++ b/talon_one/models/user.py @@ -28,23 +28,23 @@ class User(BaseModel): """ User """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - modified: datetime = Field(description="The time this entity was last modified.") - email: StrictStr = Field(description="The email address associated with the user profile.") - account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId") - name: StrictStr = Field(description="Name of the user.") - state: StrictStr = Field(description="State of the user.") - invite_token: StrictStr = Field(description="Invitation token of the user. **Note**: If the user has already accepted their invitation, this is `null`. ", alias="inviteToken") - is_admin: Optional[StrictBool] = Field(default=None, description="Indicates whether the user is an `admin`.", alias="isAdmin") - policy: Dict[str, Any] = Field(description="Access level of the user.") - roles: Optional[List[StrictInt]] = Field(default=None, description="A list of the IDs of the roles assigned to the user.") - auth_method: Optional[StrictStr] = Field(default=None, description="Authentication method for this user.", alias="authMethod") - application_notification_subscriptions: Optional[Dict[str, Any]] = Field(default=None, description="Application notifications that the user is subscribed to.", alias="applicationNotificationSubscriptions") - last_signed_in: Optional[datetime] = Field(default=None, description="Timestamp when the user last signed in to Talon.One.", alias="lastSignedIn") - last_accessed: Optional[datetime] = Field(default=None, description="Timestamp of the user's last activity after signing in to Talon.One.", alias="lastAccessed") - latest_feed_timestamp: Optional[datetime] = Field(default=None, description="Timestamp when the user was notified for feed.", alias="latestFeedTimestamp") - additional_attributes: Optional[Dict[str, Any]] = Field(default=None, description="Additional user attributes, created and used by external identity providers.", alias="additionalAttributes") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + modified: datetime = Field(description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) + email: StrictStr = Field(description="The email address associated with the user profile.", json_schema_extra={"examples": ["john.doe@example.com"]}) + account_id: StrictInt = Field(description="The ID of the account that owns this entity.", alias="accountId", json_schema_extra={"examples": [3886]}) + name: StrictStr = Field(description="Name of the user.", json_schema_extra={"examples": ["John Doe"]}) + state: StrictStr = Field(description="State of the user.", json_schema_extra={"examples": ["invited"]}) + invite_token: StrictStr = Field(description="Invitation token of the user. **Note**: If the user has already accepted their invitation, this is `null`. ", alias="inviteToken", json_schema_extra={"examples": ["Gy9b8w1irmQtEPo5RmbMmSPheL5h4"]}) + is_admin: Optional[StrictBool] = Field(default=None, description="Indicates whether the user is an `admin`.", alias="isAdmin", json_schema_extra={"examples": [False]}) + 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") + 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") __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/user_entity.py b/talon_one/models/user_entity.py index d913c35..e5ba48d 100644 --- a/talon_one/models/user_entity.py +++ b/talon_one/models/user_entity.py @@ -27,7 +27,7 @@ class UserEntity(BaseModel): """ UserEntity """ # noqa: E501 - user_id: StrictInt = Field(description="The ID of the user associated with this entity.", alias="userId") + user_id: StrictInt = Field(description="The ID of the user associated with this entity.", alias="userId", json_schema_extra={"examples": [388]}) __properties: ClassVar[List[str]] = ["userId"] model_config = ConfigDict( diff --git a/talon_one/models/value_map.py b/talon_one/models/value_map.py index b358bd1..eaba93e 100644 --- a/talon_one/models/value_map.py +++ b/talon_one/models/value_map.py @@ -28,10 +28,10 @@ class ValueMap(BaseModel): """ ValueMap """ # noqa: E501 - id: StrictInt = Field(description="Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints.") - created: Optional[datetime] = None - created_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who created the value map.", alias="createdBy") - campaign_id: StrictInt = Field(alias="campaignId") + id: StrictInt = Field(description="Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints.", json_schema_extra={"examples": [6]}) + created: Optional[datetime] = Field(default=None, json_schema_extra={"examples": ["2021-07-20T22:00:00Z"]}) + created_by: Optional[StrictInt] = Field(default=None, description="The ID of the user who created the value map.", alias="createdBy", json_schema_extra={"examples": [216]}) + campaign_id: StrictInt = Field(alias="campaignId", json_schema_extra={"examples": [244]}) __properties: ClassVar[List[str]] = ["id", "created", "createdBy", "campaignId"] model_config = ConfigDict( diff --git a/talon_one/models/webhook.py b/talon_one/models/webhook.py index 83b5cf4..5944df7 100644 --- a/talon_one/models/webhook.py +++ b/talon_one/models/webhook.py @@ -30,20 +30,20 @@ class Webhook(BaseModel): """ Webhook """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - modified: datetime = Field(description="The time this entity was last modified.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + modified: datetime = Field(description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) application_ids: List[StrictInt] = Field(description="The IDs of the Applications in which this webhook is available. An empty array means the webhook is available in `All Applications`. ", alias="applicationIds") - title: Annotated[str, Field(strict=True)] = Field(description="Name or title for this webhook.") - description: Optional[StrictStr] = Field(default=None, description="A description of the webhook.") - draft: StrictBool = Field(description="Indicates if the webhook is a draft.") - verb: StrictStr = Field(description="API method for this webhook.") - url: StrictStr = Field(description="API URL (supports templating using parameters) for this webhook.") - headers: List[Annotated[str, Field(strict=True)]] = Field(description="List of API HTTP headers for this webhook.") - payload: Optional[StrictStr] = Field(default=None, description="API payload (supports templating using parameters) for this webhook.") - params: List[TemplateArgDef] = Field(description="Array of template argument definitions.") - enabled: StrictBool = Field(description="Enables or disables webhook from showing in the Rule Builder.") - authentication_id: Optional[StrictInt] = Field(default=None, description="The ID of the credential that this webhook is using.", alias="authenticationId") + title: Annotated[str, Field(strict=True)] = Field(description="Name or title for this webhook.", json_schema_extra={"examples": ["Send message"]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the webhook.", json_schema_extra={"examples": ["A webhook to send a coupon to the user."]}) + draft: StrictBool = Field(description="Indicates if the webhook is a draft.", json_schema_extra={"examples": [False]}) + verb: StrictStr = Field(description="API method for this webhook.", json_schema_extra={"examples": ["POST"]}) + url: StrictStr = Field(description="API URL (supports templating using parameters) for this webhook.", json_schema_extra={"examples": ["www.my-company.com/my-endpoint-name"]}) + headers: List[Annotated[str, Field(strict=True)]] = Field(description="List of API HTTP headers for this webhook.", json_schema_extra={"examples": [["{\"Authorization\": \"Basic bmF2ZWVua3VtYXIU=\"}", "{\"Content-Type\": \"application/json\"}"]]}) + payload: Optional[StrictStr] = Field(default=None, description="API payload (supports templating using parameters) for this webhook.", json_schema_extra={"examples": ["{\n\t\"message\": \"${message}\"\n}"]}) + params: List[TemplateArgDef] = Field(description="Array of template argument definitions.", json_schema_extra={"examples": [[]]}) + enabled: StrictBool = Field(description="Enables or disables webhook from showing in the Rule Builder.", json_schema_extra={"examples": [True]}) + 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') diff --git a/talon_one/models/webhook_authentication.py b/talon_one/models/webhook_authentication.py index 4a24364..7ad237a 100644 --- a/talon_one/models/webhook_authentication.py +++ b/talon_one/models/webhook_authentication.py @@ -29,13 +29,13 @@ class WebhookAuthentication(BaseModel): """ WebhookAuthentication """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - modified: datetime = Field(description="The time this entity was last modified.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + modified: datetime = Field(description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) created_by: StrictStr = Field(description="The name of the user who created the webhook authentication.", alias="createdBy") modified_by: StrictStr = Field(description="The name of the user who last modified the webhook authentication.", alias="modifiedBy") webhooks: List[WebhookAuthenticationWebhookRef] - name: StrictStr = Field(description="The name of the webhook authentication.") + name: StrictStr = Field(description="The name of the webhook authentication.", json_schema_extra={"examples": ["My basic auth"]}) type: StrictStr data: Optional[Any] __properties: ClassVar[List[str]] = ["id", "created", "modified", "createdBy", "modifiedBy", "webhooks", "name", "type", "data"] diff --git a/talon_one/models/webhook_authentication_webhook_ref.py b/talon_one/models/webhook_authentication_webhook_ref.py index dc94c16..3ac0ad9 100644 --- a/talon_one/models/webhook_authentication_webhook_ref.py +++ b/talon_one/models/webhook_authentication_webhook_ref.py @@ -28,9 +28,9 @@ class WebhookAuthenticationWebhookRef(BaseModel): """ WebhookAuthenticationWebhookRef """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - title: Annotated[str, Field(strict=True)] = Field(description="The title of the webhook authentication.") - description: Optional[StrictStr] = Field(default=None, description="A description of the webhook authentication.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + title: Annotated[str, Field(strict=True)] = Field(description="The title of the webhook authentication.", json_schema_extra={"examples": ["Send message"]}) + 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') diff --git a/talon_one/models/webhook_with_outgoing_integration_details.py b/talon_one/models/webhook_with_outgoing_integration_details.py index 8c6927f..37881e2 100644 --- a/talon_one/models/webhook_with_outgoing_integration_details.py +++ b/talon_one/models/webhook_with_outgoing_integration_details.py @@ -30,23 +30,23 @@ class WebhookWithOutgoingIntegrationDetails(BaseModel): """ WebhookWithOutgoingIntegrationDetails """ # noqa: E501 - id: StrictInt = Field(description="The internal ID of this entity.") - created: datetime = Field(description="The time this entity was created.") - modified: datetime = Field(description="The time this entity was last modified.") + id: StrictInt = Field(description="The internal ID of this entity.", json_schema_extra={"examples": [6]}) + created: datetime = Field(description="The time this entity was created.", json_schema_extra={"examples": ["2020-06-10T09:05:27.993483Z"]}) + modified: datetime = Field(description="The time this entity was last modified.", json_schema_extra={"examples": ["2021-09-12T10:12:42Z"]}) application_ids: List[StrictInt] = Field(description="The IDs of the Applications in which this webhook is available. An empty array means the webhook is available in `All Applications`. ", alias="applicationIds") - title: Annotated[str, Field(strict=True)] = Field(description="Name or title for this webhook.") - description: Optional[StrictStr] = Field(default=None, description="A description of the webhook.") - draft: StrictBool = Field(description="Indicates if the webhook is a draft.") - verb: StrictStr = Field(description="API method for this webhook.") - url: StrictStr = Field(description="API URL (supports templating using parameters) for this webhook.") - headers: List[Annotated[str, Field(strict=True)]] = Field(description="List of API HTTP headers for this webhook.") - payload: Optional[StrictStr] = Field(default=None, description="API payload (supports templating using parameters) for this webhook.") - params: List[TemplateArgDef] = Field(description="Array of template argument definitions.") - enabled: StrictBool = Field(description="Enables or disables webhook from showing in the Rule Builder.") - authentication_id: Optional[StrictInt] = Field(default=None, description="The ID of the credential that this webhook is using.", alias="authenticationId") - outgoing_integration_template_id: Optional[StrictInt] = Field(default=None, description="Identifier of the outgoing integration template.", alias="outgoingIntegrationTemplateId") - outgoing_integration_type_id: Optional[StrictInt] = Field(default=None, description="Identifier of the outgoing integration type.", alias="outgoingIntegrationTypeId") - outgoing_integration_type_name: Optional[StrictStr] = Field(default=None, description="Name of the outgoing integration.", alias="outgoingIntegrationTypeName") + title: Annotated[str, Field(strict=True)] = Field(description="Name or title for this webhook.", json_schema_extra={"examples": ["Send message"]}) + description: Optional[StrictStr] = Field(default=None, description="A description of the webhook.", json_schema_extra={"examples": ["A webhook to send a coupon to the user."]}) + draft: StrictBool = Field(description="Indicates if the webhook is a draft.", json_schema_extra={"examples": [False]}) + verb: StrictStr = Field(description="API method for this webhook.", json_schema_extra={"examples": ["POST"]}) + url: StrictStr = Field(description="API URL (supports templating using parameters) for this webhook.", json_schema_extra={"examples": ["www.my-company.com/my-endpoint-name"]}) + headers: List[Annotated[str, Field(strict=True)]] = Field(description="List of API HTTP headers for this webhook.", json_schema_extra={"examples": [["{\"Authorization\": \"Basic bmF2ZWVua3VtYXIU=\"}", "{\"Content-Type\": \"application/json\"}"]]}) + payload: Optional[StrictStr] = Field(default=None, description="API payload (supports templating using parameters) for this webhook.", json_schema_extra={"examples": ["{\n\t\"message\": \"${message}\"\n}"]}) + params: List[TemplateArgDef] = Field(description="Array of template argument definitions.", json_schema_extra={"examples": [[]]}) + enabled: StrictBool = Field(description="Enables or disables webhook from showing in the Rule Builder.", json_schema_extra={"examples": [True]}) + 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]}) + outgoing_integration_template_id: Optional[StrictInt] = Field(default=None, description="Identifier of the outgoing integration template.", alias="outgoingIntegrationTemplateId", json_schema_extra={"examples": [1]}) + outgoing_integration_type_id: Optional[StrictInt] = Field(default=None, description="Identifier of the outgoing integration type.", alias="outgoingIntegrationTypeId", json_schema_extra={"examples": [1]}) + 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') diff --git a/talon_one/models/will_award_giveaway_effect_props.py b/talon_one/models/will_award_giveaway_effect_props.py index c901c5b..6fcd86c 100644 --- a/talon_one/models/will_award_giveaway_effect_props.py +++ b/talon_one/models/will_award_giveaway_effect_props.py @@ -26,11 +26,11 @@ class WillAwardGiveawayEffectProps(BaseModel): """ - The properties specific to the \"awardGiveaway\" effect when the session is not closed yet. This effect replaces \"awardGiveaway\" only when updating a session with any state other than \"closed\". This is to ensure no giveaway codes are leaked when they are still not guaranteed to be awarded. + The equivalent of the `awardGiveaway` effect but returned when updating a session with any state other than `closed`. This ensures no giveaway codes are leaked when they are still not guaranteed to be awarded. For more information about session states, see [Manage the session's state](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#manage-the-sessions-state). """ # noqa: E501 - pool_id: StrictInt = Field(description="The ID of the giveaways pool the code will be taken from.", alias="poolId") - pool_name: StrictStr = Field(description="The name of the giveaways pool the code will be taken from.", alias="poolName") - recipient_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID of the profile that will be awarded the giveaway.", alias="recipientIntegrationId") + pool_id: StrictInt = Field(description="The internal ID of the giveaway pool.", alias="poolId", json_schema_extra={"examples": [2]}) + pool_name: StrictStr = Field(description="The name of the giveaway pool.", alias="poolName", json_schema_extra={"examples": ["My pool"]}) + recipient_integration_id: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The integration ID of the customer that receives the giveaway.", alias="recipientIntegrationId", json_schema_extra={"examples": ["URNGV8294NV"]}) __properties: ClassVar[List[str]] = ["poolId", "poolName", "recipientIntegrationId"] model_config = ConfigDict( diff --git a/test/test_achievement_additional_properties_v2.py b/test/test_achievement_additional_properties_v2.py index fbe7413..5ced951 100644 --- a/test/test_achievement_additional_properties_v2.py +++ b/test/test_achievement_additional_properties_v2.py @@ -37,8 +37,9 @@ def make_instance(self, include_optional) -> AchievementAdditionalPropertiesV2: return AchievementAdditionalPropertiesV2( user_id = 1234, created_by = 'John Doe', + period_end_override = {month=11, dayOfMonth=23, hour=23, minute=59, second=59}, has_progress = True, - status = 'inprogress' + status = 'active' ) else: return AchievementAdditionalPropertiesV2( diff --git a/test/test_achievement_reference.py b/test/test_achievement_reference.py index fc412ec..8d017f0 100644 --- a/test/test_achievement_reference.py +++ b/test/test_achievement_reference.py @@ -38,7 +38,8 @@ def make_instance(self, include_optional) -> AchievementReference: achievement_id = 12, application_id = 101, application_name = 'North America Storefront', - campaign_id = 4501 + campaign_id = 4501, + campaign_name = 'Summer promotions' ) else: return AchievementReference( @@ -46,6 +47,7 @@ def make_instance(self, include_optional) -> AchievementReference: application_id = 101, application_name = 'North America Storefront', campaign_id = 4501, + campaign_name = 'Summer promotions', ) """ diff --git a/test/test_achievement_v2.py b/test/test_achievement_v2.py index 10b7495..67034f9 100644 --- a/test/test_achievement_v2.py +++ b/test/test_achievement_v2.py @@ -50,8 +50,9 @@ def make_instance(self, include_optional) -> AchievementV2: subscribed_applications = [132, 97], user_id = 1234, created_by = 'John Doe', + period_end_override = {month=11, dayOfMonth=23, hour=23, minute=59, second=59}, has_progress = True, - status = 'inprogress', + status = 'active', sandbox = True, timezone = 'Europe/Berlin' ) diff --git a/test/test_campaign_eligibility.py b/test/test_campaign_eligibility.py index d95c338..d4fe7a0 100644 --- a/test/test_campaign_eligibility.py +++ b/test/test_campaign_eligibility.py @@ -53,7 +53,10 @@ def make_instance(self, include_optional) -> CampaignEligibility: ], rules = [ null - ] + ], + experiment = talon_one.models.campaign_eligibility_experiment.CampaignEligibilityExperiment( + id = 56, + variant_id = 56, ) ) else: return CampaignEligibility( diff --git a/test/test_scim_service_provider_config_response_sort.py b/test/test_campaign_eligibility_experiment.py similarity index 65% rename from test/test_scim_service_provider_config_response_sort.py rename to test/test_campaign_eligibility_experiment.py index 7588e16..93068cd 100644 --- a/test/test_scim_service_provider_config_response_sort.py +++ b/test/test_campaign_eligibility_experiment.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.scim_service_provider_config_response_sort import ScimServiceProviderConfigResponseSort +from talon_one.models.campaign_eligibility_experiment import CampaignEligibilityExperiment -class TestScimServiceProviderConfigResponseSort(unittest.TestCase): - """ScimServiceProviderConfigResponseSort unit test stubs""" +class TestCampaignEligibilityExperiment(unittest.TestCase): + """CampaignEligibilityExperiment unit test stubs""" def setUp(self): pass @@ -25,25 +25,28 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> ScimServiceProviderConfigResponseSort: - """Test ScimServiceProviderConfigResponseSort + def make_instance(self, include_optional) -> CampaignEligibilityExperiment: + """Test CampaignEligibilityExperiment 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` + # uncomment below to create an instance of `CampaignEligibilityExperiment` """ - model = ScimServiceProviderConfigResponseSort() + model = CampaignEligibilityExperiment() if include_optional: - return ScimServiceProviderConfigResponseSort( - supported = True + return CampaignEligibilityExperiment( + id = 56, + variant_id = 56 ) else: - return ScimServiceProviderConfigResponseSort( + return CampaignEligibilityExperiment( + id = 56, + variant_id = 56, ) """ - def testScimServiceProviderConfigResponseSort(self): - """Test ScimServiceProviderConfigResponseSort""" + def testCampaignEligibilityExperiment(self): + """Test CampaignEligibilityExperiment""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_change.py b/test/test_change.py index b71a0bc..aa93604 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 = {}, - new = {applicationId"=359, attributes"={}, campaignGroups"=[], created"=2022-07-08T13:04:02.972762328Z, description"=, features"=[referrals, loyalty], id=6727}, + old = None, + new = None, management_key_id = 3 ) else: diff --git a/test/test_event.py b/test/test_event.py index 8f98b71..e2221b3 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 = {myAttribute=myValue}, + attributes = None, 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 = {myAttribute=myValue}, + attributes = None, effects = [ None ], diff --git a/test/test_event_v3.py b/test/test_event_v3.py index 285de00..e266a3a 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 = {myAttribute=myValue}, + attributes = None, 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 = {myAttribute=myValue}, + attributes = None, effects = [ None ], diff --git a/test/test_experiment_confidence_timeline.py b/test/test_experiment_confidence_timeline.py new file mode 100644 index 0000000..ed3c083 --- /dev/null +++ b/test/test_experiment_confidence_timeline.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.experiment_confidence_timeline import ExperimentConfidenceTimeline + +class TestExperimentConfidenceTimeline(unittest.TestCase): + """ExperimentConfidenceTimeline unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ExperimentConfidenceTimeline: + """Test ExperimentConfidenceTimeline + 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 `ExperimentConfidenceTimeline` + """ + model = ExperimentConfidenceTimeline() + if include_optional: + return ExperimentConfidenceTimeline( + data = [ + talon_one.models.experiment_confidence_timeline_data_point.ExperimentConfidenceTimelineDataPoint( + date = '2024-01-15T00:00:00+07:00', + confidence = talon_one.models.experiment_variant_result_confidence.ExperimentVariantResultConfidence( + avg_session_value = 100, + avg_discounted_session_value = 100, + avg_items_per_session = 100, ), ) + ] + ) + else: + return ExperimentConfidenceTimeline( + data = [ + talon_one.models.experiment_confidence_timeline_data_point.ExperimentConfidenceTimelineDataPoint( + date = '2024-01-15T00:00:00+07:00', + confidence = talon_one.models.experiment_variant_result_confidence.ExperimentVariantResultConfidence( + avg_session_value = 100, + avg_discounted_session_value = 100, + avg_items_per_session = 100, ), ) + ], + ) + """ + + def testExperimentConfidenceTimeline(self): + """Test ExperimentConfidenceTimeline""" + # 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_experiment_confidence_timeline_data_point.py similarity index 51% rename from test/test_update_customer_profile_v2409_response.py rename to test/test_experiment_confidence_timeline_data_point.py index bbf714c..4476235 100644 --- a/test/test_update_customer_profile_v2409_response.py +++ b/test/test_experiment_confidence_timeline_data_point.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.update_customer_profile_v2409_response import UpdateCustomerProfileV2409Response +from talon_one.models.experiment_confidence_timeline_data_point import ExperimentConfidenceTimelineDataPoint -class TestUpdateCustomerProfileV2409Response(unittest.TestCase): - """UpdateCustomerProfileV2409Response unit test stubs""" +class TestExperimentConfidenceTimelineDataPoint(unittest.TestCase): + """ExperimentConfidenceTimelineDataPoint unit test stubs""" def setUp(self): pass @@ -25,29 +25,34 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> UpdateCustomerProfileV2409Response: - """Test UpdateCustomerProfileV2409Response + def make_instance(self, include_optional) -> ExperimentConfidenceTimelineDataPoint: + """Test ExperimentConfidenceTimelineDataPoint 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` + # uncomment below to create an instance of `ExperimentConfidenceTimelineDataPoint` """ - model = UpdateCustomerProfileV2409Response() + model = ExperimentConfidenceTimelineDataPoint() if include_optional: - return UpdateCustomerProfileV2409Response( - message = 'Too many requests are updating this profile at the same time', - errors = [ - null - ], - status_code = 409 + return ExperimentConfidenceTimelineDataPoint( + var_date = '2024-01-15T00:00:00+07:00', + confidence = talon_one.models.experiment_variant_result_confidence.ExperimentVariantResultConfidence( + avg_session_value = 100, + avg_discounted_session_value = 100, + avg_items_per_session = 100, ) ) else: - return UpdateCustomerProfileV2409Response( + return ExperimentConfidenceTimelineDataPoint( + var_date = '2024-01-15T00:00:00+07:00', + confidence = talon_one.models.experiment_variant_result_confidence.ExperimentVariantResultConfidence( + avg_session_value = 100, + avg_discounted_session_value = 100, + avg_items_per_session = 100, ), ) """ - def testUpdateCustomerProfileV2409Response(self): - """Test UpdateCustomerProfileV2409Response""" + def testExperimentConfidenceTimelineDataPoint(self): + """Test ExperimentConfidenceTimelineDataPoint""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_integration_api.py b/test/test_integration_api.py index 3f94008..53a63d3 100644 --- a/test/test_integration_api.py +++ b/test/test_integration_api.py @@ -138,6 +138,13 @@ def test_get_customer_session(self) -> None: """ pass + def test_get_event_v3(self) -> None: + """Test case for get_event_v3 + + Get advanced event + """ + pass + def test_get_loyalty_balances(self) -> None: """Test case for get_loyalty_balances @@ -229,6 +236,13 @@ def test_track_event_v2(self) -> None: """ pass + def test_track_event_v3(self) -> None: + """Test case for track_event_v3 + + Track advanced event + """ + pass + def test_unlink_loyalty_card_from_profile(self) -> None: """Test case for unlink_loyalty_card_from_profile diff --git a/test/test_integration_event.py b/test/test_integration_event.py index 352a1d7..11b7a6b 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 = {myAttribute=myValue} + attributes = None ) else: return IntegrationEvent( type = 'pageViewed', - attributes = {myAttribute=myValue}, + attributes = None, ) """ diff --git a/test/test_integration_hub_event_payload_loyalty_profile_based_notification.py b/test/test_integration_hub_event_payload_loyalty_profile_based_notification.py deleted file mode 100644 index f8b5381..0000000 --- a/test/test_integration_hub_event_payload_loyalty_profile_based_notification.py +++ /dev/null @@ -1,76 +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 - - -import unittest - -from talon_one.models.integration_hub_event_payload_loyalty_profile_based_notification import IntegrationHubEventPayloadLoyaltyProfileBasedNotification - -class TestIntegrationHubEventPayloadLoyaltyProfileBasedNotification(unittest.TestCase): - """IntegrationHubEventPayloadLoyaltyProfileBasedNotification unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> IntegrationHubEventPayloadLoyaltyProfileBasedNotification: - """Test IntegrationHubEventPayloadLoyaltyProfileBasedNotification - 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 `IntegrationHubEventPayloadLoyaltyProfileBasedNotification` - """ - model = IntegrationHubEventPayloadLoyaltyProfileBasedNotification() - if include_optional: - return IntegrationHubEventPayloadLoyaltyProfileBasedNotification( - profile_integration_id = '', - loyalty_program_id = 56, - loyalty_program_name = '', - subledger_id = '', - source_of_event = '', - current_tier = '', - employee_name = '', - user_id = 56, - current_points = 1.337, - 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 = '' - ) - else: - return IntegrationHubEventPayloadLoyaltyProfileBasedNotification( - profile_integration_id = '', - loyalty_program_id = 56, - loyalty_program_name = '', - subledger_id = '', - source_of_event = '', - current_tier = '', - current_points = 1.337, - published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - ) - """ - - def testIntegrationHubEventPayloadLoyaltyProfileBasedNotification(self): - """Test IntegrationHubEventPayloadLoyaltyProfileBasedNotification""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_integration_hub_event_record.py b/test/test_integration_hub_event_record.py index 9a1e0a8..1ccb137 100644 --- a/test/test_integration_hub_event_record.py +++ b/test/test_integration_hub_event_record.py @@ -37,23 +37,25 @@ def make_instance(self, include_optional) -> IntegrationHubEventRecord: return IntegrationHubEventRecord( id = 56, flow_id = 56, - event_type = '', - event_data = None, + integration_name = '', + instance_name = '', + event_type = 'CouponCreated', published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), processed_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), delivered_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - process_after = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - retry = 56 + scheduled_to = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + retry = 56, + payload = '' ) else: return IntegrationHubEventRecord( id = 56, flow_id = 56, - event_type = '', - event_data = None, + event_type = 'CouponCreated', published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - process_after = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + scheduled_to = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), retry = 56, + payload = '', ) """ diff --git a/test/test_integration_hub_event_type.py b/test/test_integration_hub_event_type.py new file mode 100644 index 0000000..e3596dc --- /dev/null +++ b/test/test_integration_hub_event_type.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.integration_hub_event_type import IntegrationHubEventType + +class TestIntegrationHubEventType(unittest.TestCase): + """IntegrationHubEventType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testIntegrationHubEventType(self): + """Test IntegrationHubEventType""" + # inst = IntegrationHubEventType() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_integration_hub_flow.py b/test/test_integration_hub_flow.py index 3328460..67df5c5 100644 --- a/test/test_integration_hub_flow.py +++ b/test/test_integration_hub_flow.py @@ -36,12 +36,13 @@ def make_instance(self, include_optional) -> IntegrationHubFlow: if include_optional: return IntegrationHubFlow( application_id = 54, - event_type = '', + loyalty_program_id = 12, + event_type = 'CouponCreated', integration_hub_flow_url = '' ) else: return IntegrationHubFlow( - event_type = '', + event_type = 'CouponCreated', integration_hub_flow_url = '', ) """ diff --git a/test/test_integration_hub_flow_response.py b/test/test_integration_hub_flow_response.py index 0dc34f4..2b4b055 100644 --- a/test/test_integration_hub_flow_response.py +++ b/test/test_integration_hub_flow_response.py @@ -36,7 +36,12 @@ def make_instance(self, include_optional) -> IntegrationHubFlowResponse: if include_optional: return IntegrationHubFlowResponse( id = 56, + integration_name = '', + instance_name = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + disabled_until = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), application_id = 54, + loyalty_program_id = 12, event_type = '', integration_hub_flow_url = '', config = talon_one.models.integration_hub_flow_config_response.IntegrationHubFlowConfigResponse( @@ -47,6 +52,7 @@ def make_instance(self, include_optional) -> IntegrationHubFlowResponse: else: return IntegrationHubFlowResponse( id = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), event_type = '', integration_hub_flow_url = '', config = talon_one.models.integration_hub_flow_config_response.IntegrationHubFlowConfigResponse( diff --git a/test/test_integration_hub_flow_with_config.py b/test/test_integration_hub_flow_with_config.py index a79311a..86482d3 100644 --- a/test/test_integration_hub_flow_with_config.py +++ b/test/test_integration_hub_flow_with_config.py @@ -36,7 +36,8 @@ def make_instance(self, include_optional) -> IntegrationHubFlowWithConfig: if include_optional: return IntegrationHubFlowWithConfig( application_id = 54, - event_type = '', + loyalty_program_id = 12, + event_type = 'CouponCreated', integration_hub_flow_url = '', config = talon_one.models.integration_hub_flow_config.IntegrationHubFlowConfig( api_key = '', @@ -46,7 +47,7 @@ def make_instance(self, include_optional) -> IntegrationHubFlowWithConfig: ) else: return IntegrationHubFlowWithConfig( - event_type = '', + event_type = 'CouponCreated', integration_hub_flow_url = '', config = talon_one.models.integration_hub_flow_config.IntegrationHubFlowConfig( api_key = '', diff --git a/test/test_integration_hub_paginated_event_payload.py b/test/test_integration_hub_paginated_event_payload.py index f278bf5..c3da2cf 100644 --- a/test/test_integration_hub_paginated_event_payload.py +++ b/test/test_integration_hub_paginated_event_payload.py @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> IntegrationHubPaginatedEventPayload return IntegrationHubPaginatedEventPayload( total_result_size = 56, batched_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - event_type = 'LoyaltyPointsChanged', + event_type = 'CouponCreated', data = [ null ] @@ -45,7 +45,7 @@ def make_instance(self, include_optional) -> IntegrationHubPaginatedEventPayload else: return IntegrationHubPaginatedEventPayload( total_result_size = 56, - event_type = 'LoyaltyPointsChanged', + event_type = 'CouponCreated', data = [ null ], diff --git a/test/test_inventory_referral.py b/test/test_inventory_referral.py index 5db924f..fd967ea 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 = {channel=web}, + attributes = None, import_id = 4, code = '27G47Y54VH9L', usage_counter = 1, diff --git a/test/test_management_api.py b/test/test_management_api.py index 5dfb96b..ca12447 100644 --- a/test/test_management_api.py +++ b/test/test_management_api.py @@ -964,6 +964,13 @@ def test_import_loyalty_customers_tiers(self) -> None: """ pass + def test_import_loyalty_join_dates(self) -> None: + """Test case for import_loyalty_join_dates + + Import join dates for a loyalty program + """ + pass + def test_import_loyalty_points(self) -> None: """Test case for import_loyalty_points diff --git a/test/test_new_coupons.py b/test/test_new_coupons.py index 4d7ff3e..5b86ab5 100644 --- a/test/test_new_coupons.py +++ b/test/test_new_coupons.py @@ -49,7 +49,7 @@ def make_instance(self, include_optional) -> NewCoupons: ], number_of_coupons = 1, unique_prefix = '', - attributes = {venueId=12}, + attributes = None, recipient_integration_id = 'URNGV8294NV', valid_characters = [A, B, G, Y], coupon_pattern = 'SUMMER-#####', diff --git a/test/test_new_coupons_for_multiple_recipients.py b/test/test_new_coupons_for_multiple_recipients.py index ebbef23..876a40f 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 = {venueId=12}, + attributes = None, 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_event.py b/test/test_new_event.py index 8d3d7a3..a0e3aa7 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 = {myAttribute=myValue}, + attributes = None, session_id = '175KJPS947296' ) else: return NewEvent( type = 'pageViewed', - attributes = {myAttribute=myValue}, + attributes = None, session_id = '175KJPS947296', ) """ diff --git a/test/test_new_referral.py b/test/test_new_referral.py index 95d644a..d403870 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 = {channel=web} + attributes = None ) else: return NewReferral( diff --git a/test/test_new_referrals_for_multiple_advocates.py b/test/test_new_referrals_for_multiple_advocates.py index 4f7c1ff..47763e0 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 = {channel=web}, + attributes = None, 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_new_role_v2.py b/test/test_new_role_v2.py index 538e21f..f34d2a8 100644 --- a/test/test_new_role_v2.py +++ b/test/test_new_role_v2.py @@ -43,7 +43,12 @@ def make_instance(self, include_optional) -> NewRoleV2: applications = {1={application=Application permission set}, 3={campaign=Campaign manager permission set}, 4={draftCampaign=Campaign read-only permission set}, 5={tools=Tools permission set}}, loyalty_programs = {10=Loyalty program manager permission set}, campaign_access_groups = {5=Campaign access group manager permission set}, - account = '', ), ), + account = '', ), + thresholds = [ + talon_one.models.roles_v2_thresholds.RolesV2Thresholds( + loyalty_program_id = 8, + loyalty_points_limit = 100, ) + ], ), members = [10, 12] ) else: diff --git a/test/test_referral.py b/test/test_referral.py index 0d808fd..f9e4799 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 = {channel=web}, + attributes = None, import_id = 4, code = '27G47Y54VH9L', usage_counter = 1, diff --git a/test/test_role_v2.py b/test/test_role_v2.py index 24e3763..14461b7 100644 --- a/test/test_role_v2.py +++ b/test/test_role_v2.py @@ -47,7 +47,12 @@ def make_instance(self, include_optional) -> RoleV2: applications = {1={application=Application permission set}, 3={campaign=Campaign manager permission set}, 4={draftCampaign=Campaign read-only permission set}, 5={tools=Tools permission set}}, loyalty_programs = {10=Loyalty program manager permission set}, campaign_access_groups = {5=Campaign access group manager permission set}, - account = '', ), ), + account = '', ), + thresholds = [ + talon_one.models.roles_v2_thresholds.RolesV2Thresholds( + loyalty_program_id = 8, + loyalty_points_limit = 100, ) + ], ), members = [10, 12], is_readonly = False ) diff --git a/test/test_role_v2_application_details.py b/test/test_role_v2_application_details.py index 7a52dc2..88baea7 100644 --- a/test/test_role_v2_application_details.py +++ b/test/test_role_v2_application_details.py @@ -38,9 +38,7 @@ def make_instance(self, include_optional) -> RoleV2ApplicationDetails: application = '', campaign = '', draft_campaign = '', - tools = 'Tools permission set', - thresholds = talon_one.models.roles_v2_thresholds.RolesV2Thresholds( - loyalty_points_limit = 100, ) + tools = 'Tools permission set' ) else: return RoleV2ApplicationDetails( diff --git a/test/test_role_v2_base.py b/test/test_role_v2_base.py index 0b8df06..d01b607 100644 --- a/test/test_role_v2_base.py +++ b/test/test_role_v2_base.py @@ -43,7 +43,12 @@ def make_instance(self, include_optional) -> RoleV2Base: applications = {1={application=Application permission set}, 3={campaign=Campaign manager permission set}, 4={draftCampaign=Campaign read-only permission set}, 5={tools=Tools permission set}}, loyalty_programs = {10=Loyalty program manager permission set}, campaign_access_groups = {5=Campaign access group manager permission set}, - account = '', ), ), + account = '', ), + thresholds = [ + talon_one.models.roles_v2_thresholds.RolesV2Thresholds( + loyalty_program_id = 8, + loyalty_points_limit = 100, ) + ], ), members = [10, 12] ) else: diff --git a/test/test_role_v2_permissions.py b/test/test_role_v2_permissions.py index ee4d4f2..ea95d80 100644 --- a/test/test_role_v2_permissions.py +++ b/test/test_role_v2_permissions.py @@ -40,7 +40,12 @@ def make_instance(self, include_optional) -> RoleV2Permissions: applications = {1={application=Application permission set}, 3={campaign=Campaign manager permission set}, 4={draftCampaign=Campaign read-only permission set}, 5={tools=Tools permission set}}, loyalty_programs = {10=Loyalty program manager permission set}, campaign_access_groups = {5=Campaign access group manager permission set}, - account = '', ) + account = '', ), + thresholds = [ + talon_one.models.roles_v2_thresholds.RolesV2Thresholds( + loyalty_program_id = 8, + loyalty_points_limit = 100, ) + ] ) else: return RoleV2Permissions( diff --git a/test/test_roles_v2_thresholds.py b/test/test_roles_v2_thresholds.py index e2ace9e..405bb83 100644 --- a/test/test_roles_v2_thresholds.py +++ b/test/test_roles_v2_thresholds.py @@ -35,6 +35,7 @@ def make_instance(self, include_optional) -> RolesV2Thresholds: model = RolesV2Thresholds() if include_optional: return RolesV2Thresholds( + loyalty_program_id = 8, loyalty_points_limit = 100 ) else: diff --git a/test/test_scim_service_provider_config_response.py b/test/test_scim_service_provider_config_response.py index 72ec9c7..80ead34 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_patch.ScimServiceProviderConfigResponse_patch( + patch = talon_one.models.scim_service_provider_config_response_change_password.ScimServiceProviderConfigResponse_changePassword( supported = True, ), schemas = [ '' ], - sort = talon_one.models.scim_service_provider_config_response_sort.ScimServiceProviderConfigResponse_sort( + sort = talon_one.models.scim_service_provider_config_response_change_password.ScimServiceProviderConfigResponse_changePassword( supported = True, ) ) else: diff --git a/test/test_scim_service_provider_config_response_patch.py b/test/test_update_risk_notification.py similarity index 62% rename from test/test_scim_service_provider_config_response_patch.py rename to test/test_update_risk_notification.py index 50a826c..a07bc47 100644 --- a/test/test_scim_service_provider_config_response_patch.py +++ b/test/test_update_risk_notification.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.scim_service_provider_config_response_patch import ScimServiceProviderConfigResponsePatch +from talon_one.models.update_risk_notification import UpdateRiskNotification -class TestScimServiceProviderConfigResponsePatch(unittest.TestCase): - """ScimServiceProviderConfigResponsePatch unit test stubs""" +class TestUpdateRiskNotification(unittest.TestCase): + """UpdateRiskNotification unit test stubs""" def setUp(self): pass @@ -25,25 +25,32 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> ScimServiceProviderConfigResponsePatch: - """Test ScimServiceProviderConfigResponsePatch + def make_instance(self, include_optional) -> UpdateRiskNotification: + """Test UpdateRiskNotification 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` + # uncomment below to create an instance of `UpdateRiskNotification` """ - model = ScimServiceProviderConfigResponsePatch() + model = UpdateRiskNotification() if include_optional: - return ScimServiceProviderConfigResponsePatch( - supported = True + return UpdateRiskNotification( + entity = 'customer_profile', + activity = 'loyalty_points_earned', + time_frame = '1_week', + active = True ) else: - return ScimServiceProviderConfigResponsePatch( + return UpdateRiskNotification( + entity = 'customer_profile', + activity = 'loyalty_points_earned', + time_frame = '1_week', + active = True, ) """ - def testScimServiceProviderConfigResponsePatch(self): - """Test ScimServiceProviderConfigResponsePatch""" + def testUpdateRiskNotification(self): + """Test UpdateRiskNotification""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_user.py b/test/test_user.py index f8b3270..91824d7 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 = {}, + application_notification_subscriptions = None, 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 = {} + additional_attributes = None ) else: return User(