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,335 @@
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, StrictBool
19
+ from typing import Optional
20
+ from typing_extensions import Annotated
21
+ from uuid import UUID
22
+ from trustcomponent._generated.models.captcha_verification_result import CaptchaVerificationResult
23
+
24
+ from trustcomponent._generated.api_client import ApiClient, RequestSerialized
25
+ from trustcomponent._generated.api_response import ApiResponse
26
+ from trustcomponent._generated.rest import RESTResponseType
27
+
28
+
29
+ class CaptchaVerificationsApi:
30
+ """NOTE: This class is auto generated by OpenAPI Generator
31
+ Ref: https://openapi-generator.tech
32
+
33
+ Do not edit the class manually.
34
+ """
35
+
36
+ def __init__(self, api_client=None) -> None:
37
+ if api_client is None:
38
+ api_client = ApiClient.get_default()
39
+ self.api_client = api_client
40
+
41
+
42
+ @validate_call
43
+ def get_result(
44
+ self,
45
+ verification_id: Annotated[UUID, Field(description="ID of a verification")],
46
+ client_failover: Annotated[Optional[StrictBool], Field(description="Set when the widget could not reach TrustCaptcha (`clientFailover` in its token). The public gateway then answers on its own and lets the visitor pass only while it has seen an outage itself.")] = None,
47
+ _request_timeout: Union[
48
+ None,
49
+ Annotated[StrictFloat, Field(gt=0)],
50
+ Tuple[
51
+ Annotated[StrictFloat, Field(gt=0)],
52
+ Annotated[StrictFloat, Field(gt=0)]
53
+ ]
54
+ ] = None,
55
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
56
+ _content_type: Optional[StrictStr] = None,
57
+ _headers: Optional[Dict[StrictStr, Any]] = None,
58
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
59
+ ) -> CaptchaVerificationResult:
60
+ """Returns the result of a verification
61
+
62
+ Call it from your server with the verification id from the token the widget put into your form. A 429 here means the result reached its maximum retrieval count and comes without `Retry-After`; it is final and is not retried.
63
+
64
+ :param verification_id: ID of a verification (required)
65
+ :type verification_id: UUID
66
+ :param client_failover: Set when the widget could not reach TrustCaptcha (`clientFailover` in its token). The public gateway then answers on its own and lets the visitor pass only while it has seen an outage itself.
67
+ :type client_failover: bool
68
+ :param _request_timeout: timeout setting for this request. If one
69
+ number provided, it will be total request
70
+ timeout. It can also be a pair (tuple) of
71
+ (connection, read) timeouts.
72
+ :type _request_timeout: int, tuple(int, int), optional
73
+ :param _request_auth: set to override the auth_settings for an a single
74
+ request; this effectively ignores the
75
+ authentication in the spec for a single request.
76
+ :type _request_auth: dict, optional
77
+ :param _content_type: force content-type for the request.
78
+ :type _content_type: str, Optional
79
+ :param _headers: set to override the headers for a single
80
+ request; this effectively ignores the headers
81
+ in the spec for a single request.
82
+ :type _headers: dict, optional
83
+ :param _host_index: set to override the host_index for a single
84
+ request; this effectively ignores the host_index
85
+ in the spec for a single request.
86
+ :type _host_index: int, optional
87
+ :return: Returns the result object.
88
+ """ # noqa: E501
89
+
90
+ _param = self._get_result_serialize(
91
+ verification_id=verification_id,
92
+ client_failover=client_failover,
93
+ _request_auth=_request_auth,
94
+ _content_type=_content_type,
95
+ _headers=_headers,
96
+ _host_index=_host_index
97
+ )
98
+
99
+ _response_types_map: Dict[str, Optional[str]] = {
100
+ '200': "CaptchaVerificationResult",
101
+ '403': None,
102
+ '404': None,
103
+ '410': None,
104
+ '412': None,
105
+ '423': None,
106
+ '429': None,
107
+ }
108
+ response_data = self.api_client.call_api(
109
+ *_param,
110
+ _request_timeout=_request_timeout
111
+ )
112
+ response_data.read()
113
+ return self.api_client.response_deserialize(
114
+ response_data=response_data,
115
+ response_types_map=_response_types_map,
116
+ ).data
117
+
118
+
119
+ @validate_call
120
+ def get_result_with_http_info(
121
+ self,
122
+ verification_id: Annotated[UUID, Field(description="ID of a verification")],
123
+ client_failover: Annotated[Optional[StrictBool], Field(description="Set when the widget could not reach TrustCaptcha (`clientFailover` in its token). The public gateway then answers on its own and lets the visitor pass only while it has seen an outage itself.")] = None,
124
+ _request_timeout: Union[
125
+ None,
126
+ Annotated[StrictFloat, Field(gt=0)],
127
+ Tuple[
128
+ Annotated[StrictFloat, Field(gt=0)],
129
+ Annotated[StrictFloat, Field(gt=0)]
130
+ ]
131
+ ] = None,
132
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
133
+ _content_type: Optional[StrictStr] = None,
134
+ _headers: Optional[Dict[StrictStr, Any]] = None,
135
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
136
+ ) -> ApiResponse[CaptchaVerificationResult]:
137
+ """Returns the result of a verification
138
+
139
+ Call it from your server with the verification id from the token the widget put into your form. A 429 here means the result reached its maximum retrieval count and comes without `Retry-After`; it is final and is not retried.
140
+
141
+ :param verification_id: ID of a verification (required)
142
+ :type verification_id: UUID
143
+ :param client_failover: Set when the widget could not reach TrustCaptcha (`clientFailover` in its token). The public gateway then answers on its own and lets the visitor pass only while it has seen an outage itself.
144
+ :type client_failover: bool
145
+ :param _request_timeout: timeout setting for this request. If one
146
+ number provided, it will be total request
147
+ timeout. It can also be a pair (tuple) of
148
+ (connection, read) timeouts.
149
+ :type _request_timeout: int, tuple(int, int), optional
150
+ :param _request_auth: set to override the auth_settings for an a single
151
+ request; this effectively ignores the
152
+ authentication in the spec for a single request.
153
+ :type _request_auth: dict, optional
154
+ :param _content_type: force content-type for the request.
155
+ :type _content_type: str, Optional
156
+ :param _headers: set to override the headers for a single
157
+ request; this effectively ignores the headers
158
+ in the spec for a single request.
159
+ :type _headers: dict, optional
160
+ :param _host_index: set to override the host_index for a single
161
+ request; this effectively ignores the host_index
162
+ in the spec for a single request.
163
+ :type _host_index: int, optional
164
+ :return: Returns the result object.
165
+ """ # noqa: E501
166
+
167
+ _param = self._get_result_serialize(
168
+ verification_id=verification_id,
169
+ client_failover=client_failover,
170
+ _request_auth=_request_auth,
171
+ _content_type=_content_type,
172
+ _headers=_headers,
173
+ _host_index=_host_index
174
+ )
175
+
176
+ _response_types_map: Dict[str, Optional[str]] = {
177
+ '200': "CaptchaVerificationResult",
178
+ '403': None,
179
+ '404': None,
180
+ '410': None,
181
+ '412': None,
182
+ '423': None,
183
+ '429': None,
184
+ }
185
+ response_data = self.api_client.call_api(
186
+ *_param,
187
+ _request_timeout=_request_timeout
188
+ )
189
+ response_data.read()
190
+ return self.api_client.response_deserialize(
191
+ response_data=response_data,
192
+ response_types_map=_response_types_map,
193
+ )
194
+
195
+
196
+ @validate_call
197
+ def get_result_without_preload_content(
198
+ self,
199
+ verification_id: Annotated[UUID, Field(description="ID of a verification")],
200
+ client_failover: Annotated[Optional[StrictBool], Field(description="Set when the widget could not reach TrustCaptcha (`clientFailover` in its token). The public gateway then answers on its own and lets the visitor pass only while it has seen an outage itself.")] = None,
201
+ _request_timeout: Union[
202
+ None,
203
+ Annotated[StrictFloat, Field(gt=0)],
204
+ Tuple[
205
+ Annotated[StrictFloat, Field(gt=0)],
206
+ Annotated[StrictFloat, Field(gt=0)]
207
+ ]
208
+ ] = None,
209
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
210
+ _content_type: Optional[StrictStr] = None,
211
+ _headers: Optional[Dict[StrictStr, Any]] = None,
212
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
213
+ ) -> RESTResponseType:
214
+ """Returns the result of a verification
215
+
216
+ Call it from your server with the verification id from the token the widget put into your form. A 429 here means the result reached its maximum retrieval count and comes without `Retry-After`; it is final and is not retried.
217
+
218
+ :param verification_id: ID of a verification (required)
219
+ :type verification_id: UUID
220
+ :param client_failover: Set when the widget could not reach TrustCaptcha (`clientFailover` in its token). The public gateway then answers on its own and lets the visitor pass only while it has seen an outage itself.
221
+ :type client_failover: bool
222
+ :param _request_timeout: timeout setting for this request. If one
223
+ number provided, it will be total request
224
+ timeout. It can also be a pair (tuple) of
225
+ (connection, read) timeouts.
226
+ :type _request_timeout: int, tuple(int, int), optional
227
+ :param _request_auth: set to override the auth_settings for an a single
228
+ request; this effectively ignores the
229
+ authentication in the spec for a single request.
230
+ :type _request_auth: dict, optional
231
+ :param _content_type: force content-type for the request.
232
+ :type _content_type: str, Optional
233
+ :param _headers: set to override the headers for a single
234
+ request; this effectively ignores the headers
235
+ in the spec for a single request.
236
+ :type _headers: dict, optional
237
+ :param _host_index: set to override the host_index for a single
238
+ request; this effectively ignores the host_index
239
+ in the spec for a single request.
240
+ :type _host_index: int, optional
241
+ :return: Returns the result object.
242
+ """ # noqa: E501
243
+
244
+ _param = self._get_result_serialize(
245
+ verification_id=verification_id,
246
+ client_failover=client_failover,
247
+ _request_auth=_request_auth,
248
+ _content_type=_content_type,
249
+ _headers=_headers,
250
+ _host_index=_host_index
251
+ )
252
+
253
+ _response_types_map: Dict[str, Optional[str]] = {
254
+ '200': "CaptchaVerificationResult",
255
+ '403': None,
256
+ '404': None,
257
+ '410': None,
258
+ '412': None,
259
+ '423': None,
260
+ '429': None,
261
+ }
262
+ response_data = self.api_client.call_api(
263
+ *_param,
264
+ _request_timeout=_request_timeout
265
+ )
266
+ return response_data.response
267
+
268
+
269
+ def _get_result_serialize(
270
+ self,
271
+ verification_id,
272
+ client_failover,
273
+ _request_auth,
274
+ _content_type,
275
+ _headers,
276
+ _host_index,
277
+ ) -> RequestSerialized:
278
+
279
+ _host = None
280
+
281
+ _collection_formats: Dict[str, str] = {
282
+ }
283
+
284
+ _path_params: Dict[str, str] = {}
285
+ _query_params: List[Tuple[str, str]] = []
286
+ _header_params: Dict[str, Optional[str]] = _headers or {}
287
+ _form_params: List[Tuple[str, str]] = []
288
+ _files: Dict[
289
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
290
+ ] = {}
291
+ _body_params: Optional[bytes] = None
292
+
293
+ # process the path parameters
294
+ if verification_id is not None:
295
+ _path_params['verificationId'] = verification_id
296
+ # process the query parameters
297
+ if client_failover is not None:
298
+
299
+ _query_params.append(('clientFailover', client_failover))
300
+
301
+ # process the header parameters
302
+ # process the form parameters
303
+ # process the body parameter
304
+
305
+
306
+ # set the HTTP header `Accept`
307
+ if 'Accept' not in _header_params:
308
+ _header_params['Accept'] = self.api_client.select_header_accept(
309
+ [
310
+ 'application/json'
311
+ ]
312
+ )
313
+
314
+
315
+ # authentication setting
316
+ _auth_settings: List[str] = [
317
+ 'bearerApiKey'
318
+ ]
319
+
320
+ return self.api_client.param_serialize(
321
+ method='GET',
322
+ resource_path='/captcha/v2/verifications/{verificationId}/results',
323
+ path_params=_path_params,
324
+ query_params=_query_params,
325
+ header_params=_header_params,
326
+ body=_body_params,
327
+ post_params=_form_params,
328
+ files=_files,
329
+ auth_settings=_auth_settings,
330
+ collection_formats=_collection_formats,
331
+ _host=_host,
332
+ _request_auth=_request_auth
333
+ )
334
+
335
+
@@ -0,0 +1,315 @@
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 uuid import UUID
21
+
22
+ from trustcomponent._generated.api_client import ApiClient, RequestSerialized
23
+ from trustcomponent._generated.api_response import ApiResponse
24
+ from trustcomponent._generated.rest import RESTResponseType
25
+
26
+
27
+ class MonitoringHeartbeatsApi:
28
+ """NOTE: This class is auto generated by OpenAPI Generator
29
+ Ref: https://openapi-generator.tech
30
+
31
+ Do not edit the class manually.
32
+ """
33
+
34
+ def __init__(self, api_client=None) -> None:
35
+ if api_client is None:
36
+ api_client = ApiClient.get_default()
37
+ self.api_client = api_client
38
+
39
+
40
+ @validate_call
41
+ def ping_heartbeat(
42
+ self,
43
+ service_id: Annotated[UUID, Field(description="Id of the service")],
44
+ monitor_id: Annotated[UUID, Field(description="Id of the monitor")],
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
+ ) -> None:
58
+ """Registers a heartbeat ping of a heartbeat monitor
59
+
60
+ Call this from the monitored system on its own schedule. When no ping arrives within the interval plus grace period of the monitor, the monitor goes into outage.
61
+
62
+ :param service_id: Id of the service (required)
63
+ :type service_id: UUID
64
+ :param monitor_id: Id of the monitor (required)
65
+ :type monitor_id: UUID
66
+ :param _request_timeout: timeout setting for this request. If one
67
+ number provided, it will be total request
68
+ timeout. It can also be a pair (tuple) of
69
+ (connection, read) timeouts.
70
+ :type _request_timeout: int, tuple(int, int), optional
71
+ :param _request_auth: set to override the auth_settings for an a single
72
+ request; this effectively ignores the
73
+ authentication in the spec for a single request.
74
+ :type _request_auth: dict, optional
75
+ :param _content_type: force content-type for the request.
76
+ :type _content_type: str, Optional
77
+ :param _headers: set to override the headers for a single
78
+ request; this effectively ignores the headers
79
+ in the spec for a single request.
80
+ :type _headers: dict, optional
81
+ :param _host_index: set to override the host_index for a single
82
+ request; this effectively ignores the host_index
83
+ in the spec for a single request.
84
+ :type _host_index: int, optional
85
+ :return: Returns the result object.
86
+ """ # noqa: E501
87
+
88
+ _param = self._ping_heartbeat_serialize(
89
+ service_id=service_id,
90
+ monitor_id=monitor_id,
91
+ _request_auth=_request_auth,
92
+ _content_type=_content_type,
93
+ _headers=_headers,
94
+ _host_index=_host_index
95
+ )
96
+
97
+ _response_types_map: Dict[str, Optional[str]] = {
98
+ '204': None,
99
+ '401': None,
100
+ '403': None,
101
+ '404': 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 ping_heartbeat_with_http_info(
116
+ self,
117
+ service_id: Annotated[UUID, Field(description="Id of the service")],
118
+ monitor_id: Annotated[UUID, Field(description="Id of the monitor")],
119
+ _request_timeout: Union[
120
+ None,
121
+ Annotated[StrictFloat, Field(gt=0)],
122
+ Tuple[
123
+ Annotated[StrictFloat, Field(gt=0)],
124
+ Annotated[StrictFloat, Field(gt=0)]
125
+ ]
126
+ ] = None,
127
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
128
+ _content_type: Optional[StrictStr] = None,
129
+ _headers: Optional[Dict[StrictStr, Any]] = None,
130
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
131
+ ) -> ApiResponse[None]:
132
+ """Registers a heartbeat ping of a heartbeat monitor
133
+
134
+ Call this from the monitored system on its own schedule. When no ping arrives within the interval plus grace period of the monitor, the monitor goes into outage.
135
+
136
+ :param service_id: Id of the service (required)
137
+ :type service_id: UUID
138
+ :param monitor_id: Id of the monitor (required)
139
+ :type monitor_id: UUID
140
+ :param _request_timeout: timeout setting for this request. If one
141
+ number provided, it will be total request
142
+ timeout. It can also be a pair (tuple) of
143
+ (connection, read) timeouts.
144
+ :type _request_timeout: int, tuple(int, int), optional
145
+ :param _request_auth: set to override the auth_settings for an a single
146
+ request; this effectively ignores the
147
+ authentication in the spec for a single request.
148
+ :type _request_auth: dict, optional
149
+ :param _content_type: force content-type for the request.
150
+ :type _content_type: str, Optional
151
+ :param _headers: set to override the headers for a single
152
+ request; this effectively ignores the headers
153
+ in the spec for a single request.
154
+ :type _headers: dict, optional
155
+ :param _host_index: set to override the host_index for a single
156
+ request; this effectively ignores the host_index
157
+ in the spec for a single request.
158
+ :type _host_index: int, optional
159
+ :return: Returns the result object.
160
+ """ # noqa: E501
161
+
162
+ _param = self._ping_heartbeat_serialize(
163
+ service_id=service_id,
164
+ monitor_id=monitor_id,
165
+ _request_auth=_request_auth,
166
+ _content_type=_content_type,
167
+ _headers=_headers,
168
+ _host_index=_host_index
169
+ )
170
+
171
+ _response_types_map: Dict[str, Optional[str]] = {
172
+ '204': None,
173
+ '401': None,
174
+ '403': None,
175
+ '404': None,
176
+ }
177
+ response_data = self.api_client.call_api(
178
+ *_param,
179
+ _request_timeout=_request_timeout
180
+ )
181
+ response_data.read()
182
+ return self.api_client.response_deserialize(
183
+ response_data=response_data,
184
+ response_types_map=_response_types_map,
185
+ )
186
+
187
+
188
+ @validate_call
189
+ def ping_heartbeat_without_preload_content(
190
+ self,
191
+ service_id: Annotated[UUID, Field(description="Id of the service")],
192
+ monitor_id: Annotated[UUID, Field(description="Id of the monitor")],
193
+ _request_timeout: Union[
194
+ None,
195
+ Annotated[StrictFloat, Field(gt=0)],
196
+ Tuple[
197
+ Annotated[StrictFloat, Field(gt=0)],
198
+ Annotated[StrictFloat, Field(gt=0)]
199
+ ]
200
+ ] = None,
201
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
202
+ _content_type: Optional[StrictStr] = None,
203
+ _headers: Optional[Dict[StrictStr, Any]] = None,
204
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
205
+ ) -> RESTResponseType:
206
+ """Registers a heartbeat ping of a heartbeat monitor
207
+
208
+ Call this from the monitored system on its own schedule. When no ping arrives within the interval plus grace period of the monitor, the monitor goes into outage.
209
+
210
+ :param service_id: Id of the service (required)
211
+ :type service_id: UUID
212
+ :param monitor_id: Id of the monitor (required)
213
+ :type monitor_id: UUID
214
+ :param _request_timeout: timeout setting for this request. If one
215
+ number provided, it will be total request
216
+ timeout. It can also be a pair (tuple) of
217
+ (connection, read) timeouts.
218
+ :type _request_timeout: int, tuple(int, int), optional
219
+ :param _request_auth: set to override the auth_settings for an a single
220
+ request; this effectively ignores the
221
+ authentication in the spec for a single request.
222
+ :type _request_auth: dict, optional
223
+ :param _content_type: force content-type for the request.
224
+ :type _content_type: str, Optional
225
+ :param _headers: set to override the headers for a single
226
+ request; this effectively ignores the headers
227
+ in the spec for a single request.
228
+ :type _headers: dict, optional
229
+ :param _host_index: set to override the host_index for a single
230
+ request; this effectively ignores the host_index
231
+ in the spec for a single request.
232
+ :type _host_index: int, optional
233
+ :return: Returns the result object.
234
+ """ # noqa: E501
235
+
236
+ _param = self._ping_heartbeat_serialize(
237
+ service_id=service_id,
238
+ monitor_id=monitor_id,
239
+ _request_auth=_request_auth,
240
+ _content_type=_content_type,
241
+ _headers=_headers,
242
+ _host_index=_host_index
243
+ )
244
+
245
+ _response_types_map: Dict[str, Optional[str]] = {
246
+ '204': None,
247
+ '401': None,
248
+ '403': None,
249
+ '404': None,
250
+ }
251
+ response_data = self.api_client.call_api(
252
+ *_param,
253
+ _request_timeout=_request_timeout
254
+ )
255
+ return response_data.response
256
+
257
+
258
+ def _ping_heartbeat_serialize(
259
+ self,
260
+ service_id,
261
+ monitor_id,
262
+ _request_auth,
263
+ _content_type,
264
+ _headers,
265
+ _host_index,
266
+ ) -> RequestSerialized:
267
+
268
+ _host = None
269
+
270
+ _collection_formats: Dict[str, str] = {
271
+ }
272
+
273
+ _path_params: Dict[str, str] = {}
274
+ _query_params: List[Tuple[str, str]] = []
275
+ _header_params: Dict[str, Optional[str]] = _headers or {}
276
+ _form_params: List[Tuple[str, str]] = []
277
+ _files: Dict[
278
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
279
+ ] = {}
280
+ _body_params: Optional[bytes] = None
281
+
282
+ # process the path parameters
283
+ if service_id is not None:
284
+ _path_params['serviceId'] = service_id
285
+ if monitor_id is not None:
286
+ _path_params['monitorId'] = monitor_id
287
+ # process the query parameters
288
+ # process the header parameters
289
+ # process the form parameters
290
+ # process the body parameter
291
+
292
+
293
+
294
+
295
+ # authentication setting
296
+ _auth_settings: List[str] = [
297
+ 'bearerApiKey'
298
+ ]
299
+
300
+ return self.api_client.param_serialize(
301
+ method='POST',
302
+ resource_path='/monitoring/v1/heartbeats/{serviceId}/{monitorId}',
303
+ path_params=_path_params,
304
+ query_params=_query_params,
305
+ header_params=_header_params,
306
+ body=_body_params,
307
+ post_params=_form_params,
308
+ files=_files,
309
+ auth_settings=_auth_settings,
310
+ collection_formats=_collection_formats,
311
+ _host=_host,
312
+ _request_auth=_request_auth
313
+ )
314
+
315
+