From 6a0894a692df57205a9265bcd97477ca1dba253a Mon Sep 17 00:00:00 2001 From: Talon-One SDK Generator Date: Thu, 5 Mar 2026 14:21:43 +0000 Subject: [PATCH] update to 26.05 --- .openapi-generator/FILES | 134 +- README.md | 49 +- docs/BestPriorPrice.md | 3 +- docs/BestPriorPriceRequest.md | 3 +- docs/CouponCreatedEventRequest.md | 32 + docs/CouponDeletedEventRequest.md | 32 + docs/CouponUpdatedEventRequest.md | 32 + docs/Experiment.md | 4 +- docs/ExperimentCampaignCopy.md | 34 + docs/ExperimentCopy.md | 30 + docs/ExperimentCopyExperiment.md | 30 + docs/History.md | 34 + docs/IntegrationApi.md | 96 + docs/IntegrationHubConfig.md | 31 + ...ubEventPayloadCouponBasedNotifications.md} | 18 +- ...ntPayloadCouponBasedNotificationsLimits.md | 32 + ...tPayloadLoyaltyProfileBasedNotification.md | 43 + ...tyProfileBasedPointsChangedNotification.md | 37 + ...ileBasedPointsChangedNotificationAction.md | 33 + ...tyProfileBasedTierDowngradeNotification.md | 38 + ...altyProfileBasedTierUpgradeNotification.md | 40 + ...Record.md => IntegrationHubEventRecord.md} | 16 +- ...PrismaticFlow.md => IntegrationHubFlow.md} | 18 +- docs/IntegrationHubFlowConfig.md | 32 + docs/IntegrationHubFlowConfigResponse.md | 31 + docs/IntegrationHubFlowResponse.md | 33 + docs/IntegrationHubFlowWithConfig.md | 32 + docs/IntegrationHubPaginatedEventPayload.md | 32 + docs/ListExperiments200Response.md | 30 + docs/LoyaltyPointsChangedEventRequest.md | 32 + docs/LoyaltyTierDowngradeEventRequest.md | 32 + ...d.md => LoyaltyTierUpgradeEventRequest.md} | 16 +- docs/ManagementApi.md | 17997 +---- docs/NewExperiment.md | 4 +- docs/PriceHistoryRequest.md | 31 + docs/PriceHistoryResponse.md | 30 + docs/PrismaticConfig.md | 31 - ...ntPayloadCouponBasedNotificationsLimits.md | 32 - ...tPayloadLoyaltyProfileBasedNotification.md | 43 - ...tyProfileBasedPointsChangedNotification.md | 37 - ...ileBasedPointsChangedNotificationAction.md | 33 - ...tyProfileBasedTierDowngradeNotification.md | 38 - ...altyProfileBasedTierUpgradeNotification.md | 40 - docs/PrismaticFlowConfig.md | 32 - docs/PrismaticFlowConfigResponse.md | 31 - docs/PrismaticFlowResponse.md | 33 - docs/PrismaticFlowWithConfig.md | 32 - docs/PromoteExperiment.md | 32 + docs/UpdateExperiment.md | 2 +- docs/UpdateExperimentVariant.md | 2 +- pyproject.toml | 2 +- setup.py | 2 +- talon_one/__init__.py | 90 +- talon_one/api/integration_api.py | 278 + talon_one/api/management_api.py | 54944 +--------------- talon_one/api_client.py | 2 +- talon_one/configuration.py | 2 +- talon_one/models/__init__.py | 44 +- talon_one/models/best_prior_price.py | 6 +- talon_one/models/best_prior_price_request.py | 18 +- .../models/coupon_created_event_request.py | 101 + .../models/coupon_deleted_event_request.py | 101 + .../models/coupon_updated_event_request.py | 101 + talon_one/models/experiment.py | 11 +- talon_one/models/experiment_campaign_copy.py | 99 + talon_one/models/experiment_copy.py | 93 + .../models/experiment_copy_experiment.py | 93 + talon_one/models/history.py | 102 + ...ic_config.py => integration_hub_config.py} | 14 +- ...ent_payload_coupon_based_notifications.py} | 14 +- ...load_coupon_based_notifications_limits.py} | 8 +- ...oad_loyalty_profile_based_notification.py} | 14 +- ...file_based_points_changed_notification.py} | 14 +- ...sed_points_changed_notification_action.py} | 8 +- ...file_based_tier_downgrade_notification.py} | 8 +- ...rofile_based_tier_upgrade_notification.py} | 8 +- ...ord.py => integration_hub_event_record.py} | 8 +- ...smatic_flow.py => integration_hub_flow.py} | 14 +- ...nfig.py => integration_hub_flow_config.py} | 14 +- ...> integration_hub_flow_config_response.py} | 14 +- ...se.py => integration_hub_flow_response.py} | 22 +- ...py => integration_hub_flow_with_config.py} | 20 +- ...ntegration_hub_paginated_event_payload.py} | 8 +- .../models/list_experiments200_response.py | 97 + .../loyalty_points_changed_event_request.py | 101 + .../loyalty_tier_downgrade_event_request.py | 101 + .../loyalty_tier_upgrade_event_request.py | 101 + talon_one/models/new_experiment.py | 23 +- talon_one/models/new_experiment_variant.py | 11 +- talon_one/models/price_history_request.py | 92 + talon_one/models/price_history_response.py | 97 + talon_one/models/promote_experiment.py | 97 + talon_one/models/update_experiment.py | 2 +- talon_one/models/update_experiment_variant.py | 4 +- test/test_best_prior_price.py | 6 +- test/test_best_prior_price_request.py | 1 + test/test_coupon_created_event_request.py | 61 + test/test_coupon_deleted_event_request.py | 61 + test/test_coupon_updated_event_request.py | 61 + test/test_experiment.py | 1 + test/test_experiment_campaign_copy.py | 56 + test/test_experiment_copy.py | 70 + test/test_experiment_copy_experiment.py | 66 + test/test_history.py | 74 + test/test_integration_api.py | 7 + ...nfig.py => test_integration_hub_config.py} | 26 +- ...ent_payload_coupon_based_notifications.py} | 24 +- ...load_coupon_based_notifications_limits.py} | 22 +- ...oad_loyalty_profile_based_notification.py} | 22 +- ...file_based_points_changed_notification.py} | 22 +- ...sed_points_changed_notification_action.py} | 22 +- ...file_based_tier_downgrade_notification.py} | 22 +- ...rofile_based_tier_upgrade_notification.py} | 22 +- ...y => test_integration_hub_event_record.py} | 22 +- ...c_flow.py => test_integration_hub_flow.py} | 26 +- ...py => test_integration_hub_flow_config.py} | 22 +- ...t_integration_hub_flow_config_response.py} | 22 +- ... => test_integration_hub_flow_response.py} | 30 +- ... test_integration_hub_flow_with_config.py} | 30 +- ...integration_hub_paginated_event_payload.py | 61 + test/test_list_experiments200_response.py | 58 + ...t_loyalty_points_changed_event_request.py} | 22 +- ...st_loyalty_tier_downgrade_event_request.py | 61 + ...test_loyalty_tier_upgrade_event_request.py | 61 + test/test_management_api.py | 28 + test/test_new_experiment.py | 2 - test/test_new_experiment_variant.py | 4 +- test/test_new_experiment_variant_array.py | 4 +- test/test_price_history_request.py | 56 + test/test_price_history_response.py | 82 + test/test_promote_experiment.py | 69 + 131 files changed, 4310 insertions(+), 73568 deletions(-) create mode 100644 docs/CouponCreatedEventRequest.md create mode 100644 docs/CouponDeletedEventRequest.md create mode 100644 docs/CouponUpdatedEventRequest.md create mode 100644 docs/ExperimentCampaignCopy.md create mode 100644 docs/ExperimentCopy.md create mode 100644 docs/ExperimentCopyExperiment.md create mode 100644 docs/History.md create mode 100644 docs/IntegrationHubConfig.md rename docs/{PrismaticEventPayloadCouponBasedNotifications.md => IntegrationHubEventPayloadCouponBasedNotifications.md} (54%) create mode 100644 docs/IntegrationHubEventPayloadCouponBasedNotificationsLimits.md create mode 100644 docs/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md create mode 100644 docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md create mode 100644 docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md create mode 100644 docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md create mode 100644 docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md rename docs/{PrismaticEventRecord.md => IntegrationHubEventRecord.md} (55%) rename docs/{PrismaticFlow.md => IntegrationHubFlow.md} (50%) create mode 100644 docs/IntegrationHubFlowConfig.md create mode 100644 docs/IntegrationHubFlowConfigResponse.md create mode 100644 docs/IntegrationHubFlowResponse.md create mode 100644 docs/IntegrationHubFlowWithConfig.md create mode 100644 docs/IntegrationHubPaginatedEventPayload.md create mode 100644 docs/ListExperiments200Response.md create mode 100644 docs/LoyaltyPointsChangedEventRequest.md create mode 100644 docs/LoyaltyTierDowngradeEventRequest.md rename docs/{PrismaticPaginatedEventPayload.md => LoyaltyTierUpgradeEventRequest.md} (50%) create mode 100644 docs/PriceHistoryRequest.md create mode 100644 docs/PriceHistoryResponse.md delete mode 100644 docs/PrismaticConfig.md delete mode 100644 docs/PrismaticEventPayloadCouponBasedNotificationsLimits.md delete mode 100644 docs/PrismaticEventPayloadLoyaltyProfileBasedNotification.md delete mode 100644 docs/PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification.md delete mode 100644 docs/PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md delete mode 100644 docs/PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md delete mode 100644 docs/PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md delete mode 100644 docs/PrismaticFlowConfig.md delete mode 100644 docs/PrismaticFlowConfigResponse.md delete mode 100644 docs/PrismaticFlowResponse.md delete mode 100644 docs/PrismaticFlowWithConfig.md create mode 100644 docs/PromoteExperiment.md create mode 100644 talon_one/models/coupon_created_event_request.py create mode 100644 talon_one/models/coupon_deleted_event_request.py create mode 100644 talon_one/models/coupon_updated_event_request.py create mode 100644 talon_one/models/experiment_campaign_copy.py create mode 100644 talon_one/models/experiment_copy.py create mode 100644 talon_one/models/experiment_copy_experiment.py create mode 100644 talon_one/models/history.py rename talon_one/models/{prismatic_config.py => integration_hub_config.py} (84%) rename talon_one/models/{prismatic_event_payload_coupon_based_notifications.py => integration_hub_event_payload_coupon_based_notifications.py} (88%) rename talon_one/models/{prismatic_event_payload_coupon_based_notifications_limits.py => integration_hub_event_payload_coupon_based_notifications_limits.py} (90%) rename talon_one/models/{prismatic_event_payload_loyalty_profile_based_notification.py => integration_hub_event_payload_loyalty_profile_based_notification.py} (86%) rename talon_one/models/{prismatic_event_payload_loyalty_profile_based_points_changed_notification.py => integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py} (82%) rename talon_one/models/{prismatic_event_payload_loyalty_profile_based_points_changed_notification_action.py => integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action.py} (89%) rename talon_one/models/{prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification.py => integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py} (91%) rename talon_one/models/{prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification.py => integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py} (92%) rename talon_one/models/{prismatic_event_record.py => integration_hub_event_record.py} (94%) rename talon_one/models/{prismatic_flow.py => integration_hub_flow.py} (87%) rename talon_one/models/{prismatic_flow_config.py => integration_hub_flow_config.py} (87%) rename talon_one/models/{prismatic_flow_config_response.py => integration_hub_flow_config_response.py} (85%) rename talon_one/models/{prismatic_flow_response.py => integration_hub_flow_response.py} (79%) rename talon_one/models/{prismatic_flow_with_config.py => integration_hub_flow_with_config.py} (81%) rename talon_one/models/{prismatic_paginated_event_payload.py => integration_hub_paginated_event_payload.py} (93%) create mode 100644 talon_one/models/list_experiments200_response.py create mode 100644 talon_one/models/loyalty_points_changed_event_request.py create mode 100644 talon_one/models/loyalty_tier_downgrade_event_request.py create mode 100644 talon_one/models/loyalty_tier_upgrade_event_request.py create mode 100644 talon_one/models/price_history_request.py create mode 100644 talon_one/models/price_history_response.py create mode 100644 talon_one/models/promote_experiment.py create mode 100644 test/test_coupon_created_event_request.py create mode 100644 test/test_coupon_deleted_event_request.py create mode 100644 test/test_coupon_updated_event_request.py create mode 100644 test/test_experiment_campaign_copy.py create mode 100644 test/test_experiment_copy.py create mode 100644 test/test_experiment_copy_experiment.py create mode 100644 test/test_history.py rename test/{test_prismatic_config.py => test_integration_hub_config.py} (70%) rename test/{test_prismatic_event_payload_coupon_based_notifications.py => test_integration_hub_event_payload_coupon_based_notifications.py} (74%) rename test/{test_prismatic_event_payload_coupon_based_notifications_limits.py => test_integration_hub_event_payload_coupon_based_notifications_limits.py} (64%) rename test/{test_prismatic_event_payload_loyalty_profile_based_notification.py => test_integration_hub_event_payload_loyalty_profile_based_notification.py} (72%) rename test/{test_prismatic_event_payload_loyalty_profile_based_points_changed_notification.py => test_integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py} (65%) rename test/{test_prismatic_event_payload_loyalty_profile_based_points_changed_notification_action.py => test_integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action.py} (60%) rename test/{test_prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification.py => test_integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py} (67%) rename test/{test_prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification.py => test_integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py} (68%) rename test/{test_prismatic_event_record.py => test_integration_hub_event_record.py} (79%) rename test/{test_prismatic_flow.py => test_integration_hub_flow.py} (71%) rename test/{test_prismatic_flow_config.py => test_integration_hub_flow_config.py} (73%) rename test/{test_prismatic_flow_config_response.py => test_integration_hub_flow_config_response.py} (69%) rename test/{test_prismatic_flow_response.py => test_integration_hub_flow_response.py} (66%) rename test/{test_prismatic_flow_with_config.py => test_integration_hub_flow_with_config.py} (67%) create mode 100644 test/test_integration_hub_paginated_event_payload.py create mode 100644 test/test_list_experiments200_response.py rename test/{test_prismatic_paginated_event_payload.py => test_loyalty_points_changed_event_request.py} (73%) create mode 100644 test/test_loyalty_tier_downgrade_event_request.py create mode 100644 test/test_loyalty_tier_upgrade_event_request.py create mode 100644 test/test_price_history_request.py create mode 100644 test/test_price_history_response.py create mode 100644 test/test_promote_experiment.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index a99c0be..6e3f78e 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -170,7 +170,9 @@ docs/CollectionWithoutPayload.md docs/Coupon.md docs/CouponConstraints.md docs/CouponCreatedEffectProps.md +docs/CouponCreatedEventRequest.md docs/CouponCreationJob.md +docs/CouponDeletedEventRequest.md docs/CouponDeletionFilters.md docs/CouponDeletionJob.md docs/CouponEntity.md @@ -179,6 +181,7 @@ docs/CouponLimitConfigs.md docs/CouponRejectionReason.md docs/CouponReservations.md docs/CouponSearch.md +docs/CouponUpdatedEventRequest.md docs/CouponValue.md docs/CouponWithApplication.md docs/CouponsNotificationData.md @@ -230,6 +233,9 @@ docs/EventType.md docs/EventV2.md docs/EventV3.md docs/Experiment.md +docs/ExperimentCampaignCopy.md +docs/ExperimentCopy.md +docs/ExperimentCopyExperiment.md docs/ExperimentResults.md docs/ExperimentVariant.md docs/ExperimentVariantAllocation.md @@ -310,6 +316,7 @@ docs/GetWebhooks200Response.md docs/Giveaway.md docs/GiveawaysPool.md docs/HiddenConditionsEffects.md +docs/History.md docs/IdentifiableEntity.md docs/ImportEntity.md docs/IncreaseAchievementProgressEffectProps.md @@ -325,6 +332,21 @@ docs/IntegrationEventV2Request.md docs/IntegrationEventV2Response.md docs/IntegrationEventV3Request.md docs/IntegrationEventV3Response.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/IntegrationHubFlow.md +docs/IntegrationHubFlowConfig.md +docs/IntegrationHubFlowConfigResponse.md +docs/IntegrationHubFlowResponse.md +docs/IntegrationHubFlowWithConfig.md +docs/IntegrationHubPaginatedEventPayload.md docs/IntegrationProfileEntity.md docs/IntegrationProfileEntityV3.md docs/IntegrationRequest.md @@ -351,6 +373,7 @@ docs/ListCampaignStoreBudgetLimits200Response.md docs/ListCampaignStoreBudgets.md docs/ListCampaignStoreBudgetsStore.md docs/ListCatalogItems200Response.md +docs/ListExperiments200Response.md docs/ListStores200Response.md docs/LoginParams.md docs/Loyalty.md @@ -372,6 +395,7 @@ docs/LoyaltyLedgerEntryExpiryDateChange.md docs/LoyaltyLedgerEntryFlags.md docs/LoyaltyLedgerTransactions.md docs/LoyaltyMembership.md +docs/LoyaltyPointsChangedEventRequest.md docs/LoyaltyProgram.md docs/LoyaltyProgramBalance.md docs/LoyaltyProgramEntity.md @@ -379,6 +403,9 @@ docs/LoyaltyProgramLedgers.md docs/LoyaltyProgramTransaction.md docs/LoyaltySubLedger.md docs/LoyaltyTier.md +docs/LoyaltyTierDowngradeEventRequest.md +docs/LoyaltyTierUpgradeEventRequest.md +docs/ManagementApi.md docs/ManagementApi.md docs/ManagementKey.md docs/ManagerConfig.md @@ -491,24 +518,11 @@ docs/PendingPointsNotificationPolicy.md docs/Picklist.md docs/PlaceholderDetails.md docs/PriceDetail.md +docs/PriceHistoryRequest.md +docs/PriceHistoryResponse.md docs/PriceType.md docs/PriceTypeReferenceDetail.md docs/PriceTypeReferences.md -docs/PrismaticConfig.md -docs/PrismaticEventPayloadCouponBasedNotifications.md -docs/PrismaticEventPayloadCouponBasedNotificationsLimits.md -docs/PrismaticEventPayloadLoyaltyProfileBasedNotification.md -docs/PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification.md -docs/PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md -docs/PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md -docs/PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md -docs/PrismaticEventRecord.md -docs/PrismaticFlow.md -docs/PrismaticFlowConfig.md -docs/PrismaticFlowConfigResponse.md -docs/PrismaticFlowResponse.md -docs/PrismaticFlowWithConfig.md -docs/PrismaticPaginatedEventPayload.md docs/Product.md docs/ProductSearchMatch.md docs/ProductUnitAnalytics.md @@ -516,6 +530,7 @@ docs/ProductUnitAnalyticsDataPoint.md docs/ProductUnitAnalyticsTotals.md docs/ProfileAudiencesChanges.md docs/ProjectedTier.md +docs/PromoteExperiment.md docs/RedeemReferralEffectProps.md docs/Referral.md docs/ReferralConstraints.md @@ -679,6 +694,7 @@ talon_one/__init__.py talon_one/api/__init__.py talon_one/api/integration_api.py talon_one/api/management_api.py +talon_one/api/management_api.py talon_one/api_client.py talon_one/api_response.py talon_one/configuration.py @@ -846,7 +862,9 @@ talon_one/models/collection_without_payload.py talon_one/models/coupon.py talon_one/models/coupon_constraints.py talon_one/models/coupon_created_effect_props.py +talon_one/models/coupon_created_event_request.py talon_one/models/coupon_creation_job.py +talon_one/models/coupon_deleted_event_request.py talon_one/models/coupon_deletion_filters.py talon_one/models/coupon_deletion_job.py talon_one/models/coupon_entity.py @@ -855,6 +873,7 @@ talon_one/models/coupon_limit_configs.py talon_one/models/coupon_rejection_reason.py talon_one/models/coupon_reservations.py talon_one/models/coupon_search.py +talon_one/models/coupon_updated_event_request.py talon_one/models/coupon_value.py talon_one/models/coupon_with_application.py talon_one/models/coupons_notification_data.py @@ -906,6 +925,9 @@ talon_one/models/event_type.py talon_one/models/event_v2.py talon_one/models/event_v3.py talon_one/models/experiment.py +talon_one/models/experiment_campaign_copy.py +talon_one/models/experiment_copy.py +talon_one/models/experiment_copy_experiment.py talon_one/models/experiment_results.py talon_one/models/experiment_variant.py talon_one/models/experiment_variant_allocation.py @@ -986,6 +1008,7 @@ talon_one/models/get_webhooks200_response.py talon_one/models/giveaway.py talon_one/models/giveaways_pool.py talon_one/models/hidden_conditions_effects.py +talon_one/models/history.py talon_one/models/identifiable_entity.py talon_one/models/import_entity.py talon_one/models/increase_achievement_progress_effect_props.py @@ -1000,6 +1023,21 @@ talon_one/models/integration_event_v2_request.py talon_one/models/integration_event_v2_response.py talon_one/models/integration_event_v3_request.py talon_one/models/integration_event_v3_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_flow.py +talon_one/models/integration_hub_flow_config.py +talon_one/models/integration_hub_flow_config_response.py +talon_one/models/integration_hub_flow_response.py +talon_one/models/integration_hub_flow_with_config.py +talon_one/models/integration_hub_paginated_event_payload.py talon_one/models/integration_profile_entity.py talon_one/models/integration_profile_entity_v3.py talon_one/models/integration_request.py @@ -1026,6 +1064,7 @@ talon_one/models/list_campaign_store_budget_limits200_response.py talon_one/models/list_campaign_store_budgets.py talon_one/models/list_campaign_store_budgets_store.py talon_one/models/list_catalog_items200_response.py +talon_one/models/list_experiments200_response.py talon_one/models/list_stores200_response.py talon_one/models/login_params.py talon_one/models/loyalty.py @@ -1047,6 +1086,7 @@ talon_one/models/loyalty_ledger_entry_expiry_date_change.py talon_one/models/loyalty_ledger_entry_flags.py talon_one/models/loyalty_ledger_transactions.py talon_one/models/loyalty_membership.py +talon_one/models/loyalty_points_changed_event_request.py talon_one/models/loyalty_program.py talon_one/models/loyalty_program_balance.py talon_one/models/loyalty_program_entity.py @@ -1054,6 +1094,8 @@ talon_one/models/loyalty_program_ledgers.py talon_one/models/loyalty_program_transaction.py talon_one/models/loyalty_sub_ledger.py talon_one/models/loyalty_tier.py +talon_one/models/loyalty_tier_downgrade_event_request.py +talon_one/models/loyalty_tier_upgrade_event_request.py talon_one/models/management_key.py talon_one/models/manager_config.py talon_one/models/message_log_entries.py @@ -1165,24 +1207,11 @@ talon_one/models/pending_points_notification_policy.py talon_one/models/picklist.py talon_one/models/placeholder_details.py talon_one/models/price_detail.py +talon_one/models/price_history_request.py +talon_one/models/price_history_response.py talon_one/models/price_type.py talon_one/models/price_type_reference_detail.py talon_one/models/price_type_references.py -talon_one/models/prismatic_config.py -talon_one/models/prismatic_event_payload_coupon_based_notifications.py -talon_one/models/prismatic_event_payload_coupon_based_notifications_limits.py -talon_one/models/prismatic_event_payload_loyalty_profile_based_notification.py -talon_one/models/prismatic_event_payload_loyalty_profile_based_points_changed_notification.py -talon_one/models/prismatic_event_payload_loyalty_profile_based_points_changed_notification_action.py -talon_one/models/prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification.py -talon_one/models/prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification.py -talon_one/models/prismatic_event_record.py -talon_one/models/prismatic_flow.py -talon_one/models/prismatic_flow_config.py -talon_one/models/prismatic_flow_config_response.py -talon_one/models/prismatic_flow_response.py -talon_one/models/prismatic_flow_with_config.py -talon_one/models/prismatic_paginated_event_payload.py talon_one/models/product.py talon_one/models/product_search_match.py talon_one/models/product_unit_analytics.py @@ -1190,6 +1219,7 @@ talon_one/models/product_unit_analytics_data_point.py talon_one/models/product_unit_analytics_totals.py talon_one/models/profile_audiences_changes.py talon_one/models/projected_tier.py +talon_one/models/promote_experiment.py talon_one/models/redeem_referral_effect_props.py talon_one/models/referral.py talon_one/models/referral_constraints.py @@ -1509,7 +1539,9 @@ test/test_collection_without_payload.py test/test_coupon.py test/test_coupon_constraints.py test/test_coupon_created_effect_props.py +test/test_coupon_created_event_request.py test/test_coupon_creation_job.py +test/test_coupon_deleted_event_request.py test/test_coupon_deletion_filters.py test/test_coupon_deletion_job.py test/test_coupon_entity.py @@ -1518,6 +1550,7 @@ test/test_coupon_limit_configs.py test/test_coupon_rejection_reason.py test/test_coupon_reservations.py test/test_coupon_search.py +test/test_coupon_updated_event_request.py test/test_coupon_value.py test/test_coupon_with_application.py test/test_coupons_notification_data.py @@ -1569,6 +1602,9 @@ test/test_event_type.py test/test_event_v2.py test/test_event_v3.py test/test_experiment.py +test/test_experiment_campaign_copy.py +test/test_experiment_copy.py +test/test_experiment_copy_experiment.py test/test_experiment_results.py test/test_experiment_variant.py test/test_experiment_variant_allocation.py @@ -1649,6 +1685,7 @@ test/test_get_webhooks200_response.py test/test_giveaway.py test/test_giveaways_pool.py test/test_hidden_conditions_effects.py +test/test_history.py test/test_identifiable_entity.py test/test_import_entity.py test/test_increase_achievement_progress_effect_props.py @@ -1664,6 +1701,21 @@ test/test_integration_event_v2_request.py test/test_integration_event_v2_response.py test/test_integration_event_v3_request.py test/test_integration_event_v3_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_flow.py +test/test_integration_hub_flow_config.py +test/test_integration_hub_flow_config_response.py +test/test_integration_hub_flow_response.py +test/test_integration_hub_flow_with_config.py +test/test_integration_hub_paginated_event_payload.py test/test_integration_profile_entity.py test/test_integration_profile_entity_v3.py test/test_integration_request.py @@ -1690,6 +1742,7 @@ test/test_list_campaign_store_budget_limits200_response.py test/test_list_campaign_store_budgets.py test/test_list_campaign_store_budgets_store.py test/test_list_catalog_items200_response.py +test/test_list_experiments200_response.py test/test_list_stores200_response.py test/test_login_params.py test/test_loyalty.py @@ -1711,6 +1764,7 @@ test/test_loyalty_ledger_entry_expiry_date_change.py test/test_loyalty_ledger_entry_flags.py test/test_loyalty_ledger_transactions.py test/test_loyalty_membership.py +test/test_loyalty_points_changed_event_request.py test/test_loyalty_program.py test/test_loyalty_program_balance.py test/test_loyalty_program_entity.py @@ -1718,6 +1772,8 @@ test/test_loyalty_program_ledgers.py test/test_loyalty_program_transaction.py test/test_loyalty_sub_ledger.py test/test_loyalty_tier.py +test/test_loyalty_tier_downgrade_event_request.py +test/test_loyalty_tier_upgrade_event_request.py test/test_management_api.py test/test_management_key.py test/test_manager_config.py @@ -1830,24 +1886,11 @@ test/test_pending_points_notification_policy.py test/test_picklist.py test/test_placeholder_details.py test/test_price_detail.py +test/test_price_history_request.py +test/test_price_history_response.py test/test_price_type.py test/test_price_type_reference_detail.py test/test_price_type_references.py -test/test_prismatic_config.py -test/test_prismatic_event_payload_coupon_based_notifications.py -test/test_prismatic_event_payload_coupon_based_notifications_limits.py -test/test_prismatic_event_payload_loyalty_profile_based_notification.py -test/test_prismatic_event_payload_loyalty_profile_based_points_changed_notification.py -test/test_prismatic_event_payload_loyalty_profile_based_points_changed_notification_action.py -test/test_prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification.py -test/test_prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification.py -test/test_prismatic_event_record.py -test/test_prismatic_flow.py -test/test_prismatic_flow_config.py -test/test_prismatic_flow_config_response.py -test/test_prismatic_flow_response.py -test/test_prismatic_flow_with_config.py -test/test_prismatic_paginated_event_payload.py test/test_product.py test/test_product_search_match.py test/test_product_unit_analytics.py @@ -1855,6 +1898,7 @@ test/test_product_unit_analytics_data_point.py test/test_product_unit_analytics_totals.py test/test_profile_audiences_changes.py test/test_projected_tier.py +test/test_promote_experiment.py test/test_redeem_referral_effect_props.py test/test_referral.py test/test_referral_constraints.py diff --git a/README.md b/README.md index 0b9b7dd..09bc487 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,7 @@ Class | Method | HTTP request | Description *IntegrationApi* | [**get_loyalty_program_profile_transactions**](docs/IntegrationApi.md#get_loyalty_program_profile_transactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/transactions | List customer's loyalty transactions *IntegrationApi* | [**get_reserved_customers**](docs/IntegrationApi.md#get_reserved_customers) | **GET** /v1/coupon_reservations/customerprofiles/{couponValue} | List customers that have this coupon reserved *IntegrationApi* | [**link_loyalty_card_to_profile**](docs/IntegrationApi.md#link_loyalty_card_to_profile) | **POST** /v2/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/link_profile | Link customer profile to card +*IntegrationApi* | [**price_history**](docs/IntegrationApi.md#price_history) | **POST** /v1/best_prior_price_history | Get summary of price history *IntegrationApi* | [**reopen_customer_session**](docs/IntegrationApi.md#reopen_customer_session) | **PUT** /v2/customer_sessions/{customerSessionId}/reopen | Reopen customer session *IntegrationApi* | [**return_cart_items**](docs/IntegrationApi.md#return_cart_items) | **POST** /v2/customer_sessions/{customerSessionId}/returns | Return cart items *IntegrationApi* | [**sync_catalog**](docs/IntegrationApi.md#sync_catalog) | **PUT** /v1/catalogs/{catalogId}/sync | Sync cart item catalog @@ -230,6 +231,7 @@ Class | Method | HTTP request | Description *ManagementApi* | [**disconnect_campaign_stores**](docs/ManagementApi.md#disconnect_campaign_stores) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/stores | Disconnect stores *ManagementApi* | [**export_account_collection_items**](docs/ManagementApi.md#export_account_collection_items) | **GET** /v1/collections/{collectionId}/export | Export account-level collection's items *ManagementApi* | [**export_achievements**](docs/ManagementApi.md#export_achievements) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}/export | Export achievement customer data +*ManagementApi* | [**export_application_campaign_analytics**](docs/ManagementApi.md#export_application_campaign_analytics) | **GET** /v1/applications/{applicationId}/campaign_analytics/export | Export Application analytics aggregated by campaign *ManagementApi* | [**export_audiences_memberships**](docs/ManagementApi.md#export_audiences_memberships) | **GET** /v1/audiences/{audienceId}/memberships/export | Export audience members *ManagementApi* | [**export_campaign_store_budgets**](docs/ManagementApi.md#export_campaign_store_budgets) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/stores/budgets/export | Export campaign store budgets *ManagementApi* | [**export_campaign_stores**](docs/ManagementApi.md#export_campaign_stores) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/stores/export | Export stores @@ -243,6 +245,7 @@ Class | Method | HTTP request | Description *ManagementApi* | [**export_loyalty_card_balances**](docs/ManagementApi.md#export_loyalty_card_balances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/export_card_balances | Export all card transaction logs *ManagementApi* | [**export_loyalty_card_ledger**](docs/ManagementApi.md#export_loyalty_card_ledger) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/export_log | Export card's ledger log *ManagementApi* | [**export_loyalty_cards**](docs/ManagementApi.md#export_loyalty_cards) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/export | Export loyalty cards +*ManagementApi* | [**export_loyalty_join_dates**](docs/ManagementApi.md#export_loyalty_join_dates) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/export_join_dates | Export customers' loyalty program join dates *ManagementApi* | [**export_loyalty_ledger**](docs/ManagementApi.md#export_loyalty_ledger) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/export_log | Export customer's transaction logs *ManagementApi* | [**export_pool_giveaways**](docs/ManagementApi.md#export_pool_giveaways) | **GET** /v1/giveaways/pools/{poolId}/export | Export giveaway codes of a giveaway pool *ManagementApi* | [**export_referrals**](docs/ManagementApi.md#export_referrals) | **GET** /v1/applications/{applicationId}/export_referrals | Export referrals @@ -290,6 +293,7 @@ Class | Method | HTTP request | Description *ManagementApi* | [**get_customers_by_attributes**](docs/ManagementApi.md#get_customers_by_attributes) | **POST** /v1/customer_search/no_total | List customer profiles matching the given attributes *ManagementApi* | [**get_dashboard_statistics**](docs/ManagementApi.md#get_dashboard_statistics) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/dashboard | Get statistics for loyalty dashboard *ManagementApi* | [**get_event_types**](docs/ManagementApi.md#get_event_types) | **GET** /v1/event_types | List event types +*ManagementApi* | [**get_experiment**](docs/ManagementApi.md#get_experiment) | **GET** /v1/applications/{applicationId}/experiments/{experimentId} | Get experiment in Application *ManagementApi* | [**get_exports**](docs/ManagementApi.md#get_exports) | **GET** /v1/exports | Get exports *ManagementApi* | [**get_loyalty_card**](docs/ManagementApi.md#get_loyalty_card) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId} | Get loyalty card *ManagementApi* | [**get_loyalty_card_transaction_logs**](docs/ManagementApi.md#get_loyalty_card_transaction_logs) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/logs | List card's transactions @@ -331,6 +335,7 @@ Class | Method | HTTP request | Description *ManagementApi* | [**list_catalog_items**](docs/ManagementApi.md#list_catalog_items) | **GET** /v1/catalogs/{catalogId}/items | List items in a catalog *ManagementApi* | [**list_collections**](docs/ManagementApi.md#list_collections) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/collections | List collections in campaign *ManagementApi* | [**list_collections_in_application**](docs/ManagementApi.md#list_collections_in_application) | **GET** /v1/applications/{applicationId}/collections | List collections in Application +*ManagementApi* | [**list_experiments**](docs/ManagementApi.md#list_experiments) | **GET** /v1/applications/{applicationId}/experiments | List experiments *ManagementApi* | [**list_stores**](docs/ManagementApi.md#list_stores) | **GET** /v1/applications/{applicationId}/stores | List stores *ManagementApi* | [**okta_event_handler_challenge**](docs/ManagementApi.md#okta_event_handler_challenge) | **GET** /v1/provisioning/okta | Validate Okta API ownership *ManagementApi* | [**remove_loyalty_points**](docs/ManagementApi.md#remove_loyalty_points) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/deduct_points | Deduct points from customer profile @@ -532,7 +537,9 @@ Class | Method | HTTP request | Description - [Coupon](docs/Coupon.md) - [CouponConstraints](docs/CouponConstraints.md) - [CouponCreatedEffectProps](docs/CouponCreatedEffectProps.md) +- [CouponCreatedEventRequest](docs/CouponCreatedEventRequest.md) - [CouponCreationJob](docs/CouponCreationJob.md) +- [CouponDeletedEventRequest](docs/CouponDeletedEventRequest.md) - [CouponDeletionFilters](docs/CouponDeletionFilters.md) - [CouponDeletionJob](docs/CouponDeletionJob.md) - [CouponEntity](docs/CouponEntity.md) @@ -541,6 +548,7 @@ Class | Method | HTTP request | Description - [CouponRejectionReason](docs/CouponRejectionReason.md) - [CouponReservations](docs/CouponReservations.md) - [CouponSearch](docs/CouponSearch.md) +- [CouponUpdatedEventRequest](docs/CouponUpdatedEventRequest.md) - [CouponValue](docs/CouponValue.md) - [CouponWithApplication](docs/CouponWithApplication.md) - [CouponsNotificationData](docs/CouponsNotificationData.md) @@ -592,6 +600,9 @@ Class | Method | HTTP request | Description - [EventV2](docs/EventV2.md) - [EventV3](docs/EventV3.md) - [Experiment](docs/Experiment.md) +- [ExperimentCampaignCopy](docs/ExperimentCampaignCopy.md) +- [ExperimentCopy](docs/ExperimentCopy.md) +- [ExperimentCopyExperiment](docs/ExperimentCopyExperiment.md) - [ExperimentResults](docs/ExperimentResults.md) - [ExperimentVariant](docs/ExperimentVariant.md) - [ExperimentVariantAllocation](docs/ExperimentVariantAllocation.md) @@ -672,6 +683,7 @@ Class | Method | HTTP request | Description - [Giveaway](docs/Giveaway.md) - [GiveawaysPool](docs/GiveawaysPool.md) - [HiddenConditionsEffects](docs/HiddenConditionsEffects.md) +- [History](docs/History.md) - [IdentifiableEntity](docs/IdentifiableEntity.md) - [ImportEntity](docs/ImportEntity.md) - [IncreaseAchievementProgressEffectProps](docs/IncreaseAchievementProgressEffectProps.md) @@ -686,6 +698,21 @@ Class | Method | HTTP request | Description - [IntegrationEventV2Response](docs/IntegrationEventV2Response.md) - [IntegrationEventV3Request](docs/IntegrationEventV3Request.md) - [IntegrationEventV3Response](docs/IntegrationEventV3Response.md) +- [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) +- [IntegrationHubFlow](docs/IntegrationHubFlow.md) +- [IntegrationHubFlowConfig](docs/IntegrationHubFlowConfig.md) +- [IntegrationHubFlowConfigResponse](docs/IntegrationHubFlowConfigResponse.md) +- [IntegrationHubFlowResponse](docs/IntegrationHubFlowResponse.md) +- [IntegrationHubFlowWithConfig](docs/IntegrationHubFlowWithConfig.md) +- [IntegrationHubPaginatedEventPayload](docs/IntegrationHubPaginatedEventPayload.md) - [IntegrationProfileEntity](docs/IntegrationProfileEntity.md) - [IntegrationProfileEntityV3](docs/IntegrationProfileEntityV3.md) - [IntegrationRequest](docs/IntegrationRequest.md) @@ -712,6 +739,7 @@ Class | Method | HTTP request | Description - [ListCampaignStoreBudgets](docs/ListCampaignStoreBudgets.md) - [ListCampaignStoreBudgetsStore](docs/ListCampaignStoreBudgetsStore.md) - [ListCatalogItems200Response](docs/ListCatalogItems200Response.md) +- [ListExperiments200Response](docs/ListExperiments200Response.md) - [ListStores200Response](docs/ListStores200Response.md) - [LoginParams](docs/LoginParams.md) - [Loyalty](docs/Loyalty.md) @@ -733,6 +761,7 @@ Class | Method | HTTP request | Description - [LoyaltyLedgerEntryFlags](docs/LoyaltyLedgerEntryFlags.md) - [LoyaltyLedgerTransactions](docs/LoyaltyLedgerTransactions.md) - [LoyaltyMembership](docs/LoyaltyMembership.md) +- [LoyaltyPointsChangedEventRequest](docs/LoyaltyPointsChangedEventRequest.md) - [LoyaltyProgram](docs/LoyaltyProgram.md) - [LoyaltyProgramBalance](docs/LoyaltyProgramBalance.md) - [LoyaltyProgramEntity](docs/LoyaltyProgramEntity.md) @@ -740,6 +769,8 @@ Class | Method | HTTP request | Description - [LoyaltyProgramTransaction](docs/LoyaltyProgramTransaction.md) - [LoyaltySubLedger](docs/LoyaltySubLedger.md) - [LoyaltyTier](docs/LoyaltyTier.md) +- [LoyaltyTierDowngradeEventRequest](docs/LoyaltyTierDowngradeEventRequest.md) +- [LoyaltyTierUpgradeEventRequest](docs/LoyaltyTierUpgradeEventRequest.md) - [ManagementKey](docs/ManagementKey.md) - [ManagerConfig](docs/ManagerConfig.md) - [MessageLogEntries](docs/MessageLogEntries.md) @@ -851,24 +882,11 @@ Class | Method | HTTP request | Description - [Picklist](docs/Picklist.md) - [PlaceholderDetails](docs/PlaceholderDetails.md) - [PriceDetail](docs/PriceDetail.md) +- [PriceHistoryRequest](docs/PriceHistoryRequest.md) +- [PriceHistoryResponse](docs/PriceHistoryResponse.md) - [PriceType](docs/PriceType.md) - [PriceTypeReferenceDetail](docs/PriceTypeReferenceDetail.md) - [PriceTypeReferences](docs/PriceTypeReferences.md) -- [PrismaticConfig](docs/PrismaticConfig.md) -- [PrismaticEventPayloadCouponBasedNotifications](docs/PrismaticEventPayloadCouponBasedNotifications.md) -- [PrismaticEventPayloadCouponBasedNotificationsLimits](docs/PrismaticEventPayloadCouponBasedNotificationsLimits.md) -- [PrismaticEventPayloadLoyaltyProfileBasedNotification](docs/PrismaticEventPayloadLoyaltyProfileBasedNotification.md) -- [PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification](docs/PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification.md) -- [PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction](docs/PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md) -- [PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification](docs/PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md) -- [PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification](docs/PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md) -- [PrismaticEventRecord](docs/PrismaticEventRecord.md) -- [PrismaticFlow](docs/PrismaticFlow.md) -- [PrismaticFlowConfig](docs/PrismaticFlowConfig.md) -- [PrismaticFlowConfigResponse](docs/PrismaticFlowConfigResponse.md) -- [PrismaticFlowResponse](docs/PrismaticFlowResponse.md) -- [PrismaticFlowWithConfig](docs/PrismaticFlowWithConfig.md) -- [PrismaticPaginatedEventPayload](docs/PrismaticPaginatedEventPayload.md) - [Product](docs/Product.md) - [ProductSearchMatch](docs/ProductSearchMatch.md) - [ProductUnitAnalytics](docs/ProductUnitAnalytics.md) @@ -876,6 +894,7 @@ Class | Method | HTTP request | Description - [ProductUnitAnalyticsTotals](docs/ProductUnitAnalyticsTotals.md) - [ProfileAudiencesChanges](docs/ProfileAudiencesChanges.md) - [ProjectedTier](docs/ProjectedTier.md) +- [PromoteExperiment](docs/PromoteExperiment.md) - [RedeemReferralEffectProps](docs/RedeemReferralEffectProps.md) - [Referral](docs/Referral.md) - [ReferralConstraints](docs/ReferralConstraints.md) diff --git a/docs/BestPriorPrice.md b/docs/BestPriorPrice.md index f0cb2b5..3ca8dab 100644 --- a/docs/BestPriorPrice.md +++ b/docs/BestPriorPrice.md @@ -5,8 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the historical price. | **sku** | **str** | sku | -**observed_at** | **datetime** | The date and time when the best price was observed. | +**observed_at** | **datetime** | The date and time when the price was observed. | **context_id** | **str** | The context ID of the context active at the time of observation. | **price** | **float** | Price of the item. | **metadata** | [**BestPriorPriceMetadata**](BestPriorPriceMetadata.md) | | diff --git a/docs/BestPriorPriceRequest.md b/docs/BestPriorPriceRequest.md index 8a252dc..0d5bb05 100644 --- a/docs/BestPriorPriceRequest.md +++ b/docs/BestPriorPriceRequest.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **skus** | **List[str]** | List of product SKUs to check when determining the best prior price. | **timeframe_end_date** | **datetime** | The end date and time that defines the latest time for retrieving historical SKU prices. | **timeframe** | **str** | The number of days prior to the timeframeEndDate. Only prices within this look back period are considered for the best prior price evaluation. | -**strict_end_date** | **bool** | Indicates whether the timeframe includes the start of the current sale. - When `false`, the timeframe includes the start date of the current sale. - When `true`, the timeframe striclty uses the number of days specified in `timeframe`. | +**strict_end_date** | **bool** | This property is **deprecated**. Use `timeframeEndDateType` instead. Indicates whether the timeframe includes the start of the current sale. - When `false`, the timeframe includes the start date of the current sale. - When `true`, the timeframe strictly uses the number of days specified in `timeframe`. | +**timeframe_end_date_type** | **str** | 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 the current `contextId` with the current price value. Identical price records are merged. If there is no `contextId` for the most recent price, the most recent timestamp for the price is used. - `sale`: The timeframe ends at the start of current `contextId` and takes the prices prior to the start of the `contextId` into account. | [optional] **target** | [**BestPriorTarget**](BestPriorTarget.md) | | [optional] ## Example diff --git a/docs/CouponCreatedEventRequest.md b/docs/CouponCreatedEventRequest.md new file mode 100644 index 0000000..8e602fb --- /dev/null +++ b/docs/CouponCreatedEventRequest.md @@ -0,0 +1,32 @@ +# CouponCreatedEventRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total_result_size** | **int** | | +**batched_at** | **datetime** | Timestamp when the batch was created. | [optional] +**event_type** | **str** | | +**data** | **List[object]** | | + +## Example + +```python +from talon_one.models.coupon_created_event_request import CouponCreatedEventRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CouponCreatedEventRequest from a JSON string +coupon_created_event_request_instance = CouponCreatedEventRequest.from_json(json) +# print the JSON string representation of the object +print(CouponCreatedEventRequest.to_json()) + +# convert the object into a dict +coupon_created_event_request_dict = coupon_created_event_request_instance.to_dict() +# create an instance of CouponCreatedEventRequest from a dict +coupon_created_event_request_from_dict = CouponCreatedEventRequest.from_dict(coupon_created_event_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CouponDeletedEventRequest.md b/docs/CouponDeletedEventRequest.md new file mode 100644 index 0000000..e4ad84c --- /dev/null +++ b/docs/CouponDeletedEventRequest.md @@ -0,0 +1,32 @@ +# CouponDeletedEventRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total_result_size** | **int** | | +**batched_at** | **datetime** | Timestamp when the batch was created. | [optional] +**event_type** | **str** | | +**data** | **List[object]** | | + +## Example + +```python +from talon_one.models.coupon_deleted_event_request import CouponDeletedEventRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CouponDeletedEventRequest from a JSON string +coupon_deleted_event_request_instance = CouponDeletedEventRequest.from_json(json) +# print the JSON string representation of the object +print(CouponDeletedEventRequest.to_json()) + +# convert the object into a dict +coupon_deleted_event_request_dict = coupon_deleted_event_request_instance.to_dict() +# create an instance of CouponDeletedEventRequest from a dict +coupon_deleted_event_request_from_dict = CouponDeletedEventRequest.from_dict(coupon_deleted_event_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CouponUpdatedEventRequest.md b/docs/CouponUpdatedEventRequest.md new file mode 100644 index 0000000..135eba1 --- /dev/null +++ b/docs/CouponUpdatedEventRequest.md @@ -0,0 +1,32 @@ +# CouponUpdatedEventRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total_result_size** | **int** | | +**batched_at** | **datetime** | Timestamp when the batch was created. | [optional] +**event_type** | **str** | | +**data** | **List[object]** | | + +## Example + +```python +from talon_one.models.coupon_updated_event_request import CouponUpdatedEventRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CouponUpdatedEventRequest from a JSON string +coupon_updated_event_request_instance = CouponUpdatedEventRequest.from_json(json) +# print the JSON string representation of the object +print(CouponUpdatedEventRequest.to_json()) + +# convert the object into a dict +coupon_updated_event_request_dict = coupon_updated_event_request_instance.to_dict() +# create an instance of CouponUpdatedEventRequest from a dict +coupon_updated_event_request_from_dict = CouponUpdatedEventRequest.from_dict(coupon_updated_event_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Experiment.md b/docs/Experiment.md index dfb80c9..3b6e01b 100644 --- a/docs/Experiment.md +++ b/docs/Experiment.md @@ -8,10 +8,10 @@ Name | Type | Description | Notes **id** | **int** | The internal ID of this entity. | **created** | **datetime** | The time this entity was created. | **application_id** | **int** | The ID of the Application that owns this entity. | -**is_variant_assignment_external** | **bool** | The source of the assignment. - false - The assignment to the variant is handled internally by the Talon.Oneandled internally by the Talon.One. - true - The assignment to the variant handled externally. | [optional] +**is_variant_assignment_external** | **bool** | The source of the assignment. - false - The variant assignment is handled internally by Talon.One. - true - The variant assignment is handled externally. | [optional] **campaign** | [**Campaign**](Campaign.md) | | [optional] **activated** | **datetime** | The date and time the experiment was activated. | [optional] -**state** | **str** | A disabled experiment is not evaluated for rules or coupons. | [optional] [default to 'disabled'] +**state** | **str** | A disabled experiment is not evaluated for rules or coupons. | [default to 'disabled'] **variants** | [**List[ExperimentVariant]**](ExperimentVariant.md) | | [optional] **deletedat** | **datetime** | The date and time the experiment was deleted. | [optional] diff --git a/docs/ExperimentCampaignCopy.md b/docs/ExperimentCampaignCopy.md new file mode 100644 index 0000000..cacb392 --- /dev/null +++ b/docs/ExperimentCampaignCopy.md @@ -0,0 +1,34 @@ +# ExperimentCampaignCopy + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name of the copied campaign (Defaults to \"Copy of original campaign name\"). | [optional] +**description** | **str** | A detailed description of the campaign. | [optional] +**start_time** | **datetime** | Timestamp when the campaign will become active. | [optional] +**end_time** | **datetime** | Timestamp when the campaign will become inactive. | [optional] +**tags** | **List[str]** | A list of tags for the campaign. | [optional] +**evaluation_group_id** | **int** | The ID of the campaign evaluation group the campaign belongs to. | [optional] + +## Example + +```python +from talon_one.models.experiment_campaign_copy import ExperimentCampaignCopy + +# TODO update the JSON string below +json = "{}" +# create an instance of ExperimentCampaignCopy from a JSON string +experiment_campaign_copy_instance = ExperimentCampaignCopy.from_json(json) +# print the JSON string representation of the object +print(ExperimentCampaignCopy.to_json()) + +# convert the object into a dict +experiment_campaign_copy_dict = experiment_campaign_copy_instance.to_dict() +# create an instance of ExperimentCampaignCopy from a dict +experiment_campaign_copy_from_dict = ExperimentCampaignCopy.from_dict(experiment_campaign_copy_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/ExperimentCopy.md b/docs/ExperimentCopy.md new file mode 100644 index 0000000..5eebfad --- /dev/null +++ b/docs/ExperimentCopy.md @@ -0,0 +1,30 @@ +# ExperimentCopy + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**target_application_id** | **int** | The ID of the Application to copy the experiment. It is displayed in your Talon.One deployment URL. | +**experiment** | [**ExperimentCopyExperiment**](ExperimentCopyExperiment.md) | | + +## Example + +```python +from talon_one.models.experiment_copy import ExperimentCopy + +# TODO update the JSON string below +json = "{}" +# create an instance of ExperimentCopy from a JSON string +experiment_copy_instance = ExperimentCopy.from_json(json) +# print the JSON string representation of the object +print(ExperimentCopy.to_json()) + +# convert the object into a dict +experiment_copy_dict = experiment_copy_instance.to_dict() +# create an instance of ExperimentCopy from a dict +experiment_copy_from_dict = ExperimentCopy.from_dict(experiment_copy_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ExperimentCopyExperiment.md b/docs/ExperimentCopyExperiment.md new file mode 100644 index 0000000..bad1b8a --- /dev/null +++ b/docs/ExperimentCopyExperiment.md @@ -0,0 +1,30 @@ +# ExperimentCopyExperiment + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_variant_assignment_external** | **bool** | The source of the assignment. - false - The variant assignment is handled internally by Talon.One. - true - The variant assignment is handled externally. | +**campaign** | [**ExperimentCampaignCopy**](ExperimentCampaignCopy.md) | | + +## Example + +```python +from talon_one.models.experiment_copy_experiment import ExperimentCopyExperiment + +# TODO update the JSON string below +json = "{}" +# create an instance of ExperimentCopyExperiment from a JSON string +experiment_copy_experiment_instance = ExperimentCopyExperiment.from_json(json) +# print the JSON string representation of the object +print(ExperimentCopyExperiment.to_json()) + +# convert the object into a dict +experiment_copy_experiment_dict = experiment_copy_experiment_instance.to_dict() +# create an instance of ExperimentCopyExperiment from a dict +experiment_copy_experiment_from_dict = ExperimentCopyExperiment.from_dict(experiment_copy_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/History.md b/docs/History.md new file mode 100644 index 0000000..0d1d1c5 --- /dev/null +++ b/docs/History.md @@ -0,0 +1,34 @@ +# History + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the historical price. | +**observed_at** | **datetime** | The date and time when the price was observed. | +**context_id** | **str** | Identifier of the relevant context at the time the price was observed (e.g. summer sale). | +**price** | **float** | Price of the item. | +**metadata** | [**BestPriorPriceMetadata**](BestPriorPriceMetadata.md) | | +**target** | **object** | | + +## Example + +```python +from talon_one.models.history import History + +# TODO update the JSON string below +json = "{}" +# create an instance of History from a JSON string +history_instance = History.from_json(json) +# print the JSON string representation of the object +print(History.to_json()) + +# convert the object into a dict +history_dict = history_instance.to_dict() +# create an instance of History from a dict +history_from_dict = History.from_dict(history_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/IntegrationApi.md b/docs/IntegrationApi.md index 3d775ad..2925553 100644 --- a/docs/IntegrationApi.md +++ b/docs/IntegrationApi.md @@ -28,6 +28,7 @@ Method | HTTP request | Description [**get_loyalty_program_profile_transactions**](IntegrationApi.md#get_loyalty_program_profile_transactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/transactions | List customer's loyalty transactions [**get_reserved_customers**](IntegrationApi.md#get_reserved_customers) | **GET** /v1/coupon_reservations/customerprofiles/{couponValue} | List customers that have this coupon reserved [**link_loyalty_card_to_profile**](IntegrationApi.md#link_loyalty_card_to_profile) | **POST** /v2/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/link_profile | Link customer profile to card +[**price_history**](IntegrationApi.md#price_history) | **POST** /v1/best_prior_price_history | Get summary of price history [**reopen_customer_session**](IntegrationApi.md#reopen_customer_session) | **PUT** /v2/customer_sessions/{customerSessionId}/reopen | Reopen customer session [**return_cart_items**](IntegrationApi.md#return_cart_items) | **POST** /v2/customer_sessions/{customerSessionId}/returns | Return cart items [**sync_catalog**](IntegrationApi.md#sync_catalog) | **PUT** /v1/catalogs/{catalogId}/sync | Sync cart item catalog @@ -2306,6 +2307,101 @@ 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) +# **price_history** +> PriceHistoryResponse price_history(price_history_request) + +Get summary of price history + +Fetch the historical price data for a given SKU within a defined timeframe. + + +### Example + +* Api Key Authentication (management_key): +* Api Key Authentication (manager_auth): +* Api Key Authentication (api_key_v1): + +```python +import talon_one +from talon_one.models.price_history_request import PriceHistoryRequest +from talon_one.models.price_history_response import PriceHistoryResponse +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: management_key +configuration.api_key['management_key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['management_key'] = 'Bearer' + +# Configure API key authorization: manager_auth +configuration.api_key['manager_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['manager_auth'] = 'Bearer' + +# 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) + price_history_request = talon_one.PriceHistoryRequest() # PriceHistoryRequest | body + + try: + # Get summary of price history + api_response = api_instance.price_history(price_history_request) + print("The response of IntegrationApi->price_history:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling IntegrationApi->price_history: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **price_history_request** | [**PriceHistoryRequest**](PriceHistoryRequest.md)| body | + +### Return type + +[**PriceHistoryResponse**](PriceHistoryResponse.md) + +### Authorization + +[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | + +[[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) + # **reopen_customer_session** > ReopenSessionResponse reopen_customer_session(customer_session_id) diff --git a/docs/IntegrationHubConfig.md b/docs/IntegrationHubConfig.md new file mode 100644 index 0000000..3235d3d --- /dev/null +++ b/docs/IntegrationHubConfig.md @@ -0,0 +1,31 @@ +# IntegrationHubConfig + +Config used for accessing integrations in IntegrationHub + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integration_hub_url** | **str** | The url used to integrate the IntegrationHub Marketplace. | +**access_token** | **str** | Access token used to authenticate a user in Talon.One. | + +## Example + +```python +from talon_one.models.integration_hub_config import IntegrationHubConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of IntegrationHubConfig from a JSON string +integration_hub_config_instance = IntegrationHubConfig.from_json(json) +# print the JSON string representation of the object +print(IntegrationHubConfig.to_json()) + +# convert the object into a dict +integration_hub_config_dict = integration_hub_config_instance.to_dict() +# create an instance of IntegrationHubConfig from a dict +integration_hub_config_from_dict = IntegrationHubConfig.from_dict(integration_hub_config_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/PrismaticEventPayloadCouponBasedNotifications.md b/docs/IntegrationHubEventPayloadCouponBasedNotifications.md similarity index 54% rename from docs/PrismaticEventPayloadCouponBasedNotifications.md rename to docs/IntegrationHubEventPayloadCouponBasedNotifications.md index dad3e56..67cc520 100644 --- a/docs/PrismaticEventPayloadCouponBasedNotifications.md +++ b/docs/IntegrationHubEventPayloadCouponBasedNotifications.md @@ -1,4 +1,4 @@ -# PrismaticEventPayloadCouponBasedNotifications +# IntegrationHubEventPayloadCouponBasedNotifications ## Properties @@ -22,7 +22,7 @@ Name | Type | Description | Notes **import_id** | **int** | | [optional] **batch_id** | **str** | | [optional] **attributes** | **object** | | [optional] -**limits** | [**List[PrismaticEventPayloadCouponBasedNotificationsLimits]**](PrismaticEventPayloadCouponBasedNotificationsLimits.md) | | [optional] +**limits** | [**List[IntegrationHubEventPayloadCouponBasedNotificationsLimits]**](IntegrationHubEventPayloadCouponBasedNotificationsLimits.md) | | [optional] **published_at** | **datetime** | Timestamp when the event was published. | **source_of_event** | **str** | | **employee_name** | **str** | | @@ -30,19 +30,19 @@ Name | Type | Description | Notes ## Example ```python -from talon_one.models.prismatic_event_payload_coupon_based_notifications import PrismaticEventPayloadCouponBasedNotifications +from talon_one.models.integration_hub_event_payload_coupon_based_notifications import IntegrationHubEventPayloadCouponBasedNotifications # TODO update the JSON string below json = "{}" -# create an instance of PrismaticEventPayloadCouponBasedNotifications from a JSON string -prismatic_event_payload_coupon_based_notifications_instance = PrismaticEventPayloadCouponBasedNotifications.from_json(json) +# create an instance of IntegrationHubEventPayloadCouponBasedNotifications from a JSON string +integration_hub_event_payload_coupon_based_notifications_instance = IntegrationHubEventPayloadCouponBasedNotifications.from_json(json) # print the JSON string representation of the object -print(PrismaticEventPayloadCouponBasedNotifications.to_json()) +print(IntegrationHubEventPayloadCouponBasedNotifications.to_json()) # convert the object into a dict -prismatic_event_payload_coupon_based_notifications_dict = prismatic_event_payload_coupon_based_notifications_instance.to_dict() -# create an instance of PrismaticEventPayloadCouponBasedNotifications from a dict -prismatic_event_payload_coupon_based_notifications_from_dict = PrismaticEventPayloadCouponBasedNotifications.from_dict(prismatic_event_payload_coupon_based_notifications_dict) +integration_hub_event_payload_coupon_based_notifications_dict = integration_hub_event_payload_coupon_based_notifications_instance.to_dict() +# create an instance of IntegrationHubEventPayloadCouponBasedNotifications from a dict +integration_hub_event_payload_coupon_based_notifications_from_dict = IntegrationHubEventPayloadCouponBasedNotifications.from_dict(integration_hub_event_payload_coupon_based_notifications_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/IntegrationHubEventPayloadCouponBasedNotificationsLimits.md b/docs/IntegrationHubEventPayloadCouponBasedNotificationsLimits.md new file mode 100644 index 0000000..5aee8d8 --- /dev/null +++ b/docs/IntegrationHubEventPayloadCouponBasedNotificationsLimits.md @@ -0,0 +1,32 @@ +# IntegrationHubEventPayloadCouponBasedNotificationsLimits + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **str** | | +**limit** | **float** | | +**period** | **str** | | [optional] +**entities** | **List[str]** | | + +## Example + +```python +from talon_one.models.integration_hub_event_payload_coupon_based_notifications_limits import IntegrationHubEventPayloadCouponBasedNotificationsLimits + +# TODO update the JSON string below +json = "{}" +# create an instance of IntegrationHubEventPayloadCouponBasedNotificationsLimits from a JSON string +integration_hub_event_payload_coupon_based_notifications_limits_instance = IntegrationHubEventPayloadCouponBasedNotificationsLimits.from_json(json) +# print the JSON string representation of the object +print(IntegrationHubEventPayloadCouponBasedNotificationsLimits.to_json()) + +# convert the object into a dict +integration_hub_event_payload_coupon_based_notifications_limits_dict = integration_hub_event_payload_coupon_based_notifications_limits_instance.to_dict() +# create an instance of IntegrationHubEventPayloadCouponBasedNotificationsLimits from a dict +integration_hub_event_payload_coupon_based_notifications_limits_from_dict = IntegrationHubEventPayloadCouponBasedNotificationsLimits.from_dict(integration_hub_event_payload_coupon_based_notifications_limits_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/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md new file mode 100644 index 0000000..4952da1 --- /dev/null +++ b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md @@ -0,0 +1,43 @@ +# IntegrationHubEventPayloadLoyaltyProfileBasedNotification + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**profile_integration_id** | **str** | | +**loyalty_program_id** | **int** | | +**subledger_id** | **str** | | +**source_of_event** | **str** | | +**employee_name** | **str** | | [optional] +**user_id** | **int** | | [optional] +**current_points** | **float** | | +**actions** | [**List[IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction]**](IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md) | | [optional] +**published_at** | **datetime** | Timestamp when the event was published. | +**current_tier** | **str** | | [optional] +**old_tier** | **str** | | [optional] +**tier_expiration_date** | **datetime** | | [optional] +**timestamp_of_tier_change** | **datetime** | | [optional] +**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/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md new file mode 100644 index 0000000..5e38de1 --- /dev/null +++ b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md @@ -0,0 +1,37 @@ +# IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**profile_integration_id** | **str** | | +**loyalty_program_id** | **int** | | +**subledger_id** | **str** | | +**source_of_event** | **str** | | +**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. | + +## Example + +```python +from talon_one.models.integration_hub_event_payload_loyalty_profile_based_points_changed_notification import IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification + +# TODO update the JSON string below +json = "{}" +# create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification from a JSON string +integration_hub_event_payload_loyalty_profile_based_points_changed_notification_instance = IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.from_json(json) +# print the JSON string representation of the object +print(IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.to_json()) + +# convert the object into a dict +integration_hub_event_payload_loyalty_profile_based_points_changed_notification_dict = integration_hub_event_payload_loyalty_profile_based_points_changed_notification_instance.to_dict() +# create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification from a dict +integration_hub_event_payload_loyalty_profile_based_points_changed_notification_from_dict = IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.from_dict(integration_hub_event_payload_loyalty_profile_based_points_changed_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/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md new file mode 100644 index 0000000..8226413 --- /dev/null +++ b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md @@ -0,0 +1,33 @@ +# IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **float** | | +**reason** | **str** | | [optional] +**operation** | **str** | | +**start_date** | **datetime** | | [optional] +**expiry_date** | **datetime** | | [optional] + +## Example + +```python +from talon_one.models.integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action import IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction + +# TODO update the JSON string below +json = "{}" +# create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction from a JSON string +integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action_instance = IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.from_json(json) +# print the JSON string representation of the object +print(IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.to_json()) + +# convert the object into a dict +integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action_dict = integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action_instance.to_dict() +# create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction from a dict +integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action_from_dict = IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.from_dict(integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md new file mode 100644 index 0000000..3a4ed30 --- /dev/null +++ b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md @@ -0,0 +1,38 @@ +# IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**profile_integration_id** | **str** | | +**loyalty_program_id** | **int** | | +**subledger_id** | **str** | | +**source_of_event** | **str** | | +**current_tier** | **str** | | [optional] +**current_points** | **float** | | +**old_tier** | **str** | | [optional] +**tier_expiration_date** | **datetime** | | [optional] +**timestamp_of_tier_change** | **datetime** | | [optional] +**published_at** | **datetime** | Timestamp when the event was published. | + +## Example + +```python +from talon_one.models.integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification import IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification + +# TODO update the JSON string below +json = "{}" +# create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification from a JSON string +integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification_instance = IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.from_json(json) +# print the JSON string representation of the object +print(IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.to_json()) + +# convert the object into a dict +integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification_dict = integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification_instance.to_dict() +# create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification from a dict +integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification_from_dict = IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.from_dict(integration_hub_event_payload_loyalty_profile_based_tier_downgrade_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/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md new file mode 100644 index 0000000..3ed9122 --- /dev/null +++ b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md @@ -0,0 +1,40 @@ +# IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**profile_integration_id** | **str** | | +**loyalty_program_id** | **int** | | +**subledger_id** | **str** | | +**source_of_event** | **str** | | +**current_tier** | **str** | | [optional] +**current_points** | **float** | | +**old_tier** | **str** | | [optional] +**points_required_to_the_next_tier** | **float** | | [optional] +**next_tier** | **str** | | [optional] +**tier_expiration_date** | **datetime** | | [optional] +**timestamp_of_tier_change** | **datetime** | | [optional] +**published_at** | **datetime** | Timestamp when the event was published. | + +## Example + +```python +from talon_one.models.integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification import IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification + +# TODO update the JSON string below +json = "{}" +# create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification from a JSON string +integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification_instance = IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.from_json(json) +# print the JSON string representation of the object +print(IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.to_json()) + +# convert the object into a dict +integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification_dict = integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification_instance.to_dict() +# create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification from a dict +integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification_from_dict = IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.from_dict(integration_hub_event_payload_loyalty_profile_based_tier_upgrade_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/PrismaticEventRecord.md b/docs/IntegrationHubEventRecord.md similarity index 55% rename from docs/PrismaticEventRecord.md rename to docs/IntegrationHubEventRecord.md index 5e97602..4b89d1b 100644 --- a/docs/PrismaticEventRecord.md +++ b/docs/IntegrationHubEventRecord.md @@ -1,4 +1,4 @@ -# PrismaticEventRecord +# IntegrationHubEventRecord ## Properties @@ -17,19 +17,19 @@ Name | Type | Description | Notes ## Example ```python -from talon_one.models.prismatic_event_record import PrismaticEventRecord +from talon_one.models.integration_hub_event_record import IntegrationHubEventRecord # TODO update the JSON string below json = "{}" -# create an instance of PrismaticEventRecord from a JSON string -prismatic_event_record_instance = PrismaticEventRecord.from_json(json) +# create an instance of IntegrationHubEventRecord from a JSON string +integration_hub_event_record_instance = IntegrationHubEventRecord.from_json(json) # print the JSON string representation of the object -print(PrismaticEventRecord.to_json()) +print(IntegrationHubEventRecord.to_json()) # convert the object into a dict -prismatic_event_record_dict = prismatic_event_record_instance.to_dict() -# create an instance of PrismaticEventRecord from a dict -prismatic_event_record_from_dict = PrismaticEventRecord.from_dict(prismatic_event_record_dict) +integration_hub_event_record_dict = integration_hub_event_record_instance.to_dict() +# create an instance of IntegrationHubEventRecord from a dict +integration_hub_event_record_from_dict = IntegrationHubEventRecord.from_dict(integration_hub_event_record_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/PrismaticFlow.md b/docs/IntegrationHubFlow.md similarity index 50% rename from docs/PrismaticFlow.md rename to docs/IntegrationHubFlow.md index 63a31d4..9987310 100644 --- a/docs/PrismaticFlow.md +++ b/docs/IntegrationHubFlow.md @@ -1,4 +1,4 @@ -# PrismaticFlow +# IntegrationHubFlow ## Properties @@ -7,24 +7,24 @@ 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. | -**prismatic_flow_url** | **str** | The URL of the prismatic flow that we want to trigger for the event. | +**integration_hub_flow_url** | **str** | The URL of the integration hub flow that we want to trigger for the event. | ## Example ```python -from talon_one.models.prismatic_flow import PrismaticFlow +from talon_one.models.integration_hub_flow import IntegrationHubFlow # TODO update the JSON string below json = "{}" -# create an instance of PrismaticFlow from a JSON string -prismatic_flow_instance = PrismaticFlow.from_json(json) +# create an instance of IntegrationHubFlow from a JSON string +integration_hub_flow_instance = IntegrationHubFlow.from_json(json) # print the JSON string representation of the object -print(PrismaticFlow.to_json()) +print(IntegrationHubFlow.to_json()) # convert the object into a dict -prismatic_flow_dict = prismatic_flow_instance.to_dict() -# create an instance of PrismaticFlow from a dict -prismatic_flow_from_dict = PrismaticFlow.from_dict(prismatic_flow_dict) +integration_hub_flow_dict = integration_hub_flow_instance.to_dict() +# create an instance of IntegrationHubFlow from a dict +integration_hub_flow_from_dict = IntegrationHubFlow.from_dict(integration_hub_flow_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/IntegrationHubFlowConfig.md b/docs/IntegrationHubFlowConfig.md new file mode 100644 index 0000000..04bc1ce --- /dev/null +++ b/docs/IntegrationHubFlowConfig.md @@ -0,0 +1,32 @@ +# IntegrationHubFlowConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_key** | **str** | | +**worker_count** | **int** | Number of IntegrationHub workers to run in parallel for this flow (maximum 500). | [optional] [default to 10] +**max_events_per_message** | **int** | Maximum number of events to send in a single message to IntegrationHub. | [optional] [default to 1000] +**max_retries** | **int** | Maximum number of retries for a IntegrationHub event before it is ignored. | [optional] [default to 10] + +## Example + +```python +from talon_one.models.integration_hub_flow_config import IntegrationHubFlowConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of IntegrationHubFlowConfig from a JSON string +integration_hub_flow_config_instance = IntegrationHubFlowConfig.from_json(json) +# print the JSON string representation of the object +print(IntegrationHubFlowConfig.to_json()) + +# convert the object into a dict +integration_hub_flow_config_dict = integration_hub_flow_config_instance.to_dict() +# create an instance of IntegrationHubFlowConfig from a dict +integration_hub_flow_config_from_dict = IntegrationHubFlowConfig.from_dict(integration_hub_flow_config_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/IntegrationHubFlowConfigResponse.md b/docs/IntegrationHubFlowConfigResponse.md new file mode 100644 index 0000000..e13fe22 --- /dev/null +++ b/docs/IntegrationHubFlowConfigResponse.md @@ -0,0 +1,31 @@ +# IntegrationHubFlowConfigResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**worker_count** | **int** | Number of IntegrationHub workers to run in parallel for this flow (maximum 500). | [optional] +**max_events_per_message** | **int** | Maximum number of events to send in a single message to IntegrationHub. | [optional] +**max_retries** | **int** | Maximum number of retries for a IntegrationHub event before it is ignored. | [optional] + +## Example + +```python +from talon_one.models.integration_hub_flow_config_response import IntegrationHubFlowConfigResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of IntegrationHubFlowConfigResponse from a JSON string +integration_hub_flow_config_response_instance = IntegrationHubFlowConfigResponse.from_json(json) +# print the JSON string representation of the object +print(IntegrationHubFlowConfigResponse.to_json()) + +# convert the object into a dict +integration_hub_flow_config_response_dict = integration_hub_flow_config_response_instance.to_dict() +# create an instance of IntegrationHubFlowConfigResponse from a dict +integration_hub_flow_config_response_from_dict = IntegrationHubFlowConfigResponse.from_dict(integration_hub_flow_config_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/IntegrationHubFlowResponse.md b/docs/IntegrationHubFlowResponse.md new file mode 100644 index 0000000..0144ba6 --- /dev/null +++ b/docs/IntegrationHubFlowResponse.md @@ -0,0 +1,33 @@ +# IntegrationHubFlowResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | ID of the integration hub flow. | +**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. | +**integration_hub_flow_url** | **str** | The URL of the integration hub flow that we want to trigger for the event. | +**config** | [**IntegrationHubFlowConfigResponse**](IntegrationHubFlowConfigResponse.md) | | + +## Example + +```python +from talon_one.models.integration_hub_flow_response import IntegrationHubFlowResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of IntegrationHubFlowResponse from a JSON string +integration_hub_flow_response_instance = IntegrationHubFlowResponse.from_json(json) +# print the JSON string representation of the object +print(IntegrationHubFlowResponse.to_json()) + +# convert the object into a dict +integration_hub_flow_response_dict = integration_hub_flow_response_instance.to_dict() +# create an instance of IntegrationHubFlowResponse from a dict +integration_hub_flow_response_from_dict = IntegrationHubFlowResponse.from_dict(integration_hub_flow_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/IntegrationHubFlowWithConfig.md b/docs/IntegrationHubFlowWithConfig.md new file mode 100644 index 0000000..54b4a3a --- /dev/null +++ b/docs/IntegrationHubFlowWithConfig.md @@ -0,0 +1,32 @@ +# IntegrationHubFlowWithConfig + + +## Properties + +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. | +**integration_hub_flow_url** | **str** | The URL of the integration hub flow that we want to trigger for the event. | +**config** | [**IntegrationHubFlowConfig**](IntegrationHubFlowConfig.md) | | + +## Example + +```python +from talon_one.models.integration_hub_flow_with_config import IntegrationHubFlowWithConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of IntegrationHubFlowWithConfig from a JSON string +integration_hub_flow_with_config_instance = IntegrationHubFlowWithConfig.from_json(json) +# print the JSON string representation of the object +print(IntegrationHubFlowWithConfig.to_json()) + +# convert the object into a dict +integration_hub_flow_with_config_dict = integration_hub_flow_with_config_instance.to_dict() +# create an instance of IntegrationHubFlowWithConfig from a dict +integration_hub_flow_with_config_from_dict = IntegrationHubFlowWithConfig.from_dict(integration_hub_flow_with_config_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/IntegrationHubPaginatedEventPayload.md b/docs/IntegrationHubPaginatedEventPayload.md new file mode 100644 index 0000000..3e0f5f8 --- /dev/null +++ b/docs/IntegrationHubPaginatedEventPayload.md @@ -0,0 +1,32 @@ +# IntegrationHubPaginatedEventPayload + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total_result_size** | **int** | | +**batched_at** | **datetime** | Timestamp when the batch was created. | [optional] +**event_type** | **str** | | +**data** | **List[object]** | | + +## Example + +```python +from talon_one.models.integration_hub_paginated_event_payload import IntegrationHubPaginatedEventPayload + +# TODO update the JSON string below +json = "{}" +# create an instance of IntegrationHubPaginatedEventPayload from a JSON string +integration_hub_paginated_event_payload_instance = IntegrationHubPaginatedEventPayload.from_json(json) +# print the JSON string representation of the object +print(IntegrationHubPaginatedEventPayload.to_json()) + +# convert the object into a dict +integration_hub_paginated_event_payload_dict = integration_hub_paginated_event_payload_instance.to_dict() +# create an instance of IntegrationHubPaginatedEventPayload from a dict +integration_hub_paginated_event_payload_from_dict = IntegrationHubPaginatedEventPayload.from_dict(integration_hub_paginated_event_payload_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/ListExperiments200Response.md b/docs/ListExperiments200Response.md new file mode 100644 index 0000000..8366e93 --- /dev/null +++ b/docs/ListExperiments200Response.md @@ -0,0 +1,30 @@ +# ListExperiments200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total_result_size** | **int** | | +**data** | [**List[Experiment]**](Experiment.md) | | + +## Example + +```python +from talon_one.models.list_experiments200_response import ListExperiments200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of ListExperiments200Response from a JSON string +list_experiments200_response_instance = ListExperiments200Response.from_json(json) +# print the JSON string representation of the object +print(ListExperiments200Response.to_json()) + +# convert the object into a dict +list_experiments200_response_dict = list_experiments200_response_instance.to_dict() +# create an instance of ListExperiments200Response from a dict +list_experiments200_response_from_dict = ListExperiments200Response.from_dict(list_experiments200_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/LoyaltyPointsChangedEventRequest.md b/docs/LoyaltyPointsChangedEventRequest.md new file mode 100644 index 0000000..f765281 --- /dev/null +++ b/docs/LoyaltyPointsChangedEventRequest.md @@ -0,0 +1,32 @@ +# LoyaltyPointsChangedEventRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total_result_size** | **int** | | +**batched_at** | **datetime** | Timestamp when the batch was created. | [optional] +**event_type** | **str** | | +**data** | **List[object]** | | + +## Example + +```python +from talon_one.models.loyalty_points_changed_event_request import LoyaltyPointsChangedEventRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of LoyaltyPointsChangedEventRequest from a JSON string +loyalty_points_changed_event_request_instance = LoyaltyPointsChangedEventRequest.from_json(json) +# print the JSON string representation of the object +print(LoyaltyPointsChangedEventRequest.to_json()) + +# convert the object into a dict +loyalty_points_changed_event_request_dict = loyalty_points_changed_event_request_instance.to_dict() +# create an instance of LoyaltyPointsChangedEventRequest from a dict +loyalty_points_changed_event_request_from_dict = LoyaltyPointsChangedEventRequest.from_dict(loyalty_points_changed_event_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/LoyaltyTierDowngradeEventRequest.md b/docs/LoyaltyTierDowngradeEventRequest.md new file mode 100644 index 0000000..776a195 --- /dev/null +++ b/docs/LoyaltyTierDowngradeEventRequest.md @@ -0,0 +1,32 @@ +# LoyaltyTierDowngradeEventRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total_result_size** | **int** | | +**batched_at** | **datetime** | Timestamp when the batch was created. | [optional] +**event_type** | **str** | | +**data** | **List[object]** | | + +## Example + +```python +from talon_one.models.loyalty_tier_downgrade_event_request import LoyaltyTierDowngradeEventRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of LoyaltyTierDowngradeEventRequest from a JSON string +loyalty_tier_downgrade_event_request_instance = LoyaltyTierDowngradeEventRequest.from_json(json) +# print the JSON string representation of the object +print(LoyaltyTierDowngradeEventRequest.to_json()) + +# convert the object into a dict +loyalty_tier_downgrade_event_request_dict = loyalty_tier_downgrade_event_request_instance.to_dict() +# create an instance of LoyaltyTierDowngradeEventRequest from a dict +loyalty_tier_downgrade_event_request_from_dict = LoyaltyTierDowngradeEventRequest.from_dict(loyalty_tier_downgrade_event_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PrismaticPaginatedEventPayload.md b/docs/LoyaltyTierUpgradeEventRequest.md similarity index 50% rename from docs/PrismaticPaginatedEventPayload.md rename to docs/LoyaltyTierUpgradeEventRequest.md index 49cd25e..03c6381 100644 --- a/docs/PrismaticPaginatedEventPayload.md +++ b/docs/LoyaltyTierUpgradeEventRequest.md @@ -1,4 +1,4 @@ -# PrismaticPaginatedEventPayload +# LoyaltyTierUpgradeEventRequest ## Properties @@ -13,19 +13,19 @@ Name | Type | Description | Notes ## Example ```python -from talon_one.models.prismatic_paginated_event_payload import PrismaticPaginatedEventPayload +from talon_one.models.loyalty_tier_upgrade_event_request import LoyaltyTierUpgradeEventRequest # TODO update the JSON string below json = "{}" -# create an instance of PrismaticPaginatedEventPayload from a JSON string -prismatic_paginated_event_payload_instance = PrismaticPaginatedEventPayload.from_json(json) +# create an instance of LoyaltyTierUpgradeEventRequest from a JSON string +loyalty_tier_upgrade_event_request_instance = LoyaltyTierUpgradeEventRequest.from_json(json) # print the JSON string representation of the object -print(PrismaticPaginatedEventPayload.to_json()) +print(LoyaltyTierUpgradeEventRequest.to_json()) # convert the object into a dict -prismatic_paginated_event_payload_dict = prismatic_paginated_event_payload_instance.to_dict() -# create an instance of PrismaticPaginatedEventPayload from a dict -prismatic_paginated_event_payload_from_dict = PrismaticPaginatedEventPayload.from_dict(prismatic_paginated_event_payload_dict) +loyalty_tier_upgrade_event_request_dict = loyalty_tier_upgrade_event_request_instance.to_dict() +# create an instance of LoyaltyTierUpgradeEventRequest from a dict +loyalty_tier_upgrade_event_request_from_dict = LoyaltyTierUpgradeEventRequest.from_dict(loyalty_tier_upgrade_event_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ManagementApi.md b/docs/ManagementApi.md index 11833f0..57db73a 100644 --- a/docs/ManagementApi.md +++ b/docs/ManagementApi.md @@ -4,191 +4,18 @@ All URIs are relative to *https://yourbaseurl.talon.one* Method | HTTP request | Description ------------- | ------------- | ------------- -[**activate_user_by_email**](ManagementApi.md#activate_user_by_email) | **POST** /v1/users/activate | Enable user by email address -[**add_loyalty_card_points**](ManagementApi.md#add_loyalty_card_points) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/add_points | Add points to card -[**add_loyalty_points**](ManagementApi.md#add_loyalty_points) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/add_points | Add points to customer profile -[**copy_campaign_to_applications**](ManagementApi.md#copy_campaign_to_applications) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/copy | Copy the campaign into the specified Application -[**create_account_collection**](ManagementApi.md#create_account_collection) | **POST** /v1/collections | Create account-level collection -[**create_achievement**](ManagementApi.md#create_achievement) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements | Create achievement -[**create_additional_cost**](ManagementApi.md#create_additional_cost) | **POST** /v1/additional_costs | Create additional cost -[**create_attribute**](ManagementApi.md#create_attribute) | **POST** /v1/attributes | Create custom attribute -[**create_batch_loyalty_cards**](ManagementApi.md#create_batch_loyalty_cards) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/cards/batch | Create loyalty cards -[**create_campaign_from_template**](ManagementApi.md#create_campaign_from_template) | **POST** /v1/applications/{applicationId}/create_campaign_from_template | Create campaign from campaign template -[**create_campaign_store_budget**](ManagementApi.md#create_campaign_store_budget) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/stores/budgets | Create campaign store budget -[**create_collection**](ManagementApi.md#create_collection) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/collections | Create campaign-level collection -[**create_coupons**](ManagementApi.md#create_coupons) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons | Create coupons -[**create_coupons_async**](ManagementApi.md#create_coupons_async) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_async | Create coupons asynchronously -[**create_coupons_deletion_job**](ManagementApi.md#create_coupons_deletion_job) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_deletion_jobs | Creates a coupon deletion job -[**create_coupons_for_multiple_recipients**](ManagementApi.md#create_coupons_for_multiple_recipients) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_with_recipients | Create coupons for multiple recipients -[**create_invite_email**](ManagementApi.md#create_invite_email) | **POST** /v1/invite_emails | Resend invitation email -[**create_invite_v2**](ManagementApi.md#create_invite_v2) | **POST** /v2/invites | Invite user -[**create_password_recovery_email**](ManagementApi.md#create_password_recovery_email) | **POST** /v1/password_recovery_emails | Request a password reset -[**create_session**](ManagementApi.md#create_session) | **POST** /v1/sessions | Create session -[**create_store**](ManagementApi.md#create_store) | **POST** /v1/applications/{applicationId}/stores | Create store -[**deactivate_user_by_email**](ManagementApi.md#deactivate_user_by_email) | **POST** /v1/users/deactivate | Disable user by email address -[**deduct_loyalty_card_points**](ManagementApi.md#deduct_loyalty_card_points) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/deduct_points | Deduct points from card -[**delete_account_collection**](ManagementApi.md#delete_account_collection) | **DELETE** /v1/collections/{collectionId} | Delete account-level collection -[**delete_achievement**](ManagementApi.md#delete_achievement) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId} | Delete achievement -[**delete_campaign**](ManagementApi.md#delete_campaign) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId} | Delete campaign -[**delete_campaign_store_budgets**](ManagementApi.md#delete_campaign_store_budgets) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/stores/budgets | Delete campaign store budgets -[**delete_collection**](ManagementApi.md#delete_collection) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId} | Delete campaign-level collection -[**delete_coupon**](ManagementApi.md#delete_coupon) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId} | Delete coupon -[**delete_coupons**](ManagementApi.md#delete_coupons) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons | Delete coupons -[**delete_loyalty_card**](ManagementApi.md#delete_loyalty_card) | **DELETE** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId} | Delete loyalty card -[**delete_referral**](ManagementApi.md#delete_referral) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId} | Delete referral -[**delete_store**](ManagementApi.md#delete_store) | **DELETE** /v1/applications/{applicationId}/stores/{storeId} | Delete store -[**delete_user**](ManagementApi.md#delete_user) | **DELETE** /v1/users/{userId} | Delete user -[**delete_user_by_email**](ManagementApi.md#delete_user_by_email) | **POST** /v1/users/delete | Delete user by email address -[**destroy_session**](ManagementApi.md#destroy_session) | **DELETE** /v1/sessions | Destroy session -[**disconnect_campaign_stores**](ManagementApi.md#disconnect_campaign_stores) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/stores | Disconnect stores -[**export_account_collection_items**](ManagementApi.md#export_account_collection_items) | **GET** /v1/collections/{collectionId}/export | Export account-level collection's items -[**export_achievements**](ManagementApi.md#export_achievements) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}/export | Export achievement customer data -[**export_audiences_memberships**](ManagementApi.md#export_audiences_memberships) | **GET** /v1/audiences/{audienceId}/memberships/export | Export audience members -[**export_campaign_store_budgets**](ManagementApi.md#export_campaign_store_budgets) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/stores/budgets/export | Export campaign store budgets -[**export_campaign_stores**](ManagementApi.md#export_campaign_stores) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/stores/export | Export stores -[**export_collection_items**](ManagementApi.md#export_collection_items) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/export | Export campaign-level collection's items -[**export_coupons**](ManagementApi.md#export_coupons) | **GET** /v1/applications/{applicationId}/export_coupons | Export coupons -[**export_customer_sessions**](ManagementApi.md#export_customer_sessions) | **GET** /v1/applications/{applicationId}/export_customer_sessions | Export customer sessions -[**export_customers_tiers**](ManagementApi.md#export_customers_tiers) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/export_customers_tiers | Export customers' tier data -[**export_effects**](ManagementApi.md#export_effects) | **GET** /v1/applications/{applicationId}/export_effects | Export triggered effects -[**export_loyalty_balance**](ManagementApi.md#export_loyalty_balance) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/export_customer_balance | Export customer loyalty balance to CSV -[**export_loyalty_balances**](ManagementApi.md#export_loyalty_balances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/export_customer_balances | Export customer loyalty balances -[**export_loyalty_card_balances**](ManagementApi.md#export_loyalty_card_balances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/export_card_balances | Export all card transaction logs -[**export_loyalty_card_ledger**](ManagementApi.md#export_loyalty_card_ledger) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/export_log | Export card's ledger log -[**export_loyalty_cards**](ManagementApi.md#export_loyalty_cards) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/export | Export loyalty cards -[**export_loyalty_ledger**](ManagementApi.md#export_loyalty_ledger) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/export_log | Export customer's transaction logs -[**export_pool_giveaways**](ManagementApi.md#export_pool_giveaways) | **GET** /v1/giveaways/pools/{poolId}/export | Export giveaway codes of a giveaway pool -[**export_referrals**](ManagementApi.md#export_referrals) | **GET** /v1/applications/{applicationId}/export_referrals | Export referrals -[**generate_coupon_rejections**](ManagementApi.md#generate_coupon_rejections) | **GET** /v1/coupon_rejections | Summarize coupon redemption failures in session -[**get_access_logs_without_total_count**](ManagementApi.md#get_access_logs_without_total_count) | **GET** /v1/applications/{applicationId}/access_logs/no_total | Get access logs for Application -[**get_account**](ManagementApi.md#get_account) | **GET** /v1/accounts/{accountId} | Get account details -[**get_account_analytics**](ManagementApi.md#get_account_analytics) | **GET** /v1/accounts/{accountId}/analytics | Get account analytics -[**get_account_collection**](ManagementApi.md#get_account_collection) | **GET** /v1/collections/{collectionId} | Get account-level collection -[**get_achievement**](ManagementApi.md#get_achievement) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId} | Get achievement -[**get_additional_cost**](ManagementApi.md#get_additional_cost) | **GET** /v1/additional_costs/{additionalCostId} | Get additional cost -[**get_additional_costs**](ManagementApi.md#get_additional_costs) | **GET** /v1/additional_costs | List additional costs -[**get_application**](ManagementApi.md#get_application) | **GET** /v1/applications/{applicationId} | Get Application -[**get_application_api_health**](ManagementApi.md#get_application_api_health) | **GET** /v1/applications/{applicationId}/health_report | Get Application health -[**get_application_customer**](ManagementApi.md#get_application_customer) | **GET** /v1/applications/{applicationId}/customers/{customerId} | Get application's customer -[**get_application_customer_friends**](ManagementApi.md#get_application_customer_friends) | **GET** /v1/applications/{applicationId}/profile/{integrationId}/friends | List friends referred by customer profile -[**get_application_customers**](ManagementApi.md#get_application_customers) | **GET** /v1/applications/{applicationId}/customers | List application's customers -[**get_application_customers_by_attributes**](ManagementApi.md#get_application_customers_by_attributes) | **POST** /v1/applications/{applicationId}/customer_search | List application customers matching the given attributes -[**get_application_event_types**](ManagementApi.md#get_application_event_types) | **GET** /v1/applications/{applicationId}/event_types | List Applications event types -[**get_application_events_without_total_count**](ManagementApi.md#get_application_events_without_total_count) | **GET** /v1/applications/{applicationId}/events/no_total | List Applications events -[**get_application_session**](ManagementApi.md#get_application_session) | **GET** /v1/applications/{applicationId}/sessions/{sessionId} | Get Application session -[**get_application_sessions**](ManagementApi.md#get_application_sessions) | **GET** /v1/applications/{applicationId}/sessions | List Application sessions -[**get_applications**](ManagementApi.md#get_applications) | **GET** /v1/applications | List Applications -[**get_attribute**](ManagementApi.md#get_attribute) | **GET** /v1/attributes/{attributeId} | Get custom attribute -[**get_attributes**](ManagementApi.md#get_attributes) | **GET** /v1/attributes | List custom attributes -[**get_audience_memberships**](ManagementApi.md#get_audience_memberships) | **GET** /v1/audiences/{audienceId}/memberships | List audience members -[**get_audiences**](ManagementApi.md#get_audiences) | **GET** /v1/audiences | List audiences -[**get_audiences_analytics**](ManagementApi.md#get_audiences_analytics) | **GET** /v1/audiences/analytics | List audience analytics -[**get_campaign**](ManagementApi.md#get_campaign) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId} | Get campaign -[**get_campaign_analytics**](ManagementApi.md#get_campaign_analytics) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/analytics | Get analytics of campaigns -[**get_campaign_by_attributes**](ManagementApi.md#get_campaign_by_attributes) | **POST** /v1/applications/{applicationId}/campaigns_search | List campaigns that match the given attributes -[**get_campaign_group**](ManagementApi.md#get_campaign_group) | **GET** /v1/campaign_groups/{campaignGroupId} | Get campaign access group -[**get_campaign_groups**](ManagementApi.md#get_campaign_groups) | **GET** /v1/campaign_groups | List campaign access groups -[**get_campaign_templates**](ManagementApi.md#get_campaign_templates) | **GET** /v1/campaign_templates | List campaign templates -[**get_campaigns**](ManagementApi.md#get_campaigns) | **GET** /v1/applications/{applicationId}/campaigns | List campaigns -[**get_changes**](ManagementApi.md#get_changes) | **GET** /v1/changes | Get audit logs for an account -[**get_collection**](ManagementApi.md#get_collection) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId} | Get campaign-level collection -[**get_collection_items**](ManagementApi.md#get_collection_items) | **GET** /v1/collections/{collectionId}/items | Get collection items -[**get_coupons_without_total_count**](ManagementApi.md#get_coupons_without_total_count) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/no_total | List coupons -[**get_customer_activity_report**](ManagementApi.md#get_customer_activity_report) | **GET** /v1/applications/{applicationId}/customer_activity_reports/{customerId} | Get customer's activity report -[**get_customer_activity_reports_without_total_count**](ManagementApi.md#get_customer_activity_reports_without_total_count) | **GET** /v1/applications/{applicationId}/customer_activity_reports/no_total | Get Activity Reports for Application Customers -[**get_customer_analytics**](ManagementApi.md#get_customer_analytics) | **GET** /v1/applications/{applicationId}/customers/{customerId}/analytics | Get customer's analytics report -[**get_customer_profile**](ManagementApi.md#get_customer_profile) | **GET** /v1/customers/{customerId} | Get customer profile -[**get_customer_profile_achievement_progress**](ManagementApi.md#get_customer_profile_achievement_progress) | **GET** /v1/applications/{applicationId}/achievement_progress/{integrationId} | List customer achievements -[**get_customer_profiles**](ManagementApi.md#get_customer_profiles) | **GET** /v1/customers/no_total | List customer profiles -[**get_customers_by_attributes**](ManagementApi.md#get_customers_by_attributes) | **POST** /v1/customer_search/no_total | List customer profiles matching the given attributes -[**get_dashboard_statistics**](ManagementApi.md#get_dashboard_statistics) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/dashboard | Get statistics for loyalty dashboard -[**get_event_types**](ManagementApi.md#get_event_types) | **GET** /v1/event_types | List event types -[**get_exports**](ManagementApi.md#get_exports) | **GET** /v1/exports | Get exports -[**get_loyalty_card**](ManagementApi.md#get_loyalty_card) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId} | Get loyalty card -[**get_loyalty_card_transaction_logs**](ManagementApi.md#get_loyalty_card_transaction_logs) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/logs | List card's transactions -[**get_loyalty_cards**](ManagementApi.md#get_loyalty_cards) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards | List loyalty cards -[**get_loyalty_ledger_balances**](ManagementApi.md#get_loyalty_ledger_balances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_balances | Get customer's loyalty balances -[**get_loyalty_points**](ManagementApi.md#get_loyalty_points) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId} | Get customer's full loyalty ledger -[**get_loyalty_program**](ManagementApi.md#get_loyalty_program) | **GET** /v1/loyalty_programs/{loyaltyProgramId} | Get loyalty program -[**get_loyalty_program_profile_ledger_transactions**](ManagementApi.md#get_loyalty_program_profile_ledger_transactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_transactions | List customer's loyalty transactions -[**get_loyalty_program_transactions**](ManagementApi.md#get_loyalty_program_transactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/transactions | List loyalty program transactions -[**get_loyalty_programs**](ManagementApi.md#get_loyalty_programs) | **GET** /v1/loyalty_programs | List loyalty programs -[**get_loyalty_statistics**](ManagementApi.md#get_loyalty_statistics) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/statistics | Get loyalty program statistics -[**get_message_logs**](ManagementApi.md#get_message_logs) | **GET** /v1/message_logs | List message log entries -[**get_referrals_without_total_count**](ManagementApi.md#get_referrals_without_total_count) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/no_total | List referrals -[**get_role_v2**](ManagementApi.md#get_role_v2) | **GET** /v2/roles/{roleId} | Get role -[**get_ruleset**](ManagementApi.md#get_ruleset) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId} | Get ruleset -[**get_rulesets**](ManagementApi.md#get_rulesets) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets | List campaign rulesets -[**get_store**](ManagementApi.md#get_store) | **GET** /v1/applications/{applicationId}/stores/{storeId} | Get store -[**get_user**](ManagementApi.md#get_user) | **GET** /v1/users/{userId} | Get user -[**get_users**](ManagementApi.md#get_users) | **GET** /v1/users | List users in account -[**get_webhook**](ManagementApi.md#get_webhook) | **GET** /v1/webhooks/{webhookId} | Get webhook -[**get_webhooks**](ManagementApi.md#get_webhooks) | **GET** /v1/webhooks | List webhooks -[**import_account_collection**](ManagementApi.md#import_account_collection) | **POST** /v1/collections/{collectionId}/import | Import data into existing account-level collection -[**import_allowed_list**](ManagementApi.md#import_allowed_list) | **POST** /v1/attributes/{attributeId}/allowed_list/import | Import allowed values for attribute -[**import_audiences_memberships**](ManagementApi.md#import_audiences_memberships) | **POST** /v1/audiences/{audienceId}/memberships/import | Import audience members -[**import_campaign_store_budget**](ManagementApi.md#import_campaign_store_budget) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/stores/budgets/import | Import campaign store budgets -[**import_campaign_stores**](ManagementApi.md#import_campaign_stores) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/stores/import | Import stores -[**import_collection**](ManagementApi.md#import_collection) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/import | Import data into existing campaign-level collection -[**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_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 -[**invite_user_external**](ManagementApi.md#invite_user_external) | **POST** /v1/users/invite | Invite user from identity provider -[**list_account_collections**](ManagementApi.md#list_account_collections) | **GET** /v1/collections | List collections in account -[**list_achievements**](ManagementApi.md#list_achievements) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements | List achievements -[**list_all_roles_v2**](ManagementApi.md#list_all_roles_v2) | **GET** /v2/roles | List roles -[**list_campaign_store_budget_limits**](ManagementApi.md#list_campaign_store_budget_limits) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/stores/budgets | List campaign store budget limits -[**list_catalog_items**](ManagementApi.md#list_catalog_items) | **GET** /v1/catalogs/{catalogId}/items | List items in a catalog -[**list_collections**](ManagementApi.md#list_collections) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/collections | List collections in campaign -[**list_collections_in_application**](ManagementApi.md#list_collections_in_application) | **GET** /v1/applications/{applicationId}/collections | List collections in Application -[**list_stores**](ManagementApi.md#list_stores) | **GET** /v1/applications/{applicationId}/stores | List stores -[**okta_event_handler_challenge**](ManagementApi.md#okta_event_handler_challenge) | **GET** /v1/provisioning/okta | Validate Okta API ownership -[**remove_loyalty_points**](ManagementApi.md#remove_loyalty_points) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/deduct_points | Deduct points from customer profile -[**reset_password**](ManagementApi.md#reset_password) | **POST** /v1/reset_password | Reset password -[**scim_create_group**](ManagementApi.md#scim_create_group) | **POST** /v1/provisioning/scim/Groups | Create SCIM group -[**scim_create_user**](ManagementApi.md#scim_create_user) | **POST** /v1/provisioning/scim/Users | Create SCIM user -[**scim_delete_group**](ManagementApi.md#scim_delete_group) | **DELETE** /v1/provisioning/scim/Groups/{groupId} | Delete SCIM group -[**scim_delete_user**](ManagementApi.md#scim_delete_user) | **DELETE** /v1/provisioning/scim/Users/{userId} | Delete SCIM user -[**scim_get_group**](ManagementApi.md#scim_get_group) | **GET** /v1/provisioning/scim/Groups/{groupId} | Get SCIM group -[**scim_get_groups**](ManagementApi.md#scim_get_groups) | **GET** /v1/provisioning/scim/Groups | List SCIM groups -[**scim_get_resource_types**](ManagementApi.md#scim_get_resource_types) | **GET** /v1/provisioning/scim/ResourceTypes | List supported SCIM resource types -[**scim_get_schemas**](ManagementApi.md#scim_get_schemas) | **GET** /v1/provisioning/scim/Schemas | List supported SCIM schemas -[**scim_get_service_provider_config**](ManagementApi.md#scim_get_service_provider_config) | **GET** /v1/provisioning/scim/ServiceProviderConfig | Get SCIM service provider configuration -[**scim_get_user**](ManagementApi.md#scim_get_user) | **GET** /v1/provisioning/scim/Users/{userId} | Get SCIM user -[**scim_get_users**](ManagementApi.md#scim_get_users) | **GET** /v1/provisioning/scim/Users | List SCIM users -[**scim_patch_group**](ManagementApi.md#scim_patch_group) | **PATCH** /v1/provisioning/scim/Groups/{groupId} | Update SCIM group attributes -[**scim_patch_user**](ManagementApi.md#scim_patch_user) | **PATCH** /v1/provisioning/scim/Users/{userId} | Update SCIM user attributes -[**scim_replace_group_attributes**](ManagementApi.md#scim_replace_group_attributes) | **PUT** /v1/provisioning/scim/Groups/{groupId} | Update SCIM group -[**scim_replace_user_attributes**](ManagementApi.md#scim_replace_user_attributes) | **PUT** /v1/provisioning/scim/Users/{userId} | Update SCIM user -[**search_coupons_advanced_application_wide_without_total_count**](ManagementApi.md#search_coupons_advanced_application_wide_without_total_count) | **POST** /v1/applications/{applicationId}/coupons_search_advanced/no_total | List coupons that match the given attributes (without total count) -[**search_coupons_advanced_without_total_count**](ManagementApi.md#search_coupons_advanced_without_total_count) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_search_advanced/no_total | List coupons that match the given attributes in campaign (without total count) -[**summarize_campaign_store_budget**](ManagementApi.md#summarize_campaign_store_budget) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/stores/budgets/summary | Get summary of campaign store budgets -[**transfer_loyalty_card**](ManagementApi.md#transfer_loyalty_card) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/transfer | Transfer card data -[**update_account_collection**](ManagementApi.md#update_account_collection) | **PUT** /v1/collections/{collectionId} | Update account-level collection -[**update_achievement**](ManagementApi.md#update_achievement) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId} | Update achievement -[**update_additional_cost**](ManagementApi.md#update_additional_cost) | **PUT** /v1/additional_costs/{additionalCostId} | Update additional cost -[**update_attribute**](ManagementApi.md#update_attribute) | **PUT** /v1/attributes/{attributeId} | Update custom attribute -[**update_campaign**](ManagementApi.md#update_campaign) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId} | Update campaign -[**update_collection**](ManagementApi.md#update_collection) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId} | Update campaign-level collection's description -[**update_coupon**](ManagementApi.md#update_coupon) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId} | Update coupon -[**update_coupon_batch**](ManagementApi.md#update_coupon_batch) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons | Update coupons -[**update_loyalty_card**](ManagementApi.md#update_loyalty_card) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId} | Update loyalty card -[**update_referral**](ManagementApi.md#update_referral) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId} | Update referral -[**update_role_v2**](ManagementApi.md#update_role_v2) | **PUT** /v2/roles/{roleId} | Update role -[**update_store**](ManagementApi.md#update_store) | **PUT** /v1/applications/{applicationId}/stores/{storeId} | Update store -[**update_user**](ManagementApi.md#update_user) | **PUT** /v1/users/{userId} | Update user +[**coupon_created_event**](ManagementApi.md#coupon_created_event) | **POST** /CouponCreatedEvent | Coupon Created Event +[**coupon_deleted_event**](ManagementApi.md#coupon_deleted_event) | **POST** /CouponDeletedEvent | Coupon Deleted Event +[**coupon_updated_event**](ManagementApi.md#coupon_updated_event) | **POST** /CouponUpdatedEvent | Coupon Updated Event +[**loyalty_points_changed_event**](ManagementApi.md#loyalty_points_changed_event) | **POST** /LoyaltyPointsChangedEvent | Changed Loyalty Points Event +[**loyalty_tier_downgrade_event**](ManagementApi.md#loyalty_tier_downgrade_event) | **POST** /LoyaltyTierDowngradeEvent | Loyalty Tier Downgrade Event +[**loyalty_tier_upgrade_event**](ManagementApi.md#loyalty_tier_upgrade_event) | **POST** /LoyaltyTierUpgradeEvent | Loyalty Tier Upgrade Event -# **activate_user_by_email** -> activate_user_by_email(activate_user_request) - -Enable user by email address - -Enable a [disabled user](https://docs.talon.one/docs/product/account/account-settings/managing-users#disabling-a-user) by their email address. +# **coupon_created_event** +> coupon_created_event(coupon_created_event_request) +Coupon Created Event ### Example @@ -198,7 +25,6 @@ Enable a [disabled user](https://docs.talon.one/docs/product/account/account-set ```python import talon_one -from talon_one.models.activate_user_request import ActivateUserRequest from talon_one.rest import ApiException from pprint import pprint @@ -235,13 +61,13 @@ 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) - activate_user_request = talon_one.ActivateUserRequest() # ActivateUserRequest | body + coupon_created_event_request = talon_one.CouponCreatedEventRequest() # CouponCreatedEventRequest | ... try: - # Enable user by email address - api_instance.activate_user_by_email(activate_user_request) + # Coupon Created Event + api_instance.coupon_created_event(coupon_created_event_request) except Exception as e: - print("Exception when calling ManagementApi->activate_user_by_email: %s\n" % e) + print("Exception when calling ManagementApi->coupon_created_event: %s\n" % e) ``` @@ -251,7 +77,7 @@ with talon_one.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **activate_user_request** | [**ActivateUserRequest**](ActivateUserRequest.md)| body | + **coupon_created_event_request** | [**CouponCreatedEventRequest**](CouponCreatedEventRequest.md)| ... | ### Return type @@ -266,21 +92,13 @@ void (empty response body) - **Content-Type**: application/json - **Accept**: Not defined -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | No Content | - | [[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) -# **add_loyalty_card_points** -> add_loyalty_card_points(loyalty_program_id, loyalty_card_id, add_loyalty_points) - -Add points to card - -Add points to the given loyalty card in the specified card-based loyalty program. +# **coupon_deleted_event** +> coupon_deleted_event(coupon_deleted_event_request) +Coupon Deleted Event ### Example @@ -290,7 +108,6 @@ Add points to the given loyalty card in the specified card-based loyalty program ```python import talon_one -from talon_one.models.add_loyalty_points import AddLoyaltyPoints from talon_one.rest import ApiException from pprint import pprint @@ -327,15 +144,13 @@ 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) - loyalty_program_id = 56 # int | Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. - loyalty_card_id = 'loyalty_card_id_example' # str | Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. - add_loyalty_points = talon_one.AddLoyaltyPoints() # AddLoyaltyPoints | body + coupon_deleted_event_request = talon_one.CouponDeletedEventRequest() # CouponDeletedEventRequest | ... try: - # Add points to card - api_instance.add_loyalty_card_points(loyalty_program_id, loyalty_card_id, add_loyalty_points) + # Coupon Deleted Event + api_instance.coupon_deleted_event(coupon_deleted_event_request) except Exception as e: - print("Exception when calling ManagementApi->add_loyalty_card_points: %s\n" % e) + print("Exception when calling ManagementApi->coupon_deleted_event: %s\n" % e) ``` @@ -345,9 +160,7 @@ with talon_one.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **int**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | - **loyalty_card_id** | **str**| Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. | - **add_loyalty_points** | [**AddLoyaltyPoints**](AddLoyaltyPoints.md)| body | + **coupon_deleted_event_request** | [**CouponDeletedEventRequest**](CouponDeletedEventRequest.md)| ... | ### Return type @@ -360,29 +173,15 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details + - **Accept**: Not defined -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | No Content | - | -**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) -# **add_loyalty_points** -> add_loyalty_points(loyalty_program_id, integration_id, add_loyalty_points) - -Add points to customer profile - -Add points in the specified loyalty program for the given customer. - -To get the `integrationId` of the profile from a `sessionId`, use the -[Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. +# **coupon_updated_event** +> coupon_updated_event(coupon_updated_event_request) +Coupon Updated Event ### Example @@ -392,7 +191,6 @@ To get the `integrationId` of the profile from a `sessionId`, use the ```python import talon_one -from talon_one.models.add_loyalty_points import AddLoyaltyPoints from talon_one.rest import ApiException from pprint import pprint @@ -429,15 +227,13 @@ 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) - loyalty_program_id = 'loyalty_program_id_example' # str | The identifier for the loyalty program. - 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. - add_loyalty_points = talon_one.AddLoyaltyPoints() # AddLoyaltyPoints | body + coupon_updated_event_request = talon_one.CouponUpdatedEventRequest() # CouponUpdatedEventRequest | ... try: - # Add points to customer profile - api_instance.add_loyalty_points(loyalty_program_id, integration_id, add_loyalty_points) + # Coupon Updated Event + api_instance.coupon_updated_event(coupon_updated_event_request) except Exception as e: - print("Exception when calling ManagementApi->add_loyalty_points: %s\n" % e) + print("Exception when calling ManagementApi->coupon_updated_event: %s\n" % e) ``` @@ -447,9 +243,7 @@ with talon_one.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **str**| The identifier for the loyalty program. | - **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. | - **add_loyalty_points** | [**AddLoyaltyPoints**](AddLoyaltyPoints.md)| body | + **coupon_updated_event_request** | [**CouponUpdatedEventRequest**](CouponUpdatedEventRequest.md)| ... | ### Return type @@ -462,220 +256,15 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | No Content | - | -**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) - -# **copy_campaign_to_applications** -> GetCampaigns200Response copy_campaign_to_applications(application_id, campaign_id, campaign_copy) - -Copy the campaign into the specified Application - -Copy the campaign into all specified Applications. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.campaign_copy import CampaignCopy -from talon_one.models.get_campaigns200_response import GetCampaigns200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - campaign_copy = talon_one.CampaignCopy() # CampaignCopy | body - - try: - # Copy the campaign into the specified Application - api_response = api_instance.copy_campaign_to_applications(application_id, campaign_id, campaign_copy) - print("The response of ManagementApi->copy_campaign_to_applications:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->copy_campaign_to_applications: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **campaign_copy** | [**CampaignCopy**](CampaignCopy.md)| body | - -### Return type - -[**GetCampaigns200Response**](GetCampaigns200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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) - -# **create_account_collection** -> Collection create_account_collection(new_collection) - -Create account-level collection - -Create an account-level collection. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.collection import Collection -from talon_one.models.new_collection import NewCollection -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - new_collection = talon_one.NewCollection() # NewCollection | body - - try: - # Create account-level collection - api_response = api_instance.create_account_collection(new_collection) - print("The response of ManagementApi->create_account_collection:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->create_account_collection: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **new_collection** | [**NewCollection**](NewCollection.md)| body | - -### Return type - -[**Collection**](Collection.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details + - **Accept**: Not defined -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | Created | - | -**400** | Bad request | - | -**401** | Unauthorized | - | -**409** | Conflict. A collection with this name already exists. | - | [[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) -# **create_achievement** -> Achievement create_achievement(application_id, campaign_id, create_achievement) +# **loyalty_points_changed_event** +> loyalty_points_changed_event(loyalty_points_changed_event_request) -Create achievement - -Create a new achievement in a specific campaign. +Changed Loyalty Points Event ### Example @@ -685,8 +274,6 @@ Create a new achievement in a specific campaign. ```python import talon_one -from talon_one.models.achievement import Achievement -from talon_one.models.create_achievement import CreateAchievement from talon_one.rest import ApiException from pprint import pprint @@ -723,17 +310,13 @@ 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) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - create_achievement = talon_one.CreateAchievement() # CreateAchievement | body + loyalty_points_changed_event_request = talon_one.LoyaltyPointsChangedEventRequest() # LoyaltyPointsChangedEventRequest | ... try: - # Create achievement - api_response = api_instance.create_achievement(application_id, campaign_id, create_achievement) - print("The response of ManagementApi->create_achievement:\n") - pprint(api_response) + # Changed Loyalty Points Event + api_instance.loyalty_points_changed_event(loyalty_points_changed_event_request) except Exception as e: - print("Exception when calling ManagementApi->create_achievement: %s\n" % e) + print("Exception when calling ManagementApi->loyalty_points_changed_event: %s\n" % e) ``` @@ -743,13 +326,11 @@ with talon_one.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **create_achievement** | [**CreateAchievement**](CreateAchievement.md)| body | + **loyalty_points_changed_event_request** | [**LoyaltyPointsChangedEventRequest**](LoyaltyPointsChangedEventRequest.md)| ... | ### Return type -[**Achievement**](Achievement.md) +void (empty response body) ### Authorization @@ -758,28 +339,15 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details + - **Accept**: Not defined -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | Created | - | -**400** | Bad request | - | -**401** | Unauthorized | - | -**409** | Conflict. An achievement with this name or title already exists. | - | [[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) -# **create_additional_cost** -> AccountAdditionalCost create_additional_cost(new_additional_cost) - -Create additional cost - -Create an [additional cost](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs). - -These additional costs are shared across all applications in your account, and are never required. +# **loyalty_tier_downgrade_event** +> loyalty_tier_downgrade_event(loyalty_tier_downgrade_event_request) +Loyalty Tier Downgrade Event ### Example @@ -789,8 +357,6 @@ These additional costs are shared across all applications in your account, and a ```python import talon_one -from talon_one.models.account_additional_cost import AccountAdditionalCost -from talon_one.models.new_additional_cost import NewAdditionalCost from talon_one.rest import ApiException from pprint import pprint @@ -827,15 +393,13 @@ 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) - new_additional_cost = talon_one.NewAdditionalCost() # NewAdditionalCost | body + loyalty_tier_downgrade_event_request = talon_one.LoyaltyTierDowngradeEventRequest() # LoyaltyTierDowngradeEventRequest | ... try: - # Create additional cost - api_response = api_instance.create_additional_cost(new_additional_cost) - print("The response of ManagementApi->create_additional_cost:\n") - pprint(api_response) + # Loyalty Tier Downgrade Event + api_instance.loyalty_tier_downgrade_event(loyalty_tier_downgrade_event_request) except Exception as e: - print("Exception when calling ManagementApi->create_additional_cost: %s\n" % e) + print("Exception when calling ManagementApi->loyalty_tier_downgrade_event: %s\n" % e) ``` @@ -845,11 +409,11 @@ with talon_one.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **new_additional_cost** | [**NewAdditionalCost**](NewAdditionalCost.md)| body | + **loyalty_tier_downgrade_event_request** | [**LoyaltyTierDowngradeEventRequest**](LoyaltyTierDowngradeEventRequest.md)| ... | ### Return type -[**AccountAdditionalCost**](AccountAdditionalCost.md) +void (empty response body) ### Authorization @@ -858,34 +422,15 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details + - **Accept**: Not defined -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | Created | - | [[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) -# **create_attribute** -> Attribute create_attribute(new_attribute) - -Create custom attribute - -Create a _custom attribute_ in this account. -[Custom attributes](https://docs.talon.one/docs/dev/concepts/attributes) allow you -to add data to Talon.One domain entities like campaigns, coupons, -customers and so on. - -These attributes can then be given values when creating/updating these entities, and these values can be -used in your campaign rules. - -For example, you could define a `zipCode` field for customer sessions, -and add a rule to your campaign that only allows certain ZIP codes. - -These attributes are shared across all Applications in your account and are never required. +# **loyalty_tier_upgrade_event** +> loyalty_tier_upgrade_event(loyalty_tier_upgrade_event_request) +Loyalty Tier Upgrade Event ### Example @@ -895,8 +440,6 @@ These attributes are shared across all Applications in your account and are neve ```python import talon_one -from talon_one.models.attribute import Attribute -from talon_one.models.new_attribute import NewAttribute from talon_one.rest import ApiException from pprint import pprint @@ -933,15 +476,13 @@ 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) - new_attribute = talon_one.NewAttribute() # NewAttribute | body + loyalty_tier_upgrade_event_request = talon_one.LoyaltyTierUpgradeEventRequest() # LoyaltyTierUpgradeEventRequest | ... try: - # Create custom attribute - api_response = api_instance.create_attribute(new_attribute) - print("The response of ManagementApi->create_attribute:\n") - pprint(api_response) + # Loyalty Tier Upgrade Event + api_instance.loyalty_tier_upgrade_event(loyalty_tier_upgrade_event_request) except Exception as e: - print("Exception when calling ManagementApi->create_attribute: %s\n" % e) + print("Exception when calling ManagementApi->loyalty_tier_upgrade_event: %s\n" % e) ``` @@ -951,11 +492,11 @@ with talon_one.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **new_attribute** | [**NewAttribute**](NewAttribute.md)| body | + **loyalty_tier_upgrade_event_request** | [**LoyaltyTierUpgradeEventRequest**](LoyaltyTierUpgradeEventRequest.md)| ... | ### Return type -[**Attribute**](Attribute.md) +void (empty response body) ### Authorization @@ -964,17422 +505,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | Created | - | - -[[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) - -# **create_batch_loyalty_cards** -> LoyaltyCardBatchResponse create_batch_loyalty_cards(loyalty_program_id, loyalty_card_batch) - -Create loyalty cards - -Create a batch of loyalty cards in a specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types). - -Customers can use loyalty cards to collect and spend loyalty points. - -**Important:** - -- The specified card-based loyalty program must have a defined card code format that is used to generate the loyalty card codes. -- Trying to create more than 20,000 loyalty cards in a single request returns an error message with a `400` status code. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.loyalty_card_batch import LoyaltyCardBatch -from talon_one.models.loyalty_card_batch_response import LoyaltyCardBatchResponse -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. - loyalty_card_batch = talon_one.LoyaltyCardBatch() # LoyaltyCardBatch | body - - try: - # Create loyalty cards - api_response = api_instance.create_batch_loyalty_cards(loyalty_program_id, loyalty_card_batch) - print("The response of ManagementApi->create_batch_loyalty_cards:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->create_batch_loyalty_cards: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **int**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | - **loyalty_card_batch** | [**LoyaltyCardBatch**](LoyaltyCardBatch.md)| body | - -### Return type - -[**LoyaltyCardBatchResponse**](LoyaltyCardBatchResponse.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | -**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) - -# **create_campaign_from_template** -> CreateTemplateCampaignResponse create_campaign_from_template(application_id, create_template_campaign) - -Create campaign from campaign template - -Use the campaign template referenced in the request body to create -a new campaign in one of the connected Applications. - -If the template was created from a campaign with rules referencing [campaign collections](https://docs.talon.one/docs/product/campaigns/managing-collections), -the corresponding collections for the new campaign are created automatically. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.create_template_campaign import CreateTemplateCampaign -from talon_one.models.create_template_campaign_response import CreateTemplateCampaignResponse -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - create_template_campaign = talon_one.CreateTemplateCampaign() # CreateTemplateCampaign | body - - try: - # Create campaign from campaign template - api_response = api_instance.create_campaign_from_template(application_id, create_template_campaign) - print("The response of ManagementApi->create_campaign_from_template:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->create_campaign_from_template: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **create_template_campaign** | [**CreateTemplateCampaign**](CreateTemplateCampaign.md)| body | - -### Return type - -[**CreateTemplateCampaignResponse**](CreateTemplateCampaignResponse.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**201** | Created | - | - -[[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) - -# **create_campaign_store_budget** -> create_campaign_store_budget(application_id, campaign_id, new_campaign_store_budget) - -Create campaign store budget - -Create a new store budget for a given campaign. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.new_campaign_store_budget import NewCampaignStoreBudget -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - new_campaign_store_budget = talon_one.NewCampaignStoreBudget() # NewCampaignStoreBudget | body - - try: - # Create campaign store budget - api_instance.create_campaign_store_budget(application_id, campaign_id, new_campaign_store_budget) - except Exception as e: - print("Exception when calling ManagementApi->create_campaign_store_budget: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **new_campaign_store_budget** | [**NewCampaignStoreBudget**](NewCampaignStoreBudget.md)| body | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**201** | Created | - | -**400** | Bad request | - | -**409** | Conflict | - | - -[[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) - -# **create_collection** -> Collection create_collection(application_id, campaign_id, new_campaign_collection) - -Create campaign-level collection - -Create a campaign-level collection in a given campaign. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.collection import Collection -from talon_one.models.new_campaign_collection import NewCampaignCollection -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - new_campaign_collection = talon_one.NewCampaignCollection() # NewCampaignCollection | body - - try: - # Create campaign-level collection - api_response = api_instance.create_collection(application_id, campaign_id, new_campaign_collection) - print("The response of ManagementApi->create_collection:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->create_collection: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **new_campaign_collection** | [**NewCampaignCollection**](NewCampaignCollection.md)| body | - -### Return type - -[**Collection**](Collection.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**201** | Created | - | - -[[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) - -# **create_coupons** -> CreateCoupons200Response create_coupons(application_id, campaign_id, new_coupons, silent=silent) - -Create coupons - -Create coupons according to some pattern. Up to 20.000 coupons can be created without a unique prefix. When a unique prefix is provided, up to 200.000 coupons can be created. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.create_coupons200_response import CreateCoupons200Response -from talon_one.models.new_coupons import NewCoupons -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - new_coupons = talon_one.NewCoupons() # NewCoupons | 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') - - try: - # Create coupons - api_response = api_instance.create_coupons(application_id, campaign_id, new_coupons, silent=silent) - print("The response of ManagementApi->create_coupons:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->create_coupons: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **new_coupons** | [**NewCoupons**](NewCoupons.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'] - -### Return type - -[**CreateCoupons200Response**](CreateCoupons200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | -**204** | No Content | - | - -[[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) - -# **create_coupons_async** -> AsyncCouponCreationResponse create_coupons_async(application_id, campaign_id, new_coupon_creation_job) - -Create coupons asynchronously - -Create up to 5,000,000 coupons asynchronously. You should typically use this enpdoint when you create at least 20,001 coupons. You receive an email when the creation is complete. - -If you want to create less than 20,001 coupons, you can use the [Create coupons](https://docs.talon.one/management-api#tag/Coupons/operation/createCoupons) endpoint. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.async_coupon_creation_response import AsyncCouponCreationResponse -from talon_one.models.new_coupon_creation_job import NewCouponCreationJob -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - new_coupon_creation_job = talon_one.NewCouponCreationJob() # NewCouponCreationJob | body - - try: - # Create coupons asynchronously - api_response = api_instance.create_coupons_async(application_id, campaign_id, new_coupon_creation_job) - print("The response of ManagementApi->create_coupons_async:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->create_coupons_async: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **new_coupon_creation_job** | [**NewCouponCreationJob**](NewCouponCreationJob.md)| body | - -### Return type - -[**AsyncCouponCreationResponse**](AsyncCouponCreationResponse.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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) - -# **create_coupons_deletion_job** -> AsyncCouponDeletionJobResponse create_coupons_deletion_job(application_id, campaign_id, new_coupon_deletion_job) - -Creates a coupon deletion job - -This endpoint handles creating a job to delete coupons asynchronously. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.async_coupon_deletion_job_response import AsyncCouponDeletionJobResponse -from talon_one.models.new_coupon_deletion_job import NewCouponDeletionJob -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - new_coupon_deletion_job = talon_one.NewCouponDeletionJob() # NewCouponDeletionJob | body - - try: - # Creates a coupon deletion job - api_response = api_instance.create_coupons_deletion_job(application_id, campaign_id, new_coupon_deletion_job) - print("The response of ManagementApi->create_coupons_deletion_job:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->create_coupons_deletion_job: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **new_coupon_deletion_job** | [**NewCouponDeletionJob**](NewCouponDeletionJob.md)| body | - -### Return type - -[**AsyncCouponDeletionJobResponse**](AsyncCouponDeletionJobResponse.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**202** | The deletion request has been accepted and will be processed asynchronously | - | - -[[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) - -# **create_coupons_for_multiple_recipients** -> CreateCoupons200Response create_coupons_for_multiple_recipients(application_id, campaign_id, new_coupons_for_multiple_recipients, silent=silent) - -Create coupons for multiple recipients - -Create coupons according to some pattern for up to 1000 recipients. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.create_coupons200_response import CreateCoupons200Response -from talon_one.models.new_coupons_for_multiple_recipients import NewCouponsForMultipleRecipients -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - new_coupons_for_multiple_recipients = talon_one.NewCouponsForMultipleRecipients() # NewCouponsForMultipleRecipients | 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') - - try: - # Create coupons for multiple recipients - api_response = api_instance.create_coupons_for_multiple_recipients(application_id, campaign_id, new_coupons_for_multiple_recipients, silent=silent) - print("The response of ManagementApi->create_coupons_for_multiple_recipients:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->create_coupons_for_multiple_recipients: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **new_coupons_for_multiple_recipients** | [**NewCouponsForMultipleRecipients**](NewCouponsForMultipleRecipients.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'] - -### Return type - -[**CreateCoupons200Response**](CreateCoupons200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | -**204** | No Content | - | - -[[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) - -# **create_invite_email** -> NewInviteEmail create_invite_email(new_invite_email) - -Resend invitation email - -Resend an email invitation to an existing user. - -**Note:** The invitation token is valid for 24 hours after the email has been sent. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.new_invite_email import NewInviteEmail -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - new_invite_email = talon_one.NewInviteEmail() # NewInviteEmail | body - - try: - # Resend invitation email - api_response = api_instance.create_invite_email(new_invite_email) - print("The response of ManagementApi->create_invite_email:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->create_invite_email: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **new_invite_email** | [**NewInviteEmail**](NewInviteEmail.md)| body | - -### Return type - -[**NewInviteEmail**](NewInviteEmail.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**201** | Created | - | - -[[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) - -# **create_invite_v2** -> User create_invite_v2(new_invitation) - -Invite user - -Create a new user in the account and send an invitation to their email address. - -**Note**: The invitation token is valid for 24 hours after the email has been sent. You can resend an invitation to a user with the [Resend invitation email](https://docs.talon.one/management-api#tag/Accounts-and-users/operation/createInviteEmail) endpoint. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.new_invitation import NewInvitation -from talon_one.models.user import User -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - new_invitation = talon_one.NewInvitation() # NewInvitation | body - - try: - # Invite user - api_response = api_instance.create_invite_v2(new_invitation) - print("The response of ManagementApi->create_invite_v2:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->create_invite_v2: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **new_invitation** | [**NewInvitation**](NewInvitation.md)| body | - -### Return type - -[**User**](User.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**201** | Created | - | - -[[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) - -# **create_password_recovery_email** -> NewPasswordEmail create_password_recovery_email(new_password_email) - -Request a password reset - -Send an email with a password recovery link to the email address of an existing account. - -**Note:** The password recovery link expires 30 minutes after this endpoint is triggered. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.new_password_email import NewPasswordEmail -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - new_password_email = talon_one.NewPasswordEmail() # NewPasswordEmail | body - - try: - # Request a password reset - api_response = api_instance.create_password_recovery_email(new_password_email) - print("The response of ManagementApi->create_password_recovery_email:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->create_password_recovery_email: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **new_password_email** | [**NewPasswordEmail**](NewPasswordEmail.md)| body | - -### Return type - -[**NewPasswordEmail**](NewPasswordEmail.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**204** | Created | - | - -[[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) - -# **create_session** -> Session create_session(login_params) - -Create session - -Create a session to use the Management API endpoints. -Use the value of the `token` property provided in the response as bearer token in other API calls. - -A token is valid for 3 months. In accordance with best pratices, use your generated token -for all your API requests. Do **not** regenerate a token for each request. - -This endpoint has a rate limit of 3 to 6 requests per second per account, depending on your setup. - -
-

Granular API key

- Instead of using a session, you can also use the Management API key feature - in the Campaign Manager to decide which endpoints can be used with a given key. -
- - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.login_params import LoginParams -from talon_one.models.session import Session -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - login_params = talon_one.LoginParams() # LoginParams | body - - try: - # Create session - api_response = api_instance.create_session(login_params) - print("The response of ManagementApi->create_session:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->create_session: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **login_params** | [**LoginParams**](LoginParams.md)| body | - -### Return type - -[**Session**](Session.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**201** | Created | - | - -[[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) - -# **create_store** -> Store create_store(application_id, new_store) - -Create store - -Create a new store in a specific Application. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.new_store import NewStore -from talon_one.models.store import Store -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - new_store = talon_one.NewStore() # NewStore | body - - try: - # Create store - api_response = api_instance.create_store(application_id, new_store) - print("The response of ManagementApi->create_store:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->create_store: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **new_store** | [**NewStore**](NewStore.md)| body | - -### Return type - -[**Store**](Store.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**201** | Created | - | -**400** | Bad request | - | -**409** | Conflict. A store with this integration ID already exists for this application. | - | - -[[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) - -# **deactivate_user_by_email** -> deactivate_user_by_email(deactivate_user_request) - -Disable user by email address - -[Disable a specific user](https://docs.talon.one/docs/product/account/account-settings/managing-users#disabling-a-user) by their email address. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.deactivate_user_request import DeactivateUserRequest -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - deactivate_user_request = talon_one.DeactivateUserRequest() # DeactivateUserRequest | body - - try: - # Disable user by email address - api_instance.deactivate_user_by_email(deactivate_user_request) - except Exception as e: - print("Exception when calling ManagementApi->deactivate_user_by_email: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **deactivate_user_request** | [**DeactivateUserRequest**](DeactivateUserRequest.md)| body | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | No Content | - | - -[[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) - -# **deduct_loyalty_card_points** -> deduct_loyalty_card_points(loyalty_program_id, loyalty_card_id, deduct_loyalty_points) - -Deduct points from card - -Deduct points from the given loyalty card in the specified card-based loyalty program. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.deduct_loyalty_points import DeductLoyaltyPoints -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. - loyalty_card_id = 'loyalty_card_id_example' # str | Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. - deduct_loyalty_points = talon_one.DeductLoyaltyPoints() # DeductLoyaltyPoints | body - - try: - # Deduct points from card - api_instance.deduct_loyalty_card_points(loyalty_program_id, loyalty_card_id, deduct_loyalty_points) - except Exception as e: - print("Exception when calling ManagementApi->deduct_loyalty_card_points: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **int**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | - **loyalty_card_id** | **str**| Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. | - **deduct_loyalty_points** | [**DeductLoyaltyPoints**](DeductLoyaltyPoints.md)| body | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**204** | No Content | - | -**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) - -# **delete_account_collection** -> delete_account_collection(collection_id) - -Delete account-level collection - -Delete a given account-level collection. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - collection_id = 56 # int | The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. - - try: - # Delete account-level collection - api_instance.delete_account_collection(collection_id) - except Exception as e: - print("Exception when calling ManagementApi->delete_account_collection: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **collection_id** | **int**| The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**204** | No Content | - | -**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) - -# **delete_achievement** -> delete_achievement(application_id, campaign_id, achievement_id) - -Delete achievement - -Delete the specified achievement. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - achievement_id = 56 # int | The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. - - try: - # Delete achievement - api_instance.delete_achievement(application_id, campaign_id, achievement_id) - except Exception as e: - print("Exception when calling ManagementApi->delete_achievement: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **achievement_id** | **int**| The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**204** | No Content | - | -**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) - -# **delete_campaign** -> delete_campaign(application_id, campaign_id) - -Delete campaign - -Delete the given campaign. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - - try: - # Delete campaign - api_instance.delete_campaign(application_id, campaign_id) - except Exception as e: - print("Exception when calling ManagementApi->delete_campaign: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | No Content | - | - -[[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) - -# **delete_campaign_store_budgets** -> delete_campaign_store_budgets(application_id, campaign_id, action=action, period=period) - -Delete campaign store budgets - -Delete the store budgets for a given campaign. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - action = 'action_example' # str | The action that this budget is limiting. (optional) - period = 'period_example' # str | The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. (optional) - - try: - # Delete campaign store budgets - api_instance.delete_campaign_store_budgets(application_id, campaign_id, action=action, period=period) - except Exception as e: - print("Exception when calling ManagementApi->delete_campaign_store_budgets: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **action** | **str**| The action that this budget is limiting. | [optional] - **period** | **str**| The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**204** | Deleted | - | -**400** | Bad request | - | - -[[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) - -# **delete_collection** -> delete_collection(application_id, campaign_id, collection_id) - -Delete campaign-level collection - -Delete a given campaign-level collection. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - collection_id = 56 # int | The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. - - try: - # Delete campaign-level collection - api_instance.delete_collection(application_id, campaign_id, collection_id) - except Exception as e: - print("Exception when calling ManagementApi->delete_collection: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **collection_id** | **int**| The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**204** | No Content | - | -**401** | Unauthorized | - | - -[[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) - -# **delete_coupon** -> delete_coupon(application_id, campaign_id, coupon_id) - -Delete coupon - -Delete the specified coupon. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - coupon_id = 'coupon_id_example' # str | The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. - - try: - # Delete coupon - api_instance.delete_coupon(application_id, campaign_id, coupon_id) - except Exception as e: - print("Exception when calling ManagementApi->delete_coupon: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **coupon_id** | **str**| The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | No Content | - | - -[[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) - -# **delete_coupons** -> delete_coupons(application_id, campaign_id, value=value, created_before=created_before, created_after=created_after, starts_after=starts_after, starts_before=starts_before, expires_after=expires_after, expires_before=expires_before, valid=valid, batch_id=batch_id, usable=usable, referral_id=referral_id, recipient_integration_id=recipient_integration_id, exact_match=exact_match) - -Delete coupons - -Deletes all the coupons matching the specified criteria. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - value = 'value_example' # str | Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - created_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - created_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - starts_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - starts_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - expires_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - expires_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - valid = 'valid_example' # str | - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. (optional) - batch_id = 'batch_id_example' # str | Filter results by batches of coupons (optional) - usable = 'usable_example' # str | - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. (optional) - referral_id = 56 # int | Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - recipient_integration_id = 'recipient_integration_id_example' # str | Filter results by match with a profile ID specified in the coupon's `RecipientIntegrationId` field. (optional) - exact_match = False # bool | Filter results to an exact case-insensitive matching against the coupon code (optional) (default to False) - - try: - # Delete coupons - api_instance.delete_coupons(application_id, campaign_id, value=value, created_before=created_before, created_after=created_after, starts_after=starts_after, starts_before=starts_before, expires_after=expires_after, expires_before=expires_before, valid=valid, batch_id=batch_id, usable=usable, referral_id=referral_id, recipient_integration_id=recipient_integration_id, exact_match=exact_match) - except Exception as e: - print("Exception when calling ManagementApi->delete_coupons: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **value** | **str**| Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. | [optional] - **created_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **created_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **starts_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **starts_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **expires_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **expires_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **valid** | **str**| - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. | [optional] - **batch_id** | **str**| Filter results by batches of coupons | [optional] - **usable** | **str**| - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. | [optional] - **referral_id** | **int**| Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. | [optional] - **recipient_integration_id** | **str**| Filter results by match with a profile ID specified in the coupon's `RecipientIntegrationId` field. | [optional] - **exact_match** | **bool**| Filter results to an exact case-insensitive matching against the coupon code | [optional] [default to False] - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | No Content | - | - -[[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) - -# **delete_loyalty_card** -> delete_loyalty_card(loyalty_program_id, loyalty_card_id) - -Delete loyalty card - -Delete the given loyalty card. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. - loyalty_card_id = 'loyalty_card_id_example' # str | Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. - - try: - # Delete loyalty card - api_instance.delete_loyalty_card(loyalty_program_id, loyalty_card_id) - except Exception as e: - print("Exception when calling ManagementApi->delete_loyalty_card: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **int**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | - **loyalty_card_id** | **str**| Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**204** | No Content | - | -**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) - -# **delete_referral** -> delete_referral(application_id, campaign_id, referral_id) - -Delete referral - -Delete the specified referral. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - referral_id = 'referral_id_example' # str | The ID of the referral code. - - try: - # Delete referral - api_instance.delete_referral(application_id, campaign_id, referral_id) - except Exception as e: - print("Exception when calling ManagementApi->delete_referral: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **referral_id** | **str**| The ID of the referral code. | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | No Content | - | - -[[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) - -# **delete_store** -> delete_store(application_id, store_id) - -Delete store - -Delete the specified store. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - store_id = 'store_id_example' # str | The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. - - try: - # Delete store - api_instance.delete_store(application_id, store_id) - except Exception as e: - print("Exception when calling ManagementApi->delete_store: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **store_id** | **str**| The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**204** | No Content | - | -**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) - -# **delete_user** -> delete_user(user_id) - -Delete user - -Delete a specific user. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - user_id = 56 # int | The ID of the user. - - try: - # Delete user - api_instance.delete_user(user_id) - except Exception as e: - print("Exception when calling ManagementApi->delete_user: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user_id** | **int**| The ID of the user. | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | No Content | - | - -[[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) - -# **delete_user_by_email** -> delete_user_by_email(delete_user_request) - -Delete user by email address - -[Delete a specific user](https://docs.talon.one/docs/product/account/account-settings/managing-users#deleting-a-user) by their email address. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.delete_user_request import DeleteUserRequest -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - delete_user_request = talon_one.DeleteUserRequest() # DeleteUserRequest | body - - try: - # Delete user by email address - api_instance.delete_user_by_email(delete_user_request) - except Exception as e: - print("Exception when calling ManagementApi->delete_user_by_email: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **delete_user_request** | [**DeleteUserRequest**](DeleteUserRequest.md)| body | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | No Content | - | - -[[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) - -# **destroy_session** -> destroy_session() - -Destroy session - -Destroys the session. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - - try: - # Destroy session - api_instance.destroy_session() - except Exception as e: - print("Exception when calling ManagementApi->destroy_session: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | No Content | - | - -[[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) - -# **disconnect_campaign_stores** -> disconnect_campaign_stores(application_id, campaign_id) - -Disconnect stores - -Disconnect the stores linked to a specific campaign. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - - try: - # Disconnect stores - api_instance.disconnect_campaign_stores(application_id, campaign_id) - except Exception as e: - print("Exception when calling ManagementApi->disconnect_campaign_stores: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**204** | No Content | - | -**400** | Bad request | - | -**401** | Unauthorized - Invalid API key | - | -**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) - -# **export_account_collection_items** -> str export_account_collection_items(collection_id) - -Export account-level collection's items - -Download a CSV file containing items from a given account-level collection. - -**Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - collection_id = 56 # int | The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. - - try: - # Export account-level collection's items - api_response = api_instance.export_account_collection_items(collection_id) - print("The response of ManagementApi->export_account_collection_items:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_account_collection_items: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **collection_id** | **int**| The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. | - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**401** | Unauthorized - Invalid API key | - | -**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) - -# **export_achievements** -> str export_achievements(application_id, campaign_id, achievement_id) - -Export achievement customer data - -Download a CSV file containing a list of all the customers who have participated in and are currently participating in the given achievement. - -The CSV file contains the following columns: -- `profileIntegrationID`: The integration ID of the customer profile participating in the achievement. -- `title`: The display name of the achievement in the Campaign Manager. -- `target`: The required number of actions or the transactional milestone to complete the achievement. -- `progress`: The current progress of the customer in the achievement. -- `status`: The status of the achievement. Can be one of: ['inprogress', 'completed', 'expired']. -- `startDate`: The date on which the customer profile started the achievement in RFC3339. -- `endDate`: The date on which the achievement ends and resets for the customer profile in RFC3339. -- `completionDate`: The date on which the customer profile completed the achievement in RFC3339. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - achievement_id = 56 # int | The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. - - try: - # Export achievement customer data - api_response = api_instance.export_achievements(application_id, campaign_id, achievement_id) - print("The response of ManagementApi->export_achievements:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_achievements: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **achievement_id** | **int**| The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. | - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### 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) - -# **export_audiences_memberships** -> str export_audiences_memberships(audience_id) - -Export audience members - -Download a CSV file containing the integration IDs of the members of an audience. - -**Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - -The file contains the following column: -- `profileintegrationid`: The integration ID of the customer profile. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - audience_id = 56 # int | The ID of the audience. - - try: - # Export audience members - api_response = api_instance.export_audiences_memberships(audience_id) - print("The response of ManagementApi->export_audiences_memberships:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_audiences_memberships: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **audience_id** | **int**| The ID of the audience. | - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | -**401** | Unauthorized - Invalid API key | - | -**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) - -# **export_campaign_store_budgets** -> str export_campaign_store_budgets(application_id, campaign_id, action=action, period=period) - -Export campaign store budgets - -Download a CSV file containing the store budgets for a given campaign. - -**Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - -The CSV file contains the following columns: - -- `store_integration_id`: The identifier of the store. -- `limit`: The budget limit for the store. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - action = 'action_example' # str | The action that this budget is limiting. (optional) - period = 'period_example' # str | The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. (optional) - - try: - # Export campaign store budgets - api_response = api_instance.export_campaign_store_budgets(application_id, campaign_id, action=action, period=period) - print("The response of ManagementApi->export_campaign_store_budgets:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_campaign_store_budgets: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **action** | **str**| The action that this budget is limiting. | [optional] - **period** | **str**| The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. | [optional] - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | -**401** | Unauthorized - Invalid API key | - | -**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) - -# **export_campaign_stores** -> str export_campaign_stores(application_id, campaign_id) - -Export stores - -Download a CSV file containing the stores linked to a specific campaign. - -**Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - -The CSV file contains the following column: - -- `store_integration_id`: The identifier of the store. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - - try: - # Export stores - api_response = api_instance.export_campaign_stores(application_id, campaign_id) - print("The response of ManagementApi->export_campaign_stores:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_campaign_stores: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | -**401** | Unauthorized - Invalid API key | - | -**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) - -# **export_collection_items** -> str export_collection_items(application_id, campaign_id, collection_id) - -Export campaign-level collection's items - -Download a CSV file containing items from a given campaign-level collection. - -**Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - collection_id = 56 # int | The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. - - try: - # Export campaign-level collection's items - api_response = api_instance.export_collection_items(application_id, campaign_id, collection_id) - print("The response of ManagementApi->export_collection_items:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_collection_items: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **collection_id** | **int**| The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. | - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**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) - -# **export_coupons** -> str export_coupons(application_id, campaign_id=campaign_id, sort=sort, value=value, created_before=created_before, created_after=created_after, valid=valid, usable=usable, referral_id=referral_id, recipient_integration_id=recipient_integration_id, batch_id=batch_id, exact_match=exact_match, date_format=date_format, campaign_state=campaign_state, values_only=values_only) - -Export coupons - -Download a CSV file containing the coupons that match the given properties. - -**Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - -The CSV file can contain the following columns: - -- `accountid`: The ID of your deployment. -- `applicationid`: The ID of the Application this coupon is related to. -- `attributes`: A json object describing _custom_ referral attribute names and their values. -- `batchid`: The ID of the batch this coupon is part of. -- `campaignid`: The ID of the campaign this coupon is related to. -- `counter`: The number of times this coupon has been redeemed. -- `created`: The creation date in RFC3339 of the coupon code. -- `deleted`: Whether the coupon code is deleted. -- `deleted_changelogid`: The ID of the delete event in the logs. -- `discount_counter`: The amount of discount given by this coupon. -- `discount_limitval`: The maximum discount amount that can be given be this coupon. -- `expirydate`: The end date in RFC3339 of the code redemption period. -- `id`: The internal ID of the coupon code. -- `importid`: The ID of the import job that created this coupon. -- `is_reservation_mandatory`: Whether this coupon requires a reservation to be redeemed. -- `limits`: The limits set on this coupon. -- `limitval`: The maximum number of redemptions of this code. -- `recipientintegrationid`: The integration ID of the recipient of the coupon. - Only the customer with this integration ID can redeem this code. Available only for personal codes. -- `referralid`: The ID of the referral code that triggered the creation of this coupon (create coupon effect). -- `reservation`: Whether the coupon can be reserved for multiple customers. -- `reservation_counter`: How many times this coupon has been reserved. -- `reservation_limitval`: The maximum of number of reservations this coupon can have. -- `startdate`: The start date in RFC3339 of the code redemption period. -- `value`: The coupon code. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 3.4 # float | Filter results by campaign ID. (optional) - 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) - value = 'value_example' # str | Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - created_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - created_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - valid = 'valid_example' # str | Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) - usable = 'usable_example' # str | Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) - referral_id = 56 # int | Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - recipient_integration_id = 'recipient_integration_id_example' # str | Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field. (optional) - batch_id = 'batch_id_example' # str | Filter results by batches of coupons (optional) - exact_match = False # bool | Filter results to an exact case-insensitive matching against the coupon code. (optional) (default to False) - date_format = 'date_format_example' # str | Determines the format of dates in the export document. (optional) - campaign_state = 'campaign_state_example' # str | Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) - values_only = False # bool | Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional) (default to False) - - try: - # Export coupons - api_response = api_instance.export_coupons(application_id, campaign_id=campaign_id, sort=sort, value=value, created_before=created_before, created_after=created_after, valid=valid, usable=usable, referral_id=referral_id, recipient_integration_id=recipient_integration_id, batch_id=batch_id, exact_match=exact_match, date_format=date_format, campaign_state=campaign_state, values_only=values_only) - print("The response of ManagementApi->export_coupons:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_coupons: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **float**| Filter results by campaign ID. | [optional] - **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] - **value** | **str**| Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. | [optional] - **created_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **created_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **valid** | **str**| Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. | [optional] - **usable** | **str**| Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. | [optional] - **referral_id** | **int**| Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. | [optional] - **recipient_integration_id** | **str**| Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field. | [optional] - **batch_id** | **str**| Filter results by batches of coupons | [optional] - **exact_match** | **bool**| Filter results to an exact case-insensitive matching against the coupon code. | [optional] [default to False] - **date_format** | **str**| Determines the format of dates in the export document. | [optional] - **campaign_state** | **str**| Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. | [optional] - **values_only** | **bool**| Filter results to only return the coupon codes (`value` column) without the associated coupon data. | [optional] [default to False] - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **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) - -Export customer sessions - -Download a CSV file containing the customer sessions that match the request. - -**Important:** Archived sessions cannot be exported. See the [retention policy](https://docs.talon.one/docs/dev/server-infrastructure-and-data-retention). - -**Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - -- `id`: The internal ID of the session. -- `firstsession`: Whether this is a first session. -- `integrationid`: The integration ID of the session. -- `applicationid`: The ID of the Application. -- `profileid`: The internal ID of the customer profile. -- `profileintegrationid`: The integration ID of the customer profile. -- `created`: The timestamp when the session was created. -- `state`: The [state](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states) of the session. -- `cartitems`: The cart items in the session. -- `discounts`: The discounts in the session. -- `total`: The total value of cart items and additional costs in the session, before any discounts are applied. -- `attributes`: The attributes set in the session. -- `closedat`: Timestamp when the session was closed. -- `cancelledat`: Timestamp when the session was cancelled. -- `referral`: The referral code in the session. -- `identifiers`: The identifiers in the session. -- `additional_costs`: The [additional costs](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs) in the session. -- `updated`: Timestamp of the last session update. -- `store_integration_id`: The integration ID of the store. -- `coupons`: Coupon codes in the session. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - 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) - 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) - print("The response of ManagementApi->export_customer_sessions:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_customer_sessions: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **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] - **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] - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **export_customers_tiers** -> str export_customers_tiers(loyalty_program_id, subledger_ids=subledger_ids, tier_names=tier_names) - -Export customers' tier data - -Download a CSV file containing the tier information for customers of the specified loyalty program. - -The generated file contains the following columns: - -- `programid`: The identifier of the loyalty program. It is displayed in your Talon.One deployment URL. -- `subledgerid`: The ID of the subledger associated with the loyalty program. This column is empty if the loyalty program has no subledger. In this case, refer to the export file name to get the ID of the loyalty program. -- `customerprofileid`: The ID used to integrate customer profiles with the loyalty program. -- `tiername`: The name of the tier. -- `startdate`: The tier start date in RFC3339. -- `expirydate`: The tier expiry date in RFC3339. - -You can filter the results by providing the following optional input parameters: - -- `subledgerIds` (optional): Filter results by an array of subledger IDs. If no value is provided, all subledger data for the specified loyalty program will be exported. -- `tierNames` (optional): Filter results by an array of tier names. If no value is provided, all tier data for the specified loyalty program will be exported. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 = 'loyalty_program_id_example' # str | The identifier for the loyalty program. - subledger_ids = ['subledger_ids_example'] # List[str] | An array of subledgers IDs to filter the export by. (optional) - tier_names = ['tier_names_example'] # List[str] | An array of tier names to filter the export by. (optional) - - try: - # Export customers' tier data - api_response = api_instance.export_customers_tiers(loyalty_program_id, subledger_ids=subledger_ids, tier_names=tier_names) - print("The response of ManagementApi->export_customers_tiers:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_customers_tiers: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **str**| The identifier for the loyalty program. | - **subledger_ids** | [**List[str]**](str.md)| An array of subledgers IDs to filter the export by. | [optional] - **tier_names** | [**List[str]**](str.md)| An array of tier names to filter the export by. | [optional] - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **export_effects** -> str export_effects(application_id, campaign_id=campaign_id, created_before=created_before, created_after=created_after, date_format=date_format) - -Export triggered effects - -Download a CSV file containing the triggered effects that match the given attributes. - -**Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - -The generated file can contain the following columns: - -- `applicationid`: The ID of the Application. -- `campaignid`: The ID of the campaign. -- `couponid`: The ID of the coupon, when applicable to the effect. -- `created`: The timestamp of the effect. -- `event_type`: The name of the event. See the [docs](https://docs.talon.one/docs/dev/concepts/entities/events). -- `eventid`: The internal ID of the effect. -- `name`: The effect name. See the [docs](https://docs.talon.one/docs/dev/integration-api/api-effects). -- `profileintegrationid`: The ID of the customer profile, when applicable. -- `props`: The [properties](https://docs.talon.one/docs/dev/integration-api/api-effects) of the effect. -- `ruleindex`: The index of the rule. -- `rulesetid`: The ID of the rule set. -- `sessionid`: The internal ID of the session that triggered the effect. -- `profileid`: The internal ID of the customer profile. -- `sessionintegrationid`: The integration ID of the session. -- `total_revenue`: The total revenue. -- `store_integration_id`: The integration ID of the store. You choose this ID when you create a store. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 3.4 # float | Filter results by campaign ID. (optional) - created_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - created_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - date_format = 'date_format_example' # str | Determines the format of dates in the export document. (optional) - - try: - # Export triggered effects - api_response = api_instance.export_effects(application_id, campaign_id=campaign_id, created_before=created_before, created_after=created_after, date_format=date_format) - print("The response of ManagementApi->export_effects:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_effects: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **float**| Filter results by campaign ID. | [optional] - **created_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **created_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **date_format** | **str**| Determines the format of dates in the export document. | [optional] - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **export_loyalty_balance** -> str export_loyalty_balance(loyalty_program_id, end_date=end_date) - -Export customer loyalty balance to CSV - -⚠️ Deprecation notice: Support for requests to this endpoint will end soon. -To export customer loyalty balances to CSV, use the [Export customer loyalty balances to CSV](/management-api#tag/Loyalty/operation/exportLoyaltyBalances) endpoint. - -Download a CSV file containing the balance of each customer in the loyalty program. - -**Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 = 'loyalty_program_id_example' # str | The identifier for the loyalty program. - end_date = '2013-10-20T19:20:30+01:00' # datetime | Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - - try: - # Export customer loyalty balance to CSV - api_response = api_instance.export_loyalty_balance(loyalty_program_id, end_date=end_date) - print("The response of ManagementApi->export_loyalty_balance:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_loyalty_balance: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **str**| The identifier for the loyalty program. | - **end_date** | **datetime**| Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | -**401** | Unauthorized | - | - -[[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_loyalty_balances** -> str export_loyalty_balances(loyalty_program_id, end_date=end_date) - -Export customer loyalty balances - -Download a CSV file containing the balance of each customer in the loyalty program. - -**Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - -The generated file can contain the following columns: - -- `loyaltyProgramID`: The ID of the loyalty program. -- `loyaltySubledger`: The name of the subdleger, when applicatble. -- `profileIntegrationID`: The integration ID of the customer profile. -- `currentBalance`: The current point balance. -- `pendingBalance`: The number of pending points. -- `expiredBalance`: The number of expired points. -- `spentBalance`: The number of spent points. -- `currentTier`: The tier that the customer is in at the time of the export. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 = 'loyalty_program_id_example' # str | The identifier for the loyalty program. - end_date = '2013-10-20T19:20:30+01:00' # datetime | Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - This parameter does not affect the `currentTier` field in the CSV file, which shows the customer's tier at the time of export. (optional) - - try: - # Export customer loyalty balances - api_response = api_instance.export_loyalty_balances(loyalty_program_id, end_date=end_date) - print("The response of ManagementApi->export_loyalty_balances:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_loyalty_balances: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **str**| The identifier for the loyalty program. | - **end_date** | **datetime**| Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - This parameter does not affect the `currentTier` field in the CSV file, which shows the customer's tier at the time of export. | [optional] - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | -**401** | Unauthorized | - | - -[[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_loyalty_card_balances** -> str export_loyalty_card_balances(loyalty_program_id, end_date=end_date) - -Export all card transaction logs - -Download a CSV file containing the balances of all cards in the loyalty program. - -**Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - -The CSV file contains the following columns: -- `loyaltyProgramID`: The ID of the loyalty program. -- `loyaltySubledger`: The name of the subdleger, when applicatble. -- `cardIdentifier`: The alphanumeric identifier of the loyalty card. -- `cardState`:The state of the loyalty card. It can be `active` or `inactive`. -- `currentBalance`: The current point balance. -- `pendingBalance`: The number of pending points. -- `expiredBalance`: The number of expired points. -- `spentBalance`: The number of spent points. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 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. - end_date = '2013-10-20T19:20:30+01:00' # datetime | Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - - try: - # Export all card transaction logs - api_response = api_instance.export_loyalty_card_balances(loyalty_program_id, end_date=end_date) - print("The response of ManagementApi->export_loyalty_card_balances:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_loyalty_card_balances: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **int**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | - **end_date** | **datetime**| Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | -**401** | Unauthorized | - | - -[[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_loyalty_card_ledger** -> str export_loyalty_card_ledger(loyalty_program_id, loyalty_card_id, range_start, range_end, date_format=date_format) - -Export card's ledger log - -Download a CSV file containing a loyalty card ledger log of the loyalty program. - -**Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. - loyalty_card_id = 'loyalty_card_id_example' # str | Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. - range_start = '2013-10-20T19:20:30+01:00' # datetime | Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - range_end = '2013-10-20T19:20:30+01:00' # datetime | Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - date_format = 'date_format_example' # str | Determines the format of dates in the export document. (optional) - - try: - # Export card's ledger log - api_response = api_instance.export_loyalty_card_ledger(loyalty_program_id, loyalty_card_id, range_start, range_end, date_format=date_format) - print("The response of ManagementApi->export_loyalty_card_ledger:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_loyalty_card_ledger: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **int**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | - **loyalty_card_id** | **str**| Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. | - **range_start** | **datetime**| Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | - **range_end** | **datetime**| Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | - **date_format** | **str**| Determines the format of dates in the export document. | [optional] - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**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) - -# **export_loyalty_cards** -> str export_loyalty_cards(loyalty_program_id, batch_id=batch_id, created_before=created_before, created_after=created_after, date_format=date_format) - -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.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-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. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 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. - batch_id = 'batch_id_example' # str | Filter results by loyalty card batch ID. (optional) - created_before = '2013-10-20T19:20:30+01:00' # datetime | Only return loyalty cards created before this timestamp. **Note:** - This must be an RFC3339 timestamp string. (optional) - created_after = '2013-10-20T19:20:30+01:00' # datetime | Only return loyalty cards created after this timestamp. **Note:** - This must be an RFC3339 timestamp string. (optional) - date_format = 'date_format_example' # str | Determines the format of dates in the export document. (optional) - - try: - # Export loyalty cards - api_response = api_instance.export_loyalty_cards(loyalty_program_id, batch_id=batch_id, created_before=created_before, created_after=created_after, date_format=date_format) - print("The response of ManagementApi->export_loyalty_cards:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_loyalty_cards: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **int**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | - **batch_id** | **str**| Filter results by loyalty card batch ID. | [optional] - **created_before** | **datetime**| Only return loyalty cards created before this timestamp. **Note:** - This must be an RFC3339 timestamp string. | [optional] - **created_after** | **datetime**| Only return loyalty cards created after this timestamp. **Note:** - This must be an RFC3339 timestamp string. | [optional] - **date_format** | **str**| Determines the format of dates in the export document. | [optional] - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | -**401** | Unauthorized | - | - -[[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_loyalty_ledger** -> str export_loyalty_ledger(range_start, range_end, loyalty_program_id, integration_id, date_format=date_format) - -Export customer's transaction logs - -Download a CSV file containing a customer's transaction logs in the loyalty program. - -**Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - -The generated file can contain the following columns: - -- `customerprofileid`: The ID of the profile. -- `customersessionid`: The ID of the customer session. -- `rulesetid`: The ID of the rule set. -- `rulename`: The name of the rule. -- `programid`: The ID of the loyalty program. -- `type`: The transaction type, such as `addition` or `subtraction`. -- `name`: The reason for the transaction. -- `subledgerid`: The ID of the subledger, when applicable. -- `startdate`: The start date of the program. -- `expirydate`: The expiration date of the program. -- `id`: The ID of the transaction. -- `created`: The timestamp of the creation of the loyalty program. -- `amount`: The number of points in that transaction. -- `archived`: Whether the session related to the transaction is archived. -- `campaignid`: The ID of the campaign. -- `flags`: The flags of the transaction, when applicable. The `createsNegativeBalance` flag indicates whether the transaction results in a negative balance. -- `transactionUUID`: Unique identifier of the transaction in the UUID format. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - range_start = '2013-10-20T19:20:30+01:00' # datetime | Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - range_end = '2013-10-20T19:20:30+01:00' # datetime | Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - loyalty_program_id = 'loyalty_program_id_example' # str | The identifier for the loyalty program. - 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. - date_format = 'date_format_example' # str | Determines the format of dates in the export document. (optional) - - try: - # Export customer's transaction logs - api_response = api_instance.export_loyalty_ledger(range_start, range_end, loyalty_program_id, integration_id, date_format=date_format) - print("The response of ManagementApi->export_loyalty_ledger:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_loyalty_ledger: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **range_start** | **datetime**| Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | - **range_end** | **datetime**| Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | - **loyalty_program_id** | **str**| The identifier for the loyalty program. | - **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. | - **date_format** | **str**| Determines the format of dates in the export document. | [optional] - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **export_pool_giveaways** -> str export_pool_giveaways(pool_id, created_before=created_before, created_after=created_after) - -Export giveaway codes of a giveaway pool - -Download a CSV file containing the giveaway codes of a specific giveaway pool. - -**Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - -The CSV file contains the following columns: - -- `id`: The internal ID of the giveaway. -- `poolid`: The internal ID of the giveaway pool. -- `code`: The giveaway code. -- `startdate`: The validity start date in RFC3339 of the giveaway (can be empty). -- `enddate`: The validity end date in RFC3339 of the giveaway (can be empty). -- `attributes`: Any custom attributes associated with the giveaway code (can be empty). -- `used`: An indication of whether the giveaway is already awarded. -- `importid`: The ID of the import which created the giveaway. -- `created`: The creation time of the giveaway code. -- `profileintegrationid`: The third-party integration ID of the customer profile that was awarded the giveaway. Can be empty if the giveaway was not awarded. -- `profileid`: The internal ID of the customer profile that was awarded the giveaway. Can be empty if the giveaway was not awarded or an internal ID does not exist. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - pool_id = 56 # int | The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. - created_before = '2013-10-20T19:20:30+01:00' # datetime | Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. (optional) - created_after = '2013-10-20T19:20:30+01:00' # datetime | Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. (optional) - - try: - # Export giveaway codes of a giveaway pool - api_response = api_instance.export_pool_giveaways(pool_id, created_before=created_before, created_after=created_after) - print("The response of ManagementApi->export_pool_giveaways:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_pool_giveaways: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pool_id** | **int**| The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. | - **created_before** | **datetime**| Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. | [optional] - **created_after** | **datetime**| Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. | [optional] - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | - -[[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_referrals** -> str export_referrals(application_id, campaign_id=campaign_id, created_before=created_before, created_after=created_after, valid=valid, usable=usable, batch_id=batch_id, date_format=date_format) - -Export referrals - -Download a CSV file containing the referrals that match the given parameters. - -**Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - -The CSV file contains the following columns: - -- `code`: The referral code. -- `advocateprofileintegrationid`: The profile ID of the advocate. -- `startdate`: The start date in RFC3339 of the code redemption period. -- `expirydate`: The end date in RFC3339 of the code redemption period. -- `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. -- `attributes`: A json object describing _custom_ referral attribute names and their values. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 3.4 # float | Filter results by campaign ID. (optional) - created_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - created_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - valid = 'valid_example' # str | - `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. (optional) - usable = 'usable_example' # str | - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. (optional) - batch_id = 'batch_id_example' # str | Filter results by batches of referrals (optional) - date_format = 'date_format_example' # str | Determines the format of dates in the export document. (optional) - - try: - # Export referrals - api_response = api_instance.export_referrals(application_id, campaign_id=campaign_id, created_before=created_before, created_after=created_after, valid=valid, usable=usable, batch_id=batch_id, date_format=date_format) - print("The response of ManagementApi->export_referrals:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->export_referrals: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **float**| Filter results by campaign ID. | [optional] - **created_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **created_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **valid** | **str**| - `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. | [optional] - **usable** | **str**| - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. | [optional] - **batch_id** | **str**| Filter results by batches of referrals | [optional] - **date_format** | **str**| Determines the format of dates in the export document. | [optional] - -### Return type - -**str** - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/csv - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **generate_coupon_rejections** -> GenerateCouponRejections200Response generate_coupon_rejections(session_integration_id, application_id=application_id, language=language, coupon_code=coupon_code) - -Summarize coupon redemption failures in session - -Create a summary of the reasons for coupon redemption failures in a given customer session. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.generate_coupon_rejections200_response import GenerateCouponRejections200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - session_integration_id = 'session_integration_id_example' # str | The integration ID of the session to summarize. - application_id = 3.4 # float | Filter results by Application ID. (optional) - language = 'language_example' # str | The [ISO-639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code of the language in which the summary will be generated. (optional) - coupon_code = 'coupon_code_example' # str | The coupon code for which to get the rejection reason. (optional) - - try: - # Summarize coupon redemption failures in session - api_response = api_instance.generate_coupon_rejections(session_integration_id, application_id=application_id, language=language, coupon_code=coupon_code) - print("The response of ManagementApi->generate_coupon_rejections:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->generate_coupon_rejections: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **session_integration_id** | **str**| The integration ID of the session to summarize. | - **application_id** | **float**| Filter results by Application ID. | [optional] - **language** | **str**| The [ISO-639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code of the language in which the summary will be generated. | [optional] - **coupon_code** | **str**| The coupon code for which to get the rejection reason. | [optional] - -### Return type - -[**GenerateCouponRejections200Response**](GenerateCouponRejections200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_access_logs_without_total_count** -> GetAccessLogsWithoutTotalCount200Response get_access_logs_without_total_count(application_id, range_start, range_end, path=path, method=method, status=status, page_size=page_size, skip=skip, sort=sort) - -Get access logs for Application - -Retrieve the list of API calls sent to the specified Application. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_access_logs_without_total_count200_response import GetAccessLogsWithoutTotalCount200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - range_start = '2013-10-20T19:20:30+01:00' # datetime | Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - range_end = '2013-10-20T19:20:30+01:00' # datetime | Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - path = 'path_example' # str | Only return results where the request path matches the given regular expression. (optional) - method = 'method_example' # str | Only return results where the request method matches the given regular expression. (optional) - status = 'status_example' # str | Filter results by HTTP status codes. (optional) - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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: - # Get access logs for Application - api_response = api_instance.get_access_logs_without_total_count(application_id, range_start, range_end, path=path, method=method, status=status, page_size=page_size, skip=skip, sort=sort) - print("The response of ManagementApi->get_access_logs_without_total_count:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_access_logs_without_total_count: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **range_start** | **datetime**| Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | - **range_end** | **datetime**| Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | - **path** | **str**| Only return results where the request path matches the given regular expression. | [optional] - **method** | **str**| Only return results where the request method matches the given regular expression. | [optional] - **status** | **str**| Filter results by HTTP status codes. | [optional] - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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 - -[**GetAccessLogsWithoutTotalCount200Response**](GetAccessLogsWithoutTotalCount200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_account** -> Account get_account(account_id) - -Get account details - -Return the details of your companies Talon.One account. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.account import Account -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - account_id = 56 # int | The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. - - try: - # Get account details - api_response = api_instance.get_account(account_id) - print("The response of ManagementApi->get_account:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_account: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **account_id** | **int**| The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. | - -### Return type - -[**Account**](Account.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_account_analytics** -> AccountAnalytics get_account_analytics(account_id) - -Get account analytics - -Return the analytics of your Talon.One account. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.account_analytics import AccountAnalytics -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - account_id = 56 # int | The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. - - try: - # Get account analytics - api_response = api_instance.get_account_analytics(account_id) - print("The response of ManagementApi->get_account_analytics:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_account_analytics: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **account_id** | **int**| The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. | - -### Return type - -[**AccountAnalytics**](AccountAnalytics.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_account_collection** -> Collection get_account_collection(collection_id) - -Get account-level collection - -Retrieve a given account-level collection. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.collection import Collection -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - collection_id = 56 # int | The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. - - try: - # Get account-level collection - api_response = api_instance.get_account_collection(collection_id) - print("The response of ManagementApi->get_account_collection:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_account_collection: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **collection_id** | **int**| The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. | - -### Return type - -[**Collection**](Collection.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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_achievement** -> Achievement get_achievement(application_id, campaign_id, achievement_id) - -Get achievement - -Get the details of a specific achievement. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.achievement import Achievement -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - achievement_id = 56 # int | The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. - - try: - # Get achievement - api_response = api_instance.get_achievement(application_id, campaign_id, achievement_id) - print("The response of ManagementApi->get_achievement:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_achievement: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **achievement_id** | **int**| The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. | - -### Return type - -[**Achievement**](Achievement.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | -**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) - -# **get_additional_cost** -> AccountAdditionalCost get_additional_cost(additional_cost_id) - -Get additional cost - -Returns the additional cost. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.account_additional_cost import AccountAdditionalCost -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - additional_cost_id = 56 # int | The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. - - try: - # Get additional cost - api_response = api_instance.get_additional_cost(additional_cost_id) - print("The response of ManagementApi->get_additional_cost:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_additional_cost: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **additional_cost_id** | **int**| The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. | - -### Return type - -[**AccountAdditionalCost**](AccountAdditionalCost.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_additional_costs** -> GetAdditionalCosts200Response get_additional_costs(page_size=page_size, skip=skip, sort=sort) - -List additional costs - -Returns all the defined additional costs for the account. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_additional_costs200_response import GetAdditionalCosts200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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: - # List additional costs - api_response = api_instance.get_additional_costs(page_size=page_size, skip=skip, sort=sort) - print("The response of ManagementApi->get_additional_costs:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_additional_costs: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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 - -[**GetAdditionalCosts200Response**](GetAdditionalCosts200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_application** -> Application get_application(application_id) - -Get Application - -Get the application specified by the ID. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.application import Application -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - - try: - # Get Application - api_response = api_instance.get_application(application_id) - print("The response of ManagementApi->get_application:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_application: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - -### Return type - -[**Application**](Application.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_application_api_health** -> ApplicationApiHealth get_application_api_health(application_id) - -Get Application health - -Display the health of the Application and show the last time the Application -was used. - -You can also find this information in the Campaign Manager. In your Application, click **Settings** > **Integration API Keys**. -See the [docs](https://docs.talon.one/docs/dev/tutorials/monitoring-integration-status). - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.application_api_health import ApplicationApiHealth -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - - try: - # Get Application health - api_response = api_instance.get_application_api_health(application_id) - print("The response of ManagementApi->get_application_api_health:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_application_api_health: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - -### Return type - -[**ApplicationApiHealth**](ApplicationApiHealth.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_application_customer** -> ApplicationCustomer get_application_customer(application_id, customer_id) - -Get application's customer - -Retrieve the customers of the specified application. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.application_customer import ApplicationCustomer -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - customer_id = 56 # int | The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. - - try: - # Get application's customer - api_response = api_instance.get_application_customer(application_id, customer_id) - print("The response of ManagementApi->get_application_customer:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_application_customer: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **customer_id** | **int**| The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. | - -### Return type - -[**ApplicationCustomer**](ApplicationCustomer.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_application_customer_friends** -> GetApplicationCustomerFriends200Response get_application_customer_friends(application_id, integration_id, page_size=page_size, skip=skip, sort=sort, with_total_result_size=with_total_result_size) - -List friends referred by customer profile - -List the friends referred by the specified customer profile in this Application. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_application_customer_friends200_response import GetApplicationCustomerFriends200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - integration_id = 'integration_id_example' # str | The Integration ID of the Advocate's Profile. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - with_total_result_size = True # bool | When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - - try: - # List friends referred by customer profile - api_response = api_instance.get_application_customer_friends(application_id, integration_id, page_size=page_size, skip=skip, sort=sort, with_total_result_size=with_total_result_size) - print("The response of ManagementApi->get_application_customer_friends:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_application_customer_friends: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **integration_id** | **str**| The Integration ID of the Advocate's Profile. | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **with_total_result_size** | **bool**| When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. | [optional] - -### Return type - -[**GetApplicationCustomerFriends200Response**](GetApplicationCustomerFriends200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_application_customers** -> GetApplicationCustomers200Response get_application_customers(application_id, integration_id=integration_id, page_size=page_size, skip=skip, with_total_result_size=with_total_result_size) - -List application's customers - -List all the customers of the specified application. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_application_customers200_response import GetApplicationCustomers200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - integration_id = 'integration_id_example' # str | Filter results performing an exact matching against the profile integration identifier. (optional) - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - with_total_result_size = True # bool | When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - - try: - # List application's customers - api_response = api_instance.get_application_customers(application_id, integration_id=integration_id, page_size=page_size, skip=skip, with_total_result_size=with_total_result_size) - print("The response of ManagementApi->get_application_customers:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_application_customers: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **integration_id** | **str**| Filter results performing an exact matching against the profile integration identifier. | [optional] - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **with_total_result_size** | **bool**| When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. | [optional] - -### Return type - -[**GetApplicationCustomers200Response**](GetApplicationCustomers200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_application_customers_by_attributes** -> GetApplicationCustomersByAttributes200Response get_application_customers_by_attributes(application_id, customer_profile_search_query, page_size=page_size, skip=skip, with_total_result_size=with_total_result_size) - -List application customers matching the given attributes - -Get a list of the application customers matching the provided criteria. - -The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.customer_profile_search_query import CustomerProfileSearchQuery -from talon_one.models.get_application_customers_by_attributes200_response import GetApplicationCustomersByAttributes200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - customer_profile_search_query = talon_one.CustomerProfileSearchQuery() # CustomerProfileSearchQuery | body - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - with_total_result_size = True # bool | When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - - try: - # List application customers matching the given attributes - api_response = api_instance.get_application_customers_by_attributes(application_id, customer_profile_search_query, page_size=page_size, skip=skip, with_total_result_size=with_total_result_size) - print("The response of ManagementApi->get_application_customers_by_attributes:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_application_customers_by_attributes: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **customer_profile_search_query** | [**CustomerProfileSearchQuery**](CustomerProfileSearchQuery.md)| body | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **with_total_result_size** | **bool**| When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. | [optional] - -### Return type - -[**GetApplicationCustomersByAttributes200Response**](GetApplicationCustomersByAttributes200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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_application_event_types** -> GetApplicationEventTypes200Response get_application_event_types(application_id, page_size=page_size, skip=skip, sort=sort) - -List Applications event types - -Get all of the distinct values of the Event `type` property for events recorded in the application. - -See also: [Track an event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_application_event_types200_response import GetApplicationEventTypes200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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: - # List Applications event types - api_response = api_instance.get_application_event_types(application_id, page_size=page_size, skip=skip, sort=sort) - print("The response of ManagementApi->get_application_event_types:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_application_event_types: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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 - -[**GetApplicationEventTypes200Response**](GetApplicationEventTypes200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_application_events_without_total_count** -> GetApplicationEventsWithoutTotalCount200Response get_application_events_without_total_count(application_id, page_size=page_size, skip=skip, sort=sort, type=type, created_before=created_before, created_after=created_after, session=session, profile=profile, customer_name=customer_name, customer_email=customer_email, coupon_code=coupon_code, referral_code=referral_code, rule_query=rule_query, campaign_query=campaign_query, effect_type=effect_type) - -List Applications events - -Lists all events recorded for an application. Instead of having the total number of results in the response, this endpoint only mentions whether there are more results. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_application_events_without_total_count200_response import GetApplicationEventsWithoutTotalCount200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - type = 'type_example' # str | Comma-separated list of types by which to filter events. Must be exact match(es). (optional) - created_before = '2013-10-20T19:20:30+01:00' # datetime | Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - created_after = '2013-10-20T19:20:30+01:00' # datetime | Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - session = 'session_example' # str | Session integration ID filter for events. Must be exact match. (optional) - profile = 'profile_example' # str | Profile integration ID filter for events. Must be exact match. (optional) - customer_name = 'customer_name_example' # str | Customer name filter for events. Will match substrings case-insensitively. (optional) - customer_email = 'customer_email_example' # str | Customer e-mail address filter for events. Will match substrings case-insensitively. (optional) - coupon_code = 'coupon_code_example' # str | Coupon code (optional) - referral_code = 'referral_code_example' # str | Referral code (optional) - rule_query = 'rule_query_example' # str | Rule name filter for events (optional) - campaign_query = 'campaign_query_example' # str | Campaign name filter for events (optional) - effect_type = 'effect_type_example' # str | The type of effect that was triggered. See [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects). (optional) - - try: - # List Applications events - api_response = api_instance.get_application_events_without_total_count(application_id, page_size=page_size, skip=skip, sort=sort, type=type, created_before=created_before, created_after=created_after, session=session, profile=profile, customer_name=customer_name, customer_email=customer_email, coupon_code=coupon_code, referral_code=referral_code, rule_query=rule_query, campaign_query=campaign_query, effect_type=effect_type) - print("The response of ManagementApi->get_application_events_without_total_count:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_application_events_without_total_count: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **type** | **str**| Comma-separated list of types by which to filter events. Must be exact match(es). | [optional] - **created_before** | **datetime**| Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **created_after** | **datetime**| Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **session** | **str**| Session integration ID filter for events. Must be exact match. | [optional] - **profile** | **str**| Profile integration ID filter for events. Must be exact match. | [optional] - **customer_name** | **str**| Customer name filter for events. Will match substrings case-insensitively. | [optional] - **customer_email** | **str**| Customer e-mail address filter for events. Will match substrings case-insensitively. | [optional] - **coupon_code** | **str**| Coupon code | [optional] - **referral_code** | **str**| Referral code | [optional] - **rule_query** | **str**| Rule name filter for events | [optional] - **campaign_query** | **str**| Campaign name filter for events | [optional] - **effect_type** | **str**| The type of effect that was triggered. See [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects). | [optional] - -### Return type - -[**GetApplicationEventsWithoutTotalCount200Response**](GetApplicationEventsWithoutTotalCount200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_application_session** -> ApplicationSession get_application_session(application_id, session_id) - -Get Application session - -Get the details of the given session. -You can list the sessions with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.application_session import ApplicationSession -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - session_id = 56 # int | The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. - - try: - # Get Application session - api_response = api_instance.get_application_session(application_id, session_id) - print("The response of ManagementApi->get_application_session:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_application_session: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **session_id** | **int**| The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. | - -### Return type - -[**ApplicationSession**](ApplicationSession.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_application_sessions** -> GetApplicationSessions200Response get_application_sessions(application_id, page_size=page_size, skip=skip, sort=sort, profile=profile, state=state, created_before=created_before, created_after=created_after, coupon=coupon, referral=referral, integration_id=integration_id, store_integration_id=store_integration_id) - -List Application sessions - -List all the sessions of the specified Application. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_application_sessions200_response import GetApplicationSessions200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - profile = 'profile_example' # str | Profile integration ID filter for sessions. Must be exact match. (optional) - state = 'state_example' # str | Filter by sessions with this state. Must be exact match. (optional) - created_before = '2013-10-20T19:20:30+01:00' # datetime | Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - created_after = '2013-10-20T19:20:30+01:00' # datetime | Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - coupon = 'coupon_example' # str | Filter by sessions with this coupon. Must be exact match. (optional) - referral = 'referral_example' # str | Filter by sessions with this referral. Must be exact match. (optional) - integration_id = 'integration_id_example' # str | Filter by sessions with this integration ID. Must be exact match. (optional) - store_integration_id = 'store_integration_id_example' # str | The integration ID of the store. You choose this ID when you create a store. (optional) - - try: - # List Application sessions - api_response = api_instance.get_application_sessions(application_id, page_size=page_size, skip=skip, sort=sort, profile=profile, state=state, created_before=created_before, created_after=created_after, coupon=coupon, referral=referral, integration_id=integration_id, store_integration_id=store_integration_id) - print("The response of ManagementApi->get_application_sessions:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_application_sessions: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **profile** | **str**| Profile integration ID filter for sessions. Must be exact match. | [optional] - **state** | **str**| Filter by sessions with this state. Must be exact match. | [optional] - **created_before** | **datetime**| Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **created_after** | **datetime**| Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **coupon** | **str**| Filter by sessions with this coupon. Must be exact match. | [optional] - **referral** | **str**| Filter by sessions with this referral. Must be exact match. | [optional] - **integration_id** | **str**| Filter by sessions with this integration ID. Must be exact match. | [optional] - **store_integration_id** | **str**| The integration ID of the store. You choose this ID when you create a store. | [optional] - -### Return type - -[**GetApplicationSessions200Response**](GetApplicationSessions200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_applications** -> GetApplications200Response get_applications(page_size=page_size, skip=skip, sort=sort) - -List Applications - -List all applications in the current account. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_applications200_response import GetApplications200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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: - # List Applications - api_response = api_instance.get_applications(page_size=page_size, skip=skip, sort=sort) - print("The response of ManagementApi->get_applications:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_applications: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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 - -[**GetApplications200Response**](GetApplications200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_attribute** -> Attribute get_attribute(attribute_id) - -Get custom attribute - -Retrieve the specified custom attribute. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.attribute import Attribute -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - attribute_id = 56 # int | The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. - - try: - # Get custom attribute - api_response = api_instance.get_attribute(attribute_id) - print("The response of ManagementApi->get_attribute:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_attribute: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **attribute_id** | **int**| The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. | - -### Return type - -[**Attribute**](Attribute.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_attributes** -> GetAttributes200Response get_attributes(page_size=page_size, skip=skip, sort=sort, entity=entity, application_ids=application_ids, type=type, kind=kind, search=search) - -List custom attributes - -Return all the custom attributes for the account. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_attributes200_response import GetAttributes200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - sort = 'sort_example' # str | The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. (optional) - entity = 'entity_example' # str | Returned attributes will be filtered by supplied entity. (optional) - application_ids = 'application_ids_example' # str | Returned attributes will be filtered by supplied application ids (optional) - type = 'type_example' # str | Returned attributes will be filtered by supplied type (optional) - kind = 'kind_example' # str | Returned attributes will be filtered by supplied kind (builtin or custom) (optional) - search = 'search_example' # str | Returned attributes will be filtered by searching case insensitive through Attribute name, description and type (optional) - - try: - # List custom attributes - api_response = api_instance.get_attributes(page_size=page_size, skip=skip, sort=sort, entity=entity, application_ids=application_ids, type=type, kind=kind, search=search) - print("The response of ManagementApi->get_attributes:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_attributes: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **sort** | **str**| The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. | [optional] - **entity** | **str**| Returned attributes will be filtered by supplied entity. | [optional] - **application_ids** | **str**| Returned attributes will be filtered by supplied application ids | [optional] - **type** | **str**| Returned attributes will be filtered by supplied type | [optional] - **kind** | **str**| Returned attributes will be filtered by supplied kind (builtin or custom) | [optional] - **search** | **str**| Returned attributes will be filtered by searching case insensitive through Attribute name, description and type | [optional] - -### Return type - -[**GetAttributes200Response**](GetAttributes200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_audience_memberships** -> GetAudienceMemberships200Response get_audience_memberships(audience_id, page_size=page_size, skip=skip, sort=sort, profile_query=profile_query) - -List audience members - -Get a paginated list of the customer profiles in a given audience. - -A maximum of 1000 customer profiles per page is allowed. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_audience_memberships200_response import GetAudienceMemberships200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - audience_id = 56 # int | The ID of the audience. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - profile_query = 'profile_query_example' # str | The filter to select a profile. (optional) - - try: - # List audience members - api_response = api_instance.get_audience_memberships(audience_id, page_size=page_size, skip=skip, sort=sort, profile_query=profile_query) - print("The response of ManagementApi->get_audience_memberships:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_audience_memberships: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **audience_id** | **int**| The ID of the audience. | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **profile_query** | **str**| The filter to select a profile. | [optional] - -### Return type - -[**GetAudienceMemberships200Response**](GetAudienceMemberships200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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_audiences** -> GetAudiences200Response get_audiences(page_size=page_size, skip=skip, sort=sort, with_total_result_size=with_total_result_size) - -List audiences - -Get all audiences created in the account. To create an audience, use [Create audience](https://docs.talon.one/integration-api#tag/Audiences/operation/createAudienceV2). - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_audiences200_response import GetAudiences200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - with_total_result_size = True # bool | When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - - try: - # List audiences - api_response = api_instance.get_audiences(page_size=page_size, skip=skip, sort=sort, with_total_result_size=with_total_result_size) - print("The response of ManagementApi->get_audiences:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_audiences: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **with_total_result_size** | **bool**| When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. | [optional] - -### Return type - -[**GetAudiences200Response**](GetAudiences200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_audiences_analytics** -> GetAudiencesAnalytics200Response get_audiences_analytics(audience_ids, sort=sort) - -List audience analytics - -Get a list of audience IDs and their member count. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_audiences_analytics200_response import GetAudiencesAnalytics200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - audience_ids = 'audience_ids_example' # str | The IDs of one or more audiences, separated by commas, by which to filter results. - 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: - # List audience analytics - api_response = api_instance.get_audiences_analytics(audience_ids, sort=sort) - print("The response of ManagementApi->get_audiences_analytics:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_audiences_analytics: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **audience_ids** | **str**| The IDs of one or more audiences, separated by commas, by which to filter results. | - **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 - -[**GetAudiencesAnalytics200Response**](GetAudiencesAnalytics200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_campaign** -> Campaign get_campaign(application_id, campaign_id) - -Get campaign - -Retrieve the given campaign. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.campaign import Campaign -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - - try: - # Get campaign - api_response = api_instance.get_campaign(application_id, campaign_id) - print("The response of ManagementApi->get_campaign:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_campaign: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - -### Return type - -[**Campaign**](Campaign.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_campaign_analytics** -> GetCampaignAnalytics200Response get_campaign_analytics(application_id, campaign_id, range_start, range_end, granularity=granularity) - -Get analytics of campaigns - -Retrieve statistical data about the performance of the given campaign. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_campaign_analytics200_response import GetCampaignAnalytics200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - range_start = '2013-10-20T19:20:30+01:00' # datetime | Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - range_end = '2013-10-20T19:20:30+01:00' # datetime | Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - granularity = 'granularity_example' # str | The time interval between the results in the returned time-series. (optional) - - try: - # Get analytics of campaigns - api_response = api_instance.get_campaign_analytics(application_id, campaign_id, range_start, range_end, granularity=granularity) - print("The response of ManagementApi->get_campaign_analytics:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_campaign_analytics: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **range_start** | **datetime**| Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | - **range_end** | **datetime**| Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | - **granularity** | **str**| The time interval between the results in the returned time-series. | [optional] - -### Return type - -[**GetCampaignAnalytics200Response**](GetCampaignAnalytics200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_campaign_by_attributes** -> GetCampaigns200Response get_campaign_by_attributes(application_id, campaign_search, page_size=page_size, skip=skip, sort=sort, campaign_state=campaign_state) - -List campaigns that match the given attributes - -Get a list of all the campaigns that match a set of attributes. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.campaign_search import CampaignSearch -from talon_one.models.get_campaigns200_response import GetCampaigns200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_search = talon_one.CampaignSearch() # CampaignSearch | body - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - campaign_state = 'campaign_state_example' # str | Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) - - try: - # List campaigns that match the given attributes - api_response = api_instance.get_campaign_by_attributes(application_id, campaign_search, page_size=page_size, skip=skip, sort=sort, campaign_state=campaign_state) - print("The response of ManagementApi->get_campaign_by_attributes:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_campaign_by_attributes: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_search** | [**CampaignSearch**](CampaignSearch.md)| body | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **campaign_state** | **str**| Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. | [optional] - -### Return type - -[**GetCampaigns200Response**](GetCampaigns200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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_campaign_group** -> CampaignGroup get_campaign_group(campaign_group_id) - -Get campaign access group - -Get a campaign access group specified by its ID. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.campaign_group import CampaignGroup -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - campaign_group_id = 56 # int | The ID of the campaign access group. - - try: - # Get campaign access group - api_response = api_instance.get_campaign_group(campaign_group_id) - print("The response of ManagementApi->get_campaign_group:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_campaign_group: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_group_id** | **int**| The ID of the campaign access group. | - -### Return type - -[**CampaignGroup**](CampaignGroup.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_campaign_groups** -> GetCampaignGroups200Response get_campaign_groups(page_size=page_size, skip=skip, sort=sort) - -List campaign access groups - -List the campaign access groups in the current account. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_campaign_groups200_response import GetCampaignGroups200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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: - # List campaign access groups - api_response = api_instance.get_campaign_groups(page_size=page_size, skip=skip, sort=sort) - print("The response of ManagementApi->get_campaign_groups:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_campaign_groups: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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 - -[**GetCampaignGroups200Response**](GetCampaignGroups200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_campaign_templates** -> GetCampaignTemplates200Response get_campaign_templates(page_size=page_size, skip=skip, sort=sort, state=state, name=name, tags=tags, user_id=user_id) - -List campaign templates - -Retrieve a list of campaign templates. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_campaign_templates200_response import GetCampaignTemplates200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - state = 'state_example' # str | Filter results by the state of the campaign template. (optional) - name = 'name_example' # str | Filter results performing case-insensitive matching against the name of the campaign template. (optional) - tags = 'tags_example' # str | Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. (optional) - user_id = 56 # int | Filter results by user ID. (optional) - - try: - # List campaign templates - api_response = api_instance.get_campaign_templates(page_size=page_size, skip=skip, sort=sort, state=state, name=name, tags=tags, user_id=user_id) - print("The response of ManagementApi->get_campaign_templates:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_campaign_templates: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **state** | **str**| Filter results by the state of the campaign template. | [optional] - **name** | **str**| Filter results performing case-insensitive matching against the name of the campaign template. | [optional] - **tags** | **str**| Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. | [optional] - **user_id** | **int**| Filter results by user ID. | [optional] - -### Return type - -[**GetCampaignTemplates200Response**](GetCampaignTemplates200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_campaigns** -> GetCampaigns200Response get_campaigns(application_id, page_size=page_size, skip=skip, sort=sort, campaign_state=campaign_state, name=name, tags=tags, created_before=created_before, created_after=created_after, start_before=start_before, start_after=start_after, end_before=end_before, end_after=end_after, campaign_group_id=campaign_group_id, template_id=template_id, store_id=store_id) - -List campaigns - -List the campaigns of the specified application that match your filter criteria. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_campaigns200_response import GetCampaigns200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - campaign_state = 'campaign_state_example' # str | Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) - name = 'name_example' # str | Filter results performing case-insensitive matching against the name of the campaign. (optional) - tags = 'tags_example' # str | Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values (optional) - created_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - created_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - start_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign start time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - start_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign start time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - end_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign end time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - end_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign end time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - campaign_group_id = 56 # int | Filter results to campaigns owned by the specified campaign access group ID. (optional) - template_id = 56 # int | The ID of the campaign template this campaign was created from. (optional) - store_id = 56 # int | Filter results to campaigns linked to the specified store ID. (optional) - - try: - # List campaigns - api_response = api_instance.get_campaigns(application_id, page_size=page_size, skip=skip, sort=sort, campaign_state=campaign_state, name=name, tags=tags, created_before=created_before, created_after=created_after, start_before=start_before, start_after=start_after, end_before=end_before, end_after=end_after, campaign_group_id=campaign_group_id, template_id=template_id, store_id=store_id) - print("The response of ManagementApi->get_campaigns:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_campaigns: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **campaign_state** | **str**| Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. | [optional] - **name** | **str**| Filter results performing case-insensitive matching against the name of the campaign. | [optional] - **tags** | **str**| Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values | [optional] - **created_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **created_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **start_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign start time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **start_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign start time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **end_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign end time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **end_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign end time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **campaign_group_id** | **int**| Filter results to campaigns owned by the specified campaign access group ID. | [optional] - **template_id** | **int**| The ID of the campaign template this campaign was created from. | [optional] - **store_id** | **int**| Filter results to campaigns linked to the specified store ID. | [optional] - -### Return type - -[**GetCampaigns200Response**](GetCampaigns200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | - -[[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_changes** -> GetChanges200Response get_changes(page_size=page_size, skip=skip, sort=sort, application_id=application_id, entity_path=entity_path, user_id=user_id, created_before=created_before, created_after=created_after, with_total_result_size=with_total_result_size, management_key_id=management_key_id, include_old=include_old) - -Get audit logs for an account - -Retrieve the audit logs displayed in **Accounts > Audit logs**. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_changes200_response import GetChanges200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - application_id = 3.4 # float | Filter results by Application ID. (optional) - entity_path = 'entity_path_example' # str | Filter results on a case insensitive matching of the url path of the entity (optional) - user_id = 56 # int | Filter results by user ID. (optional) - created_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - created_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - with_total_result_size = True # bool | When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - management_key_id = 56 # int | Filter results that match the given management key ID. (optional) - include_old = True # bool | When this flag is set to false, the state without the change will not be returned. The default value is true. (optional) - - try: - # Get audit logs for an account - api_response = api_instance.get_changes(page_size=page_size, skip=skip, sort=sort, application_id=application_id, entity_path=entity_path, user_id=user_id, created_before=created_before, created_after=created_after, with_total_result_size=with_total_result_size, management_key_id=management_key_id, include_old=include_old) - print("The response of ManagementApi->get_changes:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_changes: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **application_id** | **float**| Filter results by Application ID. | [optional] - **entity_path** | **str**| Filter results on a case insensitive matching of the url path of the entity | [optional] - **user_id** | **int**| Filter results by user ID. | [optional] - **created_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **created_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **with_total_result_size** | **bool**| When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. | [optional] - **management_key_id** | **int**| Filter results that match the given management key ID. | [optional] - **include_old** | **bool**| When this flag is set to false, the state without the change will not be returned. The default value is true. | [optional] - -### Return type - -[**GetChanges200Response**](GetChanges200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_collection** -> Collection get_collection(application_id, campaign_id, collection_id) - -Get campaign-level collection - -Retrieve a given campaign-level collection. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.collection import Collection -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - collection_id = 56 # int | The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. - - try: - # Get campaign-level collection - api_response = api_instance.get_collection(application_id, campaign_id, collection_id) - print("The response of ManagementApi->get_collection:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_collection: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **collection_id** | **int**| The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. | - -### Return type - -[**Collection**](Collection.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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_collection_items** -> GetCollectionItems200Response get_collection_items(collection_id, page_size=page_size, skip=skip) - -Get collection items - -Retrieve items from a given collection. - -You can retrieve items from both account-level collections and campaign-level collections using this endpoint. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_collection_items200_response import GetCollectionItems200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - collection_id = 56 # int | The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - - try: - # Get collection items - api_response = api_instance.get_collection_items(collection_id, page_size=page_size, skip=skip) - print("The response of ManagementApi->get_collection_items:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_collection_items: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **collection_id** | **int**| The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - -### Return type - -[**GetCollectionItems200Response**](GetCollectionItems200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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_coupons_without_total_count** -> GetCouponsWithoutTotalCount200Response get_coupons_without_total_count(application_id, campaign_id, page_size=page_size, skip=skip, sort=sort, value=value, created_before=created_before, created_after=created_after, valid=valid, usable=usable, redeemed=redeemed, referral_id=referral_id, recipient_integration_id=recipient_integration_id, batch_id=batch_id, exact_match=exact_match, expires_before=expires_before, expires_after=expires_after, starts_before=starts_before, starts_after=starts_after, values_only=values_only) - -List coupons - -List all the coupons matching the specified criteria. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_coupons_without_total_count200_response import GetCouponsWithoutTotalCount200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - value = 'value_example' # str | Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - created_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - created_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - valid = 'valid_example' # str | Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) - usable = 'usable_example' # str | Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) - redeemed = 'redeemed_example' # str | - `true`: only coupons where `usageCounter > 0` will be returned. - `false`: only coupons where `usageCounter = 0` will be returned. - This field cannot be used in conjunction with the `usable` query parameter. (optional) - referral_id = 56 # int | Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - recipient_integration_id = 'recipient_integration_id_example' # str | Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field. (optional) - batch_id = 'batch_id_example' # str | Filter results by batches of coupons (optional) - exact_match = False # bool | Filter results to an exact case-insensitive matching against the coupon code. (optional) (default to False) - expires_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - expires_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - starts_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - starts_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - values_only = False # bool | Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional) (default to False) - - try: - # List coupons - api_response = api_instance.get_coupons_without_total_count(application_id, campaign_id, page_size=page_size, skip=skip, sort=sort, value=value, created_before=created_before, created_after=created_after, valid=valid, usable=usable, redeemed=redeemed, referral_id=referral_id, recipient_integration_id=recipient_integration_id, batch_id=batch_id, exact_match=exact_match, expires_before=expires_before, expires_after=expires_after, starts_before=starts_before, starts_after=starts_after, values_only=values_only) - print("The response of ManagementApi->get_coupons_without_total_count:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_coupons_without_total_count: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **value** | **str**| Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. | [optional] - **created_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **created_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **valid** | **str**| Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. | [optional] - **usable** | **str**| Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. | [optional] - **redeemed** | **str**| - `true`: only coupons where `usageCounter > 0` will be returned. - `false`: only coupons where `usageCounter = 0` will be returned. - This field cannot be used in conjunction with the `usable` query parameter. | [optional] - **referral_id** | **int**| Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. | [optional] - **recipient_integration_id** | **str**| Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field. | [optional] - **batch_id** | **str**| Filter results by batches of coupons | [optional] - **exact_match** | **bool**| Filter results to an exact case-insensitive matching against the coupon code. | [optional] [default to False] - **expires_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **expires_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **starts_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **starts_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **values_only** | **bool**| Filter results to only return the coupon codes (`value` column) without the associated coupon data. | [optional] [default to False] - -### Return type - -[**GetCouponsWithoutTotalCount200Response**](GetCouponsWithoutTotalCount200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_customer_activity_report** -> CustomerActivityReport get_customer_activity_report(range_start, range_end, application_id, customer_id, page_size=page_size, skip=skip) - -Get customer's activity report - -Fetch the summary report of a given customer in the given application, in a time range. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.customer_activity_report import CustomerActivityReport -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - range_start = '2013-10-20T19:20:30+01:00' # datetime | Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - range_end = '2013-10-20T19:20:30+01:00' # datetime | Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - customer_id = 56 # int | The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - - try: - # Get customer's activity report - api_response = api_instance.get_customer_activity_report(range_start, range_end, application_id, customer_id, page_size=page_size, skip=skip) - print("The response of ManagementApi->get_customer_activity_report:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_customer_activity_report: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **range_start** | **datetime**| Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | - **range_end** | **datetime**| Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **customer_id** | **int**| The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - -### Return type - -[**CustomerActivityReport**](CustomerActivityReport.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_customer_activity_reports_without_total_count** -> GetCustomerActivityReportsWithoutTotalCount200Response get_customer_activity_reports_without_total_count(range_start, range_end, application_id, page_size=page_size, skip=skip, sort=sort, name=name, integration_id=integration_id, campaign_name=campaign_name, advocate_name=advocate_name) - -Get Activity Reports for Application Customers - -Fetch summary reports for all application customers based on a time range. Instead of having the total number of results -in the response, this endpoint only mentions whether there are more results. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_customer_activity_reports_without_total_count200_response import GetCustomerActivityReportsWithoutTotalCount200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - range_start = '2013-10-20T19:20:30+01:00' # datetime | Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - range_end = '2013-10-20T19:20:30+01:00' # datetime | Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - name = 'name_example' # str | Only return reports matching the customer name. (optional) - integration_id = 'integration_id_example' # str | Filter results performing an exact matching against the profile integration identifier. (optional) - campaign_name = 'campaign_name_example' # str | Only return reports matching the campaign name. (optional) - advocate_name = 'advocate_name_example' # str | Only return reports matching the current customer referrer name. (optional) - - try: - # Get Activity Reports for Application Customers - api_response = api_instance.get_customer_activity_reports_without_total_count(range_start, range_end, application_id, page_size=page_size, skip=skip, sort=sort, name=name, integration_id=integration_id, campaign_name=campaign_name, advocate_name=advocate_name) - print("The response of ManagementApi->get_customer_activity_reports_without_total_count:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_customer_activity_reports_without_total_count: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **range_start** | **datetime**| Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | - **range_end** | **datetime**| Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | - **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 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **name** | **str**| Only return reports matching the customer name. | [optional] - **integration_id** | **str**| Filter results performing an exact matching against the profile integration identifier. | [optional] - **campaign_name** | **str**| Only return reports matching the campaign name. | [optional] - **advocate_name** | **str**| Only return reports matching the current customer referrer name. | [optional] - -### Return type - -[**GetCustomerActivityReportsWithoutTotalCount200Response**](GetCustomerActivityReportsWithoutTotalCount200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_customer_analytics** -> CustomerAnalytics get_customer_analytics(application_id, customer_id, page_size=page_size, skip=skip, sort=sort) - -Get customer's analytics report - -Fetch analytics for a given customer in the given application. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.customer_analytics import CustomerAnalytics -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - customer_id = 56 # int | The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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: - # Get customer's analytics report - api_response = api_instance.get_customer_analytics(application_id, customer_id, page_size=page_size, skip=skip, sort=sort) - print("The response of ManagementApi->get_customer_analytics:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_customer_analytics: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **customer_id** | **int**| The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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 - -[**CustomerAnalytics**](CustomerAnalytics.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_customer_profile** -> CustomerProfile get_customer_profile(customer_id) - -Get customer profile - -Return the details of the specified customer profile. - -
-

Performance tips

- - You can retrieve the same information via the Integration API, which can save you extra API requests. consider these options: - - - Request the customer profile to be part of the response content using - [Update Customer Session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2). - - Send an empty update with the [Update Customer Profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint with `runRuleEngine=false`. -
- - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.customer_profile import CustomerProfile -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - customer_id = 56 # int | The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. - - try: - # Get customer profile - api_response = api_instance.get_customer_profile(customer_id) - print("The response of ManagementApi->get_customer_profile:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_customer_profile: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **customer_id** | **int**| The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. | - -### Return type - -[**CustomerProfile**](CustomerProfile.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_customer_profile_achievement_progress** -> GetCustomerProfileAchievementProgress200Response get_customer_profile_achievement_progress(application_id, integration_id, page_size=page_size, skip=skip, achievement_id=achievement_id, title=title) - -List customer achievements - -For the given customer profile, list all the achievements that match your filter criteria. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_customer_profile_achievement_progress200_response import GetCustomerProfileAchievementProgress200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - 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. - 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) - achievement_id = 56 # int | The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (optional) - title = 'title_example' # str | Filter results by the `title` of an achievement. (optional) - - try: - # List customer achievements - api_response = api_instance.get_customer_profile_achievement_progress(application_id, integration_id, page_size=page_size, skip=skip, achievement_id=achievement_id, title=title) - print("The response of ManagementApi->get_customer_profile_achievement_progress:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_customer_profile_achievement_progress: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **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. | - **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] - **achievement_id** | **int**| The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. | [optional] - **title** | **str**| Filter results by the `title` of an achievement. | [optional] - -### Return type - -[**GetCustomerProfileAchievementProgress200Response**](GetCustomerProfileAchievementProgress200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | -**401** | Unauthorized | - | - -[[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_customer_profiles** -> GetCustomerProfiles200Response get_customer_profiles(page_size=page_size, skip=skip, sandbox=sandbox) - -List customer profiles - -List all customer profiles. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_customer_profiles200_response import GetCustomerProfiles200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - sandbox = False # bool | Indicates whether you are pointing to a sandbox or live customer. (optional) (default to False) - - try: - # List customer profiles - api_response = api_instance.get_customer_profiles(page_size=page_size, skip=skip, sandbox=sandbox) - print("The response of ManagementApi->get_customer_profiles:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_customer_profiles: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **sandbox** | **bool**| Indicates whether you are pointing to a sandbox or live customer. | [optional] [default to False] - -### Return type - -[**GetCustomerProfiles200Response**](GetCustomerProfiles200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_customers_by_attributes** -> GetCustomersByAttributes200Response get_customers_by_attributes(customer_profile_search_query, page_size=page_size, skip=skip, sandbox=sandbox) - -List customer profiles matching the given attributes - -Get a list of the customer profiles matching the provided criteria. - -The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.customer_profile_search_query import CustomerProfileSearchQuery -from talon_one.models.get_customers_by_attributes200_response import GetCustomersByAttributes200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - customer_profile_search_query = talon_one.CustomerProfileSearchQuery() # CustomerProfileSearchQuery | body - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - sandbox = False # bool | Indicates whether you are pointing to a sandbox or live customer. (optional) (default to False) - - try: - # List customer profiles matching the given attributes - api_response = api_instance.get_customers_by_attributes(customer_profile_search_query, page_size=page_size, skip=skip, sandbox=sandbox) - print("The response of ManagementApi->get_customers_by_attributes:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_customers_by_attributes: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **customer_profile_search_query** | [**CustomerProfileSearchQuery**](CustomerProfileSearchQuery.md)| body | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **sandbox** | **bool**| Indicates whether you are pointing to a sandbox or live customer. | [optional] [default to False] - -### Return type - -[**GetCustomersByAttributes200Response**](GetCustomersByAttributes200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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_dashboard_statistics** -> GetDashboardStatistics200Response get_dashboard_statistics(loyalty_program_id, range_start, range_end, subledger_id=subledger_id) - -Get statistics for loyalty dashboard - -Retrieve the statistics displayed on the specified loyalty program's dashboard, -such as the total active points, pending points, spent points, and expired points. - -**Important:** The returned data does not include the current day. All statistics -are updated daily at 11:59 PM in the loyalty program time zone. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_dashboard_statistics200_response import GetDashboardStatistics200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. - range_start = '2013-10-20T19:20:30+01:00' # datetime | Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - range_end = '2013-10-20T19:20:30+01:00' # datetime | Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - subledger_id = 'subledger_id_example' # str | The ID of the subledger by which we filter the data. (optional) - - try: - # Get statistics for loyalty dashboard - api_response = api_instance.get_dashboard_statistics(loyalty_program_id, range_start, range_end, subledger_id=subledger_id) - print("The response of ManagementApi->get_dashboard_statistics:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_dashboard_statistics: %s\n" % e) -``` - - - -### Parameters - - -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. | - **range_start** | **datetime**| Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | - **range_end** | **datetime**| Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | - **subledger_id** | **str**| The ID of the subledger by which we filter the data. | [optional] - -### Return type - -[**GetDashboardStatistics200Response**](GetDashboardStatistics200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_event_types** -> GetEventTypes200Response get_event_types(name=name, include_old_versions=include_old_versions, page_size=page_size, skip=skip, sort=sort) - -List event types - -Fetch all event type definitions for your account. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_event_types200_response import GetEventTypes200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - name = 'name_example' # str | Filter results to event types with the given name. This parameter implies `includeOldVersions`. (optional) - include_old_versions = False # bool | Include all versions of every event type. (optional) (default to False) - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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: - # List event types - api_response = api_instance.get_event_types(name=name, include_old_versions=include_old_versions, page_size=page_size, skip=skip, sort=sort) - print("The response of ManagementApi->get_event_types:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_event_types: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **str**| Filter results to event types with the given name. This parameter implies `includeOldVersions`. | [optional] - **include_old_versions** | **bool**| Include all versions of every event type. | [optional] [default to False] - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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 - -[**GetEventTypes200Response**](GetEventTypes200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_exports** -> GetExports200Response get_exports(page_size=page_size, skip=skip, application_id=application_id, campaign_id=campaign_id, entity=entity) - -Get exports - -List all past exports - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_exports200_response import GetExports200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - application_id = 3.4 # float | Filter results by Application ID. (optional) - campaign_id = 56 # int | Filter by the campaign ID on which the limit counters are used. (optional) - entity = 'entity_example' # str | The name of the entity type that was exported. (optional) - - try: - # Get exports - api_response = api_instance.get_exports(page_size=page_size, skip=skip, application_id=application_id, campaign_id=campaign_id, entity=entity) - print("The response of ManagementApi->get_exports:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_exports: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **application_id** | **float**| Filter results by Application ID. | [optional] - **campaign_id** | **int**| Filter by the campaign ID on which the limit counters are used. | [optional] - **entity** | **str**| The name of the entity type that was exported. | [optional] - -### Return type - -[**GetExports200Response**](GetExports200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_loyalty_card** -> LoyaltyCard get_loyalty_card(loyalty_program_id, loyalty_card_id) - -Get loyalty card - -Get the given loyalty card. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.loyalty_card import LoyaltyCard -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. - loyalty_card_id = 'loyalty_card_id_example' # str | Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. - - try: - # Get loyalty card - api_response = api_instance.get_loyalty_card(loyalty_program_id, loyalty_card_id) - print("The response of ManagementApi->get_loyalty_card:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_loyalty_card: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **int**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | - **loyalty_card_id** | **str**| Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. | - -### Return type - -[**LoyaltyCard**](LoyaltyCard.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | -**401** | Unauthorized | - | -**404** | Not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_loyalty_card_transaction_logs** -> GetLoyaltyCardTransactionLogs200Response get_loyalty_card_transaction_logs(loyalty_program_id, loyalty_card_id, start_date=start_date, end_date=end_date, page_size=page_size, skip=skip, subledger_id=subledger_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids) - -List card's transactions - -Retrieve the transaction logs for the given [loyalty card](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) -within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) with filtering options applied. -If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_loyalty_card_transaction_logs200_response import GetLoyaltyCardTransactionLogs200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. - loyalty_card_id = 'loyalty_card_id_example' # str | Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. - start_date = '2013-10-20T19:20:30+01:00' # datetime | Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - end_date = '2013-10-20T19:20:30+01:00' # datetime | Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - subledger_id = 'subledger_id_example' # str | The ID of the subledger by which we filter the data. (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) - - try: - # List card's transactions - api_response = api_instance.get_loyalty_card_transaction_logs(loyalty_program_id, loyalty_card_id, start_date=start_date, end_date=end_date, page_size=page_size, skip=skip, subledger_id=subledger_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids) - print("The response of ManagementApi->get_loyalty_card_transaction_logs:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_loyalty_card_transaction_logs: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **int**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | - **loyalty_card_id** | **str**| Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. | - **start_date** | **datetime**| Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] - **end_date** | **datetime**| Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **subledger_id** | **str**| The ID of the subledger by which we filter the data. | [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] - -### Return type - -[**GetLoyaltyCardTransactionLogs200Response**](GetLoyaltyCardTransactionLogs200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | -**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) - -# **get_loyalty_cards** -> GetLoyaltyCards200Response get_loyalty_cards(loyalty_program_id, page_size=page_size, skip=skip, sort=sort, identifier=identifier, profile_id=profile_id, batch_id=batch_id) - -List loyalty cards - -For the given card-based loyalty program, list the loyalty cards that match your filter criteria. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_loyalty_cards200_response import GetLoyaltyCards200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 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. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - identifier = 'identifier_example' # str | The card code by which to filter loyalty cards in the response. (optional) - profile_id = 56 # int | Filter results by customer profile ID. (optional) - batch_id = 'batch_id_example' # str | Filter results by loyalty card batch ID. (optional) - - try: - # List loyalty cards - api_response = api_instance.get_loyalty_cards(loyalty_program_id, page_size=page_size, skip=skip, sort=sort, identifier=identifier, profile_id=profile_id, batch_id=batch_id) - print("The response of ManagementApi->get_loyalty_cards:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_loyalty_cards: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **int**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **identifier** | **str**| The card code by which to filter loyalty cards in the response. | [optional] - **profile_id** | **int**| Filter results by customer profile ID. | [optional] - **batch_id** | **str**| Filter results by loyalty card batch ID. | [optional] - -### Return type - -[**GetLoyaltyCards200Response**](GetLoyaltyCards200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | -**401** | Unauthorized | - | - -[[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_ledger_balances** -> LoyaltyBalancesWithTiers get_loyalty_ledger_balances(loyalty_program_id, integration_id, end_date=end_date, subledger_id=subledger_id, include_tiers=include_tiers, include_projected_tier=include_projected_tier) - -Get customer's loyalty balances - -Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. -You can filter balances by date and subledger ID, and include tier-related information in the response. - -**Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. - -Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. - -For more information, see: -- [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) -- [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.loyalty_balances_with_tiers import LoyaltyBalancesWithTiers -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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. - 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. - end_date = '2013-10-20T19:20:30+01:00' # datetime | Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - subledger_id = 'subledger_id_example' # str | The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. (optional) - include_tiers = False # bool | Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. (optional) (default to False) - include_projected_tier = False # bool | Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. (optional) (default to False) - - try: - # Get customer's loyalty balances - api_response = api_instance.get_loyalty_ledger_balances(loyalty_program_id, integration_id, end_date=end_date, subledger_id=subledger_id, include_tiers=include_tiers, include_projected_tier=include_projected_tier) - print("The response of ManagementApi->get_loyalty_ledger_balances:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_loyalty_ledger_balances: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **int**| Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | - **integration_id** | **str**| The integration 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. | - **end_date** | **datetime**| Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] - **subledger_id** | **str**| The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. | [optional] - **include_tiers** | **bool**| Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. | [optional] [default to False] - **include_projected_tier** | **bool**| Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. | [optional] [default to False] - -### Return type - -[**LoyaltyBalancesWithTiers**](LoyaltyBalancesWithTiers.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | -**401** | Unauthorized | - | -**404** | Not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_loyalty_points** -> LoyaltyLedger get_loyalty_points(loyalty_program_id, integration_id) - -Get customer's full loyalty ledger - -Get the loyalty ledger for this profile integration ID. - -To get the `integrationId` of the profile from a `sessionId`, use the -[Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - -**Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, -we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.loyalty_ledger import LoyaltyLedger -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 = 'loyalty_program_id_example' # str | The identifier for the loyalty program. - 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. - - try: - # Get customer's full loyalty ledger - api_response = api_instance.get_loyalty_points(loyalty_program_id, integration_id) - print("The response of ManagementApi->get_loyalty_points:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_loyalty_points: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **str**| The identifier for the loyalty program. | - **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. | - -### Return type - -[**LoyaltyLedger**](LoyaltyLedger.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_loyalty_program** -> LoyaltyProgram get_loyalty_program(loyalty_program_id) - -Get loyalty program - -Get the specified [loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview). -To list all loyalty programs in your Application, use [List loyalty programs](#operation/getLoyaltyPrograms). - -To list the loyalty programs that a customer profile is part of, use the -[List customer data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.loyalty_program import LoyaltyProgram -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. - - try: - # Get loyalty program - api_response = api_instance.get_loyalty_program(loyalty_program_id) - print("The response of ManagementApi->get_loyalty_program:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_loyalty_program: %s\n" % e) -``` - - - -### Parameters - - -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. | - -### Return type - -[**LoyaltyProgram**](LoyaltyProgram.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_loyalty_program_profile_ledger_transactions** -> GetLoyaltyProgramProfileTransactions200Response get_loyalty_program_profile_ledger_transactions(loyalty_program_id, integration_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, subledger_id=subledger_id, loyalty_transaction_type=loyalty_transaction_type, start_date=start_date, end_date=end_date, page_size=page_size, skip=skip, awaits_activation=awaits_activation) - -List customer's loyalty transactions - -Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. - -You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. - -**Note:** To retrieve all loyalty program transaction logs in a given loyalty program, -use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_loyalty_program_profile_transactions200_response import GetLoyaltyProgramProfileTransactions200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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. - 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. - 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) - subledger_id = 'subledger_id_example' # str | The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. (optional) - loyalty_transaction_type = 'loyalty_transaction_type_example' # str | Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. (optional) - start_date = '2013-10-20T19:20:30+01:00' # datetime | Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - end_date = '2013-10-20T19:20:30+01:00' # datetime | Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - 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) - awaits_activation = True # bool | If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. (optional) - - try: - # List customer's loyalty transactions - api_response = api_instance.get_loyalty_program_profile_ledger_transactions(loyalty_program_id, integration_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, subledger_id=subledger_id, loyalty_transaction_type=loyalty_transaction_type, start_date=start_date, end_date=end_date, page_size=page_size, skip=skip, awaits_activation=awaits_activation) - print("The response of ManagementApi->get_loyalty_program_profile_ledger_transactions:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_loyalty_program_profile_ledger_transactions: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **int**| Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | - **integration_id** | **str**| The integration 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. | - **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] - **subledger_id** | **str**| The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. | [optional] - **loyalty_transaction_type** | **str**| Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. | [optional] - **start_date** | **datetime**| Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] - **end_date** | **datetime**| Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] - **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] - **awaits_activation** | **bool**| If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. | [optional] - -### Return type - -[**GetLoyaltyProgramProfileTransactions200Response**](GetLoyaltyProgramProfileTransactions200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | -**401** | Unauthorized | - | -**404** | Not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_loyalty_program_transactions** -> GetLoyaltyProgramTransactions200Response get_loyalty_program_transactions(loyalty_program_id, loyalty_transaction_type=loyalty_transaction_type, subledger_id=subledger_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, start_date=start_date, end_date=end_date, page_size=page_size, skip=skip, awaits_activation=awaits_activation) - -List loyalty program transactions - -Retrieve loyalty program transaction logs in a given loyalty program with filtering options applied. Manual and imported transactions are also included. -**Note:** If no filters are applied, the last 50 loyalty transactions for the given loyalty program are returned. - -**Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, -we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_loyalty_program_transactions200_response import GetLoyaltyProgramTransactions200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. - loyalty_transaction_type = 'loyalty_transaction_type_example' # str | Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. (optional) - subledger_id = 'subledger_id_example' # str | The ID of the subledger by which we filter the data. (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) - start_date = '2013-10-20T19:20:30+01:00' # datetime | Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - end_date = '2013-10-20T19:20:30+01:00' # datetime | Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - 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) - awaits_activation = True # bool | If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. (optional) - - try: - # List loyalty program transactions - api_response = api_instance.get_loyalty_program_transactions(loyalty_program_id, loyalty_transaction_type=loyalty_transaction_type, subledger_id=subledger_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, start_date=start_date, end_date=end_date, page_size=page_size, skip=skip, awaits_activation=awaits_activation) - print("The response of ManagementApi->get_loyalty_program_transactions:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_loyalty_program_transactions: %s\n" % e) -``` - - - -### Parameters - - -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. | - **loyalty_transaction_type** | **str**| Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. | [optional] - **subledger_id** | **str**| The ID of the subledger by which we filter the data. | [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] - **start_date** | **datetime**| Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] - **end_date** | **datetime**| Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] - **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] - **awaits_activation** | **bool**| If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. | [optional] - -### Return type - -[**GetLoyaltyProgramTransactions200Response**](GetLoyaltyProgramTransactions200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | -**401** | Unauthorized | - | -**404** | Not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_loyalty_programs** -> GetLoyaltyPrograms200Response get_loyalty_programs() - -List loyalty programs - -List the loyalty programs of the account. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_loyalty_programs200_response import GetLoyaltyPrograms200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - - try: - # List loyalty programs - api_response = api_instance.get_loyalty_programs() - print("The response of ManagementApi->get_loyalty_programs:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_loyalty_programs: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**GetLoyaltyPrograms200Response**](GetLoyaltyPrograms200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_loyalty_statistics** -> LoyaltyDashboardData get_loyalty_statistics(loyalty_program_id) - -Get loyalty program statistics - -⚠️ Deprecation notice: Support for requests to this endpoint will end soon. -To retrieve statistics for a loyalty program, use the [Get statistics for -loyalty dashboard](/management-api#tag/Loyalty/operation/getDashboardStatistics) -endpoint. - -Retrieve the statistics of the specified loyalty program, such as the -total active points, pending points, spent points, and expired points. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.loyalty_dashboard_data import LoyaltyDashboardData -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. - - try: - # Get loyalty program statistics - api_response = api_instance.get_loyalty_statistics(loyalty_program_id) - print("The response of ManagementApi->get_loyalty_statistics:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_loyalty_statistics: %s\n" % e) -``` - - - -### Parameters - - -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. | - -### Return type - -[**LoyaltyDashboardData**](LoyaltyDashboardData.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_message_logs** -> MessageLogEntries get_message_logs(entity_type, message_id=message_id, change_type=change_type, notification_ids=notification_ids, created_before=created_before, created_after=created_after, cursor=cursor, period=period, is_successful=is_successful, application_id=application_id, campaign_id=campaign_id, loyalty_program_id=loyalty_program_id, response_code=response_code, webhook_ids=webhook_ids) - -List message log entries - -Retrieve all message log entries. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.message_log_entries import MessageLogEntries -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - entity_type = 'entity_type_example' # str | The entity type the log is related to. - message_id = 'message_id_example' # str | Filter results by message ID. (optional) - change_type = 'change_type_example' # str | Filter results by change type. (optional) - notification_ids = 'notification_ids_example' # str | Filter results by notification ID (include up to 30 values, separated by a comma). (optional) - created_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. Use UTC time. (optional) - created_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. Use UTC time. (optional) - cursor = None # bytearray | A specific unique value in the database. If this value is not given, the server fetches results starting with the first record. (optional) - period = 'period_example' # str | Filter results by time period. Choose between the available relative time frames. (optional) - is_successful = True # bool | Indicates whether to return log entries with either successful or unsuccessful HTTP response codes. When set to`true`, only log entries with `2xx` response codes are returned. When set to `false`, only log entries with `4xx` and `5xx` response codes are returned. (optional) - application_id = 3.4 # float | Filter results by Application ID. (optional) - campaign_id = 3.4 # float | Filter results by campaign ID. (optional) - loyalty_program_id = 56 # int | Identifier of the loyalty program. (optional) - response_code = 56 # int | Filter results by response status code. (optional) - webhook_ids = 'webhook_ids_example' # str | Filter results by webhook ID (include up to 30 values, separated by a comma). (optional) - - try: - # List message log entries - api_response = api_instance.get_message_logs(entity_type, message_id=message_id, change_type=change_type, notification_ids=notification_ids, created_before=created_before, created_after=created_after, cursor=cursor, period=period, is_successful=is_successful, application_id=application_id, campaign_id=campaign_id, loyalty_program_id=loyalty_program_id, response_code=response_code, webhook_ids=webhook_ids) - print("The response of ManagementApi->get_message_logs:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_message_logs: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **entity_type** | **str**| The entity type the log is related to. | - **message_id** | **str**| Filter results by message ID. | [optional] - **change_type** | **str**| Filter results by change type. | [optional] - **notification_ids** | **str**| Filter results by notification ID (include up to 30 values, separated by a comma). | [optional] - **created_before** | **datetime**| Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. Use UTC time. | [optional] - **created_after** | **datetime**| Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. Use UTC time. | [optional] - **cursor** | **bytearray**| A specific unique value in the database. If this value is not given, the server fetches results starting with the first record. | [optional] - **period** | **str**| Filter results by time period. Choose between the available relative time frames. | [optional] - **is_successful** | **bool**| Indicates whether to return log entries with either successful or unsuccessful HTTP response codes. When set to`true`, only log entries with `2xx` response codes are returned. When set to `false`, only log entries with `4xx` and `5xx` response codes are returned. | [optional] - **application_id** | **float**| Filter results by Application ID. | [optional] - **campaign_id** | **float**| Filter results by campaign ID. | [optional] - **loyalty_program_id** | **int**| Identifier of the loyalty program. | [optional] - **response_code** | **int**| Filter results by response status code. | [optional] - **webhook_ids** | **str**| Filter results by webhook ID (include up to 30 values, separated by a comma). | [optional] - -### Return type - -[**MessageLogEntries**](MessageLogEntries.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_referrals_without_total_count** -> GetReferralsWithoutTotalCount200Response get_referrals_without_total_count(application_id, campaign_id, page_size=page_size, skip=skip, sort=sort, code=code, created_before=created_before, created_after=created_after, valid=valid, usable=usable, advocate=advocate) - -List referrals - -List all referrals of the specified campaign. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_referrals_without_total_count200_response import GetReferralsWithoutTotalCount200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - code = 'code_example' # str | Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - created_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - created_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - valid = 'valid_example' # str | Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. (optional) - usable = 'usable_example' # str | Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. (optional) - advocate = 'advocate_example' # str | Filter results by match with a profile ID specified in the referral's AdvocateProfileIntegrationId field. (optional) - - try: - # List referrals - api_response = api_instance.get_referrals_without_total_count(application_id, campaign_id, page_size=page_size, skip=skip, sort=sort, code=code, created_before=created_before, created_after=created_after, valid=valid, usable=usable, advocate=advocate) - print("The response of ManagementApi->get_referrals_without_total_count:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_referrals_without_total_count: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **code** | **str**| Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. | [optional] - **created_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **created_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **valid** | **str**| Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. | [optional] - **usable** | **str**| Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. | [optional] - **advocate** | **str**| Filter results by match with a profile ID specified in the referral's AdvocateProfileIntegrationId field. | [optional] - -### Return type - -[**GetReferralsWithoutTotalCount200Response**](GetReferralsWithoutTotalCount200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_role_v2** -> RoleV2 get_role_v2(role_id) - -Get role - -Get the details of a specific role. To see all the roles, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.role_v2 import RoleV2 -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - role_id = 56 # int | The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. - - try: - # Get role - api_response = api_instance.get_role_v2(role_id) - print("The response of ManagementApi->get_role_v2:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_role_v2: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **role_id** | **int**| The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. | - -### Return type - -[**RoleV2**](RoleV2.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_ruleset** -> Ruleset get_ruleset(application_id, campaign_id, ruleset_id) - -Get ruleset - -Retrieve the specified ruleset. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.ruleset import Ruleset -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - ruleset_id = 56 # int | The ID of the ruleset. - - try: - # Get ruleset - api_response = api_instance.get_ruleset(application_id, campaign_id, ruleset_id) - print("The response of ManagementApi->get_ruleset:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_ruleset: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **ruleset_id** | **int**| The ID of the ruleset. | - -### Return type - -[**Ruleset**](Ruleset.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_rulesets** -> GetRulesets200Response get_rulesets(application_id, campaign_id, page_size=page_size, skip=skip, sort=sort) - -List campaign rulesets - -List all rulesets of this campaign. A ruleset is a revision of the rules of a campaign. -**Important:** The response also includes deleted rules. -You should only consider the latest revision of the returned rulesets. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_rulesets200_response import GetRulesets200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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: - # List campaign rulesets - api_response = api_instance.get_rulesets(application_id, campaign_id, page_size=page_size, skip=skip, sort=sort) - print("The response of ManagementApi->get_rulesets:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_rulesets: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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 - -[**GetRulesets200Response**](GetRulesets200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_store** -> Store get_store(application_id, store_id) - -Get store - -Get store details for a specific store ID. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.store import Store -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - store_id = 'store_id_example' # str | The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. - - try: - # Get store - api_response = api_instance.get_store(application_id, store_id) - print("The response of ManagementApi->get_store:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_store: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **store_id** | **str**| The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. | - -### Return type - -[**Store**](Store.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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_user** -> User get_user(user_id) - -Get user - -Retrieve the data (including an invitation code) for a user. Non-admin users can only get their own profile. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.user import User -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - user_id = 56 # int | The ID of the user. - - try: - # Get user - api_response = api_instance.get_user(user_id) - print("The response of ManagementApi->get_user:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_user: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user_id** | **int**| The ID of the user. | - -### Return type - -[**User**](User.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_users** -> GetUsers200Response get_users(page_size=page_size, skip=skip, sort=sort) - -List users in account - -Retrieve all users in your account. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_users200_response import GetUsers200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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: - # List users in account - api_response = api_instance.get_users(page_size=page_size, skip=skip, sort=sort) - print("The response of ManagementApi->get_users:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_users: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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 - -[**GetUsers200Response**](GetUsers200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_webhook** -> Webhook get_webhook(webhook_id) - -Get webhook - -Returns a webhook by its id. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.webhook import Webhook -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - webhook_id = 56 # int | The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. - - try: - # Get webhook - api_response = api_instance.get_webhook(webhook_id) - print("The response of ManagementApi->get_webhook:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_webhook: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **webhook_id** | **int**| The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. | - -### Return type - -[**Webhook**](Webhook.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_webhooks** -> GetWebhooks200Response get_webhooks(application_ids=application_ids, sort=sort, page_size=page_size, skip=skip, creation_type=creation_type, visibility=visibility, outgoing_integrations_type_id=outgoing_integrations_type_id, title=title) - -List webhooks - -List all webhooks. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_webhooks200_response import GetWebhooks200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_ids = 'application_ids_example' # str | Checks if the given catalog or its attributes are referenced in the specified Application ID. **Note**: If no Application ID is provided, we check for all connected Applications. (optional) - 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) - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - creation_type = 'creation_type_example' # str | Filter results by creation type. (optional) - visibility = 'visibility_example' # str | Filter results by visibility. (optional) - outgoing_integrations_type_id = 56 # int | Filter results by outgoing integration type ID. (optional) - title = 'title_example' # str | Filter results performing case-insensitive matching against the webhook title. (optional) - - try: - # List webhooks - api_response = api_instance.get_webhooks(application_ids=application_ids, sort=sort, page_size=page_size, skip=skip, creation_type=creation_type, visibility=visibility, outgoing_integrations_type_id=outgoing_integrations_type_id, title=title) - print("The response of ManagementApi->get_webhooks:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->get_webhooks: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_ids** | **str**| Checks if the given catalog or its attributes are referenced in the specified Application ID. **Note**: If no Application ID is provided, we check for all connected Applications. | [optional] - **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] - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **creation_type** | **str**| Filter results by creation type. | [optional] - **visibility** | **str**| Filter results by visibility. | [optional] - **outgoing_integrations_type_id** | **int**| Filter results by outgoing integration type ID. | [optional] - **title** | **str**| Filter results performing case-insensitive matching against the webhook title. | [optional] - -### Return type - -[**GetWebhooks200Response**](GetWebhooks200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **import_account_collection** -> ModelImport import_account_collection(collection_id, up_file=up_file) - -Import data into existing account-level collection - -Upload a CSV file containing the collection of string values that should be attached as payload for collection. -The file should be sent as multipart data. - -The import **replaces** the initial content of the collection. - -The CSV file **must** only contain the following column: - -- `item`: the values in your collection. - -A collection is limited to 500,000 items. - -Example: - -``` -item -Addidas -Nike -Asics -``` - -**Note:** Before sending a request to this endpoint, ensure the data in the CSV to import is different from the data currently stored in the collection. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* 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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - collection_id = 56 # int | The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. - up_file = 'up_file_example' # str | The file containing the data that is being imported. (optional) - - try: - # Import data into existing account-level collection - api_response = api_instance.import_account_collection(collection_id, up_file=up_file) - print("The response of ManagementApi->import_account_collection:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->import_account_collection: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **collection_id** | **int**| The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. | - **up_file** | **str**| The file containing the data that is being imported. | [optional] - -### Return type - -[**ModelImport**](ModelImport.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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_allowed_list** -> ModelImport import_allowed_list(attribute_id, up_file=up_file) - -Import allowed values for attribute - -Upload a CSV file containing a list of [picklist values](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#picklist-values) for the specified attribute. - -The file should be sent as multipart data. - -The import **replaces** the previous list of allowed values for this attribute, if any. - -The CSV file **must** only contain the following column: -- `item` (required): the values in your allowed list, for example a list of SKU's. - -An allowed list is limited to 500,000 items. - -Example: - -```text -item -CS-VG-04032021-UP-50D-10 -CS-DV-04042021-UP-49D-12 -CS-DG-02082021-UP-50G-07 -``` - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* 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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - attribute_id = 56 # int | The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. - up_file = 'up_file_example' # str | The file containing the data that is being imported. (optional) - - try: - # Import allowed values for attribute - api_response = api_instance.import_allowed_list(attribute_id, up_file=up_file) - print("The response of ManagementApi->import_allowed_list:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->import_allowed_list: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **attribute_id** | **int**| The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. | - **up_file** | **str**| The file containing the data that is being imported. | [optional] - -### Return type - -[**ModelImport**](ModelImport.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 - Invalid API key | - | -**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_audiences_memberships** -> ModelImport import_audiences_memberships(audience_id, up_file=up_file) - -Import audience members - -Upload a CSV file containing the integration IDs of the members you want to add to an audience. - -The file should be sent as multipart data and should contain only the following column (required): -- `profileintegrationid`: The integration ID of the customer profile. - -The import **replaces** the previous list of audience members. - -**Note:** We recommend limiting your file size to 500MB. - -Example: - -```text -profileintegrationid -charles -alexa -``` - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* 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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - audience_id = 56 # int | The ID of the audience. - up_file = 'up_file_example' # str | The file containing the data that is being imported. (optional) - - try: - # Import audience members - api_response = api_instance.import_audiences_memberships(audience_id, up_file=up_file) - print("The response of ManagementApi->import_audiences_memberships:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->import_audiences_memberships: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **audience_id** | **int**| The ID of the audience. | - **up_file** | **str**| The file containing the data that is being imported. | [optional] - -### Return type - -[**ModelImport**](ModelImport.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 - Invalid API key | - | -**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_campaign_store_budget** -> ModelImport import_campaign_store_budget(application_id, campaign_id, action=action, period=period, up_file=up_file) - -Import campaign store budgets - -Upload a CSV file containing store budgets for a given campaign. - -Send the file as multipart data. - -The CSV file **must** only contain the following columns: -- `store_integration_id`: The identifier of the store. -- `limit`: The budget limit for the store. - -The import **replaces** the previous list of store budgets. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* 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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - action = 'action_example' # str | The action that this budget is limiting. (optional) - period = 'period_example' # str | The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. (optional) - up_file = 'up_file_example' # str | The file containing the data that is being imported. (optional) - - try: - # Import campaign store budgets - api_response = api_instance.import_campaign_store_budget(application_id, campaign_id, action=action, period=period, up_file=up_file) - print("The response of ManagementApi->import_campaign_store_budget:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->import_campaign_store_budget: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **action** | **str**| The action that this budget is limiting. | [optional] - **period** | **str**| The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. | [optional] - **up_file** | **str**| The file containing the data that is being imported. | [optional] - -### Return type - -[**ModelImport**](ModelImport.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**201** | Created | - | -**400** | Bad request | - | - -[[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_campaign_stores** -> ModelImport import_campaign_stores(application_id, campaign_id, up_file=up_file) - -Import stores - -Upload a CSV file containing the stores you want to link to a specific campaign. - -Send the file as multipart data. - -The CSV file **must** only contain the following column: -- `store_integration_id`: The identifier of the store. - -The import **replaces** the previous list of stores linked to the campaign. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* 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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - up_file = 'up_file_example' # str | The file containing the data that is being imported. (optional) - - try: - # Import stores - api_response = api_instance.import_campaign_stores(application_id, campaign_id, up_file=up_file) - print("The response of ManagementApi->import_campaign_stores:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->import_campaign_stores: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **up_file** | **str**| The file containing the data that is being imported. | [optional] - -### Return type - -[**ModelImport**](ModelImport.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 - Invalid API key | - | -**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_collection** -> ModelImport import_collection(application_id, campaign_id, collection_id, up_file=up_file) - -Import data into existing campaign-level collection - -Upload a CSV file containing the collection of string values that should be attached as payload for collection. -The file should be sent as multipart data. - -The import **replaces** the initial content of the collection. - -The CSV file **must** only contain the following column: - -- `item`: the values in your collection. - -A collection is limited to 500,000 items. - -Example: - -``` -item -Addidas -Nike -Asics -``` - -**Note:** Before sending a request to this endpoint, ensure the data in the CSV to import is different from the data currently stored in the collection. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* 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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - collection_id = 56 # int | The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. - up_file = 'up_file_example' # str | The file containing the data that is being imported. (optional) - - try: - # Import data into existing campaign-level collection - api_response = api_instance.import_collection(application_id, campaign_id, collection_id, up_file=up_file) - print("The response of ManagementApi->import_collection:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->import_collection: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **collection_id** | **int**| The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. | - **up_file** | **str**| The file containing the data that is being imported. | [optional] - -### Return type - -[**ModelImport**](ModelImport.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | -**401** | Unauthorized | - | - -[[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_coupons** -> ModelImport import_coupons(application_id, campaign_id, skip_duplicates=skip_duplicates, up_file=up_file) - -Import coupons - -Upload a CSV file containing the coupons that should be created. The file should be sent as multipart data. - -The CSV file contains the following columns: - -- `value` (required): The coupon code. -- `expirydate`: The end date in RFC3339 of the code redemption period. -- `startdate`: The start date in RFC3339 of the code redemption period. -- `recipientintegrationid`: The integration ID of the recipient of the coupon. - Only the customer with this integration ID can redeem this code. Available only for personal codes. -- `limitval`: The maximum number of redemptions of this code. For unlimited redemptions, use `0`. Defaults to `1` when not provided. -- `discountlimit`: The total discount value that the code can give. This is typically used to represent a gift card value. -- `attributes`: A JSON object describing _custom_ coupon attribute names and their values, enclosed with double quotation marks. - - For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) - called `category` associated with the coupon entity, the object in the CSV file, when opened in a text editor, must be: `"{"category": "10_off"}"`. - -You can use the time zone of your choice. It is converted to UTC internally by Talon.One. - -**Note:** We recommend limiting your file size to 500MB. - -**Example:** - -```text -"value","expirydate","startdate","recipientintegrationid","limitval","attributes","discountlimit" -COUP1,2018-07-01T04:00:00Z,2018-05-01T04:00:00Z,cust123,1,"{""Category"": ""10_off""}",2.4 -``` - -Once imported, you can find the `batchId` in the Campaign Manager or by -using [List coupons](#tag/Coupons/operation/getCouponsWithoutTotalCount). - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* 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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - skip_duplicates = True # bool | An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. (optional) - up_file = 'up_file_example' # str | The file containing the data that is being imported. (optional) - - try: - # Import coupons - api_response = api_instance.import_coupons(application_id, campaign_id, skip_duplicates=skip_duplicates, up_file=up_file) - print("The response of ManagementApi->import_coupons:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->import_coupons: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **skip_duplicates** | **bool**| An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. | [optional] - **up_file** | **str**| The file containing the data that is being imported. | [optional] - -### Return type - -[**ModelImport**](ModelImport.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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_cards** -> ModelImport import_loyalty_cards(loyalty_program_id, up_file=up_file) - -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 alphanumeric identifier of the loyalty card. -- `state` (required): The state of the loyalty card. It can be `active` or `inactive`. -- `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). - -**Note:** We recommend limiting your file size to 500MB. - -**Example:** - -```csv -identifier,state,customerprofileids -123-456-789AT,active,Alexa001;UserA -``` - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* 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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 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. - up_file = 'up_file_example' # str | The file containing the data that is being imported. (optional) - - try: - # Import loyalty cards - api_response = api_instance.import_loyalty_cards(loyalty_program_id, up_file=up_file) - print("The response of ManagementApi->import_loyalty_cards:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->import_loyalty_cards: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **int**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | - **up_file** | **str**| The file containing the data that is being imported. | [optional] - -### Return type - -[**ModelImport**](ModelImport.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | -**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_customers_tiers** -> ModelImport import_loyalty_customers_tiers(loyalty_program_id, up_file=up_file) - -Import customers into loyalty tiers - -Upload a CSV file containing existing customers to be assigned to existing tiers. -Send the file as multipart data. - -**Important:** This endpoint only works with loyalty programs with advanced tiers (with expiration and downgrade policy) feature enabled. - -The CSV file should contain the following columns: -- `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. -- `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. -- `tiername`: The name of an existing tier to assign to the customer. -- `expirydate`: The expiration date of the tier when the tier is reevaluated. It should be a future date. - -About customer assignment to a tier: -- If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. -- If the customer is already in the tier that's specified in the CSV file, only the expiration date is updated. - -**Note:** We recommend not using this endpoint to update the tier of a customer. -To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. - -You can use the time zone of your choice. It is converted to UTC internally by Talon.One. - -**Note:** We recommend limiting your file size to 500MB. - -**Example:** -```csv -subledgerid,customerprofileid,tiername,expirydate -SUB1,alexa,Gold,2024-03-21T07:32:14Z -,george,Silver,2025-04-16T21:12:37Z -SUB2,avocado,Bronze,2026-05-03T11:47:01Z -``` - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* 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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 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 = 'up_file_example' # str | The file containing the data that is being imported. (optional) - - try: - # Import customers into loyalty tiers - api_response = api_instance.import_loyalty_customers_tiers(loyalty_program_id, up_file=up_file) - print("The response of ManagementApi->import_loyalty_customers_tiers:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->import_loyalty_customers_tiers: %s\n" % e) -``` - - - -### Parameters - - -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. | - **up_file** | **str**| The file containing the data that is being imported. | [optional] - -### Return type - -[**ModelImport**](ModelImport.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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) - -Import loyalty points - -Upload a CSV file containing the loyalty points you want to import into a given loyalty program. -Send the file as multipart data. - -Depending on the type of loyalty program, you can import points into a given customer profile or loyalty card. - -The CSV file contains the following columns: - -- `customerprofileid` (optional): For profile-based loyalty programs, the integration ID of the customer profile where the loyalty points are imported. - - **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. -- `identifier` (optional): For card-based loyalty programs, the identifier of the loyalty card where the loyalty points are imported. -- `amount`: The amount of points to award to the customer profile. -- `startdate` (optional): The earliest date when the points can be redeemed. The points are `active` from this date until the expiration date. - - This parameter accepts one of the following values: - - A timestamp string in RFC3339 format. - - `immediate` - - `on_action` - - **Note**: - Empty or missing values default to `immediate`. -- `expirydate` (optional): The latest date when the points can be redeemed. The points are `expired` after this date. - - **Note**: It must be an RFC3339 timestamp string or string `unlimited`. Empty or missing values are considered `unlimited`. - - If passed, `validityDuration` should be omitted. -- `validityDuration` (optional): The duration for which the points remain active, relative to the - activation date. - - 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. - - If passed, `expirydate` should be omitted. -- `subledgerid` (optional): The ID of the subledger that should received the points. -- `reason` (optional): The reason why these points are awarded. - -You can use the time zone of your choice. It is converted to UTC internally by Talon.One. - -**Note:** For existing customer profiles and loyalty cards, the imported points are added to any previous active or pending points, depending on the -value provided for `startdate`. If `startdate` matches the current date, the imported points are _active_. If it is later, the points are _pending_ until -the date provided for `startdate` is reached. - -**Note:** We recommend limiting your file size to 500MB. - -**Example for profile-based programs:** - -```text -customerprofileid,amount,startdate,expirydate,subledgerid,reason -URNGV8294NV,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement -``` - -**Example for card-based programs:** - -```text -identifier,amount,startdate,expirydate,subledgerid,reason -summer-loyalty-card-0543,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement -``` - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* 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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. - notifications_enabled = True # bool | Indicates whether the points import triggers notifications about its effects. For example, a notification is sent if the import upgrades a customer's tier or offsets their negative points balance. This parameter is optional and defaults to `true`. (optional) - up_file = 'up_file_example' # str | The file containing the data that is being imported. (optional) - - try: - # Import loyalty points - api_response = api_instance.import_loyalty_points(loyalty_program_id, notifications_enabled=notifications_enabled, up_file=up_file) - print("The response of ManagementApi->import_loyalty_points:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->import_loyalty_points: %s\n" % e) -``` - - - -### Parameters - - -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. | - **notifications_enabled** | **bool**| Indicates whether the points import triggers notifications about its effects. For example, a notification is sent if the import upgrades a customer's tier or offsets their negative points balance. This parameter is optional and defaults to `true`. | [optional] - **up_file** | **str**| The file containing the data that is being imported. | [optional] - -### Return type - -[**ModelImport**](ModelImport.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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_pool_giveaways** -> ModelImport import_pool_giveaways(pool_id, up_file=up_file) - -Import giveaway codes into a giveaway pool - -Upload a CSV file containing the giveaway codes that should be created. Send the file as multipart data. - -The CSV file contains the following columns: -- `code` (required): The code of your giveaway, for instance, a gift card redemption code. -- `startdate`: The start date in RFC3339 of the code redemption period. -- `enddate`: The last date in RFC3339 of the code redemption period. -- `attributes`: A JSON object describing _custom_ giveaway attribute names and their values, enclosed with double quotation marks. - - For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) - called `provider` associated with the giveaway entity, the object in the CSV file, when opened in a text editor, must be: `"{"provider": "myPartnerCompany"}"`. - -The `startdate` and `enddate` have nothing to do with the _validity_ of the codes. They are only used by the Rule Engine to award the codes or not. -You can use the time zone setting of your choice. The values are converted to UTC internally by Talon.One. - -**Note:** - -- We recommend limiting your file size to 500MB. -- You can import the same code multiple times. Duplicate codes are treated and distributed to customers as unique codes. - -**Example:** - -```text -code,startdate,enddate,attributes -GIVEAWAY1,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,"{""provider"": ""Amazon""}" -GIVEAWAY2,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,"{""provider"": ""Amazon""}" -GIVEAWAY3,2021-01-10T23:00:00Z,2022-11-11T23:00:00Z,"{""provider"": ""Aliexpress""}" -``` - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* 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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - pool_id = 56 # int | The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. - up_file = 'up_file_example' # str | The file containing the data that is being imported. (optional) - - try: - # Import giveaway codes into a giveaway pool - api_response = api_instance.import_pool_giveaways(pool_id, up_file=up_file) - print("The response of ManagementApi->import_pool_giveaways:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->import_pool_giveaways: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pool_id** | **int**| The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. | - **up_file** | **str**| The file containing the data that is being imported. | [optional] - -### Return type - -[**ModelImport**](ModelImport.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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_referrals** -> ModelImport import_referrals(application_id, campaign_id, up_file=up_file) - -Import referrals - -Upload a CSV file containing the referrals that should be created. -The file should be sent as multipart data. - -The CSV file contains the following columns: - -- `code` (required): The referral code. -- `advocateprofileintegrationid` (required): The profile ID of the advocate. -- `startdate`: The start date in RFC3339 of the code redemption period. -- `expirydate`: The end date in RFC3339 of the code redemption period. -- `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. -- `attributes`: A JSON object describing _custom_ referral attribute names and their values, enclosed with double quotation marks. - - For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) - called `category` associated with the referral entity, the object in the CSV file, when opened in a text editor, must be: `"{"category": "10_off"}"`. - -You can use the time zone of your choice. It is converted to UTC internally by Talon.One. - -**Important:** When you import a CSV file with referrals, a [customer profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles) -is **not** automatically created for each `advocateprofileintegrationid` column value. Use the [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) -endpoint or the [Update multiple customer profiles](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfilesV2) -endpoint to create the customer profiles. - -**Note:** We recommend limiting your file size to 500MB. - -**Example:** - -```text -code,startdate,expirydate,advocateprofileintegrationid,limitval,attributes -REFERRAL_CODE1,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid_4,1,"{""my_attribute"": ""10_off""}" -REFERRAL_CODE2,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid1,1,"{""my_attribute"": ""20_off""}" -``` - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* 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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - up_file = 'up_file_example' # str | The file containing the data that is being imported. (optional) - - try: - # Import referrals - api_response = api_instance.import_referrals(application_id, campaign_id, up_file=up_file) - print("The response of ManagementApi->import_referrals:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->import_referrals: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **up_file** | **str**| The file containing the data that is being imported. | [optional] - -### Return type - -[**ModelImport**](ModelImport.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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) - -# **invite_user_external** -> invite_user_external(new_external_invitation) - -Invite user from identity provider - -[Invite a user](https://docs.talon.one/docs/product/account/account-settings/managing-users#inviting-a-user) from an external identity provider to Talon.One by sending an invitation to their email address. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.new_external_invitation import NewExternalInvitation -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - new_external_invitation = talon_one.NewExternalInvitation() # NewExternalInvitation | body - - try: - # Invite user from identity provider - api_instance.invite_user_external(new_external_invitation) - except Exception as e: - print("Exception when calling ManagementApi->invite_user_external: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **new_external_invitation** | [**NewExternalInvitation**](NewExternalInvitation.md)| body | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | Invitation email sent | - | - -[[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_account_collections** -> ListAccountCollections200Response list_account_collections(page_size=page_size, skip=skip, sort=sort, with_total_result_size=with_total_result_size, name=name) - -List collections in account - -List account-level collections in the account. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.list_account_collections200_response import ListAccountCollections200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - with_total_result_size = True # bool | When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - name = 'name_example' # str | Filter by collection name. (optional) - - try: - # List collections in account - api_response = api_instance.list_account_collections(page_size=page_size, skip=skip, sort=sort, with_total_result_size=with_total_result_size, name=name) - print("The response of ManagementApi->list_account_collections:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->list_account_collections: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **with_total_result_size** | **bool**| When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. | [optional] - **name** | **str**| Filter by collection name. | [optional] - -### Return type - -[**ListAccountCollections200Response**](ListAccountCollections200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | -**401** | Unauthorized | - | -**404** | Not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **list_achievements** -> ListAchievements200Response list_achievements(application_id, campaign_id, page_size=page_size, skip=skip, title=title) - -List achievements - -List all the achievements for a specific campaign. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.list_achievements200_response import ListAchievements200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - 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 for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. (optional) - - try: - # List achievements - api_response = api_instance.list_achievements(application_id, campaign_id, page_size=page_size, skip=skip, title=title) - print("The response of ManagementApi->list_achievements:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->list_achievements: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **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 for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. | [optional] - -### Return type - -[**ListAchievements200Response**](ListAchievements200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **list_all_roles_v2** -> ListAllRolesV2200Response list_all_roles_v2() - -List roles - -List all roles. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.list_all_roles_v2200_response import ListAllRolesV2200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - - try: - # List roles - api_response = api_instance.list_all_roles_v2() - print("The response of ManagementApi->list_all_roles_v2:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->list_all_roles_v2: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**ListAllRolesV2200Response**](ListAllRolesV2200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **list_campaign_store_budget_limits** -> ListCampaignStoreBudgetLimits200Response list_campaign_store_budget_limits(application_id, campaign_id, action=action, period=period) - -List campaign store budget limits - -Return the store budget limits for a given campaign. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.list_campaign_store_budget_limits200_response import ListCampaignStoreBudgetLimits200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - action = 'action_example' # str | The action that this budget is limiting. (optional) - period = 'period_example' # str | The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. (optional) - - try: - # List campaign store budget limits - api_response = api_instance.list_campaign_store_budget_limits(application_id, campaign_id, action=action, period=period) - print("The response of ManagementApi->list_campaign_store_budget_limits:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->list_campaign_store_budget_limits: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **action** | **str**| The action that this budget is limiting. | [optional] - **period** | **str**| The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. | [optional] - -### Return type - -[**ListCampaignStoreBudgetLimits200Response**](ListCampaignStoreBudgetLimits200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | -**401** | Unauthorized - Invalid API key | - | -**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) - -# **list_catalog_items** -> ListCatalogItems200Response list_catalog_items(catalog_id, page_size=page_size, skip=skip, with_total_result_size=with_total_result_size, sku=sku, product_names=product_names) - -List items in a catalog - -Return a paginated list of cart items in the given catalog. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.list_catalog_items200_response import ListCatalogItems200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - catalog_id = 56 # int | The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - with_total_result_size = True # bool | When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - sku = ['sku_example'] # List[str] | Filter results by one or more SKUs. Must be exact match. (optional) - product_names = ['product_names_example'] # List[str] | Filter results by one or more product names. Must be exact match. (optional) - - try: - # List items in a catalog - api_response = api_instance.list_catalog_items(catalog_id, page_size=page_size, skip=skip, with_total_result_size=with_total_result_size, sku=sku, product_names=product_names) - print("The response of ManagementApi->list_catalog_items:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->list_catalog_items: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **catalog_id** | **int**| The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **with_total_result_size** | **bool**| When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. | [optional] - **sku** | [**List[str]**](str.md)| Filter results by one or more SKUs. Must be exact match. | [optional] - **product_names** | [**List[str]**](str.md)| Filter results by one or more product names. Must be exact match. | [optional] - -### Return type - -[**ListCatalogItems200Response**](ListCatalogItems200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **list_collections** -> ListAccountCollections200Response list_collections(application_id, campaign_id, page_size=page_size, skip=skip, sort=sort, with_total_result_size=with_total_result_size, name=name) - -List collections in campaign - -List collections in a given campaign. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.list_account_collections200_response import ListAccountCollections200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - with_total_result_size = True # bool | When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - name = 'name_example' # str | Filter by collection name. (optional) - - try: - # List collections in campaign - api_response = api_instance.list_collections(application_id, campaign_id, page_size=page_size, skip=skip, sort=sort, with_total_result_size=with_total_result_size, name=name) - print("The response of ManagementApi->list_collections:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->list_collections: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **with_total_result_size** | **bool**| When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. | [optional] - **name** | **str**| Filter by collection name. | [optional] - -### Return type - -[**ListAccountCollections200Response**](ListAccountCollections200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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) - -# **list_collections_in_application** -> ListAccountCollections200Response list_collections_in_application(application_id, page_size=page_size, skip=skip, sort=sort, with_total_result_size=with_total_result_size, name=name) - -List collections in Application - -List campaign-level collections from all campaigns in a given Application. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.list_account_collections200_response import ListAccountCollections200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - with_total_result_size = True # bool | When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - name = 'name_example' # str | Filter by collection name. (optional) - - try: - # List collections in Application - api_response = api_instance.list_collections_in_application(application_id, page_size=page_size, skip=skip, sort=sort, with_total_result_size=with_total_result_size, name=name) - print("The response of ManagementApi->list_collections_in_application:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->list_collections_in_application: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **with_total_result_size** | **bool**| When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. | [optional] - **name** | **str**| Filter by collection name. | [optional] - -### Return type - -[**ListAccountCollections200Response**](ListAccountCollections200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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) - -# **list_stores** -> ListStores200Response list_stores(application_id, page_size=page_size, skip=skip, sort=sort, with_total_result_size=with_total_result_size, campaign_id=campaign_id, name=name, integration_id=integration_id, query=query) - -List stores - -List all stores for a specific Application. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.list_stores200_response import ListStores200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - with_total_result_size = True # bool | When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - campaign_id = 3.4 # float | Filter results by campaign ID. (optional) - name = 'name_example' # str | The name of the store. (optional) - integration_id = 'integration_id_example' # str | The integration ID of the store. (optional) - query = 'query_example' # str | Filter results by `name` or `integrationId`. (optional) - - try: - # List stores - api_response = api_instance.list_stores(application_id, page_size=page_size, skip=skip, sort=sort, with_total_result_size=with_total_result_size, campaign_id=campaign_id, name=name, integration_id=integration_id, query=query) - print("The response of ManagementApi->list_stores:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->list_stores: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **with_total_result_size** | **bool**| When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. | [optional] - **campaign_id** | **float**| Filter results by campaign ID. | [optional] - **name** | **str**| The name of the store. | [optional] - **integration_id** | **str**| The integration ID of the store. | [optional] - **query** | **str**| Filter results by `name` or `integrationId`. | [optional] - -### Return type - -[**ListStores200Response**](ListStores200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **okta_event_handler_challenge** -> okta_event_handler_challenge() - -Validate Okta API ownership - -Validate the ownership of the API through a challenge-response mechanism. - -This challenger endpoint is used by Okta to confirm that communication between Talon.One and Okta is correctly configured and accessible -for provisioning and deprovisioning of Talon.One users, and that only Talon.One can receive and respond to events from Okta. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - - try: - # Validate Okta API ownership - api_instance.okta_event_handler_challenge() - except Exception as e: - print("Exception when calling ManagementApi->okta_event_handler_challenge: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **remove_loyalty_points** -> remove_loyalty_points(loyalty_program_id, integration_id, deduct_loyalty_points) - -Deduct points from customer profile - -Deduct points from the specified loyalty program and specified customer profile. - -**Important:** -- Only active points can be deducted. -- Only pending points are rolled back when a session is cancelled or reopened. - -To get the `integrationId` of the profile from a `sessionId`, use the -[Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.deduct_loyalty_points import DeductLoyaltyPoints -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 = 'loyalty_program_id_example' # str | The identifier for the loyalty program. - 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. - deduct_loyalty_points = talon_one.DeductLoyaltyPoints() # DeductLoyaltyPoints | body - - try: - # Deduct points from customer profile - api_instance.remove_loyalty_points(loyalty_program_id, integration_id, deduct_loyalty_points) - except Exception as e: - print("Exception when calling ManagementApi->remove_loyalty_points: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **str**| The identifier for the loyalty program. | - **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. | - **deduct_loyalty_points** | [**DeductLoyaltyPoints**](DeductLoyaltyPoints.md)| body | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**204** | No Content | - | -**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) - -# **reset_password** -> NewPassword reset_password(new_password) - -Reset password - -Consumes the supplied password reset token and updates the password for -the associated account. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.new_password import NewPassword -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - new_password = talon_one.NewPassword() # NewPassword | body - - try: - # Reset password - api_response = api_instance.reset_password(new_password) - print("The response of ManagementApi->reset_password:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->reset_password: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **new_password** | [**NewPassword**](NewPassword.md)| body | - -### Return type - -[**NewPassword**](NewPassword.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**204** | Created | - | - -[[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) - -# **scim_create_group** -> ScimGroup scim_create_group(scim_base_group) - -Create SCIM group - -Create a new Talon.One group using the SCIM Group provisioning protocol with an identity provider, for example, Microsoft Entra ID, and assign members from the payload to the new group. -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. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.scim_base_group import ScimBaseGroup -from talon_one.models.scim_group import ScimGroup -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - scim_base_group = talon_one.ScimBaseGroup() # ScimBaseGroup | body - - try: - # Create SCIM group - api_response = api_instance.scim_create_group(scim_base_group) - print("The response of ManagementApi->scim_create_group:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->scim_create_group: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **scim_base_group** | [**ScimBaseGroup**](ScimBaseGroup.md)| body | - -### Return type - -[**ScimGroup**](ScimGroup.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**201** | Created | - | - -[[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) - -# **scim_create_user** -> ScimUser scim_create_user(scim_new_user) - -Create SCIM user - -Create a new Talon.One user using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.scim_new_user import ScimNewUser -from talon_one.models.scim_user import ScimUser -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - scim_new_user = talon_one.ScimNewUser() # ScimNewUser | body - - try: - # Create SCIM user - api_response = api_instance.scim_create_user(scim_new_user) - print("The response of ManagementApi->scim_create_user:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->scim_create_user: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **scim_new_user** | [**ScimNewUser**](ScimNewUser.md)| body | - -### Return type - -[**ScimUser**](ScimUser.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**201** | Created | - | - -[[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) - -# **scim_delete_group** -> scim_delete_group(group_id) - -Delete SCIM group - -Delete a specific group created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. -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. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - group_id = 56 # int | The ID of the group. - - try: - # Delete SCIM group - api_instance.scim_delete_group(group_id) - except Exception as e: - print("Exception when calling ManagementApi->scim_delete_group: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **group_id** | **int**| The ID of the group. | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | No Content | - | - -[[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) - -# **scim_delete_user** -> scim_delete_user(user_id) - -Delete SCIM user - -Delete a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://yourbaseurl.talon.one -# See configuration.py for a list of all supported configuration parameters. -configuration = talon_one.Configuration( - host = "https://yourbaseurl.talon.one" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - user_id = 56 # int | The ID of the user. - - try: - # Delete SCIM user - api_instance.scim_delete_user(user_id) - except Exception as e: - print("Exception when calling ManagementApi->scim_delete_user: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user_id** | **int**| The ID of the user. | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | No Content | - | - -[[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) - -# **scim_get_group** -> ScimGroup scim_get_group(group_id) - -Get SCIM group - -Retrieve data for a specific group created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. -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. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.scim_group import ScimGroup -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - group_id = 56 # int | The ID of the group. - - try: - # Get SCIM group - api_response = api_instance.scim_get_group(group_id) - print("The response of ManagementApi->scim_get_group:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->scim_get_group: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **group_id** | **int**| The ID of the group. | - -### Return type - -[**ScimGroup**](ScimGroup.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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** | Group details | - | - -[[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) - -# **scim_get_groups** -> ScimGroupsListResponse scim_get_groups() - -List SCIM groups - -Retrieve a paginated list of groups created using the SCIM protocol with an identity provider, for example, Microsoft Entra ID. -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. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.scim_groups_list_response import ScimGroupsListResponse -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - - try: - # List SCIM groups - api_response = api_instance.scim_get_groups() - print("The response of ManagementApi->scim_get_groups:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->scim_get_groups: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**ScimGroupsListResponse**](ScimGroupsListResponse.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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** | List of SCIM groups | - | - -[[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) - -# **scim_get_resource_types** -> ScimResourceTypesListResponse scim_get_resource_types() - -List supported SCIM resource types - -Retrieve a list of resource types supported by the SCIM provisioning protocol. - -Resource types define the various kinds of resources that can be managed via the SCIM API, such as users, groups, or custom-defined resources. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.scim_resource_types_list_response import ScimResourceTypesListResponse -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - - try: - # List supported SCIM resource types - api_response = api_instance.scim_get_resource_types() - print("The response of ManagementApi->scim_get_resource_types:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->scim_get_resource_types: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**ScimResourceTypesListResponse**](ScimResourceTypesListResponse.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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** | List of resource types | - | - -[[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) - -# **scim_get_schemas** -> ScimSchemasListResponse scim_get_schemas() - -List supported SCIM schemas - -Retrieve a list of schemas supported by the SCIM provisioning protocol. - -Schemas define the structure and attributes of the different resources that can be managed via the SCIM API, such as users, groups, and any custom-defined resources. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.scim_schemas_list_response import ScimSchemasListResponse -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - - try: - # List supported SCIM schemas - api_response = api_instance.scim_get_schemas() - print("The response of ManagementApi->scim_get_schemas:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->scim_get_schemas: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**ScimSchemasListResponse**](ScimSchemasListResponse.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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** | List of schemas supported by the SCIM provisioning protocol | - | - -[[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) - -# **scim_get_service_provider_config** -> ScimServiceProviderConfigResponse scim_get_service_provider_config() - -Get SCIM service provider configuration - -Retrieve the configuration settings of the SCIM service provider. It provides details about the features and capabilities supported by the SCIM API, such as the different operation settings. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.scim_service_provider_config_response import ScimServiceProviderConfigResponse -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - - try: - # Get SCIM service provider configuration - api_response = api_instance.scim_get_service_provider_config() - print("The response of ManagementApi->scim_get_service_provider_config:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->scim_get_service_provider_config: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**ScimServiceProviderConfigResponse**](ScimServiceProviderConfigResponse.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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** | Service configuration | - | - -[[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) - -# **scim_get_user** -> ScimUser scim_get_user(user_id) - -Get SCIM user - -Retrieve data for a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.scim_user import ScimUser -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - user_id = 56 # int | The ID of the user. - - try: - # Get SCIM user - api_response = api_instance.scim_get_user(user_id) - print("The response of ManagementApi->scim_get_user:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->scim_get_user: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user_id** | **int**| The ID of the user. | - -### Return type - -[**ScimUser**](ScimUser.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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** | User details | - | - -[[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) - -# **scim_get_users** -> ScimUsersListResponse scim_get_users() - -List SCIM users - -Retrieve a paginated list of users that have been provisioned using the SCIM protocol with an identity provider, for example, Microsoft Entra ID. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.scim_users_list_response import ScimUsersListResponse -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - - try: - # List SCIM users - api_response = api_instance.scim_get_users() - print("The response of ManagementApi->scim_get_users:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->scim_get_users: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**ScimUsersListResponse**](ScimUsersListResponse.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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** | List of SCIM users | - | - -[[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) - -# **scim_patch_group** -> ScimGroup scim_patch_group(group_id, scim_patch_request) - -Update SCIM group attributes - -Update certain attributes of a group created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. This endpoint allows for selective adding, removing, or replacing of specific group attributes while other attributes remain unchanged. -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. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.scim_group import ScimGroup -from talon_one.models.scim_patch_request import ScimPatchRequest -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - group_id = 56 # int | The ID of the group. - scim_patch_request = talon_one.ScimPatchRequest() # ScimPatchRequest | body - - try: - # Update SCIM group attributes - api_response = api_instance.scim_patch_group(group_id, scim_patch_request) - print("The response of ManagementApi->scim_patch_group:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->scim_patch_group: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **group_id** | **int**| The ID of the group. | - **scim_patch_request** | [**ScimPatchRequest**](ScimPatchRequest.md)| body | - -### Return type - -[**ScimGroup**](ScimGroup.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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** | Group details | - | - -[[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) - -# **scim_patch_user** -> ScimUser scim_patch_user(user_id, scim_patch_request) - -Update SCIM user attributes - -Update certain attributes of a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. - -This endpoint allows for selective adding, removing, or replacing specific attributes while leaving other attributes unchanged. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.scim_patch_request import ScimPatchRequest -from talon_one.models.scim_user import ScimUser -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - user_id = 56 # int | The ID of the user. - scim_patch_request = talon_one.ScimPatchRequest() # ScimPatchRequest | body - - try: - # Update SCIM user attributes - api_response = api_instance.scim_patch_user(user_id, scim_patch_request) - print("The response of ManagementApi->scim_patch_user:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->scim_patch_user: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user_id** | **int**| The ID of the user. | - **scim_patch_request** | [**ScimPatchRequest**](ScimPatchRequest.md)| body | - -### Return type - -[**ScimUser**](ScimUser.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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** | User details | - | - -[[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) - -# **scim_replace_group_attributes** -> ScimGroup scim_replace_group_attributes(group_id, scim_base_group) - -Update SCIM group - -Update the details of a specific group created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. This endpoint replaces all attributes of the given group with the attributes provided in the request payload. -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. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.scim_base_group import ScimBaseGroup -from talon_one.models.scim_group import ScimGroup -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - group_id = 56 # int | The ID of the group. - scim_base_group = talon_one.ScimBaseGroup() # ScimBaseGroup | body - - try: - # Update SCIM group - api_response = api_instance.scim_replace_group_attributes(group_id, scim_base_group) - print("The response of ManagementApi->scim_replace_group_attributes:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->scim_replace_group_attributes: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **group_id** | **int**| The ID of the group. | - **scim_base_group** | [**ScimBaseGroup**](ScimBaseGroup.md)| body | - -### Return type - -[**ScimGroup**](ScimGroup.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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** | Group details | - | - -[[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) - -# **scim_replace_user_attributes** -> ScimUser scim_replace_user_attributes(user_id, scim_new_user) - -Update SCIM user - -Update the details of a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. - -This endpoint replaces all attributes of the specific user with the attributes provided in the request payload. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.scim_new_user import ScimNewUser -from talon_one.models.scim_user import ScimUser -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - user_id = 56 # int | The ID of the user. - scim_new_user = talon_one.ScimNewUser() # ScimNewUser | body - - try: - # Update SCIM user - api_response = api_instance.scim_replace_user_attributes(user_id, scim_new_user) - print("The response of ManagementApi->scim_replace_user_attributes:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->scim_replace_user_attributes: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user_id** | **int**| The ID of the user. | - **scim_new_user** | [**ScimNewUser**](ScimNewUser.md)| body | - -### Return type - -[**ScimUser**](ScimUser.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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** | User details | - | - -[[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) - -# **search_coupons_advanced_application_wide_without_total_count** -> GetCouponsWithoutTotalCount200Response search_coupons_advanced_application_wide_without_total_count(application_id, body, page_size=page_size, skip=skip, sort=sort, value=value, created_before=created_before, created_after=created_after, valid=valid, usable=usable, referral_id=referral_id, recipient_integration_id=recipient_integration_id, batch_id=batch_id, exact_match=exact_match, campaign_state=campaign_state) - -List coupons that match the given attributes (without total count) - -List the coupons whose attributes match the query criteria in all the campaigns of the given Application. - -The match is successful if all the attributes of the request are found in a coupon, -even if the coupon has more attributes that are not present on the request. - -**Note:** The total count is not included in the response. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_coupons_without_total_count200_response import GetCouponsWithoutTotalCount200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - body = None # object | body - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - value = 'value_example' # str | Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - created_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - created_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - valid = 'valid_example' # str | Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) - usable = 'usable_example' # str | Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) - referral_id = 56 # int | Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - recipient_integration_id = 'recipient_integration_id_example' # str | Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field. (optional) - batch_id = 'batch_id_example' # str | Filter results by batches of coupons (optional) - exact_match = False # bool | Filter results to an exact case-insensitive matching against the coupon code. (optional) (default to False) - campaign_state = 'campaign_state_example' # str | Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) - - try: - # List coupons that match the given attributes (without total count) - api_response = api_instance.search_coupons_advanced_application_wide_without_total_count(application_id, body, page_size=page_size, skip=skip, sort=sort, value=value, created_before=created_before, created_after=created_after, valid=valid, usable=usable, referral_id=referral_id, recipient_integration_id=recipient_integration_id, batch_id=batch_id, exact_match=exact_match, campaign_state=campaign_state) - print("The response of ManagementApi->search_coupons_advanced_application_wide_without_total_count:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->search_coupons_advanced_application_wide_without_total_count: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **body** | **object**| body | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **value** | **str**| Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. | [optional] - **created_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **created_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **valid** | **str**| Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. | [optional] - **usable** | **str**| Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. | [optional] - **referral_id** | **int**| Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. | [optional] - **recipient_integration_id** | **str**| Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field. | [optional] - **batch_id** | **str**| Filter results by batches of coupons | [optional] - **exact_match** | **bool**| Filter results to an exact case-insensitive matching against the coupon code. | [optional] [default to False] - **campaign_state** | **str**| Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. | [optional] - -### Return type - -[**GetCouponsWithoutTotalCount200Response**](GetCouponsWithoutTotalCount200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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) - -# **search_coupons_advanced_without_total_count** -> GetCouponsWithoutTotalCount200Response search_coupons_advanced_without_total_count(application_id, campaign_id, body, page_size=page_size, skip=skip, sort=sort, value=value, created_before=created_before, created_after=created_after, valid=valid, usable=usable, referral_id=referral_id, recipient_integration_id=recipient_integration_id, exact_match=exact_match, batch_id=batch_id) - -List coupons that match the given attributes in campaign (without total count) - -List the coupons whose attributes match the query criteria -in the given campaign. - -The match is successful if all the attributes of the request are found in a coupon, -even if the coupon has more attributes that are not present on the request. - -**Note:** The total count is not included in the response. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.get_coupons_without_total_count200_response import GetCouponsWithoutTotalCount200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - body = None # object | body - page_size = 1000 # int | The number of items in the response. (optional) (default to 1000) - skip = 56 # int | The number of items to skip when paging through large result sets. (optional) - 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) - value = 'value_example' # str | Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - created_before = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - created_after = '2013-10-20T19:20:30+01:00' # datetime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - valid = 'valid_example' # str | Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) - usable = 'usable_example' # str | Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) - referral_id = 56 # int | Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - recipient_integration_id = 'recipient_integration_id_example' # str | Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field. (optional) - exact_match = False # bool | Filter results to an exact case-insensitive matching against the coupon code. (optional) (default to False) - batch_id = 'batch_id_example' # str | Filter results by batches of coupons (optional) - - try: - # List coupons that match the given attributes in campaign (without total count) - api_response = api_instance.search_coupons_advanced_without_total_count(application_id, campaign_id, body, page_size=page_size, skip=skip, sort=sort, value=value, created_before=created_before, created_after=created_after, valid=valid, usable=usable, referral_id=referral_id, recipient_integration_id=recipient_integration_id, exact_match=exact_match, batch_id=batch_id) - print("The response of ManagementApi->search_coupons_advanced_without_total_count:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->search_coupons_advanced_without_total_count: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **body** | **object**| body | - **page_size** | **int**| The number of items in the response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **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] - **value** | **str**| Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. | [optional] - **created_before** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **created_after** | **datetime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **valid** | **str**| Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. | [optional] - **usable** | **str**| Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. | [optional] - **referral_id** | **int**| Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. | [optional] - **recipient_integration_id** | **str**| Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field. | [optional] - **exact_match** | **bool**| Filter results to an exact case-insensitive matching against the coupon code. | [optional] [default to False] - **batch_id** | **str**| Filter results by batches of coupons | [optional] - -### Return type - -[**GetCouponsWithoutTotalCount200Response**](GetCouponsWithoutTotalCount200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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) - -# **summarize_campaign_store_budget** -> SummarizeCampaignStoreBudget200Response summarize_campaign_store_budget(application_id, campaign_id) - -Get summary of campaign store budgets - -Fetch a summary of all store budget information for a given campaign. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.summarize_campaign_store_budget200_response import SummarizeCampaignStoreBudget200Response -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - - try: - # Get summary of campaign store budgets - api_response = api_instance.summarize_campaign_store_budget(application_id, campaign_id) - print("The response of ManagementApi->summarize_campaign_store_budget:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->summarize_campaign_store_budget: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - -### Return type - -[**SummarizeCampaignStoreBudget200Response**](SummarizeCampaignStoreBudget200Response.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad request | - | -**401** | Unauthorized - Invalid API key | - | -**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) - -# **transfer_loyalty_card** -> transfer_loyalty_card(loyalty_program_id, loyalty_card_id, transfer_loyalty_card) - -Transfer card data - -Transfer loyalty card data, such as linked customers, loyalty balances and transactions, from a given loyalty card to a new, automatically created loyalty card. - -**Important:** - -- The original card is automatically blocked once the new card is created, and it cannot be activated again. -- The default status of the new card is _active_. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.transfer_loyalty_card import TransferLoyaltyCard -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. - loyalty_card_id = 'loyalty_card_id_example' # str | Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. - transfer_loyalty_card = talon_one.TransferLoyaltyCard() # TransferLoyaltyCard | body - - try: - # Transfer card data - api_instance.transfer_loyalty_card(loyalty_program_id, loyalty_card_id, transfer_loyalty_card) - except Exception as e: - print("Exception when calling ManagementApi->transfer_loyalty_card: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **int**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | - **loyalty_card_id** | **str**| Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. | - **transfer_loyalty_card** | [**TransferLoyaltyCard**](TransferLoyaltyCard.md)| body | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | -|-------------|-------------|------------------| -**204** | No Content | - | -**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) - -# **update_account_collection** -> Collection update_account_collection(collection_id, update_collection) - -Update account-level collection - -Edit the description of a given account-level collection and enable or disable the collection in the specified Applications. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.collection import Collection -from talon_one.models.update_collection import UpdateCollection -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - collection_id = 56 # int | The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. - update_collection = talon_one.UpdateCollection() # UpdateCollection | body - - try: - # Update account-level collection - api_response = api_instance.update_account_collection(collection_id, update_collection) - print("The response of ManagementApi->update_account_collection:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->update_account_collection: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **collection_id** | **int**| The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. | - **update_collection** | [**UpdateCollection**](UpdateCollection.md)| body | - -### Return type - -[**Collection**](Collection.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | -**409** | Conflict. A collection with this name already exists. | - | - -[[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) - -# **update_achievement** -> Achievement update_achievement(application_id, campaign_id, achievement_id, update_achievement) - -Update achievement - -Update the details of a specific achievement. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.achievement import Achievement -from talon_one.models.update_achievement import UpdateAchievement -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - achievement_id = 56 # int | The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. - update_achievement = talon_one.UpdateAchievement() # UpdateAchievement | body - - try: - # Update achievement - api_response = api_instance.update_achievement(application_id, campaign_id, achievement_id, update_achievement) - print("The response of ManagementApi->update_achievement:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->update_achievement: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **achievement_id** | **int**| The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. | - **update_achievement** | [**UpdateAchievement**](UpdateAchievement.md)| body | - -### Return type - -[**Achievement**](Achievement.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | -**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) - -# **update_additional_cost** -> AccountAdditionalCost update_additional_cost(additional_cost_id, new_additional_cost) - -Update additional cost - -Updates an existing additional cost. Once created, the only property of an additional cost that cannot be changed is the `name` property (or **API name** in the Campaign Manager). This restriction is in place to prevent accidentally breaking live integrations. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.account_additional_cost import AccountAdditionalCost -from talon_one.models.new_additional_cost import NewAdditionalCost -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - additional_cost_id = 56 # int | The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. - new_additional_cost = talon_one.NewAdditionalCost() # NewAdditionalCost | body - - try: - # Update additional cost - api_response = api_instance.update_additional_cost(additional_cost_id, new_additional_cost) - print("The response of ManagementApi->update_additional_cost:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->update_additional_cost: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **additional_cost_id** | **int**| The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. | - **new_additional_cost** | [**NewAdditionalCost**](NewAdditionalCost.md)| body | - -### Return type - -[**AccountAdditionalCost**](AccountAdditionalCost.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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) - -# **update_attribute** -> Attribute update_attribute(attribute_id, new_attribute) - -Update custom attribute - -Update an existing custom attribute. Once created, the only property of a custom attribute that can be -changed is the description. - -To change the `type` or `name` property of a custom attribute, create a new attribute and -update any relevant integrations and rules to use the new attribute. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.attribute import Attribute -from talon_one.models.new_attribute import NewAttribute -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - attribute_id = 56 # int | The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. - new_attribute = talon_one.NewAttribute() # NewAttribute | body - - try: - # Update custom attribute - api_response = api_instance.update_attribute(attribute_id, new_attribute) - print("The response of ManagementApi->update_attribute:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->update_attribute: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **attribute_id** | **int**| The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. | - **new_attribute** | [**NewAttribute**](NewAttribute.md)| body | - -### Return type - -[**Attribute**](Attribute.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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) - -# **update_campaign** -> Campaign update_campaign(application_id, campaign_id, update_campaign) - -Update campaign - -Update the given campaign. - -**Important:** You cannot use this endpoint to update campaigns if [campaign staging and revisions](https://docs.talon.one/docs/product/applications/managing-general-settings#campaign-staging-and-revisions) is enabled for your Application. - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.campaign import Campaign -from talon_one.models.update_campaign import UpdateCampaign -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - update_campaign = talon_one.UpdateCampaign() # UpdateCampaign | body - - try: - # Update campaign - api_response = api_instance.update_campaign(application_id, campaign_id, update_campaign) - print("The response of ManagementApi->update_campaign:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->update_campaign: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **update_campaign** | [**UpdateCampaign**](UpdateCampaign.md)| body | - -### Return type - -[**Campaign**](Campaign.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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) - -# **update_collection** -> Collection update_collection(application_id, campaign_id, collection_id, update_campaign_collection) - -Update campaign-level collection's description - -Edit the description of a given campaign-level collection. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.collection import Collection -from talon_one.models.update_campaign_collection import UpdateCampaignCollection -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - collection_id = 56 # int | The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. - update_campaign_collection = talon_one.UpdateCampaignCollection() # UpdateCampaignCollection | body - - try: - # Update campaign-level collection's description - api_response = api_instance.update_collection(application_id, campaign_id, collection_id, update_campaign_collection) - print("The response of ManagementApi->update_collection:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->update_collection: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **collection_id** | **int**| The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. | - **update_campaign_collection** | [**UpdateCampaignCollection**](UpdateCampaignCollection.md)| body | - -### Return type - -[**Collection**](Collection.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | -**401** | Unauthorized | - | - -[[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) - -# **update_coupon** -> Coupon update_coupon(application_id, campaign_id, coupon_id, update_coupon) - -Update coupon - -Update the specified coupon. - -
-

Important

- -

With this PUT endpoint, if you do not explicitly set a value for the startDate, expiryDate, and recipientIntegrationId properties in your request, it is automatically set to null.

- -
- - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.coupon import Coupon -from talon_one.models.update_coupon import UpdateCoupon -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - coupon_id = 'coupon_id_example' # str | The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. - update_coupon = talon_one.UpdateCoupon() # UpdateCoupon | body - - try: - # Update coupon - api_response = api_instance.update_coupon(application_id, campaign_id, coupon_id, update_coupon) - print("The response of ManagementApi->update_coupon:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->update_coupon: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **coupon_id** | **str**| The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. | - **update_coupon** | [**UpdateCoupon**](UpdateCoupon.md)| body | - -### Return type - -[**Coupon**](Coupon.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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) - -# **update_coupon_batch** -> update_coupon_batch(application_id, campaign_id, update_coupon_batch) - -Update coupons - -Update all coupons or a specific batch of coupons in the given campaign. -You can find the `batchId` on the **Coupons** page of your campaign -in the Campaign Manager, or you can use [List coupons](#operation/getCouponsWithoutTotalCount). - -
-

Important

- - - -
- -To update a specific coupon, use [Update coupon](#operation/updateCoupon). - - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.update_coupon_batch import UpdateCouponBatch -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - update_coupon_batch = talon_one.UpdateCouponBatch() # UpdateCouponBatch | body - - try: - # Update coupons - api_instance.update_coupon_batch(application_id, campaign_id, update_coupon_batch) - except Exception as e: - print("Exception when calling ManagementApi->update_coupon_batch: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **update_coupon_batch** | [**UpdateCouponBatch**](UpdateCouponBatch.md)| body | - -### Return type - -void (empty response body) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | No Content | - | - -[[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) - -# **update_loyalty_card** -> LoyaltyCard update_loyalty_card(loyalty_program_id, loyalty_card_id, update_loyalty_card_request) - -Update loyalty card - -Update the details of a specific loyalty card. You can set the card's status to `active` or `inactive` through this endpoint. At least one of `status` or `attributes` must be provided. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.loyalty_card import LoyaltyCard -from talon_one.models.update_loyalty_card_request import UpdateLoyaltyCardRequest -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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 card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. - loyalty_card_id = 'loyalty_card_id_example' # str | Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. - update_loyalty_card_request = talon_one.UpdateLoyaltyCardRequest() # UpdateLoyaltyCardRequest | body - - try: - # Update loyalty card - api_response = api_instance.update_loyalty_card(loyalty_program_id, loyalty_card_id, update_loyalty_card_request) - print("The response of ManagementApi->update_loyalty_card:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->update_loyalty_card: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loyalty_program_id** | **int**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | - **loyalty_card_id** | **str**| Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. | - **update_loyalty_card_request** | [**UpdateLoyaltyCardRequest**](UpdateLoyaltyCardRequest.md)| body | - -### Return type - -[**LoyaltyCard**](LoyaltyCard.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | -**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) - -# **update_referral** -> Referral update_referral(application_id, campaign_id, referral_id, update_referral) - -Update referral - -Update the specified referral. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.referral import Referral -from talon_one.models.update_referral import UpdateReferral -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - campaign_id = 56 # int | The ID of the campaign. It is displayed in your Talon.One deployment URL. - referral_id = 'referral_id_example' # str | The ID of the referral code. - update_referral = talon_one.UpdateReferral() # UpdateReferral | body - - try: - # Update referral - api_response = api_instance.update_referral(application_id, campaign_id, referral_id, update_referral) - print("The response of ManagementApi->update_referral:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->update_referral: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **campaign_id** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | - **referral_id** | **str**| The ID of the referral code. | - **update_referral** | [**UpdateReferral**](UpdateReferral.md)| body | - -### Return type - -[**Referral**](Referral.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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) - -# **update_role_v2** -> RoleV2 update_role_v2(role_id, role_v2_base) - -Update role - -Update a specific role. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.role_v2 import RoleV2 -from talon_one.models.role_v2_base import RoleV2Base -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - role_id = 56 # int | The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. - role_v2_base = talon_one.RoleV2Base() # RoleV2Base | body - - try: - # Update role - api_response = api_instance.update_role_v2(role_id, role_v2_base) - print("The response of ManagementApi->update_role_v2:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->update_role_v2: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **role_id** | **int**| The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. | - **role_v2_base** | [**RoleV2Base**](RoleV2Base.md)| body | - -### Return type - -[**RoleV2**](RoleV2.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | - -[[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) - -# **update_store** -> Store update_store(application_id, store_id, new_store) - -Update store - -Update store details for a specific store ID. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.new_store import NewStore -from talon_one.models.store import Store -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# Configure API key authorization: api_key_v1 -configuration.api_key['api_key_v1'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_v1'] = 'Bearer' - -# Enter a context with an instance of the API client -with talon_one.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = talon_one.ManagementApi(api_client) - application_id = 56 # int | The ID of the Application. It is displayed in your Talon.One deployment URL. - store_id = 'store_id_example' # str | The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. - new_store = talon_one.NewStore() # NewStore | body - - try: - # Update store - api_response = api_instance.update_store(application_id, store_id, new_store) - print("The response of ManagementApi->update_store:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->update_store: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **store_id** | **str**| The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. | - **new_store** | [**NewStore**](NewStore.md)| body | - -### Return type - -[**Store**](Store.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [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 | - | -**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) - -# **update_user** -> User update_user(user_id, update_user) - -Update user - -Update the details of a specific user. - -### Example - -* Api Key Authentication (management_key): -* Api Key Authentication (manager_auth): -* Api Key Authentication (api_key_v1): - -```python -import talon_one -from talon_one.models.update_user import UpdateUser -from talon_one.models.user import User -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: management_key -configuration.api_key['management_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['management_key'] = 'Bearer' - -# Configure API key authorization: manager_auth -configuration.api_key['manager_auth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['manager_auth'] = 'Bearer' - -# 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) - user_id = 56 # int | The ID of the user. - update_user = talon_one.UpdateUser() # UpdateUser | body - - try: - # Update user - api_response = api_instance.update_user(user_id, update_user) - print("The response of ManagementApi->update_user:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManagementApi->update_user: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user_id** | **int**| The ID of the user. | - **update_user** | [**UpdateUser**](UpdateUser.md)| body | - -### Return type - -[**User**](User.md) - -### Authorization - -[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details + - **Accept**: Not defined -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/NewExperiment.md b/docs/NewExperiment.md index aab9792..8ef9cb1 100644 --- a/docs/NewExperiment.md +++ b/docs/NewExperiment.md @@ -5,9 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**is_variant_assignment_external** | **bool** | The source of the assignment. - false - The assignment to the variant is handled internally by the Talon.Oneandled internally by the Talon.One. - true - The assignment to the variant handled externally. | -**activated** | **datetime** | The date and time the experiment was activated. | [optional] -**state** | **str** | A disabled experiment is not evaluated for rules or coupons. | [optional] [default to 'disabled'] +**is_variant_assignment_external** | **bool** | The source of the assignment. - false - The variant assignment is handled internally by Talon.One. - true - The variant assignment is handled externally. | **campaign** | [**NewCampaign**](NewCampaign.md) | | ## Example diff --git a/docs/PriceHistoryRequest.md b/docs/PriceHistoryRequest.md new file mode 100644 index 0000000..d5be4f4 --- /dev/null +++ b/docs/PriceHistoryRequest.md @@ -0,0 +1,31 @@ +# PriceHistoryRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sku** | **str** | The SKU of the item for which the historical prices are being retrieved. | +**start_date** | **datetime** | The start date of the period for which historical prices should be retrieved. | +**end_date** | **datetime** | The end date of the period for which historical prices should be retrieved. | + +## Example + +```python +from talon_one.models.price_history_request import PriceHistoryRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of PriceHistoryRequest from a JSON string +price_history_request_instance = PriceHistoryRequest.from_json(json) +# print the JSON string representation of the object +print(PriceHistoryRequest.to_json()) + +# convert the object into a dict +price_history_request_dict = price_history_request_instance.to_dict() +# create an instance of PriceHistoryRequest from a dict +price_history_request_from_dict = PriceHistoryRequest.from_dict(price_history_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PriceHistoryResponse.md b/docs/PriceHistoryResponse.md new file mode 100644 index 0000000..09d5e00 --- /dev/null +++ b/docs/PriceHistoryResponse.md @@ -0,0 +1,30 @@ +# PriceHistoryResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sku** | **str** | The SKU of the item for which historical prices should be retrieved. | +**history** | [**List[History]**](History.md) | | + +## Example + +```python +from talon_one.models.price_history_response import PriceHistoryResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of PriceHistoryResponse from a JSON string +price_history_response_instance = PriceHistoryResponse.from_json(json) +# print the JSON string representation of the object +print(PriceHistoryResponse.to_json()) + +# convert the object into a dict +price_history_response_dict = price_history_response_instance.to_dict() +# create an instance of PriceHistoryResponse from a dict +price_history_response_from_dict = PriceHistoryResponse.from_dict(price_history_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/PrismaticConfig.md b/docs/PrismaticConfig.md deleted file mode 100644 index 1a7d916..0000000 --- a/docs/PrismaticConfig.md +++ /dev/null @@ -1,31 +0,0 @@ -# PrismaticConfig - -Config used for accessing integrations in Prismatic - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**prismatic_url** | **str** | The url used to integrate the Prismatic Marketplace. | -**access_token** | **str** | Access token used to authenticate a user in Talon.One. | - -## Example - -```python -from talon_one.models.prismatic_config import PrismaticConfig - -# TODO update the JSON string below -json = "{}" -# create an instance of PrismaticConfig from a JSON string -prismatic_config_instance = PrismaticConfig.from_json(json) -# print the JSON string representation of the object -print(PrismaticConfig.to_json()) - -# convert the object into a dict -prismatic_config_dict = prismatic_config_instance.to_dict() -# create an instance of PrismaticConfig from a dict -prismatic_config_from_dict = PrismaticConfig.from_dict(prismatic_config_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/PrismaticEventPayloadCouponBasedNotificationsLimits.md b/docs/PrismaticEventPayloadCouponBasedNotificationsLimits.md deleted file mode 100644 index e4725ff..0000000 --- a/docs/PrismaticEventPayloadCouponBasedNotificationsLimits.md +++ /dev/null @@ -1,32 +0,0 @@ -# PrismaticEventPayloadCouponBasedNotificationsLimits - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**action** | **str** | | -**limit** | **float** | | -**period** | **str** | | [optional] -**entities** | **List[str]** | | - -## Example - -```python -from talon_one.models.prismatic_event_payload_coupon_based_notifications_limits import PrismaticEventPayloadCouponBasedNotificationsLimits - -# TODO update the JSON string below -json = "{}" -# create an instance of PrismaticEventPayloadCouponBasedNotificationsLimits from a JSON string -prismatic_event_payload_coupon_based_notifications_limits_instance = PrismaticEventPayloadCouponBasedNotificationsLimits.from_json(json) -# print the JSON string representation of the object -print(PrismaticEventPayloadCouponBasedNotificationsLimits.to_json()) - -# convert the object into a dict -prismatic_event_payload_coupon_based_notifications_limits_dict = prismatic_event_payload_coupon_based_notifications_limits_instance.to_dict() -# create an instance of PrismaticEventPayloadCouponBasedNotificationsLimits from a dict -prismatic_event_payload_coupon_based_notifications_limits_from_dict = PrismaticEventPayloadCouponBasedNotificationsLimits.from_dict(prismatic_event_payload_coupon_based_notifications_limits_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/PrismaticEventPayloadLoyaltyProfileBasedNotification.md b/docs/PrismaticEventPayloadLoyaltyProfileBasedNotification.md deleted file mode 100644 index 27f32ec..0000000 --- a/docs/PrismaticEventPayloadLoyaltyProfileBasedNotification.md +++ /dev/null @@ -1,43 +0,0 @@ -# PrismaticEventPayloadLoyaltyProfileBasedNotification - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**profile_integration_id** | **str** | | -**loyalty_program_id** | **int** | | -**subledger_id** | **str** | | -**source_of_event** | **str** | | -**employee_name** | **str** | | [optional] -**user_id** | **int** | | [optional] -**current_points** | **float** | | -**actions** | [**List[PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction]**](PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md) | | [optional] -**published_at** | **datetime** | Timestamp when the event was published. | -**current_tier** | **str** | | [optional] -**old_tier** | **str** | | [optional] -**tier_expiration_date** | **datetime** | | [optional] -**timestamp_of_tier_change** | **datetime** | | [optional] -**points_required_to_the_next_tier** | **float** | | [optional] -**next_tier** | **str** | | [optional] - -## Example - -```python -from talon_one.models.prismatic_event_payload_loyalty_profile_based_notification import PrismaticEventPayloadLoyaltyProfileBasedNotification - -# TODO update the JSON string below -json = "{}" -# create an instance of PrismaticEventPayloadLoyaltyProfileBasedNotification from a JSON string -prismatic_event_payload_loyalty_profile_based_notification_instance = PrismaticEventPayloadLoyaltyProfileBasedNotification.from_json(json) -# print the JSON string representation of the object -print(PrismaticEventPayloadLoyaltyProfileBasedNotification.to_json()) - -# convert the object into a dict -prismatic_event_payload_loyalty_profile_based_notification_dict = prismatic_event_payload_loyalty_profile_based_notification_instance.to_dict() -# create an instance of PrismaticEventPayloadLoyaltyProfileBasedNotification from a dict -prismatic_event_payload_loyalty_profile_based_notification_from_dict = PrismaticEventPayloadLoyaltyProfileBasedNotification.from_dict(prismatic_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/PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification.md b/docs/PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification.md deleted file mode 100644 index 82d0731..0000000 --- a/docs/PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification.md +++ /dev/null @@ -1,37 +0,0 @@ -# PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**profile_integration_id** | **str** | | -**loyalty_program_id** | **int** | | -**subledger_id** | **str** | | -**source_of_event** | **str** | | -**employee_name** | **str** | | [optional] -**user_id** | **int** | | [optional] -**current_points** | **float** | | -**actions** | [**List[PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction]**](PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md) | | [optional] -**published_at** | **datetime** | Timestamp when the event was published. | - -## Example - -```python -from talon_one.models.prismatic_event_payload_loyalty_profile_based_points_changed_notification import PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification - -# TODO update the JSON string below -json = "{}" -# create an instance of PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification from a JSON string -prismatic_event_payload_loyalty_profile_based_points_changed_notification_instance = PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification.from_json(json) -# print the JSON string representation of the object -print(PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification.to_json()) - -# convert the object into a dict -prismatic_event_payload_loyalty_profile_based_points_changed_notification_dict = prismatic_event_payload_loyalty_profile_based_points_changed_notification_instance.to_dict() -# create an instance of PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification from a dict -prismatic_event_payload_loyalty_profile_based_points_changed_notification_from_dict = PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification.from_dict(prismatic_event_payload_loyalty_profile_based_points_changed_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/PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md b/docs/PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md deleted file mode 100644 index f9a4621..0000000 --- a/docs/PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md +++ /dev/null @@ -1,33 +0,0 @@ -# PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**amount** | **float** | | -**reason** | **str** | | [optional] -**operation** | **str** | | -**start_date** | **datetime** | | [optional] -**expiry_date** | **datetime** | | [optional] - -## Example - -```python -from talon_one.models.prismatic_event_payload_loyalty_profile_based_points_changed_notification_action import PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction - -# TODO update the JSON string below -json = "{}" -# create an instance of PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction from a JSON string -prismatic_event_payload_loyalty_profile_based_points_changed_notification_action_instance = PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.from_json(json) -# print the JSON string representation of the object -print(PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.to_json()) - -# convert the object into a dict -prismatic_event_payload_loyalty_profile_based_points_changed_notification_action_dict = prismatic_event_payload_loyalty_profile_based_points_changed_notification_action_instance.to_dict() -# create an instance of PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction from a dict -prismatic_event_payload_loyalty_profile_based_points_changed_notification_action_from_dict = PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.from_dict(prismatic_event_payload_loyalty_profile_based_points_changed_notification_action_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md b/docs/PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md deleted file mode 100644 index 9328510..0000000 --- a/docs/PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md +++ /dev/null @@ -1,38 +0,0 @@ -# PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**profile_integration_id** | **str** | | -**loyalty_program_id** | **int** | | -**subledger_id** | **str** | | -**source_of_event** | **str** | | -**current_tier** | **str** | | [optional] -**current_points** | **float** | | -**old_tier** | **str** | | [optional] -**tier_expiration_date** | **datetime** | | [optional] -**timestamp_of_tier_change** | **datetime** | | [optional] -**published_at** | **datetime** | Timestamp when the event was published. | - -## Example - -```python -from talon_one.models.prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification import PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification - -# TODO update the JSON string below -json = "{}" -# create an instance of PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification from a JSON string -prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification_instance = PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification.from_json(json) -# print the JSON string representation of the object -print(PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification.to_json()) - -# convert the object into a dict -prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification_dict = prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification_instance.to_dict() -# create an instance of PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification from a dict -prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification_from_dict = PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification.from_dict(prismatic_event_payload_loyalty_profile_based_tier_downgrade_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/PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md b/docs/PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md deleted file mode 100644 index 7bcf0a2..0000000 --- a/docs/PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md +++ /dev/null @@ -1,40 +0,0 @@ -# PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**profile_integration_id** | **str** | | -**loyalty_program_id** | **int** | | -**subledger_id** | **str** | | -**source_of_event** | **str** | | -**current_tier** | **str** | | [optional] -**current_points** | **float** | | -**old_tier** | **str** | | [optional] -**points_required_to_the_next_tier** | **float** | | [optional] -**next_tier** | **str** | | [optional] -**tier_expiration_date** | **datetime** | | [optional] -**timestamp_of_tier_change** | **datetime** | | [optional] -**published_at** | **datetime** | Timestamp when the event was published. | - -## Example - -```python -from talon_one.models.prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification import PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification - -# TODO update the JSON string below -json = "{}" -# create an instance of PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification from a JSON string -prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification_instance = PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification.from_json(json) -# print the JSON string representation of the object -print(PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification.to_json()) - -# convert the object into a dict -prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification_dict = prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification_instance.to_dict() -# create an instance of PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification from a dict -prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification_from_dict = PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification.from_dict(prismatic_event_payload_loyalty_profile_based_tier_upgrade_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/PrismaticFlowConfig.md b/docs/PrismaticFlowConfig.md deleted file mode 100644 index 9892899..0000000 --- a/docs/PrismaticFlowConfig.md +++ /dev/null @@ -1,32 +0,0 @@ -# PrismaticFlowConfig - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**api_key** | **str** | | -**worker_count** | **int** | Number of Prismatic workers to run in parallel for this flow (maximum 500). | [optional] [default to 10] -**max_events_per_message** | **int** | Maximum number of events to send in a single message to Prismatic. | [optional] [default to 1000] -**max_retries** | **int** | Maximum number of retries for a Prismatic event before it is ignored. | [optional] [default to 10] - -## Example - -```python -from talon_one.models.prismatic_flow_config import PrismaticFlowConfig - -# TODO update the JSON string below -json = "{}" -# create an instance of PrismaticFlowConfig from a JSON string -prismatic_flow_config_instance = PrismaticFlowConfig.from_json(json) -# print the JSON string representation of the object -print(PrismaticFlowConfig.to_json()) - -# convert the object into a dict -prismatic_flow_config_dict = prismatic_flow_config_instance.to_dict() -# create an instance of PrismaticFlowConfig from a dict -prismatic_flow_config_from_dict = PrismaticFlowConfig.from_dict(prismatic_flow_config_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/PrismaticFlowConfigResponse.md b/docs/PrismaticFlowConfigResponse.md deleted file mode 100644 index 10ea9d5..0000000 --- a/docs/PrismaticFlowConfigResponse.md +++ /dev/null @@ -1,31 +0,0 @@ -# PrismaticFlowConfigResponse - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**worker_count** | **int** | Number of Prismatic workers to run in parallel for this flow (maximum 500). | [optional] -**max_events_per_message** | **int** | Maximum number of events to send in a single message to Prismatic. | [optional] -**max_retries** | **int** | Maximum number of retries for a Prismatic event before it is ignored. | [optional] - -## Example - -```python -from talon_one.models.prismatic_flow_config_response import PrismaticFlowConfigResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of PrismaticFlowConfigResponse from a JSON string -prismatic_flow_config_response_instance = PrismaticFlowConfigResponse.from_json(json) -# print the JSON string representation of the object -print(PrismaticFlowConfigResponse.to_json()) - -# convert the object into a dict -prismatic_flow_config_response_dict = prismatic_flow_config_response_instance.to_dict() -# create an instance of PrismaticFlowConfigResponse from a dict -prismatic_flow_config_response_from_dict = PrismaticFlowConfigResponse.from_dict(prismatic_flow_config_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/PrismaticFlowResponse.md b/docs/PrismaticFlowResponse.md deleted file mode 100644 index 601098a..0000000 --- a/docs/PrismaticFlowResponse.md +++ /dev/null @@ -1,33 +0,0 @@ -# PrismaticFlowResponse - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | ID of the prismatic flow. | -**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. | -**prismatic_flow_url** | **str** | The URL of the prismatic flow that we want to trigger for the event. | -**config** | [**PrismaticFlowConfigResponse**](PrismaticFlowConfigResponse.md) | | - -## Example - -```python -from talon_one.models.prismatic_flow_response import PrismaticFlowResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of PrismaticFlowResponse from a JSON string -prismatic_flow_response_instance = PrismaticFlowResponse.from_json(json) -# print the JSON string representation of the object -print(PrismaticFlowResponse.to_json()) - -# convert the object into a dict -prismatic_flow_response_dict = prismatic_flow_response_instance.to_dict() -# create an instance of PrismaticFlowResponse from a dict -prismatic_flow_response_from_dict = PrismaticFlowResponse.from_dict(prismatic_flow_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/PrismaticFlowWithConfig.md b/docs/PrismaticFlowWithConfig.md deleted file mode 100644 index 81b16ed..0000000 --- a/docs/PrismaticFlowWithConfig.md +++ /dev/null @@ -1,32 +0,0 @@ -# PrismaticFlowWithConfig - - -## Properties - -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. | -**prismatic_flow_url** | **str** | The URL of the prismatic flow that we want to trigger for the event. | -**config** | [**PrismaticFlowConfig**](PrismaticFlowConfig.md) | | - -## Example - -```python -from talon_one.models.prismatic_flow_with_config import PrismaticFlowWithConfig - -# TODO update the JSON string below -json = "{}" -# create an instance of PrismaticFlowWithConfig from a JSON string -prismatic_flow_with_config_instance = PrismaticFlowWithConfig.from_json(json) -# print the JSON string representation of the object -print(PrismaticFlowWithConfig.to_json()) - -# convert the object into a dict -prismatic_flow_with_config_dict = prismatic_flow_with_config_instance.to_dict() -# create an instance of PrismaticFlowWithConfig from a dict -prismatic_flow_with_config_from_dict = PrismaticFlowWithConfig.from_dict(prismatic_flow_with_config_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/PromoteExperiment.md b/docs/PromoteExperiment.md new file mode 100644 index 0000000..a6dd971 --- /dev/null +++ b/docs/PromoteExperiment.md @@ -0,0 +1,32 @@ +# PromoteExperiment + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**target_application_id** | **int** | The ID of the Application to copy the experiment. It is displayed in your Talon.One deployment URL. | +**variant_id** | **int** | The ID of the Experiment Variant to build the new campaign. | +**disable_experiment** | **bool** | Force disable the experiment. | [optional] +**campaign** | [**ExperimentCampaignCopy**](ExperimentCampaignCopy.md) | | + +## Example + +```python +from talon_one.models.promote_experiment import PromoteExperiment + +# TODO update the JSON string below +json = "{}" +# create an instance of PromoteExperiment from a JSON string +promote_experiment_instance = PromoteExperiment.from_json(json) +# print the JSON string representation of the object +print(PromoteExperiment.to_json()) + +# convert the object into a dict +promote_experiment_dict = promote_experiment_instance.to_dict() +# create an instance of PromoteExperiment from a dict +promote_experiment_from_dict = PromoteExperiment.from_dict(promote_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/UpdateExperiment.md b/docs/UpdateExperiment.md index 47a69b7..0be89e3 100644 --- a/docs/UpdateExperiment.md +++ b/docs/UpdateExperiment.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**is_variant_assignment_external** | **bool** | The source of the assignment. - false - The assignment to the variant is handled internally by the Talon.Oneandled internally by the Talon.One. - true - The assignment to the variant handled externally. | +**is_variant_assignment_external** | **bool** | The source of the assignment. - false - The variant assignment is handled internally by Talon.One. - true - The variant assignment is handled externally. | **campaign** | [**UpdateCampaign**](UpdateCampaign.md) | | ## Example diff --git a/docs/UpdateExperimentVariant.md b/docs/UpdateExperimentVariant.md index cc8c1c3..c51f142 100644 --- a/docs/UpdateExperimentVariant.md +++ b/docs/UpdateExperimentVariant.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | -**name** | **str** | | +**name** | **str** | The name of this variant. | **ruleset** | [**NewRuleset**](NewRuleset.md) | | **weight** | **int** | The percentage split of this variant. The sum of all variant percentages must be 100. | diff --git a/pyproject.toml b/pyproject.toml index 0cfa689..65c5753 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "talon-one-sdk" -version = "26.04" +version = "26.05" description = "Talon.One API" authors = [ {name = "OpenAPI Generator Community",email = "team@openapitools.org"}, diff --git a/setup.py b/setup.py index 3ba5acb..3a6aaf7 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ # http://pypi.python.org/pypi/setuptools NAME = "talon-one-sdk" -VERSION = "26.04" +VERSION = "26.05" # Get the long description from the README.md file here = pathlib.Path(__file__).parent.resolve() diff --git a/talon_one/__init__.py b/talon_one/__init__.py index 4aa7b27..62c0fd8 100644 --- a/talon_one/__init__.py +++ b/talon_one/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "26.04" +__version__ = "26.05" # Define package exports __all__ = [ @@ -191,7 +191,9 @@ "Coupon", "CouponConstraints", "CouponCreatedEffectProps", + "CouponCreatedEventRequest", "CouponCreationJob", + "CouponDeletedEventRequest", "CouponDeletionFilters", "CouponDeletionJob", "CouponEntity", @@ -200,6 +202,7 @@ "CouponRejectionReason", "CouponReservations", "CouponSearch", + "CouponUpdatedEventRequest", "CouponValue", "CouponWithApplication", "CouponsNotificationData", @@ -251,6 +254,9 @@ "EventV2", "EventV3", "Experiment", + "ExperimentCampaignCopy", + "ExperimentCopy", + "ExperimentCopyExperiment", "ExperimentResults", "ExperimentVariant", "ExperimentVariantAllocation", @@ -331,6 +337,7 @@ "Giveaway", "GiveawaysPool", "HiddenConditionsEffects", + "History", "IdentifiableEntity", "ImportEntity", "IncreaseAchievementProgressEffectProps", @@ -345,6 +352,21 @@ "IntegrationEventV2Response", "IntegrationEventV3Request", "IntegrationEventV3Response", + "IntegrationHubConfig", + "IntegrationHubEventPayloadCouponBasedNotifications", + "IntegrationHubEventPayloadCouponBasedNotificationsLimits", + "IntegrationHubEventPayloadLoyaltyProfileBasedNotification", + "IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification", + "IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction", + "IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification", + "IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification", + "IntegrationHubEventRecord", + "IntegrationHubFlow", + "IntegrationHubFlowConfig", + "IntegrationHubFlowConfigResponse", + "IntegrationHubFlowResponse", + "IntegrationHubFlowWithConfig", + "IntegrationHubPaginatedEventPayload", "IntegrationProfileEntity", "IntegrationProfileEntityV3", "IntegrationRequest", @@ -371,6 +393,7 @@ "ListCampaignStoreBudgets", "ListCampaignStoreBudgetsStore", "ListCatalogItems200Response", + "ListExperiments200Response", "ListStores200Response", "LoginParams", "Loyalty", @@ -392,6 +415,7 @@ "LoyaltyLedgerEntryFlags", "LoyaltyLedgerTransactions", "LoyaltyMembership", + "LoyaltyPointsChangedEventRequest", "LoyaltyProgram", "LoyaltyProgramBalance", "LoyaltyProgramEntity", @@ -399,6 +423,8 @@ "LoyaltyProgramTransaction", "LoyaltySubLedger", "LoyaltyTier", + "LoyaltyTierDowngradeEventRequest", + "LoyaltyTierUpgradeEventRequest", "ManagementKey", "ManagerConfig", "MessageLogEntries", @@ -510,24 +536,11 @@ "Picklist", "PlaceholderDetails", "PriceDetail", + "PriceHistoryRequest", + "PriceHistoryResponse", "PriceType", "PriceTypeReferenceDetail", "PriceTypeReferences", - "PrismaticConfig", - "PrismaticEventPayloadCouponBasedNotifications", - "PrismaticEventPayloadCouponBasedNotificationsLimits", - "PrismaticEventPayloadLoyaltyProfileBasedNotification", - "PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification", - "PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction", - "PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification", - "PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification", - "PrismaticEventRecord", - "PrismaticFlow", - "PrismaticFlowConfig", - "PrismaticFlowConfigResponse", - "PrismaticFlowResponse", - "PrismaticFlowWithConfig", - "PrismaticPaginatedEventPayload", "Product", "ProductSearchMatch", "ProductUnitAnalytics", @@ -535,6 +548,7 @@ "ProductUnitAnalyticsTotals", "ProfileAudiencesChanges", "ProjectedTier", + "PromoteExperiment", "RedeemReferralEffectProps", "Referral", "ReferralConstraints", @@ -868,7 +882,9 @@ from talon_one.models.coupon import Coupon as Coupon from talon_one.models.coupon_constraints import CouponConstraints as CouponConstraints from talon_one.models.coupon_created_effect_props import CouponCreatedEffectProps as CouponCreatedEffectProps +from talon_one.models.coupon_created_event_request import CouponCreatedEventRequest as CouponCreatedEventRequest from talon_one.models.coupon_creation_job import CouponCreationJob as CouponCreationJob +from talon_one.models.coupon_deleted_event_request import CouponDeletedEventRequest as CouponDeletedEventRequest from talon_one.models.coupon_deletion_filters import CouponDeletionFilters as CouponDeletionFilters from talon_one.models.coupon_deletion_job import CouponDeletionJob as CouponDeletionJob from talon_one.models.coupon_entity import CouponEntity as CouponEntity @@ -877,6 +893,7 @@ from talon_one.models.coupon_rejection_reason import CouponRejectionReason as CouponRejectionReason from talon_one.models.coupon_reservations import CouponReservations as CouponReservations from talon_one.models.coupon_search import CouponSearch as CouponSearch +from talon_one.models.coupon_updated_event_request import CouponUpdatedEventRequest as CouponUpdatedEventRequest from talon_one.models.coupon_value import CouponValue as CouponValue from talon_one.models.coupon_with_application import CouponWithApplication as CouponWithApplication from talon_one.models.coupons_notification_data import CouponsNotificationData as CouponsNotificationData @@ -928,6 +945,9 @@ from talon_one.models.event_v2 import EventV2 as EventV2 from talon_one.models.event_v3 import EventV3 as EventV3 from talon_one.models.experiment import Experiment as Experiment +from talon_one.models.experiment_campaign_copy import ExperimentCampaignCopy as ExperimentCampaignCopy +from talon_one.models.experiment_copy import ExperimentCopy as ExperimentCopy +from talon_one.models.experiment_copy_experiment import ExperimentCopyExperiment as ExperimentCopyExperiment from talon_one.models.experiment_results import ExperimentResults as ExperimentResults from talon_one.models.experiment_variant import ExperimentVariant as ExperimentVariant from talon_one.models.experiment_variant_allocation import ExperimentVariantAllocation as ExperimentVariantAllocation @@ -1008,6 +1028,7 @@ from talon_one.models.giveaway import Giveaway as Giveaway from talon_one.models.giveaways_pool import GiveawaysPool as GiveawaysPool from talon_one.models.hidden_conditions_effects import HiddenConditionsEffects as HiddenConditionsEffects +from talon_one.models.history import History as History from talon_one.models.identifiable_entity import IdentifiableEntity as IdentifiableEntity from talon_one.models.import_entity import ImportEntity as ImportEntity from talon_one.models.increase_achievement_progress_effect_props import IncreaseAchievementProgressEffectProps as IncreaseAchievementProgressEffectProps @@ -1022,6 +1043,21 @@ from talon_one.models.integration_event_v2_response import IntegrationEventV2Response as IntegrationEventV2Response from talon_one.models.integration_event_v3_request import IntegrationEventV3Request as IntegrationEventV3Request from talon_one.models.integration_event_v3_response import IntegrationEventV3Response as IntegrationEventV3Response +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_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 +from talon_one.models.integration_hub_flow_response import IntegrationHubFlowResponse as IntegrationHubFlowResponse +from talon_one.models.integration_hub_flow_with_config import IntegrationHubFlowWithConfig as IntegrationHubFlowWithConfig +from talon_one.models.integration_hub_paginated_event_payload import IntegrationHubPaginatedEventPayload as IntegrationHubPaginatedEventPayload from talon_one.models.integration_profile_entity import IntegrationProfileEntity as IntegrationProfileEntity from talon_one.models.integration_profile_entity_v3 import IntegrationProfileEntityV3 as IntegrationProfileEntityV3 from talon_one.models.integration_request import IntegrationRequest as IntegrationRequest @@ -1048,6 +1084,7 @@ from talon_one.models.list_campaign_store_budgets import ListCampaignStoreBudgets as ListCampaignStoreBudgets from talon_one.models.list_campaign_store_budgets_store import ListCampaignStoreBudgetsStore as ListCampaignStoreBudgetsStore from talon_one.models.list_catalog_items200_response import ListCatalogItems200Response as ListCatalogItems200Response +from talon_one.models.list_experiments200_response import ListExperiments200Response as ListExperiments200Response from talon_one.models.list_stores200_response import ListStores200Response as ListStores200Response from talon_one.models.login_params import LoginParams as LoginParams from talon_one.models.loyalty import Loyalty as Loyalty @@ -1069,6 +1106,7 @@ from talon_one.models.loyalty_ledger_entry_flags import LoyaltyLedgerEntryFlags as LoyaltyLedgerEntryFlags from talon_one.models.loyalty_ledger_transactions import LoyaltyLedgerTransactions as LoyaltyLedgerTransactions from talon_one.models.loyalty_membership import LoyaltyMembership as LoyaltyMembership +from talon_one.models.loyalty_points_changed_event_request import LoyaltyPointsChangedEventRequest as LoyaltyPointsChangedEventRequest from talon_one.models.loyalty_program import LoyaltyProgram as LoyaltyProgram from talon_one.models.loyalty_program_balance import LoyaltyProgramBalance as LoyaltyProgramBalance from talon_one.models.loyalty_program_entity import LoyaltyProgramEntity as LoyaltyProgramEntity @@ -1076,6 +1114,8 @@ from talon_one.models.loyalty_program_transaction import LoyaltyProgramTransaction as LoyaltyProgramTransaction from talon_one.models.loyalty_sub_ledger import LoyaltySubLedger as LoyaltySubLedger from talon_one.models.loyalty_tier import LoyaltyTier as LoyaltyTier +from talon_one.models.loyalty_tier_downgrade_event_request import LoyaltyTierDowngradeEventRequest as LoyaltyTierDowngradeEventRequest +from talon_one.models.loyalty_tier_upgrade_event_request import LoyaltyTierUpgradeEventRequest as LoyaltyTierUpgradeEventRequest from talon_one.models.management_key import ManagementKey as ManagementKey from talon_one.models.manager_config import ManagerConfig as ManagerConfig from talon_one.models.message_log_entries import MessageLogEntries as MessageLogEntries @@ -1187,24 +1227,11 @@ from talon_one.models.picklist import Picklist as Picklist from talon_one.models.placeholder_details import PlaceholderDetails as PlaceholderDetails from talon_one.models.price_detail import PriceDetail as PriceDetail +from talon_one.models.price_history_request import PriceHistoryRequest as PriceHistoryRequest +from talon_one.models.price_history_response import PriceHistoryResponse as PriceHistoryResponse from talon_one.models.price_type import PriceType as PriceType from talon_one.models.price_type_reference_detail import PriceTypeReferenceDetail as PriceTypeReferenceDetail from talon_one.models.price_type_references import PriceTypeReferences as PriceTypeReferences -from talon_one.models.prismatic_config import PrismaticConfig as PrismaticConfig -from talon_one.models.prismatic_event_payload_coupon_based_notifications import PrismaticEventPayloadCouponBasedNotifications as PrismaticEventPayloadCouponBasedNotifications -from talon_one.models.prismatic_event_payload_coupon_based_notifications_limits import PrismaticEventPayloadCouponBasedNotificationsLimits as PrismaticEventPayloadCouponBasedNotificationsLimits -from talon_one.models.prismatic_event_payload_loyalty_profile_based_notification import PrismaticEventPayloadLoyaltyProfileBasedNotification as PrismaticEventPayloadLoyaltyProfileBasedNotification -from talon_one.models.prismatic_event_payload_loyalty_profile_based_points_changed_notification import PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification as PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification -from talon_one.models.prismatic_event_payload_loyalty_profile_based_points_changed_notification_action import PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction as PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction -from talon_one.models.prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification import PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification as PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification -from talon_one.models.prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification import PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification as PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification -from talon_one.models.prismatic_event_record import PrismaticEventRecord as PrismaticEventRecord -from talon_one.models.prismatic_flow import PrismaticFlow as PrismaticFlow -from talon_one.models.prismatic_flow_config import PrismaticFlowConfig as PrismaticFlowConfig -from talon_one.models.prismatic_flow_config_response import PrismaticFlowConfigResponse as PrismaticFlowConfigResponse -from talon_one.models.prismatic_flow_response import PrismaticFlowResponse as PrismaticFlowResponse -from talon_one.models.prismatic_flow_with_config import PrismaticFlowWithConfig as PrismaticFlowWithConfig -from talon_one.models.prismatic_paginated_event_payload import PrismaticPaginatedEventPayload as PrismaticPaginatedEventPayload from talon_one.models.product import Product as Product from talon_one.models.product_search_match import ProductSearchMatch as ProductSearchMatch from talon_one.models.product_unit_analytics import ProductUnitAnalytics as ProductUnitAnalytics @@ -1212,6 +1239,7 @@ from talon_one.models.product_unit_analytics_totals import ProductUnitAnalyticsTotals as ProductUnitAnalyticsTotals from talon_one.models.profile_audiences_changes import ProfileAudiencesChanges as ProfileAudiencesChanges from talon_one.models.projected_tier import ProjectedTier as ProjectedTier +from talon_one.models.promote_experiment import PromoteExperiment as PromoteExperiment from talon_one.models.redeem_referral_effect_props import RedeemReferralEffectProps as RedeemReferralEffectProps from talon_one.models.referral import Referral as Referral from talon_one.models.referral_constraints import ReferralConstraints as ReferralConstraints diff --git a/talon_one/api/integration_api.py b/talon_one/api/integration_api.py index 3b08a26..8dae5fe 100644 --- a/talon_one/api/integration_api.py +++ b/talon_one/api/integration_api.py @@ -56,6 +56,8 @@ from talon_one.models.new_audience import NewAudience from talon_one.models.new_referral import NewReferral from talon_one.models.new_referrals_for_multiple_advocates import NewReferralsForMultipleAdvocates +from talon_one.models.price_history_request import PriceHistoryRequest +from talon_one.models.price_history_response import PriceHistoryResponse from talon_one.models.referral import Referral from talon_one.models.reopen_session_response import ReopenSessionResponse from talon_one.models.return_integration_request import ReturnIntegrationRequest @@ -7929,6 +7931,282 @@ def _link_loyalty_card_to_profile_serialize( + @validate_call + def price_history( + self, + price_history_request: Annotated[PriceHistoryRequest, Field(description="body")], + _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, + ) -> PriceHistoryResponse: + """Get summary of price history + + Fetch the historical price data for a given SKU within a defined timeframe. + + :param price_history_request: body (required) + :type price_history_request: PriceHistoryRequest + :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._price_history_serialize( + price_history_request=price_history_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PriceHistoryResponse", + } + 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 price_history_with_http_info( + self, + price_history_request: Annotated[PriceHistoryRequest, Field(description="body")], + _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[PriceHistoryResponse]: + """Get summary of price history + + Fetch the historical price data for a given SKU within a defined timeframe. + + :param price_history_request: body (required) + :type price_history_request: PriceHistoryRequest + :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._price_history_serialize( + price_history_request=price_history_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PriceHistoryResponse", + } + 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 price_history_without_preload_content( + self, + price_history_request: Annotated[PriceHistoryRequest, Field(description="body")], + _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 summary of price history + + Fetch the historical price data for a given SKU within a defined timeframe. + + :param price_history_request: body (required) + :type price_history_request: PriceHistoryRequest + :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._price_history_serialize( + price_history_request=price_history_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PriceHistoryResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _price_history_serialize( + self, + price_history_request, + _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 + # process the header parameters + # process the form parameters + # process the body parameter + if price_history_request is not None: + _body_params = price_history_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] = [ + 'management_key', + 'manager_auth', + 'api_key_v1' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/best_prior_price_history', + 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 reopen_customer_session( self, diff --git a/talon_one/api/management_api.py b/talon_one/api/management_api.py index bb0e669..e2d5504 100644 --- a/talon_one/api/management_api.py +++ b/talon_one/api/management_api.py @@ -15,137 +15,12 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from datetime import datetime -from pydantic import Field, StrictBool, StrictBytes, StrictFloat, StrictInt, StrictStr, field_validator -from typing import Any, Dict, List, Optional, Union -from typing_extensions import Annotated -from talon_one.models.account import Account -from talon_one.models.account_additional_cost import AccountAdditionalCost -from talon_one.models.account_analytics import AccountAnalytics -from talon_one.models.achievement import Achievement -from talon_one.models.activate_user_request import ActivateUserRequest -from talon_one.models.add_loyalty_points import AddLoyaltyPoints -from talon_one.models.application import Application -from talon_one.models.application_api_health import ApplicationApiHealth -from talon_one.models.application_customer import ApplicationCustomer -from talon_one.models.application_session import ApplicationSession -from talon_one.models.async_coupon_creation_response import AsyncCouponCreationResponse -from talon_one.models.async_coupon_deletion_job_response import AsyncCouponDeletionJobResponse -from talon_one.models.attribute import Attribute -from talon_one.models.campaign import Campaign -from talon_one.models.campaign_copy import CampaignCopy -from talon_one.models.campaign_group import CampaignGroup -from talon_one.models.campaign_search import CampaignSearch -from talon_one.models.collection import Collection -from talon_one.models.coupon import Coupon -from talon_one.models.create_achievement import CreateAchievement -from talon_one.models.create_coupons200_response import CreateCoupons200Response -from talon_one.models.create_template_campaign import CreateTemplateCampaign -from talon_one.models.create_template_campaign_response import CreateTemplateCampaignResponse -from talon_one.models.customer_activity_report import CustomerActivityReport -from talon_one.models.customer_analytics import CustomerAnalytics -from talon_one.models.customer_profile import CustomerProfile -from talon_one.models.customer_profile_search_query import CustomerProfileSearchQuery -from talon_one.models.deactivate_user_request import DeactivateUserRequest -from talon_one.models.deduct_loyalty_points import DeductLoyaltyPoints -from talon_one.models.delete_user_request import DeleteUserRequest -from talon_one.models.generate_coupon_rejections200_response import GenerateCouponRejections200Response -from talon_one.models.get_access_logs_without_total_count200_response import GetAccessLogsWithoutTotalCount200Response -from talon_one.models.get_additional_costs200_response import GetAdditionalCosts200Response -from talon_one.models.get_application_customer_friends200_response import GetApplicationCustomerFriends200Response -from talon_one.models.get_application_customers200_response import GetApplicationCustomers200Response -from talon_one.models.get_application_customers_by_attributes200_response import GetApplicationCustomersByAttributes200Response -from talon_one.models.get_application_event_types200_response import GetApplicationEventTypes200Response -from talon_one.models.get_application_events_without_total_count200_response import GetApplicationEventsWithoutTotalCount200Response -from talon_one.models.get_application_sessions200_response import GetApplicationSessions200Response -from talon_one.models.get_applications200_response import GetApplications200Response -from talon_one.models.get_attributes200_response import GetAttributes200Response -from talon_one.models.get_audience_memberships200_response import GetAudienceMemberships200Response -from talon_one.models.get_audiences200_response import GetAudiences200Response -from talon_one.models.get_audiences_analytics200_response import GetAudiencesAnalytics200Response -from talon_one.models.get_campaign_analytics200_response import GetCampaignAnalytics200Response -from talon_one.models.get_campaign_groups200_response import GetCampaignGroups200Response -from talon_one.models.get_campaign_templates200_response import GetCampaignTemplates200Response -from talon_one.models.get_campaigns200_response import GetCampaigns200Response -from talon_one.models.get_changes200_response import GetChanges200Response -from talon_one.models.get_collection_items200_response import GetCollectionItems200Response -from talon_one.models.get_coupons_without_total_count200_response import GetCouponsWithoutTotalCount200Response -from talon_one.models.get_customer_activity_reports_without_total_count200_response import GetCustomerActivityReportsWithoutTotalCount200Response -from talon_one.models.get_customer_profile_achievement_progress200_response import GetCustomerProfileAchievementProgress200Response -from talon_one.models.get_customer_profiles200_response import GetCustomerProfiles200Response -from talon_one.models.get_customers_by_attributes200_response import GetCustomersByAttributes200Response -from talon_one.models.get_dashboard_statistics200_response import GetDashboardStatistics200Response -from talon_one.models.get_event_types200_response import GetEventTypes200Response -from talon_one.models.get_exports200_response import GetExports200Response -from talon_one.models.get_loyalty_card_transaction_logs200_response import GetLoyaltyCardTransactionLogs200Response -from talon_one.models.get_loyalty_cards200_response import GetLoyaltyCards200Response -from talon_one.models.get_loyalty_program_profile_transactions200_response import GetLoyaltyProgramProfileTransactions200Response -from talon_one.models.get_loyalty_program_transactions200_response import GetLoyaltyProgramTransactions200Response -from talon_one.models.get_loyalty_programs200_response import GetLoyaltyPrograms200Response -from talon_one.models.get_referrals_without_total_count200_response import GetReferralsWithoutTotalCount200Response -from talon_one.models.get_rulesets200_response import GetRulesets200Response -from talon_one.models.get_users200_response import GetUsers200Response -from talon_one.models.get_webhooks200_response import GetWebhooks200Response -from talon_one.models.list_account_collections200_response import ListAccountCollections200Response -from talon_one.models.list_achievements200_response import ListAchievements200Response -from talon_one.models.list_all_roles_v2200_response import ListAllRolesV2200Response -from talon_one.models.list_campaign_store_budget_limits200_response import ListCampaignStoreBudgetLimits200Response -from talon_one.models.list_catalog_items200_response import ListCatalogItems200Response -from talon_one.models.list_stores200_response import ListStores200Response -from talon_one.models.login_params import LoginParams -from talon_one.models.loyalty_balances_with_tiers import LoyaltyBalancesWithTiers -from talon_one.models.loyalty_card import LoyaltyCard -from talon_one.models.loyalty_card_batch import LoyaltyCardBatch -from talon_one.models.loyalty_card_batch_response import LoyaltyCardBatchResponse -from talon_one.models.loyalty_dashboard_data import LoyaltyDashboardData -from talon_one.models.loyalty_ledger import LoyaltyLedger -from talon_one.models.loyalty_program import LoyaltyProgram -from talon_one.models.message_log_entries import MessageLogEntries -from talon_one.models.model_import import ModelImport -from talon_one.models.new_additional_cost import NewAdditionalCost -from talon_one.models.new_attribute import NewAttribute -from talon_one.models.new_campaign_collection import NewCampaignCollection -from talon_one.models.new_campaign_store_budget import NewCampaignStoreBudget -from talon_one.models.new_collection import NewCollection -from talon_one.models.new_coupon_creation_job import NewCouponCreationJob -from talon_one.models.new_coupon_deletion_job import NewCouponDeletionJob -from talon_one.models.new_coupons import NewCoupons -from talon_one.models.new_coupons_for_multiple_recipients import NewCouponsForMultipleRecipients -from talon_one.models.new_external_invitation import NewExternalInvitation -from talon_one.models.new_invitation import NewInvitation -from talon_one.models.new_invite_email import NewInviteEmail -from talon_one.models.new_password import NewPassword -from talon_one.models.new_password_email import NewPasswordEmail -from talon_one.models.new_store import NewStore -from talon_one.models.referral import Referral -from talon_one.models.role_v2 import RoleV2 -from talon_one.models.role_v2_base import RoleV2Base -from talon_one.models.ruleset import Ruleset -from talon_one.models.scim_base_group import ScimBaseGroup -from talon_one.models.scim_group import ScimGroup -from talon_one.models.scim_groups_list_response import ScimGroupsListResponse -from talon_one.models.scim_new_user import ScimNewUser -from talon_one.models.scim_patch_request import ScimPatchRequest -from talon_one.models.scim_resource_types_list_response import ScimResourceTypesListResponse -from talon_one.models.scim_schemas_list_response import ScimSchemasListResponse -from talon_one.models.scim_service_provider_config_response import ScimServiceProviderConfigResponse -from talon_one.models.scim_user import ScimUser -from talon_one.models.scim_users_list_response import ScimUsersListResponse -from talon_one.models.session import Session -from talon_one.models.store import Store -from talon_one.models.summarize_campaign_store_budget200_response import SummarizeCampaignStoreBudget200Response -from talon_one.models.transfer_loyalty_card import TransferLoyaltyCard -from talon_one.models.update_achievement import UpdateAchievement -from talon_one.models.update_campaign import UpdateCampaign -from talon_one.models.update_campaign_collection import UpdateCampaignCollection -from talon_one.models.update_collection import UpdateCollection -from talon_one.models.update_coupon import UpdateCoupon -from talon_one.models.update_coupon_batch import UpdateCouponBatch -from talon_one.models.update_loyalty_card_request import UpdateLoyaltyCardRequest -from talon_one.models.update_referral import UpdateReferral -from talon_one.models.update_user import UpdateUser -from talon_one.models.user import User -from talon_one.models.webhook import Webhook +from talon_one.models.coupon_created_event_request import CouponCreatedEventRequest +from talon_one.models.coupon_deleted_event_request import CouponDeletedEventRequest +from talon_one.models.coupon_updated_event_request import CouponUpdatedEventRequest +from talon_one.models.loyalty_points_changed_event_request import LoyaltyPointsChangedEventRequest +from talon_one.models.loyalty_tier_downgrade_event_request import LoyaltyTierDowngradeEventRequest +from talon_one.models.loyalty_tier_upgrade_event_request import LoyaltyTierUpgradeEventRequest from talon_one.api_client import ApiClient, RequestSerialized from talon_one.api_response import ApiResponse @@ -166,9 +41,9 @@ def __init__(self, api_client=None) -> None: @validate_call - def activate_user_by_email( + def coupon_created_event( self, - activate_user_request: Annotated[ActivateUserRequest, Field(description="body")], + coupon_created_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -182,12 +57,11 @@ def activate_user_by_email( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Enable user by email address + """Coupon Created Event - Enable a [disabled user](https://docs.talon.one/docs/product/account/account-settings/managing-users#disabling-a-user) by their email address. - :param activate_user_request: body (required) - :type activate_user_request: ActivateUserRequest + :param coupon_created_event_request: ... (required) + :type coupon_created_event_request: CouponCreatedEventRequest :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 @@ -210,8 +84,8 @@ def activate_user_by_email( :return: Returns the result object. """ # noqa: E501 - _param = self._activate_user_by_email_serialize( - activate_user_request=activate_user_request, + _param = self._coupon_created_event_serialize( + coupon_created_event_request=coupon_created_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -219,7 +93,6 @@ def activate_user_by_email( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, } response_data = self.api_client.call_api( *_param, @@ -233,9 +106,9 @@ def activate_user_by_email( @validate_call - def activate_user_by_email_with_http_info( + def coupon_created_event_with_http_info( self, - activate_user_request: Annotated[ActivateUserRequest, Field(description="body")], + coupon_created_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -249,12 +122,11 @@ def activate_user_by_email_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Enable user by email address + """Coupon Created Event - Enable a [disabled user](https://docs.talon.one/docs/product/account/account-settings/managing-users#disabling-a-user) by their email address. - :param activate_user_request: body (required) - :type activate_user_request: ActivateUserRequest + :param coupon_created_event_request: ... (required) + :type coupon_created_event_request: CouponCreatedEventRequest :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 @@ -277,8 +149,8 @@ def activate_user_by_email_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._activate_user_by_email_serialize( - activate_user_request=activate_user_request, + _param = self._coupon_created_event_serialize( + coupon_created_event_request=coupon_created_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -286,7 +158,6 @@ def activate_user_by_email_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, } response_data = self.api_client.call_api( *_param, @@ -300,9 +171,9 @@ def activate_user_by_email_with_http_info( @validate_call - def activate_user_by_email_without_preload_content( + def coupon_created_event_without_preload_content( self, - activate_user_request: Annotated[ActivateUserRequest, Field(description="body")], + coupon_created_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -316,12 +187,11 @@ def activate_user_by_email_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Enable user by email address + """Coupon Created Event - Enable a [disabled user](https://docs.talon.one/docs/product/account/account-settings/managing-users#disabling-a-user) by their email address. - :param activate_user_request: body (required) - :type activate_user_request: ActivateUserRequest + :param coupon_created_event_request: ... (required) + :type coupon_created_event_request: CouponCreatedEventRequest :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 @@ -344,8 +214,8 @@ def activate_user_by_email_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._activate_user_by_email_serialize( - activate_user_request=activate_user_request, + _param = self._coupon_created_event_serialize( + coupon_created_event_request=coupon_created_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -353,7 +223,6 @@ def activate_user_by_email_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, } response_data = self.api_client.call_api( *_param, @@ -362,9 +231,9 @@ def activate_user_by_email_without_preload_content( return response_data.response - def _activate_user_by_email_serialize( + def _coupon_created_event_serialize( self, - activate_user_request, + coupon_created_event_request, _request_auth, _content_type, _headers, @@ -390,8 +259,8 @@ def _activate_user_by_email_serialize( # process the header parameters # process the form parameters # process the body parameter - if activate_user_request is not None: - _body_params = activate_user_request + if coupon_created_event_request is not None: + _body_params = coupon_created_event_request @@ -418,7 +287,7 @@ def _activate_user_by_email_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v1/users/activate', + resource_path='/CouponCreatedEvent', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -435,11 +304,9 @@ def _activate_user_by_email_serialize( @validate_call - def add_loyalty_card_points( + def coupon_deleted_event( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - add_loyalty_points: Annotated[AddLoyaltyPoints, Field(description="body")], + coupon_deleted_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -453,16 +320,11 @@ def add_loyalty_card_points( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Add points to card + """Coupon Deleted Event - Add points to the given loyalty card in the specified card-based loyalty program. - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param add_loyalty_points: body (required) - :type add_loyalty_points: AddLoyaltyPoints + :param coupon_deleted_event_request: ... (required) + :type coupon_deleted_event_request: CouponDeletedEventRequest :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 @@ -485,10 +347,8 @@ def add_loyalty_card_points( :return: Returns the result object. """ # noqa: E501 - _param = self._add_loyalty_card_points_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - add_loyalty_points=add_loyalty_points, + _param = self._coupon_deleted_event_serialize( + coupon_deleted_event_request=coupon_deleted_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -496,10 +356,6 @@ def add_loyalty_card_points( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -513,11 +369,9 @@ def add_loyalty_card_points( @validate_call - def add_loyalty_card_points_with_http_info( + def coupon_deleted_event_with_http_info( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - add_loyalty_points: Annotated[AddLoyaltyPoints, Field(description="body")], + coupon_deleted_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -531,16 +385,11 @@ def add_loyalty_card_points_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Add points to card + """Coupon Deleted Event - Add points to the given loyalty card in the specified card-based loyalty program. - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param add_loyalty_points: body (required) - :type add_loyalty_points: AddLoyaltyPoints + :param coupon_deleted_event_request: ... (required) + :type coupon_deleted_event_request: CouponDeletedEventRequest :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 @@ -563,10 +412,8 @@ def add_loyalty_card_points_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._add_loyalty_card_points_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - add_loyalty_points=add_loyalty_points, + _param = self._coupon_deleted_event_serialize( + coupon_deleted_event_request=coupon_deleted_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -574,10 +421,6 @@ def add_loyalty_card_points_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -591,11 +434,9 @@ def add_loyalty_card_points_with_http_info( @validate_call - def add_loyalty_card_points_without_preload_content( + def coupon_deleted_event_without_preload_content( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - add_loyalty_points: Annotated[AddLoyaltyPoints, Field(description="body")], + coupon_deleted_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -609,16 +450,11 @@ def add_loyalty_card_points_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Add points to card + """Coupon Deleted Event - Add points to the given loyalty card in the specified card-based loyalty program. - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param add_loyalty_points: body (required) - :type add_loyalty_points: AddLoyaltyPoints + :param coupon_deleted_event_request: ... (required) + :type coupon_deleted_event_request: CouponDeletedEventRequest :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 @@ -641,10 +477,8 @@ def add_loyalty_card_points_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._add_loyalty_card_points_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - add_loyalty_points=add_loyalty_points, + _param = self._coupon_deleted_event_serialize( + coupon_deleted_event_request=coupon_deleted_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -652,10 +486,6 @@ def add_loyalty_card_points_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -664,11 +494,9 @@ def add_loyalty_card_points_without_preload_content( return response_data.response - def _add_loyalty_card_points_serialize( + def _coupon_deleted_event_serialize( self, - loyalty_program_id, - loyalty_card_id, - add_loyalty_points, + coupon_deleted_event_request, _request_auth, _content_type, _headers, @@ -690,25 +518,14 @@ def _add_loyalty_card_points_serialize( _body_params: Optional[bytes] = None # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - if loyalty_card_id is not None: - _path_params['loyaltyCardId'] = loyalty_card_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if add_loyalty_points is not None: - _body_params = add_loyalty_points + if coupon_deleted_event_request is not None: + _body_params = coupon_deleted_event_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: @@ -732,8 +549,8 @@ def _add_loyalty_card_points_serialize( ] return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/add_points', + method='POST', + resource_path='/CouponDeletedEvent', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -750,11 +567,9 @@ def _add_loyalty_card_points_serialize( @validate_call - def add_loyalty_points( + def coupon_updated_event( self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - 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. ")], - add_loyalty_points: Annotated[AddLoyaltyPoints, Field(description="body")], + coupon_updated_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -768,16 +583,11 @@ def add_loyalty_points( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Add points to customer profile + """Coupon Updated Event - Add points in the specified loyalty program for the given customer. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param add_loyalty_points: body (required) - :type add_loyalty_points: AddLoyaltyPoints + :param coupon_updated_event_request: ... (required) + :type coupon_updated_event_request: CouponUpdatedEventRequest :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 @@ -800,10 +610,8 @@ def add_loyalty_points( :return: Returns the result object. """ # noqa: E501 - _param = self._add_loyalty_points_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - add_loyalty_points=add_loyalty_points, + _param = self._coupon_updated_event_serialize( + coupon_updated_event_request=coupon_updated_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -811,10 +619,6 @@ def add_loyalty_points( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -828,11 +632,9 @@ def add_loyalty_points( @validate_call - def add_loyalty_points_with_http_info( + def coupon_updated_event_with_http_info( self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - 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. ")], - add_loyalty_points: Annotated[AddLoyaltyPoints, Field(description="body")], + coupon_updated_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -846,328 +648,11 @@ def add_loyalty_points_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Add points to customer profile - - Add points in the specified loyalty program for the given customer. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param add_loyalty_points: body (required) - :type add_loyalty_points: AddLoyaltyPoints - :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._add_loyalty_points_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - add_loyalty_points=add_loyalty_points, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def add_loyalty_points_without_preload_content( - self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - 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. ")], - add_loyalty_points: Annotated[AddLoyaltyPoints, Field(description="body")], - _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: - """Add points to customer profile - - Add points in the specified loyalty program for the given customer. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param add_loyalty_points: body (required) - :type add_loyalty_points: AddLoyaltyPoints - :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._add_loyalty_points_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - add_loyalty_points=add_loyalty_points, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _add_loyalty_points_serialize( - self, - loyalty_program_id, - integration_id, - add_loyalty_points, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - if integration_id is not None: - _path_params['integrationId'] = integration_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if add_loyalty_points is not None: - _body_params = add_loyalty_points - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/add_points', - 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 copy_campaign_to_applications( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - campaign_copy: Annotated[CampaignCopy, Field(description="body")], - _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, - ) -> GetCampaigns200Response: - """Copy the campaign into the specified Application - - Copy the campaign into all specified Applications. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param campaign_copy: body (required) - :type campaign_copy: CampaignCopy - :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._copy_campaign_to_applications_serialize( - application_id=application_id, - campaign_id=campaign_id, - campaign_copy=campaign_copy, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaigns200Response", - } - 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 copy_campaign_to_applications_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - campaign_copy: Annotated[CampaignCopy, Field(description="body")], - _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[GetCampaigns200Response]: - """Copy the campaign into the specified Application + """Coupon Updated Event - Copy the campaign into all specified Applications. - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param campaign_copy: body (required) - :type campaign_copy: CampaignCopy + :param coupon_updated_event_request: ... (required) + :type coupon_updated_event_request: CouponUpdatedEventRequest :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 @@ -1190,10 +675,8 @@ def copy_campaign_to_applications_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._copy_campaign_to_applications_serialize( - application_id=application_id, - campaign_id=campaign_id, - campaign_copy=campaign_copy, + _param = self._coupon_updated_event_serialize( + coupon_updated_event_request=coupon_updated_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1201,7 +684,6 @@ def copy_campaign_to_applications_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaigns200Response", } response_data = self.api_client.call_api( *_param, @@ -1215,11 +697,9 @@ def copy_campaign_to_applications_with_http_info( @validate_call - def copy_campaign_to_applications_without_preload_content( + def coupon_updated_event_without_preload_content( self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - campaign_copy: Annotated[CampaignCopy, Field(description="body")], + coupon_updated_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1233,16 +713,11 @@ def copy_campaign_to_applications_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Copy the campaign into the specified Application + """Coupon Updated Event - Copy the campaign into all specified Applications. - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param campaign_copy: body (required) - :type campaign_copy: CampaignCopy + :param coupon_updated_event_request: ... (required) + :type coupon_updated_event_request: CouponUpdatedEventRequest :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 @@ -1265,10 +740,8 @@ def copy_campaign_to_applications_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._copy_campaign_to_applications_serialize( - application_id=application_id, - campaign_id=campaign_id, - campaign_copy=campaign_copy, + _param = self._coupon_updated_event_serialize( + coupon_updated_event_request=coupon_updated_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1276,7 +749,6 @@ def copy_campaign_to_applications_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaigns200Response", } response_data = self.api_client.call_api( *_param, @@ -1285,11 +757,9 @@ def copy_campaign_to_applications_without_preload_content( return response_data.response - def _copy_campaign_to_applications_serialize( + def _coupon_updated_event_serialize( self, - application_id, - campaign_id, - campaign_copy, + coupon_updated_event_request, _request_auth, _content_type, _headers, @@ -1311,25 +781,14 @@ def _copy_campaign_to_applications_serialize( _body_params: Optional[bytes] = None # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if campaign_copy is not None: - _body_params = campaign_copy + if coupon_updated_event_request is not None: + _body_params = coupon_updated_event_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: @@ -1354,7 +813,7 @@ def _copy_campaign_to_applications_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/copy', + resource_path='/CouponUpdatedEvent', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1371,9 +830,9 @@ def _copy_campaign_to_applications_serialize( @validate_call - def create_account_collection( + def loyalty_points_changed_event( self, - new_collection: Annotated[NewCollection, Field(description="body")], + loyalty_points_changed_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1386,13 +845,12 @@ def create_account_collection( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Collection: - """Create account-level collection + ) -> None: + """Changed Loyalty Points Event - Create an account-level collection. - :param new_collection: body (required) - :type new_collection: NewCollection + :param loyalty_points_changed_event_request: ... (required) + :type loyalty_points_changed_event_request: LoyaltyPointsChangedEventRequest :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 @@ -1415,8 +873,8 @@ def create_account_collection( :return: Returns the result object. """ # noqa: E501 - _param = self._create_account_collection_serialize( - new_collection=new_collection, + _param = self._loyalty_points_changed_event_serialize( + loyalty_points_changed_event_request=loyalty_points_changed_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1424,10 +882,6 @@ def create_account_collection( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "Collection", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '409': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -1441,9 +895,9 @@ def create_account_collection( @validate_call - def create_account_collection_with_http_info( + def loyalty_points_changed_event_with_http_info( self, - new_collection: Annotated[NewCollection, Field(description="body")], + loyalty_points_changed_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1456,13 +910,12 @@ def create_account_collection_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Collection]: - """Create account-level collection + ) -> ApiResponse[None]: + """Changed Loyalty Points Event - Create an account-level collection. - :param new_collection: body (required) - :type new_collection: NewCollection + :param loyalty_points_changed_event_request: ... (required) + :type loyalty_points_changed_event_request: LoyaltyPointsChangedEventRequest :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 @@ -1485,8 +938,8 @@ def create_account_collection_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_account_collection_serialize( - new_collection=new_collection, + _param = self._loyalty_points_changed_event_serialize( + loyalty_points_changed_event_request=loyalty_points_changed_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1494,10 +947,6 @@ def create_account_collection_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "Collection", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '409': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -1511,9 +960,9 @@ def create_account_collection_with_http_info( @validate_call - def create_account_collection_without_preload_content( + def loyalty_points_changed_event_without_preload_content( self, - new_collection: Annotated[NewCollection, Field(description="body")], + loyalty_points_changed_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1527,12 +976,11 @@ def create_account_collection_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create account-level collection + """Changed Loyalty Points Event - Create an account-level collection. - :param new_collection: body (required) - :type new_collection: NewCollection + :param loyalty_points_changed_event_request: ... (required) + :type loyalty_points_changed_event_request: LoyaltyPointsChangedEventRequest :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 @@ -1555,8 +1003,8 @@ def create_account_collection_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_account_collection_serialize( - new_collection=new_collection, + _param = self._loyalty_points_changed_event_serialize( + loyalty_points_changed_event_request=loyalty_points_changed_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1564,10 +1012,6 @@ def create_account_collection_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "Collection", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '409': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -1576,9 +1020,9 @@ def create_account_collection_without_preload_content( return response_data.response - def _create_account_collection_serialize( + def _loyalty_points_changed_event_serialize( self, - new_collection, + loyalty_points_changed_event_request, _request_auth, _content_type, _headers, @@ -1604,17 +1048,10 @@ def _create_account_collection_serialize( # process the header parameters # process the form parameters # process the body parameter - if new_collection is not None: - _body_params = new_collection + if loyalty_points_changed_event_request is not None: + _body_params = loyalty_points_changed_event_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: @@ -1639,7 +1076,7 @@ def _create_account_collection_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v1/collections', + resource_path='/LoyaltyPointsChangedEvent', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1656,11 +1093,9 @@ def _create_account_collection_serialize( @validate_call - def create_achievement( + def loyalty_tier_downgrade_event( self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - create_achievement: Annotated[CreateAchievement, Field(description="body")], + loyalty_tier_downgrade_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1673,17 +1108,12 @@ def create_achievement( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Achievement: - """Create achievement + ) -> None: + """Loyalty Tier Downgrade Event - Create a new achievement in a specific campaign. - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param create_achievement: body (required) - :type create_achievement: CreateAchievement + :param loyalty_tier_downgrade_event_request: ... (required) + :type loyalty_tier_downgrade_event_request: LoyaltyTierDowngradeEventRequest :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 @@ -1706,10 +1136,8 @@ def create_achievement( :return: Returns the result object. """ # noqa: E501 - _param = self._create_achievement_serialize( - application_id=application_id, - campaign_id=campaign_id, - create_achievement=create_achievement, + _param = self._loyalty_tier_downgrade_event_serialize( + loyalty_tier_downgrade_event_request=loyalty_tier_downgrade_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1717,10 +1145,6 @@ def create_achievement( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "Achievement", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '409': None, } response_data = self.api_client.call_api( *_param, @@ -1734,11 +1158,9 @@ def create_achievement( @validate_call - def create_achievement_with_http_info( + def loyalty_tier_downgrade_event_with_http_info( self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - create_achievement: Annotated[CreateAchievement, Field(description="body")], + loyalty_tier_downgrade_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1751,17 +1173,12 @@ def create_achievement_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Achievement]: - """Create achievement + ) -> ApiResponse[None]: + """Loyalty Tier Downgrade Event - Create a new achievement in a specific campaign. - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param create_achievement: body (required) - :type create_achievement: CreateAchievement + :param loyalty_tier_downgrade_event_request: ... (required) + :type loyalty_tier_downgrade_event_request: LoyaltyTierDowngradeEventRequest :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 @@ -1784,10 +1201,8 @@ def create_achievement_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_achievement_serialize( - application_id=application_id, - campaign_id=campaign_id, - create_achievement=create_achievement, + _param = self._loyalty_tier_downgrade_event_serialize( + loyalty_tier_downgrade_event_request=loyalty_tier_downgrade_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1795,10 +1210,6 @@ def create_achievement_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "Achievement", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '409': None, } response_data = self.api_client.call_api( *_param, @@ -1812,11 +1223,9 @@ def create_achievement_with_http_info( @validate_call - def create_achievement_without_preload_content( + def loyalty_tier_downgrade_event_without_preload_content( self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - create_achievement: Annotated[CreateAchievement, Field(description="body")], + loyalty_tier_downgrade_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1830,16 +1239,11 @@ def create_achievement_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create achievement + """Loyalty Tier Downgrade Event - Create a new achievement in a specific campaign. - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param create_achievement: body (required) - :type create_achievement: CreateAchievement + :param loyalty_tier_downgrade_event_request: ... (required) + :type loyalty_tier_downgrade_event_request: LoyaltyTierDowngradeEventRequest :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 @@ -1862,10 +1266,8 @@ def create_achievement_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_achievement_serialize( - application_id=application_id, - campaign_id=campaign_id, - create_achievement=create_achievement, + _param = self._loyalty_tier_downgrade_event_serialize( + loyalty_tier_downgrade_event_request=loyalty_tier_downgrade_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1873,10 +1275,6 @@ def create_achievement_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "Achievement", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '409': None, } response_data = self.api_client.call_api( *_param, @@ -1885,11 +1283,9 @@ def create_achievement_without_preload_content( return response_data.response - def _create_achievement_serialize( + def _loyalty_tier_downgrade_event_serialize( self, - application_id, - campaign_id, - create_achievement, + loyalty_tier_downgrade_event_request, _request_auth, _content_type, _headers, @@ -1911,25 +1307,14 @@ def _create_achievement_serialize( _body_params: Optional[bytes] = None # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if create_achievement is not None: - _body_params = create_achievement + if loyalty_tier_downgrade_event_request is not None: + _body_params = loyalty_tier_downgrade_event_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: @@ -1954,7 +1339,7 @@ def _create_achievement_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/achievements', + resource_path='/LoyaltyTierDowngradeEvent', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1971,9 +1356,9 @@ def _create_achievement_serialize( @validate_call - def create_additional_cost( + def loyalty_tier_upgrade_event( self, - new_additional_cost: Annotated[NewAdditionalCost, Field(description="body")], + loyalty_tier_upgrade_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1986,13 +1371,12 @@ def create_additional_cost( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AccountAdditionalCost: - """Create additional cost + ) -> None: + """Loyalty Tier Upgrade Event - Create an [additional cost](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs). These additional costs are shared across all applications in your account, and are never required. - :param new_additional_cost: body (required) - :type new_additional_cost: NewAdditionalCost + :param loyalty_tier_upgrade_event_request: ... (required) + :type loyalty_tier_upgrade_event_request: LoyaltyTierUpgradeEventRequest :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 @@ -2015,8 +1399,8 @@ def create_additional_cost( :return: Returns the result object. """ # noqa: E501 - _param = self._create_additional_cost_serialize( - new_additional_cost=new_additional_cost, + _param = self._loyalty_tier_upgrade_event_serialize( + loyalty_tier_upgrade_event_request=loyalty_tier_upgrade_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2024,7 +1408,6 @@ def create_additional_cost( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "AccountAdditionalCost", } response_data = self.api_client.call_api( *_param, @@ -2038,9 +1421,9 @@ def create_additional_cost( @validate_call - def create_additional_cost_with_http_info( + def loyalty_tier_upgrade_event_with_http_info( self, - new_additional_cost: Annotated[NewAdditionalCost, Field(description="body")], + loyalty_tier_upgrade_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2053,13 +1436,12 @@ def create_additional_cost_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AccountAdditionalCost]: - """Create additional cost + ) -> ApiResponse[None]: + """Loyalty Tier Upgrade Event - Create an [additional cost](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs). These additional costs are shared across all applications in your account, and are never required. - :param new_additional_cost: body (required) - :type new_additional_cost: NewAdditionalCost + :param loyalty_tier_upgrade_event_request: ... (required) + :type loyalty_tier_upgrade_event_request: LoyaltyTierUpgradeEventRequest :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 @@ -2082,8 +1464,8 @@ def create_additional_cost_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_additional_cost_serialize( - new_additional_cost=new_additional_cost, + _param = self._loyalty_tier_upgrade_event_serialize( + loyalty_tier_upgrade_event_request=loyalty_tier_upgrade_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2091,7 +1473,6 @@ def create_additional_cost_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "AccountAdditionalCost", } response_data = self.api_client.call_api( *_param, @@ -2105,9 +1486,9 @@ def create_additional_cost_with_http_info( @validate_call - def create_additional_cost_without_preload_content( + def loyalty_tier_upgrade_event_without_preload_content( self, - new_additional_cost: Annotated[NewAdditionalCost, Field(description="body")], + loyalty_tier_upgrade_event_request: , _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2121,12 +1502,11 @@ def create_additional_cost_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create additional cost + """Loyalty Tier Upgrade Event - Create an [additional cost](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs). These additional costs are shared across all applications in your account, and are never required. - :param new_additional_cost: body (required) - :type new_additional_cost: NewAdditionalCost + :param loyalty_tier_upgrade_event_request: ... (required) + :type loyalty_tier_upgrade_event_request: LoyaltyTierUpgradeEventRequest :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 @@ -2149,8 +1529,8 @@ def create_additional_cost_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_additional_cost_serialize( - new_additional_cost=new_additional_cost, + _param = self._loyalty_tier_upgrade_event_serialize( + loyalty_tier_upgrade_event_request=loyalty_tier_upgrade_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2158,7 +1538,6 @@ def create_additional_cost_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "AccountAdditionalCost", } response_data = self.api_client.call_api( *_param, @@ -2167,9 +1546,9 @@ def create_additional_cost_without_preload_content( return response_data.response - def _create_additional_cost_serialize( + def _loyalty_tier_upgrade_event_serialize( self, - new_additional_cost, + loyalty_tier_upgrade_event_request, _request_auth, _content_type, _headers, @@ -2195,17 +1574,10 @@ def _create_additional_cost_serialize( # process the header parameters # process the form parameters # process the body parameter - if new_additional_cost is not None: - _body_params = new_additional_cost + if loyalty_tier_upgrade_event_request is not None: + _body_params = loyalty_tier_upgrade_event_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: @@ -2230,53985 +1602,7 @@ def _create_additional_cost_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v1/additional_costs', - 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 create_attribute( - self, - new_attribute: Annotated[NewAttribute, Field(description="body")], - _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, - ) -> Attribute: - """Create custom attribute - - Create a _custom attribute_ in this account. [Custom attributes](https://docs.talon.one/docs/dev/concepts/attributes) allow you to add data to Talon.One domain entities like campaigns, coupons, customers and so on. These attributes can then be given values when creating/updating these entities, and these values can be used in your campaign rules. For example, you could define a `zipCode` field for customer sessions, and add a rule to your campaign that only allows certain ZIP codes. These attributes are shared across all Applications in your account and are never required. - - :param new_attribute: body (required) - :type new_attribute: NewAttribute - :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._create_attribute_serialize( - new_attribute=new_attribute, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Attribute", - } - 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 create_attribute_with_http_info( - self, - new_attribute: Annotated[NewAttribute, Field(description="body")], - _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[Attribute]: - """Create custom attribute - - Create a _custom attribute_ in this account. [Custom attributes](https://docs.talon.one/docs/dev/concepts/attributes) allow you to add data to Talon.One domain entities like campaigns, coupons, customers and so on. These attributes can then be given values when creating/updating these entities, and these values can be used in your campaign rules. For example, you could define a `zipCode` field for customer sessions, and add a rule to your campaign that only allows certain ZIP codes. These attributes are shared across all Applications in your account and are never required. - - :param new_attribute: body (required) - :type new_attribute: NewAttribute - :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._create_attribute_serialize( - new_attribute=new_attribute, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Attribute", - } - 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 create_attribute_without_preload_content( - self, - new_attribute: Annotated[NewAttribute, Field(description="body")], - _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: - """Create custom attribute - - Create a _custom attribute_ in this account. [Custom attributes](https://docs.talon.one/docs/dev/concepts/attributes) allow you to add data to Talon.One domain entities like campaigns, coupons, customers and so on. These attributes can then be given values when creating/updating these entities, and these values can be used in your campaign rules. For example, you could define a `zipCode` field for customer sessions, and add a rule to your campaign that only allows certain ZIP codes. These attributes are shared across all Applications in your account and are never required. - - :param new_attribute: body (required) - :type new_attribute: NewAttribute - :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._create_attribute_serialize( - new_attribute=new_attribute, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Attribute", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_attribute_serialize( - self, - new_attribute, - _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 - # process the header parameters - # process the form parameters - # process the body parameter - if new_attribute is not None: - _body_params = new_attribute - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/attributes', - 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 create_batch_loyalty_cards( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_batch: Annotated[LoyaltyCardBatch, Field(description="body")], - _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, - ) -> LoyaltyCardBatchResponse: - """Create loyalty cards - - Create a batch of loyalty cards in a specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types). Customers can use loyalty cards to collect and spend loyalty points. **Important:** - The specified card-based loyalty program must have a defined card code format that is used to generate the loyalty card codes. - Trying to create more than 20,000 loyalty cards in a single request returns an error message with a `400` status code. - - :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 - :param loyalty_card_batch: body (required) - :type loyalty_card_batch: LoyaltyCardBatch - :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._create_batch_loyalty_cards_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_batch=loyalty_card_batch, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCardBatchResponse", - '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 create_batch_loyalty_cards_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_batch: Annotated[LoyaltyCardBatch, Field(description="body")], - _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[LoyaltyCardBatchResponse]: - """Create loyalty cards - - Create a batch of loyalty cards in a specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types). Customers can use loyalty cards to collect and spend loyalty points. **Important:** - The specified card-based loyalty program must have a defined card code format that is used to generate the loyalty card codes. - Trying to create more than 20,000 loyalty cards in a single request returns an error message with a `400` status code. - - :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 - :param loyalty_card_batch: body (required) - :type loyalty_card_batch: LoyaltyCardBatch - :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._create_batch_loyalty_cards_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_batch=loyalty_card_batch, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCardBatchResponse", - '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 create_batch_loyalty_cards_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_batch: Annotated[LoyaltyCardBatch, Field(description="body")], - _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: - """Create loyalty cards - - Create a batch of loyalty cards in a specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types). Customers can use loyalty cards to collect and spend loyalty points. **Important:** - The specified card-based loyalty program must have a defined card code format that is used to generate the loyalty card codes. - Trying to create more than 20,000 loyalty cards in a single request returns an error message with a `400` status code. - - :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 - :param loyalty_card_batch: body (required) - :type loyalty_card_batch: LoyaltyCardBatch - :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._create_batch_loyalty_cards_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_batch=loyalty_card_batch, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCardBatchResponse", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_batch_loyalty_cards_serialize( - self, - loyalty_program_id, - loyalty_card_batch, - _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 - # process the body parameter - if loyalty_card_batch is not None: - _body_params = loyalty_card_batch - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards/batch', - 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 create_campaign_from_template( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - create_template_campaign: Annotated[CreateTemplateCampaign, Field(description="body")], - _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, - ) -> CreateTemplateCampaignResponse: - """Create campaign from campaign template - - Use the campaign template referenced in the request body to create a new campaign in one of the connected Applications. If the template was created from a campaign with rules referencing [campaign collections](https://docs.talon.one/docs/product/campaigns/managing-collections), the corresponding collections for the new campaign are created automatically. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param create_template_campaign: body (required) - :type create_template_campaign: CreateTemplateCampaign - :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._create_campaign_from_template_serialize( - application_id=application_id, - create_template_campaign=create_template_campaign, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "CreateTemplateCampaignResponse", - } - 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 create_campaign_from_template_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - create_template_campaign: Annotated[CreateTemplateCampaign, Field(description="body")], - _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[CreateTemplateCampaignResponse]: - """Create campaign from campaign template - - Use the campaign template referenced in the request body to create a new campaign in one of the connected Applications. If the template was created from a campaign with rules referencing [campaign collections](https://docs.talon.one/docs/product/campaigns/managing-collections), the corresponding collections for the new campaign are created automatically. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param create_template_campaign: body (required) - :type create_template_campaign: CreateTemplateCampaign - :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._create_campaign_from_template_serialize( - application_id=application_id, - create_template_campaign=create_template_campaign, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "CreateTemplateCampaignResponse", - } - 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 create_campaign_from_template_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - create_template_campaign: Annotated[CreateTemplateCampaign, Field(description="body")], - _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: - """Create campaign from campaign template - - Use the campaign template referenced in the request body to create a new campaign in one of the connected Applications. If the template was created from a campaign with rules referencing [campaign collections](https://docs.talon.one/docs/product/campaigns/managing-collections), the corresponding collections for the new campaign are created automatically. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param create_template_campaign: body (required) - :type create_template_campaign: CreateTemplateCampaign - :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._create_campaign_from_template_serialize( - application_id=application_id, - create_template_campaign=create_template_campaign, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "CreateTemplateCampaignResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_campaign_from_template_serialize( - self, - application_id, - create_template_campaign, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if create_template_campaign is not None: - _body_params = create_template_campaign - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/applications/{applicationId}/create_campaign_from_template', - 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 create_campaign_store_budget( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_campaign_store_budget: Annotated[NewCampaignStoreBudget, Field(description="body")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Create campaign store budget - - Create a new store budget for a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_campaign_store_budget: body (required) - :type new_campaign_store_budget: NewCampaignStoreBudget - :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._create_campaign_store_budget_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_campaign_store_budget=new_campaign_store_budget, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': None, - '400': "ErrorResponse", - '409': "ErrorResponse", - } - 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 create_campaign_store_budget_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_campaign_store_budget: Annotated[NewCampaignStoreBudget, Field(description="body")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Create campaign store budget - - Create a new store budget for a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_campaign_store_budget: body (required) - :type new_campaign_store_budget: NewCampaignStoreBudget - :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._create_campaign_store_budget_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_campaign_store_budget=new_campaign_store_budget, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': None, - '400': "ErrorResponse", - '409': "ErrorResponse", - } - 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 create_campaign_store_budget_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_campaign_store_budget: Annotated[NewCampaignStoreBudget, Field(description="body")], - _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: - """Create campaign store budget - - Create a new store budget for a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_campaign_store_budget: body (required) - :type new_campaign_store_budget: NewCampaignStoreBudget - :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._create_campaign_store_budget_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_campaign_store_budget=new_campaign_store_budget, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': None, - '400': "ErrorResponse", - '409': "ErrorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_campaign_store_budget_serialize( - self, - application_id, - campaign_id, - new_campaign_store_budget, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if new_campaign_store_budget is not None: - _body_params = new_campaign_store_budget - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/stores/budgets', - 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 create_collection( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_campaign_collection: Annotated[NewCampaignCollection, Field(description="body")], - _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, - ) -> Collection: - """Create campaign-level collection - - Create a campaign-level collection in a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_campaign_collection: body (required) - :type new_campaign_collection: NewCampaignCollection - :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._create_collection_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_campaign_collection=new_campaign_collection, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Collection", - } - 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 create_collection_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_campaign_collection: Annotated[NewCampaignCollection, Field(description="body")], - _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[Collection]: - """Create campaign-level collection - - Create a campaign-level collection in a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_campaign_collection: body (required) - :type new_campaign_collection: NewCampaignCollection - :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._create_collection_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_campaign_collection=new_campaign_collection, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Collection", - } - 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 create_collection_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_campaign_collection: Annotated[NewCampaignCollection, Field(description="body")], - _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: - """Create campaign-level collection - - Create a campaign-level collection in a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_campaign_collection: body (required) - :type new_campaign_collection: NewCampaignCollection - :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._create_collection_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_campaign_collection=new_campaign_collection, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Collection", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_collection_serialize( - self, - application_id, - campaign_id, - new_campaign_collection, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if new_campaign_collection is not None: - _body_params = new_campaign_collection - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/collections', - 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 create_coupons( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_coupons: Annotated[NewCoupons, 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, - _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, - ) -> CreateCoupons200Response: - """Create coupons - - Create coupons according to some pattern. Up to 20.000 coupons can be created without a unique prefix. When a unique prefix is provided, up to 200.000 coupons can be created. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_coupons: body (required) - :type new_coupons: NewCoupons - :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 _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._create_coupons_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_coupons=new_coupons, - silent=silent, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateCoupons200Response", - '204': None, - } - 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 create_coupons_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_coupons: Annotated[NewCoupons, 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, - _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[CreateCoupons200Response]: - """Create coupons - - Create coupons according to some pattern. Up to 20.000 coupons can be created without a unique prefix. When a unique prefix is provided, up to 200.000 coupons can be created. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_coupons: body (required) - :type new_coupons: NewCoupons - :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 _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._create_coupons_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_coupons=new_coupons, - silent=silent, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateCoupons200Response", - '204': None, - } - 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 create_coupons_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_coupons: Annotated[NewCoupons, 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, - _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: - """Create coupons - - Create coupons according to some pattern. Up to 20.000 coupons can be created without a unique prefix. When a unique prefix is provided, up to 200.000 coupons can be created. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_coupons: body (required) - :type new_coupons: NewCoupons - :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 _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._create_coupons_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_coupons=new_coupons, - silent=silent, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateCoupons200Response", - '204': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_coupons_serialize( - self, - application_id, - campaign_id, - new_coupons, - silent, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - if silent is not None: - - _query_params.append(('silent', silent)) - - # process the header parameters - # process the form parameters - # process the body parameter - if new_coupons is not None: - _body_params = new_coupons - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/coupons', - 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 create_coupons_async( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_coupon_creation_job: Annotated[NewCouponCreationJob, Field(description="body")], - _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, - ) -> AsyncCouponCreationResponse: - """Create coupons asynchronously - - Create up to 5,000,000 coupons asynchronously. You should typically use this enpdoint when you create at least 20,001 coupons. You receive an email when the creation is complete. If you want to create less than 20,001 coupons, you can use the [Create coupons](https://docs.talon.one/management-api#tag/Coupons/operation/createCoupons) endpoint. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_coupon_creation_job: body (required) - :type new_coupon_creation_job: NewCouponCreationJob - :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._create_coupons_async_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_coupon_creation_job=new_coupon_creation_job, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "AsyncCouponCreationResponse", - } - 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 create_coupons_async_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_coupon_creation_job: Annotated[NewCouponCreationJob, Field(description="body")], - _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[AsyncCouponCreationResponse]: - """Create coupons asynchronously - - Create up to 5,000,000 coupons asynchronously. You should typically use this enpdoint when you create at least 20,001 coupons. You receive an email when the creation is complete. If you want to create less than 20,001 coupons, you can use the [Create coupons](https://docs.talon.one/management-api#tag/Coupons/operation/createCoupons) endpoint. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_coupon_creation_job: body (required) - :type new_coupon_creation_job: NewCouponCreationJob - :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._create_coupons_async_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_coupon_creation_job=new_coupon_creation_job, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "AsyncCouponCreationResponse", - } - 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 create_coupons_async_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_coupon_creation_job: Annotated[NewCouponCreationJob, Field(description="body")], - _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: - """Create coupons asynchronously - - Create up to 5,000,000 coupons asynchronously. You should typically use this enpdoint when you create at least 20,001 coupons. You receive an email when the creation is complete. If you want to create less than 20,001 coupons, you can use the [Create coupons](https://docs.talon.one/management-api#tag/Coupons/operation/createCoupons) endpoint. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_coupon_creation_job: body (required) - :type new_coupon_creation_job: NewCouponCreationJob - :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._create_coupons_async_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_coupon_creation_job=new_coupon_creation_job, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "AsyncCouponCreationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_coupons_async_serialize( - self, - application_id, - campaign_id, - new_coupon_creation_job, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if new_coupon_creation_job is not None: - _body_params = new_coupon_creation_job - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_async', - 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 create_coupons_deletion_job( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_coupon_deletion_job: Annotated[NewCouponDeletionJob, Field(description="body")], - _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, - ) -> AsyncCouponDeletionJobResponse: - """Creates a coupon deletion job - - This endpoint handles creating a job to delete coupons asynchronously. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_coupon_deletion_job: body (required) - :type new_coupon_deletion_job: NewCouponDeletionJob - :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._create_coupons_deletion_job_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_coupon_deletion_job=new_coupon_deletion_job, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '202': "AsyncCouponDeletionJobResponse", - } - 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 create_coupons_deletion_job_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_coupon_deletion_job: Annotated[NewCouponDeletionJob, Field(description="body")], - _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[AsyncCouponDeletionJobResponse]: - """Creates a coupon deletion job - - This endpoint handles creating a job to delete coupons asynchronously. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_coupon_deletion_job: body (required) - :type new_coupon_deletion_job: NewCouponDeletionJob - :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._create_coupons_deletion_job_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_coupon_deletion_job=new_coupon_deletion_job, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '202': "AsyncCouponDeletionJobResponse", - } - 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 create_coupons_deletion_job_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_coupon_deletion_job: Annotated[NewCouponDeletionJob, Field(description="body")], - _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: - """Creates a coupon deletion job - - This endpoint handles creating a job to delete coupons asynchronously. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_coupon_deletion_job: body (required) - :type new_coupon_deletion_job: NewCouponDeletionJob - :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._create_coupons_deletion_job_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_coupon_deletion_job=new_coupon_deletion_job, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '202': "AsyncCouponDeletionJobResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_coupons_deletion_job_serialize( - self, - application_id, - campaign_id, - new_coupon_deletion_job, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if new_coupon_deletion_job is not None: - _body_params = new_coupon_deletion_job - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_deletion_jobs', - 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 create_coupons_for_multiple_recipients( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_coupons_for_multiple_recipients: Annotated[NewCouponsForMultipleRecipients, 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, - _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, - ) -> CreateCoupons200Response: - """Create coupons for multiple recipients - - Create coupons according to some pattern for up to 1000 recipients. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_coupons_for_multiple_recipients: body (required) - :type new_coupons_for_multiple_recipients: NewCouponsForMultipleRecipients - :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 _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._create_coupons_for_multiple_recipients_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_coupons_for_multiple_recipients=new_coupons_for_multiple_recipients, - silent=silent, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateCoupons200Response", - '204': None, - } - 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 create_coupons_for_multiple_recipients_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_coupons_for_multiple_recipients: Annotated[NewCouponsForMultipleRecipients, 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, - _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[CreateCoupons200Response]: - """Create coupons for multiple recipients - - Create coupons according to some pattern for up to 1000 recipients. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_coupons_for_multiple_recipients: body (required) - :type new_coupons_for_multiple_recipients: NewCouponsForMultipleRecipients - :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 _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._create_coupons_for_multiple_recipients_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_coupons_for_multiple_recipients=new_coupons_for_multiple_recipients, - silent=silent, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateCoupons200Response", - '204': None, - } - 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 create_coupons_for_multiple_recipients_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - new_coupons_for_multiple_recipients: Annotated[NewCouponsForMultipleRecipients, 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, - _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: - """Create coupons for multiple recipients - - Create coupons according to some pattern for up to 1000 recipients. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param new_coupons_for_multiple_recipients: body (required) - :type new_coupons_for_multiple_recipients: NewCouponsForMultipleRecipients - :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 _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._create_coupons_for_multiple_recipients_serialize( - application_id=application_id, - campaign_id=campaign_id, - new_coupons_for_multiple_recipients=new_coupons_for_multiple_recipients, - silent=silent, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateCoupons200Response", - '204': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_coupons_for_multiple_recipients_serialize( - self, - application_id, - campaign_id, - new_coupons_for_multiple_recipients, - silent, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - if silent is not None: - - _query_params.append(('silent', silent)) - - # process the header parameters - # process the form parameters - # process the body parameter - if new_coupons_for_multiple_recipients is not None: - _body_params = new_coupons_for_multiple_recipients - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_with_recipients', - 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 create_invite_email( - self, - new_invite_email: Annotated[NewInviteEmail, Field(description="body")], - _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, - ) -> NewInviteEmail: - """Resend invitation email - - Resend an email invitation to an existing user. **Note:** The invitation token is valid for 24 hours after the email has been sent. - - :param new_invite_email: body (required) - :type new_invite_email: NewInviteEmail - :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._create_invite_email_serialize( - new_invite_email=new_invite_email, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "NewInviteEmail", - } - 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 create_invite_email_with_http_info( - self, - new_invite_email: Annotated[NewInviteEmail, Field(description="body")], - _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[NewInviteEmail]: - """Resend invitation email - - Resend an email invitation to an existing user. **Note:** The invitation token is valid for 24 hours after the email has been sent. - - :param new_invite_email: body (required) - :type new_invite_email: NewInviteEmail - :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._create_invite_email_serialize( - new_invite_email=new_invite_email, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "NewInviteEmail", - } - 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 create_invite_email_without_preload_content( - self, - new_invite_email: Annotated[NewInviteEmail, Field(description="body")], - _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: - """Resend invitation email - - Resend an email invitation to an existing user. **Note:** The invitation token is valid for 24 hours after the email has been sent. - - :param new_invite_email: body (required) - :type new_invite_email: NewInviteEmail - :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._create_invite_email_serialize( - new_invite_email=new_invite_email, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "NewInviteEmail", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_invite_email_serialize( - self, - new_invite_email, - _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 - # process the header parameters - # process the form parameters - # process the body parameter - if new_invite_email is not None: - _body_params = new_invite_email - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/invite_emails', - 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 create_invite_v2( - self, - new_invitation: Annotated[NewInvitation, Field(description="body")], - _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, - ) -> User: - """Invite user - - Create a new user in the account and send an invitation to their email address. **Note**: The invitation token is valid for 24 hours after the email has been sent. You can resend an invitation to a user with the [Resend invitation email](https://docs.talon.one/management-api#tag/Accounts-and-users/operation/createInviteEmail) endpoint. - - :param new_invitation: body (required) - :type new_invitation: NewInvitation - :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._create_invite_v2_serialize( - new_invitation=new_invitation, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "User", - } - 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 create_invite_v2_with_http_info( - self, - new_invitation: Annotated[NewInvitation, Field(description="body")], - _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[User]: - """Invite user - - Create a new user in the account and send an invitation to their email address. **Note**: The invitation token is valid for 24 hours after the email has been sent. You can resend an invitation to a user with the [Resend invitation email](https://docs.talon.one/management-api#tag/Accounts-and-users/operation/createInviteEmail) endpoint. - - :param new_invitation: body (required) - :type new_invitation: NewInvitation - :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._create_invite_v2_serialize( - new_invitation=new_invitation, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "User", - } - 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 create_invite_v2_without_preload_content( - self, - new_invitation: Annotated[NewInvitation, Field(description="body")], - _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: - """Invite user - - Create a new user in the account and send an invitation to their email address. **Note**: The invitation token is valid for 24 hours after the email has been sent. You can resend an invitation to a user with the [Resend invitation email](https://docs.talon.one/management-api#tag/Accounts-and-users/operation/createInviteEmail) endpoint. - - :param new_invitation: body (required) - :type new_invitation: NewInvitation - :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._create_invite_v2_serialize( - new_invitation=new_invitation, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "User", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_invite_v2_serialize( - self, - new_invitation, - _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 - # process the header parameters - # process the form parameters - # process the body parameter - if new_invitation is not None: - _body_params = new_invitation - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/invites', - 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 create_password_recovery_email( - self, - new_password_email: Annotated[NewPasswordEmail, Field(description="body")], - _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, - ) -> NewPasswordEmail: - """Request a password reset - - Send an email with a password recovery link to the email address of an existing account. **Note:** The password recovery link expires 30 minutes after this endpoint is triggered. - - :param new_password_email: body (required) - :type new_password_email: NewPasswordEmail - :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._create_password_recovery_email_serialize( - new_password_email=new_password_email, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': "NewPasswordEmail", - } - 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 create_password_recovery_email_with_http_info( - self, - new_password_email: Annotated[NewPasswordEmail, Field(description="body")], - _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[NewPasswordEmail]: - """Request a password reset - - Send an email with a password recovery link to the email address of an existing account. **Note:** The password recovery link expires 30 minutes after this endpoint is triggered. - - :param new_password_email: body (required) - :type new_password_email: NewPasswordEmail - :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._create_password_recovery_email_serialize( - new_password_email=new_password_email, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': "NewPasswordEmail", - } - 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 create_password_recovery_email_without_preload_content( - self, - new_password_email: Annotated[NewPasswordEmail, Field(description="body")], - _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: - """Request a password reset - - Send an email with a password recovery link to the email address of an existing account. **Note:** The password recovery link expires 30 minutes after this endpoint is triggered. - - :param new_password_email: body (required) - :type new_password_email: NewPasswordEmail - :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._create_password_recovery_email_serialize( - new_password_email=new_password_email, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': "NewPasswordEmail", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_password_recovery_email_serialize( - self, - new_password_email, - _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 - # process the header parameters - # process the form parameters - # process the body parameter - if new_password_email is not None: - _body_params = new_password_email - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/password_recovery_emails', - 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 create_session( - self, - login_params: Annotated[LoginParams, Field(description="body")], - _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, - ) -> Session: - """Create session - - Create a session to use the Management API endpoints. Use the value of the `token` property provided in the response as bearer token in other API calls. A token is valid for 3 months. In accordance with best pratices, use your generated token for all your API requests. Do **not** regenerate a token for each request. This endpoint has a rate limit of 3 to 6 requests per second per account, depending on your setup.

Granular API key

Instead of using a session, you can also use the Management API key feature in the Campaign Manager to decide which endpoints can be used with a given key.
- - :param login_params: body (required) - :type login_params: LoginParams - :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._create_session_serialize( - login_params=login_params, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Session", - } - 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 create_session_with_http_info( - self, - login_params: Annotated[LoginParams, Field(description="body")], - _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[Session]: - """Create session - - Create a session to use the Management API endpoints. Use the value of the `token` property provided in the response as bearer token in other API calls. A token is valid for 3 months. In accordance with best pratices, use your generated token for all your API requests. Do **not** regenerate a token for each request. This endpoint has a rate limit of 3 to 6 requests per second per account, depending on your setup.

Granular API key

Instead of using a session, you can also use the Management API key feature in the Campaign Manager to decide which endpoints can be used with a given key.
- - :param login_params: body (required) - :type login_params: LoginParams - :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._create_session_serialize( - login_params=login_params, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Session", - } - 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 create_session_without_preload_content( - self, - login_params: Annotated[LoginParams, Field(description="body")], - _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: - """Create session - - Create a session to use the Management API endpoints. Use the value of the `token` property provided in the response as bearer token in other API calls. A token is valid for 3 months. In accordance with best pratices, use your generated token for all your API requests. Do **not** regenerate a token for each request. This endpoint has a rate limit of 3 to 6 requests per second per account, depending on your setup.

Granular API key

Instead of using a session, you can also use the Management API key feature in the Campaign Manager to decide which endpoints can be used with a given key.
- - :param login_params: body (required) - :type login_params: LoginParams - :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._create_session_serialize( - login_params=login_params, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Session", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_session_serialize( - self, - login_params, - _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 - # process the header parameters - # process the form parameters - # process the body parameter - if login_params is not None: - _body_params = login_params - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/sessions', - 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 create_store( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - new_store: Annotated[NewStore, Field(description="body")], - _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, - ) -> Store: - """Create store - - Create a new store in a specific Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param new_store: body (required) - :type new_store: NewStore - :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._create_store_serialize( - application_id=application_id, - new_store=new_store, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Store", - '400': "ErrorResponse", - '409': "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 create_store_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - new_store: Annotated[NewStore, Field(description="body")], - _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[Store]: - """Create store - - Create a new store in a specific Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param new_store: body (required) - :type new_store: NewStore - :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._create_store_serialize( - application_id=application_id, - new_store=new_store, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Store", - '400': "ErrorResponse", - '409': "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 create_store_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - new_store: Annotated[NewStore, Field(description="body")], - _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: - """Create store - - Create a new store in a specific Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param new_store: body (required) - :type new_store: NewStore - :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._create_store_serialize( - application_id=application_id, - new_store=new_store, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Store", - '400': "ErrorResponse", - '409': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_store_serialize( - self, - application_id, - new_store, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if new_store is not None: - _body_params = new_store - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/applications/{applicationId}/stores', - 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 deactivate_user_by_email( - self, - deactivate_user_request: Annotated[DeactivateUserRequest, Field(description="body")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Disable user by email address - - [Disable a specific user](https://docs.talon.one/docs/product/account/account-settings/managing-users#disabling-a-user) by their email address. - - :param deactivate_user_request: body (required) - :type deactivate_user_request: DeactivateUserRequest - :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._deactivate_user_by_email_serialize( - deactivate_user_request=deactivate_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 deactivate_user_by_email_with_http_info( - self, - deactivate_user_request: Annotated[DeactivateUserRequest, Field(description="body")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Disable user by email address - - [Disable a specific user](https://docs.talon.one/docs/product/account/account-settings/managing-users#disabling-a-user) by their email address. - - :param deactivate_user_request: body (required) - :type deactivate_user_request: DeactivateUserRequest - :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._deactivate_user_by_email_serialize( - deactivate_user_request=deactivate_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 deactivate_user_by_email_without_preload_content( - self, - deactivate_user_request: Annotated[DeactivateUserRequest, Field(description="body")], - _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: - """Disable user by email address - - [Disable a specific user](https://docs.talon.one/docs/product/account/account-settings/managing-users#disabling-a-user) by their email address. - - :param deactivate_user_request: body (required) - :type deactivate_user_request: DeactivateUserRequest - :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._deactivate_user_by_email_serialize( - deactivate_user_request=deactivate_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _deactivate_user_by_email_serialize( - self, - deactivate_user_request, - _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 - # process the header parameters - # process the form parameters - # process the body parameter - if deactivate_user_request is not None: - _body_params = deactivate_user_request - - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/users/deactivate', - 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 deduct_loyalty_card_points( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - deduct_loyalty_points: Annotated[DeductLoyaltyPoints, Field(description="body")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Deduct points from card - - Deduct points from the given loyalty card in the specified card-based loyalty program. - - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param deduct_loyalty_points: body (required) - :type deduct_loyalty_points: DeductLoyaltyPoints - :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._deduct_loyalty_card_points_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - deduct_loyalty_points=deduct_loyalty_points, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def deduct_loyalty_card_points_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - deduct_loyalty_points: Annotated[DeductLoyaltyPoints, Field(description="body")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Deduct points from card - - Deduct points from the given loyalty card in the specified card-based loyalty program. - - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param deduct_loyalty_points: body (required) - :type deduct_loyalty_points: DeductLoyaltyPoints - :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._deduct_loyalty_card_points_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - deduct_loyalty_points=deduct_loyalty_points, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def deduct_loyalty_card_points_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - deduct_loyalty_points: Annotated[DeductLoyaltyPoints, Field(description="body")], - _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: - """Deduct points from card - - Deduct points from the given loyalty card in the specified card-based loyalty program. - - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param deduct_loyalty_points: body (required) - :type deduct_loyalty_points: DeductLoyaltyPoints - :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._deduct_loyalty_card_points_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - deduct_loyalty_points=deduct_loyalty_points, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _deduct_loyalty_card_points_serialize( - self, - loyalty_program_id, - loyalty_card_id, - deduct_loyalty_points, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - if loyalty_card_id is not None: - _path_params['loyaltyCardId'] = loyalty_card_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if deduct_loyalty_points is not None: - _body_params = deduct_loyalty_points - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/deduct_points', - 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 delete_account_collection( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete account-level collection - - Delete a given account-level collection. - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_account_collection_serialize( - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '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 delete_account_collection_with_http_info( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete account-level collection - - Delete a given account-level collection. - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_account_collection_serialize( - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '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 delete_account_collection_without_preload_content( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete account-level collection - - Delete a given account-level collection. - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_account_collection_serialize( - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_account_collection_serialize( - self, - collection_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 collection_id is not None: - _path_params['collectionId'] = collection_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/collections/{collectionId}', - 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 delete_achievement( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - achievement_id: Annotated[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/listAchievements) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete achievement - - Delete the specified achievement. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param achievement_id: The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) - :type achievement_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_achievement_serialize( - application_id=application_id, - campaign_id=campaign_id, - achievement_id=achievement_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '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 delete_achievement_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - achievement_id: Annotated[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/listAchievements) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete achievement - - Delete the specified achievement. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param achievement_id: The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) - :type achievement_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_achievement_serialize( - application_id=application_id, - campaign_id=campaign_id, - achievement_id=achievement_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '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 delete_achievement_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - achievement_id: Annotated[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/listAchievements) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete achievement - - Delete the specified achievement. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param achievement_id: The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) - :type achievement_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_achievement_serialize( - application_id=application_id, - campaign_id=campaign_id, - achievement_id=achievement_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_achievement_serialize( - self, - application_id, - campaign_id, - achievement_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - if achievement_id is not None: - _path_params['achievementId'] = achievement_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}', - 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 delete_campaign( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete campaign - - Delete the given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param _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._delete_campaign_serialize( - application_id=application_id, - campaign_id=campaign_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 delete_campaign_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete campaign - - Delete the given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param _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._delete_campaign_serialize( - application_id=application_id, - campaign_id=campaign_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 delete_campaign_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - _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: - """Delete campaign - - Delete the given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param _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._delete_campaign_serialize( - application_id=application_id, - campaign_id=campaign_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_campaign_serialize( - self, - application_id, - campaign_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}', - 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 delete_campaign_store_budgets( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - action: Annotated[Optional[StrictStr], Field(description="The action that this budget is limiting.")] = None, - period: Annotated[Optional[StrictStr], Field(description="The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. ")] = 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, - ) -> None: - """Delete campaign store budgets - - Delete the store budgets for a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param action: The action that this budget is limiting. - :type action: str - :param period: The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. - :type period: 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._delete_campaign_store_budgets_serialize( - application_id=application_id, - campaign_id=campaign_id, - action=action, - period=period, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponse", - } - 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 delete_campaign_store_budgets_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - action: Annotated[Optional[StrictStr], Field(description="The action that this budget is limiting.")] = None, - period: Annotated[Optional[StrictStr], Field(description="The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. ")] = 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[None]: - """Delete campaign store budgets - - Delete the store budgets for a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param action: The action that this budget is limiting. - :type action: str - :param period: The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. - :type period: 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._delete_campaign_store_budgets_serialize( - application_id=application_id, - campaign_id=campaign_id, - action=action, - period=period, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponse", - } - 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 delete_campaign_store_budgets_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - action: Annotated[Optional[StrictStr], Field(description="The action that this budget is limiting.")] = None, - period: Annotated[Optional[StrictStr], Field(description="The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. ")] = 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: - """Delete campaign store budgets - - Delete the store budgets for a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param action: The action that this budget is limiting. - :type action: str - :param period: The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. - :type period: 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._delete_campaign_store_budgets_serialize( - application_id=application_id, - campaign_id=campaign_id, - action=action, - period=period, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_campaign_store_budgets_serialize( - self, - application_id, - campaign_id, - action, - period, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - if action is not None: - - _query_params.append(('action', action)) - - if period is not None: - - _query_params.append(('period', period)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/stores/budgets', - 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 delete_collection( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete campaign-level collection - - Delete a given campaign-level collection. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param collection_id: The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_collection_serialize( - application_id=application_id, - campaign_id=campaign_id, - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '401': "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 delete_collection_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete campaign-level collection - - Delete a given campaign-level collection. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param collection_id: The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_collection_serialize( - application_id=application_id, - campaign_id=campaign_id, - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '401': "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 delete_collection_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete campaign-level collection - - Delete a given campaign-level collection. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param collection_id: The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_collection_serialize( - application_id=application_id, - campaign_id=campaign_id, - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '401': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_collection_serialize( - self, - application_id, - campaign_id, - collection_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - if collection_id is not None: - _path_params['collectionId'] = collection_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}', - 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 delete_coupon( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - coupon_id: Annotated[StrictStr, Field(description="The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete coupon - - Delete the specified coupon. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param coupon_id: The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. (required) - :type coupon_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._delete_coupon_serialize( - application_id=application_id, - campaign_id=campaign_id, - coupon_id=coupon_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 delete_coupon_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - coupon_id: Annotated[StrictStr, Field(description="The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete coupon - - Delete the specified coupon. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param coupon_id: The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. (required) - :type coupon_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._delete_coupon_serialize( - application_id=application_id, - campaign_id=campaign_id, - coupon_id=coupon_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 delete_coupon_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - coupon_id: Annotated[StrictStr, Field(description="The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. ")], - _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: - """Delete coupon - - Delete the specified coupon. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param coupon_id: The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. (required) - :type coupon_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._delete_coupon_serialize( - application_id=application_id, - campaign_id=campaign_id, - coupon_id=coupon_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_coupon_serialize( - self, - application_id, - campaign_id, - coupon_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - if coupon_id is not None: - _path_params['couponId'] = coupon_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId}', - 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 delete_coupons( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - value: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - starts_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - starts_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - expires_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - expires_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="- `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. ")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of coupons")] = None, - usable: Annotated[Optional[StrictStr], Field(description="- `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. ")] = None, - referral_id: Annotated[Optional[StrictInt], Field(description="Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code.")] = None, - recipient_integration_id: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile ID specified in the coupon's `RecipientIntegrationId` field. ")] = None, - exact_match: Annotated[Optional[StrictBool], Field(description="Filter results to an exact case-insensitive matching against the coupon code")] = 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, - ) -> None: - """Delete coupons - - Deletes all the coupons matching the specified criteria. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param value: Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type value: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param starts_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type starts_after: datetime - :param starts_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type starts_before: datetime - :param expires_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type expires_after: datetime - :param expires_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type expires_before: datetime - :param valid: - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. - :type valid: str - :param batch_id: Filter results by batches of coupons - :type batch_id: str - :param usable: - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. - :type usable: str - :param referral_id: Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. - :type referral_id: int - :param recipient_integration_id: Filter results by match with a profile ID specified in the coupon's `RecipientIntegrationId` field. - :type recipient_integration_id: str - :param exact_match: Filter results to an exact case-insensitive matching against the coupon code - :type exact_match: 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._delete_coupons_serialize( - application_id=application_id, - campaign_id=campaign_id, - value=value, - created_before=created_before, - created_after=created_after, - starts_after=starts_after, - starts_before=starts_before, - expires_after=expires_after, - expires_before=expires_before, - valid=valid, - batch_id=batch_id, - usable=usable, - referral_id=referral_id, - recipient_integration_id=recipient_integration_id, - exact_match=exact_match, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 delete_coupons_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - value: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - starts_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - starts_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - expires_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - expires_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="- `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. ")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of coupons")] = None, - usable: Annotated[Optional[StrictStr], Field(description="- `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. ")] = None, - referral_id: Annotated[Optional[StrictInt], Field(description="Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code.")] = None, - recipient_integration_id: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile ID specified in the coupon's `RecipientIntegrationId` field. ")] = None, - exact_match: Annotated[Optional[StrictBool], Field(description="Filter results to an exact case-insensitive matching against the coupon code")] = 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[None]: - """Delete coupons - - Deletes all the coupons matching the specified criteria. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param value: Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type value: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param starts_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type starts_after: datetime - :param starts_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type starts_before: datetime - :param expires_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type expires_after: datetime - :param expires_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type expires_before: datetime - :param valid: - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. - :type valid: str - :param batch_id: Filter results by batches of coupons - :type batch_id: str - :param usable: - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. - :type usable: str - :param referral_id: Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. - :type referral_id: int - :param recipient_integration_id: Filter results by match with a profile ID specified in the coupon's `RecipientIntegrationId` field. - :type recipient_integration_id: str - :param exact_match: Filter results to an exact case-insensitive matching against the coupon code - :type exact_match: 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._delete_coupons_serialize( - application_id=application_id, - campaign_id=campaign_id, - value=value, - created_before=created_before, - created_after=created_after, - starts_after=starts_after, - starts_before=starts_before, - expires_after=expires_after, - expires_before=expires_before, - valid=valid, - batch_id=batch_id, - usable=usable, - referral_id=referral_id, - recipient_integration_id=recipient_integration_id, - exact_match=exact_match, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 delete_coupons_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - value: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - starts_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - starts_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - expires_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - expires_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="- `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. ")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of coupons")] = None, - usable: Annotated[Optional[StrictStr], Field(description="- `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. ")] = None, - referral_id: Annotated[Optional[StrictInt], Field(description="Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code.")] = None, - recipient_integration_id: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile ID specified in the coupon's `RecipientIntegrationId` field. ")] = None, - exact_match: Annotated[Optional[StrictBool], Field(description="Filter results to an exact case-insensitive matching against the coupon code")] = 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: - """Delete coupons - - Deletes all the coupons matching the specified criteria. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param value: Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type value: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param starts_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type starts_after: datetime - :param starts_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type starts_before: datetime - :param expires_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type expires_after: datetime - :param expires_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type expires_before: datetime - :param valid: - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. - :type valid: str - :param batch_id: Filter results by batches of coupons - :type batch_id: str - :param usable: - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. - :type usable: str - :param referral_id: Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. - :type referral_id: int - :param recipient_integration_id: Filter results by match with a profile ID specified in the coupon's `RecipientIntegrationId` field. - :type recipient_integration_id: str - :param exact_match: Filter results to an exact case-insensitive matching against the coupon code - :type exact_match: 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._delete_coupons_serialize( - application_id=application_id, - campaign_id=campaign_id, - value=value, - created_before=created_before, - created_after=created_after, - starts_after=starts_after, - starts_before=starts_before, - expires_after=expires_after, - expires_before=expires_before, - valid=valid, - batch_id=batch_id, - usable=usable, - referral_id=referral_id, - recipient_integration_id=recipient_integration_id, - exact_match=exact_match, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_coupons_serialize( - self, - application_id, - campaign_id, - value, - created_before, - created_after, - starts_after, - starts_before, - expires_after, - expires_before, - valid, - batch_id, - usable, - referral_id, - recipient_integration_id, - exact_match, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - if value is not None: - - _query_params.append(('value', value)) - - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - 'createdBefore', - created_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdBefore', created_before)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdAfter', created_after)) - - if starts_after is not None: - if isinstance(starts_after, datetime): - _query_params.append( - ( - 'startsAfter', - starts_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startsAfter', starts_after)) - - if starts_before is not None: - if isinstance(starts_before, datetime): - _query_params.append( - ( - 'startsBefore', - starts_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startsBefore', starts_before)) - - if expires_after is not None: - if isinstance(expires_after, datetime): - _query_params.append( - ( - 'expiresAfter', - expires_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('expiresAfter', expires_after)) - - if expires_before is not None: - if isinstance(expires_before, datetime): - _query_params.append( - ( - 'expiresBefore', - expires_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('expiresBefore', expires_before)) - - if valid is not None: - - _query_params.append(('valid', valid)) - - if batch_id is not None: - - _query_params.append(('batchId', batch_id)) - - if usable is not None: - - _query_params.append(('usable', usable)) - - if referral_id is not None: - - _query_params.append(('referralId', referral_id)) - - if recipient_integration_id is not None: - - _query_params.append(('recipientIntegrationId', recipient_integration_id)) - - if exact_match is not None: - - _query_params.append(('exactMatch', exact_match)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/coupons', - 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 delete_loyalty_card( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete loyalty card - - Delete the given 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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_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._delete_loyalty_card_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '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 delete_loyalty_card_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete loyalty card - - Delete the given 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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_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._delete_loyalty_card_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '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 delete_loyalty_card_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - _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: - """Delete loyalty card - - Delete the given 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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_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._delete_loyalty_card_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_loyalty_card_serialize( - self, - loyalty_program_id, - loyalty_card_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - if loyalty_card_id is not None: - _path_params['loyaltyCardId'] = loyalty_card_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}', - 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 delete_referral( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - referral_id: Annotated[StrictStr, Field(description="The ID of the referral code.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete referral - - Delete the specified referral. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param referral_id: The ID of the referral code. (required) - :type referral_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._delete_referral_serialize( - application_id=application_id, - campaign_id=campaign_id, - referral_id=referral_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 delete_referral_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - referral_id: Annotated[StrictStr, Field(description="The ID of the referral code.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete referral - - Delete the specified referral. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param referral_id: The ID of the referral code. (required) - :type referral_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._delete_referral_serialize( - application_id=application_id, - campaign_id=campaign_id, - referral_id=referral_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 delete_referral_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - referral_id: Annotated[StrictStr, Field(description="The ID of the referral code.")], - _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: - """Delete referral - - Delete the specified referral. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param referral_id: The ID of the referral code. (required) - :type referral_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._delete_referral_serialize( - application_id=application_id, - campaign_id=campaign_id, - referral_id=referral_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_referral_serialize( - self, - application_id, - campaign_id, - referral_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - if referral_id is not None: - _path_params['referralId'] = referral_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId}', - 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 delete_store( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - store_id: Annotated[StrictStr, Field(description="The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete store - - Delete the specified store. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param store_id: The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) - :type store_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._delete_store_serialize( - application_id=application_id, - store_id=store_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '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 delete_store_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - store_id: Annotated[StrictStr, Field(description="The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete store - - Delete the specified store. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param store_id: The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) - :type store_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._delete_store_serialize( - application_id=application_id, - store_id=store_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '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 delete_store_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - store_id: Annotated[StrictStr, Field(description="The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete store - - Delete the specified store. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param store_id: The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) - :type store_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._delete_store_serialize( - application_id=application_id, - store_id=store_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_store_serialize( - self, - application_id, - store_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if store_id is not None: - _path_params['storeId'] = store_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/applications/{applicationId}/stores/{storeId}', - 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 delete_user( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete user - - Delete a specific user. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 delete_user_with_http_info( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete user - - Delete a specific user. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 delete_user_without_preload_content( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - _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: - """Delete user - - Delete a specific user. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_user_serialize( - self, - user_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 user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/users/{userId}', - 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 delete_user_by_email( - self, - delete_user_request: Annotated[DeleteUserRequest, Field(description="body")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete user by email address - - [Delete a specific user](https://docs.talon.one/docs/product/account/account-settings/managing-users#deleting-a-user) by their email address. - - :param delete_user_request: body (required) - :type delete_user_request: DeleteUserRequest - :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._delete_user_by_email_serialize( - delete_user_request=delete_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 delete_user_by_email_with_http_info( - self, - delete_user_request: Annotated[DeleteUserRequest, Field(description="body")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete user by email address - - [Delete a specific user](https://docs.talon.one/docs/product/account/account-settings/managing-users#deleting-a-user) by their email address. - - :param delete_user_request: body (required) - :type delete_user_request: DeleteUserRequest - :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._delete_user_by_email_serialize( - delete_user_request=delete_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 delete_user_by_email_without_preload_content( - self, - delete_user_request: Annotated[DeleteUserRequest, Field(description="body")], - _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: - """Delete user by email address - - [Delete a specific user](https://docs.talon.one/docs/product/account/account-settings/managing-users#deleting-a-user) by their email address. - - :param delete_user_request: body (required) - :type delete_user_request: DeleteUserRequest - :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._delete_user_by_email_serialize( - delete_user_request=delete_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_user_by_email_serialize( - self, - delete_user_request, - _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 - # process the header parameters - # process the form parameters - # process the body parameter - if delete_user_request is not None: - _body_params = delete_user_request - - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/users/delete', - 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 destroy_session( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Destroy session - - Destroys the session. - - :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._destroy_session_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 destroy_session_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Destroy session - - Destroys the session. - - :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._destroy_session_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 destroy_session_without_preload_content( - self, - _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: - """Destroy session - - Destroys the session. - - :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._destroy_session_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _destroy_session_serialize( - self, - _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 - # process the header parameters - # process the form parameters - # process the body parameter - - - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/sessions', - 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 disconnect_campaign_stores( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Disconnect stores - - Disconnect the stores linked to a specific campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param _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._disconnect_campaign_stores_serialize( - application_id=application_id, - campaign_id=campaign_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponse", - '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 disconnect_campaign_stores_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Disconnect stores - - Disconnect the stores linked to a specific campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param _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._disconnect_campaign_stores_serialize( - application_id=application_id, - campaign_id=campaign_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponse", - '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 disconnect_campaign_stores_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - _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: - """Disconnect stores - - Disconnect the stores linked to a specific campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param _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._disconnect_campaign_stores_serialize( - application_id=application_id, - campaign_id=campaign_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponse", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _disconnect_campaign_stores_serialize( - self, - application_id, - campaign_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/stores', - 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 export_account_collection_items( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """Export account-level collection's items - - Download a CSV file containing items from a given account-level collection. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._export_account_collection_items_serialize( - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '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 export_account_collection_items_with_http_info( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """Export account-level collection's items - - Download a CSV file containing items from a given account-level collection. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._export_account_collection_items_serialize( - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '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 export_account_collection_items_without_preload_content( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Export account-level collection's items - - Download a CSV file containing items from a given account-level collection. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._export_account_collection_items_serialize( - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_account_collection_items_serialize( - self, - collection_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 collection_id is not None: - _path_params['collectionId'] = collection_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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/collections/{collectionId}/export', - 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 export_achievements( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - achievement_id: Annotated[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/listAchievements) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """Export achievement customer data - - Download a CSV file containing a list of all the customers who have participated in and are currently participating in the given achievement. The CSV file contains the following columns: - `profileIntegrationID`: The integration ID of the customer profile participating in the achievement. - `title`: The display name of the achievement in the Campaign Manager. - `target`: The required number of actions or the transactional milestone to complete the achievement. - `progress`: The current progress of the customer in the achievement. - `status`: The status of the achievement. Can be one of: ['inprogress', 'completed', 'expired']. - `startDate`: The date on which the customer profile started the achievement in RFC3339. - `endDate`: The date on which the achievement ends and resets for the customer profile in RFC3339. - `completionDate`: The date on which the customer profile completed the achievement in RFC3339. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param achievement_id: The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) - :type achievement_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._export_achievements_serialize( - application_id=application_id, - campaign_id=campaign_id, - achievement_id=achievement_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '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 export_achievements_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - achievement_id: Annotated[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/listAchievements) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """Export achievement customer data - - Download a CSV file containing a list of all the customers who have participated in and are currently participating in the given achievement. The CSV file contains the following columns: - `profileIntegrationID`: The integration ID of the customer profile participating in the achievement. - `title`: The display name of the achievement in the Campaign Manager. - `target`: The required number of actions or the transactional milestone to complete the achievement. - `progress`: The current progress of the customer in the achievement. - `status`: The status of the achievement. Can be one of: ['inprogress', 'completed', 'expired']. - `startDate`: The date on which the customer profile started the achievement in RFC3339. - `endDate`: The date on which the achievement ends and resets for the customer profile in RFC3339. - `completionDate`: The date on which the customer profile completed the achievement in RFC3339. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param achievement_id: The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) - :type achievement_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._export_achievements_serialize( - application_id=application_id, - campaign_id=campaign_id, - achievement_id=achievement_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '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 export_achievements_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - achievement_id: Annotated[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/listAchievements) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Export achievement customer data - - Download a CSV file containing a list of all the customers who have participated in and are currently participating in the given achievement. The CSV file contains the following columns: - `profileIntegrationID`: The integration ID of the customer profile participating in the achievement. - `title`: The display name of the achievement in the Campaign Manager. - `target`: The required number of actions or the transactional milestone to complete the achievement. - `progress`: The current progress of the customer in the achievement. - `status`: The status of the achievement. Can be one of: ['inprogress', 'completed', 'expired']. - `startDate`: The date on which the customer profile started the achievement in RFC3339. - `endDate`: The date on which the achievement ends and resets for the customer profile in RFC3339. - `completionDate`: The date on which the customer profile completed the achievement in RFC3339. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param achievement_id: The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) - :type achievement_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._export_achievements_serialize( - application_id=application_id, - campaign_id=campaign_id, - achievement_id=achievement_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_achievements_serialize( - self, - application_id, - campaign_id, - achievement_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - if achievement_id is not None: - _path_params['achievementId'] = achievement_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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}/export', - 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 export_audiences_memberships( - self, - audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], - _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, - ) -> str: - """Export audience members - - Download a CSV file containing the integration IDs of the members of an audience. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The file contains the following column: - `profileintegrationid`: The integration ID of the customer profile. - - :param audience_id: The ID of the audience. (required) - :type audience_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._export_audiences_memberships_serialize( - audience_id=audience_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponse", - '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 export_audiences_memberships_with_http_info( - self, - audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], - _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[str]: - """Export audience members - - Download a CSV file containing the integration IDs of the members of an audience. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The file contains the following column: - `profileintegrationid`: The integration ID of the customer profile. - - :param audience_id: The ID of the audience. (required) - :type audience_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._export_audiences_memberships_serialize( - audience_id=audience_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponse", - '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 export_audiences_memberships_without_preload_content( - self, - audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], - _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: - """Export audience members - - Download a CSV file containing the integration IDs of the members of an audience. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The file contains the following column: - `profileintegrationid`: The integration ID of the customer profile. - - :param audience_id: The ID of the audience. (required) - :type audience_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._export_audiences_memberships_serialize( - audience_id=audience_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponse", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_audiences_memberships_serialize( - self, - audience_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 audience_id is not None: - _path_params['audienceId'] = audience_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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/audiences/{audienceId}/memberships/export', - 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 export_campaign_store_budgets( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - action: Annotated[Optional[StrictStr], Field(description="The action that this budget is limiting.")] = None, - period: Annotated[Optional[StrictStr], Field(description="The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. ")] = 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, - ) -> str: - """Export campaign store budgets - - Download a CSV file containing the store budgets for a given campaign. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `store_integration_id`: The identifier of the store. - `limit`: The budget limit for the store. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param action: The action that this budget is limiting. - :type action: str - :param period: The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. - :type period: 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._export_campaign_store_budgets_serialize( - application_id=application_id, - campaign_id=campaign_id, - action=action, - period=period, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponse", - '401': "ErrorResponse", - '404': "ErrorResponse", - } - 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 export_campaign_store_budgets_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - action: Annotated[Optional[StrictStr], Field(description="The action that this budget is limiting.")] = None, - period: Annotated[Optional[StrictStr], Field(description="The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. ")] = 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[str]: - """Export campaign store budgets - - Download a CSV file containing the store budgets for a given campaign. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `store_integration_id`: The identifier of the store. - `limit`: The budget limit for the store. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param action: The action that this budget is limiting. - :type action: str - :param period: The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. - :type period: 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._export_campaign_store_budgets_serialize( - application_id=application_id, - campaign_id=campaign_id, - action=action, - period=period, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponse", - '401': "ErrorResponse", - '404': "ErrorResponse", - } - 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 export_campaign_store_budgets_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - action: Annotated[Optional[StrictStr], Field(description="The action that this budget is limiting.")] = None, - period: Annotated[Optional[StrictStr], Field(description="The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. ")] = 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: - """Export campaign store budgets - - Download a CSV file containing the store budgets for a given campaign. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `store_integration_id`: The identifier of the store. - `limit`: The budget limit for the store. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param action: The action that this budget is limiting. - :type action: str - :param period: The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. - :type period: 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._export_campaign_store_budgets_serialize( - application_id=application_id, - campaign_id=campaign_id, - action=action, - period=period, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponse", - '401': "ErrorResponse", - '404': "ErrorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_campaign_store_budgets_serialize( - self, - application_id, - campaign_id, - action, - period, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - if action is not None: - - _query_params.append(('action', action)) - - if period is not None: - - _query_params.append(('period', period)) - - # 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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/stores/budgets/export', - 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 export_campaign_stores( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - _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, - ) -> str: - """Export stores - - Download a CSV file containing the stores linked to a specific campaign. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following column: - `store_integration_id`: The identifier of the store. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param _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._export_campaign_stores_serialize( - application_id=application_id, - campaign_id=campaign_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponse", - '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 export_campaign_stores_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - _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[str]: - """Export stores - - Download a CSV file containing the stores linked to a specific campaign. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following column: - `store_integration_id`: The identifier of the store. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param _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._export_campaign_stores_serialize( - application_id=application_id, - campaign_id=campaign_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponse", - '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 export_campaign_stores_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - _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: - """Export stores - - Download a CSV file containing the stores linked to a specific campaign. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following column: - `store_integration_id`: The identifier of the store. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param _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._export_campaign_stores_serialize( - application_id=application_id, - campaign_id=campaign_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponse", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_campaign_stores_serialize( - self, - application_id, - campaign_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # 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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/stores/export', - 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 export_collection_items( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """Export campaign-level collection's items - - Download a CSV file containing items from a given campaign-level collection. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param collection_id: The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._export_collection_items_serialize( - application_id=application_id, - campaign_id=campaign_id, - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '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 export_collection_items_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """Export campaign-level collection's items - - Download a CSV file containing items from a given campaign-level collection. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param collection_id: The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._export_collection_items_serialize( - application_id=application_id, - campaign_id=campaign_id, - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '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 export_collection_items_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Export campaign-level collection's items - - Download a CSV file containing items from a given campaign-level collection. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param collection_id: The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._export_collection_items_serialize( - application_id=application_id, - campaign_id=campaign_id, - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_collection_items_serialize( - self, - application_id, - campaign_id, - collection_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - if collection_id is not None: - _path_params['collectionId'] = collection_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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/export', - 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 export_coupons( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by campaign ID.")] = None, - 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, - value: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. ")] = None, - referral_id: Annotated[Optional[StrictInt], Field(description="Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code.")] = None, - recipient_integration_id: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field.")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of coupons")] = None, - exact_match: Annotated[Optional[StrictBool], Field(description="Filter results to an exact case-insensitive matching against the coupon code.")] = None, - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = None, - campaign_state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. ")] = None, - values_only: Annotated[Optional[StrictBool], Field(description="Filter results to only return the coupon codes (`value` column) without the associated coupon data.")] = None, - _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, - ) -> str: - """Export coupons - - Download a CSV file containing the coupons that match the given properties. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file can contain the following columns: - `accountid`: The ID of your deployment. - `applicationid`: The ID of the Application this coupon is related to. - `attributes`: A json object describing _custom_ referral attribute names and their values. - `batchid`: The ID of the batch this coupon is part of. - `campaignid`: The ID of the campaign this coupon is related to. - `counter`: The number of times this coupon has been redeemed. - `created`: The creation date in RFC3339 of the coupon code. - `deleted`: Whether the coupon code is deleted. - `deleted_changelogid`: The ID of the delete event in the logs. - `discount_counter`: The amount of discount given by this coupon. - `discount_limitval`: The maximum discount amount that can be given be this coupon. - `expirydate`: The end date in RFC3339 of the code redemption period. - `id`: The internal ID of the coupon code. - `importid`: The ID of the import job that created this coupon. - `is_reservation_mandatory`: Whether this coupon requires a reservation to be redeemed. - `limits`: The limits set on this coupon. - `limitval`: The maximum number of redemptions of this code. - `recipientintegrationid`: The integration ID of the recipient of the coupon. Only the customer with this integration ID can redeem this code. Available only for personal codes. - `referralid`: The ID of the referral code that triggered the creation of this coupon (create coupon effect). - `reservation`: Whether the coupon can be reserved for multiple customers. - `reservation_counter`: How many times this coupon has been reserved. - `reservation_limitval`: The maximum of number of reservations this coupon can have. - `startdate`: The start date in RFC3339 of the code redemption period. - `value`: The coupon code. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: Filter results by campaign ID. - :type campaign_id: float - :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 - :param value: Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type value: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. - :type valid: str - :param usable: Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. - :type usable: str - :param referral_id: Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. - :type referral_id: int - :param recipient_integration_id: Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field. - :type recipient_integration_id: str - :param batch_id: Filter results by batches of coupons - :type batch_id: str - :param exact_match: Filter results to an exact case-insensitive matching against the coupon code. - :type exact_match: bool - :param date_format: Determines the format of dates in the export document. - :type date_format: str - :param campaign_state: Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - :type campaign_state: str - :param values_only: Filter results to only return the coupon codes (`value` column) without the associated coupon data. - :type values_only: bool - :param _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._export_coupons_serialize( - application_id=application_id, - campaign_id=campaign_id, - sort=sort, - value=value, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - referral_id=referral_id, - recipient_integration_id=recipient_integration_id, - batch_id=batch_id, - exact_match=exact_match, - date_format=date_format, - campaign_state=campaign_state, - values_only=values_only, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - 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 export_coupons_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by campaign ID.")] = None, - 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, - value: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. ")] = None, - referral_id: Annotated[Optional[StrictInt], Field(description="Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code.")] = None, - recipient_integration_id: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field.")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of coupons")] = None, - exact_match: Annotated[Optional[StrictBool], Field(description="Filter results to an exact case-insensitive matching against the coupon code.")] = None, - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = None, - campaign_state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. ")] = None, - values_only: Annotated[Optional[StrictBool], Field(description="Filter results to only return the coupon codes (`value` column) without the associated coupon data.")] = None, - _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[str]: - """Export coupons - - Download a CSV file containing the coupons that match the given properties. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file can contain the following columns: - `accountid`: The ID of your deployment. - `applicationid`: The ID of the Application this coupon is related to. - `attributes`: A json object describing _custom_ referral attribute names and their values. - `batchid`: The ID of the batch this coupon is part of. - `campaignid`: The ID of the campaign this coupon is related to. - `counter`: The number of times this coupon has been redeemed. - `created`: The creation date in RFC3339 of the coupon code. - `deleted`: Whether the coupon code is deleted. - `deleted_changelogid`: The ID of the delete event in the logs. - `discount_counter`: The amount of discount given by this coupon. - `discount_limitval`: The maximum discount amount that can be given be this coupon. - `expirydate`: The end date in RFC3339 of the code redemption period. - `id`: The internal ID of the coupon code. - `importid`: The ID of the import job that created this coupon. - `is_reservation_mandatory`: Whether this coupon requires a reservation to be redeemed. - `limits`: The limits set on this coupon. - `limitval`: The maximum number of redemptions of this code. - `recipientintegrationid`: The integration ID of the recipient of the coupon. Only the customer with this integration ID can redeem this code. Available only for personal codes. - `referralid`: The ID of the referral code that triggered the creation of this coupon (create coupon effect). - `reservation`: Whether the coupon can be reserved for multiple customers. - `reservation_counter`: How many times this coupon has been reserved. - `reservation_limitval`: The maximum of number of reservations this coupon can have. - `startdate`: The start date in RFC3339 of the code redemption period. - `value`: The coupon code. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: Filter results by campaign ID. - :type campaign_id: float - :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 - :param value: Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type value: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. - :type valid: str - :param usable: Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. - :type usable: str - :param referral_id: Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. - :type referral_id: int - :param recipient_integration_id: Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field. - :type recipient_integration_id: str - :param batch_id: Filter results by batches of coupons - :type batch_id: str - :param exact_match: Filter results to an exact case-insensitive matching against the coupon code. - :type exact_match: bool - :param date_format: Determines the format of dates in the export document. - :type date_format: str - :param campaign_state: Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - :type campaign_state: str - :param values_only: Filter results to only return the coupon codes (`value` column) without the associated coupon data. - :type values_only: bool - :param _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._export_coupons_serialize( - application_id=application_id, - campaign_id=campaign_id, - sort=sort, - value=value, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - referral_id=referral_id, - recipient_integration_id=recipient_integration_id, - batch_id=batch_id, - exact_match=exact_match, - date_format=date_format, - campaign_state=campaign_state, - values_only=values_only, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - 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 export_coupons_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by campaign ID.")] = None, - 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, - value: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. ")] = None, - referral_id: Annotated[Optional[StrictInt], Field(description="Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code.")] = None, - recipient_integration_id: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field.")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of coupons")] = None, - exact_match: Annotated[Optional[StrictBool], Field(description="Filter results to an exact case-insensitive matching against the coupon code.")] = None, - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = None, - campaign_state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. ")] = None, - values_only: Annotated[Optional[StrictBool], Field(description="Filter results to only return the coupon codes (`value` column) without the associated coupon data.")] = None, - _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: - """Export coupons - - Download a CSV file containing the coupons that match the given properties. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file can contain the following columns: - `accountid`: The ID of your deployment. - `applicationid`: The ID of the Application this coupon is related to. - `attributes`: A json object describing _custom_ referral attribute names and their values. - `batchid`: The ID of the batch this coupon is part of. - `campaignid`: The ID of the campaign this coupon is related to. - `counter`: The number of times this coupon has been redeemed. - `created`: The creation date in RFC3339 of the coupon code. - `deleted`: Whether the coupon code is deleted. - `deleted_changelogid`: The ID of the delete event in the logs. - `discount_counter`: The amount of discount given by this coupon. - `discount_limitval`: The maximum discount amount that can be given be this coupon. - `expirydate`: The end date in RFC3339 of the code redemption period. - `id`: The internal ID of the coupon code. - `importid`: The ID of the import job that created this coupon. - `is_reservation_mandatory`: Whether this coupon requires a reservation to be redeemed. - `limits`: The limits set on this coupon. - `limitval`: The maximum number of redemptions of this code. - `recipientintegrationid`: The integration ID of the recipient of the coupon. Only the customer with this integration ID can redeem this code. Available only for personal codes. - `referralid`: The ID of the referral code that triggered the creation of this coupon (create coupon effect). - `reservation`: Whether the coupon can be reserved for multiple customers. - `reservation_counter`: How many times this coupon has been reserved. - `reservation_limitval`: The maximum of number of reservations this coupon can have. - `startdate`: The start date in RFC3339 of the code redemption period. - `value`: The coupon code. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: Filter results by campaign ID. - :type campaign_id: float - :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 - :param value: Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type value: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. - :type valid: str - :param usable: Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. - :type usable: str - :param referral_id: Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. - :type referral_id: int - :param recipient_integration_id: Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field. - :type recipient_integration_id: str - :param batch_id: Filter results by batches of coupons - :type batch_id: str - :param exact_match: Filter results to an exact case-insensitive matching against the coupon code. - :type exact_match: bool - :param date_format: Determines the format of dates in the export document. - :type date_format: str - :param campaign_state: Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - :type campaign_state: str - :param values_only: Filter results to only return the coupon codes (`value` column) without the associated coupon data. - :type values_only: bool - :param _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._export_coupons_serialize( - application_id=application_id, - campaign_id=campaign_id, - sort=sort, - value=value, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - referral_id=referral_id, - recipient_integration_id=recipient_integration_id, - batch_id=batch_id, - exact_match=exact_match, - date_format=date_format, - campaign_state=campaign_state, - values_only=values_only, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_coupons_serialize( - self, - application_id, - campaign_id, - sort, - value, - created_before, - created_after, - valid, - usable, - referral_id, - recipient_integration_id, - batch_id, - exact_match, - date_format, - campaign_state, - values_only, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - if campaign_id is not None: - - _query_params.append(('campaignId', campaign_id)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if value is not None: - - _query_params.append(('value', value)) - - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - 'createdBefore', - created_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdBefore', created_before)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdAfter', created_after)) - - if valid is not None: - - _query_params.append(('valid', valid)) - - if usable is not None: - - _query_params.append(('usable', usable)) - - if referral_id is not None: - - _query_params.append(('referralId', referral_id)) - - if recipient_integration_id is not None: - - _query_params.append(('recipientIntegrationId', recipient_integration_id)) - - if batch_id is not None: - - _query_params.append(('batchId', batch_id)) - - if exact_match is not None: - - _query_params.append(('exactMatch', exact_match)) - - if date_format is not None: - - _query_params.append(('dateFormat', date_format)) - - if campaign_state is not None: - - _query_params.append(('campaignState', campaign_state)) - - if values_only is not None: - - _query_params.append(('valuesOnly', values_only)) - - # 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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/export_coupons', - 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 export_customer_sessions( - self, - 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, - 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, - _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, - ) -> str: - """Export customer sessions - - Download a CSV file containing the customer sessions that match the request. **Important:** Archived sessions cannot be exported. See the [retention policy](https://docs.talon.one/docs/dev/server-infrastructure-and-data-retention). **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - `id`: The internal ID of the session. - `firstsession`: Whether this is a first session. - `integrationid`: The integration ID of the session. - `applicationid`: The ID of the Application. - `profileid`: The internal ID of the customer profile. - `profileintegrationid`: The integration ID of the customer profile. - `created`: The timestamp when the session was created. - `state`: The [state](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states) of the session. - `cartitems`: The cart items in the session. - `discounts`: The discounts in the session. - `total`: The total value of cart items and additional costs in the session, before any discounts are applied. - `attributes`: The attributes set in the session. - `closedat`: Timestamp when the session was closed. - `cancelledat`: Timestamp when the session was cancelled. - `referral`: The referral code in the session. - `identifiers`: The identifiers in the session. - `additional_costs`: The [additional costs](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs) in the session. - `updated`: Timestamp of the last session update. - `store_integration_id`: The integration ID of the store. - `coupons`: Coupon codes in the session. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. - :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 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. - :type date_format: str - :param customer_session_state: Filter results by state. - :type customer_session_state: 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._export_customer_sessions_serialize( - application_id=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, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - 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 export_customer_sessions_with_http_info( - self, - 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, - 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, - _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[str]: - """Export customer sessions - - Download a CSV file containing the customer sessions that match the request. **Important:** Archived sessions cannot be exported. See the [retention policy](https://docs.talon.one/docs/dev/server-infrastructure-and-data-retention). **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - `id`: The internal ID of the session. - `firstsession`: Whether this is a first session. - `integrationid`: The integration ID of the session. - `applicationid`: The ID of the Application. - `profileid`: The internal ID of the customer profile. - `profileintegrationid`: The integration ID of the customer profile. - `created`: The timestamp when the session was created. - `state`: The [state](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states) of the session. - `cartitems`: The cart items in the session. - `discounts`: The discounts in the session. - `total`: The total value of cart items and additional costs in the session, before any discounts are applied. - `attributes`: The attributes set in the session. - `closedat`: Timestamp when the session was closed. - `cancelledat`: Timestamp when the session was cancelled. - `referral`: The referral code in the session. - `identifiers`: The identifiers in the session. - `additional_costs`: The [additional costs](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs) in the session. - `updated`: Timestamp of the last session update. - `store_integration_id`: The integration ID of the store. - `coupons`: Coupon codes in the session. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. - :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 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. - :type date_format: str - :param customer_session_state: Filter results by state. - :type customer_session_state: 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._export_customer_sessions_serialize( - application_id=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, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - 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 export_customer_sessions_without_preload_content( - self, - 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, - 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, - _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: - """Export customer sessions - - Download a CSV file containing the customer sessions that match the request. **Important:** Archived sessions cannot be exported. See the [retention policy](https://docs.talon.one/docs/dev/server-infrastructure-and-data-retention). **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - `id`: The internal ID of the session. - `firstsession`: Whether this is a first session. - `integrationid`: The integration ID of the session. - `applicationid`: The ID of the Application. - `profileid`: The internal ID of the customer profile. - `profileintegrationid`: The integration ID of the customer profile. - `created`: The timestamp when the session was created. - `state`: The [state](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states) of the session. - `cartitems`: The cart items in the session. - `discounts`: The discounts in the session. - `total`: The total value of cart items and additional costs in the session, before any discounts are applied. - `attributes`: The attributes set in the session. - `closedat`: Timestamp when the session was closed. - `cancelledat`: Timestamp when the session was cancelled. - `referral`: The referral code in the session. - `identifiers`: The identifiers in the session. - `additional_costs`: The [additional costs](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs) in the session. - `updated`: Timestamp of the last session update. - `store_integration_id`: The integration ID of the store. - `coupons`: Coupon codes in the session. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. - :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 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. - :type date_format: str - :param customer_session_state: Filter results by state. - :type customer_session_state: 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._export_customer_sessions_serialize( - application_id=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, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_customer_sessions_serialize( - self, - application_id, - created_before, - created_after, - profile_integration_id, - date_format, - customer_session_state, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - 'createdBefore', - created_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdBefore', created_before)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdAfter', created_after)) - - if profile_integration_id is not None: - - _query_params.append(('profileIntegrationId', profile_integration_id)) - - if date_format is not None: - - _query_params.append(('dateFormat', date_format)) - - if customer_session_state is not None: - - _query_params.append(('customerSessionState', customer_session_state)) - - # 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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/export_customer_sessions', - 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 export_customers_tiers( - self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - subledger_ids: Annotated[Optional[List[StrictStr]], Field(description="An array of subledgers IDs to filter the export by.")] = None, - tier_names: Annotated[Optional[List[StrictStr]], Field(description="An array of tier names to filter the export by.")] = 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, - ) -> str: - """Export customers' tier data - - Download a CSV file containing the tier information for customers of the specified loyalty program. The generated file contains the following columns: - `programid`: The identifier of the loyalty program. It is displayed in your Talon.One deployment URL. - `subledgerid`: The ID of the subledger associated with the loyalty program. This column is empty if the loyalty program has no subledger. In this case, refer to the export file name to get the ID of the loyalty program. - `customerprofileid`: The ID used to integrate customer profiles with the loyalty program. - `tiername`: The name of the tier. - `startdate`: The tier start date in RFC3339. - `expirydate`: The tier expiry date in RFC3339. You can filter the results by providing the following optional input parameters: - `subledgerIds` (optional): Filter results by an array of subledger IDs. If no value is provided, all subledger data for the specified loyalty program will be exported. - `tierNames` (optional): Filter results by an array of tier names. If no value is provided, all tier data for the specified loyalty program will be exported. - - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param subledger_ids: An array of subledgers IDs to filter the export by. - :type subledger_ids: List[str] - :param tier_names: An array of tier names to filter the export by. - :type tier_names: List[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._export_customers_tiers_serialize( - loyalty_program_id=loyalty_program_id, - subledger_ids=subledger_ids, - tier_names=tier_names, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - 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 export_customers_tiers_with_http_info( - self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - subledger_ids: Annotated[Optional[List[StrictStr]], Field(description="An array of subledgers IDs to filter the export by.")] = None, - tier_names: Annotated[Optional[List[StrictStr]], Field(description="An array of tier names to filter the export by.")] = 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[str]: - """Export customers' tier data - - Download a CSV file containing the tier information for customers of the specified loyalty program. The generated file contains the following columns: - `programid`: The identifier of the loyalty program. It is displayed in your Talon.One deployment URL. - `subledgerid`: The ID of the subledger associated with the loyalty program. This column is empty if the loyalty program has no subledger. In this case, refer to the export file name to get the ID of the loyalty program. - `customerprofileid`: The ID used to integrate customer profiles with the loyalty program. - `tiername`: The name of the tier. - `startdate`: The tier start date in RFC3339. - `expirydate`: The tier expiry date in RFC3339. You can filter the results by providing the following optional input parameters: - `subledgerIds` (optional): Filter results by an array of subledger IDs. If no value is provided, all subledger data for the specified loyalty program will be exported. - `tierNames` (optional): Filter results by an array of tier names. If no value is provided, all tier data for the specified loyalty program will be exported. - - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param subledger_ids: An array of subledgers IDs to filter the export by. - :type subledger_ids: List[str] - :param tier_names: An array of tier names to filter the export by. - :type tier_names: List[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._export_customers_tiers_serialize( - loyalty_program_id=loyalty_program_id, - subledger_ids=subledger_ids, - tier_names=tier_names, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - 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 export_customers_tiers_without_preload_content( - self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - subledger_ids: Annotated[Optional[List[StrictStr]], Field(description="An array of subledgers IDs to filter the export by.")] = None, - tier_names: Annotated[Optional[List[StrictStr]], Field(description="An array of tier names to filter the export by.")] = 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: - """Export customers' tier data - - Download a CSV file containing the tier information for customers of the specified loyalty program. The generated file contains the following columns: - `programid`: The identifier of the loyalty program. It is displayed in your Talon.One deployment URL. - `subledgerid`: The ID of the subledger associated with the loyalty program. This column is empty if the loyalty program has no subledger. In this case, refer to the export file name to get the ID of the loyalty program. - `customerprofileid`: The ID used to integrate customer profiles with the loyalty program. - `tiername`: The name of the tier. - `startdate`: The tier start date in RFC3339. - `expirydate`: The tier expiry date in RFC3339. You can filter the results by providing the following optional input parameters: - `subledgerIds` (optional): Filter results by an array of subledger IDs. If no value is provided, all subledger data for the specified loyalty program will be exported. - `tierNames` (optional): Filter results by an array of tier names. If no value is provided, all tier data for the specified loyalty program will be exported. - - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param subledger_ids: An array of subledgers IDs to filter the export by. - :type subledger_ids: List[str] - :param tier_names: An array of tier names to filter the export by. - :type tier_names: List[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._export_customers_tiers_serialize( - loyalty_program_id=loyalty_program_id, - subledger_ids=subledger_ids, - tier_names=tier_names, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_customers_tiers_serialize( - self, - loyalty_program_id, - subledger_ids, - tier_names, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - 'subledgerIds': 'csv', - 'tierNames': 'csv', - } - - _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 - if subledger_ids is not None: - - _query_params.append(('subledgerIds', subledger_ids)) - - if tier_names is not None: - - _query_params.append(('tierNames', tier_names)) - - # 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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/export_customers_tiers', - 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 export_effects( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by campaign ID.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = 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, - ) -> str: - """Export triggered effects - - Download a CSV file containing the triggered effects that match the given attributes. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The generated file can contain the following columns: - `applicationid`: The ID of the Application. - `campaignid`: The ID of the campaign. - `couponid`: The ID of the coupon, when applicable to the effect. - `created`: The timestamp of the effect. - `event_type`: The name of the event. See the [docs](https://docs.talon.one/docs/dev/concepts/entities/events). - `eventid`: The internal ID of the effect. - `name`: The effect name. See the [docs](https://docs.talon.one/docs/dev/integration-api/api-effects). - `profileintegrationid`: The ID of the customer profile, when applicable. - `props`: The [properties](https://docs.talon.one/docs/dev/integration-api/api-effects) of the effect. - `ruleindex`: The index of the rule. - `rulesetid`: The ID of the rule set. - `sessionid`: The internal ID of the session that triggered the effect. - `profileid`: The internal ID of the customer profile. - `sessionintegrationid`: The integration ID of the session. - `total_revenue`: The total revenue. - `store_integration_id`: The integration ID of the store. You choose this ID when you create a store. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: Filter results by campaign ID. - :type campaign_id: float - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param date_format: Determines the format of dates in the export document. - :type date_format: 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._export_effects_serialize( - application_id=application_id, - campaign_id=campaign_id, - created_before=created_before, - created_after=created_after, - date_format=date_format, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - 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 export_effects_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by campaign ID.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = 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[str]: - """Export triggered effects - - Download a CSV file containing the triggered effects that match the given attributes. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The generated file can contain the following columns: - `applicationid`: The ID of the Application. - `campaignid`: The ID of the campaign. - `couponid`: The ID of the coupon, when applicable to the effect. - `created`: The timestamp of the effect. - `event_type`: The name of the event. See the [docs](https://docs.talon.one/docs/dev/concepts/entities/events). - `eventid`: The internal ID of the effect. - `name`: The effect name. See the [docs](https://docs.talon.one/docs/dev/integration-api/api-effects). - `profileintegrationid`: The ID of the customer profile, when applicable. - `props`: The [properties](https://docs.talon.one/docs/dev/integration-api/api-effects) of the effect. - `ruleindex`: The index of the rule. - `rulesetid`: The ID of the rule set. - `sessionid`: The internal ID of the session that triggered the effect. - `profileid`: The internal ID of the customer profile. - `sessionintegrationid`: The integration ID of the session. - `total_revenue`: The total revenue. - `store_integration_id`: The integration ID of the store. You choose this ID when you create a store. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: Filter results by campaign ID. - :type campaign_id: float - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param date_format: Determines the format of dates in the export document. - :type date_format: 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._export_effects_serialize( - application_id=application_id, - campaign_id=campaign_id, - created_before=created_before, - created_after=created_after, - date_format=date_format, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - 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 export_effects_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by campaign ID.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = 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: - """Export triggered effects - - Download a CSV file containing the triggered effects that match the given attributes. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The generated file can contain the following columns: - `applicationid`: The ID of the Application. - `campaignid`: The ID of the campaign. - `couponid`: The ID of the coupon, when applicable to the effect. - `created`: The timestamp of the effect. - `event_type`: The name of the event. See the [docs](https://docs.talon.one/docs/dev/concepts/entities/events). - `eventid`: The internal ID of the effect. - `name`: The effect name. See the [docs](https://docs.talon.one/docs/dev/integration-api/api-effects). - `profileintegrationid`: The ID of the customer profile, when applicable. - `props`: The [properties](https://docs.talon.one/docs/dev/integration-api/api-effects) of the effect. - `ruleindex`: The index of the rule. - `rulesetid`: The ID of the rule set. - `sessionid`: The internal ID of the session that triggered the effect. - `profileid`: The internal ID of the customer profile. - `sessionintegrationid`: The integration ID of the session. - `total_revenue`: The total revenue. - `store_integration_id`: The integration ID of the store. You choose this ID when you create a store. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: Filter results by campaign ID. - :type campaign_id: float - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param date_format: Determines the format of dates in the export document. - :type date_format: 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._export_effects_serialize( - application_id=application_id, - campaign_id=campaign_id, - created_before=created_before, - created_after=created_after, - date_format=date_format, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_effects_serialize( - self, - application_id, - campaign_id, - created_before, - created_after, - date_format, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - if campaign_id is not None: - - _query_params.append(('campaignId', campaign_id)) - - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - 'createdBefore', - created_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdBefore', created_before)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdAfter', created_after)) - - if date_format is not None: - - _query_params.append(('dateFormat', date_format)) - - # 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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/export_effects', - 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 export_loyalty_balance( - self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - _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, - ) -> str: - """(Deprecated) Export customer loyalty balance to CSV - - ⚠️ Deprecation notice: Support for requests to this endpoint will end soon. To export customer loyalty balances to CSV, use the [Export customer loyalty balances to CSV](/management-api#tag/Loyalty/operation/exportLoyaltyBalances) endpoint. Download a CSV file containing the balance of each customer in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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 - warnings.warn("GET /v1/loyalty_programs/{loyaltyProgramId}/export_customer_balance is deprecated.", DeprecationWarning) - - _param = self._export_loyalty_balance_serialize( - loyalty_program_id=loyalty_program_id, - end_date=end_date, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponseWithStatus", - '401': "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 export_loyalty_balance_with_http_info( - self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - _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[str]: - """(Deprecated) Export customer loyalty balance to CSV - - ⚠️ Deprecation notice: Support for requests to this endpoint will end soon. To export customer loyalty balances to CSV, use the [Export customer loyalty balances to CSV](/management-api#tag/Loyalty/operation/exportLoyaltyBalances) endpoint. Download a CSV file containing the balance of each customer in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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 - warnings.warn("GET /v1/loyalty_programs/{loyaltyProgramId}/export_customer_balance is deprecated.", DeprecationWarning) - - _param = self._export_loyalty_balance_serialize( - loyalty_program_id=loyalty_program_id, - end_date=end_date, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponseWithStatus", - '401': "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 export_loyalty_balance_without_preload_content( - self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - _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: - """(Deprecated) Export customer loyalty balance to CSV - - ⚠️ Deprecation notice: Support for requests to this endpoint will end soon. To export customer loyalty balances to CSV, use the [Export customer loyalty balances to CSV](/management-api#tag/Loyalty/operation/exportLoyaltyBalances) endpoint. Download a CSV file containing the balance of each customer in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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 - warnings.warn("GET /v1/loyalty_programs/{loyaltyProgramId}/export_customer_balance is deprecated.", DeprecationWarning) - - _param = self._export_loyalty_balance_serialize( - loyalty_program_id=loyalty_program_id, - end_date=end_date, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_loyalty_balance_serialize( - self, - loyalty_program_id, - end_date, - _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 - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - # 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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/export_customer_balance', - 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 export_loyalty_balances( - self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - This parameter does not affect the `currentTier` field in the CSV file, which shows the customer's tier at the time of export. ")] = 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, - ) -> str: - """Export customer loyalty balances - - Download a CSV file containing the balance of each customer in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The generated file can contain the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subdleger, when applicatble. - `profileIntegrationID`: The integration ID of the customer profile. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points. - `currentTier`: The tier that the customer is in at the time of the export. - - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - This parameter does not affect the `currentTier` field in the CSV file, which shows the customer's tier at the time of export. - :type end_date: datetime - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._export_loyalty_balances_serialize( - loyalty_program_id=loyalty_program_id, - end_date=end_date, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponseWithStatus", - '401': "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 export_loyalty_balances_with_http_info( - self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - This parameter does not affect the `currentTier` field in the CSV file, which shows the customer's tier at the time of export. ")] = 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[str]: - """Export customer loyalty balances - - Download a CSV file containing the balance of each customer in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The generated file can contain the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subdleger, when applicatble. - `profileIntegrationID`: The integration ID of the customer profile. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points. - `currentTier`: The tier that the customer is in at the time of the export. - - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - This parameter does not affect the `currentTier` field in the CSV file, which shows the customer's tier at the time of export. - :type end_date: datetime - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._export_loyalty_balances_serialize( - loyalty_program_id=loyalty_program_id, - end_date=end_date, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponseWithStatus", - '401': "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 export_loyalty_balances_without_preload_content( - self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - This parameter does not affect the `currentTier` field in the CSV file, which shows the customer's tier at the time of export. ")] = 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: - """Export customer loyalty balances - - Download a CSV file containing the balance of each customer in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The generated file can contain the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subdleger, when applicatble. - `profileIntegrationID`: The integration ID of the customer profile. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points. - `currentTier`: The tier that the customer is in at the time of the export. - - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - This parameter does not affect the `currentTier` field in the CSV file, which shows the customer's tier at the time of export. - :type end_date: datetime - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._export_loyalty_balances_serialize( - loyalty_program_id=loyalty_program_id, - end_date=end_date, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_loyalty_balances_serialize( - self, - loyalty_program_id, - end_date, - _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 - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - # 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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/export_customer_balances', - 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 export_loyalty_card_balances( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="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. ")], - end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - _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, - ) -> str: - """Export all card transaction logs - - Download a CSV file containing the balances of all cards in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subdleger, when applicatble. - `cardIdentifier`: The alphanumeric identifier of the loyalty card. - `cardState`:The state of the loyalty card. It can be `active` or `inactive`. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points. - - :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 - :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._export_loyalty_card_balances_serialize( - loyalty_program_id=loyalty_program_id, - end_date=end_date, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponseWithStatus", - '401': "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 export_loyalty_card_balances_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="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. ")], - end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - _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[str]: - """Export all card transaction logs - - Download a CSV file containing the balances of all cards in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subdleger, when applicatble. - `cardIdentifier`: The alphanumeric identifier of the loyalty card. - `cardState`:The state of the loyalty card. It can be `active` or `inactive`. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points. - - :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 - :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._export_loyalty_card_balances_serialize( - loyalty_program_id=loyalty_program_id, - end_date=end_date, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponseWithStatus", - '401': "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 export_loyalty_card_balances_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="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. ")], - end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - _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: - """Export all card transaction logs - - Download a CSV file containing the balances of all cards in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subdleger, when applicatble. - `cardIdentifier`: The alphanumeric identifier of the loyalty card. - `cardState`:The state of the loyalty card. It can be `active` or `inactive`. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points. - - :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 - :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._export_loyalty_card_balances_serialize( - loyalty_program_id=loyalty_program_id, - end_date=end_date, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_loyalty_card_balances_serialize( - self, - loyalty_program_id, - end_date, - _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 - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - # 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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/export_card_balances', - 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 export_loyalty_card_ledger( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = 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, - ) -> str: - """Export card's ledger log - - Download a CSV file containing a loyalty card ledger log of the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param date_format: Determines the format of dates in the export document. - :type date_format: 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._export_loyalty_card_ledger_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - range_start=range_start, - range_end=range_end, - date_format=date_format, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '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 export_loyalty_card_ledger_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = 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[str]: - """Export card's ledger log - - Download a CSV file containing a loyalty card ledger log of the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param date_format: Determines the format of dates in the export document. - :type date_format: 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._export_loyalty_card_ledger_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - range_start=range_start, - range_end=range_end, - date_format=date_format, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '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 export_loyalty_card_ledger_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = 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: - """Export card's ledger log - - Download a CSV file containing a loyalty card ledger log of the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param date_format: Determines the format of dates in the export document. - :type date_format: 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._export_loyalty_card_ledger_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - range_start=range_start, - range_end=range_end, - date_format=date_format, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_loyalty_card_ledger_serialize( - self, - loyalty_program_id, - loyalty_card_id, - range_start, - range_end, - date_format, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - if loyalty_card_id is not None: - _path_params['loyaltyCardId'] = loyalty_card_id - # process the query parameters - if range_start is not None: - if isinstance(range_start, datetime): - _query_params.append( - ( - 'rangeStart', - range_start.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('rangeStart', range_start)) - - if range_end is not None: - if isinstance(range_end, datetime): - _query_params.append( - ( - 'rangeEnd', - range_end.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('rangeEnd', range_end)) - - if date_format is not None: - - _query_params.append(('dateFormat', date_format)) - - # 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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/export_log', - 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 export_loyalty_cards( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="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. ")], - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty card batch ID.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Only return loyalty cards created before this timestamp. **Note:** - This must be an RFC3339 timestamp string. ")] = None, - created_after: Annotated[Optional[datetime], Field(description="Only return loyalty cards created after this timestamp. **Note:** - This must be an RFC3339 timestamp string. ")] = None, - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = 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, - ) -> 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.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-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. - - :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 - :param batch_id: Filter results by loyalty card batch ID. - :type batch_id: str - :param created_before: Only return loyalty cards created before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - :type created_before: datetime - :param created_after: Only return loyalty cards created after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - :type created_after: datetime - :param date_format: Determines the format of dates in the export document. - :type date_format: 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._export_loyalty_cards_serialize( - loyalty_program_id=loyalty_program_id, - batch_id=batch_id, - created_before=created_before, - created_after=created_after, - date_format=date_format, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponseWithStatus", - '401': "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 export_loyalty_cards_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="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. ")], - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty card batch ID.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Only return loyalty cards created before this timestamp. **Note:** - This must be an RFC3339 timestamp string. ")] = None, - created_after: Annotated[Optional[datetime], Field(description="Only return loyalty cards created after this timestamp. **Note:** - This must be an RFC3339 timestamp string. ")] = None, - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = 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[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.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-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. - - :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 - :param batch_id: Filter results by loyalty card batch ID. - :type batch_id: str - :param created_before: Only return loyalty cards created before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - :type created_before: datetime - :param created_after: Only return loyalty cards created after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - :type created_after: datetime - :param date_format: Determines the format of dates in the export document. - :type date_format: 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._export_loyalty_cards_serialize( - loyalty_program_id=loyalty_program_id, - batch_id=batch_id, - created_before=created_before, - created_after=created_after, - date_format=date_format, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponseWithStatus", - '401': "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 export_loyalty_cards_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="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. ")], - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty card batch ID.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Only return loyalty cards created before this timestamp. **Note:** - This must be an RFC3339 timestamp string. ")] = None, - created_after: Annotated[Optional[datetime], Field(description="Only return loyalty cards created after this timestamp. **Note:** - This must be an RFC3339 timestamp string. ")] = None, - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = 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: - """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.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-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. - - :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 - :param batch_id: Filter results by loyalty card batch ID. - :type batch_id: str - :param created_before: Only return loyalty cards created before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - :type created_before: datetime - :param created_after: Only return loyalty cards created after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - :type created_after: datetime - :param date_format: Determines the format of dates in the export document. - :type date_format: 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._export_loyalty_cards_serialize( - loyalty_program_id=loyalty_program_id, - batch_id=batch_id, - created_before=created_before, - created_after=created_after, - date_format=date_format, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_loyalty_cards_serialize( - self, - loyalty_program_id, - batch_id, - created_before, - created_after, - date_format, - _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 - if batch_id is not None: - - _query_params.append(('batchId', batch_id)) - - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - 'createdBefore', - created_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdBefore', created_before)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdAfter', created_after)) - - if date_format is not None: - - _query_params.append(('dateFormat', date_format)) - - # 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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards/export', - 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 export_loyalty_ledger( - self, - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - 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. ")], - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = 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, - ) -> str: - """Export customer's transaction logs - - Download a CSV file containing a customer's transaction logs in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The generated file can contain the following columns: - `customerprofileid`: The ID of the profile. - `customersessionid`: The ID of the customer session. - `rulesetid`: The ID of the rule set. - `rulename`: The name of the rule. - `programid`: The ID of the loyalty program. - `type`: The transaction type, such as `addition` or `subtraction`. - `name`: The reason for the transaction. - `subledgerid`: The ID of the subledger, when applicable. - `startdate`: The start date of the program. - `expirydate`: The expiration date of the program. - `id`: The ID of the transaction. - `created`: The timestamp of the creation of the loyalty program. - `amount`: The number of points in that transaction. - `archived`: Whether the session related to the transaction is archived. - `campaignid`: The ID of the campaign. - `flags`: The flags of the transaction, when applicable. The `createsNegativeBalance` flag indicates whether the transaction results in a negative balance. - `transactionUUID`: Unique identifier of the transaction in the UUID format. - - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param date_format: Determines the format of dates in the export document. - :type date_format: 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._export_loyalty_ledger_serialize( - range_start=range_start, - range_end=range_end, - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - date_format=date_format, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - 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 export_loyalty_ledger_with_http_info( - self, - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - 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. ")], - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = 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[str]: - """Export customer's transaction logs - - Download a CSV file containing a customer's transaction logs in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The generated file can contain the following columns: - `customerprofileid`: The ID of the profile. - `customersessionid`: The ID of the customer session. - `rulesetid`: The ID of the rule set. - `rulename`: The name of the rule. - `programid`: The ID of the loyalty program. - `type`: The transaction type, such as `addition` or `subtraction`. - `name`: The reason for the transaction. - `subledgerid`: The ID of the subledger, when applicable. - `startdate`: The start date of the program. - `expirydate`: The expiration date of the program. - `id`: The ID of the transaction. - `created`: The timestamp of the creation of the loyalty program. - `amount`: The number of points in that transaction. - `archived`: Whether the session related to the transaction is archived. - `campaignid`: The ID of the campaign. - `flags`: The flags of the transaction, when applicable. The `createsNegativeBalance` flag indicates whether the transaction results in a negative balance. - `transactionUUID`: Unique identifier of the transaction in the UUID format. - - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param date_format: Determines the format of dates in the export document. - :type date_format: 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._export_loyalty_ledger_serialize( - range_start=range_start, - range_end=range_end, - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - date_format=date_format, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - 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 export_loyalty_ledger_without_preload_content( - self, - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - 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. ")], - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = 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: - """Export customer's transaction logs - - Download a CSV file containing a customer's transaction logs in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The generated file can contain the following columns: - `customerprofileid`: The ID of the profile. - `customersessionid`: The ID of the customer session. - `rulesetid`: The ID of the rule set. - `rulename`: The name of the rule. - `programid`: The ID of the loyalty program. - `type`: The transaction type, such as `addition` or `subtraction`. - `name`: The reason for the transaction. - `subledgerid`: The ID of the subledger, when applicable. - `startdate`: The start date of the program. - `expirydate`: The expiration date of the program. - `id`: The ID of the transaction. - `created`: The timestamp of the creation of the loyalty program. - `amount`: The number of points in that transaction. - `archived`: Whether the session related to the transaction is archived. - `campaignid`: The ID of the campaign. - `flags`: The flags of the transaction, when applicable. The `createsNegativeBalance` flag indicates whether the transaction results in a negative balance. - `transactionUUID`: Unique identifier of the transaction in the UUID format. - - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param date_format: Determines the format of dates in the export document. - :type date_format: 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._export_loyalty_ledger_serialize( - range_start=range_start, - range_end=range_end, - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - date_format=date_format, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_loyalty_ledger_serialize( - self, - range_start, - range_end, - loyalty_program_id, - integration_id, - date_format, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - if integration_id is not None: - _path_params['integrationId'] = integration_id - # process the query parameters - if range_start is not None: - if isinstance(range_start, datetime): - _query_params.append( - ( - 'rangeStart', - range_start.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('rangeStart', range_start)) - - if range_end is not None: - if isinstance(range_end, datetime): - _query_params.append( - ( - 'rangeEnd', - range_end.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('rangeEnd', range_end)) - - if date_format is not None: - - _query_params.append(('dateFormat', date_format)) - - # 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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/export_log', - 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 export_pool_giveaways( - self, - pool_id: Annotated[StrictInt, Field(description="The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section.")], - created_before: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string.")] = 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, - ) -> str: - """Export giveaway codes of a giveaway pool - - Download a CSV file containing the giveaway codes of a specific giveaway pool. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `id`: The internal ID of the giveaway. - `poolid`: The internal ID of the giveaway pool. - `code`: The giveaway code. - `startdate`: The validity start date in RFC3339 of the giveaway (can be empty). - `enddate`: The validity end date in RFC3339 of the giveaway (can be empty). - `attributes`: Any custom attributes associated with the giveaway code (can be empty). - `used`: An indication of whether the giveaway is already awarded. - `importid`: The ID of the import which created the giveaway. - `created`: The creation time of the giveaway code. - `profileintegrationid`: The third-party integration ID of the customer profile that was awarded the giveaway. Can be empty if the giveaway was not awarded. - `profileid`: The internal ID of the customer profile that was awarded the giveaway. Can be empty if the giveaway was not awarded or an internal ID does not exist. - - :param pool_id: The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - :type pool_id: int - :param created_before: Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. - :type created_before: datetime - :param created_after: Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. - :type created_after: datetime - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._export_pool_giveaways_serialize( - pool_id=pool_id, - created_before=created_before, - created_after=created_after, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "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 export_pool_giveaways_with_http_info( - self, - pool_id: Annotated[StrictInt, Field(description="The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section.")], - created_before: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string.")] = 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[str]: - """Export giveaway codes of a giveaway pool - - Download a CSV file containing the giveaway codes of a specific giveaway pool. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `id`: The internal ID of the giveaway. - `poolid`: The internal ID of the giveaway pool. - `code`: The giveaway code. - `startdate`: The validity start date in RFC3339 of the giveaway (can be empty). - `enddate`: The validity end date in RFC3339 of the giveaway (can be empty). - `attributes`: Any custom attributes associated with the giveaway code (can be empty). - `used`: An indication of whether the giveaway is already awarded. - `importid`: The ID of the import which created the giveaway. - `created`: The creation time of the giveaway code. - `profileintegrationid`: The third-party integration ID of the customer profile that was awarded the giveaway. Can be empty if the giveaway was not awarded. - `profileid`: The internal ID of the customer profile that was awarded the giveaway. Can be empty if the giveaway was not awarded or an internal ID does not exist. - - :param pool_id: The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - :type pool_id: int - :param created_before: Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. - :type created_before: datetime - :param created_after: Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. - :type created_after: datetime - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._export_pool_giveaways_serialize( - pool_id=pool_id, - created_before=created_before, - created_after=created_after, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "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 export_pool_giveaways_without_preload_content( - self, - pool_id: Annotated[StrictInt, Field(description="The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section.")], - created_before: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string.")] = 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: - """Export giveaway codes of a giveaway pool - - Download a CSV file containing the giveaway codes of a specific giveaway pool. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `id`: The internal ID of the giveaway. - `poolid`: The internal ID of the giveaway pool. - `code`: The giveaway code. - `startdate`: The validity start date in RFC3339 of the giveaway (can be empty). - `enddate`: The validity end date in RFC3339 of the giveaway (can be empty). - `attributes`: Any custom attributes associated with the giveaway code (can be empty). - `used`: An indication of whether the giveaway is already awarded. - `importid`: The ID of the import which created the giveaway. - `created`: The creation time of the giveaway code. - `profileintegrationid`: The third-party integration ID of the customer profile that was awarded the giveaway. Can be empty if the giveaway was not awarded. - `profileid`: The internal ID of the customer profile that was awarded the giveaway. Can be empty if the giveaway was not awarded or an internal ID does not exist. - - :param pool_id: The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - :type pool_id: int - :param created_before: Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. - :type created_before: datetime - :param created_after: Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. - :type created_after: datetime - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._export_pool_giveaways_serialize( - pool_id=pool_id, - created_before=created_before, - created_after=created_after, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - '400': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_pool_giveaways_serialize( - self, - pool_id, - created_before, - created_after, - _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 pool_id is not None: - _path_params['poolId'] = pool_id - # process the query parameters - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - 'createdBefore', - created_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdBefore', created_before)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdAfter', created_after)) - - # 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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/giveaways/pools/{poolId}/export', - 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 export_referrals( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by campaign ID.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="- `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="- `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. ")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of referrals")] = None, - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = 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, - ) -> str: - """Export referrals - - Download a CSV file containing the referrals that match the given parameters. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `code`: The referral code. - `advocateprofileintegrationid`: The profile ID of the advocate. - `startdate`: The start date in RFC3339 of the code redemption period. - `expirydate`: The end date in RFC3339 of the code redemption period. - `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. - `attributes`: A json object describing _custom_ referral attribute names and their values. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: Filter results by campaign ID. - :type campaign_id: float - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: - `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. - :type valid: str - :param usable: - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. - :type usable: str - :param batch_id: Filter results by batches of referrals - :type batch_id: str - :param date_format: Determines the format of dates in the export document. - :type date_format: 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._export_referrals_serialize( - application_id=application_id, - campaign_id=campaign_id, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - batch_id=batch_id, - date_format=date_format, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - 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 export_referrals_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by campaign ID.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="- `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="- `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. ")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of referrals")] = None, - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = 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[str]: - """Export referrals - - Download a CSV file containing the referrals that match the given parameters. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `code`: The referral code. - `advocateprofileintegrationid`: The profile ID of the advocate. - `startdate`: The start date in RFC3339 of the code redemption period. - `expirydate`: The end date in RFC3339 of the code redemption period. - `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. - `attributes`: A json object describing _custom_ referral attribute names and their values. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: Filter results by campaign ID. - :type campaign_id: float - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: - `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. - :type valid: str - :param usable: - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. - :type usable: str - :param batch_id: Filter results by batches of referrals - :type batch_id: str - :param date_format: Determines the format of dates in the export document. - :type date_format: 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._export_referrals_serialize( - application_id=application_id, - campaign_id=campaign_id, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - batch_id=batch_id, - date_format=date_format, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - 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 export_referrals_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by campaign ID.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="- `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="- `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. ")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of referrals")] = None, - date_format: Annotated[Optional[StrictStr], Field(description="Determines the format of dates in the export document.")] = 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: - """Export referrals - - Download a CSV file containing the referrals that match the given parameters. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `code`: The referral code. - `advocateprofileintegrationid`: The profile ID of the advocate. - `startdate`: The start date in RFC3339 of the code redemption period. - `expirydate`: The end date in RFC3339 of the code redemption period. - `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. - `attributes`: A json object describing _custom_ referral attribute names and their values. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: Filter results by campaign ID. - :type campaign_id: float - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: - `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. - :type valid: str - :param usable: - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. - :type usable: str - :param batch_id: Filter results by batches of referrals - :type batch_id: str - :param date_format: Determines the format of dates in the export document. - :type date_format: 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._export_referrals_serialize( - application_id=application_id, - campaign_id=campaign_id, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - batch_id=batch_id, - date_format=date_format, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _export_referrals_serialize( - self, - application_id, - campaign_id, - created_before, - created_after, - valid, - usable, - batch_id, - date_format, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - if campaign_id is not None: - - _query_params.append(('campaignId', campaign_id)) - - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - 'createdBefore', - created_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdBefore', created_before)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdAfter', created_after)) - - if valid is not None: - - _query_params.append(('valid', valid)) - - if usable is not None: - - _query_params.append(('usable', usable)) - - if batch_id is not None: - - _query_params.append(('batchId', batch_id)) - - if date_format is not None: - - _query_params.append(('dateFormat', date_format)) - - # 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/csv' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/export_referrals', - 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 generate_coupon_rejections( - self, - session_integration_id: Annotated[StrictStr, Field(description="The integration ID of the session to summarize.")], - application_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by Application ID.")] = None, - language: Annotated[Optional[StrictStr], Field(description="The [ISO-639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code of the language in which the summary will be generated. ")] = None, - coupon_code: Annotated[Optional[StrictStr], Field(description="The coupon code for which to get the rejection reason.")] = 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, - ) -> GenerateCouponRejections200Response: - """Summarize coupon redemption failures in session - - Create a summary of the reasons for coupon redemption failures in a given customer session. - - :param session_integration_id: The integration ID of the session to summarize. (required) - :type session_integration_id: str - :param application_id: Filter results by Application ID. - :type application_id: float - :param language: The [ISO-639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code of the language in which the summary will be generated. - :type language: str - :param coupon_code: The coupon code for which to get the rejection reason. - :type coupon_code: 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._generate_coupon_rejections_serialize( - session_integration_id=session_integration_id, - application_id=application_id, - language=language, - coupon_code=coupon_code, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GenerateCouponRejections200Response", - } - 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 generate_coupon_rejections_with_http_info( - self, - session_integration_id: Annotated[StrictStr, Field(description="The integration ID of the session to summarize.")], - application_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by Application ID.")] = None, - language: Annotated[Optional[StrictStr], Field(description="The [ISO-639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code of the language in which the summary will be generated. ")] = None, - coupon_code: Annotated[Optional[StrictStr], Field(description="The coupon code for which to get the rejection reason.")] = 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[GenerateCouponRejections200Response]: - """Summarize coupon redemption failures in session - - Create a summary of the reasons for coupon redemption failures in a given customer session. - - :param session_integration_id: The integration ID of the session to summarize. (required) - :type session_integration_id: str - :param application_id: Filter results by Application ID. - :type application_id: float - :param language: The [ISO-639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code of the language in which the summary will be generated. - :type language: str - :param coupon_code: The coupon code for which to get the rejection reason. - :type coupon_code: 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._generate_coupon_rejections_serialize( - session_integration_id=session_integration_id, - application_id=application_id, - language=language, - coupon_code=coupon_code, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GenerateCouponRejections200Response", - } - 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 generate_coupon_rejections_without_preload_content( - self, - session_integration_id: Annotated[StrictStr, Field(description="The integration ID of the session to summarize.")], - application_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by Application ID.")] = None, - language: Annotated[Optional[StrictStr], Field(description="The [ISO-639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code of the language in which the summary will be generated. ")] = None, - coupon_code: Annotated[Optional[StrictStr], Field(description="The coupon code for which to get the rejection reason.")] = 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: - """Summarize coupon redemption failures in session - - Create a summary of the reasons for coupon redemption failures in a given customer session. - - :param session_integration_id: The integration ID of the session to summarize. (required) - :type session_integration_id: str - :param application_id: Filter results by Application ID. - :type application_id: float - :param language: The [ISO-639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code of the language in which the summary will be generated. - :type language: str - :param coupon_code: The coupon code for which to get the rejection reason. - :type coupon_code: 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._generate_coupon_rejections_serialize( - session_integration_id=session_integration_id, - application_id=application_id, - language=language, - coupon_code=coupon_code, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GenerateCouponRejections200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _generate_coupon_rejections_serialize( - self, - session_integration_id, - application_id, - language, - coupon_code, - _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 session_integration_id is not None: - - _query_params.append(('sessionIntegrationId', session_integration_id)) - - if application_id is not None: - - _query_params.append(('applicationId', application_id)) - - if language is not None: - - _query_params.append(('language', language)) - - if coupon_code is not None: - - _query_params.append(('couponCode', coupon_code)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/coupon_rejections', - 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_access_logs_without_total_count( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - path: Annotated[Optional[StrictStr], Field(description="Only return results where the request path matches the given regular expression.")] = None, - method: Annotated[Optional[StrictStr], Field(description="Only return results where the request method matches the given regular expression.")] = None, - status: Annotated[Optional[StrictStr], Field(description="Filter results by HTTP status codes.")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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, - ) -> GetAccessLogsWithoutTotalCount200Response: - """Get access logs for Application - - Retrieve the list of API calls sent to the specified Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param path: Only return results where the request path matches the given regular expression. - :type path: str - :param method: Only return results where the request method matches the given regular expression. - :type method: str - :param status: Filter results by HTTP status codes. - :type status: str - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_access_logs_without_total_count_serialize( - application_id=application_id, - range_start=range_start, - range_end=range_end, - path=path, - method=method, - status=status, - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAccessLogsWithoutTotalCount200Response", - } - 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_access_logs_without_total_count_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - path: Annotated[Optional[StrictStr], Field(description="Only return results where the request path matches the given regular expression.")] = None, - method: Annotated[Optional[StrictStr], Field(description="Only return results where the request method matches the given regular expression.")] = None, - status: Annotated[Optional[StrictStr], Field(description="Filter results by HTTP status codes.")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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[GetAccessLogsWithoutTotalCount200Response]: - """Get access logs for Application - - Retrieve the list of API calls sent to the specified Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param path: Only return results where the request path matches the given regular expression. - :type path: str - :param method: Only return results where the request method matches the given regular expression. - :type method: str - :param status: Filter results by HTTP status codes. - :type status: str - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_access_logs_without_total_count_serialize( - application_id=application_id, - range_start=range_start, - range_end=range_end, - path=path, - method=method, - status=status, - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAccessLogsWithoutTotalCount200Response", - } - 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_access_logs_without_total_count_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - path: Annotated[Optional[StrictStr], Field(description="Only return results where the request path matches the given regular expression.")] = None, - method: Annotated[Optional[StrictStr], Field(description="Only return results where the request method matches the given regular expression.")] = None, - status: Annotated[Optional[StrictStr], Field(description="Filter results by HTTP status codes.")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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 access logs for Application - - Retrieve the list of API calls sent to the specified Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param path: Only return results where the request path matches the given regular expression. - :type path: str - :param method: Only return results where the request method matches the given regular expression. - :type method: str - :param status: Filter results by HTTP status codes. - :type status: str - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_access_logs_without_total_count_serialize( - application_id=application_id, - range_start=range_start, - range_end=range_end, - path=path, - method=method, - status=status, - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAccessLogsWithoutTotalCount200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_access_logs_without_total_count_serialize( - self, - application_id, - range_start, - range_end, - path, - method, - status, - page_size, - skip, - sort, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - if path is not None: - - _query_params.append(('path', path)) - - if method is not None: - - _query_params.append(('method', method)) - - if status is not None: - - _query_params.append(('status', status)) - - if range_start is not None: - if isinstance(range_start, datetime): - _query_params.append( - ( - 'rangeStart', - range_start.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('rangeStart', range_start)) - - if range_end is not None: - if isinstance(range_end, datetime): - _query_params.append( - ( - 'rangeEnd', - range_end.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('rangeEnd', range_end)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/access_logs/no_total', - 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_account( - self, - account_id: Annotated[StrictInt, Field(description="The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. ")], - _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, - ) -> Account: - """Get account details - - Return the details of your companies Talon.One account. - - :param account_id: The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) - :type account_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_account_serialize( - account_id=account_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Account", - } - 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_account_with_http_info( - self, - account_id: Annotated[StrictInt, Field(description="The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. ")], - _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[Account]: - """Get account details - - Return the details of your companies Talon.One account. - - :param account_id: The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) - :type account_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_account_serialize( - account_id=account_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Account", - } - 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_account_without_preload_content( - self, - account_id: Annotated[StrictInt, Field(description="The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. ")], - _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 account details - - Return the details of your companies Talon.One account. - - :param account_id: The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) - :type account_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_account_serialize( - account_id=account_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Account", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_account_serialize( - self, - account_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 account_id is not None: - _path_params['accountId'] = account_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/accounts/{accountId}', - 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_account_analytics( - self, - account_id: Annotated[StrictInt, Field(description="The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. ")], - _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, - ) -> AccountAnalytics: - """Get account analytics - - Return the analytics of your Talon.One account. - - :param account_id: The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) - :type account_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_account_analytics_serialize( - account_id=account_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "AccountAnalytics", - } - 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_account_analytics_with_http_info( - self, - account_id: Annotated[StrictInt, Field(description="The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. ")], - _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[AccountAnalytics]: - """Get account analytics - - Return the analytics of your Talon.One account. - - :param account_id: The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) - :type account_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_account_analytics_serialize( - account_id=account_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "AccountAnalytics", - } - 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_account_analytics_without_preload_content( - self, - account_id: Annotated[StrictInt, Field(description="The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. ")], - _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 account analytics - - Return the analytics of your Talon.One account. - - :param account_id: The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) - :type account_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_account_analytics_serialize( - account_id=account_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "AccountAnalytics", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_account_analytics_serialize( - self, - account_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 account_id is not None: - _path_params['accountId'] = account_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/accounts/{accountId}/analytics', - 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_account_collection( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Collection: - """Get account-level collection - - Retrieve a given account-level collection. - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_account_collection_serialize( - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Collection", - '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_account_collection_with_http_info( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Collection]: - """Get account-level collection - - Retrieve a given account-level collection. - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_account_collection_serialize( - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Collection", - '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_account_collection_without_preload_content( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get account-level collection - - Retrieve a given account-level collection. - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_account_collection_serialize( - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Collection", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_account_collection_serialize( - self, - collection_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 collection_id is not None: - _path_params['collectionId'] = collection_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/collections/{collectionId}', - 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_achievement( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - achievement_id: Annotated[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/listAchievements) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Achievement: - """Get achievement - - Get the details of a specific achievement. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param achievement_id: The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) - :type achievement_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_achievement_serialize( - application_id=application_id, - campaign_id=campaign_id, - achievement_id=achievement_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Achievement", - '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 get_achievement_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - achievement_id: Annotated[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/listAchievements) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Achievement]: - """Get achievement - - Get the details of a specific achievement. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param achievement_id: The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) - :type achievement_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_achievement_serialize( - application_id=application_id, - campaign_id=campaign_id, - achievement_id=achievement_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Achievement", - '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 get_achievement_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - achievement_id: Annotated[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/listAchievements) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get achievement - - Get the details of a specific achievement. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param achievement_id: The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) - :type achievement_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_achievement_serialize( - application_id=application_id, - campaign_id=campaign_id, - achievement_id=achievement_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Achievement", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_achievement_serialize( - self, - application_id, - campaign_id, - achievement_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - if achievement_id is not None: - _path_params['achievementId'] = achievement_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}', - 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_additional_cost( - self, - additional_cost_id: Annotated[StrictInt, Field(description="The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. ")], - _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, - ) -> AccountAdditionalCost: - """Get additional cost - - Returns the additional cost. - - :param additional_cost_id: The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. (required) - :type additional_cost_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_additional_cost_serialize( - additional_cost_id=additional_cost_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "AccountAdditionalCost", - } - 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_additional_cost_with_http_info( - self, - additional_cost_id: Annotated[StrictInt, Field(description="The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. ")], - _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[AccountAdditionalCost]: - """Get additional cost - - Returns the additional cost. - - :param additional_cost_id: The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. (required) - :type additional_cost_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_additional_cost_serialize( - additional_cost_id=additional_cost_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "AccountAdditionalCost", - } - 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_additional_cost_without_preload_content( - self, - additional_cost_id: Annotated[StrictInt, Field(description="The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. ")], - _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 additional cost - - Returns the additional cost. - - :param additional_cost_id: The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. (required) - :type additional_cost_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_additional_cost_serialize( - additional_cost_id=additional_cost_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "AccountAdditionalCost", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_additional_cost_serialize( - self, - additional_cost_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 additional_cost_id is not None: - _path_params['additionalCostId'] = additional_cost_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/additional_costs/{additionalCostId}', - 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_additional_costs( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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, - ) -> GetAdditionalCosts200Response: - """List additional costs - - Returns all the defined additional costs for the account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_additional_costs_serialize( - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAdditionalCosts200Response", - } - 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_additional_costs_with_http_info( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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[GetAdditionalCosts200Response]: - """List additional costs - - Returns all the defined additional costs for the account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_additional_costs_serialize( - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAdditionalCosts200Response", - } - 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_additional_costs_without_preload_content( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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: - """List additional costs - - Returns all the defined additional costs for the account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_additional_costs_serialize( - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAdditionalCosts200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_additional_costs_serialize( - self, - page_size, - skip, - sort, - _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 page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/additional_costs', - 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_application( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - _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, - ) -> Application: - """Get Application - - Get the application specified by the ID. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_application_serialize( - application_id=application_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Application", - } - 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_application_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - _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[Application]: - """Get Application - - Get the application specified by the ID. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_application_serialize( - application_id=application_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Application", - } - 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_application_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - _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 Application - - Get the application specified by the ID. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_application_serialize( - application_id=application_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Application", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_application_serialize( - self, - application_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}', - 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_application_api_health( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - _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, - ) -> ApplicationApiHealth: - """Get Application health - - Display the health of the Application and show the last time the Application was used. You can also find this information in the Campaign Manager. In your Application, click **Settings** > **Integration API Keys**. See the [docs](https://docs.talon.one/docs/dev/tutorials/monitoring-integration-status). - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_application_api_health_serialize( - application_id=application_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationApiHealth", - } - 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_application_api_health_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - _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[ApplicationApiHealth]: - """Get Application health - - Display the health of the Application and show the last time the Application was used. You can also find this information in the Campaign Manager. In your Application, click **Settings** > **Integration API Keys**. See the [docs](https://docs.talon.one/docs/dev/tutorials/monitoring-integration-status). - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_application_api_health_serialize( - application_id=application_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationApiHealth", - } - 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_application_api_health_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - _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 Application health - - Display the health of the Application and show the last time the Application was used. You can also find this information in the Campaign Manager. In your Application, click **Settings** > **Integration API Keys**. See the [docs](https://docs.talon.one/docs/dev/tutorials/monitoring-integration-status). - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_application_api_health_serialize( - application_id=application_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationApiHealth", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_application_api_health_serialize( - self, - application_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/health_report', - 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_application_customer( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - customer_id: Annotated[StrictInt, Field(description="The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApplicationCustomer: - """Get application's customer - - Retrieve the customers of the specified application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param customer_id: The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type customer_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_application_customer_serialize( - application_id=application_id, - customer_id=customer_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationCustomer", - } - 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_application_customer_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - customer_id: Annotated[StrictInt, Field(description="The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ApplicationCustomer]: - """Get application's customer - - Retrieve the customers of the specified application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param customer_id: The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type customer_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_application_customer_serialize( - application_id=application_id, - customer_id=customer_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationCustomer", - } - 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_application_customer_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - customer_id: Annotated[StrictInt, Field(description="The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get application's customer - - Retrieve the customers of the specified application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param customer_id: The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type customer_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_application_customer_serialize( - application_id=application_id, - customer_id=customer_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationCustomer", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_application_customer_serialize( - self, - application_id, - customer_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if customer_id is not None: - _path_params['customerId'] = customer_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/customers/{customerId}', - 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_application_customer_friends( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - integration_id: Annotated[StrictStr, Field(description="The Integration ID of the Advocate's Profile.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = 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, - ) -> GetApplicationCustomerFriends200Response: - """List friends referred by customer profile - - List the friends referred by the specified customer profile in this Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param integration_id: The Integration ID of the Advocate's Profile. (required) - :type integration_id: str - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: 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._get_application_customer_friends_serialize( - application_id=application_id, - integration_id=integration_id, - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationCustomerFriends200Response", - } - 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_application_customer_friends_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - integration_id: Annotated[StrictStr, Field(description="The Integration ID of the Advocate's Profile.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = 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[GetApplicationCustomerFriends200Response]: - """List friends referred by customer profile - - List the friends referred by the specified customer profile in this Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param integration_id: The Integration ID of the Advocate's Profile. (required) - :type integration_id: str - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: 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._get_application_customer_friends_serialize( - application_id=application_id, - integration_id=integration_id, - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationCustomerFriends200Response", - } - 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_application_customer_friends_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - integration_id: Annotated[StrictStr, Field(description="The Integration ID of the Advocate's Profile.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = 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: - """List friends referred by customer profile - - List the friends referred by the specified customer profile in this Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param integration_id: The Integration ID of the Advocate's Profile. (required) - :type integration_id: str - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: 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._get_application_customer_friends_serialize( - application_id=application_id, - integration_id=integration_id, - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationCustomerFriends200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_application_customer_friends_serialize( - self, - application_id, - integration_id, - page_size, - skip, - sort, - with_total_result_size, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if integration_id is not None: - _path_params['integrationId'] = integration_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if with_total_result_size is not None: - - _query_params.append(('withTotalResultSize', with_total_result_size)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/profile/{integrationId}/friends', - 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_application_customers( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - integration_id: Annotated[Optional[StrictStr], Field(description="Filter results performing an exact matching against the profile integration identifier.")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = 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, - ) -> GetApplicationCustomers200Response: - """List application's customers - - List all the customers of the specified application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param integration_id: Filter results performing an exact matching against the profile integration identifier. - :type integration_id: str - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: 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._get_application_customers_serialize( - application_id=application_id, - integration_id=integration_id, - page_size=page_size, - skip=skip, - with_total_result_size=with_total_result_size, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationCustomers200Response", - } - 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_application_customers_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - integration_id: Annotated[Optional[StrictStr], Field(description="Filter results performing an exact matching against the profile integration identifier.")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = 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[GetApplicationCustomers200Response]: - """List application's customers - - List all the customers of the specified application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param integration_id: Filter results performing an exact matching against the profile integration identifier. - :type integration_id: str - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: 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._get_application_customers_serialize( - application_id=application_id, - integration_id=integration_id, - page_size=page_size, - skip=skip, - with_total_result_size=with_total_result_size, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationCustomers200Response", - } - 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_application_customers_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - integration_id: Annotated[Optional[StrictStr], Field(description="Filter results performing an exact matching against the profile integration identifier.")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = 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: - """List application's customers - - List all the customers of the specified application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param integration_id: Filter results performing an exact matching against the profile integration identifier. - :type integration_id: str - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: 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._get_application_customers_serialize( - application_id=application_id, - integration_id=integration_id, - page_size=page_size, - skip=skip, - with_total_result_size=with_total_result_size, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationCustomers200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_application_customers_serialize( - self, - application_id, - integration_id, - page_size, - skip, - with_total_result_size, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - if integration_id is not None: - - _query_params.append(('integrationId', integration_id)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if with_total_result_size is not None: - - _query_params.append(('withTotalResultSize', with_total_result_size)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/customers', - 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_application_customers_by_attributes( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - customer_profile_search_query: Annotated[CustomerProfileSearchQuery, Field(description="body")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = 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, - ) -> GetApplicationCustomersByAttributes200Response: - """List application customers matching the given attributes - - Get a list of the application customers matching the provided criteria. The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param customer_profile_search_query: body (required) - :type customer_profile_search_query: CustomerProfileSearchQuery - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: 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._get_application_customers_by_attributes_serialize( - application_id=application_id, - customer_profile_search_query=customer_profile_search_query, - page_size=page_size, - skip=skip, - with_total_result_size=with_total_result_size, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationCustomersByAttributes200Response", - } - 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_application_customers_by_attributes_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - customer_profile_search_query: Annotated[CustomerProfileSearchQuery, Field(description="body")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = 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[GetApplicationCustomersByAttributes200Response]: - """List application customers matching the given attributes - - Get a list of the application customers matching the provided criteria. The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param customer_profile_search_query: body (required) - :type customer_profile_search_query: CustomerProfileSearchQuery - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: 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._get_application_customers_by_attributes_serialize( - application_id=application_id, - customer_profile_search_query=customer_profile_search_query, - page_size=page_size, - skip=skip, - with_total_result_size=with_total_result_size, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationCustomersByAttributes200Response", - } - 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_application_customers_by_attributes_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - customer_profile_search_query: Annotated[CustomerProfileSearchQuery, Field(description="body")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = 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: - """List application customers matching the given attributes - - Get a list of the application customers matching the provided criteria. The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param customer_profile_search_query: body (required) - :type customer_profile_search_query: CustomerProfileSearchQuery - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: 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._get_application_customers_by_attributes_serialize( - application_id=application_id, - customer_profile_search_query=customer_profile_search_query, - page_size=page_size, - skip=skip, - with_total_result_size=with_total_result_size, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationCustomersByAttributes200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_application_customers_by_attributes_serialize( - self, - application_id, - customer_profile_search_query, - page_size, - skip, - with_total_result_size, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if with_total_result_size is not None: - - _query_params.append(('withTotalResultSize', with_total_result_size)) - - # process the header parameters - # process the form parameters - # process the body parameter - if customer_profile_search_query is not None: - _body_params = customer_profile_search_query - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/applications/{applicationId}/customer_search', - 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_application_event_types( - self, - 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=1000, 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, - 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, - 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, - ) -> GetApplicationEventTypes200Response: - """List Applications event types - - Get all of the distinct values of the Event `type` property for events recorded in the application. See also: [Track an event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_application_event_types_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationEventTypes200Response", - } - 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_application_event_types_with_http_info( - self, - 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=1000, 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, - 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, - 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[GetApplicationEventTypes200Response]: - """List Applications event types - - Get all of the distinct values of the Event `type` property for events recorded in the application. See also: [Track an event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_application_event_types_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationEventTypes200Response", - } - 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_application_event_types_without_preload_content( - self, - 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=1000, 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, - 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, - 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: - """List Applications event types - - Get all of the distinct values of the Event `type` property for events recorded in the application. See also: [Track an event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_application_event_types_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationEventTypes200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_application_event_types_serialize( - self, - application_id, - page_size, - skip, - sort, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/event_types', - 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_application_events_without_total_count( - self, - 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=1000, 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, - 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, - type: Annotated[Optional[StrictStr], Field(description="Comma-separated list of types by which to filter events. Must be exact match(es).")] = None, - created_before: Annotated[Optional[datetime], Field(description="Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - session: Annotated[Optional[StrictStr], Field(description="Session integration ID filter for events. Must be exact match.")] = None, - profile: Annotated[Optional[StrictStr], Field(description="Profile integration ID filter for events. Must be exact match.")] = None, - customer_name: Annotated[Optional[Annotated[str, Field(min_length=2, strict=True)]], Field(description="Customer name filter for events. Will match substrings case-insensitively.")] = None, - customer_email: Annotated[Optional[Annotated[str, Field(min_length=2, strict=True)]], Field(description="Customer e-mail address filter for events. Will match substrings case-insensitively.")] = None, - coupon_code: Annotated[Optional[StrictStr], Field(description="Coupon code")] = None, - referral_code: Annotated[Optional[StrictStr], Field(description="Referral code")] = None, - rule_query: Annotated[Optional[StrictStr], Field(description="Rule name filter for events")] = None, - campaign_query: Annotated[Optional[StrictStr], Field(description="Campaign name filter for events")] = None, - effect_type: Annotated[Optional[StrictStr], Field(description="The type of effect that was triggered. See [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects).")] = 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, - ) -> GetApplicationEventsWithoutTotalCount200Response: - """List Applications events - - Lists all events recorded for an application. Instead of having the total number of results in the response, this endpoint only mentions whether there are more results. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param type: Comma-separated list of types by which to filter events. Must be exact match(es). - :type type: str - :param created_before: Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param session: Session integration ID filter for events. Must be exact match. - :type session: str - :param profile: Profile integration ID filter for events. Must be exact match. - :type profile: str - :param customer_name: Customer name filter for events. Will match substrings case-insensitively. - :type customer_name: str - :param customer_email: Customer e-mail address filter for events. Will match substrings case-insensitively. - :type customer_email: str - :param coupon_code: Coupon code - :type coupon_code: str - :param referral_code: Referral code - :type referral_code: str - :param rule_query: Rule name filter for events - :type rule_query: str - :param campaign_query: Campaign name filter for events - :type campaign_query: str - :param effect_type: The type of effect that was triggered. See [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects). - :type effect_type: 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_application_events_without_total_count_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - type=type, - created_before=created_before, - created_after=created_after, - session=session, - profile=profile, - customer_name=customer_name, - customer_email=customer_email, - coupon_code=coupon_code, - referral_code=referral_code, - rule_query=rule_query, - campaign_query=campaign_query, - effect_type=effect_type, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationEventsWithoutTotalCount200Response", - } - 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_application_events_without_total_count_with_http_info( - self, - 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=1000, 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, - 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, - type: Annotated[Optional[StrictStr], Field(description="Comma-separated list of types by which to filter events. Must be exact match(es).")] = None, - created_before: Annotated[Optional[datetime], Field(description="Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - session: Annotated[Optional[StrictStr], Field(description="Session integration ID filter for events. Must be exact match.")] = None, - profile: Annotated[Optional[StrictStr], Field(description="Profile integration ID filter for events. Must be exact match.")] = None, - customer_name: Annotated[Optional[Annotated[str, Field(min_length=2, strict=True)]], Field(description="Customer name filter for events. Will match substrings case-insensitively.")] = None, - customer_email: Annotated[Optional[Annotated[str, Field(min_length=2, strict=True)]], Field(description="Customer e-mail address filter for events. Will match substrings case-insensitively.")] = None, - coupon_code: Annotated[Optional[StrictStr], Field(description="Coupon code")] = None, - referral_code: Annotated[Optional[StrictStr], Field(description="Referral code")] = None, - rule_query: Annotated[Optional[StrictStr], Field(description="Rule name filter for events")] = None, - campaign_query: Annotated[Optional[StrictStr], Field(description="Campaign name filter for events")] = None, - effect_type: Annotated[Optional[StrictStr], Field(description="The type of effect that was triggered. See [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects).")] = 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[GetApplicationEventsWithoutTotalCount200Response]: - """List Applications events - - Lists all events recorded for an application. Instead of having the total number of results in the response, this endpoint only mentions whether there are more results. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param type: Comma-separated list of types by which to filter events. Must be exact match(es). - :type type: str - :param created_before: Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param session: Session integration ID filter for events. Must be exact match. - :type session: str - :param profile: Profile integration ID filter for events. Must be exact match. - :type profile: str - :param customer_name: Customer name filter for events. Will match substrings case-insensitively. - :type customer_name: str - :param customer_email: Customer e-mail address filter for events. Will match substrings case-insensitively. - :type customer_email: str - :param coupon_code: Coupon code - :type coupon_code: str - :param referral_code: Referral code - :type referral_code: str - :param rule_query: Rule name filter for events - :type rule_query: str - :param campaign_query: Campaign name filter for events - :type campaign_query: str - :param effect_type: The type of effect that was triggered. See [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects). - :type effect_type: 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_application_events_without_total_count_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - type=type, - created_before=created_before, - created_after=created_after, - session=session, - profile=profile, - customer_name=customer_name, - customer_email=customer_email, - coupon_code=coupon_code, - referral_code=referral_code, - rule_query=rule_query, - campaign_query=campaign_query, - effect_type=effect_type, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationEventsWithoutTotalCount200Response", - } - 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_application_events_without_total_count_without_preload_content( - self, - 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=1000, 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, - 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, - type: Annotated[Optional[StrictStr], Field(description="Comma-separated list of types by which to filter events. Must be exact match(es).")] = None, - created_before: Annotated[Optional[datetime], Field(description="Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - session: Annotated[Optional[StrictStr], Field(description="Session integration ID filter for events. Must be exact match.")] = None, - profile: Annotated[Optional[StrictStr], Field(description="Profile integration ID filter for events. Must be exact match.")] = None, - customer_name: Annotated[Optional[Annotated[str, Field(min_length=2, strict=True)]], Field(description="Customer name filter for events. Will match substrings case-insensitively.")] = None, - customer_email: Annotated[Optional[Annotated[str, Field(min_length=2, strict=True)]], Field(description="Customer e-mail address filter for events. Will match substrings case-insensitively.")] = None, - coupon_code: Annotated[Optional[StrictStr], Field(description="Coupon code")] = None, - referral_code: Annotated[Optional[StrictStr], Field(description="Referral code")] = None, - rule_query: Annotated[Optional[StrictStr], Field(description="Rule name filter for events")] = None, - campaign_query: Annotated[Optional[StrictStr], Field(description="Campaign name filter for events")] = None, - effect_type: Annotated[Optional[StrictStr], Field(description="The type of effect that was triggered. See [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects).")] = 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: - """List Applications events - - Lists all events recorded for an application. Instead of having the total number of results in the response, this endpoint only mentions whether there are more results. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param type: Comma-separated list of types by which to filter events. Must be exact match(es). - :type type: str - :param created_before: Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param session: Session integration ID filter for events. Must be exact match. - :type session: str - :param profile: Profile integration ID filter for events. Must be exact match. - :type profile: str - :param customer_name: Customer name filter for events. Will match substrings case-insensitively. - :type customer_name: str - :param customer_email: Customer e-mail address filter for events. Will match substrings case-insensitively. - :type customer_email: str - :param coupon_code: Coupon code - :type coupon_code: str - :param referral_code: Referral code - :type referral_code: str - :param rule_query: Rule name filter for events - :type rule_query: str - :param campaign_query: Campaign name filter for events - :type campaign_query: str - :param effect_type: The type of effect that was triggered. See [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects). - :type effect_type: 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_application_events_without_total_count_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - type=type, - created_before=created_before, - created_after=created_after, - session=session, - profile=profile, - customer_name=customer_name, - customer_email=customer_email, - coupon_code=coupon_code, - referral_code=referral_code, - rule_query=rule_query, - campaign_query=campaign_query, - effect_type=effect_type, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationEventsWithoutTotalCount200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_application_events_without_total_count_serialize( - self, - application_id, - page_size, - skip, - sort, - type, - created_before, - created_after, - session, - profile, - customer_name, - customer_email, - coupon_code, - referral_code, - rule_query, - campaign_query, - effect_type, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if type is not None: - - _query_params.append(('type', type)) - - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - 'createdBefore', - created_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdBefore', created_before)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdAfter', created_after)) - - if session is not None: - - _query_params.append(('session', session)) - - if profile is not None: - - _query_params.append(('profile', profile)) - - if customer_name is not None: - - _query_params.append(('customerName', customer_name)) - - if customer_email is not None: - - _query_params.append(('customerEmail', customer_email)) - - if coupon_code is not None: - - _query_params.append(('couponCode', coupon_code)) - - if referral_code is not None: - - _query_params.append(('referralCode', referral_code)) - - if rule_query is not None: - - _query_params.append(('ruleQuery', rule_query)) - - if campaign_query is not None: - - _query_params.append(('campaignQuery', campaign_query)) - - if effect_type is not None: - - _query_params.append(('effectType', effect_type)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/events/no_total', - 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_application_session( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - session_id: Annotated[StrictInt, Field(description="The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApplicationSession: - """Get Application session - - Get the details of the given session. You can list the sessions with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param session_id: The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) - :type session_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_application_session_serialize( - application_id=application_id, - session_id=session_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationSession", - } - 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_application_session_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - session_id: Annotated[StrictInt, Field(description="The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ApplicationSession]: - """Get Application session - - Get the details of the given session. You can list the sessions with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param session_id: The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) - :type session_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_application_session_serialize( - application_id=application_id, - session_id=session_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationSession", - } - 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_application_session_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - session_id: Annotated[StrictInt, Field(description="The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get Application session - - Get the details of the given session. You can list the sessions with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param session_id: The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) - :type session_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_application_session_serialize( - application_id=application_id, - session_id=session_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationSession", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_application_session_serialize( - self, - application_id, - session_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if session_id is not None: - _path_params['sessionId'] = session_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/sessions/{sessionId}', - 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_application_sessions( - self, - 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=1000, 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, - 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, - profile: Annotated[Optional[StrictStr], Field(description="Profile integration ID filter for sessions. Must be exact match.")] = None, - state: Annotated[Optional[StrictStr], Field(description="Filter by sessions with this state. Must be exact match.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - coupon: Annotated[Optional[StrictStr], Field(description="Filter by sessions with this coupon. Must be exact match.")] = None, - referral: Annotated[Optional[StrictStr], Field(description="Filter by sessions with this referral. Must be exact match.")] = None, - integration_id: Annotated[Optional[StrictStr], Field(description="Filter by sessions with this integration ID. Must be exact match.")] = None, - store_integration_id: Annotated[Optional[StrictStr], Field(description="The integration ID of the store. You choose this ID when you create a store.")] = 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, - ) -> GetApplicationSessions200Response: - """List Application sessions - - List all the sessions of the specified Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param profile: Profile integration ID filter for sessions. Must be exact match. - :type profile: str - :param state: Filter by sessions with this state. Must be exact match. - :type state: str - :param created_before: Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param coupon: Filter by sessions with this coupon. Must be exact match. - :type coupon: str - :param referral: Filter by sessions with this referral. Must be exact match. - :type referral: str - :param integration_id: Filter by sessions with this integration ID. Must be exact match. - :type integration_id: str - :param store_integration_id: The integration ID of the store. You choose this ID when you create a store. - :type store_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_application_sessions_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - profile=profile, - state=state, - created_before=created_before, - created_after=created_after, - coupon=coupon, - referral=referral, - integration_id=integration_id, - store_integration_id=store_integration_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationSessions200Response", - } - 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_application_sessions_with_http_info( - self, - 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=1000, 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, - 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, - profile: Annotated[Optional[StrictStr], Field(description="Profile integration ID filter for sessions. Must be exact match.")] = None, - state: Annotated[Optional[StrictStr], Field(description="Filter by sessions with this state. Must be exact match.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - coupon: Annotated[Optional[StrictStr], Field(description="Filter by sessions with this coupon. Must be exact match.")] = None, - referral: Annotated[Optional[StrictStr], Field(description="Filter by sessions with this referral. Must be exact match.")] = None, - integration_id: Annotated[Optional[StrictStr], Field(description="Filter by sessions with this integration ID. Must be exact match.")] = None, - store_integration_id: Annotated[Optional[StrictStr], Field(description="The integration ID of the store. You choose this ID when you create a store.")] = 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[GetApplicationSessions200Response]: - """List Application sessions - - List all the sessions of the specified Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param profile: Profile integration ID filter for sessions. Must be exact match. - :type profile: str - :param state: Filter by sessions with this state. Must be exact match. - :type state: str - :param created_before: Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param coupon: Filter by sessions with this coupon. Must be exact match. - :type coupon: str - :param referral: Filter by sessions with this referral. Must be exact match. - :type referral: str - :param integration_id: Filter by sessions with this integration ID. Must be exact match. - :type integration_id: str - :param store_integration_id: The integration ID of the store. You choose this ID when you create a store. - :type store_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_application_sessions_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - profile=profile, - state=state, - created_before=created_before, - created_after=created_after, - coupon=coupon, - referral=referral, - integration_id=integration_id, - store_integration_id=store_integration_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationSessions200Response", - } - 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_application_sessions_without_preload_content( - self, - 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=1000, 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, - 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, - profile: Annotated[Optional[StrictStr], Field(description="Profile integration ID filter for sessions. Must be exact match.")] = None, - state: Annotated[Optional[StrictStr], Field(description="Filter by sessions with this state. Must be exact match.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - coupon: Annotated[Optional[StrictStr], Field(description="Filter by sessions with this coupon. Must be exact match.")] = None, - referral: Annotated[Optional[StrictStr], Field(description="Filter by sessions with this referral. Must be exact match.")] = None, - integration_id: Annotated[Optional[StrictStr], Field(description="Filter by sessions with this integration ID. Must be exact match.")] = None, - store_integration_id: Annotated[Optional[StrictStr], Field(description="The integration ID of the store. You choose this ID when you create a store.")] = 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: - """List Application sessions - - List all the sessions of the specified Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param profile: Profile integration ID filter for sessions. Must be exact match. - :type profile: str - :param state: Filter by sessions with this state. Must be exact match. - :type state: str - :param created_before: Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param coupon: Filter by sessions with this coupon. Must be exact match. - :type coupon: str - :param referral: Filter by sessions with this referral. Must be exact match. - :type referral: str - :param integration_id: Filter by sessions with this integration ID. Must be exact match. - :type integration_id: str - :param store_integration_id: The integration ID of the store. You choose this ID when you create a store. - :type store_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_application_sessions_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - profile=profile, - state=state, - created_before=created_before, - created_after=created_after, - coupon=coupon, - referral=referral, - integration_id=integration_id, - store_integration_id=store_integration_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplicationSessions200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_application_sessions_serialize( - self, - application_id, - page_size, - skip, - sort, - profile, - state, - created_before, - created_after, - coupon, - referral, - integration_id, - store_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 application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if profile is not None: - - _query_params.append(('profile', profile)) - - if state is not None: - - _query_params.append(('state', state)) - - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - 'createdBefore', - created_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdBefore', created_before)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdAfter', created_after)) - - if coupon is not None: - - _query_params.append(('coupon', coupon)) - - if referral is not None: - - _query_params.append(('referral', referral)) - - if integration_id is not None: - - _query_params.append(('integrationId', integration_id)) - - if store_integration_id is not None: - - _query_params.append(('storeIntegrationId', store_integration_id)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/sessions', - 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_applications( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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, - ) -> GetApplications200Response: - """List Applications - - List all applications in the current account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_applications_serialize( - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplications200Response", - } - 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_applications_with_http_info( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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[GetApplications200Response]: - """List Applications - - List all applications in the current account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_applications_serialize( - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplications200Response", - } - 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_applications_without_preload_content( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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: - """List Applications - - List all applications in the current account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_applications_serialize( - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetApplications200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_applications_serialize( - self, - page_size, - skip, - sort, - _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 page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications', - 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_attribute( - self, - attribute_id: Annotated[StrictInt, Field(description="The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**.")], - _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, - ) -> Attribute: - """Get custom attribute - - Retrieve the specified custom attribute. - - :param attribute_id: The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - :type attribute_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_attribute_serialize( - attribute_id=attribute_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Attribute", - } - 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_attribute_with_http_info( - self, - attribute_id: Annotated[StrictInt, Field(description="The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**.")], - _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[Attribute]: - """Get custom attribute - - Retrieve the specified custom attribute. - - :param attribute_id: The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - :type attribute_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_attribute_serialize( - attribute_id=attribute_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Attribute", - } - 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_attribute_without_preload_content( - self, - attribute_id: Annotated[StrictInt, Field(description="The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**.")], - _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 custom attribute - - Retrieve the specified custom attribute. - - :param attribute_id: The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - :type attribute_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_attribute_serialize( - attribute_id=attribute_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Attribute", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_attribute_serialize( - self, - attribute_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 attribute_id is not None: - _path_params['attributeId'] = attribute_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/attributes/{attributeId}', - 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_attributes( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. ")] = None, - entity: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied entity.")] = None, - application_ids: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied application ids")] = None, - type: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied type")] = None, - kind: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied kind (builtin or custom)")] = None, - search: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by searching case insensitive through Attribute name, description and type")] = None, - _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, - ) -> GetAttributes200Response: - """List custom attributes - - Return all the custom attributes for the account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param entity: Returned attributes will be filtered by supplied entity. - :type entity: str - :param application_ids: Returned attributes will be filtered by supplied application ids - :type application_ids: str - :param type: Returned attributes will be filtered by supplied type - :type type: str - :param kind: Returned attributes will be filtered by supplied kind (builtin or custom) - :type kind: str - :param search: Returned attributes will be filtered by searching case insensitive through Attribute name, description and type - :type search: 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_attributes_serialize( - page_size=page_size, - skip=skip, - sort=sort, - entity=entity, - application_ids=application_ids, - type=type, - kind=kind, - search=search, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAttributes200Response", - } - 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_attributes_with_http_info( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. ")] = None, - entity: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied entity.")] = None, - application_ids: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied application ids")] = None, - type: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied type")] = None, - kind: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied kind (builtin or custom)")] = None, - search: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by searching case insensitive through Attribute name, description and type")] = None, - _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[GetAttributes200Response]: - """List custom attributes - - Return all the custom attributes for the account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param entity: Returned attributes will be filtered by supplied entity. - :type entity: str - :param application_ids: Returned attributes will be filtered by supplied application ids - :type application_ids: str - :param type: Returned attributes will be filtered by supplied type - :type type: str - :param kind: Returned attributes will be filtered by supplied kind (builtin or custom) - :type kind: str - :param search: Returned attributes will be filtered by searching case insensitive through Attribute name, description and type - :type search: 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_attributes_serialize( - page_size=page_size, - skip=skip, - sort=sort, - entity=entity, - application_ids=application_ids, - type=type, - kind=kind, - search=search, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAttributes200Response", - } - 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_attributes_without_preload_content( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations. ")] = None, - entity: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied entity.")] = None, - application_ids: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied application ids")] = None, - type: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied type")] = None, - kind: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by supplied kind (builtin or custom)")] = None, - search: Annotated[Optional[StrictStr], Field(description="Returned attributes will be filtered by searching case insensitive through Attribute name, description and type")] = None, - _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: - """List custom attributes - - Return all the custom attributes for the account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param entity: Returned attributes will be filtered by supplied entity. - :type entity: str - :param application_ids: Returned attributes will be filtered by supplied application ids - :type application_ids: str - :param type: Returned attributes will be filtered by supplied type - :type type: str - :param kind: Returned attributes will be filtered by supplied kind (builtin or custom) - :type kind: str - :param search: Returned attributes will be filtered by searching case insensitive through Attribute name, description and type - :type search: 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_attributes_serialize( - page_size=page_size, - skip=skip, - sort=sort, - entity=entity, - application_ids=application_ids, - type=type, - kind=kind, - search=search, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAttributes200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_attributes_serialize( - self, - page_size, - skip, - sort, - entity, - application_ids, - type, - kind, - search, - _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 page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if entity is not None: - - _query_params.append(('entity', entity)) - - if application_ids is not None: - - _query_params.append(('applicationIds', application_ids)) - - if type is not None: - - _query_params.append(('type', type)) - - if kind is not None: - - _query_params.append(('kind', kind)) - - if search is not None: - - _query_params.append(('search', search)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/attributes', - 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_audience_memberships( - self, - audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - profile_query: Annotated[Optional[StrictStr], Field(description="The filter to select a profile.")] = 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, - ) -> GetAudienceMemberships200Response: - """List audience members - - Get a paginated list of the customer profiles in a given audience. A maximum of 1000 customer profiles per page is allowed. - - :param audience_id: The ID of the audience. (required) - :type audience_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param profile_query: The filter to select a profile. - :type profile_query: 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_audience_memberships_serialize( - audience_id=audience_id, - page_size=page_size, - skip=skip, - sort=sort, - profile_query=profile_query, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAudienceMemberships200Response", - '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_audience_memberships_with_http_info( - self, - audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - profile_query: Annotated[Optional[StrictStr], Field(description="The filter to select a profile.")] = 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[GetAudienceMemberships200Response]: - """List audience members - - Get a paginated list of the customer profiles in a given audience. A maximum of 1000 customer profiles per page is allowed. - - :param audience_id: The ID of the audience. (required) - :type audience_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param profile_query: The filter to select a profile. - :type profile_query: 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_audience_memberships_serialize( - audience_id=audience_id, - page_size=page_size, - skip=skip, - sort=sort, - profile_query=profile_query, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAudienceMemberships200Response", - '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_audience_memberships_without_preload_content( - self, - audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - profile_query: Annotated[Optional[StrictStr], Field(description="The filter to select a profile.")] = 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: - """List audience members - - Get a paginated list of the customer profiles in a given audience. A maximum of 1000 customer profiles per page is allowed. - - :param audience_id: The ID of the audience. (required) - :type audience_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param profile_query: The filter to select a profile. - :type profile_query: 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_audience_memberships_serialize( - audience_id=audience_id, - page_size=page_size, - skip=skip, - sort=sort, - profile_query=profile_query, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAudienceMemberships200Response", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_audience_memberships_serialize( - self, - audience_id, - page_size, - skip, - sort, - profile_query, - _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 audience_id is not None: - _path_params['audienceId'] = audience_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if profile_query is not None: - - _query_params.append(('profileQuery', profile_query)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/audiences/{audienceId}/memberships', - 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_audiences( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = 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, - ) -> GetAudiences200Response: - """List audiences - - Get all audiences created in the account. To create an audience, use [Create audience](https://docs.talon.one/integration-api#tag/Audiences/operation/createAudienceV2). - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: 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._get_audiences_serialize( - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAudiences200Response", - } - 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_audiences_with_http_info( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = 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[GetAudiences200Response]: - """List audiences - - Get all audiences created in the account. To create an audience, use [Create audience](https://docs.talon.one/integration-api#tag/Audiences/operation/createAudienceV2). - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: 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._get_audiences_serialize( - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAudiences200Response", - } - 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_audiences_without_preload_content( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = 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: - """List audiences - - Get all audiences created in the account. To create an audience, use [Create audience](https://docs.talon.one/integration-api#tag/Audiences/operation/createAudienceV2). - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: 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._get_audiences_serialize( - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAudiences200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_audiences_serialize( - self, - page_size, - skip, - sort, - with_total_result_size, - _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 page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if with_total_result_size is not None: - - _query_params.append(('withTotalResultSize', with_total_result_size)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/audiences', - 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_audiences_analytics( - self, - audience_ids: Annotated[StrictStr, Field(description="The IDs of one or more audiences, separated by commas, by which to filter results.")], - 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, - 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, - ) -> GetAudiencesAnalytics200Response: - """List audience 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) - :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 - :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_audiences_analytics_serialize( - audience_ids=audience_ids, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAudiencesAnalytics200Response", - } - 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_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.")], - 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, - 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[GetAudiencesAnalytics200Response]: - """List audience 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) - :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 - :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_audiences_analytics_serialize( - audience_ids=audience_ids, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAudiencesAnalytics200Response", - } - 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_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.")], - 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, - 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: - """List audience 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) - :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 - :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_audiences_analytics_serialize( - audience_ids=audience_ids, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAudiencesAnalytics200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_audiences_analytics_serialize( - self, - audience_ids, - sort, - _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 sort is not None: - - _query_params.append(('sort', sort)) - - if audience_ids is not None: - - _query_params.append(('audienceIds', audience_ids)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/audiences/analytics', - 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_campaign( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - _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, - ) -> Campaign: - """Get campaign - - Retrieve the given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param _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_campaign_serialize( - application_id=application_id, - campaign_id=campaign_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Campaign", - } - 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_campaign_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - _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[Campaign]: - """Get campaign - - Retrieve the given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param _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_campaign_serialize( - application_id=application_id, - campaign_id=campaign_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Campaign", - } - 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_campaign_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - _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 campaign - - Retrieve the given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param _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_campaign_serialize( - application_id=application_id, - campaign_id=campaign_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Campaign", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_campaign_serialize( - self, - application_id, - campaign_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}', - 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_campaign_analytics( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - granularity: Annotated[Optional[StrictStr], Field(description="The time interval between the results in the returned time-series.")] = 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, - ) -> GetCampaignAnalytics200Response: - """Get analytics of campaigns - - Retrieve statistical data about the performance of the given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param granularity: The time interval between the results in the returned time-series. - :type granularity: 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_campaign_analytics_serialize( - application_id=application_id, - campaign_id=campaign_id, - range_start=range_start, - range_end=range_end, - granularity=granularity, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaignAnalytics200Response", - } - 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_campaign_analytics_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - granularity: Annotated[Optional[StrictStr], Field(description="The time interval between the results in the returned time-series.")] = 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[GetCampaignAnalytics200Response]: - """Get analytics of campaigns - - Retrieve statistical data about the performance of the given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param granularity: The time interval between the results in the returned time-series. - :type granularity: 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_campaign_analytics_serialize( - application_id=application_id, - campaign_id=campaign_id, - range_start=range_start, - range_end=range_end, - granularity=granularity, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaignAnalytics200Response", - } - 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_campaign_analytics_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - granularity: Annotated[Optional[StrictStr], Field(description="The time interval between the results in the returned time-series.")] = 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: - """Get analytics of campaigns - - Retrieve statistical data about the performance of the given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param granularity: The time interval between the results in the returned time-series. - :type granularity: 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_campaign_analytics_serialize( - application_id=application_id, - campaign_id=campaign_id, - range_start=range_start, - range_end=range_end, - granularity=granularity, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaignAnalytics200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_campaign_analytics_serialize( - self, - application_id, - campaign_id, - range_start, - range_end, - granularity, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - if range_start is not None: - if isinstance(range_start, datetime): - _query_params.append( - ( - 'rangeStart', - range_start.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('rangeStart', range_start)) - - if range_end is not None: - if isinstance(range_end, datetime): - _query_params.append( - ( - 'rangeEnd', - range_end.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('rangeEnd', range_end)) - - if granularity is not None: - - _query_params.append(('granularity', granularity)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/analytics', - 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_campaign_by_attributes( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_search: Annotated[CampaignSearch, Field(description="body")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - campaign_state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. ")] = None, - _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, - ) -> GetCampaigns200Response: - """List campaigns that match the given attributes - - Get a list of all the campaigns that match a set of attributes. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_search: body (required) - :type campaign_search: CampaignSearch - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param campaign_state: Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - :type campaign_state: 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_campaign_by_attributes_serialize( - application_id=application_id, - campaign_search=campaign_search, - page_size=page_size, - skip=skip, - sort=sort, - campaign_state=campaign_state, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaigns200Response", - } - 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_campaign_by_attributes_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_search: Annotated[CampaignSearch, Field(description="body")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - campaign_state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. ")] = None, - _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[GetCampaigns200Response]: - """List campaigns that match the given attributes - - Get a list of all the campaigns that match a set of attributes. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_search: body (required) - :type campaign_search: CampaignSearch - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param campaign_state: Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - :type campaign_state: 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_campaign_by_attributes_serialize( - application_id=application_id, - campaign_search=campaign_search, - page_size=page_size, - skip=skip, - sort=sort, - campaign_state=campaign_state, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaigns200Response", - } - 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_campaign_by_attributes_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_search: Annotated[CampaignSearch, Field(description="body")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - campaign_state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. ")] = None, - _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: - """List campaigns that match the given attributes - - Get a list of all the campaigns that match a set of attributes. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_search: body (required) - :type campaign_search: CampaignSearch - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param campaign_state: Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - :type campaign_state: 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_campaign_by_attributes_serialize( - application_id=application_id, - campaign_search=campaign_search, - page_size=page_size, - skip=skip, - sort=sort, - campaign_state=campaign_state, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaigns200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_campaign_by_attributes_serialize( - self, - application_id, - campaign_search, - page_size, - skip, - sort, - campaign_state, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if campaign_state is not None: - - _query_params.append(('campaignState', campaign_state)) - - # process the header parameters - # process the form parameters - # process the body parameter - if campaign_search is not None: - _body_params = campaign_search - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/applications/{applicationId}/campaigns_search', - 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_campaign_group( - self, - campaign_group_id: Annotated[StrictInt, Field(description="The ID of the campaign access group.")], - _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, - ) -> CampaignGroup: - """Get campaign access group - - Get a campaign access group specified by its ID. - - :param campaign_group_id: The ID of the campaign access group. (required) - :type campaign_group_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_campaign_group_serialize( - campaign_group_id=campaign_group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CampaignGroup", - } - 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_campaign_group_with_http_info( - self, - campaign_group_id: Annotated[StrictInt, Field(description="The ID of the campaign access group.")], - _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[CampaignGroup]: - """Get campaign access group - - Get a campaign access group specified by its ID. - - :param campaign_group_id: The ID of the campaign access group. (required) - :type campaign_group_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_campaign_group_serialize( - campaign_group_id=campaign_group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CampaignGroup", - } - 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_campaign_group_without_preload_content( - self, - campaign_group_id: Annotated[StrictInt, Field(description="The ID of the campaign access group.")], - _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 campaign access group - - Get a campaign access group specified by its ID. - - :param campaign_group_id: The ID of the campaign access group. (required) - :type campaign_group_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_campaign_group_serialize( - campaign_group_id=campaign_group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CampaignGroup", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_campaign_group_serialize( - self, - campaign_group_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 campaign_group_id is not None: - _path_params['campaignGroupId'] = campaign_group_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/campaign_groups/{campaignGroupId}', - 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_campaign_groups( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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, - ) -> GetCampaignGroups200Response: - """List campaign access groups - - List the campaign access groups in the current account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_campaign_groups_serialize( - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaignGroups200Response", - } - 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_campaign_groups_with_http_info( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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[GetCampaignGroups200Response]: - """List campaign access groups - - List the campaign access groups in the current account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_campaign_groups_serialize( - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaignGroups200Response", - } - 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_campaign_groups_without_preload_content( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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: - """List campaign access groups - - List the campaign access groups in the current account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_campaign_groups_serialize( - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaignGroups200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_campaign_groups_serialize( - self, - page_size, - skip, - sort, - _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 page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/campaign_groups', - 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_campaign_templates( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign template.")] = None, - name: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the name of the campaign template.")] = None, - tags: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. ")] = None, - user_id: Annotated[Optional[StrictInt], Field(description="Filter results by user ID.")] = 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, - ) -> GetCampaignTemplates200Response: - """List campaign templates - - Retrieve a list of campaign templates. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param state: Filter results by the state of the campaign template. - :type state: str - :param name: Filter results performing case-insensitive matching against the name of the campaign template. - :type name: str - :param tags: Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. - :type tags: str - :param user_id: Filter results by user ID. - :type user_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_campaign_templates_serialize( - page_size=page_size, - skip=skip, - sort=sort, - state=state, - name=name, - tags=tags, - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaignTemplates200Response", - } - 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_campaign_templates_with_http_info( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign template.")] = None, - name: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the name of the campaign template.")] = None, - tags: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. ")] = None, - user_id: Annotated[Optional[StrictInt], Field(description="Filter results by user ID.")] = 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[GetCampaignTemplates200Response]: - """List campaign templates - - Retrieve a list of campaign templates. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param state: Filter results by the state of the campaign template. - :type state: str - :param name: Filter results performing case-insensitive matching against the name of the campaign template. - :type name: str - :param tags: Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. - :type tags: str - :param user_id: Filter results by user ID. - :type user_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_campaign_templates_serialize( - page_size=page_size, - skip=skip, - sort=sort, - state=state, - name=name, - tags=tags, - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaignTemplates200Response", - } - 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_campaign_templates_without_preload_content( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign template.")] = None, - name: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the name of the campaign template.")] = None, - tags: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. ")] = None, - user_id: Annotated[Optional[StrictInt], Field(description="Filter results by user ID.")] = 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: - """List campaign templates - - Retrieve a list of campaign templates. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param state: Filter results by the state of the campaign template. - :type state: str - :param name: Filter results performing case-insensitive matching against the name of the campaign template. - :type name: str - :param tags: Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. - :type tags: str - :param user_id: Filter results by user ID. - :type user_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_campaign_templates_serialize( - page_size=page_size, - skip=skip, - sort=sort, - state=state, - name=name, - tags=tags, - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaignTemplates200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_campaign_templates_serialize( - self, - page_size, - skip, - sort, - state, - name, - tags, - user_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 - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if state is not None: - - _query_params.append(('state', state)) - - if name is not None: - - _query_params.append(('name', name)) - - if tags is not None: - - _query_params.append(('tags', tags)) - - if user_id is not None: - - _query_params.append(('userId', user_id)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/campaign_templates', - 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_campaigns( - self, - 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=1000, 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, - 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, - campaign_state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. ")] = None, - name: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the name of the campaign.")] = None, - tags: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values ")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - start_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign start time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - start_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign start time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - end_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign end time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - end_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign end time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - campaign_group_id: Annotated[Optional[StrictInt], Field(description="Filter results to campaigns owned by the specified campaign access group ID.")] = None, - template_id: Annotated[Optional[StrictInt], Field(description="The ID of the campaign template this campaign was created from.")] = None, - store_id: Annotated[Optional[StrictInt], Field(description="Filter results to campaigns linked to the specified store ID.")] = 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, - ) -> GetCampaigns200Response: - """List campaigns - - List the campaigns of the specified application that match your filter criteria. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param campaign_state: Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - :type campaign_state: str - :param name: Filter results performing case-insensitive matching against the name of the campaign. - :type name: str - :param tags: Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values - :type tags: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param start_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign start time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type start_before: datetime - :param start_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign start time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type start_after: datetime - :param end_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign end time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type end_before: datetime - :param end_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign end time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type end_after: datetime - :param campaign_group_id: Filter results to campaigns owned by the specified campaign access group ID. - :type campaign_group_id: int - :param template_id: The ID of the campaign template this campaign was created from. - :type template_id: int - :param store_id: Filter results to campaigns linked to the specified store ID. - :type store_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_campaigns_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - campaign_state=campaign_state, - name=name, - tags=tags, - created_before=created_before, - created_after=created_after, - start_before=start_before, - start_after=start_after, - end_before=end_before, - end_after=end_after, - campaign_group_id=campaign_group_id, - template_id=template_id, - store_id=store_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaigns200Response", - '400': "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_campaigns_with_http_info( - self, - 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=1000, 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, - 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, - campaign_state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. ")] = None, - name: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the name of the campaign.")] = None, - tags: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values ")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - start_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign start time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - start_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign start time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - end_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign end time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - end_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign end time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - campaign_group_id: Annotated[Optional[StrictInt], Field(description="Filter results to campaigns owned by the specified campaign access group ID.")] = None, - template_id: Annotated[Optional[StrictInt], Field(description="The ID of the campaign template this campaign was created from.")] = None, - store_id: Annotated[Optional[StrictInt], Field(description="Filter results to campaigns linked to the specified store ID.")] = 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[GetCampaigns200Response]: - """List campaigns - - List the campaigns of the specified application that match your filter criteria. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param campaign_state: Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - :type campaign_state: str - :param name: Filter results performing case-insensitive matching against the name of the campaign. - :type name: str - :param tags: Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values - :type tags: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param start_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign start time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type start_before: datetime - :param start_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign start time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type start_after: datetime - :param end_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign end time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type end_before: datetime - :param end_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign end time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type end_after: datetime - :param campaign_group_id: Filter results to campaigns owned by the specified campaign access group ID. - :type campaign_group_id: int - :param template_id: The ID of the campaign template this campaign was created from. - :type template_id: int - :param store_id: Filter results to campaigns linked to the specified store ID. - :type store_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_campaigns_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - campaign_state=campaign_state, - name=name, - tags=tags, - created_before=created_before, - created_after=created_after, - start_before=start_before, - start_after=start_after, - end_before=end_before, - end_after=end_after, - campaign_group_id=campaign_group_id, - template_id=template_id, - store_id=store_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaigns200Response", - '400': "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_campaigns_without_preload_content( - self, - 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=1000, 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, - 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, - campaign_state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. ")] = None, - name: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the name of the campaign.")] = None, - tags: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values ")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - start_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign start time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - start_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign start time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - end_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign end time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - end_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign end time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - campaign_group_id: Annotated[Optional[StrictInt], Field(description="Filter results to campaigns owned by the specified campaign access group ID.")] = None, - template_id: Annotated[Optional[StrictInt], Field(description="The ID of the campaign template this campaign was created from.")] = None, - store_id: Annotated[Optional[StrictInt], Field(description="Filter results to campaigns linked to the specified store ID.")] = 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: - """List campaigns - - List the campaigns of the specified application that match your filter criteria. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param campaign_state: Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - :type campaign_state: str - :param name: Filter results performing case-insensitive matching against the name of the campaign. - :type name: str - :param tags: Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values - :type tags: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param start_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign start time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type start_before: datetime - :param start_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign start time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type start_after: datetime - :param end_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign end time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type end_before: datetime - :param end_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign end time timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type end_after: datetime - :param campaign_group_id: Filter results to campaigns owned by the specified campaign access group ID. - :type campaign_group_id: int - :param template_id: The ID of the campaign template this campaign was created from. - :type template_id: int - :param store_id: Filter results to campaigns linked to the specified store ID. - :type store_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_campaigns_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - campaign_state=campaign_state, - name=name, - tags=tags, - created_before=created_before, - created_after=created_after, - start_before=start_before, - start_after=start_after, - end_before=end_before, - end_after=end_after, - campaign_group_id=campaign_group_id, - template_id=template_id, - store_id=store_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCampaigns200Response", - '400': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_campaigns_serialize( - self, - application_id, - page_size, - skip, - sort, - campaign_state, - name, - tags, - created_before, - created_after, - start_before, - start_after, - end_before, - end_after, - campaign_group_id, - template_id, - store_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if campaign_state is not None: - - _query_params.append(('campaignState', campaign_state)) - - if name is not None: - - _query_params.append(('name', name)) - - if tags is not None: - - _query_params.append(('tags', tags)) - - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - 'createdBefore', - created_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdBefore', created_before)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdAfter', created_after)) - - if start_before is not None: - if isinstance(start_before, datetime): - _query_params.append( - ( - 'startBefore', - start_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startBefore', start_before)) - - if start_after is not None: - if isinstance(start_after, datetime): - _query_params.append( - ( - 'startAfter', - start_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startAfter', start_after)) - - if end_before is not None: - if isinstance(end_before, datetime): - _query_params.append( - ( - 'endBefore', - end_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endBefore', end_before)) - - if end_after is not None: - if isinstance(end_after, datetime): - _query_params.append( - ( - 'endAfter', - end_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endAfter', end_after)) - - if campaign_group_id is not None: - - _query_params.append(('campaignGroupId', campaign_group_id)) - - if template_id is not None: - - _query_params.append(('templateId', template_id)) - - if store_id is not None: - - _query_params.append(('storeId', store_id)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/campaigns', - 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_changes( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - application_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by Application ID.")] = None, - entity_path: Annotated[Optional[StrictStr], Field(description="Filter results on a case insensitive matching of the url path of the entity")] = None, - user_id: Annotated[Optional[StrictInt], Field(description="Filter results by user ID.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - management_key_id: Annotated[Optional[StrictInt], Field(description="Filter results that match the given management key ID.")] = None, - include_old: Annotated[Optional[StrictBool], Field(description="When this flag is set to false, the state without the change will not be returned. The default value is 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, - ) -> GetChanges200Response: - """Get audit logs for an account - - Retrieve the audit logs displayed in **Accounts > Audit logs**. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param application_id: Filter results by Application ID. - :type application_id: float - :param entity_path: Filter results on a case insensitive matching of the url path of the entity - :type entity_path: str - :param user_id: Filter results by user ID. - :type user_id: int - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param management_key_id: Filter results that match the given management key ID. - :type management_key_id: int - :param include_old: When this flag is set to false, the state without the change will not be returned. The default value is true. - :type include_old: 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._get_changes_serialize( - page_size=page_size, - skip=skip, - sort=sort, - application_id=application_id, - entity_path=entity_path, - user_id=user_id, - created_before=created_before, - created_after=created_after, - with_total_result_size=with_total_result_size, - management_key_id=management_key_id, - include_old=include_old, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetChanges200Response", - } - 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_changes_with_http_info( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - application_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by Application ID.")] = None, - entity_path: Annotated[Optional[StrictStr], Field(description="Filter results on a case insensitive matching of the url path of the entity")] = None, - user_id: Annotated[Optional[StrictInt], Field(description="Filter results by user ID.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - management_key_id: Annotated[Optional[StrictInt], Field(description="Filter results that match the given management key ID.")] = None, - include_old: Annotated[Optional[StrictBool], Field(description="When this flag is set to false, the state without the change will not be returned. The default value is 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[GetChanges200Response]: - """Get audit logs for an account - - Retrieve the audit logs displayed in **Accounts > Audit logs**. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param application_id: Filter results by Application ID. - :type application_id: float - :param entity_path: Filter results on a case insensitive matching of the url path of the entity - :type entity_path: str - :param user_id: Filter results by user ID. - :type user_id: int - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param management_key_id: Filter results that match the given management key ID. - :type management_key_id: int - :param include_old: When this flag is set to false, the state without the change will not be returned. The default value is true. - :type include_old: 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._get_changes_serialize( - page_size=page_size, - skip=skip, - sort=sort, - application_id=application_id, - entity_path=entity_path, - user_id=user_id, - created_before=created_before, - created_after=created_after, - with_total_result_size=with_total_result_size, - management_key_id=management_key_id, - include_old=include_old, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetChanges200Response", - } - 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_changes_without_preload_content( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - application_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by Application ID.")] = None, - entity_path: Annotated[Optional[StrictStr], Field(description="Filter results on a case insensitive matching of the url path of the entity")] = None, - user_id: Annotated[Optional[StrictInt], Field(description="Filter results by user ID.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - management_key_id: Annotated[Optional[StrictInt], Field(description="Filter results that match the given management key ID.")] = None, - include_old: Annotated[Optional[StrictBool], Field(description="When this flag is set to false, the state without the change will not be returned. The default value is 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: - """Get audit logs for an account - - Retrieve the audit logs displayed in **Accounts > Audit logs**. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param application_id: Filter results by Application ID. - :type application_id: float - :param entity_path: Filter results on a case insensitive matching of the url path of the entity - :type entity_path: str - :param user_id: Filter results by user ID. - :type user_id: int - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param management_key_id: Filter results that match the given management key ID. - :type management_key_id: int - :param include_old: When this flag is set to false, the state without the change will not be returned. The default value is true. - :type include_old: 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._get_changes_serialize( - page_size=page_size, - skip=skip, - sort=sort, - application_id=application_id, - entity_path=entity_path, - user_id=user_id, - created_before=created_before, - created_after=created_after, - with_total_result_size=with_total_result_size, - management_key_id=management_key_id, - include_old=include_old, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetChanges200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_changes_serialize( - self, - page_size, - skip, - sort, - application_id, - entity_path, - user_id, - created_before, - created_after, - with_total_result_size, - management_key_id, - include_old, - _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 page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if application_id is not None: - - _query_params.append(('applicationId', application_id)) - - if entity_path is not None: - - _query_params.append(('entityPath', entity_path)) - - if user_id is not None: - - _query_params.append(('userId', user_id)) - - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - 'createdBefore', - created_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdBefore', created_before)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdAfter', created_after)) - - if with_total_result_size is not None: - - _query_params.append(('withTotalResultSize', with_total_result_size)) - - if management_key_id is not None: - - _query_params.append(('managementKeyId', management_key_id)) - - if include_old is not None: - - _query_params.append(('includeOld', include_old)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/changes', - 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_collection( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Collection: - """Get campaign-level collection - - Retrieve a given campaign-level collection. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param collection_id: The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_collection_serialize( - application_id=application_id, - campaign_id=campaign_id, - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Collection", - '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_collection_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Collection]: - """Get campaign-level collection - - Retrieve a given campaign-level collection. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param collection_id: The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_collection_serialize( - application_id=application_id, - campaign_id=campaign_id, - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Collection", - '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_collection_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get campaign-level collection - - Retrieve a given campaign-level collection. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param collection_id: The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - :type collection_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_collection_serialize( - application_id=application_id, - campaign_id=campaign_id, - collection_id=collection_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Collection", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_collection_serialize( - self, - application_id, - campaign_id, - collection_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - if collection_id is not None: - _path_params['collectionId'] = collection_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}', - 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_collection_items( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - _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, - ) -> GetCollectionItems200Response: - """Get collection items - - Retrieve items from a given collection. You can retrieve items from both account-level collections and campaign-level collections using this endpoint. - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_collection_items_serialize( - collection_id=collection_id, - page_size=page_size, - skip=skip, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCollectionItems200Response", - '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_collection_items_with_http_info( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - _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[GetCollectionItems200Response]: - """Get collection items - - Retrieve items from a given collection. You can retrieve items from both account-level collections and campaign-level collections using this endpoint. - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_collection_items_serialize( - collection_id=collection_id, - page_size=page_size, - skip=skip, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCollectionItems200Response", - '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_collection_items_without_preload_content( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - _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 collection items - - Retrieve items from a given collection. You can retrieve items from both account-level collections and campaign-level collections using this endpoint. - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_collection_items_serialize( - collection_id=collection_id, - page_size=page_size, - skip=skip, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCollectionItems200Response", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_collection_items_serialize( - self, - collection_id, - page_size, - skip, - _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 collection_id is not None: - _path_params['collectionId'] = collection_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/collections/{collectionId}/items', - 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_coupons_without_total_count( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - value: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. ")] = None, - redeemed: Annotated[Optional[StrictStr], Field(description="- `true`: only coupons where `usageCounter > 0` will be returned. - `false`: only coupons where `usageCounter = 0` will be returned. - This field cannot be used in conjunction with the `usable` query parameter. ")] = None, - referral_id: Annotated[Optional[StrictInt], Field(description="Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code.")] = None, - recipient_integration_id: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field.")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of coupons")] = None, - exact_match: Annotated[Optional[StrictBool], Field(description="Filter results to an exact case-insensitive matching against the coupon code.")] = None, - expires_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - expires_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - starts_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - starts_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - values_only: Annotated[Optional[StrictBool], Field(description="Filter results to only return the coupon codes (`value` column) without the associated coupon data.")] = 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, - ) -> GetCouponsWithoutTotalCount200Response: - """List coupons - - List all the coupons matching the specified criteria. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param value: Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type value: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. - :type valid: str - :param usable: Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. - :type usable: str - :param redeemed: - `true`: only coupons where `usageCounter > 0` will be returned. - `false`: only coupons where `usageCounter = 0` will be returned. - This field cannot be used in conjunction with the `usable` query parameter. - :type redeemed: str - :param referral_id: Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. - :type referral_id: int - :param recipient_integration_id: Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field. - :type recipient_integration_id: str - :param batch_id: Filter results by batches of coupons - :type batch_id: str - :param exact_match: Filter results to an exact case-insensitive matching against the coupon code. - :type exact_match: bool - :param expires_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type expires_before: datetime - :param expires_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type expires_after: datetime - :param starts_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type starts_before: datetime - :param starts_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type starts_after: datetime - :param values_only: Filter results to only return the coupon codes (`value` column) without the associated coupon data. - :type values_only: 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._get_coupons_without_total_count_serialize( - application_id=application_id, - campaign_id=campaign_id, - page_size=page_size, - skip=skip, - sort=sort, - value=value, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - redeemed=redeemed, - referral_id=referral_id, - recipient_integration_id=recipient_integration_id, - batch_id=batch_id, - exact_match=exact_match, - expires_before=expires_before, - expires_after=expires_after, - starts_before=starts_before, - starts_after=starts_after, - values_only=values_only, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCouponsWithoutTotalCount200Response", - } - 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_coupons_without_total_count_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - value: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. ")] = None, - redeemed: Annotated[Optional[StrictStr], Field(description="- `true`: only coupons where `usageCounter > 0` will be returned. - `false`: only coupons where `usageCounter = 0` will be returned. - This field cannot be used in conjunction with the `usable` query parameter. ")] = None, - referral_id: Annotated[Optional[StrictInt], Field(description="Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code.")] = None, - recipient_integration_id: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field.")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of coupons")] = None, - exact_match: Annotated[Optional[StrictBool], Field(description="Filter results to an exact case-insensitive matching against the coupon code.")] = None, - expires_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - expires_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - starts_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - starts_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - values_only: Annotated[Optional[StrictBool], Field(description="Filter results to only return the coupon codes (`value` column) without the associated coupon data.")] = 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[GetCouponsWithoutTotalCount200Response]: - """List coupons - - List all the coupons matching the specified criteria. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param value: Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type value: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. - :type valid: str - :param usable: Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. - :type usable: str - :param redeemed: - `true`: only coupons where `usageCounter > 0` will be returned. - `false`: only coupons where `usageCounter = 0` will be returned. - This field cannot be used in conjunction with the `usable` query parameter. - :type redeemed: str - :param referral_id: Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. - :type referral_id: int - :param recipient_integration_id: Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field. - :type recipient_integration_id: str - :param batch_id: Filter results by batches of coupons - :type batch_id: str - :param exact_match: Filter results to an exact case-insensitive matching against the coupon code. - :type exact_match: bool - :param expires_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type expires_before: datetime - :param expires_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type expires_after: datetime - :param starts_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type starts_before: datetime - :param starts_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type starts_after: datetime - :param values_only: Filter results to only return the coupon codes (`value` column) without the associated coupon data. - :type values_only: 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._get_coupons_without_total_count_serialize( - application_id=application_id, - campaign_id=campaign_id, - page_size=page_size, - skip=skip, - sort=sort, - value=value, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - redeemed=redeemed, - referral_id=referral_id, - recipient_integration_id=recipient_integration_id, - batch_id=batch_id, - exact_match=exact_match, - expires_before=expires_before, - expires_after=expires_after, - starts_before=starts_before, - starts_after=starts_after, - values_only=values_only, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCouponsWithoutTotalCount200Response", - } - 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_coupons_without_total_count_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - value: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. ")] = None, - redeemed: Annotated[Optional[StrictStr], Field(description="- `true`: only coupons where `usageCounter > 0` will be returned. - `false`: only coupons where `usageCounter = 0` will be returned. - This field cannot be used in conjunction with the `usable` query parameter. ")] = None, - referral_id: Annotated[Optional[StrictInt], Field(description="Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code.")] = None, - recipient_integration_id: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field.")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of coupons")] = None, - exact_match: Annotated[Optional[StrictBool], Field(description="Filter results to an exact case-insensitive matching against the coupon code.")] = None, - expires_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - expires_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - starts_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - starts_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - values_only: Annotated[Optional[StrictBool], Field(description="Filter results to only return the coupon codes (`value` column) without the associated coupon data.")] = 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: - """List coupons - - List all the coupons matching the specified criteria. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param value: Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type value: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. - :type valid: str - :param usable: Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. - :type usable: str - :param redeemed: - `true`: only coupons where `usageCounter > 0` will be returned. - `false`: only coupons where `usageCounter = 0` will be returned. - This field cannot be used in conjunction with the `usable` query parameter. - :type redeemed: str - :param referral_id: Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. - :type referral_id: int - :param recipient_integration_id: Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field. - :type recipient_integration_id: str - :param batch_id: Filter results by batches of coupons - :type batch_id: str - :param exact_match: Filter results to an exact case-insensitive matching against the coupon code. - :type exact_match: bool - :param expires_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type expires_before: datetime - :param expires_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type expires_after: datetime - :param starts_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type starts_before: datetime - :param starts_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type starts_after: datetime - :param values_only: Filter results to only return the coupon codes (`value` column) without the associated coupon data. - :type values_only: 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._get_coupons_without_total_count_serialize( - application_id=application_id, - campaign_id=campaign_id, - page_size=page_size, - skip=skip, - sort=sort, - value=value, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - redeemed=redeemed, - referral_id=referral_id, - recipient_integration_id=recipient_integration_id, - batch_id=batch_id, - exact_match=exact_match, - expires_before=expires_before, - expires_after=expires_after, - starts_before=starts_before, - starts_after=starts_after, - values_only=values_only, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCouponsWithoutTotalCount200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_coupons_without_total_count_serialize( - self, - application_id, - campaign_id, - page_size, - skip, - sort, - value, - created_before, - created_after, - valid, - usable, - redeemed, - referral_id, - recipient_integration_id, - batch_id, - exact_match, - expires_before, - expires_after, - starts_before, - starts_after, - values_only, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if value is not None: - - _query_params.append(('value', value)) - - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - 'createdBefore', - created_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdBefore', created_before)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdAfter', created_after)) - - if valid is not None: - - _query_params.append(('valid', valid)) - - if usable is not None: - - _query_params.append(('usable', usable)) - - if redeemed is not None: - - _query_params.append(('redeemed', redeemed)) - - if referral_id is not None: - - _query_params.append(('referralId', referral_id)) - - if recipient_integration_id is not None: - - _query_params.append(('recipientIntegrationId', recipient_integration_id)) - - if batch_id is not None: - - _query_params.append(('batchId', batch_id)) - - if exact_match is not None: - - _query_params.append(('exactMatch', exact_match)) - - if expires_before is not None: - if isinstance(expires_before, datetime): - _query_params.append( - ( - 'expiresBefore', - expires_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('expiresBefore', expires_before)) - - if expires_after is not None: - if isinstance(expires_after, datetime): - _query_params.append( - ( - 'expiresAfter', - expires_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('expiresAfter', expires_after)) - - if starts_before is not None: - if isinstance(starts_before, datetime): - _query_params.append( - ( - 'startsBefore', - starts_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startsBefore', starts_before)) - - if starts_after is not None: - if isinstance(starts_after, datetime): - _query_params.append( - ( - 'startsAfter', - starts_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startsAfter', starts_after)) - - if values_only is not None: - - _query_params.append(('valuesOnly', values_only)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/coupons/no_total', - 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_customer_activity_report( - self, - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - customer_id: Annotated[StrictInt, Field(description="The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - _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, - ) -> CustomerActivityReport: - """Get customer's activity report - - Fetch the summary report of a given customer in the given application, in a time range. - - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param customer_id: The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type customer_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_customer_activity_report_serialize( - range_start=range_start, - range_end=range_end, - application_id=application_id, - customer_id=customer_id, - page_size=page_size, - skip=skip, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomerActivityReport", - } - 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_customer_activity_report_with_http_info( - self, - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - customer_id: Annotated[StrictInt, Field(description="The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - _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[CustomerActivityReport]: - """Get customer's activity report - - Fetch the summary report of a given customer in the given application, in a time range. - - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param customer_id: The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type customer_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_customer_activity_report_serialize( - range_start=range_start, - range_end=range_end, - application_id=application_id, - customer_id=customer_id, - page_size=page_size, - skip=skip, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomerActivityReport", - } - 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_customer_activity_report_without_preload_content( - self, - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - customer_id: Annotated[StrictInt, Field(description="The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - _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 customer's activity report - - Fetch the summary report of a given customer in the given application, in a time range. - - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param customer_id: The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type customer_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_customer_activity_report_serialize( - range_start=range_start, - range_end=range_end, - application_id=application_id, - customer_id=customer_id, - page_size=page_size, - skip=skip, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomerActivityReport", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_customer_activity_report_serialize( - self, - range_start, - range_end, - application_id, - customer_id, - page_size, - skip, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if customer_id is not None: - _path_params['customerId'] = customer_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if range_start is not None: - if isinstance(range_start, datetime): - _query_params.append( - ( - 'rangeStart', - range_start.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('rangeStart', range_start)) - - if range_end is not None: - if isinstance(range_end, datetime): - _query_params.append( - ( - 'rangeEnd', - range_end.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('rangeEnd', range_end)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/customer_activity_reports/{customerId}', - 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_customer_activity_reports_without_total_count( - self, - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - 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=1000, 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, - 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, - name: Annotated[Optional[StrictStr], Field(description="Only return reports matching the customer name.")] = None, - integration_id: Annotated[Optional[StrictStr], Field(description="Filter results performing an exact matching against the profile integration identifier.")] = None, - campaign_name: Annotated[Optional[StrictStr], Field(description="Only return reports matching the campaign name.")] = None, - advocate_name: Annotated[Optional[StrictStr], Field(description="Only return reports matching the current customer referrer name.")] = 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, - ) -> GetCustomerActivityReportsWithoutTotalCount200Response: - """Get Activity Reports for Application Customers - - Fetch summary reports for all application customers based on a time range. Instead of having the total number of results in the response, this endpoint only mentions whether there are more results. - - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param name: Only return reports matching the customer name. - :type name: str - :param integration_id: Filter results performing an exact matching against the profile integration identifier. - :type integration_id: str - :param campaign_name: Only return reports matching the campaign name. - :type campaign_name: str - :param advocate_name: Only return reports matching the current customer referrer name. - :type advocate_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 - (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_customer_activity_reports_without_total_count_serialize( - range_start=range_start, - range_end=range_end, - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - name=name, - integration_id=integration_id, - campaign_name=campaign_name, - advocate_name=advocate_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomerActivityReportsWithoutTotalCount200Response", - } - 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_customer_activity_reports_without_total_count_with_http_info( - self, - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - 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=1000, 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, - 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, - name: Annotated[Optional[StrictStr], Field(description="Only return reports matching the customer name.")] = None, - integration_id: Annotated[Optional[StrictStr], Field(description="Filter results performing an exact matching against the profile integration identifier.")] = None, - campaign_name: Annotated[Optional[StrictStr], Field(description="Only return reports matching the campaign name.")] = None, - advocate_name: Annotated[Optional[StrictStr], Field(description="Only return reports matching the current customer referrer name.")] = 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[GetCustomerActivityReportsWithoutTotalCount200Response]: - """Get Activity Reports for Application Customers - - Fetch summary reports for all application customers based on a time range. Instead of having the total number of results in the response, this endpoint only mentions whether there are more results. - - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param name: Only return reports matching the customer name. - :type name: str - :param integration_id: Filter results performing an exact matching against the profile integration identifier. - :type integration_id: str - :param campaign_name: Only return reports matching the campaign name. - :type campaign_name: str - :param advocate_name: Only return reports matching the current customer referrer name. - :type advocate_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 - (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_customer_activity_reports_without_total_count_serialize( - range_start=range_start, - range_end=range_end, - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - name=name, - integration_id=integration_id, - campaign_name=campaign_name, - advocate_name=advocate_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomerActivityReportsWithoutTotalCount200Response", - } - 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_customer_activity_reports_without_total_count_without_preload_content( - self, - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - 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=1000, 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, - 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, - name: Annotated[Optional[StrictStr], Field(description="Only return reports matching the customer name.")] = None, - integration_id: Annotated[Optional[StrictStr], Field(description="Filter results performing an exact matching against the profile integration identifier.")] = None, - campaign_name: Annotated[Optional[StrictStr], Field(description="Only return reports matching the campaign name.")] = None, - advocate_name: Annotated[Optional[StrictStr], Field(description="Only return reports matching the current customer referrer name.")] = 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: - """Get Activity Reports for Application Customers - - Fetch summary reports for all application customers based on a time range. Instead of having the total number of results in the response, this endpoint only mentions whether there are more results. - - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param name: Only return reports matching the customer name. - :type name: str - :param integration_id: Filter results performing an exact matching against the profile integration identifier. - :type integration_id: str - :param campaign_name: Only return reports matching the campaign name. - :type campaign_name: str - :param advocate_name: Only return reports matching the current customer referrer name. - :type advocate_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 - (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_customer_activity_reports_without_total_count_serialize( - range_start=range_start, - range_end=range_end, - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - name=name, - integration_id=integration_id, - campaign_name=campaign_name, - advocate_name=advocate_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomerActivityReportsWithoutTotalCount200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_customer_activity_reports_without_total_count_serialize( - self, - range_start, - range_end, - application_id, - page_size, - skip, - sort, - name, - integration_id, - campaign_name, - advocate_name, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if range_start is not None: - if isinstance(range_start, datetime): - _query_params.append( - ( - 'rangeStart', - range_start.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('rangeStart', range_start)) - - if range_end is not None: - if isinstance(range_end, datetime): - _query_params.append( - ( - 'rangeEnd', - range_end.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('rangeEnd', range_end)) - - if name is not None: - - _query_params.append(('name', name)) - - if integration_id is not None: - - _query_params.append(('integrationId', integration_id)) - - if campaign_name is not None: - - _query_params.append(('campaignName', campaign_name)) - - if advocate_name is not None: - - _query_params.append(('advocateName', advocate_name)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/customer_activity_reports/no_total', - 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_customer_analytics( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - customer_id: Annotated[StrictInt, Field(description="The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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, - ) -> CustomerAnalytics: - """Get customer's analytics report - - Fetch analytics for a given customer in the given application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param customer_id: The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type customer_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_customer_analytics_serialize( - application_id=application_id, - customer_id=customer_id, - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomerAnalytics", - } - 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_customer_analytics_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - customer_id: Annotated[StrictInt, Field(description="The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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[CustomerAnalytics]: - """Get customer's analytics report - - Fetch analytics for a given customer in the given application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param customer_id: The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type customer_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_customer_analytics_serialize( - application_id=application_id, - customer_id=customer_id, - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomerAnalytics", - } - 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_customer_analytics_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - customer_id: Annotated[StrictInt, Field(description="The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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 customer's analytics report - - Fetch analytics for a given customer in the given application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param customer_id: The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type customer_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_customer_analytics_serialize( - application_id=application_id, - customer_id=customer_id, - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomerAnalytics", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_customer_analytics_serialize( - self, - application_id, - customer_id, - page_size, - skip, - sort, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if customer_id is not None: - _path_params['customerId'] = customer_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/customers/{customerId}/analytics', - 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_customer_profile( - self, - customer_id: Annotated[StrictInt, Field(description="The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CustomerProfile: - """Get customer profile - - Return the details of the specified customer profile.

Performance tips

You can retrieve the same information via the Integration API, which can save you extra API requests. consider these options: - Request the customer profile to be part of the response content using [Update Customer Session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2). - Send an empty update with the [Update Customer Profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint with `runRuleEngine=false`.
- - :param customer_id: The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type customer_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_customer_profile_serialize( - customer_id=customer_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomerProfile", - } - 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_customer_profile_with_http_info( - self, - customer_id: Annotated[StrictInt, Field(description="The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CustomerProfile]: - """Get customer profile - - Return the details of the specified customer profile.

Performance tips

You can retrieve the same information via the Integration API, which can save you extra API requests. consider these options: - Request the customer profile to be part of the response content using [Update Customer Session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2). - Send an empty update with the [Update Customer Profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint with `runRuleEngine=false`.
- - :param customer_id: The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type customer_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_customer_profile_serialize( - customer_id=customer_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomerProfile", - } - 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_customer_profile_without_preload_content( - self, - customer_id: Annotated[StrictInt, Field(description="The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get customer profile - - Return the details of the specified customer profile.

Performance tips

You can retrieve the same information via the Integration API, which can save you extra API requests. consider these options: - Request the customer profile to be part of the response content using [Update Customer Session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2). - Send an empty update with the [Update Customer Profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint with `runRuleEngine=false`.
- - :param customer_id: The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type customer_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_customer_profile_serialize( - customer_id=customer_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomerProfile", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_customer_profile_serialize( - self, - customer_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 customer_id is not None: - _path_params['customerId'] = customer_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/customers/{customerId}', - 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_customer_profile_achievement_progress( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - 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. ")], - 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, - achievement_id: Annotated[Optional[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/listAchievements) endpoint.")] = None, - title: Annotated[Optional[StrictStr], Field(description="Filter results by the `title` of an achievement.")] = 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, - ) -> GetCustomerProfileAchievementProgress200Response: - """List customer achievements - - For the given customer profile, list all the achievements that match your filter criteria. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param achievement_id: The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. - :type achievement_id: int - :param title: Filter results by the `title` of an achievement. - :type title: 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_customer_profile_achievement_progress_serialize( - application_id=application_id, - integration_id=integration_id, - page_size=page_size, - skip=skip, - achievement_id=achievement_id, - title=title, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomerProfileAchievementProgress200Response", - '400': "ErrorResponseWithStatus", - '401': "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_customer_profile_achievement_progress_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - 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. ")], - 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, - achievement_id: Annotated[Optional[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/listAchievements) endpoint.")] = None, - title: Annotated[Optional[StrictStr], Field(description="Filter results by the `title` of an achievement.")] = 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[GetCustomerProfileAchievementProgress200Response]: - """List customer achievements - - For the given customer profile, list all the achievements that match your filter criteria. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param achievement_id: The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. - :type achievement_id: int - :param title: Filter results by the `title` of an achievement. - :type title: 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_customer_profile_achievement_progress_serialize( - application_id=application_id, - integration_id=integration_id, - page_size=page_size, - skip=skip, - achievement_id=achievement_id, - title=title, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomerProfileAchievementProgress200Response", - '400': "ErrorResponseWithStatus", - '401': "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_customer_profile_achievement_progress_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - 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. ")], - 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, - achievement_id: Annotated[Optional[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/listAchievements) endpoint.")] = None, - title: Annotated[Optional[StrictStr], Field(description="Filter results by the `title` of an achievement.")] = 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: - """List customer achievements - - For the given customer profile, list all the achievements that match your filter criteria. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param achievement_id: The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. - :type achievement_id: int - :param title: Filter results by the `title` of an achievement. - :type title: 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_customer_profile_achievement_progress_serialize( - application_id=application_id, - integration_id=integration_id, - page_size=page_size, - skip=skip, - achievement_id=achievement_id, - title=title, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomerProfileAchievementProgress200Response", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_customer_profile_achievement_progress_serialize( - self, - application_id, - integration_id, - page_size, - skip, - achievement_id, - title, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if integration_id is not None: - _path_params['integrationId'] = integration_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if achievement_id is not None: - - _query_params.append(('achievementId', achievement_id)) - - if title is not None: - - _query_params.append(('title', title)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/achievement_progress/{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_customer_profiles( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - sandbox: Annotated[Optional[StrictBool], Field(description="Indicates whether you are pointing to a sandbox or live customer.")] = 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, - ) -> GetCustomerProfiles200Response: - """List customer profiles - - List all customer profiles. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param sandbox: Indicates whether you are pointing to a sandbox or live customer. - :type sandbox: 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._get_customer_profiles_serialize( - page_size=page_size, - skip=skip, - sandbox=sandbox, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomerProfiles200Response", - } - 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_customer_profiles_with_http_info( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - sandbox: Annotated[Optional[StrictBool], Field(description="Indicates whether you are pointing to a sandbox or live customer.")] = 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[GetCustomerProfiles200Response]: - """List customer profiles - - List all customer profiles. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param sandbox: Indicates whether you are pointing to a sandbox or live customer. - :type sandbox: 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._get_customer_profiles_serialize( - page_size=page_size, - skip=skip, - sandbox=sandbox, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomerProfiles200Response", - } - 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_customer_profiles_without_preload_content( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - sandbox: Annotated[Optional[StrictBool], Field(description="Indicates whether you are pointing to a sandbox or live customer.")] = 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: - """List customer profiles - - List all customer profiles. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param sandbox: Indicates whether you are pointing to a sandbox or live customer. - :type sandbox: 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._get_customer_profiles_serialize( - page_size=page_size, - skip=skip, - sandbox=sandbox, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomerProfiles200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_customer_profiles_serialize( - self, - page_size, - skip, - sandbox, - _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 page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sandbox is not None: - - _query_params.append(('sandbox', sandbox)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/customers/no_total', - 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_customers_by_attributes( - self, - customer_profile_search_query: Annotated[CustomerProfileSearchQuery, Field(description="body")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - sandbox: Annotated[Optional[StrictBool], Field(description="Indicates whether you are pointing to a sandbox or live customer.")] = 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, - ) -> GetCustomersByAttributes200Response: - """List customer profiles matching the given attributes - - Get a list of the customer profiles matching the provided criteria. The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request. - - :param customer_profile_search_query: body (required) - :type customer_profile_search_query: CustomerProfileSearchQuery - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param sandbox: Indicates whether you are pointing to a sandbox or live customer. - :type sandbox: 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._get_customers_by_attributes_serialize( - customer_profile_search_query=customer_profile_search_query, - page_size=page_size, - skip=skip, - sandbox=sandbox, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomersByAttributes200Response", - } - 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_customers_by_attributes_with_http_info( - self, - customer_profile_search_query: Annotated[CustomerProfileSearchQuery, Field(description="body")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - sandbox: Annotated[Optional[StrictBool], Field(description="Indicates whether you are pointing to a sandbox or live customer.")] = 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[GetCustomersByAttributes200Response]: - """List customer profiles matching the given attributes - - Get a list of the customer profiles matching the provided criteria. The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request. - - :param customer_profile_search_query: body (required) - :type customer_profile_search_query: CustomerProfileSearchQuery - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param sandbox: Indicates whether you are pointing to a sandbox or live customer. - :type sandbox: 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._get_customers_by_attributes_serialize( - customer_profile_search_query=customer_profile_search_query, - page_size=page_size, - skip=skip, - sandbox=sandbox, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomersByAttributes200Response", - } - 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_customers_by_attributes_without_preload_content( - self, - customer_profile_search_query: Annotated[CustomerProfileSearchQuery, Field(description="body")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - sandbox: Annotated[Optional[StrictBool], Field(description="Indicates whether you are pointing to a sandbox or live customer.")] = 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: - """List customer profiles matching the given attributes - - Get a list of the customer profiles matching the provided criteria. The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request. - - :param customer_profile_search_query: body (required) - :type customer_profile_search_query: CustomerProfileSearchQuery - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param sandbox: Indicates whether you are pointing to a sandbox or live customer. - :type sandbox: 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._get_customers_by_attributes_serialize( - customer_profile_search_query=customer_profile_search_query, - page_size=page_size, - skip=skip, - sandbox=sandbox, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomersByAttributes200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_customers_by_attributes_serialize( - self, - customer_profile_search_query, - page_size, - skip, - sandbox, - _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 page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sandbox is not None: - - _query_params.append(('sandbox', sandbox)) - - # process the header parameters - # process the form parameters - # process the body parameter - if customer_profile_search_query is not None: - _body_params = customer_profile_search_query - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/customer_search/no_total', - 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_dashboard_statistics( - self, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = 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, - ) -> GetDashboardStatistics200Response: - """Get statistics for loyalty dashboard - - Retrieve the statistics displayed on the specified loyalty program's dashboard, such as the total active points, pending points, spent points, and expired points. **Important:** The returned data does not include the current day. All statistics are updated daily at 11:59 PM in the loyalty program time zone. - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_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_dashboard_statistics_serialize( - loyalty_program_id=loyalty_program_id, - range_start=range_start, - range_end=range_end, - subledger_id=subledger_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetDashboardStatistics200Response", - } - 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_dashboard_statistics_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = 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[GetDashboardStatistics200Response]: - """Get statistics for loyalty dashboard - - Retrieve the statistics displayed on the specified loyalty program's dashboard, such as the total active points, pending points, spent points, and expired points. **Important:** The returned data does not include the current day. All statistics are updated daily at 11:59 PM in the loyalty program time zone. - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_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_dashboard_statistics_serialize( - loyalty_program_id=loyalty_program_id, - range_start=range_start, - range_end=range_end, - subledger_id=subledger_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetDashboardStatistics200Response", - } - 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_dashboard_statistics_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - range_start: Annotated[datetime, Field(description="Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - range_end: Annotated[datetime, Field(description="Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")], - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = 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: - """Get statistics for loyalty dashboard - - Retrieve the statistics displayed on the specified loyalty program's dashboard, such as the total active points, pending points, spent points, and expired points. **Important:** The returned data does not include the current day. All statistics are updated daily at 11:59 PM in the loyalty program time zone. - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param range_start: Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_start: datetime - :param range_end: Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - :type range_end: datetime - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_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_dashboard_statistics_serialize( - loyalty_program_id=loyalty_program_id, - range_start=range_start, - range_end=range_end, - subledger_id=subledger_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetDashboardStatistics200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_dashboard_statistics_serialize( - self, - loyalty_program_id, - range_start, - range_end, - subledger_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - # process the query parameters - if subledger_id is not None: - - _query_params.append(('subledgerId', subledger_id)) - - if range_start is not None: - if isinstance(range_start, datetime): - _query_params.append( - ( - 'rangeStart', - range_start.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('rangeStart', range_start)) - - if range_end is not None: - if isinstance(range_end, datetime): - _query_params.append( - ( - 'rangeEnd', - range_end.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('rangeEnd', range_end)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/dashboard', - 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_event_types( - self, - name: Annotated[Optional[StrictStr], Field(description="Filter results to event types with the given name. This parameter implies `includeOldVersions`.")] = None, - include_old_versions: Annotated[Optional[StrictBool], Field(description="Include all versions of every event type.")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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, - ) -> GetEventTypes200Response: - """List event types - - Fetch all event type definitions for your account. - - :param name: Filter results to event types with the given name. This parameter implies `includeOldVersions`. - :type name: str - :param include_old_versions: Include all versions of every event type. - :type include_old_versions: bool - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_types_serialize( - name=name, - include_old_versions=include_old_versions, - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetEventTypes200Response", - } - 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_types_with_http_info( - self, - name: Annotated[Optional[StrictStr], Field(description="Filter results to event types with the given name. This parameter implies `includeOldVersions`.")] = None, - include_old_versions: Annotated[Optional[StrictBool], Field(description="Include all versions of every event type.")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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[GetEventTypes200Response]: - """List event types - - Fetch all event type definitions for your account. - - :param name: Filter results to event types with the given name. This parameter implies `includeOldVersions`. - :type name: str - :param include_old_versions: Include all versions of every event type. - :type include_old_versions: bool - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_types_serialize( - name=name, - include_old_versions=include_old_versions, - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetEventTypes200Response", - } - 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_types_without_preload_content( - self, - name: Annotated[Optional[StrictStr], Field(description="Filter results to event types with the given name. This parameter implies `includeOldVersions`.")] = None, - include_old_versions: Annotated[Optional[StrictBool], Field(description="Include all versions of every event type.")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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: - """List event types - - Fetch all event type definitions for your account. - - :param name: Filter results to event types with the given name. This parameter implies `includeOldVersions`. - :type name: str - :param include_old_versions: Include all versions of every event type. - :type include_old_versions: bool - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_types_serialize( - name=name, - include_old_versions=include_old_versions, - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetEventTypes200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_event_types_serialize( - self, - name, - include_old_versions, - page_size, - skip, - sort, - _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 name is not None: - - _query_params.append(('name', name)) - - if include_old_versions is not None: - - _query_params.append(('includeOldVersions', include_old_versions)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/event_types', - 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_exports( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - application_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by Application ID.")] = None, - campaign_id: Annotated[Optional[StrictInt], Field(description="Filter by the campaign ID on which the limit counters are used.")] = None, - entity: Annotated[Optional[StrictStr], Field(description="The name of the entity type that was exported.")] = 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, - ) -> GetExports200Response: - """Get exports - - List all past exports - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param application_id: Filter results by Application ID. - :type application_id: float - :param campaign_id: Filter by the campaign ID on which the limit counters are used. - :type campaign_id: int - :param entity: The name of the entity type that was exported. - :type entity: 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_exports_serialize( - page_size=page_size, - skip=skip, - application_id=application_id, - campaign_id=campaign_id, - entity=entity, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetExports200Response", - } - 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_exports_with_http_info( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - application_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by Application ID.")] = None, - campaign_id: Annotated[Optional[StrictInt], Field(description="Filter by the campaign ID on which the limit counters are used.")] = None, - entity: Annotated[Optional[StrictStr], Field(description="The name of the entity type that was exported.")] = 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[GetExports200Response]: - """Get exports - - List all past exports - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param application_id: Filter results by Application ID. - :type application_id: float - :param campaign_id: Filter by the campaign ID on which the limit counters are used. - :type campaign_id: int - :param entity: The name of the entity type that was exported. - :type entity: 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_exports_serialize( - page_size=page_size, - skip=skip, - application_id=application_id, - campaign_id=campaign_id, - entity=entity, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetExports200Response", - } - 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_exports_without_preload_content( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - application_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by Application ID.")] = None, - campaign_id: Annotated[Optional[StrictInt], Field(description="Filter by the campaign ID on which the limit counters are used.")] = None, - entity: Annotated[Optional[StrictStr], Field(description="The name of the entity type that was exported.")] = 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: - """Get exports - - List all past exports - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param application_id: Filter results by Application ID. - :type application_id: float - :param campaign_id: Filter by the campaign ID on which the limit counters are used. - :type campaign_id: int - :param entity: The name of the entity type that was exported. - :type entity: 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_exports_serialize( - page_size=page_size, - skip=skip, - application_id=application_id, - campaign_id=campaign_id, - entity=entity, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetExports200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_exports_serialize( - self, - page_size, - skip, - application_id, - campaign_id, - entity, - _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 page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if application_id is not None: - - _query_params.append(('applicationId', application_id)) - - if campaign_id is not None: - - _query_params.append(('campaignId', campaign_id)) - - if entity is not None: - - _query_params.append(('entity', entity)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/exports', - 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_card( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - _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, - ) -> LoyaltyCard: - """Get loyalty card - - Get the given 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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_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_loyalty_card_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCard", - '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 get_loyalty_card_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - _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[LoyaltyCard]: - """Get loyalty card - - Get the given 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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_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_loyalty_card_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCard", - '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 get_loyalty_card_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - _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 loyalty card - - Get the given 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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_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_loyalty_card_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCard", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_loyalty_card_serialize( - self, - loyalty_program_id, - loyalty_card_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - if loyalty_card_id is not None: - _path_params['loyaltyCardId'] = loyalty_card_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}', - 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_card_transaction_logs( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = 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, - _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, - ) -> GetLoyaltyCardTransactionLogs200Response: - """List card's transactions - - Retrieve the transaction logs for the given [loyalty card](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. - - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: 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. - :type transaction_uuids: List[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_loyalty_card_transaction_logs_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - start_date=start_date, - end_date=end_date, - page_size=page_size, - skip=skip, - subledger_id=subledger_id, - customer_session_ids=customer_session_ids, - transaction_uuids=transaction_uuids, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyCardTransactionLogs200Response", - '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 get_loyalty_card_transaction_logs_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = 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, - _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[GetLoyaltyCardTransactionLogs200Response]: - """List card's transactions - - Retrieve the transaction logs for the given [loyalty card](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. - - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: 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. - :type transaction_uuids: List[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_loyalty_card_transaction_logs_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - start_date=start_date, - end_date=end_date, - page_size=page_size, - skip=skip, - subledger_id=subledger_id, - customer_session_ids=customer_session_ids, - transaction_uuids=transaction_uuids, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyCardTransactionLogs200Response", - '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 get_loyalty_card_transaction_logs_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = 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, - _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: - """List card's transactions - - Retrieve the transaction logs for the given [loyalty card](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. - - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: 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. - :type transaction_uuids: List[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_loyalty_card_transaction_logs_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - start_date=start_date, - end_date=end_date, - page_size=page_size, - skip=skip, - subledger_id=subledger_id, - customer_session_ids=customer_session_ids, - transaction_uuids=transaction_uuids, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyCardTransactionLogs200Response", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_loyalty_card_transaction_logs_serialize( - self, - loyalty_program_id, - loyalty_card_id, - start_date, - end_date, - page_size, - skip, - subledger_id, - customer_session_ids, - transaction_uuids, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - 'customerSessionIDs': 'multi', - 'transactionUUIDs': 'multi', - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - if loyalty_card_id is not None: - _path_params['loyaltyCardId'] = loyalty_card_id - # process the query parameters - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) - - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if subledger_id is not None: - - _query_params.append(('subledgerId', subledger_id)) - - if customer_session_ids is not None: - - _query_params.append(('customerSessionIDs', customer_session_ids)) - - if transaction_uuids is not None: - - _query_params.append(('transactionUUIDs', transaction_uuids)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/logs', - 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_cards( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="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. ")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - identifier: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True)]], Field(description="The card code by which to filter loyalty cards in the response.")] = None, - profile_id: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Filter results by customer profile ID.")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty card batch ID.")] = 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, - ) -> GetLoyaltyCards200Response: - """List loyalty cards - - For the given card-based loyalty program, list the loyalty cards that match your filter criteria. - - :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 - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param identifier: The card code by which to filter loyalty cards in the response. - :type identifier: str - :param profile_id: Filter results by customer profile ID. - :type profile_id: int - :param batch_id: Filter results by loyalty card batch ID. - :type batch_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_loyalty_cards_serialize( - loyalty_program_id=loyalty_program_id, - page_size=page_size, - skip=skip, - sort=sort, - identifier=identifier, - profile_id=profile_id, - batch_id=batch_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyCards200Response", - '400': "ErrorResponseWithStatus", - '401': "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_loyalty_cards_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="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. ")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - identifier: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True)]], Field(description="The card code by which to filter loyalty cards in the response.")] = None, - profile_id: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Filter results by customer profile ID.")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty card batch ID.")] = 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[GetLoyaltyCards200Response]: - """List loyalty cards - - For the given card-based loyalty program, list the loyalty cards that match your filter criteria. - - :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 - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param identifier: The card code by which to filter loyalty cards in the response. - :type identifier: str - :param profile_id: Filter results by customer profile ID. - :type profile_id: int - :param batch_id: Filter results by loyalty card batch ID. - :type batch_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_loyalty_cards_serialize( - loyalty_program_id=loyalty_program_id, - page_size=page_size, - skip=skip, - sort=sort, - identifier=identifier, - profile_id=profile_id, - batch_id=batch_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyCards200Response", - '400': "ErrorResponseWithStatus", - '401': "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_loyalty_cards_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="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. ")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - identifier: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True)]], Field(description="The card code by which to filter loyalty cards in the response.")] = None, - profile_id: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Filter results by customer profile ID.")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty card batch ID.")] = 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: - """List loyalty cards - - For the given card-based loyalty program, list the loyalty cards that match your filter criteria. - - :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 - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param identifier: The card code by which to filter loyalty cards in the response. - :type identifier: str - :param profile_id: Filter results by customer profile ID. - :type profile_id: int - :param batch_id: Filter results by loyalty card batch ID. - :type batch_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_loyalty_cards_serialize( - loyalty_program_id=loyalty_program_id, - page_size=page_size, - skip=skip, - sort=sort, - identifier=identifier, - profile_id=profile_id, - batch_id=batch_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyCards200Response", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_loyalty_cards_serialize( - self, - loyalty_program_id, - page_size, - skip, - sort, - identifier, - profile_id, - batch_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if identifier is not None: - - _query_params.append(('identifier', identifier)) - - if profile_id is not None: - - _query_params.append(('profileId', profile_id)) - - if batch_id is not None: - - _query_params.append(('batchId', batch_id)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards', - 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_ledger_balances( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - integration_id: Annotated[StrictStr, Field(description="The integration 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. ")], - end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger.")] = None, - include_tiers: Annotated[Optional[StrictBool], Field(description="Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. ")] = None, - include_projected_tier: Annotated[Optional[StrictBool], Field(description="Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. ")] = 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, - ) -> LoyaltyBalancesWithTiers: - """Get customer's loyalty balances - - Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. **Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) - - :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param subledger_id: The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. - :type subledger_id: str - :param include_tiers: Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. - :type include_tiers: bool - :param include_projected_tier: Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. - :type include_projected_tier: 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._get_loyalty_ledger_balances_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - end_date=end_date, - subledger_id=subledger_id, - include_tiers=include_tiers, - include_projected_tier=include_projected_tier, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyBalancesWithTiers", - '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 get_loyalty_ledger_balances_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - integration_id: Annotated[StrictStr, Field(description="The integration 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. ")], - end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger.")] = None, - include_tiers: Annotated[Optional[StrictBool], Field(description="Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. ")] = None, - include_projected_tier: Annotated[Optional[StrictBool], Field(description="Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. ")] = 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[LoyaltyBalancesWithTiers]: - """Get customer's loyalty balances - - Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. **Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) - - :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param subledger_id: The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. - :type subledger_id: str - :param include_tiers: Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. - :type include_tiers: bool - :param include_projected_tier: Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. - :type include_projected_tier: 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._get_loyalty_ledger_balances_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - end_date=end_date, - subledger_id=subledger_id, - include_tiers=include_tiers, - include_projected_tier=include_projected_tier, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyBalancesWithTiers", - '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 get_loyalty_ledger_balances_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - integration_id: Annotated[StrictStr, Field(description="The integration 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. ")], - end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger.")] = None, - include_tiers: Annotated[Optional[StrictBool], Field(description="Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. ")] = None, - include_projected_tier: Annotated[Optional[StrictBool], Field(description="Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. ")] = 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: - """Get customer's loyalty balances - - Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. **Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) - - :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param subledger_id: The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. - :type subledger_id: str - :param include_tiers: Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. - :type include_tiers: bool - :param include_projected_tier: Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. - :type include_projected_tier: 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._get_loyalty_ledger_balances_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - end_date=end_date, - subledger_id=subledger_id, - include_tiers=include_tiers, - include_projected_tier=include_projected_tier, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyBalancesWithTiers", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_loyalty_ledger_balances_serialize( - self, - loyalty_program_id, - integration_id, - end_date, - subledger_id, - include_tiers, - include_projected_tier, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - if integration_id is not None: - _path_params['integrationId'] = integration_id - # process the query parameters - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if subledger_id is not None: - - _query_params.append(('subledgerId', subledger_id)) - - if include_tiers is not None: - - _query_params.append(('includeTiers', include_tiers)) - - if include_projected_tier is not None: - - _query_params.append(('includeProjectedTier', include_projected_tier)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_balances', - 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_points( - self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - 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. ")], - _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, - ) -> LoyaltyLedger: - """(Deprecated) Get customer's full loyalty ledger - - Get the loyalty ledger for this profile integration ID. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). - - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :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 - warnings.warn("GET /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId} is deprecated.", DeprecationWarning) - - _param = self._get_loyalty_points_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyLedger", - } - 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_loyalty_points_with_http_info( - self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - 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. ")], - _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[LoyaltyLedger]: - """(Deprecated) Get customer's full loyalty ledger - - Get the loyalty ledger for this profile integration ID. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). - - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :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 - warnings.warn("GET /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId} is deprecated.", DeprecationWarning) - - _param = self._get_loyalty_points_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyLedger", - } - 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_loyalty_points_without_preload_content( - self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - 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. ")], - _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: - """(Deprecated) Get customer's full loyalty ledger - - Get the loyalty ledger for this profile integration ID. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). - - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :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 - warnings.warn("GET /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId} is deprecated.", DeprecationWarning) - - _param = self._get_loyalty_points_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyLedger", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_loyalty_points_serialize( - self, - loyalty_program_id, - integration_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - if integration_id is not None: - _path_params['integrationId'] = integration_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{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_program( - self, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - _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, - ) -> LoyaltyProgram: - """Get loyalty program - - Get the specified [loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview). To list all loyalty programs in your Application, use [List loyalty programs](#operation/getLoyaltyPrograms). To list the loyalty programs that a customer profile is part of, use the [List customer data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :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_loyalty_program_serialize( - loyalty_program_id=loyalty_program_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyProgram", - } - 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_loyalty_program_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - _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[LoyaltyProgram]: - """Get loyalty program - - Get the specified [loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview). To list all loyalty programs in your Application, use [List loyalty programs](#operation/getLoyaltyPrograms). To list the loyalty programs that a customer profile is part of, use the [List customer data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :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_loyalty_program_serialize( - loyalty_program_id=loyalty_program_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyProgram", - } - 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_loyalty_program_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - _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 loyalty program - - Get the specified [loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview). To list all loyalty programs in your Application, use [List loyalty programs](#operation/getLoyaltyPrograms). To list the loyalty programs that a customer profile is part of, use the [List customer data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :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_loyalty_program_serialize( - loyalty_program_id=loyalty_program_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyProgram", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_loyalty_program_serialize( - self, - loyalty_program_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}', - 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_program_profile_ledger_transactions( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - integration_id: Annotated[StrictStr, Field(description="The integration 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. ")], - 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, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger.")] = None, - loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = 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, - ) -> GetLoyaltyProgramProfileTransactions200Response: - """List customer's loyalty transactions - - Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. **Note:** To retrieve all loyalty program transaction logs in a given loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. - - :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :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. - :type transaction_uuids: List[str] - :param subledger_id: The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. - :type subledger_id: str - :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. - :type loyalty_transaction_type: str - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. - :type awaits_activation: 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._get_loyalty_program_profile_ledger_transactions_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - customer_session_ids=customer_session_ids, - transaction_uuids=transaction_uuids, - subledger_id=subledger_id, - loyalty_transaction_type=loyalty_transaction_type, - start_date=start_date, - end_date=end_date, - page_size=page_size, - skip=skip, - awaits_activation=awaits_activation, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyProgramProfileTransactions200Response", - '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 get_loyalty_program_profile_ledger_transactions_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - integration_id: Annotated[StrictStr, Field(description="The integration 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. ")], - 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, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger.")] = None, - loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = 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[GetLoyaltyProgramProfileTransactions200Response]: - """List customer's loyalty transactions - - Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. **Note:** To retrieve all loyalty program transaction logs in a given loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. - - :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :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. - :type transaction_uuids: List[str] - :param subledger_id: The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. - :type subledger_id: str - :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. - :type loyalty_transaction_type: str - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. - :type awaits_activation: 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._get_loyalty_program_profile_ledger_transactions_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - customer_session_ids=customer_session_ids, - transaction_uuids=transaction_uuids, - subledger_id=subledger_id, - loyalty_transaction_type=loyalty_transaction_type, - start_date=start_date, - end_date=end_date, - page_size=page_size, - skip=skip, - awaits_activation=awaits_activation, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyProgramProfileTransactions200Response", - '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 get_loyalty_program_profile_ledger_transactions_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - integration_id: Annotated[StrictStr, Field(description="The integration 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. ")], - 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, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger.")] = None, - loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = 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: - """List customer's loyalty transactions - - Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. **Note:** To retrieve all loyalty program transaction logs in a given loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. - - :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :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. - :type transaction_uuids: List[str] - :param subledger_id: The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. - :type subledger_id: str - :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. - :type loyalty_transaction_type: str - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. - :type awaits_activation: 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._get_loyalty_program_profile_ledger_transactions_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - customer_session_ids=customer_session_ids, - transaction_uuids=transaction_uuids, - subledger_id=subledger_id, - loyalty_transaction_type=loyalty_transaction_type, - start_date=start_date, - end_date=end_date, - page_size=page_size, - skip=skip, - awaits_activation=awaits_activation, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyProgramProfileTransactions200Response", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_loyalty_program_profile_ledger_transactions_serialize( - self, - loyalty_program_id, - integration_id, - customer_session_ids, - transaction_uuids, - subledger_id, - loyalty_transaction_type, - start_date, - end_date, - page_size, - skip, - awaits_activation, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - 'customerSessionIDs': 'multi', - 'transactionUUIDs': 'multi', - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - if integration_id is not None: - _path_params['integrationId'] = integration_id - # process the query parameters - if customer_session_ids is not None: - - _query_params.append(('customerSessionIDs', customer_session_ids)) - - if transaction_uuids is not None: - - _query_params.append(('transactionUUIDs', transaction_uuids)) - - if subledger_id is not None: - - _query_params.append(('subledgerId', subledger_id)) - - if loyalty_transaction_type is not None: - - _query_params.append(('loyaltyTransactionType', loyalty_transaction_type)) - - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) - - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if awaits_activation is not None: - - _query_params.append(('awaitsActivation', awaits_activation)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_transactions', - 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_program_transactions( - self, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = 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, - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = 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, - ) -> GetLoyaltyProgramTransactions200Response: - """List loyalty program transactions - - Retrieve loyalty program transaction logs in a given loyalty program with filtering options applied. Manual and imported transactions are also included. **Note:** If no filters are applied, the last 50 loyalty transactions for the given loyalty program are returned. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. - :type loyalty_transaction_type: str - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: 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. - :type transaction_uuids: List[str] - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. - :type awaits_activation: 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._get_loyalty_program_transactions_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_transaction_type=loyalty_transaction_type, - subledger_id=subledger_id, - customer_session_ids=customer_session_ids, - transaction_uuids=transaction_uuids, - start_date=start_date, - end_date=end_date, - page_size=page_size, - skip=skip, - awaits_activation=awaits_activation, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyProgramTransactions200Response", - '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 get_loyalty_program_transactions_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = 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, - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = 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[GetLoyaltyProgramTransactions200Response]: - """List loyalty program transactions - - Retrieve loyalty program transaction logs in a given loyalty program with filtering options applied. Manual and imported transactions are also included. **Note:** If no filters are applied, the last 50 loyalty transactions for the given loyalty program are returned. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. - :type loyalty_transaction_type: str - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: 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. - :type transaction_uuids: List[str] - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. - :type awaits_activation: 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._get_loyalty_program_transactions_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_transaction_type=loyalty_transaction_type, - subledger_id=subledger_id, - customer_session_ids=customer_session_ids, - transaction_uuids=transaction_uuids, - start_date=start_date, - end_date=end_date, - page_size=page_size, - skip=skip, - awaits_activation=awaits_activation, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyProgramTransactions200Response", - '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 get_loyalty_program_transactions_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = 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, - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = 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: - """List loyalty program transactions - - Retrieve loyalty program transaction logs in a given loyalty program with filtering options applied. Manual and imported transactions are also included. **Note:** If no filters are applied, the last 50 loyalty transactions for the given loyalty program are returned. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. - :type loyalty_transaction_type: str - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: 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. - :type transaction_uuids: List[str] - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. - :type awaits_activation: 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._get_loyalty_program_transactions_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_transaction_type=loyalty_transaction_type, - subledger_id=subledger_id, - customer_session_ids=customer_session_ids, - transaction_uuids=transaction_uuids, - start_date=start_date, - end_date=end_date, - page_size=page_size, - skip=skip, - awaits_activation=awaits_activation, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyProgramTransactions200Response", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_loyalty_program_transactions_serialize( - self, - loyalty_program_id, - loyalty_transaction_type, - subledger_id, - customer_session_ids, - transaction_uuids, - start_date, - end_date, - page_size, - skip, - awaits_activation, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - 'customerSessionIDs': 'multi', - 'transactionUUIDs': 'multi', - } - - _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 - if loyalty_transaction_type is not None: - - _query_params.append(('loyaltyTransactionType', loyalty_transaction_type)) - - if subledger_id is not None: - - _query_params.append(('subledgerId', subledger_id)) - - if customer_session_ids is not None: - - _query_params.append(('customerSessionIDs', customer_session_ids)) - - if transaction_uuids is not None: - - _query_params.append(('transactionUUIDs', transaction_uuids)) - - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) - - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if awaits_activation is not None: - - _query_params.append(('awaitsActivation', awaits_activation)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/transactions', - 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_programs( - self, - _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, - ) -> GetLoyaltyPrograms200Response: - """List loyalty programs - - List the loyalty programs of the account. - - :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_loyalty_programs_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyPrograms200Response", - } - 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_loyalty_programs_with_http_info( - self, - _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[GetLoyaltyPrograms200Response]: - """List loyalty programs - - List the loyalty programs of the account. - - :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_loyalty_programs_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyPrograms200Response", - } - 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_loyalty_programs_without_preload_content( - self, - _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: - """List loyalty programs - - List the loyalty programs of the account. - - :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_loyalty_programs_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyPrograms200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_loyalty_programs_serialize( - self, - _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 - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs', - 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_statistics( - self, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - _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, - ) -> LoyaltyDashboardData: - """(Deprecated) Get loyalty program statistics - - ⚠️ Deprecation notice: Support for requests to this endpoint will end soon. To retrieve statistics for a loyalty program, use the [Get statistics for loyalty dashboard](/management-api#tag/Loyalty/operation/getDashboardStatistics) endpoint. Retrieve the statistics of the specified loyalty program, such as the total active points, pending points, spent points, and expired points. - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :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 - warnings.warn("GET /v1/loyalty_programs/{loyaltyProgramId}/statistics is deprecated.", DeprecationWarning) - - _param = self._get_loyalty_statistics_serialize( - loyalty_program_id=loyalty_program_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyDashboardData", - } - 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_loyalty_statistics_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - _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[LoyaltyDashboardData]: - """(Deprecated) Get loyalty program statistics - - ⚠️ Deprecation notice: Support for requests to this endpoint will end soon. To retrieve statistics for a loyalty program, use the [Get statistics for loyalty dashboard](/management-api#tag/Loyalty/operation/getDashboardStatistics) endpoint. Retrieve the statistics of the specified loyalty program, such as the total active points, pending points, spent points, and expired points. - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :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 - warnings.warn("GET /v1/loyalty_programs/{loyaltyProgramId}/statistics is deprecated.", DeprecationWarning) - - _param = self._get_loyalty_statistics_serialize( - loyalty_program_id=loyalty_program_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyDashboardData", - } - 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_loyalty_statistics_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - _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: - """(Deprecated) Get loyalty program statistics - - ⚠️ Deprecation notice: Support for requests to this endpoint will end soon. To retrieve statistics for a loyalty program, use the [Get statistics for loyalty dashboard](/management-api#tag/Loyalty/operation/getDashboardStatistics) endpoint. Retrieve the statistics of the specified loyalty program, such as the total active points, pending points, spent points, and expired points. - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :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 - warnings.warn("GET /v1/loyalty_programs/{loyaltyProgramId}/statistics is deprecated.", DeprecationWarning) - - _param = self._get_loyalty_statistics_serialize( - loyalty_program_id=loyalty_program_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyDashboardData", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_loyalty_statistics_serialize( - self, - loyalty_program_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/statistics', - 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_message_logs( - self, - entity_type: Annotated[StrictStr, Field(description="The entity type the log is related to. ")], - message_id: Annotated[Optional[StrictStr], Field(description="Filter results by message ID.")] = None, - change_type: Annotated[Optional[StrictStr], Field(description="Filter results by change type.")] = None, - notification_ids: Annotated[Optional[StrictStr], Field(description="Filter results by notification ID (include up to 30 values, separated by a comma).")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. Use UTC time.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. Use UTC time.")] = None, - cursor: Annotated[Optional[Union[StrictBytes, StrictStr]], Field(description="A specific unique value in the database. If this value is not given, the server fetches results starting with the first record. ")] = None, - period: Annotated[Optional[StrictStr], Field(description="Filter results by time period. Choose between the available relative time frames. ")] = None, - is_successful: Annotated[Optional[StrictBool], Field(description="Indicates whether to return log entries with either successful or unsuccessful HTTP response codes. When set to`true`, only log entries with `2xx` response codes are returned. When set to `false`, only log entries with `4xx` and `5xx` response codes are returned. ")] = None, - application_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by Application ID.")] = None, - campaign_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by campaign ID.")] = None, - loyalty_program_id: Annotated[Optional[StrictInt], Field(description="Identifier of the loyalty program.")] = None, - response_code: Annotated[Optional[StrictInt], Field(description="Filter results by response status code.")] = None, - webhook_ids: Annotated[Optional[StrictStr], Field(description="Filter results by webhook ID (include up to 30 values, separated by a comma).")] = 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, - ) -> MessageLogEntries: - """List message log entries - - Retrieve all message log entries. - - :param entity_type: The entity type the log is related to. (required) - :type entity_type: str - :param message_id: Filter results by message ID. - :type message_id: str - :param change_type: Filter results by change type. - :type change_type: str - :param notification_ids: Filter results by notification ID (include up to 30 values, separated by a comma). - :type notification_ids: str - :param created_before: Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. Use UTC time. - :type created_before: datetime - :param created_after: Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. Use UTC time. - :type created_after: datetime - :param cursor: A specific unique value in the database. If this value is not given, the server fetches results starting with the first record. - :type cursor: bytearray - :param period: Filter results by time period. Choose between the available relative time frames. - :type period: str - :param is_successful: Indicates whether to return log entries with either successful or unsuccessful HTTP response codes. When set to`true`, only log entries with `2xx` response codes are returned. When set to `false`, only log entries with `4xx` and `5xx` response codes are returned. - :type is_successful: bool - :param application_id: Filter results by Application ID. - :type application_id: float - :param campaign_id: Filter results by campaign ID. - :type campaign_id: float - :param loyalty_program_id: Identifier of the loyalty program. - :type loyalty_program_id: int - :param response_code: Filter results by response status code. - :type response_code: int - :param webhook_ids: Filter results by webhook ID (include up to 30 values, separated by a comma). - :type webhook_ids: 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_message_logs_serialize( - entity_type=entity_type, - message_id=message_id, - change_type=change_type, - notification_ids=notification_ids, - created_before=created_before, - created_after=created_after, - cursor=cursor, - period=period, - is_successful=is_successful, - application_id=application_id, - campaign_id=campaign_id, - loyalty_program_id=loyalty_program_id, - response_code=response_code, - webhook_ids=webhook_ids, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "MessageLogEntries", - } - 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_message_logs_with_http_info( - self, - entity_type: Annotated[StrictStr, Field(description="The entity type the log is related to. ")], - message_id: Annotated[Optional[StrictStr], Field(description="Filter results by message ID.")] = None, - change_type: Annotated[Optional[StrictStr], Field(description="Filter results by change type.")] = None, - notification_ids: Annotated[Optional[StrictStr], Field(description="Filter results by notification ID (include up to 30 values, separated by a comma).")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. Use UTC time.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. Use UTC time.")] = None, - cursor: Annotated[Optional[Union[StrictBytes, StrictStr]], Field(description="A specific unique value in the database. If this value is not given, the server fetches results starting with the first record. ")] = None, - period: Annotated[Optional[StrictStr], Field(description="Filter results by time period. Choose between the available relative time frames. ")] = None, - is_successful: Annotated[Optional[StrictBool], Field(description="Indicates whether to return log entries with either successful or unsuccessful HTTP response codes. When set to`true`, only log entries with `2xx` response codes are returned. When set to `false`, only log entries with `4xx` and `5xx` response codes are returned. ")] = None, - application_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by Application ID.")] = None, - campaign_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by campaign ID.")] = None, - loyalty_program_id: Annotated[Optional[StrictInt], Field(description="Identifier of the loyalty program.")] = None, - response_code: Annotated[Optional[StrictInt], Field(description="Filter results by response status code.")] = None, - webhook_ids: Annotated[Optional[StrictStr], Field(description="Filter results by webhook ID (include up to 30 values, separated by a comma).")] = 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[MessageLogEntries]: - """List message log entries - - Retrieve all message log entries. - - :param entity_type: The entity type the log is related to. (required) - :type entity_type: str - :param message_id: Filter results by message ID. - :type message_id: str - :param change_type: Filter results by change type. - :type change_type: str - :param notification_ids: Filter results by notification ID (include up to 30 values, separated by a comma). - :type notification_ids: str - :param created_before: Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. Use UTC time. - :type created_before: datetime - :param created_after: Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. Use UTC time. - :type created_after: datetime - :param cursor: A specific unique value in the database. If this value is not given, the server fetches results starting with the first record. - :type cursor: bytearray - :param period: Filter results by time period. Choose between the available relative time frames. - :type period: str - :param is_successful: Indicates whether to return log entries with either successful or unsuccessful HTTP response codes. When set to`true`, only log entries with `2xx` response codes are returned. When set to `false`, only log entries with `4xx` and `5xx` response codes are returned. - :type is_successful: bool - :param application_id: Filter results by Application ID. - :type application_id: float - :param campaign_id: Filter results by campaign ID. - :type campaign_id: float - :param loyalty_program_id: Identifier of the loyalty program. - :type loyalty_program_id: int - :param response_code: Filter results by response status code. - :type response_code: int - :param webhook_ids: Filter results by webhook ID (include up to 30 values, separated by a comma). - :type webhook_ids: 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_message_logs_serialize( - entity_type=entity_type, - message_id=message_id, - change_type=change_type, - notification_ids=notification_ids, - created_before=created_before, - created_after=created_after, - cursor=cursor, - period=period, - is_successful=is_successful, - application_id=application_id, - campaign_id=campaign_id, - loyalty_program_id=loyalty_program_id, - response_code=response_code, - webhook_ids=webhook_ids, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "MessageLogEntries", - } - 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_message_logs_without_preload_content( - self, - entity_type: Annotated[StrictStr, Field(description="The entity type the log is related to. ")], - message_id: Annotated[Optional[StrictStr], Field(description="Filter results by message ID.")] = None, - change_type: Annotated[Optional[StrictStr], Field(description="Filter results by change type.")] = None, - notification_ids: Annotated[Optional[StrictStr], Field(description="Filter results by notification ID (include up to 30 values, separated by a comma).")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. Use UTC time.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. Use UTC time.")] = None, - cursor: Annotated[Optional[Union[StrictBytes, StrictStr]], Field(description="A specific unique value in the database. If this value is not given, the server fetches results starting with the first record. ")] = None, - period: Annotated[Optional[StrictStr], Field(description="Filter results by time period. Choose between the available relative time frames. ")] = None, - is_successful: Annotated[Optional[StrictBool], Field(description="Indicates whether to return log entries with either successful or unsuccessful HTTP response codes. When set to`true`, only log entries with `2xx` response codes are returned. When set to `false`, only log entries with `4xx` and `5xx` response codes are returned. ")] = None, - application_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by Application ID.")] = None, - campaign_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by campaign ID.")] = None, - loyalty_program_id: Annotated[Optional[StrictInt], Field(description="Identifier of the loyalty program.")] = None, - response_code: Annotated[Optional[StrictInt], Field(description="Filter results by response status code.")] = None, - webhook_ids: Annotated[Optional[StrictStr], Field(description="Filter results by webhook ID (include up to 30 values, separated by a comma).")] = 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: - """List message log entries - - Retrieve all message log entries. - - :param entity_type: The entity type the log is related to. (required) - :type entity_type: str - :param message_id: Filter results by message ID. - :type message_id: str - :param change_type: Filter results by change type. - :type change_type: str - :param notification_ids: Filter results by notification ID (include up to 30 values, separated by a comma). - :type notification_ids: str - :param created_before: Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. Use UTC time. - :type created_before: datetime - :param created_after: Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. Use UTC time. - :type created_after: datetime - :param cursor: A specific unique value in the database. If this value is not given, the server fetches results starting with the first record. - :type cursor: bytearray - :param period: Filter results by time period. Choose between the available relative time frames. - :type period: str - :param is_successful: Indicates whether to return log entries with either successful or unsuccessful HTTP response codes. When set to`true`, only log entries with `2xx` response codes are returned. When set to `false`, only log entries with `4xx` and `5xx` response codes are returned. - :type is_successful: bool - :param application_id: Filter results by Application ID. - :type application_id: float - :param campaign_id: Filter results by campaign ID. - :type campaign_id: float - :param loyalty_program_id: Identifier of the loyalty program. - :type loyalty_program_id: int - :param response_code: Filter results by response status code. - :type response_code: int - :param webhook_ids: Filter results by webhook ID (include up to 30 values, separated by a comma). - :type webhook_ids: 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_message_logs_serialize( - entity_type=entity_type, - message_id=message_id, - change_type=change_type, - notification_ids=notification_ids, - created_before=created_before, - created_after=created_after, - cursor=cursor, - period=period, - is_successful=is_successful, - application_id=application_id, - campaign_id=campaign_id, - loyalty_program_id=loyalty_program_id, - response_code=response_code, - webhook_ids=webhook_ids, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "MessageLogEntries", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_message_logs_serialize( - self, - entity_type, - message_id, - change_type, - notification_ids, - created_before, - created_after, - cursor, - period, - is_successful, - application_id, - campaign_id, - loyalty_program_id, - response_code, - webhook_ids, - _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 message_id is not None: - - _query_params.append(('messageID', message_id)) - - if change_type is not None: - - _query_params.append(('changeType', change_type)) - - if notification_ids is not None: - - _query_params.append(('notificationIDs', notification_ids)) - - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - 'createdBefore', - created_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdBefore', created_before)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdAfter', created_after)) - - if cursor is not None: - - _query_params.append(('cursor', cursor)) - - if period is not None: - - _query_params.append(('period', period)) - - if is_successful is not None: - - _query_params.append(('isSuccessful', is_successful)) - - if entity_type is not None: - - _query_params.append(('entityType', entity_type)) - - if application_id is not None: - - _query_params.append(('applicationId', application_id)) - - if campaign_id is not None: - - _query_params.append(('campaignId', campaign_id)) - - if loyalty_program_id is not None: - - _query_params.append(('loyaltyProgramId', loyalty_program_id)) - - if response_code is not None: - - _query_params.append(('responseCode', response_code)) - - if webhook_ids is not None: - - _query_params.append(('webhookIDs', webhook_ids)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/message_logs', - 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_referrals_without_total_count( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - code: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. ")] = None, - advocate: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile ID specified in the referral's AdvocateProfileIntegrationId field.")] = 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, - ) -> GetReferralsWithoutTotalCount200Response: - """List referrals - - List all referrals of the specified campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param code: Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type code: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. - :type valid: str - :param usable: Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. - :type usable: str - :param advocate: Filter results by match with a profile ID specified in the referral's AdvocateProfileIntegrationId field. - :type advocate: 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_referrals_without_total_count_serialize( - application_id=application_id, - campaign_id=campaign_id, - page_size=page_size, - skip=skip, - sort=sort, - code=code, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - advocate=advocate, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetReferralsWithoutTotalCount200Response", - } - 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_referrals_without_total_count_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - code: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. ")] = None, - advocate: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile ID specified in the referral's AdvocateProfileIntegrationId field.")] = 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[GetReferralsWithoutTotalCount200Response]: - """List referrals - - List all referrals of the specified campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param code: Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type code: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. - :type valid: str - :param usable: Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. - :type usable: str - :param advocate: Filter results by match with a profile ID specified in the referral's AdvocateProfileIntegrationId field. - :type advocate: 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_referrals_without_total_count_serialize( - application_id=application_id, - campaign_id=campaign_id, - page_size=page_size, - skip=skip, - sort=sort, - code=code, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - advocate=advocate, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetReferralsWithoutTotalCount200Response", - } - 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_referrals_without_total_count_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - code: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. ")] = None, - advocate: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile ID specified in the referral's AdvocateProfileIntegrationId field.")] = 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: - """List referrals - - List all referrals of the specified campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param code: Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type code: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. - :type valid: str - :param usable: Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. - :type usable: str - :param advocate: Filter results by match with a profile ID specified in the referral's AdvocateProfileIntegrationId field. - :type advocate: 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_referrals_without_total_count_serialize( - application_id=application_id, - campaign_id=campaign_id, - page_size=page_size, - skip=skip, - sort=sort, - code=code, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - advocate=advocate, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetReferralsWithoutTotalCount200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_referrals_without_total_count_serialize( - self, - application_id, - campaign_id, - page_size, - skip, - sort, - code, - created_before, - created_after, - valid, - usable, - advocate, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if code is not None: - - _query_params.append(('code', code)) - - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - 'createdBefore', - created_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdBefore', created_before)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdAfter', created_after)) - - if valid is not None: - - _query_params.append(('valid', valid)) - - if usable is not None: - - _query_params.append(('usable', usable)) - - if advocate is not None: - - _query_params.append(('advocate', advocate)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/referrals/no_total', - 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_role_v2( - self, - role_id: Annotated[StrictInt, Field(description="The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RoleV2: - """Get role - - Get the details of a specific role. To see all the roles, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. - - :param role_id: The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) - :type role_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_role_v2_serialize( - role_id=role_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RoleV2", - } - 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_role_v2_with_http_info( - self, - role_id: Annotated[StrictInt, Field(description="The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RoleV2]: - """Get role - - Get the details of a specific role. To see all the roles, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. - - :param role_id: The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) - :type role_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_role_v2_serialize( - role_id=role_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RoleV2", - } - 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_role_v2_without_preload_content( - self, - role_id: Annotated[StrictInt, Field(description="The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get role - - Get the details of a specific role. To see all the roles, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. - - :param role_id: The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) - :type role_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_role_v2_serialize( - role_id=role_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RoleV2", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_role_v2_serialize( - self, - role_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 role_id is not None: - _path_params['roleId'] = role_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/roles/{roleId}', - 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_ruleset( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - ruleset_id: Annotated[StrictInt, Field(description="The ID of the ruleset.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Ruleset: - """Get ruleset - - Retrieve the specified ruleset. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param ruleset_id: The ID of the ruleset. (required) - :type ruleset_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_ruleset_serialize( - application_id=application_id, - campaign_id=campaign_id, - ruleset_id=ruleset_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Ruleset", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def get_ruleset_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - ruleset_id: Annotated[StrictInt, Field(description="The ID of the ruleset.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Ruleset]: - """Get ruleset - - Retrieve the specified ruleset. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param ruleset_id: The ID of the ruleset. (required) - :type ruleset_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_ruleset_serialize( - application_id=application_id, - campaign_id=campaign_id, - ruleset_id=ruleset_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Ruleset", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def get_ruleset_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - ruleset_id: Annotated[StrictInt, Field(description="The ID of the ruleset.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get ruleset - - Retrieve the specified ruleset. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param ruleset_id: The ID of the ruleset. (required) - :type ruleset_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_ruleset_serialize( - application_id=application_id, - campaign_id=campaign_id, - ruleset_id=ruleset_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Ruleset", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_ruleset_serialize( - self, - application_id, - campaign_id, - ruleset_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - if ruleset_id is not None: - _path_params['rulesetId'] = ruleset_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId}', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def get_rulesets( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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, - ) -> GetRulesets200Response: - """List campaign rulesets - - List all rulesets of this campaign. A ruleset is a revision of the rules of a campaign. **Important:** The response also includes deleted rules. You should only consider the latest revision of the returned rulesets. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_rulesets_serialize( - application_id=application_id, - campaign_id=campaign_id, - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetRulesets200Response", - } - 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_rulesets_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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[GetRulesets200Response]: - """List campaign rulesets - - List all rulesets of this campaign. A ruleset is a revision of the rules of a campaign. **Important:** The response also includes deleted rules. You should only consider the latest revision of the returned rulesets. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_rulesets_serialize( - application_id=application_id, - campaign_id=campaign_id, - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetRulesets200Response", - } - 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_rulesets_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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: - """List campaign rulesets - - List all rulesets of this campaign. A ruleset is a revision of the rules of a campaign. **Important:** The response also includes deleted rules. You should only consider the latest revision of the returned rulesets. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_rulesets_serialize( - application_id=application_id, - campaign_id=campaign_id, - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetRulesets200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_rulesets_serialize( - self, - application_id, - campaign_id, - page_size, - skip, - sort, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets', - 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_store( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - store_id: Annotated[StrictStr, Field(description="The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Store: - """Get store - - Get store details for a specific store ID. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param store_id: The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) - :type store_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_store_serialize( - application_id=application_id, - store_id=store_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Store", - '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_store_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - store_id: Annotated[StrictStr, Field(description="The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Store]: - """Get store - - Get store details for a specific store ID. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param store_id: The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) - :type store_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_store_serialize( - application_id=application_id, - store_id=store_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Store", - '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_store_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - store_id: Annotated[StrictStr, Field(description="The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. ")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get store - - Get store details for a specific store ID. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param store_id: The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) - :type store_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_store_serialize( - application_id=application_id, - store_id=store_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Store", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_store_serialize( - self, - application_id, - store_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if store_id is not None: - _path_params['storeId'] = store_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/stores/{storeId}', - 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_user( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - _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, - ) -> User: - """Get user - - Retrieve the data (including an invitation code) for a user. Non-admin users can only get their own profile. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - } - 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_user_with_http_info( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - _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[User]: - """Get user - - Retrieve the data (including an invitation code) for a user. Non-admin users can only get their own profile. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - } - 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_user_without_preload_content( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - _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 user - - Retrieve the data (including an invitation code) for a user. Non-admin users can only get their own profile. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_user_serialize( - self, - user_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 user_id is not None: - _path_params['userId'] = user_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/users/{userId}', - 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_users( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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, - ) -> GetUsers200Response: - """List users in account - - Retrieve all users in your account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_users_serialize( - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetUsers200Response", - } - 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_users_with_http_info( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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[GetUsers200Response]: - """List users in account - - Retrieve all users in your account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_users_serialize( - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetUsers200Response", - } - 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_users_without_preload_content( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - 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: - """List users in account - - Retrieve all users in your account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :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_users_serialize( - page_size=page_size, - skip=skip, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetUsers200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_users_serialize( - self, - page_size, - skip, - sort, - _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 page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/users', - 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_webhook( - self, - webhook_id: Annotated[StrictInt, Field(description="The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. ")], - _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, - ) -> Webhook: - """Get webhook - - Returns a webhook by its id. - - :param webhook_id: The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. (required) - :type webhook_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_webhook_serialize( - webhook_id=webhook_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Webhook", - } - 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_webhook_with_http_info( - self, - webhook_id: Annotated[StrictInt, Field(description="The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. ")], - _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[Webhook]: - """Get webhook - - Returns a webhook by its id. - - :param webhook_id: The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. (required) - :type webhook_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_webhook_serialize( - webhook_id=webhook_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Webhook", - } - 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_webhook_without_preload_content( - self, - webhook_id: Annotated[StrictInt, Field(description="The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. ")], - _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 webhook - - Returns a webhook by its id. - - :param webhook_id: The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. (required) - :type webhook_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_webhook_serialize( - webhook_id=webhook_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Webhook", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_webhook_serialize( - self, - webhook_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 webhook_id is not None: - _path_params['webhookId'] = webhook_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/webhooks/{webhookId}', - 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_webhooks( - self, - application_ids: Annotated[Optional[StrictStr], Field(description="Checks if the given catalog or its attributes are referenced in the specified Application ID. **Note**: If no Application ID is provided, we check for all connected Applications. ")] = None, - 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, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - creation_type: Annotated[Optional[StrictStr], Field(description="Filter results by creation type.")] = None, - visibility: Annotated[Optional[StrictStr], Field(description="Filter results by visibility.")] = None, - outgoing_integrations_type_id: Annotated[Optional[StrictInt], Field(description="Filter results by outgoing integration type ID.")] = None, - title: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the webhook title.")] = 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, - ) -> GetWebhooks200Response: - """List webhooks - - List all webhooks. - - :param application_ids: Checks if the given catalog or its attributes are referenced in the specified Application ID. **Note**: If no Application ID is provided, we check for all connected Applications. - :type application_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 - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param creation_type: Filter results by creation type. - :type creation_type: str - :param visibility: Filter results by visibility. - :type visibility: str - :param outgoing_integrations_type_id: Filter results by outgoing integration type ID. - :type outgoing_integrations_type_id: int - :param title: Filter results performing case-insensitive matching against the webhook title. - :type title: 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_webhooks_serialize( - application_ids=application_ids, - sort=sort, - page_size=page_size, - skip=skip, - creation_type=creation_type, - visibility=visibility, - outgoing_integrations_type_id=outgoing_integrations_type_id, - title=title, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetWebhooks200Response", - } - 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_webhooks_with_http_info( - self, - application_ids: Annotated[Optional[StrictStr], Field(description="Checks if the given catalog or its attributes are referenced in the specified Application ID. **Note**: If no Application ID is provided, we check for all connected Applications. ")] = None, - 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, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - creation_type: Annotated[Optional[StrictStr], Field(description="Filter results by creation type.")] = None, - visibility: Annotated[Optional[StrictStr], Field(description="Filter results by visibility.")] = None, - outgoing_integrations_type_id: Annotated[Optional[StrictInt], Field(description="Filter results by outgoing integration type ID.")] = None, - title: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the webhook title.")] = 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[GetWebhooks200Response]: - """List webhooks - - List all webhooks. - - :param application_ids: Checks if the given catalog or its attributes are referenced in the specified Application ID. **Note**: If no Application ID is provided, we check for all connected Applications. - :type application_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 - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param creation_type: Filter results by creation type. - :type creation_type: str - :param visibility: Filter results by visibility. - :type visibility: str - :param outgoing_integrations_type_id: Filter results by outgoing integration type ID. - :type outgoing_integrations_type_id: int - :param title: Filter results performing case-insensitive matching against the webhook title. - :type title: 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_webhooks_serialize( - application_ids=application_ids, - sort=sort, - page_size=page_size, - skip=skip, - creation_type=creation_type, - visibility=visibility, - outgoing_integrations_type_id=outgoing_integrations_type_id, - title=title, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetWebhooks200Response", - } - 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_webhooks_without_preload_content( - self, - application_ids: Annotated[Optional[StrictStr], Field(description="Checks if the given catalog or its attributes are referenced in the specified Application ID. **Note**: If no Application ID is provided, we check for all connected Applications. ")] = None, - 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, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - creation_type: Annotated[Optional[StrictStr], Field(description="Filter results by creation type.")] = None, - visibility: Annotated[Optional[StrictStr], Field(description="Filter results by visibility.")] = None, - outgoing_integrations_type_id: Annotated[Optional[StrictInt], Field(description="Filter results by outgoing integration type ID.")] = None, - title: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the webhook title.")] = 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: - """List webhooks - - List all webhooks. - - :param application_ids: Checks if the given catalog or its attributes are referenced in the specified Application ID. **Note**: If no Application ID is provided, we check for all connected Applications. - :type application_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 - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param creation_type: Filter results by creation type. - :type creation_type: str - :param visibility: Filter results by visibility. - :type visibility: str - :param outgoing_integrations_type_id: Filter results by outgoing integration type ID. - :type outgoing_integrations_type_id: int - :param title: Filter results performing case-insensitive matching against the webhook title. - :type title: 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_webhooks_serialize( - application_ids=application_ids, - sort=sort, - page_size=page_size, - skip=skip, - creation_type=creation_type, - visibility=visibility, - outgoing_integrations_type_id=outgoing_integrations_type_id, - title=title, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetWebhooks200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_webhooks_serialize( - self, - application_ids, - sort, - page_size, - skip, - creation_type, - visibility, - outgoing_integrations_type_id, - title, - _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 application_ids is not None: - - _query_params.append(('applicationIds', application_ids)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if creation_type is not None: - - _query_params.append(('creationType', creation_type)) - - if visibility is not None: - - _query_params.append(('visibility', visibility)) - - if outgoing_integrations_type_id is not None: - - _query_params.append(('outgoingIntegrationsTypeId', outgoing_integrations_type_id)) - - if title is not None: - - _query_params.append(('title', title)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/webhooks', - 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_account_collection( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 data into existing account-level collection - - Upload a CSV file containing the collection of string values that should be attached as payload for collection. The file should be sent as multipart data. The import **replaces** the initial content of the collection. The CSV file **must** only contain the following column: - `item`: the values in your collection. A collection is limited to 500,000 items. Example: ``` item Addidas Nike Asics ``` **Note:** Before sending a request to this endpoint, ensure the data in the CSV to import is different from the data currently stored in the collection. - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_account_collection_serialize( - collection_id=collection_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", - } - 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_account_collection_with_http_info( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 data into existing account-level collection - - Upload a CSV file containing the collection of string values that should be attached as payload for collection. The file should be sent as multipart data. The import **replaces** the initial content of the collection. The CSV file **must** only contain the following column: - `item`: the values in your collection. A collection is limited to 500,000 items. Example: ``` item Addidas Nike Asics ``` **Note:** Before sending a request to this endpoint, ensure the data in the CSV to import is different from the data currently stored in the collection. - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_account_collection_serialize( - collection_id=collection_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", - } - 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_account_collection_without_preload_content( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 data into existing account-level collection - - Upload a CSV file containing the collection of string values that should be attached as payload for collection. The file should be sent as multipart data. The import **replaces** the initial content of the collection. The CSV file **must** only contain the following column: - `item`: the values in your collection. A collection is limited to 500,000 items. Example: ``` item Addidas Nike Asics ``` **Note:** Before sending a request to this endpoint, ensure the data in the CSV to import is different from the data currently stored in the collection. - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_account_collection_serialize( - collection_id=collection_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", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _import_account_collection_serialize( - self, - collection_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 collection_id is not None: - _path_params['collectionId'] = collection_id - # process the query parameters - # process the header parameters - # process the form parameters - if up_file is not None: - _form_params.append(('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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/collections/{collectionId}/import', - 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_allowed_list( - self, - attribute_id: Annotated[StrictInt, Field(description="The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 allowed values for attribute - - Upload a CSV file containing a list of [picklist values](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#picklist-values) for the specified attribute. The file should be sent as multipart data. The import **replaces** the previous list of allowed values for this attribute, if any. The CSV file **must** only contain the following column: - `item` (required): the values in your allowed list, for example a list of SKU's. An allowed list is limited to 500,000 items. Example: ```text item CS-VG-04032021-UP-50D-10 CS-DV-04042021-UP-49D-12 CS-DG-02082021-UP-50G-07 ``` - - :param attribute_id: The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - :type attribute_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_allowed_list_serialize( - attribute_id=attribute_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': "ErrorResponse", - '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_allowed_list_with_http_info( - self, - attribute_id: Annotated[StrictInt, Field(description="The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 allowed values for attribute - - Upload a CSV file containing a list of [picklist values](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#picklist-values) for the specified attribute. The file should be sent as multipart data. The import **replaces** the previous list of allowed values for this attribute, if any. The CSV file **must** only contain the following column: - `item` (required): the values in your allowed list, for example a list of SKU's. An allowed list is limited to 500,000 items. Example: ```text item CS-VG-04032021-UP-50D-10 CS-DV-04042021-UP-49D-12 CS-DG-02082021-UP-50G-07 ``` - - :param attribute_id: The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - :type attribute_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_allowed_list_serialize( - attribute_id=attribute_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': "ErrorResponse", - '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_allowed_list_without_preload_content( - self, - attribute_id: Annotated[StrictInt, Field(description="The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 allowed values for attribute - - Upload a CSV file containing a list of [picklist values](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#picklist-values) for the specified attribute. The file should be sent as multipart data. The import **replaces** the previous list of allowed values for this attribute, if any. The CSV file **must** only contain the following column: - `item` (required): the values in your allowed list, for example a list of SKU's. An allowed list is limited to 500,000 items. Example: ```text item CS-VG-04032021-UP-50D-10 CS-DV-04042021-UP-49D-12 CS-DG-02082021-UP-50G-07 ``` - - :param attribute_id: The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - :type attribute_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_allowed_list_serialize( - attribute_id=attribute_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': "ErrorResponse", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _import_allowed_list_serialize( - self, - attribute_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 attribute_id is not None: - _path_params['attributeId'] = attribute_id - # process the query parameters - # process the header parameters - # process the form parameters - if up_file is not None: - _form_params.append(('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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/attributes/{attributeId}/allowed_list/import', - 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_audiences_memberships( - self, - audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 audience members - - Upload a CSV file containing the integration IDs of the members you want to add to an audience. The file should be sent as multipart data and should contain only the following column (required): - `profileintegrationid`: The integration ID of the customer profile. The import **replaces** the previous list of audience members. **Note:** We recommend limiting your file size to 500MB. Example: ```text profileintegrationid charles alexa ``` - - :param audience_id: The ID of the audience. (required) - :type audience_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_audiences_memberships_serialize( - audience_id=audience_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': "ErrorResponse", - '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_audiences_memberships_with_http_info( - self, - audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 audience members - - Upload a CSV file containing the integration IDs of the members you want to add to an audience. The file should be sent as multipart data and should contain only the following column (required): - `profileintegrationid`: The integration ID of the customer profile. The import **replaces** the previous list of audience members. **Note:** We recommend limiting your file size to 500MB. Example: ```text profileintegrationid charles alexa ``` - - :param audience_id: The ID of the audience. (required) - :type audience_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_audiences_memberships_serialize( - audience_id=audience_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': "ErrorResponse", - '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_audiences_memberships_without_preload_content( - self, - audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 audience members - - Upload a CSV file containing the integration IDs of the members you want to add to an audience. The file should be sent as multipart data and should contain only the following column (required): - `profileintegrationid`: The integration ID of the customer profile. The import **replaces** the previous list of audience members. **Note:** We recommend limiting your file size to 500MB. Example: ```text profileintegrationid charles alexa ``` - - :param audience_id: The ID of the audience. (required) - :type audience_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_audiences_memberships_serialize( - audience_id=audience_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': "ErrorResponse", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _import_audiences_memberships_serialize( - self, - audience_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 audience_id is not None: - _path_params['audienceId'] = audience_id - # process the query parameters - # process the header parameters - # process the form parameters - if up_file is not None: - _form_params.append(('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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/audiences/{audienceId}/memberships/import', - 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_campaign_store_budget( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - action: Annotated[Optional[StrictStr], Field(description="The action that this budget is limiting.")] = None, - period: Annotated[Optional[StrictStr], Field(description="The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. ")] = None, - up_file: Annotated[Optional[StrictStr], Field(description="The 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 campaign store budgets - - Upload a CSV file containing store budgets for a given campaign. Send the file as multipart data. The CSV file **must** only contain the following columns: - `store_integration_id`: The identifier of the store. - `limit`: The budget limit for the store. The import **replaces** the previous list of store budgets. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param action: The action that this budget is limiting. - :type action: str - :param period: The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. - :type period: str - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_campaign_store_budget_serialize( - application_id=application_id, - campaign_id=campaign_id, - action=action, - period=period, - 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]] = { - '201': "ModelImport", - '400': "ErrorResponse", - } - 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_campaign_store_budget_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - action: Annotated[Optional[StrictStr], Field(description="The action that this budget is limiting.")] = None, - period: Annotated[Optional[StrictStr], Field(description="The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. ")] = None, - up_file: Annotated[Optional[StrictStr], Field(description="The 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 campaign store budgets - - Upload a CSV file containing store budgets for a given campaign. Send the file as multipart data. The CSV file **must** only contain the following columns: - `store_integration_id`: The identifier of the store. - `limit`: The budget limit for the store. The import **replaces** the previous list of store budgets. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param action: The action that this budget is limiting. - :type action: str - :param period: The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. - :type period: str - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_campaign_store_budget_serialize( - application_id=application_id, - campaign_id=campaign_id, - action=action, - period=period, - 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]] = { - '201': "ModelImport", - '400': "ErrorResponse", - } - 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_campaign_store_budget_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - action: Annotated[Optional[StrictStr], Field(description="The action that this budget is limiting.")] = None, - period: Annotated[Optional[StrictStr], Field(description="The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. ")] = None, - up_file: Annotated[Optional[StrictStr], Field(description="The 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 campaign store budgets - - Upload a CSV file containing store budgets for a given campaign. Send the file as multipart data. The CSV file **must** only contain the following columns: - `store_integration_id`: The identifier of the store. - `limit`: The budget limit for the store. The import **replaces** the previous list of store budgets. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param action: The action that this budget is limiting. - :type action: str - :param period: The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. - :type period: str - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_campaign_store_budget_serialize( - application_id=application_id, - campaign_id=campaign_id, - action=action, - period=period, - 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]] = { - '201': "ModelImport", - '400': "ErrorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _import_campaign_store_budget_serialize( - self, - application_id, - campaign_id, - action, - period, - 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 application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - if action is not None: - - _query_params.append(('action', action)) - - if period is not None: - - _query_params.append(('period', period)) - - # process the header parameters - # process the form parameters - if up_file is not None: - _form_params.append(('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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/stores/budgets/import', - 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_campaign_stores( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 stores - - Upload a CSV file containing the stores you want to link to a specific campaign. Send the file as multipart data. The CSV file **must** only contain the following column: - `store_integration_id`: The identifier of the store. The import **replaces** the previous list of stores linked to the campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_campaign_stores_serialize( - application_id=application_id, - campaign_id=campaign_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': "ErrorResponse", - '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_campaign_stores_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 stores - - Upload a CSV file containing the stores you want to link to a specific campaign. Send the file as multipart data. The CSV file **must** only contain the following column: - `store_integration_id`: The identifier of the store. The import **replaces** the previous list of stores linked to the campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_campaign_stores_serialize( - application_id=application_id, - campaign_id=campaign_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': "ErrorResponse", - '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_campaign_stores_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 stores - - Upload a CSV file containing the stores you want to link to a specific campaign. Send the file as multipart data. The CSV file **must** only contain the following column: - `store_integration_id`: The identifier of the store. The import **replaces** the previous list of stores linked to the campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_campaign_stores_serialize( - application_id=application_id, - campaign_id=campaign_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': "ErrorResponse", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _import_campaign_stores_serialize( - self, - application_id, - campaign_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 application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - # process the header parameters - # process the form parameters - if up_file is not None: - _form_params.append(('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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/stores/import', - 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_collection( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 data into existing campaign-level collection - - Upload a CSV file containing the collection of string values that should be attached as payload for collection. The file should be sent as multipart data. The import **replaces** the initial content of the collection. The CSV file **must** only contain the following column: - `item`: the values in your collection. A collection is limited to 500,000 items. Example: ``` item Addidas Nike Asics ``` **Note:** Before sending a request to this endpoint, ensure the data in the CSV to import is different from the data currently stored in the collection. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param collection_id: The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - :type collection_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_collection_serialize( - application_id=application_id, - campaign_id=campaign_id, - collection_id=collection_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", - '401': "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_collection_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 data into existing campaign-level collection - - Upload a CSV file containing the collection of string values that should be attached as payload for collection. The file should be sent as multipart data. The import **replaces** the initial content of the collection. The CSV file **must** only contain the following column: - `item`: the values in your collection. A collection is limited to 500,000 items. Example: ``` item Addidas Nike Asics ``` **Note:** Before sending a request to this endpoint, ensure the data in the CSV to import is different from the data currently stored in the collection. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param collection_id: The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - :type collection_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_collection_serialize( - application_id=application_id, - campaign_id=campaign_id, - collection_id=collection_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", - '401': "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_collection_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 data into existing campaign-level collection - - Upload a CSV file containing the collection of string values that should be attached as payload for collection. The file should be sent as multipart data. The import **replaces** the initial content of the collection. The CSV file **must** only contain the following column: - `item`: the values in your collection. A collection is limited to 500,000 items. Example: ``` item Addidas Nike Asics ``` **Note:** Before sending a request to this endpoint, ensure the data in the CSV to import is different from the data currently stored in the collection. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param collection_id: The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - :type collection_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_collection_serialize( - application_id=application_id, - campaign_id=campaign_id, - collection_id=collection_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", - '401': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _import_collection_serialize( - self, - application_id, - campaign_id, - collection_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 application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - if collection_id is not None: - _path_params['collectionId'] = collection_id - # process the query parameters - # process the header parameters - # process the form parameters - if up_file is not None: - _form_params.append(('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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/import', - 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_coupons( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - skip_duplicates: Annotated[Optional[StrictBool], Field(description="An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. ")] = None, - up_file: Annotated[Optional[StrictStr], Field(description="The 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 coupons - - Upload a CSV file containing the coupons that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - `value` (required): The coupon code. - `expirydate`: The end date in RFC3339 of the code redemption period. - `startdate`: The start date in RFC3339 of the code redemption period. - `recipientintegrationid`: The integration ID of the recipient of the coupon. Only the customer with this integration ID can redeem this code. Available only for personal codes. - `limitval`: The maximum number of redemptions of this code. For unlimited redemptions, use `0`. Defaults to `1` when not provided. - `discountlimit`: The total discount value that the code can give. This is typically used to represent a gift card value. - `attributes`: A JSON object describing _custom_ coupon attribute names and their values, enclosed with double quotation marks. For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `category` associated with the coupon entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"category\": \"10_off\"}\"`. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** We recommend limiting your file size to 500MB. **Example:** ```text \"value\",\"expirydate\",\"startdate\",\"recipientintegrationid\",\"limitval\",\"attributes\",\"discountlimit\" COUP1,2018-07-01T04:00:00Z,2018-05-01T04:00:00Z,cust123,1,\"{\"\"Category\"\": \"\"10_off\"\"}\",2.4 ``` Once imported, you can find the `batchId` in the Campaign Manager or by using [List coupons](#tag/Coupons/operation/getCouponsWithoutTotalCount). - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param skip_duplicates: An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. - :type skip_duplicates: bool - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_coupons_serialize( - application_id=application_id, - campaign_id=campaign_id, - skip_duplicates=skip_duplicates, - 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", - } - 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_coupons_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - skip_duplicates: Annotated[Optional[StrictBool], Field(description="An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. ")] = None, - up_file: Annotated[Optional[StrictStr], Field(description="The 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 coupons - - Upload a CSV file containing the coupons that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - `value` (required): The coupon code. - `expirydate`: The end date in RFC3339 of the code redemption period. - `startdate`: The start date in RFC3339 of the code redemption period. - `recipientintegrationid`: The integration ID of the recipient of the coupon. Only the customer with this integration ID can redeem this code. Available only for personal codes. - `limitval`: The maximum number of redemptions of this code. For unlimited redemptions, use `0`. Defaults to `1` when not provided. - `discountlimit`: The total discount value that the code can give. This is typically used to represent a gift card value. - `attributes`: A JSON object describing _custom_ coupon attribute names and their values, enclosed with double quotation marks. For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `category` associated with the coupon entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"category\": \"10_off\"}\"`. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** We recommend limiting your file size to 500MB. **Example:** ```text \"value\",\"expirydate\",\"startdate\",\"recipientintegrationid\",\"limitval\",\"attributes\",\"discountlimit\" COUP1,2018-07-01T04:00:00Z,2018-05-01T04:00:00Z,cust123,1,\"{\"\"Category\"\": \"\"10_off\"\"}\",2.4 ``` Once imported, you can find the `batchId` in the Campaign Manager or by using [List coupons](#tag/Coupons/operation/getCouponsWithoutTotalCount). - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param skip_duplicates: An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. - :type skip_duplicates: bool - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_coupons_serialize( - application_id=application_id, - campaign_id=campaign_id, - skip_duplicates=skip_duplicates, - 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", - } - 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_coupons_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - skip_duplicates: Annotated[Optional[StrictBool], Field(description="An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. ")] = None, - up_file: Annotated[Optional[StrictStr], Field(description="The 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 coupons - - Upload a CSV file containing the coupons that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - `value` (required): The coupon code. - `expirydate`: The end date in RFC3339 of the code redemption period. - `startdate`: The start date in RFC3339 of the code redemption period. - `recipientintegrationid`: The integration ID of the recipient of the coupon. Only the customer with this integration ID can redeem this code. Available only for personal codes. - `limitval`: The maximum number of redemptions of this code. For unlimited redemptions, use `0`. Defaults to `1` when not provided. - `discountlimit`: The total discount value that the code can give. This is typically used to represent a gift card value. - `attributes`: A JSON object describing _custom_ coupon attribute names and their values, enclosed with double quotation marks. For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `category` associated with the coupon entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"category\": \"10_off\"}\"`. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** We recommend limiting your file size to 500MB. **Example:** ```text \"value\",\"expirydate\",\"startdate\",\"recipientintegrationid\",\"limitval\",\"attributes\",\"discountlimit\" COUP1,2018-07-01T04:00:00Z,2018-05-01T04:00:00Z,cust123,1,\"{\"\"Category\"\": \"\"10_off\"\"}\",2.4 ``` Once imported, you can find the `batchId` in the Campaign Manager or by using [List coupons](#tag/Coupons/operation/getCouponsWithoutTotalCount). - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param skip_duplicates: An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. - :type skip_duplicates: bool - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_coupons_serialize( - application_id=application_id, - campaign_id=campaign_id, - skip_duplicates=skip_duplicates, - 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", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _import_coupons_serialize( - self, - application_id, - campaign_id, - skip_duplicates, - 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 application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - if skip_duplicates is not None: - - _query_params.append(('skipDuplicates', skip_duplicates)) - - # process the header parameters - # process the form parameters - if up_file is not None: - _form_params.append(('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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/import_coupons', - 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_cards( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="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. ")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 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 alphanumeric identifier of the loyalty card. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). **Note:** We recommend limiting your file size to 500MB. **Example:** ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` - - :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 - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_loyalty_cards_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", - '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_cards_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="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. ")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 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 alphanumeric identifier of the loyalty card. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). **Note:** We recommend limiting your file size to 500MB. **Example:** ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` - - :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 - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_loyalty_cards_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", - '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_cards_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="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. ")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 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 alphanumeric identifier of the loyalty card. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). **Note:** We recommend limiting your file size to 500MB. **Example:** ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` - - :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 - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_loyalty_cards_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", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _import_loyalty_cards_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: - _form_params.append(('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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/import_cards', - 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_customers_tiers( - self, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 customers into loyalty tiers - - Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. **Important:** This endpoint only works with loyalty programs with advanced tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiration date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiration date is updated. **Note:** We recommend not using this endpoint to update the tier of a customer. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** We recommend limiting your file size to 500MB. **Example:** ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_loyalty_customers_tiers_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_customers_tiers_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 customers into loyalty tiers - - Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. **Important:** This endpoint only works with loyalty programs with advanced tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiration date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiration date is updated. **Note:** We recommend not using this endpoint to update the tier of a customer. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** We recommend limiting your file size to 500MB. **Example:** ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_loyalty_customers_tiers_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_customers_tiers_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 customers into loyalty tiers - - Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. **Important:** This endpoint only works with loyalty programs with advanced tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiration date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiration date is updated. **Note:** We recommend not using this endpoint to update the tier of a customer. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** We recommend limiting your file size to 500MB. **Example:** ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_loyalty_customers_tiers_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_customers_tiers_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: - _form_params.append(('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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/import_customers_tiers', - 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, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - notifications_enabled: Annotated[Optional[StrictBool], Field(description="Indicates whether the points import triggers notifications about its effects. For example, a notification is sent if the import upgrades a customer's tier or offsets their negative points balance. This parameter is optional and defaults to `true`. ")] = None, - up_file: Annotated[Optional[StrictStr], Field(description="The 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 loyalty points - - Upload a CSV file containing the loyalty points you want to import into a given loyalty program. Send the file as multipart data. Depending on the type of loyalty program, you can import points into a given customer profile or loyalty card. The CSV file contains the following columns: - `customerprofileid` (optional): For profile-based loyalty programs, the integration ID of the customer profile where the loyalty points are imported. **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. - `identifier` (optional): For card-based loyalty programs, the identifier of the loyalty card where the loyalty points are imported. - `amount`: The amount of points to award to the customer profile. - `startdate` (optional): The earliest date when the points can be redeemed. The points are `active` from this date until the expiration date. This parameter accepts one of the following values: - A timestamp string in RFC3339 format. - `immediate` - `on_action` **Note**: Empty or missing values default to `immediate`. - `expirydate` (optional): The latest date when the points can be redeemed. The points are `expired` after this date. **Note**: It must be an RFC3339 timestamp string or string `unlimited`. Empty or missing values are considered `unlimited`. If passed, `validityDuration` should be omitted. - `validityDuration` (optional): The duration for which the points remain active, relative to the activation date. 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. If passed, `expirydate` should be omitted. - `subledgerid` (optional): The ID of the subledger that should received the points. - `reason` (optional): The reason why these points are awarded. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** For existing customer profiles and loyalty cards, the imported points are added to any previous active or pending points, depending on the value provided for `startdate`. If `startdate` matches the current date, the imported points are _active_. If it is later, the points are _pending_ until the date provided for `startdate` is reached. **Note:** We recommend limiting your file size to 500MB. **Example for profile-based programs:** ```text customerprofileid,amount,startdate,expirydate,subledgerid,reason URNGV8294NV,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` **Example for card-based programs:** ```text identifier,amount,startdate,expirydate,subledgerid,reason summer-loyalty-card-0543,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param notifications_enabled: Indicates whether the points import triggers notifications about its effects. For example, a notification is sent if the import upgrades a customer's tier or offsets their negative points balance. This parameter is optional and defaults to `true`. - :type notifications_enabled: bool - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_loyalty_points_serialize( - loyalty_program_id=loyalty_program_id, - notifications_enabled=notifications_enabled, - 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", - } - 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_points_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - notifications_enabled: Annotated[Optional[StrictBool], Field(description="Indicates whether the points import triggers notifications about its effects. For example, a notification is sent if the import upgrades a customer's tier or offsets their negative points balance. This parameter is optional and defaults to `true`. ")] = None, - up_file: Annotated[Optional[StrictStr], Field(description="The 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 loyalty points - - Upload a CSV file containing the loyalty points you want to import into a given loyalty program. Send the file as multipart data. Depending on the type of loyalty program, you can import points into a given customer profile or loyalty card. The CSV file contains the following columns: - `customerprofileid` (optional): For profile-based loyalty programs, the integration ID of the customer profile where the loyalty points are imported. **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. - `identifier` (optional): For card-based loyalty programs, the identifier of the loyalty card where the loyalty points are imported. - `amount`: The amount of points to award to the customer profile. - `startdate` (optional): The earliest date when the points can be redeemed. The points are `active` from this date until the expiration date. This parameter accepts one of the following values: - A timestamp string in RFC3339 format. - `immediate` - `on_action` **Note**: Empty or missing values default to `immediate`. - `expirydate` (optional): The latest date when the points can be redeemed. The points are `expired` after this date. **Note**: It must be an RFC3339 timestamp string or string `unlimited`. Empty or missing values are considered `unlimited`. If passed, `validityDuration` should be omitted. - `validityDuration` (optional): The duration for which the points remain active, relative to the activation date. 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. If passed, `expirydate` should be omitted. - `subledgerid` (optional): The ID of the subledger that should received the points. - `reason` (optional): The reason why these points are awarded. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** For existing customer profiles and loyalty cards, the imported points are added to any previous active or pending points, depending on the value provided for `startdate`. If `startdate` matches the current date, the imported points are _active_. If it is later, the points are _pending_ until the date provided for `startdate` is reached. **Note:** We recommend limiting your file size to 500MB. **Example for profile-based programs:** ```text customerprofileid,amount,startdate,expirydate,subledgerid,reason URNGV8294NV,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` **Example for card-based programs:** ```text identifier,amount,startdate,expirydate,subledgerid,reason summer-loyalty-card-0543,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param notifications_enabled: Indicates whether the points import triggers notifications about its effects. For example, a notification is sent if the import upgrades a customer's tier or offsets their negative points balance. This parameter is optional and defaults to `true`. - :type notifications_enabled: bool - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_loyalty_points_serialize( - loyalty_program_id=loyalty_program_id, - notifications_enabled=notifications_enabled, - 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", - } - 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_points_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(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. ")], - notifications_enabled: Annotated[Optional[StrictBool], Field(description="Indicates whether the points import triggers notifications about its effects. For example, a notification is sent if the import upgrades a customer's tier or offsets their negative points balance. This parameter is optional and defaults to `true`. ")] = None, - up_file: Annotated[Optional[StrictStr], Field(description="The 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 loyalty points - - Upload a CSV file containing the loyalty points you want to import into a given loyalty program. Send the file as multipart data. Depending on the type of loyalty program, you can import points into a given customer profile or loyalty card. The CSV file contains the following columns: - `customerprofileid` (optional): For profile-based loyalty programs, the integration ID of the customer profile where the loyalty points are imported. **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. - `identifier` (optional): For card-based loyalty programs, the identifier of the loyalty card where the loyalty points are imported. - `amount`: The amount of points to award to the customer profile. - `startdate` (optional): The earliest date when the points can be redeemed. The points are `active` from this date until the expiration date. This parameter accepts one of the following values: - A timestamp string in RFC3339 format. - `immediate` - `on_action` **Note**: Empty or missing values default to `immediate`. - `expirydate` (optional): The latest date when the points can be redeemed. The points are `expired` after this date. **Note**: It must be an RFC3339 timestamp string or string `unlimited`. Empty or missing values are considered `unlimited`. If passed, `validityDuration` should be omitted. - `validityDuration` (optional): The duration for which the points remain active, relative to the activation date. 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. If passed, `expirydate` should be omitted. - `subledgerid` (optional): The ID of the subledger that should received the points. - `reason` (optional): The reason why these points are awarded. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** For existing customer profiles and loyalty cards, the imported points are added to any previous active or pending points, depending on the value provided for `startdate`. If `startdate` matches the current date, the imported points are _active_. If it is later, the points are _pending_ until the date provided for `startdate` is reached. **Note:** We recommend limiting your file size to 500MB. **Example for profile-based programs:** ```text customerprofileid,amount,startdate,expirydate,subledgerid,reason URNGV8294NV,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` **Example for card-based programs:** ```text identifier,amount,startdate,expirydate,subledgerid,reason summer-loyalty-card-0543,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` - - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param notifications_enabled: Indicates whether the points import triggers notifications about its effects. For example, a notification is sent if the import upgrades a customer's tier or offsets their negative points balance. This parameter is optional and defaults to `true`. - :type notifications_enabled: bool - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_loyalty_points_serialize( - loyalty_program_id=loyalty_program_id, - notifications_enabled=notifications_enabled, - 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", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _import_loyalty_points_serialize( - self, - loyalty_program_id, - notifications_enabled, - 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 - if notifications_enabled is not None: - - _query_params.append(('notificationsEnabled', notifications_enabled)) - - # process the header parameters - # process the form parameters - if up_file is not None: - _form_params.append(('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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/import_points', - 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_pool_giveaways( - self, - pool_id: Annotated[StrictInt, Field(description="The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 giveaway codes into a giveaway pool - - Upload a CSV file containing the giveaway codes that should be created. Send the file as multipart data. The CSV file contains the following columns: - `code` (required): The code of your giveaway, for instance, a gift card redemption code. - `startdate`: The start date in RFC3339 of the code redemption period. - `enddate`: The last date in RFC3339 of the code redemption period. - `attributes`: A JSON object describing _custom_ giveaway attribute names and their values, enclosed with double quotation marks. For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `provider` associated with the giveaway entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"provider\": \"myPartnerCompany\"}\"`. The `startdate` and `enddate` have nothing to do with the _validity_ of the codes. They are only used by the Rule Engine to award the codes or not. You can use the time zone setting of your choice. The values are converted to UTC internally by Talon.One. **Note:** - We recommend limiting your file size to 500MB. - You can import the same code multiple times. Duplicate codes are treated and distributed to customers as unique codes. **Example:** ```text code,startdate,enddate,attributes GIVEAWAY1,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY2,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY3,2021-01-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Aliexpress\"\"}\" ``` - - :param pool_id: The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - :type pool_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_pool_giveaways_serialize( - pool_id=pool_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", - } - 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_pool_giveaways_with_http_info( - self, - pool_id: Annotated[StrictInt, Field(description="The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 giveaway codes into a giveaway pool - - Upload a CSV file containing the giveaway codes that should be created. Send the file as multipart data. The CSV file contains the following columns: - `code` (required): The code of your giveaway, for instance, a gift card redemption code. - `startdate`: The start date in RFC3339 of the code redemption period. - `enddate`: The last date in RFC3339 of the code redemption period. - `attributes`: A JSON object describing _custom_ giveaway attribute names and their values, enclosed with double quotation marks. For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `provider` associated with the giveaway entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"provider\": \"myPartnerCompany\"}\"`. The `startdate` and `enddate` have nothing to do with the _validity_ of the codes. They are only used by the Rule Engine to award the codes or not. You can use the time zone setting of your choice. The values are converted to UTC internally by Talon.One. **Note:** - We recommend limiting your file size to 500MB. - You can import the same code multiple times. Duplicate codes are treated and distributed to customers as unique codes. **Example:** ```text code,startdate,enddate,attributes GIVEAWAY1,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY2,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY3,2021-01-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Aliexpress\"\"}\" ``` - - :param pool_id: The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - :type pool_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_pool_giveaways_serialize( - pool_id=pool_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", - } - 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_pool_giveaways_without_preload_content( - self, - pool_id: Annotated[StrictInt, Field(description="The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 giveaway codes into a giveaway pool - - Upload a CSV file containing the giveaway codes that should be created. Send the file as multipart data. The CSV file contains the following columns: - `code` (required): The code of your giveaway, for instance, a gift card redemption code. - `startdate`: The start date in RFC3339 of the code redemption period. - `enddate`: The last date in RFC3339 of the code redemption period. - `attributes`: A JSON object describing _custom_ giveaway attribute names and their values, enclosed with double quotation marks. For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `provider` associated with the giveaway entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"provider\": \"myPartnerCompany\"}\"`. The `startdate` and `enddate` have nothing to do with the _validity_ of the codes. They are only used by the Rule Engine to award the codes or not. You can use the time zone setting of your choice. The values are converted to UTC internally by Talon.One. **Note:** - We recommend limiting your file size to 500MB. - You can import the same code multiple times. Duplicate codes are treated and distributed to customers as unique codes. **Example:** ```text code,startdate,enddate,attributes GIVEAWAY1,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY2,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY3,2021-01-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Aliexpress\"\"}\" ``` - - :param pool_id: The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - :type pool_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_pool_giveaways_serialize( - pool_id=pool_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", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _import_pool_giveaways_serialize( - self, - pool_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 pool_id is not None: - _path_params['poolId'] = pool_id - # process the query parameters - # process the header parameters - # process the form parameters - if up_file is not None: - _form_params.append(('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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/giveaways/pools/{poolId}/import', - 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_referrals( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 referrals - - Upload a CSV file containing the referrals that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - `code` (required): The referral code. - `advocateprofileintegrationid` (required): The profile ID of the advocate. - `startdate`: The start date in RFC3339 of the code redemption period. - `expirydate`: The end date in RFC3339 of the code redemption period. - `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. - `attributes`: A JSON object describing _custom_ referral attribute names and their values, enclosed with double quotation marks. For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `category` associated with the referral entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"category\": \"10_off\"}\"`. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Important:** When you import a CSV file with referrals, a [customer profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles) is **not** automatically created for each `advocateprofileintegrationid` column value. Use the [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint or the [Update multiple customer profiles](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfilesV2) endpoint to create the customer profiles. **Note:** We recommend limiting your file size to 500MB. **Example:** ```text code,startdate,expirydate,advocateprofileintegrationid,limitval,attributes REFERRAL_CODE1,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid_4,1,\"{\"\"my_attribute\"\": \"\"10_off\"\"}\" REFERRAL_CODE2,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid1,1,\"{\"\"my_attribute\"\": \"\"20_off\"\"}\" ``` - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_referrals_serialize( - application_id=application_id, - campaign_id=campaign_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", - } - 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_referrals_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 referrals - - Upload a CSV file containing the referrals that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - `code` (required): The referral code. - `advocateprofileintegrationid` (required): The profile ID of the advocate. - `startdate`: The start date in RFC3339 of the code redemption period. - `expirydate`: The end date in RFC3339 of the code redemption period. - `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. - `attributes`: A JSON object describing _custom_ referral attribute names and their values, enclosed with double quotation marks. For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `category` associated with the referral entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"category\": \"10_off\"}\"`. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Important:** When you import a CSV file with referrals, a [customer profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles) is **not** automatically created for each `advocateprofileintegrationid` column value. Use the [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint or the [Update multiple customer profiles](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfilesV2) endpoint to create the customer profiles. **Note:** We recommend limiting your file size to 500MB. **Example:** ```text code,startdate,expirydate,advocateprofileintegrationid,limitval,attributes REFERRAL_CODE1,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid_4,1,\"{\"\"my_attribute\"\": \"\"10_off\"\"}\" REFERRAL_CODE2,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid1,1,\"{\"\"my_attribute\"\": \"\"20_off\"\"}\" ``` - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_referrals_serialize( - application_id=application_id, - campaign_id=campaign_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", - } - 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_referrals_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - up_file: Annotated[Optional[StrictStr], Field(description="The 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 referrals - - Upload a CSV file containing the referrals that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - `code` (required): The referral code. - `advocateprofileintegrationid` (required): The profile ID of the advocate. - `startdate`: The start date in RFC3339 of the code redemption period. - `expirydate`: The end date in RFC3339 of the code redemption period. - `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. - `attributes`: A JSON object describing _custom_ referral attribute names and their values, enclosed with double quotation marks. For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `category` associated with the referral entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"category\": \"10_off\"}\"`. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Important:** When you import a CSV file with referrals, a [customer profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles) is **not** automatically created for each `advocateprofileintegrationid` column value. Use the [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint or the [Update multiple customer profiles](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfilesV2) endpoint to create the customer profiles. **Note:** We recommend limiting your file size to 500MB. **Example:** ```text code,startdate,expirydate,advocateprofileintegrationid,limitval,attributes REFERRAL_CODE1,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid_4,1,\"{\"\"my_attribute\"\": \"\"10_off\"\"}\" REFERRAL_CODE2,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid1,1,\"{\"\"my_attribute\"\": \"\"20_off\"\"}\" ``` - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param up_file: The file containing the data that is being imported. - :type up_file: 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._import_referrals_serialize( - application_id=application_id, - campaign_id=campaign_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", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _import_referrals_serialize( - self, - application_id, - campaign_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 application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - # process the header parameters - # process the form parameters - if up_file is not None: - _form_params.append(('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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/import_referrals', - 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 invite_user_external( - self, - new_external_invitation: Annotated[NewExternalInvitation, Field(description="body")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Invite user from identity provider - - [Invite a user](https://docs.talon.one/docs/product/account/account-settings/managing-users#inviting-a-user) from an external identity provider to Talon.One by sending an invitation to their email address. - - :param new_external_invitation: body (required) - :type new_external_invitation: NewExternalInvitation - :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._invite_user_external_serialize( - new_external_invitation=new_external_invitation, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 invite_user_external_with_http_info( - self, - new_external_invitation: Annotated[NewExternalInvitation, Field(description="body")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Invite user from identity provider - - [Invite a user](https://docs.talon.one/docs/product/account/account-settings/managing-users#inviting-a-user) from an external identity provider to Talon.One by sending an invitation to their email address. - - :param new_external_invitation: body (required) - :type new_external_invitation: NewExternalInvitation - :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._invite_user_external_serialize( - new_external_invitation=new_external_invitation, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 invite_user_external_without_preload_content( - self, - new_external_invitation: Annotated[NewExternalInvitation, Field(description="body")], - _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: - """Invite user from identity provider - - [Invite a user](https://docs.talon.one/docs/product/account/account-settings/managing-users#inviting-a-user) from an external identity provider to Talon.One by sending an invitation to their email address. - - :param new_external_invitation: body (required) - :type new_external_invitation: NewExternalInvitation - :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._invite_user_external_serialize( - new_external_invitation=new_external_invitation, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _invite_user_external_serialize( - self, - new_external_invitation, - _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 - # process the header parameters - # process the form parameters - # process the body parameter - if new_external_invitation is not None: - _body_params = new_external_invitation - - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/users/invite', - 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 list_account_collections( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - name: Annotated[Optional[StrictStr], Field(description="Filter by collection name.")] = 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, - ) -> ListAccountCollections200Response: - """List collections in account - - List account-level collections in the account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param name: Filter by collection name. - :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 - (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._list_account_collections_serialize( - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAccountCollections200Response", - '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 list_account_collections_with_http_info( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - name: Annotated[Optional[StrictStr], Field(description="Filter by collection name.")] = 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[ListAccountCollections200Response]: - """List collections in account - - List account-level collections in the account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param name: Filter by collection name. - :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 - (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._list_account_collections_serialize( - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAccountCollections200Response", - '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 list_account_collections_without_preload_content( - self, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - name: Annotated[Optional[StrictStr], Field(description="Filter by collection name.")] = 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: - """List collections in account - - List account-level collections in the account. - - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param name: Filter by collection name. - :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 - (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._list_account_collections_serialize( - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAccountCollections200Response", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_account_collections_serialize( - self, - page_size, - skip, - sort, - with_total_result_size, - name, - _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 page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if with_total_result_size is not None: - - _query_params.append(('withTotalResultSize', with_total_result_size)) - - if name is not None: - - _query_params.append(('name', name)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/collections', - 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 list_achievements( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - 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 for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. ")] = 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, - ) -> ListAchievements200Response: - """List achievements - - List all the achievements for a specific campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param page_size: The number of items in the response. - :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 for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. - :type title: 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._list_achievements_serialize( - application_id=application_id, - campaign_id=campaign_id, - page_size=page_size, - skip=skip, - title=title, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAchievements200Response", - } - 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 list_achievements_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - 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 for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. ")] = 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[ListAchievements200Response]: - """List achievements - - List all the achievements for a specific campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param page_size: The number of items in the response. - :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 for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. - :type title: 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._list_achievements_serialize( - application_id=application_id, - campaign_id=campaign_id, - page_size=page_size, - skip=skip, - title=title, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAchievements200Response", - } - 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 list_achievements_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - 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 for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. ")] = 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: - """List achievements - - List all the achievements for a specific campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param page_size: The number of items in the response. - :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 for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. - :type title: 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._list_achievements_serialize( - application_id=application_id, - campaign_id=campaign_id, - page_size=page_size, - skip=skip, - title=title, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAchievements200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_achievements_serialize( - self, - application_id, - campaign_id, - page_size, - skip, - title, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if title is not None: - - _query_params.append(('title', title)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/achievements', - 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 list_all_roles_v2( - self, - _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, - ) -> ListAllRolesV2200Response: - """List roles - - List all roles. - - :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._list_all_roles_v2_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAllRolesV2200Response", - } - 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 list_all_roles_v2_with_http_info( - self, - _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[ListAllRolesV2200Response]: - """List roles - - List all roles. - - :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._list_all_roles_v2_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAllRolesV2200Response", - } - 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 list_all_roles_v2_without_preload_content( - self, - _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: - """List roles - - List all roles. - - :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._list_all_roles_v2_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAllRolesV2200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_all_roles_v2_serialize( - self, - _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 - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/roles', - 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 list_campaign_store_budget_limits( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - action: Annotated[Optional[StrictStr], Field(description="The action that this budget is limiting.")] = None, - period: Annotated[Optional[StrictStr], Field(description="The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. ")] = 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, - ) -> ListCampaignStoreBudgetLimits200Response: - """List campaign store budget limits - - Return the store budget limits for a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param action: The action that this budget is limiting. - :type action: str - :param period: The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. - :type period: 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._list_campaign_store_budget_limits_serialize( - application_id=application_id, - campaign_id=campaign_id, - action=action, - period=period, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListCampaignStoreBudgetLimits200Response", - '400': "ErrorResponse", - '401': "ErrorResponse", - '404': "ErrorResponse", - } - 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 list_campaign_store_budget_limits_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - action: Annotated[Optional[StrictStr], Field(description="The action that this budget is limiting.")] = None, - period: Annotated[Optional[StrictStr], Field(description="The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. ")] = 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[ListCampaignStoreBudgetLimits200Response]: - """List campaign store budget limits - - Return the store budget limits for a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param action: The action that this budget is limiting. - :type action: str - :param period: The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. - :type period: 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._list_campaign_store_budget_limits_serialize( - application_id=application_id, - campaign_id=campaign_id, - action=action, - period=period, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListCampaignStoreBudgetLimits200Response", - '400': "ErrorResponse", - '401': "ErrorResponse", - '404': "ErrorResponse", - } - 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 list_campaign_store_budget_limits_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - action: Annotated[Optional[StrictStr], Field(description="The action that this budget is limiting.")] = None, - period: Annotated[Optional[StrictStr], Field(description="The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. ")] = 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: - """List campaign store budget limits - - Return the store budget limits for a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param action: The action that this budget is limiting. - :type action: str - :param period: The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. - :type period: 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._list_campaign_store_budget_limits_serialize( - application_id=application_id, - campaign_id=campaign_id, - action=action, - period=period, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListCampaignStoreBudgetLimits200Response", - '400': "ErrorResponse", - '401': "ErrorResponse", - '404': "ErrorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_campaign_store_budget_limits_serialize( - self, - application_id, - campaign_id, - action, - period, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - if action is not None: - - _query_params.append(('action', action)) - - if period is not None: - - _query_params.append(('period', period)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/stores/budgets', - 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 list_catalog_items( - self, - catalog_id: Annotated[StrictInt, Field(description="The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - sku: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more SKUs. Must be exact match.")] = None, - product_names: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more product names. Must be exact match.")] = 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, - ) -> ListCatalogItems200Response: - """List items in a catalog - - Return a paginated list of cart items in the given catalog. - - :param catalog_id: The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) - :type catalog_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param sku: Filter results by one or more SKUs. Must be exact match. - :type sku: List[str] - :param product_names: Filter results by one or more product names. Must be exact match. - :type product_names: List[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._list_catalog_items_serialize( - catalog_id=catalog_id, - page_size=page_size, - skip=skip, - with_total_result_size=with_total_result_size, - sku=sku, - product_names=product_names, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListCatalogItems200Response", - } - 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 list_catalog_items_with_http_info( - self, - catalog_id: Annotated[StrictInt, Field(description="The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - sku: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more SKUs. Must be exact match.")] = None, - product_names: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more product names. Must be exact match.")] = 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[ListCatalogItems200Response]: - """List items in a catalog - - Return a paginated list of cart items in the given catalog. - - :param catalog_id: The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) - :type catalog_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param sku: Filter results by one or more SKUs. Must be exact match. - :type sku: List[str] - :param product_names: Filter results by one or more product names. Must be exact match. - :type product_names: List[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._list_catalog_items_serialize( - catalog_id=catalog_id, - page_size=page_size, - skip=skip, - with_total_result_size=with_total_result_size, - sku=sku, - product_names=product_names, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListCatalogItems200Response", - } - 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 list_catalog_items_without_preload_content( - self, - catalog_id: Annotated[StrictInt, Field(description="The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - sku: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more SKUs. Must be exact match.")] = None, - product_names: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more product names. Must be exact match.")] = 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: - """List items in a catalog - - Return a paginated list of cart items in the given catalog. - - :param catalog_id: The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) - :type catalog_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param sku: Filter results by one or more SKUs. Must be exact match. - :type sku: List[str] - :param product_names: Filter results by one or more product names. Must be exact match. - :type product_names: List[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._list_catalog_items_serialize( - catalog_id=catalog_id, - page_size=page_size, - skip=skip, - with_total_result_size=with_total_result_size, - sku=sku, - product_names=product_names, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListCatalogItems200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_catalog_items_serialize( - self, - catalog_id, - page_size, - skip, - with_total_result_size, - sku, - product_names, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - 'sku': 'multi', - 'productNames': 'multi', - } - - _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 catalog_id is not None: - _path_params['catalogId'] = catalog_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if with_total_result_size is not None: - - _query_params.append(('withTotalResultSize', with_total_result_size)) - - if sku is not None: - - _query_params.append(('sku', sku)) - - if product_names is not None: - - _query_params.append(('productNames', product_names)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/catalogs/{catalogId}/items', - 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 list_collections( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - name: Annotated[Optional[StrictStr], Field(description="Filter by collection name.")] = 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, - ) -> ListAccountCollections200Response: - """List collections in campaign - - List collections in a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param name: Filter by collection name. - :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 - (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._list_collections_serialize( - application_id=application_id, - campaign_id=campaign_id, - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAccountCollections200Response", - '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 list_collections_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - name: Annotated[Optional[StrictStr], Field(description="Filter by collection name.")] = 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[ListAccountCollections200Response]: - """List collections in campaign - - List collections in a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param name: Filter by collection name. - :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 - (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._list_collections_serialize( - application_id=application_id, - campaign_id=campaign_id, - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAccountCollections200Response", - '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 list_collections_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - name: Annotated[Optional[StrictStr], Field(description="Filter by collection name.")] = 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: - """List collections in campaign - - List collections in a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param name: Filter by collection name. - :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 - (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._list_collections_serialize( - application_id=application_id, - campaign_id=campaign_id, - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAccountCollections200Response", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_collections_serialize( - self, - application_id, - campaign_id, - page_size, - skip, - sort, - with_total_result_size, - name, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if with_total_result_size is not None: - - _query_params.append(('withTotalResultSize', with_total_result_size)) - - if name is not None: - - _query_params.append(('name', name)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/collections', - 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 list_collections_in_application( - self, - 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=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - name: Annotated[Optional[StrictStr], Field(description="Filter by collection name.")] = 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, - ) -> ListAccountCollections200Response: - """List collections in Application - - List campaign-level collections from all campaigns in a given Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param name: Filter by collection name. - :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 - (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._list_collections_in_application_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAccountCollections200Response", - '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 list_collections_in_application_with_http_info( - self, - 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=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - name: Annotated[Optional[StrictStr], Field(description="Filter by collection name.")] = 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[ListAccountCollections200Response]: - """List collections in Application - - List campaign-level collections from all campaigns in a given Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param name: Filter by collection name. - :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 - (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._list_collections_in_application_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAccountCollections200Response", - '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 list_collections_in_application_without_preload_content( - self, - 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=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - name: Annotated[Optional[StrictStr], Field(description="Filter by collection name.")] = 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: - """List collections in Application - - List campaign-level collections from all campaigns in a given Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param name: Filter by collection name. - :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 - (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._list_collections_in_application_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAccountCollections200Response", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_collections_in_application_serialize( - self, - application_id, - page_size, - skip, - sort, - with_total_result_size, - name, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if with_total_result_size is not None: - - _query_params.append(('withTotalResultSize', with_total_result_size)) - - if name is not None: - - _query_params.append(('name', name)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/collections', - 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 list_stores( - self, - 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=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - campaign_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by campaign ID.")] = None, - name: Annotated[Optional[StrictStr], Field(description="The name of the store.")] = None, - integration_id: Annotated[Optional[StrictStr], Field(description="The integration ID of the store.")] = None, - query: Annotated[Optional[StrictStr], Field(description="Filter results by `name` or `integrationId`.")] = 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, - ) -> ListStores200Response: - """List stores - - List all stores for a specific Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param campaign_id: Filter results by campaign ID. - :type campaign_id: float - :param name: The name of the store. - :type name: str - :param integration_id: The integration ID of the store. - :type integration_id: str - :param query: Filter results by `name` or `integrationId`. - :type query: 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._list_stores_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - campaign_id=campaign_id, - name=name, - integration_id=integration_id, - query=query, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListStores200Response", - } - 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 list_stores_with_http_info( - self, - 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=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - campaign_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by campaign ID.")] = None, - name: Annotated[Optional[StrictStr], Field(description="The name of the store.")] = None, - integration_id: Annotated[Optional[StrictStr], Field(description="The integration ID of the store.")] = None, - query: Annotated[Optional[StrictStr], Field(description="Filter results by `name` or `integrationId`.")] = 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[ListStores200Response]: - """List stores - - List all stores for a specific Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param campaign_id: Filter results by campaign ID. - :type campaign_id: float - :param name: The name of the store. - :type name: str - :param integration_id: The integration ID of the store. - :type integration_id: str - :param query: Filter results by `name` or `integrationId`. - :type query: 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._list_stores_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - campaign_id=campaign_id, - name=name, - integration_id=integration_id, - query=query, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListStores200Response", - } - 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 list_stores_without_preload_content( - self, - 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=1000, 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, - 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, - with_total_result_size: Annotated[Optional[StrictBool], Field(description="When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. ")] = None, - campaign_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by campaign ID.")] = None, - name: Annotated[Optional[StrictStr], Field(description="The name of the store.")] = None, - integration_id: Annotated[Optional[StrictStr], Field(description="The integration ID of the store.")] = None, - query: Annotated[Optional[StrictStr], Field(description="Filter results by `name` or `integrationId`.")] = 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: - """List stores - - List all stores for a specific Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param with_total_result_size: When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. - :type with_total_result_size: bool - :param campaign_id: Filter results by campaign ID. - :type campaign_id: float - :param name: The name of the store. - :type name: str - :param integration_id: The integration ID of the store. - :type integration_id: str - :param query: Filter results by `name` or `integrationId`. - :type query: 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._list_stores_serialize( - application_id=application_id, - page_size=page_size, - skip=skip, - sort=sort, - with_total_result_size=with_total_result_size, - campaign_id=campaign_id, - name=name, - integration_id=integration_id, - query=query, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ListStores200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_stores_serialize( - self, - application_id, - page_size, - skip, - sort, - with_total_result_size, - campaign_id, - name, - integration_id, - query, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if with_total_result_size is not None: - - _query_params.append(('withTotalResultSize', with_total_result_size)) - - if campaign_id is not None: - - _query_params.append(('campaignId', campaign_id)) - - if name is not None: - - _query_params.append(('name', name)) - - if integration_id is not None: - - _query_params.append(('integrationId', integration_id)) - - if query is not None: - - _query_params.append(('query', query)) - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/stores', - 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 okta_event_handler_challenge( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Validate Okta API ownership - - Validate the ownership of the API through a challenge-response mechanism. This challenger endpoint is used by Okta to confirm that communication between Talon.One and Okta is correctly configured and accessible for provisioning and deprovisioning of Talon.One users, and that only Talon.One can receive and respond to events from Okta. - - :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._okta_event_handler_challenge_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': None, - } - 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 okta_event_handler_challenge_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Validate Okta API ownership - - Validate the ownership of the API through a challenge-response mechanism. This challenger endpoint is used by Okta to confirm that communication between Talon.One and Okta is correctly configured and accessible for provisioning and deprovisioning of Talon.One users, and that only Talon.One can receive and respond to events from Okta. - - :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._okta_event_handler_challenge_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': None, - } - 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 okta_event_handler_challenge_without_preload_content( - self, - _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: - """Validate Okta API ownership - - Validate the ownership of the API through a challenge-response mechanism. This challenger endpoint is used by Okta to confirm that communication between Talon.One and Okta is correctly configured and accessible for provisioning and deprovisioning of Talon.One users, and that only Talon.One can receive and respond to events from Okta. - - :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._okta_event_handler_challenge_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _okta_event_handler_challenge_serialize( - self, - _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 - # process the header parameters - # process the form parameters - # process the body parameter - - - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/provisioning/okta', - 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 remove_loyalty_points( - self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - 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. ")], - deduct_loyalty_points: Annotated[DeductLoyaltyPoints, Field(description="body")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Deduct points from customer profile - - Deduct points from the specified loyalty program and specified customer profile. **Important:** - Only active points can be deducted. - Only pending points are rolled back when a session is cancelled or reopened. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param deduct_loyalty_points: body (required) - :type deduct_loyalty_points: DeductLoyaltyPoints - :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._remove_loyalty_points_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - deduct_loyalty_points=deduct_loyalty_points, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def remove_loyalty_points_with_http_info( - self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - 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. ")], - deduct_loyalty_points: Annotated[DeductLoyaltyPoints, Field(description="body")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Deduct points from customer profile - - Deduct points from the specified loyalty program and specified customer profile. **Important:** - Only active points can be deducted. - Only pending points are rolled back when a session is cancelled or reopened. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param deduct_loyalty_points: body (required) - :type deduct_loyalty_points: DeductLoyaltyPoints - :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._remove_loyalty_points_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - deduct_loyalty_points=deduct_loyalty_points, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def remove_loyalty_points_without_preload_content( - self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], - 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. ")], - deduct_loyalty_points: Annotated[DeductLoyaltyPoints, Field(description="body")], - _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: - """Deduct points from customer profile - - Deduct points from the specified loyalty program and specified customer profile. **Important:** - Only active points can be deducted. - Only pending points are rolled back when a session is cancelled or reopened. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param deduct_loyalty_points: body (required) - :type deduct_loyalty_points: DeductLoyaltyPoints - :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._remove_loyalty_points_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - deduct_loyalty_points=deduct_loyalty_points, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _remove_loyalty_points_serialize( - self, - loyalty_program_id, - integration_id, - deduct_loyalty_points, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - if integration_id is not None: - _path_params['integrationId'] = integration_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if deduct_loyalty_points is not None: - _body_params = deduct_loyalty_points - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/deduct_points', - 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 reset_password( - self, - new_password: Annotated[NewPassword, Field(description="body")], - _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, - ) -> NewPassword: - """Reset password - - Consumes the supplied password reset token and updates the password for the associated account. - - :param new_password: body (required) - :type new_password: NewPassword - :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._reset_password_serialize( - new_password=new_password, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': "NewPassword", - } - 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 reset_password_with_http_info( - self, - new_password: Annotated[NewPassword, Field(description="body")], - _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[NewPassword]: - """Reset password - - Consumes the supplied password reset token and updates the password for the associated account. - - :param new_password: body (required) - :type new_password: NewPassword - :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._reset_password_serialize( - new_password=new_password, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': "NewPassword", - } - 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 reset_password_without_preload_content( - self, - new_password: Annotated[NewPassword, Field(description="body")], - _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: - """Reset password - - Consumes the supplied password reset token and updates the password for the associated account. - - :param new_password: body (required) - :type new_password: NewPassword - :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._reset_password_serialize( - new_password=new_password, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': "NewPassword", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _reset_password_serialize( - self, - new_password, - _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 - # process the header parameters - # process the form parameters - # process the body parameter - if new_password is not None: - _body_params = new_password - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/reset_password', - 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 scim_create_group( - self, - scim_base_group: Annotated[ScimBaseGroup, Field(description="body")], - _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, - ) -> ScimGroup: - """Create SCIM group - - Create a new Talon.One group using the SCIM Group provisioning protocol with an identity provider, for example, Microsoft Entra ID, and assign members from the payload to the new group. 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. - - :param scim_base_group: body (required) - :type scim_base_group: ScimBaseGroup - :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._scim_create_group_serialize( - scim_base_group=scim_base_group, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "ScimGroup", - } - 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 scim_create_group_with_http_info( - self, - scim_base_group: Annotated[ScimBaseGroup, Field(description="body")], - _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[ScimGroup]: - """Create SCIM group - - Create a new Talon.One group using the SCIM Group provisioning protocol with an identity provider, for example, Microsoft Entra ID, and assign members from the payload to the new group. 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. - - :param scim_base_group: body (required) - :type scim_base_group: ScimBaseGroup - :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._scim_create_group_serialize( - scim_base_group=scim_base_group, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "ScimGroup", - } - 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 scim_create_group_without_preload_content( - self, - scim_base_group: Annotated[ScimBaseGroup, Field(description="body")], - _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: - """Create SCIM group - - Create a new Talon.One group using the SCIM Group provisioning protocol with an identity provider, for example, Microsoft Entra ID, and assign members from the payload to the new group. 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. - - :param scim_base_group: body (required) - :type scim_base_group: ScimBaseGroup - :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._scim_create_group_serialize( - scim_base_group=scim_base_group, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "ScimGroup", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _scim_create_group_serialize( - self, - scim_base_group, - _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 - # process the header parameters - # process the form parameters - # process the body parameter - if scim_base_group is not None: - _body_params = scim_base_group - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/provisioning/scim/Groups', - 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 scim_create_user( - self, - scim_new_user: Annotated[ScimNewUser, Field(description="body")], - _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, - ) -> ScimUser: - """Create SCIM user - - Create a new Talon.One user using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. - - :param scim_new_user: body (required) - :type scim_new_user: ScimNewUser - :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._scim_create_user_serialize( - scim_new_user=scim_new_user, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "ScimUser", - } - 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 scim_create_user_with_http_info( - self, - scim_new_user: Annotated[ScimNewUser, Field(description="body")], - _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[ScimUser]: - """Create SCIM user - - Create a new Talon.One user using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. - - :param scim_new_user: body (required) - :type scim_new_user: ScimNewUser - :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._scim_create_user_serialize( - scim_new_user=scim_new_user, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "ScimUser", - } - 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 scim_create_user_without_preload_content( - self, - scim_new_user: Annotated[ScimNewUser, Field(description="body")], - _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: - """Create SCIM user - - Create a new Talon.One user using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. - - :param scim_new_user: body (required) - :type scim_new_user: ScimNewUser - :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._scim_create_user_serialize( - scim_new_user=scim_new_user, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "ScimUser", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _scim_create_user_serialize( - self, - scim_new_user, - _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 - # process the header parameters - # process the form parameters - # process the body parameter - if scim_new_user is not None: - _body_params = scim_new_user - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/provisioning/scim/Users', - 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 scim_delete_group( - self, - group_id: Annotated[StrictInt, Field(description="The ID of the group.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete SCIM group - - Delete a specific group created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. 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. - - :param group_id: The ID of the group. (required) - :type group_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._scim_delete_group_serialize( - group_id=group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 scim_delete_group_with_http_info( - self, - group_id: Annotated[StrictInt, Field(description="The ID of the group.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete SCIM group - - Delete a specific group created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. 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. - - :param group_id: The ID of the group. (required) - :type group_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._scim_delete_group_serialize( - group_id=group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 scim_delete_group_without_preload_content( - self, - group_id: Annotated[StrictInt, Field(description="The ID of the group.")], - _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: - """Delete SCIM group - - Delete a specific group created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. 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. - - :param group_id: The ID of the group. (required) - :type group_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._scim_delete_group_serialize( - group_id=group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _scim_delete_group_serialize( - self, - group_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 group_id is not None: - _path_params['groupId'] = group_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/provisioning/scim/Groups/{groupId}', - 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 scim_delete_user( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete SCIM user - - Delete a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._scim_delete_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 scim_delete_user_with_http_info( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete SCIM user - - Delete a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._scim_delete_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 scim_delete_user_without_preload_content( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - _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: - """Delete SCIM user - - Delete a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._scim_delete_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _scim_delete_user_serialize( - self, - user_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 user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - - - # authentication setting - _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/provisioning/scim/Users/{userId}', - 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 scim_get_group( - self, - group_id: Annotated[StrictInt, Field(description="The ID of the group.")], - _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, - ) -> ScimGroup: - """Get SCIM group - - Retrieve data for a specific group created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. 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. - - :param group_id: The ID of the group. (required) - :type group_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._scim_get_group_serialize( - group_id=group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimGroup", - } - 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 scim_get_group_with_http_info( - self, - group_id: Annotated[StrictInt, Field(description="The ID of the group.")], - _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[ScimGroup]: - """Get SCIM group - - Retrieve data for a specific group created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. 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. - - :param group_id: The ID of the group. (required) - :type group_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._scim_get_group_serialize( - group_id=group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimGroup", - } - 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 scim_get_group_without_preload_content( - self, - group_id: Annotated[StrictInt, Field(description="The ID of the group.")], - _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 SCIM group - - Retrieve data for a specific group created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. 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. - - :param group_id: The ID of the group. (required) - :type group_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._scim_get_group_serialize( - group_id=group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimGroup", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _scim_get_group_serialize( - self, - group_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 group_id is not None: - _path_params['groupId'] = group_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/provisioning/scim/Groups/{groupId}', - 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 scim_get_groups( - self, - _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, - ) -> ScimGroupsListResponse: - """List SCIM groups - - Retrieve a paginated list of groups created using the SCIM protocol with an identity provider, for example, Microsoft Entra ID. 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. - - :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._scim_get_groups_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimGroupsListResponse", - } - 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 scim_get_groups_with_http_info( - self, - _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[ScimGroupsListResponse]: - """List SCIM groups - - Retrieve a paginated list of groups created using the SCIM protocol with an identity provider, for example, Microsoft Entra ID. 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. - - :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._scim_get_groups_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimGroupsListResponse", - } - 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 scim_get_groups_without_preload_content( - self, - _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: - """List SCIM groups - - Retrieve a paginated list of groups created using the SCIM protocol with an identity provider, for example, Microsoft Entra ID. 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. - - :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._scim_get_groups_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimGroupsListResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _scim_get_groups_serialize( - self, - _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 - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/provisioning/scim/Groups', - 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 scim_get_resource_types( - self, - _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, - ) -> ScimResourceTypesListResponse: - """List supported SCIM resource types - - Retrieve a list of resource types supported by the SCIM provisioning protocol. Resource types define the various kinds of resources that can be managed via the SCIM API, such as users, groups, or custom-defined resources. - - :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._scim_get_resource_types_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimResourceTypesListResponse", - } - 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 scim_get_resource_types_with_http_info( - self, - _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[ScimResourceTypesListResponse]: - """List supported SCIM resource types - - Retrieve a list of resource types supported by the SCIM provisioning protocol. Resource types define the various kinds of resources that can be managed via the SCIM API, such as users, groups, or custom-defined resources. - - :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._scim_get_resource_types_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimResourceTypesListResponse", - } - 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 scim_get_resource_types_without_preload_content( - self, - _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: - """List supported SCIM resource types - - Retrieve a list of resource types supported by the SCIM provisioning protocol. Resource types define the various kinds of resources that can be managed via the SCIM API, such as users, groups, or custom-defined resources. - - :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._scim_get_resource_types_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimResourceTypesListResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _scim_get_resource_types_serialize( - self, - _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 - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/provisioning/scim/ResourceTypes', - 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 scim_get_schemas( - self, - _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, - ) -> ScimSchemasListResponse: - """List supported SCIM schemas - - Retrieve a list of schemas supported by the SCIM provisioning protocol. Schemas define the structure and attributes of the different resources that can be managed via the SCIM API, such as users, groups, and any custom-defined resources. - - :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._scim_get_schemas_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimSchemasListResponse", - } - 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 scim_get_schemas_with_http_info( - self, - _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[ScimSchemasListResponse]: - """List supported SCIM schemas - - Retrieve a list of schemas supported by the SCIM provisioning protocol. Schemas define the structure and attributes of the different resources that can be managed via the SCIM API, such as users, groups, and any custom-defined resources. - - :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._scim_get_schemas_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimSchemasListResponse", - } - 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 scim_get_schemas_without_preload_content( - self, - _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: - """List supported SCIM schemas - - Retrieve a list of schemas supported by the SCIM provisioning protocol. Schemas define the structure and attributes of the different resources that can be managed via the SCIM API, such as users, groups, and any custom-defined resources. - - :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._scim_get_schemas_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimSchemasListResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _scim_get_schemas_serialize( - self, - _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 - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/provisioning/scim/Schemas', - 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 scim_get_service_provider_config( - self, - _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, - ) -> ScimServiceProviderConfigResponse: - """Get SCIM service provider configuration - - Retrieve the configuration settings of the SCIM service provider. It provides details about the features and capabilities supported by the SCIM API, such as the different operation settings. - - :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._scim_get_service_provider_config_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimServiceProviderConfigResponse", - } - 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 scim_get_service_provider_config_with_http_info( - self, - _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[ScimServiceProviderConfigResponse]: - """Get SCIM service provider configuration - - Retrieve the configuration settings of the SCIM service provider. It provides details about the features and capabilities supported by the SCIM API, such as the different operation settings. - - :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._scim_get_service_provider_config_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimServiceProviderConfigResponse", - } - 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 scim_get_service_provider_config_without_preload_content( - self, - _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 SCIM service provider configuration - - Retrieve the configuration settings of the SCIM service provider. It provides details about the features and capabilities supported by the SCIM API, such as the different operation settings. - - :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._scim_get_service_provider_config_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimServiceProviderConfigResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _scim_get_service_provider_config_serialize( - self, - _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 - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/provisioning/scim/ServiceProviderConfig', - 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 scim_get_user( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - _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, - ) -> ScimUser: - """Get SCIM user - - Retrieve data for a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._scim_get_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimUser", - } - 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 scim_get_user_with_http_info( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - _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[ScimUser]: - """Get SCIM user - - Retrieve data for a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._scim_get_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimUser", - } - 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 scim_get_user_without_preload_content( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - _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 SCIM user - - Retrieve data for a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._scim_get_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimUser", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _scim_get_user_serialize( - self, - user_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 user_id is not None: - _path_params['userId'] = user_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/provisioning/scim/Users/{userId}', - 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 scim_get_users( - self, - _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, - ) -> ScimUsersListResponse: - """List SCIM users - - Retrieve a paginated list of users that have been provisioned using the SCIM protocol with an identity provider, for example, Microsoft Entra ID. - - :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._scim_get_users_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimUsersListResponse", - } - 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 scim_get_users_with_http_info( - self, - _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[ScimUsersListResponse]: - """List SCIM users - - Retrieve a paginated list of users that have been provisioned using the SCIM protocol with an identity provider, for example, Microsoft Entra ID. - - :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._scim_get_users_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimUsersListResponse", - } - 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 scim_get_users_without_preload_content( - self, - _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: - """List SCIM users - - Retrieve a paginated list of users that have been provisioned using the SCIM protocol with an identity provider, for example, Microsoft Entra ID. - - :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._scim_get_users_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimUsersListResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _scim_get_users_serialize( - self, - _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 - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/provisioning/scim/Users', - 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 scim_patch_group( - self, - group_id: Annotated[StrictInt, Field(description="The ID of the group.")], - scim_patch_request: Annotated[ScimPatchRequest, Field(description="body")], - _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, - ) -> ScimGroup: - """Update SCIM group attributes - - Update certain attributes of a group created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. This endpoint allows for selective adding, removing, or replacing of specific group attributes while other attributes remain unchanged. 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. - - :param group_id: The ID of the group. (required) - :type group_id: int - :param scim_patch_request: body (required) - :type scim_patch_request: ScimPatchRequest - :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._scim_patch_group_serialize( - group_id=group_id, - scim_patch_request=scim_patch_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimGroup", - } - 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 scim_patch_group_with_http_info( - self, - group_id: Annotated[StrictInt, Field(description="The ID of the group.")], - scim_patch_request: Annotated[ScimPatchRequest, Field(description="body")], - _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[ScimGroup]: - """Update SCIM group attributes - - Update certain attributes of a group created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. This endpoint allows for selective adding, removing, or replacing of specific group attributes while other attributes remain unchanged. 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. - - :param group_id: The ID of the group. (required) - :type group_id: int - :param scim_patch_request: body (required) - :type scim_patch_request: ScimPatchRequest - :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._scim_patch_group_serialize( - group_id=group_id, - scim_patch_request=scim_patch_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimGroup", - } - 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 scim_patch_group_without_preload_content( - self, - group_id: Annotated[StrictInt, Field(description="The ID of the group.")], - scim_patch_request: Annotated[ScimPatchRequest, Field(description="body")], - _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: - """Update SCIM group attributes - - Update certain attributes of a group created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. This endpoint allows for selective adding, removing, or replacing of specific group attributes while other attributes remain unchanged. 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. - - :param group_id: The ID of the group. (required) - :type group_id: int - :param scim_patch_request: body (required) - :type scim_patch_request: ScimPatchRequest - :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._scim_patch_group_serialize( - group_id=group_id, - scim_patch_request=scim_patch_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimGroup", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _scim_patch_group_serialize( - self, - group_id, - scim_patch_request, - _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 group_id is not None: - _path_params['groupId'] = group_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if scim_patch_request is not None: - _body_params = scim_patch_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PATCH', - resource_path='/v1/provisioning/scim/Groups/{groupId}', - 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 scim_patch_user( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - scim_patch_request: Annotated[ScimPatchRequest, Field(description="body")], - _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, - ) -> ScimUser: - """Update SCIM user attributes - - Update certain attributes of a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. This endpoint allows for selective adding, removing, or replacing specific attributes while leaving other attributes unchanged. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param scim_patch_request: body (required) - :type scim_patch_request: ScimPatchRequest - :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._scim_patch_user_serialize( - user_id=user_id, - scim_patch_request=scim_patch_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimUser", - } - 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 scim_patch_user_with_http_info( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - scim_patch_request: Annotated[ScimPatchRequest, Field(description="body")], - _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[ScimUser]: - """Update SCIM user attributes - - Update certain attributes of a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. This endpoint allows for selective adding, removing, or replacing specific attributes while leaving other attributes unchanged. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param scim_patch_request: body (required) - :type scim_patch_request: ScimPatchRequest - :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._scim_patch_user_serialize( - user_id=user_id, - scim_patch_request=scim_patch_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimUser", - } - 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 scim_patch_user_without_preload_content( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - scim_patch_request: Annotated[ScimPatchRequest, Field(description="body")], - _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: - """Update SCIM user attributes - - Update certain attributes of a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. This endpoint allows for selective adding, removing, or replacing specific attributes while leaving other attributes unchanged. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param scim_patch_request: body (required) - :type scim_patch_request: ScimPatchRequest - :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._scim_patch_user_serialize( - user_id=user_id, - scim_patch_request=scim_patch_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimUser", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _scim_patch_user_serialize( - self, - user_id, - scim_patch_request, - _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 user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if scim_patch_request is not None: - _body_params = scim_patch_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PATCH', - resource_path='/v1/provisioning/scim/Users/{userId}', - 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 scim_replace_group_attributes( - self, - group_id: Annotated[StrictInt, Field(description="The ID of the group.")], - scim_base_group: Annotated[ScimBaseGroup, Field(description="body")], - _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, - ) -> ScimGroup: - """Update SCIM group - - Update the details of a specific group created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. This endpoint replaces all attributes of the given group with the attributes provided in the request payload. 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. - - :param group_id: The ID of the group. (required) - :type group_id: int - :param scim_base_group: body (required) - :type scim_base_group: ScimBaseGroup - :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._scim_replace_group_attributes_serialize( - group_id=group_id, - scim_base_group=scim_base_group, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimGroup", - } - 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 scim_replace_group_attributes_with_http_info( - self, - group_id: Annotated[StrictInt, Field(description="The ID of the group.")], - scim_base_group: Annotated[ScimBaseGroup, Field(description="body")], - _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[ScimGroup]: - """Update SCIM group - - Update the details of a specific group created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. This endpoint replaces all attributes of the given group with the attributes provided in the request payload. 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. - - :param group_id: The ID of the group. (required) - :type group_id: int - :param scim_base_group: body (required) - :type scim_base_group: ScimBaseGroup - :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._scim_replace_group_attributes_serialize( - group_id=group_id, - scim_base_group=scim_base_group, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimGroup", - } - 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 scim_replace_group_attributes_without_preload_content( - self, - group_id: Annotated[StrictInt, Field(description="The ID of the group.")], - scim_base_group: Annotated[ScimBaseGroup, Field(description="body")], - _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: - """Update SCIM group - - Update the details of a specific group created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. This endpoint replaces all attributes of the given group with the attributes provided in the request payload. 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. - - :param group_id: The ID of the group. (required) - :type group_id: int - :param scim_base_group: body (required) - :type scim_base_group: ScimBaseGroup - :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._scim_replace_group_attributes_serialize( - group_id=group_id, - scim_base_group=scim_base_group, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimGroup", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _scim_replace_group_attributes_serialize( - self, - group_id, - scim_base_group, - _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 group_id is not None: - _path_params['groupId'] = group_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if scim_base_group is not None: - _body_params = scim_base_group - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/provisioning/scim/Groups/{groupId}', - 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 scim_replace_user_attributes( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - scim_new_user: Annotated[ScimNewUser, Field(description="body")], - _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, - ) -> ScimUser: - """Update SCIM user - - Update the details of a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. This endpoint replaces all attributes of the specific user with the attributes provided in the request payload. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param scim_new_user: body (required) - :type scim_new_user: ScimNewUser - :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._scim_replace_user_attributes_serialize( - user_id=user_id, - scim_new_user=scim_new_user, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimUser", - } - 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 scim_replace_user_attributes_with_http_info( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - scim_new_user: Annotated[ScimNewUser, Field(description="body")], - _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[ScimUser]: - """Update SCIM user - - Update the details of a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. This endpoint replaces all attributes of the specific user with the attributes provided in the request payload. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param scim_new_user: body (required) - :type scim_new_user: ScimNewUser - :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._scim_replace_user_attributes_serialize( - user_id=user_id, - scim_new_user=scim_new_user, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimUser", - } - 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 scim_replace_user_attributes_without_preload_content( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - scim_new_user: Annotated[ScimNewUser, Field(description="body")], - _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: - """Update SCIM user - - Update the details of a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. This endpoint replaces all attributes of the specific user with the attributes provided in the request payload. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param scim_new_user: body (required) - :type scim_new_user: ScimNewUser - :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._scim_replace_user_attributes_serialize( - user_id=user_id, - scim_new_user=scim_new_user, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ScimUser", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _scim_replace_user_attributes_serialize( - self, - user_id, - scim_new_user, - _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 user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if scim_new_user is not None: - _body_params = scim_new_user - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/provisioning/scim/Users/{userId}', - 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 search_coupons_advanced_application_wide_without_total_count( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - body: Annotated[Dict[str, Any], Field(description="body")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - value: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. ")] = None, - referral_id: Annotated[Optional[StrictInt], Field(description="Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code.")] = None, - recipient_integration_id: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field.")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of coupons")] = None, - exact_match: Annotated[Optional[StrictBool], Field(description="Filter results to an exact case-insensitive matching against the coupon code.")] = None, - campaign_state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. ")] = None, - _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, - ) -> GetCouponsWithoutTotalCount200Response: - """List coupons that match the given attributes (without total count) - - List the coupons whose attributes match the query criteria in all the campaigns of the given Application. The match is successful if all the attributes of the request are found in a coupon, even if the coupon has more attributes that are not present on the request. **Note:** The total count is not included in the response. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param body: body (required) - :type body: object - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param value: Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type value: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. - :type valid: str - :param usable: Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. - :type usable: str - :param referral_id: Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. - :type referral_id: int - :param recipient_integration_id: Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field. - :type recipient_integration_id: str - :param batch_id: Filter results by batches of coupons - :type batch_id: str - :param exact_match: Filter results to an exact case-insensitive matching against the coupon code. - :type exact_match: bool - :param campaign_state: Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - :type campaign_state: 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._search_coupons_advanced_application_wide_without_total_count_serialize( - application_id=application_id, - body=body, - page_size=page_size, - skip=skip, - sort=sort, - value=value, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - referral_id=referral_id, - recipient_integration_id=recipient_integration_id, - batch_id=batch_id, - exact_match=exact_match, - campaign_state=campaign_state, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCouponsWithoutTotalCount200Response", - } - 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 search_coupons_advanced_application_wide_without_total_count_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - body: Annotated[Dict[str, Any], Field(description="body")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - value: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. ")] = None, - referral_id: Annotated[Optional[StrictInt], Field(description="Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code.")] = None, - recipient_integration_id: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field.")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of coupons")] = None, - exact_match: Annotated[Optional[StrictBool], Field(description="Filter results to an exact case-insensitive matching against the coupon code.")] = None, - campaign_state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. ")] = None, - _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[GetCouponsWithoutTotalCount200Response]: - """List coupons that match the given attributes (without total count) - - List the coupons whose attributes match the query criteria in all the campaigns of the given Application. The match is successful if all the attributes of the request are found in a coupon, even if the coupon has more attributes that are not present on the request. **Note:** The total count is not included in the response. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param body: body (required) - :type body: object - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param value: Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type value: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. - :type valid: str - :param usable: Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. - :type usable: str - :param referral_id: Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. - :type referral_id: int - :param recipient_integration_id: Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field. - :type recipient_integration_id: str - :param batch_id: Filter results by batches of coupons - :type batch_id: str - :param exact_match: Filter results to an exact case-insensitive matching against the coupon code. - :type exact_match: bool - :param campaign_state: Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - :type campaign_state: 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._search_coupons_advanced_application_wide_without_total_count_serialize( - application_id=application_id, - body=body, - page_size=page_size, - skip=skip, - sort=sort, - value=value, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - referral_id=referral_id, - recipient_integration_id=recipient_integration_id, - batch_id=batch_id, - exact_match=exact_match, - campaign_state=campaign_state, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCouponsWithoutTotalCount200Response", - } - 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 search_coupons_advanced_application_wide_without_total_count_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - body: Annotated[Dict[str, Any], Field(description="body")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - value: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. ")] = None, - referral_id: Annotated[Optional[StrictInt], Field(description="Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code.")] = None, - recipient_integration_id: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field.")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of coupons")] = None, - exact_match: Annotated[Optional[StrictBool], Field(description="Filter results to an exact case-insensitive matching against the coupon code.")] = None, - campaign_state: Annotated[Optional[StrictStr], Field(description="Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. ")] = None, - _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: - """List coupons that match the given attributes (without total count) - - List the coupons whose attributes match the query criteria in all the campaigns of the given Application. The match is successful if all the attributes of the request are found in a coupon, even if the coupon has more attributes that are not present on the request. **Note:** The total count is not included in the response. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param body: body (required) - :type body: object - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param value: Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type value: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. - :type valid: str - :param usable: Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. - :type usable: str - :param referral_id: Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. - :type referral_id: int - :param recipient_integration_id: Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field. - :type recipient_integration_id: str - :param batch_id: Filter results by batches of coupons - :type batch_id: str - :param exact_match: Filter results to an exact case-insensitive matching against the coupon code. - :type exact_match: bool - :param campaign_state: Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - :type campaign_state: 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._search_coupons_advanced_application_wide_without_total_count_serialize( - application_id=application_id, - body=body, - page_size=page_size, - skip=skip, - sort=sort, - value=value, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - referral_id=referral_id, - recipient_integration_id=recipient_integration_id, - batch_id=batch_id, - exact_match=exact_match, - campaign_state=campaign_state, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCouponsWithoutTotalCount200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _search_coupons_advanced_application_wide_without_total_count_serialize( - self, - application_id, - body, - page_size, - skip, - sort, - value, - created_before, - created_after, - valid, - usable, - referral_id, - recipient_integration_id, - batch_id, - exact_match, - campaign_state, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if value is not None: - - _query_params.append(('value', value)) - - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - 'createdBefore', - created_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdBefore', created_before)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdAfter', created_after)) - - if valid is not None: - - _query_params.append(('valid', valid)) - - if usable is not None: - - _query_params.append(('usable', usable)) - - if referral_id is not None: - - _query_params.append(('referralId', referral_id)) - - if recipient_integration_id is not None: - - _query_params.append(('recipientIntegrationId', recipient_integration_id)) - - if batch_id is not None: - - _query_params.append(('batchId', batch_id)) - - if exact_match is not None: - - _query_params.append(('exactMatch', exact_match)) - - if campaign_state is not None: - - _query_params.append(('campaignState', campaign_state)) - - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/applications/{applicationId}/coupons_search_advanced/no_total', - 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 search_coupons_advanced_without_total_count( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - body: Annotated[Dict[str, Any], Field(description="body")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - value: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. ")] = None, - referral_id: Annotated[Optional[StrictInt], Field(description="Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code.")] = None, - recipient_integration_id: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field.")] = None, - exact_match: Annotated[Optional[StrictBool], Field(description="Filter results to an exact case-insensitive matching against the coupon code.")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of coupons")] = 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, - ) -> GetCouponsWithoutTotalCount200Response: - """List coupons that match the given attributes in campaign (without total count) - - List the coupons whose attributes match the query criteria in the given campaign. The match is successful if all the attributes of the request are found in a coupon, even if the coupon has more attributes that are not present on the request. **Note:** The total count is not included in the response. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param body: body (required) - :type body: object - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param value: Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type value: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. - :type valid: str - :param usable: Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. - :type usable: str - :param referral_id: Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. - :type referral_id: int - :param recipient_integration_id: Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field. - :type recipient_integration_id: str - :param exact_match: Filter results to an exact case-insensitive matching against the coupon code. - :type exact_match: bool - :param batch_id: Filter results by batches of coupons - :type batch_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._search_coupons_advanced_without_total_count_serialize( - application_id=application_id, - campaign_id=campaign_id, - body=body, - page_size=page_size, - skip=skip, - sort=sort, - value=value, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - referral_id=referral_id, - recipient_integration_id=recipient_integration_id, - exact_match=exact_match, - batch_id=batch_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCouponsWithoutTotalCount200Response", - } - 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 search_coupons_advanced_without_total_count_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - body: Annotated[Dict[str, Any], Field(description="body")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - value: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. ")] = None, - referral_id: Annotated[Optional[StrictInt], Field(description="Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code.")] = None, - recipient_integration_id: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field.")] = None, - exact_match: Annotated[Optional[StrictBool], Field(description="Filter results to an exact case-insensitive matching against the coupon code.")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of coupons")] = 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[GetCouponsWithoutTotalCount200Response]: - """List coupons that match the given attributes in campaign (without total count) - - List the coupons whose attributes match the query criteria in the given campaign. The match is successful if all the attributes of the request are found in a coupon, even if the coupon has more attributes that are not present on the request. **Note:** The total count is not included in the response. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param body: body (required) - :type body: object - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param value: Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type value: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. - :type valid: str - :param usable: Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. - :type usable: str - :param referral_id: Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. - :type referral_id: int - :param recipient_integration_id: Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field. - :type recipient_integration_id: str - :param exact_match: Filter results to an exact case-insensitive matching against the coupon code. - :type exact_match: bool - :param batch_id: Filter results by batches of coupons - :type batch_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._search_coupons_advanced_without_total_count_serialize( - application_id=application_id, - campaign_id=campaign_id, - body=body, - page_size=page_size, - skip=skip, - sort=sort, - value=value, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - referral_id=referral_id, - recipient_integration_id=recipient_integration_id, - exact_match=exact_match, - batch_id=batch_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCouponsWithoutTotalCount200Response", - } - 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 search_coupons_advanced_without_total_count_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - body: Annotated[Dict[str, Any], Field(description="body")], - page_size: Annotated[Optional[Annotated[int, Field(le=1000, 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, - 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, - value: Annotated[Optional[StrictStr], Field(description="Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.")] = None, - created_before: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - created_after: Annotated[Optional[datetime], Field(description="Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally.")] = None, - valid: Annotated[Optional[StrictStr], Field(description="Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. ")] = None, - usable: Annotated[Optional[StrictStr], Field(description="Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. ")] = None, - referral_id: Annotated[Optional[StrictInt], Field(description="Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code.")] = None, - recipient_integration_id: Annotated[Optional[StrictStr], Field(description="Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field.")] = None, - exact_match: Annotated[Optional[StrictBool], Field(description="Filter results to an exact case-insensitive matching against the coupon code.")] = None, - batch_id: Annotated[Optional[StrictStr], Field(description="Filter results by batches of coupons")] = 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: - """List coupons that match the given attributes in campaign (without total count) - - List the coupons whose attributes match the query criteria in the given campaign. The match is successful if all the attributes of the request are found in a coupon, even if the coupon has more attributes that are not present on the request. **Note:** The total count is not included in the response. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param body: body (required) - :type body: object - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int - :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 - :param value: Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. - :type value: str - :param created_before: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_before: datetime - :param created_after: Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. - :type created_after: datetime - :param valid: Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. - :type valid: str - :param usable: Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. - :type usable: str - :param referral_id: Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. - :type referral_id: int - :param recipient_integration_id: Filter results by match with a profile ID specified in the coupon's RecipientIntegrationId field. - :type recipient_integration_id: str - :param exact_match: Filter results to an exact case-insensitive matching against the coupon code. - :type exact_match: bool - :param batch_id: Filter results by batches of coupons - :type batch_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._search_coupons_advanced_without_total_count_serialize( - application_id=application_id, - campaign_id=campaign_id, - body=body, - page_size=page_size, - skip=skip, - sort=sort, - value=value, - created_before=created_before, - created_after=created_after, - valid=valid, - usable=usable, - referral_id=referral_id, - recipient_integration_id=recipient_integration_id, - exact_match=exact_match, - batch_id=batch_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCouponsWithoutTotalCount200Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _search_coupons_advanced_without_total_count_serialize( - self, - application_id, - campaign_id, - body, - page_size, - skip, - sort, - value, - created_before, - created_after, - valid, - usable, - referral_id, - recipient_integration_id, - exact_match, - batch_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - if value is not None: - - _query_params.append(('value', value)) - - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - 'createdBefore', - created_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdBefore', created_before)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdAfter', created_after)) - - if valid is not None: - - _query_params.append(('valid', valid)) - - if usable is not None: - - _query_params.append(('usable', usable)) - - if referral_id is not None: - - _query_params.append(('referralId', referral_id)) - - if recipient_integration_id is not None: - - _query_params.append(('recipientIntegrationId', recipient_integration_id)) - - if exact_match is not None: - - _query_params.append(('exactMatch', exact_match)) - - if batch_id is not None: - - _query_params.append(('batchId', batch_id)) - - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_search_advanced/no_total', - 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 summarize_campaign_store_budget( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - _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, - ) -> SummarizeCampaignStoreBudget200Response: - """Get summary of campaign store budgets - - Fetch a summary of all store budget information for a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param _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._summarize_campaign_store_budget_serialize( - application_id=application_id, - campaign_id=campaign_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SummarizeCampaignStoreBudget200Response", - '400': "ErrorResponse", - '401': "ErrorResponse", - '404': "ErrorResponse", - } - 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 summarize_campaign_store_budget_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - _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[SummarizeCampaignStoreBudget200Response]: - """Get summary of campaign store budgets - - Fetch a summary of all store budget information for a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param _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._summarize_campaign_store_budget_serialize( - application_id=application_id, - campaign_id=campaign_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SummarizeCampaignStoreBudget200Response", - '400': "ErrorResponse", - '401': "ErrorResponse", - '404': "ErrorResponse", - } - 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 summarize_campaign_store_budget_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - _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 summary of campaign store budgets - - Fetch a summary of all store budget information for a given campaign. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param _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._summarize_campaign_store_budget_serialize( - application_id=application_id, - campaign_id=campaign_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SummarizeCampaignStoreBudget200Response", - '400': "ErrorResponse", - '401': "ErrorResponse", - '404': "ErrorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _summarize_campaign_store_budget_serialize( - self, - application_id, - campaign_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/stores/budgets/summary', - 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 transfer_loyalty_card( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - transfer_loyalty_card: Annotated[TransferLoyaltyCard, Field(description="body")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Transfer card data - - Transfer loyalty card data, such as linked customers, loyalty balances and transactions, from a given loyalty card to a new, automatically created loyalty card. **Important:** - The original card is automatically blocked once the new card is created, and it cannot be activated again. - The default status of the new card is _active_. - - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param transfer_loyalty_card: body (required) - :type transfer_loyalty_card: TransferLoyaltyCard - :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._transfer_loyalty_card_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - transfer_loyalty_card=transfer_loyalty_card, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def transfer_loyalty_card_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - transfer_loyalty_card: Annotated[TransferLoyaltyCard, Field(description="body")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Transfer card data - - Transfer loyalty card data, such as linked customers, loyalty balances and transactions, from a given loyalty card to a new, automatically created loyalty card. **Important:** - The original card is automatically blocked once the new card is created, and it cannot be activated again. - The default status of the new card is _active_. - - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param transfer_loyalty_card: body (required) - :type transfer_loyalty_card: TransferLoyaltyCard - :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._transfer_loyalty_card_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - transfer_loyalty_card=transfer_loyalty_card, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def transfer_loyalty_card_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - transfer_loyalty_card: Annotated[TransferLoyaltyCard, Field(description="body")], - _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: - """Transfer card data - - Transfer loyalty card data, such as linked customers, loyalty balances and transactions, from a given loyalty card to a new, automatically created loyalty card. **Important:** - The original card is automatically blocked once the new card is created, and it cannot be activated again. - The default status of the new card is _active_. - - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param transfer_loyalty_card: body (required) - :type transfer_loyalty_card: TransferLoyaltyCard - :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._transfer_loyalty_card_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - transfer_loyalty_card=transfer_loyalty_card, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _transfer_loyalty_card_serialize( - self, - loyalty_program_id, - loyalty_card_id, - transfer_loyalty_card, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - if loyalty_card_id is not None: - _path_params['loyaltyCardId'] = loyalty_card_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if transfer_loyalty_card is not None: - _body_params = transfer_loyalty_card - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/transfer', - 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 update_account_collection( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - update_collection: Annotated[UpdateCollection, Field(description="body")], - _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, - ) -> Collection: - """Update account-level collection - - Edit the description of a given account-level collection and enable or disable the collection in the specified Applications. - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param update_collection: body (required) - :type update_collection: UpdateCollection - :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._update_account_collection_serialize( - collection_id=collection_id, - update_collection=update_collection, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Collection", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '409': "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 update_account_collection_with_http_info( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - update_collection: Annotated[UpdateCollection, Field(description="body")], - _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[Collection]: - """Update account-level collection - - Edit the description of a given account-level collection and enable or disable the collection in the specified Applications. - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param update_collection: body (required) - :type update_collection: UpdateCollection - :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._update_account_collection_serialize( - collection_id=collection_id, - update_collection=update_collection, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Collection", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '409': "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 update_account_collection_without_preload_content( - self, - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint.")], - update_collection: Annotated[UpdateCollection, Field(description="body")], - _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: - """Update account-level collection - - Edit the description of a given account-level collection and enable or disable the collection in the specified Applications. - - :param collection_id: The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - :type collection_id: int - :param update_collection: body (required) - :type update_collection: UpdateCollection - :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._update_account_collection_serialize( - collection_id=collection_id, - update_collection=update_collection, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Collection", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '409': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _update_account_collection_serialize( - self, - collection_id, - update_collection, - _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 collection_id is not None: - _path_params['collectionId'] = collection_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if update_collection is not None: - _body_params = update_collection - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/collections/{collectionId}', - 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 update_achievement( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - achievement_id: Annotated[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/listAchievements) endpoint.")], - update_achievement: Annotated[UpdateAchievement, Field(description="body")], - _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, - ) -> Achievement: - """Update achievement - - Update the details of a specific achievement. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param achievement_id: The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) - :type achievement_id: int - :param update_achievement: body (required) - :type update_achievement: UpdateAchievement - :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._update_achievement_serialize( - application_id=application_id, - campaign_id=campaign_id, - achievement_id=achievement_id, - update_achievement=update_achievement, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Achievement", - '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 update_achievement_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - achievement_id: Annotated[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/listAchievements) endpoint.")], - update_achievement: Annotated[UpdateAchievement, Field(description="body")], - _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[Achievement]: - """Update achievement - - Update the details of a specific achievement. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param achievement_id: The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) - :type achievement_id: int - :param update_achievement: body (required) - :type update_achievement: UpdateAchievement - :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._update_achievement_serialize( - application_id=application_id, - campaign_id=campaign_id, - achievement_id=achievement_id, - update_achievement=update_achievement, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Achievement", - '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 update_achievement_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - achievement_id: Annotated[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/listAchievements) endpoint.")], - update_achievement: Annotated[UpdateAchievement, Field(description="body")], - _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: - """Update achievement - - Update the details of a specific achievement. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param achievement_id: The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) - :type achievement_id: int - :param update_achievement: body (required) - :type update_achievement: UpdateAchievement - :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._update_achievement_serialize( - application_id=application_id, - campaign_id=campaign_id, - achievement_id=achievement_id, - update_achievement=update_achievement, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Achievement", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _update_achievement_serialize( - self, - application_id, - campaign_id, - achievement_id, - update_achievement, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - if achievement_id is not None: - _path_params['achievementId'] = achievement_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if update_achievement is not None: - _body_params = update_achievement - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}', - 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 update_additional_cost( - self, - additional_cost_id: Annotated[StrictInt, Field(description="The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. ")], - new_additional_cost: Annotated[NewAdditionalCost, Field(description="body")], - _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, - ) -> AccountAdditionalCost: - """Update additional cost - - Updates an existing additional cost. Once created, the only property of an additional cost that cannot be changed is the `name` property (or **API name** in the Campaign Manager). This restriction is in place to prevent accidentally breaking live integrations. - - :param additional_cost_id: The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. (required) - :type additional_cost_id: int - :param new_additional_cost: body (required) - :type new_additional_cost: NewAdditionalCost - :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._update_additional_cost_serialize( - additional_cost_id=additional_cost_id, - new_additional_cost=new_additional_cost, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "AccountAdditionalCost", - } - 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 update_additional_cost_with_http_info( - self, - additional_cost_id: Annotated[StrictInt, Field(description="The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. ")], - new_additional_cost: Annotated[NewAdditionalCost, Field(description="body")], - _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[AccountAdditionalCost]: - """Update additional cost - - Updates an existing additional cost. Once created, the only property of an additional cost that cannot be changed is the `name` property (or **API name** in the Campaign Manager). This restriction is in place to prevent accidentally breaking live integrations. - - :param additional_cost_id: The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. (required) - :type additional_cost_id: int - :param new_additional_cost: body (required) - :type new_additional_cost: NewAdditionalCost - :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._update_additional_cost_serialize( - additional_cost_id=additional_cost_id, - new_additional_cost=new_additional_cost, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "AccountAdditionalCost", - } - 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 update_additional_cost_without_preload_content( - self, - additional_cost_id: Annotated[StrictInt, Field(description="The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. ")], - new_additional_cost: Annotated[NewAdditionalCost, Field(description="body")], - _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: - """Update additional cost - - Updates an existing additional cost. Once created, the only property of an additional cost that cannot be changed is the `name` property (or **API name** in the Campaign Manager). This restriction is in place to prevent accidentally breaking live integrations. - - :param additional_cost_id: The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. (required) - :type additional_cost_id: int - :param new_additional_cost: body (required) - :type new_additional_cost: NewAdditionalCost - :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._update_additional_cost_serialize( - additional_cost_id=additional_cost_id, - new_additional_cost=new_additional_cost, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "AccountAdditionalCost", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _update_additional_cost_serialize( - self, - additional_cost_id, - new_additional_cost, - _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 additional_cost_id is not None: - _path_params['additionalCostId'] = additional_cost_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if new_additional_cost is not None: - _body_params = new_additional_cost - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/additional_costs/{additionalCostId}', - 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 update_attribute( - self, - attribute_id: Annotated[StrictInt, Field(description="The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**.")], - new_attribute: Annotated[NewAttribute, Field(description="body")], - _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, - ) -> Attribute: - """Update custom attribute - - Update an existing custom attribute. Once created, the only property of a custom attribute that can be changed is the description. To change the `type` or `name` property of a custom attribute, create a new attribute and update any relevant integrations and rules to use the new attribute. - - :param attribute_id: The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - :type attribute_id: int - :param new_attribute: body (required) - :type new_attribute: NewAttribute - :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._update_attribute_serialize( - attribute_id=attribute_id, - new_attribute=new_attribute, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Attribute", - } - 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 update_attribute_with_http_info( - self, - attribute_id: Annotated[StrictInt, Field(description="The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**.")], - new_attribute: Annotated[NewAttribute, Field(description="body")], - _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[Attribute]: - """Update custom attribute - - Update an existing custom attribute. Once created, the only property of a custom attribute that can be changed is the description. To change the `type` or `name` property of a custom attribute, create a new attribute and update any relevant integrations and rules to use the new attribute. - - :param attribute_id: The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - :type attribute_id: int - :param new_attribute: body (required) - :type new_attribute: NewAttribute - :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._update_attribute_serialize( - attribute_id=attribute_id, - new_attribute=new_attribute, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Attribute", - } - 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 update_attribute_without_preload_content( - self, - attribute_id: Annotated[StrictInt, Field(description="The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**.")], - new_attribute: Annotated[NewAttribute, Field(description="body")], - _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: - """Update custom attribute - - Update an existing custom attribute. Once created, the only property of a custom attribute that can be changed is the description. To change the `type` or `name` property of a custom attribute, create a new attribute and update any relevant integrations and rules to use the new attribute. - - :param attribute_id: The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - :type attribute_id: int - :param new_attribute: body (required) - :type new_attribute: NewAttribute - :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._update_attribute_serialize( - attribute_id=attribute_id, - new_attribute=new_attribute, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Attribute", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _update_attribute_serialize( - self, - attribute_id, - new_attribute, - _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 attribute_id is not None: - _path_params['attributeId'] = attribute_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if new_attribute is not None: - _body_params = new_attribute - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/attributes/{attributeId}', - 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 update_campaign( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - update_campaign: Annotated[UpdateCampaign, Field(description="body")], - _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, - ) -> Campaign: - """Update campaign - - Update the given campaign. **Important:** You cannot use this endpoint to update campaigns if [campaign staging and revisions](https://docs.talon.one/docs/product/applications/managing-general-settings#campaign-staging-and-revisions) is enabled for your Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param update_campaign: body (required) - :type update_campaign: UpdateCampaign - :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._update_campaign_serialize( - application_id=application_id, - campaign_id=campaign_id, - update_campaign=update_campaign, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Campaign", - } - 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 update_campaign_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - update_campaign: Annotated[UpdateCampaign, Field(description="body")], - _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[Campaign]: - """Update campaign - - Update the given campaign. **Important:** You cannot use this endpoint to update campaigns if [campaign staging and revisions](https://docs.talon.one/docs/product/applications/managing-general-settings#campaign-staging-and-revisions) is enabled for your Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param update_campaign: body (required) - :type update_campaign: UpdateCampaign - :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._update_campaign_serialize( - application_id=application_id, - campaign_id=campaign_id, - update_campaign=update_campaign, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Campaign", - } - 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 update_campaign_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - update_campaign: Annotated[UpdateCampaign, Field(description="body")], - _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: - """Update campaign - - Update the given campaign. **Important:** You cannot use this endpoint to update campaigns if [campaign staging and revisions](https://docs.talon.one/docs/product/applications/managing-general-settings#campaign-staging-and-revisions) is enabled for your Application. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param update_campaign: body (required) - :type update_campaign: UpdateCampaign - :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._update_campaign_serialize( - application_id=application_id, - campaign_id=campaign_id, - update_campaign=update_campaign, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Campaign", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _update_campaign_serialize( - self, - application_id, - campaign_id, - update_campaign, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if update_campaign is not None: - _body_params = update_campaign - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}', - 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 update_collection( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint.")], - update_campaign_collection: Annotated[UpdateCampaignCollection, Field(description="body")], - _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, - ) -> Collection: - """Update campaign-level collection's description - - Edit the description of a given campaign-level collection. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param collection_id: The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - :type collection_id: int - :param update_campaign_collection: body (required) - :type update_campaign_collection: UpdateCampaignCollection - :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._update_collection_serialize( - application_id=application_id, - campaign_id=campaign_id, - collection_id=collection_id, - update_campaign_collection=update_campaign_collection, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Collection", - '401': "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 update_collection_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint.")], - update_campaign_collection: Annotated[UpdateCampaignCollection, Field(description="body")], - _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[Collection]: - """Update campaign-level collection's description - - Edit the description of a given campaign-level collection. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param collection_id: The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - :type collection_id: int - :param update_campaign_collection: body (required) - :type update_campaign_collection: UpdateCampaignCollection - :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._update_collection_serialize( - application_id=application_id, - campaign_id=campaign_id, - collection_id=collection_id, - update_campaign_collection=update_campaign_collection, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Collection", - '401': "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 update_collection_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - collection_id: Annotated[StrictInt, Field(description="The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint.")], - update_campaign_collection: Annotated[UpdateCampaignCollection, Field(description="body")], - _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: - """Update campaign-level collection's description - - Edit the description of a given campaign-level collection. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param collection_id: The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - :type collection_id: int - :param update_campaign_collection: body (required) - :type update_campaign_collection: UpdateCampaignCollection - :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._update_collection_serialize( - application_id=application_id, - campaign_id=campaign_id, - collection_id=collection_id, - update_campaign_collection=update_campaign_collection, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Collection", - '401': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _update_collection_serialize( - self, - application_id, - campaign_id, - collection_id, - update_campaign_collection, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - if collection_id is not None: - _path_params['collectionId'] = collection_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if update_campaign_collection is not None: - _body_params = update_campaign_collection - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}', - 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 update_coupon( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - coupon_id: Annotated[StrictStr, Field(description="The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. ")], - update_coupon: Annotated[UpdateCoupon, Field(description="body")], - _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, - ) -> Coupon: - """Update coupon - - Update the specified coupon.

Important

With this PUT endpoint, if you do not explicitly set a value for the startDate, expiryDate, and recipientIntegrationId properties in your request, it is automatically set to null.

- - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param coupon_id: The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. (required) - :type coupon_id: str - :param update_coupon: body (required) - :type update_coupon: UpdateCoupon - :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._update_coupon_serialize( - application_id=application_id, - campaign_id=campaign_id, - coupon_id=coupon_id, - update_coupon=update_coupon, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Coupon", - } - 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 update_coupon_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - coupon_id: Annotated[StrictStr, Field(description="The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. ")], - update_coupon: Annotated[UpdateCoupon, Field(description="body")], - _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[Coupon]: - """Update coupon - - Update the specified coupon.

Important

With this PUT endpoint, if you do not explicitly set a value for the startDate, expiryDate, and recipientIntegrationId properties in your request, it is automatically set to null.

- - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param coupon_id: The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. (required) - :type coupon_id: str - :param update_coupon: body (required) - :type update_coupon: UpdateCoupon - :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._update_coupon_serialize( - application_id=application_id, - campaign_id=campaign_id, - coupon_id=coupon_id, - update_coupon=update_coupon, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Coupon", - } - 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 update_coupon_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - coupon_id: Annotated[StrictStr, Field(description="The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. ")], - update_coupon: Annotated[UpdateCoupon, Field(description="body")], - _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: - """Update coupon - - Update the specified coupon.

Important

With this PUT endpoint, if you do not explicitly set a value for the startDate, expiryDate, and recipientIntegrationId properties in your request, it is automatically set to null.

- - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param coupon_id: The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. (required) - :type coupon_id: str - :param update_coupon: body (required) - :type update_coupon: UpdateCoupon - :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._update_coupon_serialize( - application_id=application_id, - campaign_id=campaign_id, - coupon_id=coupon_id, - update_coupon=update_coupon, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Coupon", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _update_coupon_serialize( - self, - application_id, - campaign_id, - coupon_id, - update_coupon, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - if coupon_id is not None: - _path_params['couponId'] = coupon_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if update_coupon is not None: - _body_params = update_coupon - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId}', - 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 update_coupon_batch( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - update_coupon_batch: Annotated[UpdateCouponBatch, Field(description="body")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Update coupons - - Update all coupons or a specific batch of coupons in the given campaign. You can find the `batchId` on the **Coupons** page of your campaign in the Campaign Manager, or you can use [List coupons](#operation/getCouponsWithoutTotalCount).

Important

To update a specific coupon, use [Update coupon](#operation/updateCoupon). - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param update_coupon_batch: body (required) - :type update_coupon_batch: UpdateCouponBatch - :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._update_coupon_batch_serialize( - application_id=application_id, - campaign_id=campaign_id, - update_coupon_batch=update_coupon_batch, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 update_coupon_batch_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - update_coupon_batch: Annotated[UpdateCouponBatch, Field(description="body")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Update coupons - - Update all coupons or a specific batch of coupons in the given campaign. You can find the `batchId` on the **Coupons** page of your campaign in the Campaign Manager, or you can use [List coupons](#operation/getCouponsWithoutTotalCount).

Important

To update a specific coupon, use [Update coupon](#operation/updateCoupon). - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param update_coupon_batch: body (required) - :type update_coupon_batch: UpdateCouponBatch - :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._update_coupon_batch_serialize( - application_id=application_id, - campaign_id=campaign_id, - update_coupon_batch=update_coupon_batch, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - 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 update_coupon_batch_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - update_coupon_batch: Annotated[UpdateCouponBatch, Field(description="body")], - _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: - """Update coupons - - Update all coupons or a specific batch of coupons in the given campaign. You can find the `batchId` on the **Coupons** page of your campaign in the Campaign Manager, or you can use [List coupons](#operation/getCouponsWithoutTotalCount).

Important

To update a specific coupon, use [Update coupon](#operation/updateCoupon). - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param update_coupon_batch: body (required) - :type update_coupon_batch: UpdateCouponBatch - :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._update_coupon_batch_serialize( - application_id=application_id, - campaign_id=campaign_id, - update_coupon_batch=update_coupon_batch, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _update_coupon_batch_serialize( - self, - application_id, - campaign_id, - update_coupon_batch, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if update_coupon_batch is not None: - _body_params = update_coupon_batch - - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/coupons', - 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 update_loyalty_card( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - update_loyalty_card_request: Annotated[UpdateLoyaltyCardRequest, Field(description="body")], - _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, - ) -> LoyaltyCard: - """Update loyalty card - - Update the details of a specific loyalty card. You can set the card's status to `active` or `inactive` through this endpoint. At least one of `status` or `attributes` must be provided. - - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param update_loyalty_card_request: body (required) - :type update_loyalty_card_request: UpdateLoyaltyCardRequest - :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._update_loyalty_card_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - update_loyalty_card_request=update_loyalty_card_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCard", - '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 update_loyalty_card_with_http_info( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - update_loyalty_card_request: Annotated[UpdateLoyaltyCardRequest, Field(description="body")], - _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[LoyaltyCard]: - """Update loyalty card - - Update the details of a specific loyalty card. You can set the card's status to `active` or `inactive` through this endpoint. At least one of `status` or `attributes` must be provided. - - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param update_loyalty_card_request: body (required) - :type update_loyalty_card_request: UpdateLoyaltyCardRequest - :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._update_loyalty_card_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - update_loyalty_card_request=update_loyalty_card_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCard", - '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 update_loyalty_card_without_preload_content( - self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - update_loyalty_card_request: Annotated[UpdateLoyaltyCardRequest, Field(description="body")], - _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: - """Update loyalty card - - Update the details of a specific loyalty card. You can set the card's status to `active` or `inactive` through this endpoint. At least one of `status` or `attributes` must be provided. - - :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 - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param update_loyalty_card_request: body (required) - :type update_loyalty_card_request: UpdateLoyaltyCardRequest - :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._update_loyalty_card_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - update_loyalty_card_request=update_loyalty_card_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCard", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _update_loyalty_card_serialize( - self, - loyalty_program_id, - loyalty_card_id, - update_loyalty_card_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - if loyalty_card_id is not None: - _path_params['loyaltyCardId'] = loyalty_card_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if update_loyalty_card_request is not None: - _body_params = update_loyalty_card_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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}', - 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 update_referral( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - referral_id: Annotated[StrictStr, Field(description="The ID of the referral code.")], - update_referral: Annotated[UpdateReferral, Field(description="body")], - _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, - ) -> Referral: - """Update referral - - Update the specified referral. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param referral_id: The ID of the referral code. (required) - :type referral_id: str - :param update_referral: body (required) - :type update_referral: UpdateReferral - :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._update_referral_serialize( - application_id=application_id, - campaign_id=campaign_id, - referral_id=referral_id, - update_referral=update_referral, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Referral", - } - 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 update_referral_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - referral_id: Annotated[StrictStr, Field(description="The ID of the referral code.")], - update_referral: Annotated[UpdateReferral, Field(description="body")], - _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[Referral]: - """Update referral - - Update the specified referral. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param referral_id: The ID of the referral code. (required) - :type referral_id: str - :param update_referral: body (required) - :type update_referral: UpdateReferral - :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._update_referral_serialize( - application_id=application_id, - campaign_id=campaign_id, - referral_id=referral_id, - update_referral=update_referral, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Referral", - } - 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 update_referral_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - campaign_id: Annotated[StrictInt, Field(description="The ID of the campaign. It is displayed in your Talon.One deployment URL.")], - referral_id: Annotated[StrictStr, Field(description="The ID of the referral code.")], - update_referral: Annotated[UpdateReferral, Field(description="body")], - _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: - """Update referral - - Update the specified referral. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param campaign_id: The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - :type campaign_id: int - :param referral_id: The ID of the referral code. (required) - :type referral_id: str - :param update_referral: body (required) - :type update_referral: UpdateReferral - :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._update_referral_serialize( - application_id=application_id, - campaign_id=campaign_id, - referral_id=referral_id, - update_referral=update_referral, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Referral", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _update_referral_serialize( - self, - application_id, - campaign_id, - referral_id, - update_referral, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if campaign_id is not None: - _path_params['campaignId'] = campaign_id - if referral_id is not None: - _path_params['referralId'] = referral_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if update_referral is not None: - _body_params = update_referral - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId}', - 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 update_role_v2( - self, - role_id: Annotated[StrictInt, Field(description="The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. ")], - role_v2_base: Annotated[RoleV2Base, Field(description="body")], - _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, - ) -> RoleV2: - """Update role - - Update a specific role. - - :param role_id: The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) - :type role_id: int - :param role_v2_base: body (required) - :type role_v2_base: RoleV2Base - :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._update_role_v2_serialize( - role_id=role_id, - role_v2_base=role_v2_base, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RoleV2", - } - 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 update_role_v2_with_http_info( - self, - role_id: Annotated[StrictInt, Field(description="The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. ")], - role_v2_base: Annotated[RoleV2Base, Field(description="body")], - _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[RoleV2]: - """Update role - - Update a specific role. - - :param role_id: The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) - :type role_id: int - :param role_v2_base: body (required) - :type role_v2_base: RoleV2Base - :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._update_role_v2_serialize( - role_id=role_id, - role_v2_base=role_v2_base, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RoleV2", - } - 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 update_role_v2_without_preload_content( - self, - role_id: Annotated[StrictInt, Field(description="The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. ")], - role_v2_base: Annotated[RoleV2Base, Field(description="body")], - _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: - """Update role - - Update a specific role. - - :param role_id: The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) - :type role_id: int - :param role_v2_base: body (required) - :type role_v2_base: RoleV2Base - :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._update_role_v2_serialize( - role_id=role_id, - role_v2_base=role_v2_base, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RoleV2", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _update_role_v2_serialize( - self, - role_id, - role_v2_base, - _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 role_id is not None: - _path_params['roleId'] = role_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if role_v2_base is not None: - _body_params = role_v2_base - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v2/roles/{roleId}', - 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 update_store( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - store_id: Annotated[StrictStr, Field(description="The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. ")], - new_store: Annotated[NewStore, Field(description="body")], - _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, - ) -> Store: - """Update store - - Update store details for a specific store ID. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param store_id: The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) - :type store_id: str - :param new_store: body (required) - :type new_store: NewStore - :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._update_store_serialize( - application_id=application_id, - store_id=store_id, - new_store=new_store, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Store", - '400': "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 update_store_with_http_info( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - store_id: Annotated[StrictStr, Field(description="The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. ")], - new_store: Annotated[NewStore, Field(description="body")], - _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[Store]: - """Update store - - Update store details for a specific store ID. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param store_id: The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) - :type store_id: str - :param new_store: body (required) - :type new_store: NewStore - :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._update_store_serialize( - application_id=application_id, - store_id=store_id, - new_store=new_store, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Store", - '400': "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 update_store_without_preload_content( - self, - application_id: Annotated[StrictInt, Field(description="The ID of the Application. It is displayed in your Talon.One deployment URL.")], - store_id: Annotated[StrictStr, Field(description="The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. ")], - new_store: Annotated[NewStore, Field(description="body")], - _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: - """Update store - - Update store details for a specific store ID. - - :param application_id: The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - :type application_id: int - :param store_id: The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) - :type store_id: str - :param new_store: body (required) - :type new_store: NewStore - :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._update_store_serialize( - application_id=application_id, - store_id=store_id, - new_store=new_store, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Store", - '400': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _update_store_serialize( - self, - application_id, - store_id, - new_store, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if application_id is not None: - _path_params['applicationId'] = application_id - if store_id is not None: - _path_params['storeId'] = store_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if new_store is not None: - _body_params = new_store - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/applications/{applicationId}/stores/{storeId}', - 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 update_user( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - update_user: Annotated[UpdateUser, Field(description="body")], - _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, - ) -> User: - """Update user - - Update the details of a specific user. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param update_user: body (required) - :type update_user: UpdateUser - :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._update_user_serialize( - user_id=user_id, - update_user=update_user, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - } - 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 update_user_with_http_info( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - update_user: Annotated[UpdateUser, Field(description="body")], - _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[User]: - """Update user - - Update the details of a specific user. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param update_user: body (required) - :type update_user: UpdateUser - :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._update_user_serialize( - user_id=user_id, - update_user=update_user, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - } - 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 update_user_without_preload_content( - self, - user_id: Annotated[StrictInt, Field(description="The ID of the user.")], - update_user: Annotated[UpdateUser, Field(description="body")], - _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: - """Update user - - Update the details of a specific user. - - :param user_id: The ID of the user. (required) - :type user_id: int - :param update_user: body (required) - :type update_user: UpdateUser - :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._update_user_serialize( - user_id=user_id, - update_user=update_user, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _update_user_serialize( - self, - user_id, - update_user, - _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 user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if update_user is not None: - _body_params = update_user - - - # 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] = [ - 'management_key', - 'manager_auth', - 'api_key_v1' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/users/{userId}', + resource_path='/LoyaltyTierUpgradeEvent', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/talon_one/api_client.py b/talon_one/api_client.py index c246789..f92eeda 100644 --- a/talon_one/api_client.py +++ b/talon_one/api_client.py @@ -90,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/26.04/python' + self.user_agent = 'OpenAPI-Generator/26.05/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 9cb7706..7fd7ed6 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.04".\ + "SDK Package Version: 26.05".\ 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 b89ce59..10bca62 100644 --- a/talon_one/models/__init__.py +++ b/talon_one/models/__init__.py @@ -175,7 +175,9 @@ from talon_one.models.coupon import Coupon from talon_one.models.coupon_constraints import CouponConstraints from talon_one.models.coupon_created_effect_props import CouponCreatedEffectProps +from talon_one.models.coupon_created_event_request import CouponCreatedEventRequest from talon_one.models.coupon_creation_job import CouponCreationJob +from talon_one.models.coupon_deleted_event_request import CouponDeletedEventRequest from talon_one.models.coupon_deletion_filters import CouponDeletionFilters from talon_one.models.coupon_deletion_job import CouponDeletionJob from talon_one.models.coupon_entity import CouponEntity @@ -184,6 +186,7 @@ from talon_one.models.coupon_rejection_reason import CouponRejectionReason from talon_one.models.coupon_reservations import CouponReservations from talon_one.models.coupon_search import CouponSearch +from talon_one.models.coupon_updated_event_request import CouponUpdatedEventRequest from talon_one.models.coupon_value import CouponValue from talon_one.models.coupon_with_application import CouponWithApplication from talon_one.models.coupons_notification_data import CouponsNotificationData @@ -235,6 +238,9 @@ from talon_one.models.event_v2 import EventV2 from talon_one.models.event_v3 import EventV3 from talon_one.models.experiment import Experiment +from talon_one.models.experiment_campaign_copy import ExperimentCampaignCopy +from talon_one.models.experiment_copy import ExperimentCopy +from talon_one.models.experiment_copy_experiment import ExperimentCopyExperiment from talon_one.models.experiment_results import ExperimentResults from talon_one.models.experiment_variant import ExperimentVariant from talon_one.models.experiment_variant_allocation import ExperimentVariantAllocation @@ -315,6 +321,7 @@ from talon_one.models.giveaway import Giveaway from talon_one.models.giveaways_pool import GiveawaysPool from talon_one.models.hidden_conditions_effects import HiddenConditionsEffects +from talon_one.models.history import History from talon_one.models.identifiable_entity import IdentifiableEntity from talon_one.models.import_entity import ImportEntity from talon_one.models.increase_achievement_progress_effect_props import IncreaseAchievementProgressEffectProps @@ -329,6 +336,21 @@ 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_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_flow import IntegrationHubFlow +from talon_one.models.integration_hub_flow_config import IntegrationHubFlowConfig +from talon_one.models.integration_hub_flow_config_response import IntegrationHubFlowConfigResponse +from talon_one.models.integration_hub_flow_response import IntegrationHubFlowResponse +from talon_one.models.integration_hub_flow_with_config import IntegrationHubFlowWithConfig +from talon_one.models.integration_hub_paginated_event_payload import IntegrationHubPaginatedEventPayload from talon_one.models.integration_profile_entity import IntegrationProfileEntity from talon_one.models.integration_profile_entity_v3 import IntegrationProfileEntityV3 from talon_one.models.integration_request import IntegrationRequest @@ -355,6 +377,7 @@ from talon_one.models.list_campaign_store_budgets import ListCampaignStoreBudgets from talon_one.models.list_campaign_store_budgets_store import ListCampaignStoreBudgetsStore from talon_one.models.list_catalog_items200_response import ListCatalogItems200Response +from talon_one.models.list_experiments200_response import ListExperiments200Response from talon_one.models.list_stores200_response import ListStores200Response from talon_one.models.login_params import LoginParams from talon_one.models.loyalty import Loyalty @@ -376,6 +399,7 @@ from talon_one.models.loyalty_ledger_entry_flags import LoyaltyLedgerEntryFlags from talon_one.models.loyalty_ledger_transactions import LoyaltyLedgerTransactions from talon_one.models.loyalty_membership import LoyaltyMembership +from talon_one.models.loyalty_points_changed_event_request import LoyaltyPointsChangedEventRequest from talon_one.models.loyalty_program import LoyaltyProgram from talon_one.models.loyalty_program_balance import LoyaltyProgramBalance from talon_one.models.loyalty_program_entity import LoyaltyProgramEntity @@ -383,6 +407,8 @@ from talon_one.models.loyalty_program_transaction import LoyaltyProgramTransaction from talon_one.models.loyalty_sub_ledger import LoyaltySubLedger from talon_one.models.loyalty_tier import LoyaltyTier +from talon_one.models.loyalty_tier_downgrade_event_request import LoyaltyTierDowngradeEventRequest +from talon_one.models.loyalty_tier_upgrade_event_request import LoyaltyTierUpgradeEventRequest from talon_one.models.management_key import ManagementKey from talon_one.models.manager_config import ManagerConfig from talon_one.models.message_log_entries import MessageLogEntries @@ -494,24 +520,11 @@ from talon_one.models.picklist import Picklist from talon_one.models.placeholder_details import PlaceholderDetails from talon_one.models.price_detail import PriceDetail +from talon_one.models.price_history_request import PriceHistoryRequest +from talon_one.models.price_history_response import PriceHistoryResponse from talon_one.models.price_type import PriceType from talon_one.models.price_type_reference_detail import PriceTypeReferenceDetail from talon_one.models.price_type_references import PriceTypeReferences -from talon_one.models.prismatic_config import PrismaticConfig -from talon_one.models.prismatic_event_payload_coupon_based_notifications import PrismaticEventPayloadCouponBasedNotifications -from talon_one.models.prismatic_event_payload_coupon_based_notifications_limits import PrismaticEventPayloadCouponBasedNotificationsLimits -from talon_one.models.prismatic_event_payload_loyalty_profile_based_notification import PrismaticEventPayloadLoyaltyProfileBasedNotification -from talon_one.models.prismatic_event_payload_loyalty_profile_based_points_changed_notification import PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification -from talon_one.models.prismatic_event_payload_loyalty_profile_based_points_changed_notification_action import PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction -from talon_one.models.prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification import PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification -from talon_one.models.prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification import PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification -from talon_one.models.prismatic_event_record import PrismaticEventRecord -from talon_one.models.prismatic_flow import PrismaticFlow -from talon_one.models.prismatic_flow_config import PrismaticFlowConfig -from talon_one.models.prismatic_flow_config_response import PrismaticFlowConfigResponse -from talon_one.models.prismatic_flow_response import PrismaticFlowResponse -from talon_one.models.prismatic_flow_with_config import PrismaticFlowWithConfig -from talon_one.models.prismatic_paginated_event_payload import PrismaticPaginatedEventPayload from talon_one.models.product import Product from talon_one.models.product_search_match import ProductSearchMatch from talon_one.models.product_unit_analytics import ProductUnitAnalytics @@ -519,6 +532,7 @@ from talon_one.models.product_unit_analytics_totals import ProductUnitAnalyticsTotals from talon_one.models.profile_audiences_changes import ProfileAudiencesChanges from talon_one.models.projected_tier import ProjectedTier +from talon_one.models.promote_experiment import PromoteExperiment from talon_one.models.redeem_referral_effect_props import RedeemReferralEffectProps from talon_one.models.referral import Referral from talon_one.models.referral_constraints import ReferralConstraints diff --git a/talon_one/models/best_prior_price.py b/talon_one/models/best_prior_price.py index 12c5fc0..61bce31 100644 --- a/talon_one/models/best_prior_price.py +++ b/talon_one/models/best_prior_price.py @@ -28,13 +28,14 @@ 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 best price was observed.", alias="observedAt") + observed_at: datetime = Field(description="The date and time when the price was observed.", alias="observedAt") context_id: StrictStr = Field(description="The context ID of the context active at the time of observation. ", alias="contextId") price: Union[StrictFloat, StrictInt] = Field(description="Price of the item.") metadata: BestPriorPriceMetadata target: Dict[str, Any] - __properties: ClassVar[List[str]] = ["sku", "observedAt", "contextId", "price", "metadata", "target"] + __properties: ClassVar[List[str]] = ["id", "sku", "observedAt", "contextId", "price", "metadata", "target"] model_config = ConfigDict( populate_by_name=True, @@ -90,6 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "id": obj.get("id"), "sku": obj.get("sku"), "observedAt": obj.get("observedAt"), "contextId": obj.get("contextId"), diff --git a/talon_one/models/best_prior_price_request.py b/talon_one/models/best_prior_price_request.py index 0cd754c..121f74c 100644 --- a/talon_one/models/best_prior_price_request.py +++ b/talon_one/models/best_prior_price_request.py @@ -18,7 +18,7 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from talon_one.models.best_prior_target import BestPriorTarget @@ -32,9 +32,20 @@ class BestPriorPriceRequest(BaseModel): 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.") - strict_end_date: StrictBool = Field(description="Indicates whether the timeframe includes the start of the current sale. - When `false`, the timeframe includes the start date of the current sale. - When `true`, the timeframe striclty uses the number of days specified in `timeframe`. ", alias="strictEndDate") + strict_end_date: StrictBool = Field(description="This property is **deprecated**. Use `timeframeEndDateType` instead. Indicates whether the timeframe includes the start of the current sale. - When `false`, the timeframe includes the start date of the current sale. - When `true`, the timeframe strictly uses the number of days specified in `timeframe`. ", alias="strictEndDate") + timeframe_end_date_type: Optional[StrictStr] = Field(default=None, 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 the current `contextId` with the current price value. Identical price records are merged. If there is no `contextId` for the most recent price, the most recent timestamp for the price is used. - `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") target: Optional[BestPriorTarget] = None - __properties: ClassVar[List[str]] = ["skus", "timeframeEndDate", "timeframe", "strictEndDate", "target"] + __properties: ClassVar[List[str]] = ["skus", "timeframeEndDate", "timeframe", "strictEndDate", "timeframeEndDateType", "target"] + + @field_validator('timeframe_end_date_type') + def timeframe_end_date_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['strict', 'price', 'sale']): + raise ValueError("must be one of enum values ('strict', 'price', 'sale')") + return value model_config = ConfigDict( populate_by_name=True, @@ -94,6 +105,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "timeframeEndDate": obj.get("timeframeEndDate"), "timeframe": obj.get("timeframe"), "strictEndDate": obj.get("strictEndDate"), + "timeframeEndDateType": obj.get("timeframeEndDateType"), "target": BestPriorTarget.from_dict(obj["target"]) if obj.get("target") is not None else None }) return _obj diff --git a/talon_one/models/coupon_created_event_request.py b/talon_one/models/coupon_created_event_request.py new file mode 100644 index 0000000..16eac78 --- /dev/null +++ b/talon_one/models/coupon_created_event_request.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CouponCreatedEventRequest(BaseModel): + """ + CouponCreatedEventRequest + """ # 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") + 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(['CouponCreated']): + raise ValueError("must be one of enum values ('CouponCreated')") + return value + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CouponCreatedEventRequest 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 CouponCreatedEventRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "TotalResultSize": obj.get("TotalResultSize"), + "BatchedAt": obj.get("BatchedAt"), + "EventType": obj.get("EventType"), + "Data": obj.get("Data") + }) + return _obj + + diff --git a/talon_one/models/coupon_deleted_event_request.py b/talon_one/models/coupon_deleted_event_request.py new file mode 100644 index 0000000..04ccb25 --- /dev/null +++ b/talon_one/models/coupon_deleted_event_request.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CouponDeletedEventRequest(BaseModel): + """ + CouponDeletedEventRequest + """ # 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") + 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(['CouponDeleted']): + raise ValueError("must be one of enum values ('CouponDeleted')") + return value + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CouponDeletedEventRequest 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 CouponDeletedEventRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "TotalResultSize": obj.get("TotalResultSize"), + "BatchedAt": obj.get("BatchedAt"), + "EventType": obj.get("EventType"), + "Data": obj.get("Data") + }) + return _obj + + diff --git a/talon_one/models/coupon_updated_event_request.py b/talon_one/models/coupon_updated_event_request.py new file mode 100644 index 0000000..8a83d30 --- /dev/null +++ b/talon_one/models/coupon_updated_event_request.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CouponUpdatedEventRequest(BaseModel): + """ + CouponUpdatedEventRequest + """ # 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") + 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(['CouponUpdated']): + raise ValueError("must be one of enum values ('CouponUpdated')") + return value + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CouponUpdatedEventRequest 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 CouponUpdatedEventRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "TotalResultSize": obj.get("TotalResultSize"), + "BatchedAt": obj.get("BatchedAt"), + "EventType": obj.get("EventType"), + "Data": obj.get("Data") + }) + return _obj + + diff --git a/talon_one/models/experiment.py b/talon_one/models/experiment.py index baeb470..62ad364 100644 --- a/talon_one/models/experiment.py +++ b/talon_one/models/experiment.py @@ -32,10 +32,10 @@ class Experiment(BaseModel): 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") - is_variant_assignment_external: Optional[StrictBool] = Field(default=None, description="The source of the assignment. - false - The assignment to the variant is handled internally by the Talon.Oneandled internally by the Talon.One. - true - The assignment to the variant handled externally. ", alias="isVariantAssignmentExternal") + 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: Optional[StrictStr] = Field(default='disabled', 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. ") variants: Optional[List[ExperimentVariant]] = None 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", "deletedat"] @@ -43,11 +43,8 @@ class Experiment(BaseModel): @field_validator('state') def state_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - - if value not in set(['enabled', 'disabled']): - raise ValueError("must be one of enum values ('enabled', 'disabled')") + if value not in set(['enabled', 'disabled', 'archived']): + raise ValueError("must be one of enum values ('enabled', 'disabled', 'archived')") return value model_config = ConfigDict( diff --git a/talon_one/models/experiment_campaign_copy.py b/talon_one/models/experiment_campaign_copy.py new file mode 100644 index 0000000..3402c98 --- /dev/null +++ b/talon_one/models/experiment_campaign_copy.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +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") + __properties: ClassVar[List[str]] = ["name", "description", "startTime", "endTime", "tags", "evaluationGroupId"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExperimentCampaignCopy 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 ExperimentCampaignCopy from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "description": obj.get("description"), + "startTime": obj.get("startTime"), + "endTime": obj.get("endTime"), + "tags": obj.get("tags"), + "evaluationGroupId": obj.get("evaluationGroupId") + }) + return _obj + + diff --git a/talon_one/models/experiment_copy.py b/talon_one/models/experiment_copy.py new file mode 100644 index 0000000..e405bb2 --- /dev/null +++ b/talon_one/models/experiment_copy.py @@ -0,0 +1,93 @@ +# 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) are used 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#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from talon_one.models.experiment_copy_experiment import ExperimentCopyExperiment +from typing import Optional, Set +from typing_extensions import Self + +class ExperimentCopy(BaseModel): + """ + ExperimentCopy + """ # noqa: E501 + target_application_id: StrictInt = Field(description="The ID of the Application to copy the experiment. It is displayed in your Talon.One deployment URL. ", alias="targetApplicationId") + experiment: ExperimentCopyExperiment + __properties: ClassVar[List[str]] = ["targetApplicationId", "experiment"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExperimentCopy 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 experiment + if self.experiment: + _dict['experiment'] = self.experiment.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExperimentCopy from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "targetApplicationId": obj.get("targetApplicationId"), + "experiment": ExperimentCopyExperiment.from_dict(obj["experiment"]) if obj.get("experiment") is not None else None + }) + return _obj + + diff --git a/talon_one/models/experiment_copy_experiment.py b/talon_one/models/experiment_copy_experiment.py new file mode 100644 index 0000000..a2949fd --- /dev/null +++ b/talon_one/models/experiment_copy_experiment.py @@ -0,0 +1,93 @@ +# 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) are used 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#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List +from talon_one.models.experiment_campaign_copy import ExperimentCampaignCopy +from typing import Optional, Set +from typing_extensions import Self + +class ExperimentCopyExperiment(BaseModel): + """ + ExperimentCopyExperiment + """ # noqa: E501 + is_variant_assignment_external: StrictBool = Field(description="The source of the assignment. - false - The variant assignment is handled internally by Talon.One. - true - The variant assignment is handled externally. ", alias="isVariantAssignmentExternal") + campaign: ExperimentCampaignCopy + __properties: ClassVar[List[str]] = ["isVariantAssignmentExternal", "campaign"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExperimentCopyExperiment 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 campaign + if self.campaign: + _dict['campaign'] = self.campaign.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExperimentCopyExperiment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "isVariantAssignmentExternal": obj.get("isVariantAssignmentExternal"), + "campaign": ExperimentCampaignCopy.from_dict(obj["campaign"]) if obj.get("campaign") is not None else None + }) + return _obj + + diff --git a/talon_one/models/history.py b/talon_one/models/history.py new file mode 100644 index 0000000..57fa1a3 --- /dev/null +++ b/talon_one/models/history.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#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, Union +from talon_one.models.best_prior_price_metadata import BestPriorPriceMetadata +from typing import Optional, Set +from typing_extensions import Self + +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_id: StrictStr = Field(description="Identifier of the relevant context at the time the price was observed (e.g. summer sale). ", alias="contextId") + price: Union[StrictFloat, StrictInt] = Field(description="Price of the item.") + metadata: BestPriorPriceMetadata + target: Dict[str, Any] + __properties: ClassVar[List[str]] = ["id", "observedAt", "contextId", "price", "metadata", "target"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of History 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 metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of History from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "observedAt": obj.get("observedAt"), + "contextId": obj.get("contextId"), + "price": obj.get("price"), + "metadata": BestPriorPriceMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "target": obj.get("target") + }) + return _obj + + diff --git a/talon_one/models/prismatic_config.py b/talon_one/models/integration_hub_config.py similarity index 84% rename from talon_one/models/prismatic_config.py rename to talon_one/models/integration_hub_config.py index 704733d..928e714 100644 --- a/talon_one/models/prismatic_config.py +++ b/talon_one/models/integration_hub_config.py @@ -22,13 +22,13 @@ from typing import Optional, Set from typing_extensions import Self -class PrismaticConfig(BaseModel): +class IntegrationHubConfig(BaseModel): """ - Config used for accessing integrations in Prismatic + Config used for accessing integrations in IntegrationHub """ # noqa: E501 - prismatic_url: StrictStr = Field(description="The url used to integrate the Prismatic Marketplace.", alias="prismaticUrl") + 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") - __properties: ClassVar[List[str]] = ["prismaticUrl", "accessToken"] + __properties: ClassVar[List[str]] = ["integrationHubUrl", "accessToken"] model_config = ConfigDict( populate_by_name=True, @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PrismaticConfig from a JSON string""" + """Create an instance of IntegrationHubConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PrismaticConfig from a dict""" + """Create an instance of IntegrationHubConfig from a dict""" if obj is None: return None @@ -81,7 +81,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "prismaticUrl": obj.get("prismaticUrl"), + "integrationHubUrl": obj.get("integrationHubUrl"), "accessToken": obj.get("accessToken") }) return _obj diff --git a/talon_one/models/prismatic_event_payload_coupon_based_notifications.py b/talon_one/models/integration_hub_event_payload_coupon_based_notifications.py similarity index 88% rename from talon_one/models/prismatic_event_payload_coupon_based_notifications.py rename to talon_one/models/integration_hub_event_payload_coupon_based_notifications.py index 046962d..ac42446 100644 --- a/talon_one/models/prismatic_event_payload_coupon_based_notifications.py +++ b/talon_one/models/integration_hub_event_payload_coupon_based_notifications.py @@ -20,13 +20,13 @@ 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.prismatic_event_payload_coupon_based_notifications_limits import PrismaticEventPayloadCouponBasedNotificationsLimits +from talon_one.models.integration_hub_event_payload_coupon_based_notifications_limits import IntegrationHubEventPayloadCouponBasedNotificationsLimits from typing import Optional, Set from typing_extensions import Self -class PrismaticEventPayloadCouponBasedNotifications(BaseModel): +class IntegrationHubEventPayloadCouponBasedNotifications(BaseModel): """ - PrismaticEventPayloadCouponBasedNotifications + IntegrationHubEventPayloadCouponBasedNotifications """ # noqa: E501 id: StrictInt = Field(alias="Id") created: datetime = Field(alias="Created") @@ -45,7 +45,7 @@ class PrismaticEventPayloadCouponBasedNotifications(BaseModel): 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") - limits: Optional[List[PrismaticEventPayloadCouponBasedNotificationsLimits]] = Field(default=None, alias="Limits") + 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") employee_name: StrictStr = Field(alias="EmployeeName") @@ -69,7 +69,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PrismaticEventPayloadCouponBasedNotifications from a JSON string""" + """Create an instance of IntegrationHubEventPayloadCouponBasedNotifications from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -101,7 +101,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PrismaticEventPayloadCouponBasedNotifications from a dict""" + """Create an instance of IntegrationHubEventPayloadCouponBasedNotifications from a dict""" if obj is None: return None @@ -126,7 +126,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "ImportId": obj.get("ImportId"), "BatchId": obj.get("BatchId"), "Attributes": obj.get("Attributes"), - "Limits": [PrismaticEventPayloadCouponBasedNotificationsLimits.from_dict(_item) for _item in obj["Limits"]] if obj.get("Limits") is not None else None, + "Limits": [IntegrationHubEventPayloadCouponBasedNotificationsLimits.from_dict(_item) for _item in obj["Limits"]] if obj.get("Limits") is not None else None, "PublishedAt": obj.get("PublishedAt"), "SourceOfEvent": obj.get("SourceOfEvent"), "EmployeeName": obj.get("EmployeeName") diff --git a/talon_one/models/prismatic_event_payload_coupon_based_notifications_limits.py b/talon_one/models/integration_hub_event_payload_coupon_based_notifications_limits.py similarity index 90% rename from talon_one/models/prismatic_event_payload_coupon_based_notifications_limits.py rename to talon_one/models/integration_hub_event_payload_coupon_based_notifications_limits.py index e59ae03..43e3ae5 100644 --- a/talon_one/models/prismatic_event_payload_coupon_based_notifications_limits.py +++ b/talon_one/models/integration_hub_event_payload_coupon_based_notifications_limits.py @@ -22,9 +22,9 @@ from typing import Optional, Set from typing_extensions import Self -class PrismaticEventPayloadCouponBasedNotificationsLimits(BaseModel): +class IntegrationHubEventPayloadCouponBasedNotificationsLimits(BaseModel): """ - PrismaticEventPayloadCouponBasedNotificationsLimits + IntegrationHubEventPayloadCouponBasedNotificationsLimits """ # noqa: E501 action: StrictStr = Field(alias="Action") limit: Union[StrictFloat, StrictInt] = Field(alias="Limit") @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PrismaticEventPayloadCouponBasedNotificationsLimits from a JSON string""" + """Create an instance of IntegrationHubEventPayloadCouponBasedNotificationsLimits from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -75,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PrismaticEventPayloadCouponBasedNotificationsLimits from a dict""" + """Create an instance of IntegrationHubEventPayloadCouponBasedNotificationsLimits from a dict""" if obj is None: return None diff --git a/talon_one/models/prismatic_event_payload_loyalty_profile_based_notification.py b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_notification.py similarity index 86% rename from talon_one/models/prismatic_event_payload_loyalty_profile_based_notification.py rename to talon_one/models/integration_hub_event_payload_loyalty_profile_based_notification.py index a8eb82a..41fef0b 100644 --- a/talon_one/models/prismatic_event_payload_loyalty_profile_based_notification.py +++ b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_notification.py @@ -20,13 +20,13 @@ 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.prismatic_event_payload_loyalty_profile_based_points_changed_notification_action import PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction +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 -class PrismaticEventPayloadLoyaltyProfileBasedNotification(BaseModel): +class IntegrationHubEventPayloadLoyaltyProfileBasedNotification(BaseModel): """ - PrismaticEventPayloadLoyaltyProfileBasedNotification + IntegrationHubEventPayloadLoyaltyProfileBasedNotification """ # noqa: E501 profile_integration_id: StrictStr = Field(alias="ProfileIntegrationID") loyalty_program_id: StrictInt = Field(alias="LoyaltyProgramID") @@ -35,7 +35,7 @@ class PrismaticEventPayloadLoyaltyProfileBasedNotification(BaseModel): 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[PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction]] = Field(default=None, alias="Actions") + actions: Optional[List[IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction]] = Field(default=None, alias="Actions") published_at: datetime = Field(description="Timestamp when the event was published.", alias="PublishedAt") current_tier: Optional[StrictStr] = Field(default=None, alias="CurrentTier") old_tier: Optional[StrictStr] = Field(default=None, alias="OldTier") @@ -63,7 +63,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PrismaticEventPayloadLoyaltyProfileBasedNotification from a JSON string""" + """Create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedNotification from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -95,7 +95,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PrismaticEventPayloadLoyaltyProfileBasedNotification from a dict""" + """Create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedNotification from a dict""" if obj is None: return None @@ -110,7 +110,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "EmployeeName": obj.get("EmployeeName"), "UserID": obj.get("UserID"), "CurrentPoints": obj.get("CurrentPoints"), - "Actions": [PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.from_dict(_item) for _item in obj["Actions"]] if obj.get("Actions") is not None else None, + "Actions": [IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.from_dict(_item) for _item in obj["Actions"]] if obj.get("Actions") is not None else None, "PublishedAt": obj.get("PublishedAt"), "CurrentTier": obj.get("CurrentTier"), "OldTier": obj.get("OldTier"), diff --git a/talon_one/models/prismatic_event_payload_loyalty_profile_based_points_changed_notification.py b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py similarity index 82% rename from talon_one/models/prismatic_event_payload_loyalty_profile_based_points_changed_notification.py rename to talon_one/models/integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py index a6e87f0..784534b 100644 --- a/talon_one/models/prismatic_event_payload_loyalty_profile_based_points_changed_notification.py +++ b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py @@ -20,13 +20,13 @@ 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.prismatic_event_payload_loyalty_profile_based_points_changed_notification_action import PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction +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 -class PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification(BaseModel): +class IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification(BaseModel): """ - PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification + IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification """ # noqa: E501 profile_integration_id: StrictStr = Field(alias="ProfileIntegrationID") loyalty_program_id: StrictInt = Field(alias="LoyaltyProgramID") @@ -35,7 +35,7 @@ class PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification(BaseMode 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[PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction]] = Field(default=None, alias="Actions") + actions: Optional[List[IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction]] = Field(default=None, alias="Actions") published_at: datetime = Field(description="Timestamp when the event was published.", alias="PublishedAt") __properties: ClassVar[List[str]] = ["ProfileIntegrationID", "LoyaltyProgramID", "SubledgerID", "SourceOfEvent", "EmployeeName", "UserID", "CurrentPoints", "Actions", "PublishedAt"] @@ -57,7 +57,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification from a JSON string""" + """Create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -89,7 +89,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification from a dict""" + """Create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification from a dict""" if obj is None: return None @@ -104,7 +104,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "EmployeeName": obj.get("EmployeeName"), "UserID": obj.get("UserID"), "CurrentPoints": obj.get("CurrentPoints"), - "Actions": [PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.from_dict(_item) for _item in obj["Actions"]] if obj.get("Actions") is not None else None, + "Actions": [IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.from_dict(_item) for _item in obj["Actions"]] if obj.get("Actions") is not None else None, "PublishedAt": obj.get("PublishedAt") }) return _obj diff --git a/talon_one/models/prismatic_event_payload_loyalty_profile_based_points_changed_notification_action.py b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action.py similarity index 89% rename from talon_one/models/prismatic_event_payload_loyalty_profile_based_points_changed_notification_action.py rename to talon_one/models/integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action.py index e515cf2..0d2ad6e 100644 --- a/talon_one/models/prismatic_event_payload_loyalty_profile_based_points_changed_notification_action.py +++ b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction(BaseModel): +class IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction(BaseModel): """ - PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction + IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction """ # noqa: E501 amount: Union[StrictFloat, StrictInt] = Field(alias="Amount") reason: Optional[StrictStr] = Field(default=None, alias="Reason") @@ -59,7 +59,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction from a JSON string""" + """Create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -84,7 +84,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction from a dict""" + """Create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction from a dict""" if obj is None: return None diff --git a/talon_one/models/prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification.py b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py similarity index 91% rename from talon_one/models/prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification.py rename to talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py index 78e748e..6177ae7 100644 --- a/talon_one/models/prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification.py +++ b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification(BaseModel): +class IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification(BaseModel): """ - PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification + IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification """ # noqa: E501 profile_integration_id: StrictStr = Field(alias="ProfileIntegrationID") loyalty_program_id: StrictInt = Field(alias="LoyaltyProgramID") @@ -57,7 +57,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification from a JSON string""" + """Create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -82,7 +82,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification from a dict""" + """Create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification from a dict""" if obj is None: return None diff --git a/talon_one/models/prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification.py b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py similarity index 92% rename from talon_one/models/prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification.py rename to talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py index 60dff21..d3134a1 100644 --- a/talon_one/models/prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification.py +++ b/talon_one/models/integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification(BaseModel): +class IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification(BaseModel): """ - PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification + IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification """ # noqa: E501 profile_integration_id: StrictStr = Field(alias="ProfileIntegrationID") loyalty_program_id: StrictInt = Field(alias="LoyaltyProgramID") @@ -59,7 +59,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification from a JSON string""" + """Create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -84,7 +84,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification from a dict""" + """Create an instance of IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification from a dict""" if obj is None: return None diff --git a/talon_one/models/prismatic_event_record.py b/talon_one/models/integration_hub_event_record.py similarity index 94% rename from talon_one/models/prismatic_event_record.py rename to talon_one/models/integration_hub_event_record.py index 6a6e3c1..503a223 100644 --- a/talon_one/models/prismatic_event_record.py +++ b/talon_one/models/integration_hub_event_record.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class PrismaticEventRecord(BaseModel): +class IntegrationHubEventRecord(BaseModel): """ - PrismaticEventRecord + IntegrationHubEventRecord """ # noqa: E501 id: StrictInt = Field(alias="Id") flow_id: StrictInt = Field(alias="FlowId") @@ -55,7 +55,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PrismaticEventRecord from a JSON string""" + """Create an instance of IntegrationHubEventRecord from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -85,7 +85,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PrismaticEventRecord from a dict""" + """Create an instance of IntegrationHubEventRecord from a dict""" if obj is None: return None diff --git a/talon_one/models/prismatic_flow.py b/talon_one/models/integration_hub_flow.py similarity index 87% rename from talon_one/models/prismatic_flow.py rename to talon_one/models/integration_hub_flow.py index 2bb4d1f..b270440 100644 --- a/talon_one/models/prismatic_flow.py +++ b/talon_one/models/integration_hub_flow.py @@ -22,14 +22,14 @@ from typing import Optional, Set from typing_extensions import Self -class PrismaticFlow(BaseModel): +class IntegrationHubFlow(BaseModel): """ - PrismaticFlow + 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") - prismatic_flow_url: StrictStr = Field(description="The URL of the prismatic flow that we want to trigger for the event.", alias="PrismaticFlowUrl") - __properties: ClassVar[List[str]] = ["ApplicationID", "EventType", "PrismaticFlowUrl"] + 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"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PrismaticFlow from a JSON string""" + """Create an instance of IntegrationHubFlow from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,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 PrismaticFlow from a dict""" + """Create an instance of IntegrationHubFlow from a dict""" if obj is None: return None @@ -84,7 +84,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "ApplicationID": obj.get("ApplicationID"), "EventType": obj.get("EventType"), - "PrismaticFlowUrl": obj.get("PrismaticFlowUrl") + "IntegrationHubFlowUrl": obj.get("IntegrationHubFlowUrl") }) return _obj diff --git a/talon_one/models/prismatic_flow_config.py b/talon_one/models/integration_hub_flow_config.py similarity index 87% rename from talon_one/models/prismatic_flow_config.py rename to talon_one/models/integration_hub_flow_config.py index 4ddc776..54430cf 100644 --- a/talon_one/models/prismatic_flow_config.py +++ b/talon_one/models/integration_hub_flow_config.py @@ -23,14 +23,14 @@ from typing import Optional, Set from typing_extensions import Self -class PrismaticFlowConfig(BaseModel): +class IntegrationHubFlowConfig(BaseModel): """ - PrismaticFlowConfig + IntegrationHubFlowConfig """ # noqa: E501 api_key: StrictStr = Field(alias="ApiKey") - worker_count: Optional[Annotated[int, Field(le=500, strict=True, ge=1)]] = Field(default=10, description="Number of Prismatic workers to run in parallel for this flow (maximum 500).", alias="WorkerCount") - max_events_per_message: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=1000, description="Maximum number of events to send in a single message to Prismatic.", alias="MaxEventsPerMessage") - max_retries: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=10, description="Maximum number of retries for a Prismatic event before it is ignored.", alias="MaxRetries") + worker_count: Optional[Annotated[int, Field(le=500, strict=True, ge=1)]] = Field(default=10, description="Number of IntegrationHub workers to run in parallel for this flow (maximum 500).", alias="WorkerCount") + max_events_per_message: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=1000, description="Maximum number of events to send in a single message to IntegrationHub.", alias="MaxEventsPerMessage") + max_retries: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=10, description="Maximum number of retries for a IntegrationHub event before it is ignored.", alias="MaxRetries") __properties: ClassVar[List[str]] = ["ApiKey", "WorkerCount", "MaxEventsPerMessage", "MaxRetries"] model_config = ConfigDict( @@ -51,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PrismaticFlowConfig from a JSON string""" + """Create an instance of IntegrationHubFlowConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -76,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PrismaticFlowConfig from a dict""" + """Create an instance of IntegrationHubFlowConfig from a dict""" if obj is None: return None diff --git a/talon_one/models/prismatic_flow_config_response.py b/talon_one/models/integration_hub_flow_config_response.py similarity index 85% rename from talon_one/models/prismatic_flow_config_response.py rename to talon_one/models/integration_hub_flow_config_response.py index 4b756ac..6f67944 100644 --- a/talon_one/models/prismatic_flow_config_response.py +++ b/talon_one/models/integration_hub_flow_config_response.py @@ -23,13 +23,13 @@ from typing import Optional, Set from typing_extensions import Self -class PrismaticFlowConfigResponse(BaseModel): +class IntegrationHubFlowConfigResponse(BaseModel): """ - PrismaticFlowConfigResponse + IntegrationHubFlowConfigResponse """ # noqa: E501 - worker_count: Optional[Annotated[int, Field(le=500, strict=True, ge=1)]] = Field(default=None, description="Number of Prismatic workers to run in parallel for this flow (maximum 500).", alias="WorkerCount") - max_events_per_message: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Maximum number of events to send in a single message to Prismatic.", alias="MaxEventsPerMessage") - max_retries: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Maximum number of retries for a Prismatic event before it is ignored.", alias="MaxRetries") + worker_count: Optional[Annotated[int, Field(le=500, strict=True, ge=1)]] = Field(default=None, description="Number of IntegrationHub workers to run in parallel for this flow (maximum 500).", alias="WorkerCount") + max_events_per_message: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Maximum number of events to send in a single message to IntegrationHub.", alias="MaxEventsPerMessage") + max_retries: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Maximum number of retries for a IntegrationHub event before it is ignored.", alias="MaxRetries") __properties: ClassVar[List[str]] = ["WorkerCount", "MaxEventsPerMessage", "MaxRetries"] model_config = ConfigDict( @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PrismaticFlowConfigResponse from a JSON string""" + """Create an instance of IntegrationHubFlowConfigResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -75,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PrismaticFlowConfigResponse from a dict""" + """Create an instance of IntegrationHubFlowConfigResponse from a dict""" if obj is None: return None diff --git a/talon_one/models/prismatic_flow_response.py b/talon_one/models/integration_hub_flow_response.py similarity index 79% rename from talon_one/models/prismatic_flow_response.py rename to talon_one/models/integration_hub_flow_response.py index 1bda085..d952f07 100644 --- a/talon_one/models/prismatic_flow_response.py +++ b/talon_one/models/integration_hub_flow_response.py @@ -19,20 +19,20 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from talon_one.models.prismatic_flow_config_response import PrismaticFlowConfigResponse +from talon_one.models.integration_hub_flow_config_response import IntegrationHubFlowConfigResponse from typing import Optional, Set from typing_extensions import Self -class PrismaticFlowResponse(BaseModel): +class IntegrationHubFlowResponse(BaseModel): """ - PrismaticFlowResponse + IntegrationHubFlowResponse """ # noqa: E501 - id: StrictInt = Field(description="ID of the prismatic flow.", alias="Id") + 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") - prismatic_flow_url: StrictStr = Field(description="The URL of the prismatic flow that we want to trigger for the event.", alias="PrismaticFlowUrl") - config: PrismaticFlowConfigResponse = Field(alias="Config") - __properties: ClassVar[List[str]] = ["Id", "ApplicationID", "EventType", "PrismaticFlowUrl", "Config"] + 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"] model_config = ConfigDict( populate_by_name=True, @@ -52,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PrismaticFlowResponse from a JSON string""" + """Create an instance of IntegrationHubFlowResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -80,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PrismaticFlowResponse from a dict""" + """Create an instance of IntegrationHubFlowResponse from a dict""" if obj is None: return None @@ -91,8 +91,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "Id": obj.get("Id"), "ApplicationID": obj.get("ApplicationID"), "EventType": obj.get("EventType"), - "PrismaticFlowUrl": obj.get("PrismaticFlowUrl"), - "Config": PrismaticFlowConfigResponse.from_dict(obj["Config"]) if obj.get("Config") is not None else None + "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/prismatic_flow_with_config.py b/talon_one/models/integration_hub_flow_with_config.py similarity index 81% rename from talon_one/models/prismatic_flow_with_config.py rename to talon_one/models/integration_hub_flow_with_config.py index 9b01236..44d06de 100644 --- a/talon_one/models/prismatic_flow_with_config.py +++ b/talon_one/models/integration_hub_flow_with_config.py @@ -19,19 +19,19 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from talon_one.models.prismatic_flow_config import PrismaticFlowConfig +from talon_one.models.integration_hub_flow_config import IntegrationHubFlowConfig from typing import Optional, Set from typing_extensions import Self -class PrismaticFlowWithConfig(BaseModel): +class IntegrationHubFlowWithConfig(BaseModel): """ - PrismaticFlowWithConfig + 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") - prismatic_flow_url: StrictStr = Field(description="The URL of the prismatic flow that we want to trigger for the event.", alias="PrismaticFlowUrl") - config: PrismaticFlowConfig = Field(alias="Config") - __properties: ClassVar[List[str]] = ["ApplicationID", "EventType", "PrismaticFlowUrl", "Config"] + 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"] model_config = ConfigDict( populate_by_name=True, @@ -51,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PrismaticFlowWithConfig from a JSON string""" + """Create an instance of IntegrationHubFlowWithConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -79,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PrismaticFlowWithConfig from a dict""" + """Create an instance of IntegrationHubFlowWithConfig from a dict""" if obj is None: return None @@ -89,8 +89,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "ApplicationID": obj.get("ApplicationID"), "EventType": obj.get("EventType"), - "PrismaticFlowUrl": obj.get("PrismaticFlowUrl"), - "Config": PrismaticFlowConfig.from_dict(obj["Config"]) if obj.get("Config") is not None else None + "IntegrationHubFlowUrl": obj.get("IntegrationHubFlowUrl"), + "Config": IntegrationHubFlowConfig.from_dict(obj["Config"]) if obj.get("Config") is not None else None }) return _obj diff --git a/talon_one/models/prismatic_paginated_event_payload.py b/talon_one/models/integration_hub_paginated_event_payload.py similarity index 93% rename from talon_one/models/prismatic_paginated_event_payload.py rename to talon_one/models/integration_hub_paginated_event_payload.py index af7b49d..6dd4721 100644 --- a/talon_one/models/prismatic_paginated_event_payload.py +++ b/talon_one/models/integration_hub_paginated_event_payload.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class PrismaticPaginatedEventPayload(BaseModel): +class IntegrationHubPaginatedEventPayload(BaseModel): """ - PrismaticPaginatedEventPayload + IntegrationHubPaginatedEventPayload """ # 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") @@ -58,7 +58,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PrismaticPaginatedEventPayload from a JSON string""" + """Create an instance of IntegrationHubPaginatedEventPayload from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -83,7 +83,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PrismaticPaginatedEventPayload from a dict""" + """Create an instance of IntegrationHubPaginatedEventPayload from a dict""" if obj is None: return None diff --git a/talon_one/models/list_experiments200_response.py b/talon_one/models/list_experiments200_response.py new file mode 100644 index 0000000..bd5cbae --- /dev/null +++ b/talon_one/models/list_experiments200_response.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from talon_one.models.experiment import Experiment +from typing import Optional, Set +from typing_extensions import Self + +class ListExperiments200Response(BaseModel): + """ + ListExperiments200Response + """ # noqa: E501 + total_result_size: StrictInt = Field(alias="totalResultSize") + data: List[Experiment] + __properties: ClassVar[List[str]] = ["totalResultSize", "data"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListExperiments200Response 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 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 ListExperiments200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "totalResultSize": obj.get("totalResultSize"), + "data": [Experiment.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/loyalty_points_changed_event_request.py b/talon_one/models/loyalty_points_changed_event_request.py new file mode 100644 index 0000000..93ec8b0 --- /dev/null +++ b/talon_one/models/loyalty_points_changed_event_request.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class LoyaltyPointsChangedEventRequest(BaseModel): + """ + LoyaltyPointsChangedEventRequest + """ # 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") + 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']): + raise ValueError("must be one of enum values ('LoyaltyPointsChanged')") + return value + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LoyaltyPointsChangedEventRequest 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 LoyaltyPointsChangedEventRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "TotalResultSize": obj.get("TotalResultSize"), + "BatchedAt": obj.get("BatchedAt"), + "EventType": obj.get("EventType"), + "Data": obj.get("Data") + }) + return _obj + + diff --git a/talon_one/models/loyalty_tier_downgrade_event_request.py b/talon_one/models/loyalty_tier_downgrade_event_request.py new file mode 100644 index 0000000..c3438f8 --- /dev/null +++ b/talon_one/models/loyalty_tier_downgrade_event_request.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class LoyaltyTierDowngradeEventRequest(BaseModel): + """ + LoyaltyTierDowngradeEventRequest + """ # 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") + 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(['LoyaltyTierDowngrade']): + raise ValueError("must be one of enum values ('LoyaltyTierDowngrade')") + return value + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LoyaltyTierDowngradeEventRequest 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 LoyaltyTierDowngradeEventRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "TotalResultSize": obj.get("TotalResultSize"), + "BatchedAt": obj.get("BatchedAt"), + "EventType": obj.get("EventType"), + "Data": obj.get("Data") + }) + return _obj + + diff --git a/talon_one/models/loyalty_tier_upgrade_event_request.py b/talon_one/models/loyalty_tier_upgrade_event_request.py new file mode 100644 index 0000000..bcf49b7 --- /dev/null +++ b/talon_one/models/loyalty_tier_upgrade_event_request.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class LoyaltyTierUpgradeEventRequest(BaseModel): + """ + LoyaltyTierUpgradeEventRequest + """ # 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") + 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(['LoyaltyTierUpgrade']): + raise ValueError("must be one of enum values ('LoyaltyTierUpgrade')") + return value + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LoyaltyTierUpgradeEventRequest 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 LoyaltyTierUpgradeEventRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "TotalResultSize": obj.get("TotalResultSize"), + "BatchedAt": obj.get("BatchedAt"), + "EventType": obj.get("EventType"), + "Data": obj.get("Data") + }) + return _obj + + diff --git a/talon_one/models/new_experiment.py b/talon_one/models/new_experiment.py index faa6cf5..b2d2b47 100644 --- a/talon_one/models/new_experiment.py +++ b/talon_one/models/new_experiment.py @@ -17,9 +17,8 @@ import re # noqa: F401 import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List from talon_one.models.new_campaign import NewCampaign from typing import Optional, Set from typing_extensions import Self @@ -28,21 +27,9 @@ class NewExperiment(BaseModel): """ NewExperiment """ # noqa: E501 - is_variant_assignment_external: StrictBool = Field(description="The source of the assignment. - false - The assignment to the variant is handled internally by the Talon.Oneandled internally by the Talon.One. - true - The assignment to the variant handled externally. ", alias="isVariantAssignmentExternal") - activated: Optional[datetime] = Field(default=None, description="The date and time the experiment was activated. ") - state: Optional[StrictStr] = Field(default='disabled', description="A disabled experiment is not evaluated for rules or coupons. ") + 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 - __properties: ClassVar[List[str]] = ["isVariantAssignmentExternal", "activated", "state", "campaign"] - - @field_validator('state') - def state_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['enabled', 'disabled']): - raise ValueError("must be one of enum values ('enabled', 'disabled')") - return value + __properties: ClassVar[List[str]] = ["isVariantAssignmentExternal", "campaign"] model_config = ConfigDict( populate_by_name=True, @@ -99,8 +86,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "isVariantAssignmentExternal": obj.get("isVariantAssignmentExternal"), - "activated": obj.get("activated"), - "state": obj.get("state") if obj.get("state") is not None else 'disabled', "campaign": NewCampaign.from_dict(obj["campaign"]) if obj.get("campaign") is not None else None }) return _obj diff --git a/talon_one/models/new_experiment_variant.py b/talon_one/models/new_experiment_variant.py index ce5dc98..a21b063 100644 --- a/talon_one/models/new_experiment_variant.py +++ b/talon_one/models/new_experiment_variant.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool from typing import Any, ClassVar, Dict, List from typing_extensions import Annotated from talon_one.models.new_ruleset import NewRuleset @@ -28,19 +28,12 @@ class NewExperimentVariant(BaseModel): """ NewExperimentVariant """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of this variant.") + 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.") ruleset: NewRuleset is_primary: StrictBool = Field(alias="isPrimary") __properties: ClassVar[List[str]] = ["name", "weight", "ruleset", "isPrimary"] - @field_validator('name') - def name_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[A-Za-z](\w|\s)*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z](\w|\s)*$/") - return value - model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/talon_one/models/price_history_request.py b/talon_one/models/price_history_request.py new file mode 100644 index 0000000..a71876a --- /dev/null +++ b/talon_one/models/price_history_request.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#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, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +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") + __properties: ClassVar[List[str]] = ["sku", "startDate", "endDate"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PriceHistoryRequest 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 PriceHistoryRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "sku": obj.get("sku"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate") + }) + return _obj + + diff --git a/talon_one/models/price_history_response.py b/talon_one/models/price_history_response.py new file mode 100644 index 0000000..326323f --- /dev/null +++ b/talon_one/models/price_history_response.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from talon_one.models.history import History +from typing import Optional, Set +from typing_extensions import Self + +class PriceHistoryResponse(BaseModel): + """ + PriceHistoryResponse + """ # noqa: E501 + sku: StrictStr = Field(description="The SKU of the item for which historical prices should be retrieved.") + history: List[History] + __properties: ClassVar[List[str]] = ["sku", "history"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PriceHistoryResponse 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 history (list) + _items = [] + if self.history: + for _item_history in self.history: + if _item_history: + _items.append(_item_history.to_dict()) + _dict['history'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PriceHistoryResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "sku": obj.get("sku"), + "history": [History.from_dict(_item) for _item in obj["history"]] if obj.get("history") is not None else None + }) + return _obj + + diff --git a/talon_one/models/promote_experiment.py b/talon_one/models/promote_experiment.py new file mode 100644 index 0000000..e2cf20a --- /dev/null +++ b/talon_one/models/promote_experiment.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#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, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.experiment_campaign_copy import ExperimentCampaignCopy +from typing import Optional, Set +from typing_extensions import Self + +class PromoteExperiment(BaseModel): + """ + PromoteExperiment + """ # noqa: E501 + target_application_id: StrictInt = Field(description="The ID of the Application to copy the experiment. It is displayed in your Talon.One deployment URL. ", alias="targetApplicationId") + variant_id: StrictInt = Field(description="The ID of the Experiment Variant to build the new campaign. ", alias="variantId") + disable_experiment: Optional[StrictBool] = Field(default=None, description="Force disable the experiment. ", alias="disableExperiment") + campaign: ExperimentCampaignCopy + __properties: ClassVar[List[str]] = ["targetApplicationId", "variantId", "disableExperiment", "campaign"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PromoteExperiment 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 campaign + if self.campaign: + _dict['campaign'] = self.campaign.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PromoteExperiment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "targetApplicationId": obj.get("targetApplicationId"), + "variantId": obj.get("variantId"), + "disableExperiment": obj.get("disableExperiment"), + "campaign": ExperimentCampaignCopy.from_dict(obj["campaign"]) if obj.get("campaign") is not None else None + }) + return _obj + + diff --git a/talon_one/models/update_experiment.py b/talon_one/models/update_experiment.py index 1c8ca9f..16b5b4b 100644 --- a/talon_one/models/update_experiment.py +++ b/talon_one/models/update_experiment.py @@ -27,7 +27,7 @@ class UpdateExperiment(BaseModel): """ UpdateExperiment """ # noqa: E501 - is_variant_assignment_external: StrictBool = Field(description="The source of the assignment. - false - The assignment to the variant is handled internally by the Talon.Oneandled internally by the Talon.One. - true - The assignment to the variant handled externally. ", alias="isVariantAssignmentExternal") + 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 __properties: ClassVar[List[str]] = ["isVariantAssignmentExternal", "campaign"] diff --git a/talon_one/models/update_experiment_variant.py b/talon_one/models/update_experiment_variant.py index 2099f6a..3a59cde 100644 --- a/talon_one/models/update_experiment_variant.py +++ b/talon_one/models/update_experiment_variant.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List from typing_extensions import Annotated from talon_one.models.new_ruleset import NewRuleset @@ -29,7 +29,7 @@ class UpdateExperimentVariant(BaseModel): UpdateExperimentVariant """ # noqa: E501 id: StrictInt - name: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of this variant.") 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.") __properties: ClassVar[List[str]] = ["id", "name", "ruleset", "weight"] diff --git a/test/test_best_prior_price.py b/test/test_best_prior_price.py index 39410ba..225b561 100644 --- a/test/test_best_prior_price.py +++ b/test/test_best_prior_price.py @@ -35,9 +35,10 @@ def make_instance(self, include_optional) -> BestPriorPrice: model = BestPriorPrice() if include_optional: return BestPriorPrice( + id = 1, sku = 'NVR-GN-GV-UUP', observed_at = '2020-11-10T23:00:00Z', - context_id = 'Summer Sale 2007', + context_id = 'Summer Sale 2025', price = 99.99, metadata = talon_one.models.best_prior_price_metadata.BestPriorPriceMetadata( influencing_campaign_details = [ @@ -50,9 +51,10 @@ def make_instance(self, include_optional) -> BestPriorPrice: ) else: return BestPriorPrice( + id = 1, sku = 'NVR-GN-GV-UUP', observed_at = '2020-11-10T23:00:00Z', - context_id = 'Summer Sale 2007', + context_id = 'Summer Sale 2025', price = 99.99, metadata = talon_one.models.best_prior_price_metadata.BestPriorPriceMetadata( influencing_campaign_details = [ diff --git a/test/test_best_prior_price_request.py b/test/test_best_prior_price_request.py index d44f870..94028a6 100644 --- a/test/test_best_prior_price_request.py +++ b/test/test_best_prior_price_request.py @@ -39,6 +39,7 @@ def make_instance(self, include_optional) -> BestPriorPriceRequest: timeframe_end_date = '2020-11-10T23:00:00Z', timeframe = '30', strict_end_date = True, + timeframe_end_date_type = 'sale', target = talon_one.models.best_prior_target.BestPriorTarget( target_type = 'AUDIENCE', audience_id = 4, ) diff --git a/test/test_coupon_created_event_request.py b/test/test_coupon_created_event_request.py new file mode 100644 index 0000000..9d6f532 --- /dev/null +++ b/test/test_coupon_created_event_request.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#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.coupon_created_event_request import CouponCreatedEventRequest + +class TestCouponCreatedEventRequest(unittest.TestCase): + """CouponCreatedEventRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CouponCreatedEventRequest: + """Test CouponCreatedEventRequest + 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 `CouponCreatedEventRequest` + """ + model = CouponCreatedEventRequest() + if include_optional: + return CouponCreatedEventRequest( + 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 = 'CouponCreated', + data = [ + null + ] + ) + else: + return CouponCreatedEventRequest( + total_result_size = 56, + event_type = 'CouponCreated', + data = [ + null + ], + ) + """ + + def testCouponCreatedEventRequest(self): + """Test CouponCreatedEventRequest""" + # 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_coupon_deleted_event_request.py b/test/test_coupon_deleted_event_request.py new file mode 100644 index 0000000..a71f574 --- /dev/null +++ b/test/test_coupon_deleted_event_request.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#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.coupon_deleted_event_request import CouponDeletedEventRequest + +class TestCouponDeletedEventRequest(unittest.TestCase): + """CouponDeletedEventRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CouponDeletedEventRequest: + """Test CouponDeletedEventRequest + 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 `CouponDeletedEventRequest` + """ + model = CouponDeletedEventRequest() + if include_optional: + return CouponDeletedEventRequest( + 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 = 'CouponDeleted', + data = [ + null + ] + ) + else: + return CouponDeletedEventRequest( + total_result_size = 56, + event_type = 'CouponDeleted', + data = [ + null + ], + ) + """ + + def testCouponDeletedEventRequest(self): + """Test CouponDeletedEventRequest""" + # 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_coupon_updated_event_request.py b/test/test_coupon_updated_event_request.py new file mode 100644 index 0000000..a1d2f6d --- /dev/null +++ b/test/test_coupon_updated_event_request.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#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.coupon_updated_event_request import CouponUpdatedEventRequest + +class TestCouponUpdatedEventRequest(unittest.TestCase): + """CouponUpdatedEventRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CouponUpdatedEventRequest: + """Test CouponUpdatedEventRequest + 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 `CouponUpdatedEventRequest` + """ + model = CouponUpdatedEventRequest() + if include_optional: + return CouponUpdatedEventRequest( + 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 = 'CouponUpdated', + data = [ + null + ] + ) + else: + return CouponUpdatedEventRequest( + total_result_size = 56, + event_type = 'CouponUpdated', + data = [ + null + ], + ) + """ + + def testCouponUpdatedEventRequest(self): + """Test CouponUpdatedEventRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_experiment.py b/test/test_experiment.py index 9e6fe28..d95178c 100644 --- a/test/test_experiment.py +++ b/test/test_experiment.py @@ -52,6 +52,7 @@ def make_instance(self, include_optional) -> Experiment: id = 6, created = '2020-06-10T09:05:27.993483Z', application_id = 322, + state = 'disabled', ) """ diff --git a/test/test_experiment_campaign_copy.py b/test/test_experiment_campaign_copy.py new file mode 100644 index 0000000..7f16858 --- /dev/null +++ b/test/test_experiment_campaign_copy.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#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_campaign_copy import ExperimentCampaignCopy + +class TestExperimentCampaignCopy(unittest.TestCase): + """ExperimentCampaignCopy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ExperimentCampaignCopy: + """Test ExperimentCampaignCopy + 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 `ExperimentCampaignCopy` + """ + model = ExperimentCampaignCopy() + if include_optional: + return ExperimentCampaignCopy( + name = 'Copy of Summer promotions', + description = 'Campaign for all summer 2021 promotions', + start_time = '2021-06-01T09:00:27.993483Z', + end_time = '2021-09-10T01:00:00.993483Z', + tags = [Summer, Shoes], + evaluation_group_id = 2 + ) + else: + return ExperimentCampaignCopy( + ) + """ + + def testExperimentCampaignCopy(self): + """Test ExperimentCampaignCopy""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_experiment_copy.py b/test/test_experiment_copy.py new file mode 100644 index 0000000..8b3d255 --- /dev/null +++ b/test/test_experiment_copy.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#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_copy import ExperimentCopy + +class TestExperimentCopy(unittest.TestCase): + """ExperimentCopy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ExperimentCopy: + """Test ExperimentCopy + 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 `ExperimentCopy` + """ + model = ExperimentCopy() + if include_optional: + return ExperimentCopy( + target_application_id = 56, + experiment = talon_one.models.experiment_copy_experiment.ExperimentCopy_experiment( + is_variant_assignment_external = True, + campaign = talon_one.models.experiment_campaign_copy.ExperimentCampaignCopy( + name = 'Copy of Summer promotions', + description = 'Campaign for all summer 2021 promotions', + start_time = '2021-06-01T09:00:27.993483Z', + end_time = '2021-09-10T01:00:00.993483Z', + tags = [Summer, Shoes], + evaluation_group_id = 2, ), ) + ) + else: + return ExperimentCopy( + target_application_id = 56, + experiment = talon_one.models.experiment_copy_experiment.ExperimentCopy_experiment( + is_variant_assignment_external = True, + campaign = talon_one.models.experiment_campaign_copy.ExperimentCampaignCopy( + name = 'Copy of Summer promotions', + description = 'Campaign for all summer 2021 promotions', + start_time = '2021-06-01T09:00:27.993483Z', + end_time = '2021-09-10T01:00:00.993483Z', + tags = [Summer, Shoes], + evaluation_group_id = 2, ), ), + ) + """ + + def testExperimentCopy(self): + """Test ExperimentCopy""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_experiment_copy_experiment.py b/test/test_experiment_copy_experiment.py new file mode 100644 index 0000000..5d0e664 --- /dev/null +++ b/test/test_experiment_copy_experiment.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) are used 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#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_copy_experiment import ExperimentCopyExperiment + +class TestExperimentCopyExperiment(unittest.TestCase): + """ExperimentCopyExperiment unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ExperimentCopyExperiment: + """Test ExperimentCopyExperiment + 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 `ExperimentCopyExperiment` + """ + model = ExperimentCopyExperiment() + if include_optional: + return ExperimentCopyExperiment( + is_variant_assignment_external = True, + campaign = talon_one.models.experiment_campaign_copy.ExperimentCampaignCopy( + name = 'Copy of Summer promotions', + description = 'Campaign for all summer 2021 promotions', + start_time = '2021-06-01T09:00:27.993483Z', + end_time = '2021-09-10T01:00:00.993483Z', + tags = [Summer, Shoes], + evaluation_group_id = 2, ) + ) + else: + return ExperimentCopyExperiment( + is_variant_assignment_external = True, + campaign = talon_one.models.experiment_campaign_copy.ExperimentCampaignCopy( + name = 'Copy of Summer promotions', + description = 'Campaign for all summer 2021 promotions', + start_time = '2021-06-01T09:00:27.993483Z', + end_time = '2021-09-10T01:00:00.993483Z', + tags = [Summer, Shoes], + evaluation_group_id = 2, ), + ) + """ + + def testExperimentCopyExperiment(self): + """Test ExperimentCopyExperiment""" + # 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_history.py b/test/test_history.py new file mode 100644 index 0000000..733f5e1 --- /dev/null +++ b/test/test_history.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#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.history import History + +class TestHistory(unittest.TestCase): + """History unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> History: + """Test History + 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 `History` + """ + model = History() + if include_optional: + return History( + id = 1, + observed_at = '2020-11-10T23:00:00Z', + context_id = 'Summer Sale 2025', + price = 99.99, + metadata = talon_one.models.best_prior_price_metadata.BestPriorPriceMetadata( + influencing_campaign_details = [ + talon_one.models.influencing_campaign_details.InfluencingCampaignDetails( + campaign_id = 56, + discount_value = 1.337, ) + ], + adjustment_details = null, ), + target = talon_one.models.label_target.LabelTarget() + ) + else: + return History( + id = 1, + observed_at = '2020-11-10T23:00:00Z', + context_id = 'Summer Sale 2025', + price = 99.99, + metadata = talon_one.models.best_prior_price_metadata.BestPriorPriceMetadata( + influencing_campaign_details = [ + talon_one.models.influencing_campaign_details.InfluencingCampaignDetails( + campaign_id = 56, + discount_value = 1.337, ) + ], + adjustment_details = null, ), + target = talon_one.models.label_target.LabelTarget(), + ) + """ + + def testHistory(self): + """Test History""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_integration_api.py b/test/test_integration_api.py index 04ce981..6e1e7f6 100644 --- a/test/test_integration_api.py +++ b/test/test_integration_api.py @@ -194,6 +194,13 @@ def test_link_loyalty_card_to_profile(self) -> None: """ pass + def test_price_history(self) -> None: + """Test case for price_history + + Get summary of price history + """ + pass + def test_reopen_customer_session(self) -> None: """Test case for reopen_customer_session diff --git a/test/test_prismatic_config.py b/test/test_integration_hub_config.py similarity index 70% rename from test/test_prismatic_config.py rename to test/test_integration_hub_config.py index a633dc3..cbedf5f 100644 --- a/test/test_prismatic_config.py +++ b/test/test_integration_hub_config.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.prismatic_config import PrismaticConfig +from talon_one.models.integration_hub_config import IntegrationHubConfig -class TestPrismaticConfig(unittest.TestCase): - """PrismaticConfig unit test stubs""" +class TestIntegrationHubConfig(unittest.TestCase): + """IntegrationHubConfig unit test stubs""" def setUp(self): pass @@ -25,28 +25,28 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> PrismaticConfig: - """Test PrismaticConfig + def make_instance(self, include_optional) -> IntegrationHubConfig: + """Test IntegrationHubConfig 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 `PrismaticConfig` + # uncomment below to create an instance of `IntegrationHubConfig` """ - model = PrismaticConfig() + model = IntegrationHubConfig() if include_optional: - return PrismaticConfig( - prismatic_url = 'https://app.eu-west-1.prismatic.io/', + return IntegrationHubConfig( + integration_hub_url = 'https://hub.talon.farm/', access_token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9' ) else: - return PrismaticConfig( - prismatic_url = 'https://app.eu-west-1.prismatic.io/', + return IntegrationHubConfig( + integration_hub_url = 'https://hub.talon.farm/', access_token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', ) """ - def testPrismaticConfig(self): - """Test PrismaticConfig""" + def testIntegrationHubConfig(self): + """Test IntegrationHubConfig""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_prismatic_event_payload_coupon_based_notifications.py b/test/test_integration_hub_event_payload_coupon_based_notifications.py similarity index 74% rename from test/test_prismatic_event_payload_coupon_based_notifications.py rename to test/test_integration_hub_event_payload_coupon_based_notifications.py index b7b51a0..84a7b5c 100644 --- a/test/test_prismatic_event_payload_coupon_based_notifications.py +++ b/test/test_integration_hub_event_payload_coupon_based_notifications.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.prismatic_event_payload_coupon_based_notifications import PrismaticEventPayloadCouponBasedNotifications +from talon_one.models.integration_hub_event_payload_coupon_based_notifications import IntegrationHubEventPayloadCouponBasedNotifications -class TestPrismaticEventPayloadCouponBasedNotifications(unittest.TestCase): - """PrismaticEventPayloadCouponBasedNotifications unit test stubs""" +class TestIntegrationHubEventPayloadCouponBasedNotifications(unittest.TestCase): + """IntegrationHubEventPayloadCouponBasedNotifications unit test stubs""" def setUp(self): pass @@ -25,16 +25,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> PrismaticEventPayloadCouponBasedNotifications: - """Test PrismaticEventPayloadCouponBasedNotifications + def make_instance(self, include_optional) -> IntegrationHubEventPayloadCouponBasedNotifications: + """Test IntegrationHubEventPayloadCouponBasedNotifications 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 `PrismaticEventPayloadCouponBasedNotifications` + # uncomment below to create an instance of `IntegrationHubEventPayloadCouponBasedNotifications` """ - model = PrismaticEventPayloadCouponBasedNotifications() + model = IntegrationHubEventPayloadCouponBasedNotifications() if include_optional: - return PrismaticEventPayloadCouponBasedNotifications( + return IntegrationHubEventPayloadCouponBasedNotifications( id = 56, created = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), campaign_id = 56, @@ -53,7 +53,7 @@ def make_instance(self, include_optional) -> PrismaticEventPayloadCouponBasedNot batch_id = '', attributes = None, limits = [ - talon_one.models.prismatic_event_payload_coupon_based_notifications_limits.PrismaticEventPayloadCouponBasedNotificationsLimits( + talon_one.models.integration_hub_event_payload_coupon_based_notifications_limits.IntegrationHubEventPayloadCouponBasedNotificationsLimits( action = '', limit = 1.337, period = '', @@ -66,7 +66,7 @@ def make_instance(self, include_optional) -> PrismaticEventPayloadCouponBasedNot employee_name = '' ) else: - return PrismaticEventPayloadCouponBasedNotifications( + return IntegrationHubEventPayloadCouponBasedNotifications( id = 56, created = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), campaign_id = 56, @@ -79,8 +79,8 @@ def make_instance(self, include_optional) -> PrismaticEventPayloadCouponBasedNot ) """ - def testPrismaticEventPayloadCouponBasedNotifications(self): - """Test PrismaticEventPayloadCouponBasedNotifications""" + def testIntegrationHubEventPayloadCouponBasedNotifications(self): + """Test IntegrationHubEventPayloadCouponBasedNotifications""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_prismatic_event_payload_coupon_based_notifications_limits.py b/test/test_integration_hub_event_payload_coupon_based_notifications_limits.py similarity index 64% rename from test/test_prismatic_event_payload_coupon_based_notifications_limits.py rename to test/test_integration_hub_event_payload_coupon_based_notifications_limits.py index 66927a7..6b2ef1d 100644 --- a/test/test_prismatic_event_payload_coupon_based_notifications_limits.py +++ b/test/test_integration_hub_event_payload_coupon_based_notifications_limits.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.prismatic_event_payload_coupon_based_notifications_limits import PrismaticEventPayloadCouponBasedNotificationsLimits +from talon_one.models.integration_hub_event_payload_coupon_based_notifications_limits import IntegrationHubEventPayloadCouponBasedNotificationsLimits -class TestPrismaticEventPayloadCouponBasedNotificationsLimits(unittest.TestCase): - """PrismaticEventPayloadCouponBasedNotificationsLimits unit test stubs""" +class TestIntegrationHubEventPayloadCouponBasedNotificationsLimits(unittest.TestCase): + """IntegrationHubEventPayloadCouponBasedNotificationsLimits unit test stubs""" def setUp(self): pass @@ -25,16 +25,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> PrismaticEventPayloadCouponBasedNotificationsLimits: - """Test PrismaticEventPayloadCouponBasedNotificationsLimits + def make_instance(self, include_optional) -> IntegrationHubEventPayloadCouponBasedNotificationsLimits: + """Test IntegrationHubEventPayloadCouponBasedNotificationsLimits 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 `PrismaticEventPayloadCouponBasedNotificationsLimits` + # uncomment below to create an instance of `IntegrationHubEventPayloadCouponBasedNotificationsLimits` """ - model = PrismaticEventPayloadCouponBasedNotificationsLimits() + model = IntegrationHubEventPayloadCouponBasedNotificationsLimits() if include_optional: - return PrismaticEventPayloadCouponBasedNotificationsLimits( + return IntegrationHubEventPayloadCouponBasedNotificationsLimits( action = '', limit = 1.337, period = '', @@ -43,7 +43,7 @@ def make_instance(self, include_optional) -> PrismaticEventPayloadCouponBasedNot ] ) else: - return PrismaticEventPayloadCouponBasedNotificationsLimits( + return IntegrationHubEventPayloadCouponBasedNotificationsLimits( action = '', limit = 1.337, entities = [ @@ -52,8 +52,8 @@ def make_instance(self, include_optional) -> PrismaticEventPayloadCouponBasedNot ) """ - def testPrismaticEventPayloadCouponBasedNotificationsLimits(self): - """Test PrismaticEventPayloadCouponBasedNotificationsLimits""" + def testIntegrationHubEventPayloadCouponBasedNotificationsLimits(self): + """Test IntegrationHubEventPayloadCouponBasedNotificationsLimits""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_prismatic_event_payload_loyalty_profile_based_notification.py b/test/test_integration_hub_event_payload_loyalty_profile_based_notification.py similarity index 72% rename from test/test_prismatic_event_payload_loyalty_profile_based_notification.py rename to test/test_integration_hub_event_payload_loyalty_profile_based_notification.py index a0c4b95..a356e48 100644 --- a/test/test_prismatic_event_payload_loyalty_profile_based_notification.py +++ b/test/test_integration_hub_event_payload_loyalty_profile_based_notification.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.prismatic_event_payload_loyalty_profile_based_notification import PrismaticEventPayloadLoyaltyProfileBasedNotification +from talon_one.models.integration_hub_event_payload_loyalty_profile_based_notification import IntegrationHubEventPayloadLoyaltyProfileBasedNotification -class TestPrismaticEventPayloadLoyaltyProfileBasedNotification(unittest.TestCase): - """PrismaticEventPayloadLoyaltyProfileBasedNotification unit test stubs""" +class TestIntegrationHubEventPayloadLoyaltyProfileBasedNotification(unittest.TestCase): + """IntegrationHubEventPayloadLoyaltyProfileBasedNotification unit test stubs""" def setUp(self): pass @@ -25,16 +25,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> PrismaticEventPayloadLoyaltyProfileBasedNotification: - """Test PrismaticEventPayloadLoyaltyProfileBasedNotification + 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 `PrismaticEventPayloadLoyaltyProfileBasedNotification` + # uncomment below to create an instance of `IntegrationHubEventPayloadLoyaltyProfileBasedNotification` """ - model = PrismaticEventPayloadLoyaltyProfileBasedNotification() + model = IntegrationHubEventPayloadLoyaltyProfileBasedNotification() if include_optional: - return PrismaticEventPayloadLoyaltyProfileBasedNotification( + return IntegrationHubEventPayloadLoyaltyProfileBasedNotification( profile_integration_id = '', loyalty_program_id = 56, subledger_id = '', @@ -54,7 +54,7 @@ def make_instance(self, include_optional) -> PrismaticEventPayloadLoyaltyProfile next_tier = '' ) else: - return PrismaticEventPayloadLoyaltyProfileBasedNotification( + return IntegrationHubEventPayloadLoyaltyProfileBasedNotification( profile_integration_id = '', loyalty_program_id = 56, subledger_id = '', @@ -64,8 +64,8 @@ def make_instance(self, include_optional) -> PrismaticEventPayloadLoyaltyProfile ) """ - def testPrismaticEventPayloadLoyaltyProfileBasedNotification(self): - """Test PrismaticEventPayloadLoyaltyProfileBasedNotification""" + def testIntegrationHubEventPayloadLoyaltyProfileBasedNotification(self): + """Test IntegrationHubEventPayloadLoyaltyProfileBasedNotification""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_prismatic_event_payload_loyalty_profile_based_points_changed_notification.py b/test/test_integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py similarity index 65% rename from test/test_prismatic_event_payload_loyalty_profile_based_points_changed_notification.py rename to test/test_integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py index 90e2c1c..e475b5e 100644 --- a/test/test_prismatic_event_payload_loyalty_profile_based_points_changed_notification.py +++ b/test/test_integration_hub_event_payload_loyalty_profile_based_points_changed_notification.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.prismatic_event_payload_loyalty_profile_based_points_changed_notification import PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification +from talon_one.models.integration_hub_event_payload_loyalty_profile_based_points_changed_notification import IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification -class TestPrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification(unittest.TestCase): - """PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification unit test stubs""" +class TestIntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification(unittest.TestCase): + """IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification unit test stubs""" def setUp(self): pass @@ -25,16 +25,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification: - """Test PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification + def make_instance(self, include_optional) -> IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification: + """Test IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification 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 `PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification` + # uncomment below to create an instance of `IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification` """ - model = PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification() + model = IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification() if include_optional: - return PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification( + return IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification( profile_integration_id = '', loyalty_program_id = 56, subledger_id = '', @@ -48,7 +48,7 @@ def make_instance(self, include_optional) -> PrismaticEventPayloadLoyaltyProfile published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') ) else: - return PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification( + return IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification( profile_integration_id = '', loyalty_program_id = 56, subledger_id = '', @@ -58,8 +58,8 @@ def make_instance(self, include_optional) -> PrismaticEventPayloadLoyaltyProfile ) """ - def testPrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification(self): - """Test PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotification""" + def testIntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification(self): + """Test IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_prismatic_event_payload_loyalty_profile_based_points_changed_notification_action.py b/test/test_integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action.py similarity index 60% rename from test/test_prismatic_event_payload_loyalty_profile_based_points_changed_notification_action.py rename to test/test_integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action.py index b32314c..3e46427 100644 --- a/test/test_prismatic_event_payload_loyalty_profile_based_points_changed_notification_action.py +++ b/test/test_integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.prismatic_event_payload_loyalty_profile_based_points_changed_notification_action import PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction +from talon_one.models.integration_hub_event_payload_loyalty_profile_based_points_changed_notification_action import IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction -class TestPrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction(unittest.TestCase): - """PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction unit test stubs""" +class TestIntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction(unittest.TestCase): + """IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction unit test stubs""" def setUp(self): pass @@ -25,16 +25,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction: - """Test PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction + def make_instance(self, include_optional) -> IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction: + """Test IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction 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 `PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction` + # uncomment below to create an instance of `IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction` """ - model = PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction() + model = IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction() if include_optional: - return PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction( + return IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction( amount = 1.337, reason = '', operation = 'addition', @@ -42,14 +42,14 @@ def make_instance(self, include_optional) -> PrismaticEventPayloadLoyaltyProfile expiry_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') ) else: - return PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction( + return IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction( amount = 1.337, operation = 'addition', ) """ - def testPrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction(self): - """Test PrismaticEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction""" + def testIntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction(self): + """Test IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification.py b/test/test_integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py similarity index 67% rename from test/test_prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification.py rename to test/test_integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py index 63202c3..89d0b8a 100644 --- a/test/test_prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification.py +++ b/test/test_integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.prismatic_event_payload_loyalty_profile_based_tier_downgrade_notification import PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification +from talon_one.models.integration_hub_event_payload_loyalty_profile_based_tier_downgrade_notification import IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification -class TestPrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification(unittest.TestCase): - """PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification unit test stubs""" +class TestIntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification(unittest.TestCase): + """IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification unit test stubs""" def setUp(self): pass @@ -25,16 +25,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification: - """Test PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification + def make_instance(self, include_optional) -> IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification: + """Test IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification 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 `PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification` + # uncomment below to create an instance of `IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification` """ - model = PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification() + model = IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification() if include_optional: - return PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification( + return IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification( profile_integration_id = '', loyalty_program_id = 56, subledger_id = '', @@ -47,7 +47,7 @@ def make_instance(self, include_optional) -> PrismaticEventPayloadLoyaltyProfile published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') ) else: - return PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification( + return IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification( profile_integration_id = '', loyalty_program_id = 56, subledger_id = '', @@ -57,8 +57,8 @@ def make_instance(self, include_optional) -> PrismaticEventPayloadLoyaltyProfile ) """ - def testPrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification(self): - """Test PrismaticEventPayloadLoyaltyProfileBasedTierDowngradeNotification""" + def testIntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification(self): + """Test IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification.py b/test/test_integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py similarity index 68% rename from test/test_prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification.py rename to test/test_integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py index 0968f7e..e3e6598 100644 --- a/test/test_prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification.py +++ b/test/test_integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.prismatic_event_payload_loyalty_profile_based_tier_upgrade_notification import PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification +from talon_one.models.integration_hub_event_payload_loyalty_profile_based_tier_upgrade_notification import IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification -class TestPrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification(unittest.TestCase): - """PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification unit test stubs""" +class TestIntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification(unittest.TestCase): + """IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification unit test stubs""" def setUp(self): pass @@ -25,16 +25,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification: - """Test PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification + def make_instance(self, include_optional) -> IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification: + """Test IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification 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 `PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification` + # uncomment below to create an instance of `IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification` """ - model = PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification() + model = IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification() if include_optional: - return PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification( + return IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification( profile_integration_id = '', loyalty_program_id = 56, subledger_id = '', @@ -49,7 +49,7 @@ def make_instance(self, include_optional) -> PrismaticEventPayloadLoyaltyProfile published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') ) else: - return PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification( + return IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification( profile_integration_id = '', loyalty_program_id = 56, subledger_id = '', @@ -59,8 +59,8 @@ def make_instance(self, include_optional) -> PrismaticEventPayloadLoyaltyProfile ) """ - def testPrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification(self): - """Test PrismaticEventPayloadLoyaltyProfileBasedTierUpgradeNotification""" + def testIntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification(self): + """Test IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_prismatic_event_record.py b/test/test_integration_hub_event_record.py similarity index 79% rename from test/test_prismatic_event_record.py rename to test/test_integration_hub_event_record.py index 6d9d82d..1e3222f 100644 --- a/test/test_prismatic_event_record.py +++ b/test/test_integration_hub_event_record.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.prismatic_event_record import PrismaticEventRecord +from talon_one.models.integration_hub_event_record import IntegrationHubEventRecord -class TestPrismaticEventRecord(unittest.TestCase): - """PrismaticEventRecord unit test stubs""" +class TestIntegrationHubEventRecord(unittest.TestCase): + """IntegrationHubEventRecord unit test stubs""" def setUp(self): pass @@ -25,16 +25,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> PrismaticEventRecord: - """Test PrismaticEventRecord + def make_instance(self, include_optional) -> IntegrationHubEventRecord: + """Test IntegrationHubEventRecord 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 `PrismaticEventRecord` + # uncomment below to create an instance of `IntegrationHubEventRecord` """ - model = PrismaticEventRecord() + model = IntegrationHubEventRecord() if include_optional: - return PrismaticEventRecord( + return IntegrationHubEventRecord( id = 56, flow_id = 56, event_type = '', @@ -45,7 +45,7 @@ def make_instance(self, include_optional) -> PrismaticEventRecord: retry = 56 ) else: - return PrismaticEventRecord( + return IntegrationHubEventRecord( id = 56, flow_id = 56, event_type = '', @@ -56,8 +56,8 @@ def make_instance(self, include_optional) -> PrismaticEventRecord: ) """ - def testPrismaticEventRecord(self): - """Test PrismaticEventRecord""" + def testIntegrationHubEventRecord(self): + """Test IntegrationHubEventRecord""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_prismatic_flow.py b/test/test_integration_hub_flow.py similarity index 71% rename from test/test_prismatic_flow.py rename to test/test_integration_hub_flow.py index 6d7a45e..527aff5 100644 --- a/test/test_prismatic_flow.py +++ b/test/test_integration_hub_flow.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.prismatic_flow import PrismaticFlow +from talon_one.models.integration_hub_flow import IntegrationHubFlow -class TestPrismaticFlow(unittest.TestCase): - """PrismaticFlow unit test stubs""" +class TestIntegrationHubFlow(unittest.TestCase): + """IntegrationHubFlow unit test stubs""" def setUp(self): pass @@ -25,29 +25,29 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> PrismaticFlow: - """Test PrismaticFlow + def make_instance(self, include_optional) -> IntegrationHubFlow: + """Test IntegrationHubFlow 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 `PrismaticFlow` + # uncomment below to create an instance of `IntegrationHubFlow` """ - model = PrismaticFlow() + model = IntegrationHubFlow() if include_optional: - return PrismaticFlow( + return IntegrationHubFlow( application_id = 54, event_type = '', - prismatic_flow_url = '' + integration_hub_flow_url = '' ) else: - return PrismaticFlow( + return IntegrationHubFlow( event_type = '', - prismatic_flow_url = '', + integration_hub_flow_url = '', ) """ - def testPrismaticFlow(self): - """Test PrismaticFlow""" + def testIntegrationHubFlow(self): + """Test IntegrationHubFlow""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_prismatic_flow_config.py b/test/test_integration_hub_flow_config.py similarity index 73% rename from test/test_prismatic_flow_config.py rename to test/test_integration_hub_flow_config.py index 81fe5bf..13a0326 100644 --- a/test/test_prismatic_flow_config.py +++ b/test/test_integration_hub_flow_config.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.prismatic_flow_config import PrismaticFlowConfig +from talon_one.models.integration_hub_flow_config import IntegrationHubFlowConfig -class TestPrismaticFlowConfig(unittest.TestCase): - """PrismaticFlowConfig unit test stubs""" +class TestIntegrationHubFlowConfig(unittest.TestCase): + """IntegrationHubFlowConfig unit test stubs""" def setUp(self): pass @@ -25,29 +25,29 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> PrismaticFlowConfig: - """Test PrismaticFlowConfig + def make_instance(self, include_optional) -> IntegrationHubFlowConfig: + """Test IntegrationHubFlowConfig 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 `PrismaticFlowConfig` + # uncomment below to create an instance of `IntegrationHubFlowConfig` """ - model = PrismaticFlowConfig() + model = IntegrationHubFlowConfig() if include_optional: - return PrismaticFlowConfig( + return IntegrationHubFlowConfig( api_key = '', worker_count = 1, max_events_per_message = 1, max_retries = 0 ) else: - return PrismaticFlowConfig( + return IntegrationHubFlowConfig( api_key = '', ) """ - def testPrismaticFlowConfig(self): - """Test PrismaticFlowConfig""" + def testIntegrationHubFlowConfig(self): + """Test IntegrationHubFlowConfig""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_prismatic_flow_config_response.py b/test/test_integration_hub_flow_config_response.py similarity index 69% rename from test/test_prismatic_flow_config_response.py rename to test/test_integration_hub_flow_config_response.py index e17fb5e..3c10c53 100644 --- a/test/test_prismatic_flow_config_response.py +++ b/test/test_integration_hub_flow_config_response.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.prismatic_flow_config_response import PrismaticFlowConfigResponse +from talon_one.models.integration_hub_flow_config_response import IntegrationHubFlowConfigResponse -class TestPrismaticFlowConfigResponse(unittest.TestCase): - """PrismaticFlowConfigResponse unit test stubs""" +class TestIntegrationHubFlowConfigResponse(unittest.TestCase): + """IntegrationHubFlowConfigResponse unit test stubs""" def setUp(self): pass @@ -25,27 +25,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> PrismaticFlowConfigResponse: - """Test PrismaticFlowConfigResponse + def make_instance(self, include_optional) -> IntegrationHubFlowConfigResponse: + """Test IntegrationHubFlowConfigResponse 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 `PrismaticFlowConfigResponse` + # uncomment below to create an instance of `IntegrationHubFlowConfigResponse` """ - model = PrismaticFlowConfigResponse() + model = IntegrationHubFlowConfigResponse() if include_optional: - return PrismaticFlowConfigResponse( + return IntegrationHubFlowConfigResponse( worker_count = 1, max_events_per_message = 1, max_retries = 0 ) else: - return PrismaticFlowConfigResponse( + return IntegrationHubFlowConfigResponse( ) """ - def testPrismaticFlowConfigResponse(self): - """Test PrismaticFlowConfigResponse""" + def testIntegrationHubFlowConfigResponse(self): + """Test IntegrationHubFlowConfigResponse""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_prismatic_flow_response.py b/test/test_integration_hub_flow_response.py similarity index 66% rename from test/test_prismatic_flow_response.py rename to test/test_integration_hub_flow_response.py index e9c5536..b719ff4 100644 --- a/test/test_prismatic_flow_response.py +++ b/test/test_integration_hub_flow_response.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.prismatic_flow_response import PrismaticFlowResponse +from talon_one.models.integration_hub_flow_response import IntegrationHubFlowResponse -class TestPrismaticFlowResponse(unittest.TestCase): - """PrismaticFlowResponse unit test stubs""" +class TestIntegrationHubFlowResponse(unittest.TestCase): + """IntegrationHubFlowResponse unit test stubs""" def setUp(self): pass @@ -25,39 +25,39 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> PrismaticFlowResponse: - """Test PrismaticFlowResponse + def make_instance(self, include_optional) -> IntegrationHubFlowResponse: + """Test IntegrationHubFlowResponse 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 `PrismaticFlowResponse` + # uncomment below to create an instance of `IntegrationHubFlowResponse` """ - model = PrismaticFlowResponse() + model = IntegrationHubFlowResponse() if include_optional: - return PrismaticFlowResponse( + return IntegrationHubFlowResponse( id = 56, application_id = 54, event_type = '', - prismatic_flow_url = '', - config = talon_one.models.prismatic_flow_config_response.PrismaticFlowConfigResponse( + integration_hub_flow_url = '', + config = talon_one.models.integration_hub_flow_config_response.IntegrationHubFlowConfigResponse( worker_count = 1, max_events_per_message = 1, max_retries = 0, ) ) else: - return PrismaticFlowResponse( + return IntegrationHubFlowResponse( id = 56, event_type = '', - prismatic_flow_url = '', - config = talon_one.models.prismatic_flow_config_response.PrismaticFlowConfigResponse( + integration_hub_flow_url = '', + config = talon_one.models.integration_hub_flow_config_response.IntegrationHubFlowConfigResponse( worker_count = 1, max_events_per_message = 1, max_retries = 0, ), ) """ - def testPrismaticFlowResponse(self): - """Test PrismaticFlowResponse""" + def testIntegrationHubFlowResponse(self): + """Test IntegrationHubFlowResponse""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_prismatic_flow_with_config.py b/test/test_integration_hub_flow_with_config.py similarity index 67% rename from test/test_prismatic_flow_with_config.py rename to test/test_integration_hub_flow_with_config.py index 2e707db..d79fee4 100644 --- a/test/test_prismatic_flow_with_config.py +++ b/test/test_integration_hub_flow_with_config.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.prismatic_flow_with_config import PrismaticFlowWithConfig +from talon_one.models.integration_hub_flow_with_config import IntegrationHubFlowWithConfig -class TestPrismaticFlowWithConfig(unittest.TestCase): - """PrismaticFlowWithConfig unit test stubs""" +class TestIntegrationHubFlowWithConfig(unittest.TestCase): + """IntegrationHubFlowWithConfig unit test stubs""" def setUp(self): pass @@ -25,30 +25,30 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> PrismaticFlowWithConfig: - """Test PrismaticFlowWithConfig + def make_instance(self, include_optional) -> IntegrationHubFlowWithConfig: + """Test IntegrationHubFlowWithConfig 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 `PrismaticFlowWithConfig` + # uncomment below to create an instance of `IntegrationHubFlowWithConfig` """ - model = PrismaticFlowWithConfig() + model = IntegrationHubFlowWithConfig() if include_optional: - return PrismaticFlowWithConfig( + return IntegrationHubFlowWithConfig( application_id = 54, event_type = '', - prismatic_flow_url = '', - config = talon_one.models.prismatic_flow_config.PrismaticFlowConfig( + integration_hub_flow_url = '', + config = talon_one.models.integration_hub_flow_config.IntegrationHubFlowConfig( api_key = '', worker_count = 1, max_events_per_message = 1, max_retries = 0, ) ) else: - return PrismaticFlowWithConfig( + return IntegrationHubFlowWithConfig( event_type = '', - prismatic_flow_url = '', - config = talon_one.models.prismatic_flow_config.PrismaticFlowConfig( + integration_hub_flow_url = '', + config = talon_one.models.integration_hub_flow_config.IntegrationHubFlowConfig( api_key = '', worker_count = 1, max_events_per_message = 1, @@ -56,8 +56,8 @@ def make_instance(self, include_optional) -> PrismaticFlowWithConfig: ) """ - def testPrismaticFlowWithConfig(self): - """Test PrismaticFlowWithConfig""" + def testIntegrationHubFlowWithConfig(self): + """Test IntegrationHubFlowWithConfig""" # 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_hub_paginated_event_payload.py b/test/test_integration_hub_paginated_event_payload.py new file mode 100644 index 0000000..5ccdede --- /dev/null +++ b/test/test_integration_hub_paginated_event_payload.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.integration_hub_paginated_event_payload import IntegrationHubPaginatedEventPayload + +class TestIntegrationHubPaginatedEventPayload(unittest.TestCase): + """IntegrationHubPaginatedEventPayload unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IntegrationHubPaginatedEventPayload: + """Test IntegrationHubPaginatedEventPayload + 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 `IntegrationHubPaginatedEventPayload` + """ + model = IntegrationHubPaginatedEventPayload() + if include_optional: + 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', + data = [ + null + ] + ) + else: + return IntegrationHubPaginatedEventPayload( + total_result_size = 56, + event_type = 'LoyaltyPointsChanged', + data = [ + null + ], + ) + """ + + def testIntegrationHubPaginatedEventPayload(self): + """Test IntegrationHubPaginatedEventPayload""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_list_experiments200_response.py b/test/test_list_experiments200_response.py new file mode 100644 index 0000000..ea1c451 --- /dev/null +++ b/test/test_list_experiments200_response.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#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.list_experiments200_response import ListExperiments200Response + +class TestListExperiments200Response(unittest.TestCase): + """ListExperiments200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ListExperiments200Response: + """Test ListExperiments200Response + 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 `ListExperiments200Response` + """ + model = ListExperiments200Response() + if include_optional: + return ListExperiments200Response( + total_result_size = 1, + data = [ + null + ] + ) + else: + return ListExperiments200Response( + total_result_size = 1, + data = [ + null + ], + ) + """ + + def testListExperiments200Response(self): + """Test ListExperiments200Response""" + # 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_prismatic_paginated_event_payload.py b/test/test_loyalty_points_changed_event_request.py similarity index 73% rename from test/test_prismatic_paginated_event_payload.py rename to test/test_loyalty_points_changed_event_request.py index 4550723..192a5c4 100644 --- a/test/test_prismatic_paginated_event_payload.py +++ b/test/test_loyalty_points_changed_event_request.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.prismatic_paginated_event_payload import PrismaticPaginatedEventPayload +from talon_one.models.loyalty_points_changed_event_request import LoyaltyPointsChangedEventRequest -class TestPrismaticPaginatedEventPayload(unittest.TestCase): - """PrismaticPaginatedEventPayload unit test stubs""" +class TestLoyaltyPointsChangedEventRequest(unittest.TestCase): + """LoyaltyPointsChangedEventRequest unit test stubs""" def setUp(self): pass @@ -25,16 +25,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> PrismaticPaginatedEventPayload: - """Test PrismaticPaginatedEventPayload + def make_instance(self, include_optional) -> LoyaltyPointsChangedEventRequest: + """Test LoyaltyPointsChangedEventRequest 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 `PrismaticPaginatedEventPayload` + # uncomment below to create an instance of `LoyaltyPointsChangedEventRequest` """ - model = PrismaticPaginatedEventPayload() + model = LoyaltyPointsChangedEventRequest() if include_optional: - return PrismaticPaginatedEventPayload( + return LoyaltyPointsChangedEventRequest( 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', @@ -43,7 +43,7 @@ def make_instance(self, include_optional) -> PrismaticPaginatedEventPayload: ] ) else: - return PrismaticPaginatedEventPayload( + return LoyaltyPointsChangedEventRequest( total_result_size = 56, event_type = 'LoyaltyPointsChanged', data = [ @@ -52,8 +52,8 @@ def make_instance(self, include_optional) -> PrismaticPaginatedEventPayload: ) """ - def testPrismaticPaginatedEventPayload(self): - """Test PrismaticPaginatedEventPayload""" + def testLoyaltyPointsChangedEventRequest(self): + """Test LoyaltyPointsChangedEventRequest""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_loyalty_tier_downgrade_event_request.py b/test/test_loyalty_tier_downgrade_event_request.py new file mode 100644 index 0000000..e832fd6 --- /dev/null +++ b/test/test_loyalty_tier_downgrade_event_request.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#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.loyalty_tier_downgrade_event_request import LoyaltyTierDowngradeEventRequest + +class TestLoyaltyTierDowngradeEventRequest(unittest.TestCase): + """LoyaltyTierDowngradeEventRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LoyaltyTierDowngradeEventRequest: + """Test LoyaltyTierDowngradeEventRequest + 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 `LoyaltyTierDowngradeEventRequest` + """ + model = LoyaltyTierDowngradeEventRequest() + if include_optional: + return LoyaltyTierDowngradeEventRequest( + 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 = 'LoyaltyTierDowngrade', + data = [ + null + ] + ) + else: + return LoyaltyTierDowngradeEventRequest( + total_result_size = 56, + event_type = 'LoyaltyTierDowngrade', + data = [ + null + ], + ) + """ + + def testLoyaltyTierDowngradeEventRequest(self): + """Test LoyaltyTierDowngradeEventRequest""" + # 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_loyalty_tier_upgrade_event_request.py b/test/test_loyalty_tier_upgrade_event_request.py new file mode 100644 index 0000000..2ae16f0 --- /dev/null +++ b/test/test_loyalty_tier_upgrade_event_request.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#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.loyalty_tier_upgrade_event_request import LoyaltyTierUpgradeEventRequest + +class TestLoyaltyTierUpgradeEventRequest(unittest.TestCase): + """LoyaltyTierUpgradeEventRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LoyaltyTierUpgradeEventRequest: + """Test LoyaltyTierUpgradeEventRequest + 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 `LoyaltyTierUpgradeEventRequest` + """ + model = LoyaltyTierUpgradeEventRequest() + if include_optional: + return LoyaltyTierUpgradeEventRequest( + 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 = 'LoyaltyTierUpgrade', + data = [ + null + ] + ) + else: + return LoyaltyTierUpgradeEventRequest( + total_result_size = 56, + event_type = 'LoyaltyTierUpgrade', + data = [ + null + ], + ) + """ + + def testLoyaltyTierUpgradeEventRequest(self): + """Test LoyaltyTierUpgradeEventRequest""" + # 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_management_api.py b/test/test_management_api.py index a3cc414..6d38bfd 100644 --- a/test/test_management_api.py +++ b/test/test_management_api.py @@ -299,6 +299,13 @@ def test_export_achievements(self) -> None: """ pass + def test_export_application_campaign_analytics(self) -> None: + """Test case for export_application_campaign_analytics + + Export Application analytics aggregated by campaign + """ + pass + def test_export_audiences_memberships(self) -> None: """Test case for export_audiences_memberships @@ -390,6 +397,13 @@ def test_export_loyalty_cards(self) -> None: """ pass + def test_export_loyalty_join_dates(self) -> None: + """Test case for export_loyalty_join_dates + + Export customers' loyalty program join dates + """ + pass + def test_export_loyalty_ledger(self) -> None: """Test case for export_loyalty_ledger @@ -719,6 +733,13 @@ def test_get_event_types(self) -> None: """ pass + def test_get_experiment(self) -> None: + """Test case for get_experiment + + Get experiment in Application + """ + pass + def test_get_exports(self) -> None: """Test case for get_exports @@ -1006,6 +1027,13 @@ def test_list_collections_in_application(self) -> None: """ pass + def test_list_experiments(self) -> None: + """Test case for list_experiments + + List experiments + """ + pass + def test_list_stores(self) -> None: """Test case for list_stores diff --git a/test/test_new_experiment.py b/test/test_new_experiment.py index 51dd8c5..c2b3e92 100644 --- a/test/test_new_experiment.py +++ b/test/test_new_experiment.py @@ -36,8 +36,6 @@ def make_instance(self, include_optional) -> NewExperiment: if include_optional: return NewExperiment( is_variant_assignment_external = True, - activated = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - state = 'disabled', campaign = None ) else: diff --git a/test/test_new_experiment_variant.py b/test/test_new_experiment_variant.py index c3e7b8a..4cebe7b 100644 --- a/test/test_new_experiment_variant.py +++ b/test/test_new_experiment_variant.py @@ -35,7 +35,7 @@ def make_instance(self, include_optional) -> NewExperimentVariant: model = NewExperimentVariant() if include_optional: return NewExperimentVariant( - name = 'AXyB u h9cRnacyv IL 9 WTpJZ0', + name = 'Variant A', weight = 13, ruleset = talon_one.models.new_ruleset.NewRuleset( rules = [ @@ -74,7 +74,7 @@ def make_instance(self, include_optional) -> NewExperimentVariant: ) else: return NewExperimentVariant( - name = 'AXyB u h9cRnacyv IL 9 WTpJZ0', + name = 'Variant A', weight = 13, ruleset = talon_one.models.new_ruleset.NewRuleset( rules = [ diff --git a/test/test_new_experiment_variant_array.py b/test/test_new_experiment_variant_array.py index 0cd900a..46f8a02 100644 --- a/test/test_new_experiment_variant_array.py +++ b/test/test_new_experiment_variant_array.py @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> NewExperimentVariantArray: return NewExperimentVariantArray( variants = [ talon_one.models.new_experiment_variant.NewExperimentVariant( - name = 'AXyB u h9cRnacyv IL 9 WTpJZ0', + name = 'Variant A', weight = 13, ruleset = talon_one.models.new_ruleset.NewRuleset( rules = [ @@ -79,7 +79,7 @@ def make_instance(self, include_optional) -> NewExperimentVariantArray: return NewExperimentVariantArray( variants = [ talon_one.models.new_experiment_variant.NewExperimentVariant( - name = 'AXyB u h9cRnacyv IL 9 WTpJZ0', + name = 'Variant A', weight = 13, ruleset = talon_one.models.new_ruleset.NewRuleset( rules = [ diff --git a/test/test_price_history_request.py b/test/test_price_history_request.py new file mode 100644 index 0000000..82f92f3 --- /dev/null +++ b/test/test_price_history_request.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#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.price_history_request import PriceHistoryRequest + +class TestPriceHistoryRequest(unittest.TestCase): + """PriceHistoryRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PriceHistoryRequest: + """Test PriceHistoryRequest + 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 `PriceHistoryRequest` + """ + model = PriceHistoryRequest() + if include_optional: + return PriceHistoryRequest( + sku = '[sku-124]', + start_date = '2020-11-10T23:00:00Z', + end_date = '2020-12-10T23:00:00Z' + ) + else: + return PriceHistoryRequest( + sku = '[sku-124]', + start_date = '2020-11-10T23:00:00Z', + end_date = '2020-12-10T23:00:00Z', + ) + """ + + def testPriceHistoryRequest(self): + """Test PriceHistoryRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_price_history_response.py b/test/test_price_history_response.py new file mode 100644 index 0000000..9af97a1 --- /dev/null +++ b/test/test_price_history_response.py @@ -0,0 +1,82 @@ +# 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) are used 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#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.price_history_response import PriceHistoryResponse + +class TestPriceHistoryResponse(unittest.TestCase): + """PriceHistoryResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PriceHistoryResponse: + """Test PriceHistoryResponse + 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 `PriceHistoryResponse` + """ + model = PriceHistoryResponse() + if include_optional: + return PriceHistoryResponse( + sku = '[SKU1241028]', + history = [ + talon_one.models.history.History( + id = 1, + observed_at = '2020-11-10T23:00:00Z', + context_id = 'Summer Sale 2025', + price = 99.99, + metadata = talon_one.models.best_prior_price_metadata.BestPriorPriceMetadata( + influencing_campaign_details = [ + talon_one.models.influencing_campaign_details.InfluencingCampaignDetails( + campaign_id = 56, + discount_value = 1.337, ) + ], + adjustment_details = null, ), + target = talon_one.models.label_target.LabelTarget(), ) + ] + ) + else: + return PriceHistoryResponse( + sku = '[SKU1241028]', + history = [ + talon_one.models.history.History( + id = 1, + observed_at = '2020-11-10T23:00:00Z', + context_id = 'Summer Sale 2025', + price = 99.99, + metadata = talon_one.models.best_prior_price_metadata.BestPriorPriceMetadata( + influencing_campaign_details = [ + talon_one.models.influencing_campaign_details.InfluencingCampaignDetails( + campaign_id = 56, + discount_value = 1.337, ) + ], + adjustment_details = null, ), + target = talon_one.models.label_target.LabelTarget(), ) + ], + ) + """ + + def testPriceHistoryResponse(self): + """Test PriceHistoryResponse""" + # 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_promote_experiment.py b/test/test_promote_experiment.py new file mode 100644 index 0000000..03e9d26 --- /dev/null +++ b/test/test_promote_experiment.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used 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#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.promote_experiment import PromoteExperiment + +class TestPromoteExperiment(unittest.TestCase): + """PromoteExperiment unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PromoteExperiment: + """Test PromoteExperiment + 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 `PromoteExperiment` + """ + model = PromoteExperiment() + if include_optional: + return PromoteExperiment( + target_application_id = 56, + variant_id = 56, + disable_experiment = True, + campaign = talon_one.models.experiment_campaign_copy.ExperimentCampaignCopy( + name = 'Copy of Summer promotions', + description = 'Campaign for all summer 2021 promotions', + start_time = '2021-06-01T09:00:27.993483Z', + end_time = '2021-09-10T01:00:00.993483Z', + tags = [Summer, Shoes], + evaluation_group_id = 2, ) + ) + else: + return PromoteExperiment( + target_application_id = 56, + variant_id = 56, + campaign = talon_one.models.experiment_campaign_copy.ExperimentCampaignCopy( + name = 'Copy of Summer promotions', + description = 'Campaign for all summer 2021 promotions', + start_time = '2021-06-01T09:00:27.993483Z', + end_time = '2021-09-10T01:00:00.993483Z', + tags = [Summer, Shoes], + evaluation_group_id = 2, ), + ) + """ + + def testPromoteExperiment(self): + """Test PromoteExperiment""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()