trustcomponent 0.0.1b0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. trustcomponent/__init__.py +7 -0
  2. trustcomponent/_client.py +54 -0
  3. trustcomponent/_generated/__init__.py +186 -0
  4. trustcomponent/_generated/api/__init__.py +12 -0
  5. trustcomponent/_generated/api/analytics_server_events_api.py +330 -0
  6. trustcomponent/_generated/api/analytics_websites_api.py +2006 -0
  7. trustcomponent/_generated/api/captcha_verifications_api.py +335 -0
  8. trustcomponent/_generated/api/monitoring_heartbeats_api.py +315 -0
  9. trustcomponent/_generated/api/platform_events_api.py +381 -0
  10. trustcomponent/_generated/api/tax_validation_schedules_api.py +579 -0
  11. trustcomponent/_generated/api/tax_validation_validation_results_api.py +305 -0
  12. trustcomponent/_generated/api/tax_validation_validations_api.py +609 -0
  13. trustcomponent/_generated/api_client.py +819 -0
  14. trustcomponent/_generated/api_response.py +21 -0
  15. trustcomponent/_generated/configuration.py +630 -0
  16. trustcomponent/_generated/exceptions.py +218 -0
  17. trustcomponent/_generated/models/__init__.py +78 -0
  18. trustcomponent/_generated/models/analytics_event_category_enum.py +49 -0
  19. trustcomponent/_generated/models/analytics_realtime.py +110 -0
  20. trustcomponent/_generated/models/analytics_realtime_page.py +90 -0
  21. trustcomponent/_generated/models/analytics_realtime_point.py +90 -0
  22. trustcomponent/_generated/models/analytics_server_event_batch_create_params.py +106 -0
  23. trustcomponent/_generated/models/analytics_server_event_batch_event_commerce_create_params.py +113 -0
  24. trustcomponent/_generated/models/analytics_server_event_batch_event_commerce_product_create_params.py +97 -0
  25. trustcomponent/_generated/models/analytics_server_event_batch_event_create_params.py +131 -0
  26. trustcomponent/_generated/models/analytics_server_event_batch_event_error_create_params.py +95 -0
  27. trustcomponent/_generated/models/analytics_server_event_batch_event_refund_create_params.py +91 -0
  28. trustcomponent/_generated/models/analytics_server_event_batch_result.py +98 -0
  29. trustcomponent/_generated/models/analytics_server_event_batch_result_drop_reason_enum.py +49 -0
  30. trustcomponent/_generated/models/analytics_server_event_batch_result_dropped.py +91 -0
  31. trustcomponent/_generated/models/analytics_stats_breakdown.py +109 -0
  32. trustcomponent/_generated/models/analytics_stats_breakdown_row.py +100 -0
  33. trustcomponent/_generated/models/analytics_stats_breakdown_row_page.py +111 -0
  34. trustcomponent/_generated/models/analytics_stats_conversions.py +102 -0
  35. trustcomponent/_generated/models/analytics_stats_conversions_goal.py +110 -0
  36. trustcomponent/_generated/models/analytics_stats_conversions_goal_revenue.py +90 -0
  37. trustcomponent/_generated/models/analytics_stats_dimension_enum.py +66 -0
  38. trustcomponent/_generated/models/analytics_stats_filter_match_mode_enum.py +37 -0
  39. trustcomponent/_generated/models/analytics_stats_filter_operator_enum.py +42 -0
  40. trustcomponent/_generated/models/analytics_stats_granularity_enum.py +37 -0
  41. trustcomponent/_generated/models/analytics_stats_overview.py +105 -0
  42. trustcomponent/_generated/models/analytics_stats_timeseries.py +103 -0
  43. trustcomponent/_generated/models/analytics_stats_timeseries_point.py +94 -0
  44. trustcomponent/_generated/models/analytics_stats_totals.py +117 -0
  45. trustcomponent/_generated/models/analytics_website.py +95 -0
  46. trustcomponent/_generated/models/analytics_websites_page.py +102 -0
  47. trustcomponent/_generated/models/captcha_verification_result.py +128 -0
  48. trustcomponent/_generated/models/platform_event.py +136 -0
  49. trustcomponent/_generated/models/platform_event_actor.py +110 -0
  50. trustcomponent/_generated/models/platform_event_actor_automation.py +91 -0
  51. trustcomponent/_generated/models/platform_event_actor_automation_kind_enum.py +38 -0
  52. trustcomponent/_generated/models/platform_event_actor_type_enum.py +40 -0
  53. trustcomponent/_generated/models/platform_event_change.py +107 -0
  54. trustcomponent/_generated/models/platform_event_change_operation_enum.py +40 -0
  55. trustcomponent/_generated/models/platform_event_origin.py +107 -0
  56. trustcomponent/_generated/models/platform_event_ref.py +98 -0
  57. trustcomponent/_generated/models/platform_event_source_enum.py +41 -0
  58. trustcomponent/_generated/models/platform_events_page.py +113 -0
  59. trustcomponent/_generated/models/tax_validation_match_status_enum.py +41 -0
  60. trustcomponent/_generated/models/tax_validation_provider_enum.py +43 -0
  61. trustcomponent/_generated/models/tax_validation_provider_status_enum.py +48 -0
  62. trustcomponent/_generated/models/tax_validation_schedule.py +124 -0
  63. trustcomponent/_generated/models/tax_validation_schedule_create_params.py +135 -0
  64. trustcomponent/_generated/models/tax_validation_tax_address.py +121 -0
  65. trustcomponent/_generated/models/tax_validation_tax_identifier_scheme_enum.py +46 -0
  66. trustcomponent/_generated/models/tax_validation_validation.py +163 -0
  67. trustcomponent/_generated/models/tax_validation_validation_address_match.py +97 -0
  68. trustcomponent/_generated/models/tax_validation_validation_batch_create_params.py +97 -0
  69. trustcomponent/_generated/models/tax_validation_validation_create_params.py +135 -0
  70. trustcomponent/_generated/models/tax_validation_validation_frequency_enum.py +38 -0
  71. trustcomponent/_generated/models/tax_validation_validation_input.py +117 -0
  72. trustcomponent/_generated/models/tax_validation_validation_match.py +97 -0
  73. trustcomponent/_generated/models/tax_validation_validation_mode_enum.py +37 -0
  74. trustcomponent/_generated/models/tax_validation_validation_outcome_enum.py +41 -0
  75. trustcomponent/_generated/models/tax_validation_validation_request_status_enum.py +41 -0
  76. trustcomponent/_generated/models/tax_validation_validation_response_data.py +113 -0
  77. trustcomponent/_generated/models/tax_validation_validation_result.py +146 -0
  78. trustcomponent/_generated/models/tax_validation_validation_schedule_attach_params.py +109 -0
  79. trustcomponent/_generated/models/tax_validation_verification_method_enum.py +37 -0
  80. trustcomponent/_generated/modules.py +42 -0
  81. trustcomponent/_generated/py.typed +0 -0
  82. trustcomponent/_generated/rest.py +313 -0
  83. trustcomponent/_http.py +90 -0
  84. trustcomponent/captcha.py +33 -0
  85. trustcomponent/errors.py +51 -0
  86. trustcomponent-0.0.1b0.dist-info/METADATA +98 -0
  87. trustcomponent-0.0.1b0.dist-info/RECORD +89 -0
  88. trustcomponent-0.0.1b0.dist-info/WHEEL +4 -0
  89. trustcomponent-0.0.1b0.dist-info/licenses/LICENSE.md +21 -0
@@ -0,0 +1,7 @@
1
+ from trustcomponent._client import TrustComponent
2
+ from trustcomponent.captcha import CaptchaModule, VerificationToken, parse_verification_token
3
+ from trustcomponent.errors import * # noqa: F401,F403
4
+ from trustcomponent._generated import models
5
+
6
+ __all__ = ["TrustComponent", "CaptchaModule", "VerificationToken", "parse_verification_token", "models"]
7
+ __version__ = TrustComponent.version
@@ -0,0 +1,54 @@
1
+ from __future__ import annotations
2
+
3
+ import base64
4
+ import json
5
+ import logging
6
+ import platform
7
+ from typing import Callable, Optional
8
+
9
+ from trustcomponent._generated.configuration import Configuration
10
+ from trustcomponent._generated.modules import API_VERSION, SDK_VERSION, AnalyticsModule, MonitoringModule, PlatformModule, TaxValidationModule
11
+ from trustcomponent._http import SdkApiClient
12
+ from trustcomponent.captcha import CaptchaModule
13
+
14
+ DEFAULT_HOST = "https://api.trustcomponent.com"
15
+ _logger = logging.getLogger("trustcomponent")
16
+
17
+
18
+ class TrustComponent:
19
+ """Entry point of the SDK. ``TrustComponent("ak_…")`` is all most integrations need; keyword arguments change host,
20
+ timeout, proxy, retries and the rest."""
21
+
22
+ version = SDK_VERSION
23
+
24
+ def __init__(
25
+ self,
26
+ api_key: str,
27
+ *,
28
+ host: str = DEFAULT_HOST,
29
+ timeout: float = 10.0,
30
+ proxy: Optional[str] = None,
31
+ max_retries: int = 2,
32
+ deprecation_warnings: bool = True,
33
+ integration: Optional[str] = None,
34
+ logger: Callable[[str], None] = _logger.warning,
35
+ ) -> None:
36
+ if not api_key or not api_key.strip():
37
+ raise ValueError("api_key must not be empty")
38
+ configuration = Configuration(host=host.rstrip("/"), access_token=api_key.strip(), retries=False, proxy=proxy)
39
+ client = SdkApiClient(configuration, timeout, max(0, max_retries), deprecation_warnings, logger)
40
+ client.user_agent = f"trustcomponent-python/{SDK_VERSION}"
41
+ client.set_default_header("Authorization", f"Bearer {api_key.strip()}")
42
+ client.set_default_header("TrustComponent-Sdk", _sdk_header(integration))
43
+ self.captcha = CaptchaModule(client)
44
+ self.analytics = AnalyticsModule(client)
45
+ self.monitoring = MonitoringModule(client)
46
+ self.tax_validation = TaxValidationModule(client)
47
+ self.platform = PlatformModule(client)
48
+
49
+
50
+ def _sdk_header(integration: Optional[str]) -> str:
51
+ metadata = {"sdk": "python", "version": SDK_VERSION, "api": API_VERSION, "runtime": f"python/{platform.python_version()}", "os": platform.system()}
52
+ if integration:
53
+ metadata["integration"] = integration
54
+ return base64.b64encode(json.dumps(metadata, separators=(",", ":")).encode()).decode()
@@ -0,0 +1,186 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+
5
+ """
6
+ TrustComponent API
7
+
8
+ The public API of every TrustComponent module, authenticated with an API key (`ak_…`). Each operation carries its own version in its path.
9
+
10
+ The version of the OpenAPI document: 0.0.1-beta.0
11
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
12
+
13
+ Do not edit the class manually.
14
+ """ # noqa: E501
15
+
16
+
17
+ __version__ = "0.0.1-beta.0"
18
+
19
+ # Define package exports
20
+ __all__ = [
21
+ "AnalyticsServerEventsApi",
22
+ "AnalyticsWebsitesApi",
23
+ "CaptchaVerificationsApi",
24
+ "MonitoringHeartbeatsApi",
25
+ "PlatformEventsApi",
26
+ "TaxValidationSchedulesApi",
27
+ "TaxValidationValidationResultsApi",
28
+ "TaxValidationValidationsApi",
29
+ "ApiResponse",
30
+ "ApiClient",
31
+ "Configuration",
32
+ "OpenApiException",
33
+ "ApiTypeError",
34
+ "ApiValueError",
35
+ "ApiKeyError",
36
+ "ApiAttributeError",
37
+ "ApiException",
38
+ "AnalyticsEventCategoryEnum",
39
+ "AnalyticsRealtime",
40
+ "AnalyticsRealtimePage",
41
+ "AnalyticsRealtimePoint",
42
+ "AnalyticsServerEventBatchCreateParams",
43
+ "AnalyticsServerEventBatchEventCommerceCreateParams",
44
+ "AnalyticsServerEventBatchEventCommerceProductCreateParams",
45
+ "AnalyticsServerEventBatchEventCreateParams",
46
+ "AnalyticsServerEventBatchEventErrorCreateParams",
47
+ "AnalyticsServerEventBatchEventRefundCreateParams",
48
+ "AnalyticsServerEventBatchResult",
49
+ "AnalyticsServerEventBatchResultDropReasonEnum",
50
+ "AnalyticsServerEventBatchResultDropped",
51
+ "AnalyticsStatsBreakdown",
52
+ "AnalyticsStatsBreakdownRow",
53
+ "AnalyticsStatsBreakdownRowPage",
54
+ "AnalyticsStatsConversions",
55
+ "AnalyticsStatsConversionsGoal",
56
+ "AnalyticsStatsConversionsGoalRevenue",
57
+ "AnalyticsStatsDimensionEnum",
58
+ "AnalyticsStatsFilterMatchModeEnum",
59
+ "AnalyticsStatsFilterOperatorEnum",
60
+ "AnalyticsStatsGranularityEnum",
61
+ "AnalyticsStatsOverview",
62
+ "AnalyticsStatsTimeseries",
63
+ "AnalyticsStatsTimeseriesPoint",
64
+ "AnalyticsStatsTotals",
65
+ "AnalyticsWebsite",
66
+ "AnalyticsWebsitesPage",
67
+ "CaptchaVerificationResult",
68
+ "PlatformEvent",
69
+ "PlatformEventActor",
70
+ "PlatformEventActorAutomation",
71
+ "PlatformEventActorAutomationKindEnum",
72
+ "PlatformEventActorTypeEnum",
73
+ "PlatformEventChange",
74
+ "PlatformEventChangeOperationEnum",
75
+ "PlatformEventOrigin",
76
+ "PlatformEventRef",
77
+ "PlatformEventSourceEnum",
78
+ "PlatformEventsPage",
79
+ "TaxValidationMatchStatusEnum",
80
+ "TaxValidationProviderEnum",
81
+ "TaxValidationProviderStatusEnum",
82
+ "TaxValidationSchedule",
83
+ "TaxValidationScheduleCreateParams",
84
+ "TaxValidationTaxAddress",
85
+ "TaxValidationTaxIdentifierSchemeEnum",
86
+ "TaxValidationValidation",
87
+ "TaxValidationValidationAddressMatch",
88
+ "TaxValidationValidationBatchCreateParams",
89
+ "TaxValidationValidationCreateParams",
90
+ "TaxValidationValidationFrequencyEnum",
91
+ "TaxValidationValidationInput",
92
+ "TaxValidationValidationMatch",
93
+ "TaxValidationValidationModeEnum",
94
+ "TaxValidationValidationOutcomeEnum",
95
+ "TaxValidationValidationRequestStatusEnum",
96
+ "TaxValidationValidationResponseData",
97
+ "TaxValidationValidationResult",
98
+ "TaxValidationValidationScheduleAttachParams",
99
+ "TaxValidationVerificationMethodEnum",
100
+ ]
101
+
102
+ # import apis into sdk package
103
+ from trustcomponent._generated.api.analytics_server_events_api import AnalyticsServerEventsApi as AnalyticsServerEventsApi
104
+ from trustcomponent._generated.api.analytics_websites_api import AnalyticsWebsitesApi as AnalyticsWebsitesApi
105
+ from trustcomponent._generated.api.captcha_verifications_api import CaptchaVerificationsApi as CaptchaVerificationsApi
106
+ from trustcomponent._generated.api.monitoring_heartbeats_api import MonitoringHeartbeatsApi as MonitoringHeartbeatsApi
107
+ from trustcomponent._generated.api.platform_events_api import PlatformEventsApi as PlatformEventsApi
108
+ from trustcomponent._generated.api.tax_validation_schedules_api import TaxValidationSchedulesApi as TaxValidationSchedulesApi
109
+ from trustcomponent._generated.api.tax_validation_validation_results_api import TaxValidationValidationResultsApi as TaxValidationValidationResultsApi
110
+ from trustcomponent._generated.api.tax_validation_validations_api import TaxValidationValidationsApi as TaxValidationValidationsApi
111
+
112
+ # import ApiClient
113
+ from trustcomponent._generated.api_response import ApiResponse as ApiResponse
114
+ from trustcomponent._generated.api_client import ApiClient as ApiClient
115
+ from trustcomponent._generated.configuration import Configuration as Configuration
116
+ from trustcomponent._generated.exceptions import OpenApiException as OpenApiException
117
+ from trustcomponent._generated.exceptions import ApiTypeError as ApiTypeError
118
+ from trustcomponent._generated.exceptions import ApiValueError as ApiValueError
119
+ from trustcomponent._generated.exceptions import ApiKeyError as ApiKeyError
120
+ from trustcomponent._generated.exceptions import ApiAttributeError as ApiAttributeError
121
+ from trustcomponent._generated.exceptions import ApiException as ApiException
122
+
123
+ # import models into sdk package
124
+ from trustcomponent._generated.models.analytics_event_category_enum import AnalyticsEventCategoryEnum as AnalyticsEventCategoryEnum
125
+ from trustcomponent._generated.models.analytics_realtime import AnalyticsRealtime as AnalyticsRealtime
126
+ from trustcomponent._generated.models.analytics_realtime_page import AnalyticsRealtimePage as AnalyticsRealtimePage
127
+ from trustcomponent._generated.models.analytics_realtime_point import AnalyticsRealtimePoint as AnalyticsRealtimePoint
128
+ from trustcomponent._generated.models.analytics_server_event_batch_create_params import AnalyticsServerEventBatchCreateParams as AnalyticsServerEventBatchCreateParams
129
+ from trustcomponent._generated.models.analytics_server_event_batch_event_commerce_create_params import AnalyticsServerEventBatchEventCommerceCreateParams as AnalyticsServerEventBatchEventCommerceCreateParams
130
+ from trustcomponent._generated.models.analytics_server_event_batch_event_commerce_product_create_params import AnalyticsServerEventBatchEventCommerceProductCreateParams as AnalyticsServerEventBatchEventCommerceProductCreateParams
131
+ from trustcomponent._generated.models.analytics_server_event_batch_event_create_params import AnalyticsServerEventBatchEventCreateParams as AnalyticsServerEventBatchEventCreateParams
132
+ from trustcomponent._generated.models.analytics_server_event_batch_event_error_create_params import AnalyticsServerEventBatchEventErrorCreateParams as AnalyticsServerEventBatchEventErrorCreateParams
133
+ from trustcomponent._generated.models.analytics_server_event_batch_event_refund_create_params import AnalyticsServerEventBatchEventRefundCreateParams as AnalyticsServerEventBatchEventRefundCreateParams
134
+ from trustcomponent._generated.models.analytics_server_event_batch_result import AnalyticsServerEventBatchResult as AnalyticsServerEventBatchResult
135
+ from trustcomponent._generated.models.analytics_server_event_batch_result_drop_reason_enum import AnalyticsServerEventBatchResultDropReasonEnum as AnalyticsServerEventBatchResultDropReasonEnum
136
+ from trustcomponent._generated.models.analytics_server_event_batch_result_dropped import AnalyticsServerEventBatchResultDropped as AnalyticsServerEventBatchResultDropped
137
+ from trustcomponent._generated.models.analytics_stats_breakdown import AnalyticsStatsBreakdown as AnalyticsStatsBreakdown
138
+ from trustcomponent._generated.models.analytics_stats_breakdown_row import AnalyticsStatsBreakdownRow as AnalyticsStatsBreakdownRow
139
+ from trustcomponent._generated.models.analytics_stats_breakdown_row_page import AnalyticsStatsBreakdownRowPage as AnalyticsStatsBreakdownRowPage
140
+ from trustcomponent._generated.models.analytics_stats_conversions import AnalyticsStatsConversions as AnalyticsStatsConversions
141
+ from trustcomponent._generated.models.analytics_stats_conversions_goal import AnalyticsStatsConversionsGoal as AnalyticsStatsConversionsGoal
142
+ from trustcomponent._generated.models.analytics_stats_conversions_goal_revenue import AnalyticsStatsConversionsGoalRevenue as AnalyticsStatsConversionsGoalRevenue
143
+ from trustcomponent._generated.models.analytics_stats_dimension_enum import AnalyticsStatsDimensionEnum as AnalyticsStatsDimensionEnum
144
+ from trustcomponent._generated.models.analytics_stats_filter_match_mode_enum import AnalyticsStatsFilterMatchModeEnum as AnalyticsStatsFilterMatchModeEnum
145
+ from trustcomponent._generated.models.analytics_stats_filter_operator_enum import AnalyticsStatsFilterOperatorEnum as AnalyticsStatsFilterOperatorEnum
146
+ from trustcomponent._generated.models.analytics_stats_granularity_enum import AnalyticsStatsGranularityEnum as AnalyticsStatsGranularityEnum
147
+ from trustcomponent._generated.models.analytics_stats_overview import AnalyticsStatsOverview as AnalyticsStatsOverview
148
+ from trustcomponent._generated.models.analytics_stats_timeseries import AnalyticsStatsTimeseries as AnalyticsStatsTimeseries
149
+ from trustcomponent._generated.models.analytics_stats_timeseries_point import AnalyticsStatsTimeseriesPoint as AnalyticsStatsTimeseriesPoint
150
+ from trustcomponent._generated.models.analytics_stats_totals import AnalyticsStatsTotals as AnalyticsStatsTotals
151
+ from trustcomponent._generated.models.analytics_website import AnalyticsWebsite as AnalyticsWebsite
152
+ from trustcomponent._generated.models.analytics_websites_page import AnalyticsWebsitesPage as AnalyticsWebsitesPage
153
+ from trustcomponent._generated.models.captcha_verification_result import CaptchaVerificationResult as CaptchaVerificationResult
154
+ from trustcomponent._generated.models.platform_event import PlatformEvent as PlatformEvent
155
+ from trustcomponent._generated.models.platform_event_actor import PlatformEventActor as PlatformEventActor
156
+ from trustcomponent._generated.models.platform_event_actor_automation import PlatformEventActorAutomation as PlatformEventActorAutomation
157
+ from trustcomponent._generated.models.platform_event_actor_automation_kind_enum import PlatformEventActorAutomationKindEnum as PlatformEventActorAutomationKindEnum
158
+ from trustcomponent._generated.models.platform_event_actor_type_enum import PlatformEventActorTypeEnum as PlatformEventActorTypeEnum
159
+ from trustcomponent._generated.models.platform_event_change import PlatformEventChange as PlatformEventChange
160
+ from trustcomponent._generated.models.platform_event_change_operation_enum import PlatformEventChangeOperationEnum as PlatformEventChangeOperationEnum
161
+ from trustcomponent._generated.models.platform_event_origin import PlatformEventOrigin as PlatformEventOrigin
162
+ from trustcomponent._generated.models.platform_event_ref import PlatformEventRef as PlatformEventRef
163
+ from trustcomponent._generated.models.platform_event_source_enum import PlatformEventSourceEnum as PlatformEventSourceEnum
164
+ from trustcomponent._generated.models.platform_events_page import PlatformEventsPage as PlatformEventsPage
165
+ from trustcomponent._generated.models.tax_validation_match_status_enum import TaxValidationMatchStatusEnum as TaxValidationMatchStatusEnum
166
+ from trustcomponent._generated.models.tax_validation_provider_enum import TaxValidationProviderEnum as TaxValidationProviderEnum
167
+ from trustcomponent._generated.models.tax_validation_provider_status_enum import TaxValidationProviderStatusEnum as TaxValidationProviderStatusEnum
168
+ from trustcomponent._generated.models.tax_validation_schedule import TaxValidationSchedule as TaxValidationSchedule
169
+ from trustcomponent._generated.models.tax_validation_schedule_create_params import TaxValidationScheduleCreateParams as TaxValidationScheduleCreateParams
170
+ from trustcomponent._generated.models.tax_validation_tax_address import TaxValidationTaxAddress as TaxValidationTaxAddress
171
+ from trustcomponent._generated.models.tax_validation_tax_identifier_scheme_enum import TaxValidationTaxIdentifierSchemeEnum as TaxValidationTaxIdentifierSchemeEnum
172
+ from trustcomponent._generated.models.tax_validation_validation import TaxValidationValidation as TaxValidationValidation
173
+ from trustcomponent._generated.models.tax_validation_validation_address_match import TaxValidationValidationAddressMatch as TaxValidationValidationAddressMatch
174
+ from trustcomponent._generated.models.tax_validation_validation_batch_create_params import TaxValidationValidationBatchCreateParams as TaxValidationValidationBatchCreateParams
175
+ from trustcomponent._generated.models.tax_validation_validation_create_params import TaxValidationValidationCreateParams as TaxValidationValidationCreateParams
176
+ from trustcomponent._generated.models.tax_validation_validation_frequency_enum import TaxValidationValidationFrequencyEnum as TaxValidationValidationFrequencyEnum
177
+ from trustcomponent._generated.models.tax_validation_validation_input import TaxValidationValidationInput as TaxValidationValidationInput
178
+ from trustcomponent._generated.models.tax_validation_validation_match import TaxValidationValidationMatch as TaxValidationValidationMatch
179
+ from trustcomponent._generated.models.tax_validation_validation_mode_enum import TaxValidationValidationModeEnum as TaxValidationValidationModeEnum
180
+ from trustcomponent._generated.models.tax_validation_validation_outcome_enum import TaxValidationValidationOutcomeEnum as TaxValidationValidationOutcomeEnum
181
+ from trustcomponent._generated.models.tax_validation_validation_request_status_enum import TaxValidationValidationRequestStatusEnum as TaxValidationValidationRequestStatusEnum
182
+ from trustcomponent._generated.models.tax_validation_validation_response_data import TaxValidationValidationResponseData as TaxValidationValidationResponseData
183
+ from trustcomponent._generated.models.tax_validation_validation_result import TaxValidationValidationResult as TaxValidationValidationResult
184
+ from trustcomponent._generated.models.tax_validation_validation_schedule_attach_params import TaxValidationValidationScheduleAttachParams as TaxValidationValidationScheduleAttachParams
185
+ from trustcomponent._generated.models.tax_validation_verification_method_enum import TaxValidationVerificationMethodEnum as TaxValidationVerificationMethodEnum
186
+
@@ -0,0 +1,12 @@
1
+ # flake8: noqa
2
+
3
+ # import apis into api package
4
+ from trustcomponent._generated.api.analytics_server_events_api import AnalyticsServerEventsApi
5
+ from trustcomponent._generated.api.analytics_websites_api import AnalyticsWebsitesApi
6
+ from trustcomponent._generated.api.captcha_verifications_api import CaptchaVerificationsApi
7
+ from trustcomponent._generated.api.monitoring_heartbeats_api import MonitoringHeartbeatsApi
8
+ from trustcomponent._generated.api.platform_events_api import PlatformEventsApi
9
+ from trustcomponent._generated.api.tax_validation_schedules_api import TaxValidationSchedulesApi
10
+ from trustcomponent._generated.api.tax_validation_validation_results_api import TaxValidationValidationResultsApi
11
+ from trustcomponent._generated.api.tax_validation_validations_api import TaxValidationValidationsApi
12
+
@@ -0,0 +1,330 @@
1
+ """
2
+ TrustComponent API
3
+
4
+ The public API of every TrustComponent module, authenticated with an API key (`ak_…`). Each operation carries its own version in its path.
5
+
6
+ The version of the OpenAPI document: 0.0.1-beta.0
7
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+
9
+ Do not edit the class manually.
10
+ """ # noqa: E501
11
+
12
+
13
+ import warnings
14
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+ from typing_extensions import Annotated
17
+
18
+ from pydantic import Field
19
+ from typing_extensions import Annotated
20
+ from trustcomponent._generated.models.analytics_server_event_batch_create_params import AnalyticsServerEventBatchCreateParams
21
+ from trustcomponent._generated.models.analytics_server_event_batch_result import AnalyticsServerEventBatchResult
22
+
23
+ from trustcomponent._generated.api_client import ApiClient, RequestSerialized
24
+ from trustcomponent._generated.api_response import ApiResponse
25
+ from trustcomponent._generated.rest import RESTResponseType
26
+
27
+
28
+ class AnalyticsServerEventsApi:
29
+ """NOTE: This class is auto generated by OpenAPI Generator
30
+ Ref: https://openapi-generator.tech
31
+
32
+ Do not edit the class manually.
33
+ """
34
+
35
+ def __init__(self, api_client=None) -> None:
36
+ if api_client is None:
37
+ api_client = ApiClient.get_default()
38
+ self.api_client = api_client
39
+
40
+
41
+ @validate_call
42
+ def create_server_event_batch(
43
+ self,
44
+ analytics_server_event_batch_create_params: Annotated[AnalyticsServerEventBatchCreateParams, Field(description="Website, the consent the operator vouches for, and the events")],
45
+ _request_timeout: Union[
46
+ None,
47
+ Annotated[StrictFloat, Field(gt=0)],
48
+ Tuple[
49
+ Annotated[StrictFloat, Field(gt=0)],
50
+ Annotated[StrictFloat, Field(gt=0)]
51
+ ]
52
+ ] = None,
53
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
54
+ _content_type: Optional[StrictStr] = None,
55
+ _headers: Optional[Dict[StrictStr, Any]] = None,
56
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
57
+ ) -> AnalyticsServerEventBatchResult:
58
+ """Accepts a batch of events from a customer backend
59
+
60
+ Verified business events that do not depend on a browser: a completed order, a refund, a signup confirmed by e-mail, a backend error. Authenticated with a project API key; the batch names the website, which must belong to the subscription of the key. Every event carries a stable id, so a retried batch never creates a second copy. The address and user agent of the request belong to the sending server and are never used for geo, device or bot detection; the end user's address and user agent are taken from the event only when the backend sends them explicitly, and neither is stored. A purchase sent from the server replaces the browser purchase of the same order id, a browser purchase never replaces a server one. A session that holds only server events counts for goals and revenue, but is no visit: sessions, visitors and bounce rate count sessions with at least one browser event. The server answers 202 as soon as the accepted events are written and lists per reason how many events it dropped.
61
+
62
+ :param analytics_server_event_batch_create_params: Website, the consent the operator vouches for, and the events (required)
63
+ :type analytics_server_event_batch_create_params: AnalyticsServerEventBatchCreateParams
64
+ :param _request_timeout: timeout setting for this request. If one
65
+ number provided, it will be total request
66
+ timeout. It can also be a pair (tuple) of
67
+ (connection, read) timeouts.
68
+ :type _request_timeout: int, tuple(int, int), optional
69
+ :param _request_auth: set to override the auth_settings for an a single
70
+ request; this effectively ignores the
71
+ authentication in the spec for a single request.
72
+ :type _request_auth: dict, optional
73
+ :param _content_type: force content-type for the request.
74
+ :type _content_type: str, Optional
75
+ :param _headers: set to override the headers for a single
76
+ request; this effectively ignores the headers
77
+ in the spec for a single request.
78
+ :type _headers: dict, optional
79
+ :param _host_index: set to override the host_index for a single
80
+ request; this effectively ignores the host_index
81
+ in the spec for a single request.
82
+ :type _host_index: int, optional
83
+ :return: Returns the result object.
84
+ """ # noqa: E501
85
+
86
+ _param = self._create_server_event_batch_serialize(
87
+ analytics_server_event_batch_create_params=analytics_server_event_batch_create_params,
88
+ _request_auth=_request_auth,
89
+ _content_type=_content_type,
90
+ _headers=_headers,
91
+ _host_index=_host_index
92
+ )
93
+
94
+ _response_types_map: Dict[str, Optional[str]] = {
95
+ '202': "AnalyticsServerEventBatchResult",
96
+ '400': None,
97
+ '401': None,
98
+ '403': None,
99
+ '404': None,
100
+ '413': None,
101
+ '429': None,
102
+ }
103
+ response_data = self.api_client.call_api(
104
+ *_param,
105
+ _request_timeout=_request_timeout
106
+ )
107
+ response_data.read()
108
+ return self.api_client.response_deserialize(
109
+ response_data=response_data,
110
+ response_types_map=_response_types_map,
111
+ ).data
112
+
113
+
114
+ @validate_call
115
+ def create_server_event_batch_with_http_info(
116
+ self,
117
+ analytics_server_event_batch_create_params: Annotated[AnalyticsServerEventBatchCreateParams, Field(description="Website, the consent the operator vouches for, and the events")],
118
+ _request_timeout: Union[
119
+ None,
120
+ Annotated[StrictFloat, Field(gt=0)],
121
+ Tuple[
122
+ Annotated[StrictFloat, Field(gt=0)],
123
+ Annotated[StrictFloat, Field(gt=0)]
124
+ ]
125
+ ] = None,
126
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
127
+ _content_type: Optional[StrictStr] = None,
128
+ _headers: Optional[Dict[StrictStr, Any]] = None,
129
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
130
+ ) -> ApiResponse[AnalyticsServerEventBatchResult]:
131
+ """Accepts a batch of events from a customer backend
132
+
133
+ Verified business events that do not depend on a browser: a completed order, a refund, a signup confirmed by e-mail, a backend error. Authenticated with a project API key; the batch names the website, which must belong to the subscription of the key. Every event carries a stable id, so a retried batch never creates a second copy. The address and user agent of the request belong to the sending server and are never used for geo, device or bot detection; the end user's address and user agent are taken from the event only when the backend sends them explicitly, and neither is stored. A purchase sent from the server replaces the browser purchase of the same order id, a browser purchase never replaces a server one. A session that holds only server events counts for goals and revenue, but is no visit: sessions, visitors and bounce rate count sessions with at least one browser event. The server answers 202 as soon as the accepted events are written and lists per reason how many events it dropped.
134
+
135
+ :param analytics_server_event_batch_create_params: Website, the consent the operator vouches for, and the events (required)
136
+ :type analytics_server_event_batch_create_params: AnalyticsServerEventBatchCreateParams
137
+ :param _request_timeout: timeout setting for this request. If one
138
+ number provided, it will be total request
139
+ timeout. It can also be a pair (tuple) of
140
+ (connection, read) timeouts.
141
+ :type _request_timeout: int, tuple(int, int), optional
142
+ :param _request_auth: set to override the auth_settings for an a single
143
+ request; this effectively ignores the
144
+ authentication in the spec for a single request.
145
+ :type _request_auth: dict, optional
146
+ :param _content_type: force content-type for the request.
147
+ :type _content_type: str, Optional
148
+ :param _headers: set to override the headers for a single
149
+ request; this effectively ignores the headers
150
+ in the spec for a single request.
151
+ :type _headers: dict, optional
152
+ :param _host_index: set to override the host_index for a single
153
+ request; this effectively ignores the host_index
154
+ in the spec for a single request.
155
+ :type _host_index: int, optional
156
+ :return: Returns the result object.
157
+ """ # noqa: E501
158
+
159
+ _param = self._create_server_event_batch_serialize(
160
+ analytics_server_event_batch_create_params=analytics_server_event_batch_create_params,
161
+ _request_auth=_request_auth,
162
+ _content_type=_content_type,
163
+ _headers=_headers,
164
+ _host_index=_host_index
165
+ )
166
+
167
+ _response_types_map: Dict[str, Optional[str]] = {
168
+ '202': "AnalyticsServerEventBatchResult",
169
+ '400': None,
170
+ '401': None,
171
+ '403': None,
172
+ '404': None,
173
+ '413': None,
174
+ '429': None,
175
+ }
176
+ response_data = self.api_client.call_api(
177
+ *_param,
178
+ _request_timeout=_request_timeout
179
+ )
180
+ response_data.read()
181
+ return self.api_client.response_deserialize(
182
+ response_data=response_data,
183
+ response_types_map=_response_types_map,
184
+ )
185
+
186
+
187
+ @validate_call
188
+ def create_server_event_batch_without_preload_content(
189
+ self,
190
+ analytics_server_event_batch_create_params: Annotated[AnalyticsServerEventBatchCreateParams, Field(description="Website, the consent the operator vouches for, and the events")],
191
+ _request_timeout: Union[
192
+ None,
193
+ Annotated[StrictFloat, Field(gt=0)],
194
+ Tuple[
195
+ Annotated[StrictFloat, Field(gt=0)],
196
+ Annotated[StrictFloat, Field(gt=0)]
197
+ ]
198
+ ] = None,
199
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
200
+ _content_type: Optional[StrictStr] = None,
201
+ _headers: Optional[Dict[StrictStr, Any]] = None,
202
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
203
+ ) -> RESTResponseType:
204
+ """Accepts a batch of events from a customer backend
205
+
206
+ Verified business events that do not depend on a browser: a completed order, a refund, a signup confirmed by e-mail, a backend error. Authenticated with a project API key; the batch names the website, which must belong to the subscription of the key. Every event carries a stable id, so a retried batch never creates a second copy. The address and user agent of the request belong to the sending server and are never used for geo, device or bot detection; the end user's address and user agent are taken from the event only when the backend sends them explicitly, and neither is stored. A purchase sent from the server replaces the browser purchase of the same order id, a browser purchase never replaces a server one. A session that holds only server events counts for goals and revenue, but is no visit: sessions, visitors and bounce rate count sessions with at least one browser event. The server answers 202 as soon as the accepted events are written and lists per reason how many events it dropped.
207
+
208
+ :param analytics_server_event_batch_create_params: Website, the consent the operator vouches for, and the events (required)
209
+ :type analytics_server_event_batch_create_params: AnalyticsServerEventBatchCreateParams
210
+ :param _request_timeout: timeout setting for this request. If one
211
+ number provided, it will be total request
212
+ timeout. It can also be a pair (tuple) of
213
+ (connection, read) timeouts.
214
+ :type _request_timeout: int, tuple(int, int), optional
215
+ :param _request_auth: set to override the auth_settings for an a single
216
+ request; this effectively ignores the
217
+ authentication in the spec for a single request.
218
+ :type _request_auth: dict, optional
219
+ :param _content_type: force content-type for the request.
220
+ :type _content_type: str, Optional
221
+ :param _headers: set to override the headers for a single
222
+ request; this effectively ignores the headers
223
+ in the spec for a single request.
224
+ :type _headers: dict, optional
225
+ :param _host_index: set to override the host_index for a single
226
+ request; this effectively ignores the host_index
227
+ in the spec for a single request.
228
+ :type _host_index: int, optional
229
+ :return: Returns the result object.
230
+ """ # noqa: E501
231
+
232
+ _param = self._create_server_event_batch_serialize(
233
+ analytics_server_event_batch_create_params=analytics_server_event_batch_create_params,
234
+ _request_auth=_request_auth,
235
+ _content_type=_content_type,
236
+ _headers=_headers,
237
+ _host_index=_host_index
238
+ )
239
+
240
+ _response_types_map: Dict[str, Optional[str]] = {
241
+ '202': "AnalyticsServerEventBatchResult",
242
+ '400': None,
243
+ '401': None,
244
+ '403': None,
245
+ '404': None,
246
+ '413': None,
247
+ '429': None,
248
+ }
249
+ response_data = self.api_client.call_api(
250
+ *_param,
251
+ _request_timeout=_request_timeout
252
+ )
253
+ return response_data.response
254
+
255
+
256
+ def _create_server_event_batch_serialize(
257
+ self,
258
+ analytics_server_event_batch_create_params,
259
+ _request_auth,
260
+ _content_type,
261
+ _headers,
262
+ _host_index,
263
+ ) -> RequestSerialized:
264
+
265
+ _host = None
266
+
267
+ _collection_formats: Dict[str, str] = {
268
+ }
269
+
270
+ _path_params: Dict[str, str] = {}
271
+ _query_params: List[Tuple[str, str]] = []
272
+ _header_params: Dict[str, Optional[str]] = _headers or {}
273
+ _form_params: List[Tuple[str, str]] = []
274
+ _files: Dict[
275
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
276
+ ] = {}
277
+ _body_params: Optional[bytes] = None
278
+
279
+ # process the path parameters
280
+ # process the query parameters
281
+ # process the header parameters
282
+ # process the form parameters
283
+ # process the body parameter
284
+ if analytics_server_event_batch_create_params is not None:
285
+ _body_params = analytics_server_event_batch_create_params
286
+
287
+
288
+ # set the HTTP header `Accept`
289
+ if 'Accept' not in _header_params:
290
+ _header_params['Accept'] = self.api_client.select_header_accept(
291
+ [
292
+ 'application/json'
293
+ ]
294
+ )
295
+
296
+ # set the HTTP header `Content-Type`
297
+ if _content_type:
298
+ _header_params['Content-Type'] = _content_type
299
+ else:
300
+ _default_content_type = (
301
+ self.api_client.select_header_content_type(
302
+ [
303
+ 'application/json'
304
+ ]
305
+ )
306
+ )
307
+ if _default_content_type is not None:
308
+ _header_params['Content-Type'] = _default_content_type
309
+
310
+ # authentication setting
311
+ _auth_settings: List[str] = [
312
+ 'bearerApiKey'
313
+ ]
314
+
315
+ return self.api_client.param_serialize(
316
+ method='POST',
317
+ resource_path='/analytics/v1/server-events/batches',
318
+ path_params=_path_params,
319
+ query_params=_query_params,
320
+ header_params=_header_params,
321
+ body=_body_params,
322
+ post_params=_form_params,
323
+ files=_files,
324
+ auth_settings=_auth_settings,
325
+ collection_formats=_collection_formats,
326
+ _host=_host,
327
+ _request_auth=_request_auth
328
+ )
329
+
330
+