cs2cap 1.0.0__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 (161) hide show
  1. cs2cap/__init__.py +342 -0
  2. cs2cap/api/__init__.py +17 -0
  3. cs2cap/api/account_alerts_api.py +1799 -0
  4. cs2cap/api/account_api_keys_api.py +1741 -0
  5. cs2cap/api/account_watchlist_api.py +909 -0
  6. cs2cap/api/account_webhooks_api.py +2002 -0
  7. cs2cap/api/bids_api.py +994 -0
  8. cs2cap/api/foreign_exchange_api.py +293 -0
  9. cs2cap/api/inventory_api.py +579 -0
  10. cs2cap/api/items_api.py +879 -0
  11. cs2cap/api/market_intelligence_api.py +1553 -0
  12. cs2cap/api/portfolio_api.py +4266 -0
  13. cs2cap/api/prices_api.py +1858 -0
  14. cs2cap/api/providers_api.py +316 -0
  15. cs2cap/api/sales_api.py +406 -0
  16. cs2cap/api_client.py +813 -0
  17. cs2cap/api_response.py +21 -0
  18. cs2cap/configuration.py +585 -0
  19. cs2cap/exceptions.py +218 -0
  20. cs2cap/models/__init__.py +151 -0
  21. cs2cap/models/account_mutation_response.py +87 -0
  22. cs2cap/models/alert_batch_create_request.py +96 -0
  23. cs2cap/models/alert_batch_create_response.py +99 -0
  24. cs2cap/models/alert_batch_create_result.py +117 -0
  25. cs2cap/models/alert_create_request.py +108 -0
  26. cs2cap/models/alert_definition.py +126 -0
  27. cs2cap/models/alert_delivery_summary.py +141 -0
  28. cs2cap/models/alert_event_summary.py +134 -0
  29. cs2cap/models/alert_events_response.py +101 -0
  30. cs2cap/models/alert_item_summary.py +96 -0
  31. cs2cap/models/alert_list_response.py +101 -0
  32. cs2cap/models/alert_update_request.py +117 -0
  33. cs2cap/models/all_providers.py +74 -0
  34. cs2cap/models/api_key_info.py +142 -0
  35. cs2cap/models/batch_bid_item.py +106 -0
  36. cs2cap/models/batch_bid_quote.py +106 -0
  37. cs2cap/models/batch_bids_meta.py +96 -0
  38. cs2cap/models/batch_bids_request.py +108 -0
  39. cs2cap/models/batch_bids_response.py +105 -0
  40. cs2cap/models/batch_price_item.py +106 -0
  41. cs2cap/models/batch_price_quote.py +106 -0
  42. cs2cap/models/batch_prices_meta.py +96 -0
  43. cs2cap/models/batch_prices_request.py +108 -0
  44. cs2cap/models/batch_prices_response.py +105 -0
  45. cs2cap/models/bids_filter_meta.py +113 -0
  46. cs2cap/models/bids_meta.py +95 -0
  47. cs2cap/models/bids_response.py +107 -0
  48. cs2cap/models/buy_order_item.py +117 -0
  49. cs2cap/models/buy_order_provider.py +46 -0
  50. cs2cap/models/charm_info.py +94 -0
  51. cs2cap/models/child_api_key_create_request.py +102 -0
  52. cs2cap/models/child_api_key_create_response.py +95 -0
  53. cs2cap/models/child_api_key_detail_response.py +93 -0
  54. cs2cap/models/child_api_key_list_response.py +101 -0
  55. cs2cap/models/child_api_key_update_request.py +107 -0
  56. cs2cap/models/cursor_pagination_meta.py +99 -0
  57. cs2cap/models/error_response.py +89 -0
  58. cs2cap/models/fx_rates_response.py +95 -0
  59. cs2cap/models/indicator_data_coverage.py +106 -0
  60. cs2cap/models/indicator_momentum.py +169 -0
  61. cs2cap/models/indicator_signals.py +127 -0
  62. cs2cap/models/indicator_volatility.py +120 -0
  63. cs2cap/models/indicator_volume.py +106 -0
  64. cs2cap/models/inspect_info.py +106 -0
  65. cs2cap/models/item_out.py +234 -0
  66. cs2cap/models/items_catalog_summary.py +87 -0
  67. cs2cap/models/items_filter_metadata.py +103 -0
  68. cs2cap/models/items_metadata_response.py +97 -0
  69. cs2cap/models/items_paginated_response_item_out.py +101 -0
  70. cs2cap/models/items_pagination_meta.py +103 -0
  71. cs2cap/models/loc_inner.py +138 -0
  72. cs2cap/models/market_arbitrage_data.py +95 -0
  73. cs2cap/models/market_arbitrage_item.py +142 -0
  74. cs2cap/models/market_arbitrage_meta.py +111 -0
  75. cs2cap/models/market_arbitrage_response.py +103 -0
  76. cs2cap/models/market_index_group.py +103 -0
  77. cs2cap/models/market_indexes_data.py +105 -0
  78. cs2cap/models/market_indexes_meta.py +120 -0
  79. cs2cap/models/market_indexes_response.py +97 -0
  80. cs2cap/models/market_indicators_item_data.py +140 -0
  81. cs2cap/models/market_indicators_item_response.py +97 -0
  82. cs2cap/models/market_indicators_meta.py +120 -0
  83. cs2cap/models/market_item.py +131 -0
  84. cs2cap/models/market_item_analytics_coverage.py +91 -0
  85. cs2cap/models/market_item_analytics_data.py +118 -0
  86. cs2cap/models/market_item_analytics_provider.py +262 -0
  87. cs2cap/models/market_item_analytics_response.py +97 -0
  88. cs2cap/models/market_item_analytics_summary.py +290 -0
  89. cs2cap/models/market_items_snapshot_data.py +95 -0
  90. cs2cap/models/market_items_snapshot_item.py +102 -0
  91. cs2cap/models/market_items_snapshot_response.py +97 -0
  92. cs2cap/models/market_meta.py +111 -0
  93. cs2cap/models/market_time_window_meta.py +87 -0
  94. cs2cap/models/pagination_meta.py +103 -0
  95. cs2cap/models/phase_name.py +43 -0
  96. cs2cap/models/portfolio_add_item_request.py +109 -0
  97. cs2cap/models/portfolio_create.py +88 -0
  98. cs2cap/models/portfolio_data.py +101 -0
  99. cs2cap/models/portfolio_history_meta.py +132 -0
  100. cs2cap/models/portfolio_history_page.py +107 -0
  101. cs2cap/models/portfolio_history_point.py +96 -0
  102. cs2cap/models/portfolio_import_request.py +92 -0
  103. cs2cap/models/portfolio_import_result.py +91 -0
  104. cs2cap/models/portfolio_item_out.py +170 -0
  105. cs2cap/models/portfolio_line_item.py +129 -0
  106. cs2cap/models/portfolio_list_response.py +95 -0
  107. cs2cap/models/portfolio_meta.py +92 -0
  108. cs2cap/models/portfolio_out.py +96 -0
  109. cs2cap/models/portfolio_request.py +105 -0
  110. cs2cap/models/portfolio_request_item.py +90 -0
  111. cs2cap/models/portfolio_response.py +97 -0
  112. cs2cap/models/price_candle_item.py +110 -0
  113. cs2cap/models/price_candles_meta.py +107 -0
  114. cs2cap/models/price_candles_page.py +101 -0
  115. cs2cap/models/price_history_filters_meta.py +129 -0
  116. cs2cap/models/price_history_meta.py +96 -0
  117. cs2cap/models/price_snapshot.py +107 -0
  118. cs2cap/models/price_snapshot_page.py +107 -0
  119. cs2cap/models/prices_filter_meta.py +106 -0
  120. cs2cap/models/prices_meta.py +95 -0
  121. cs2cap/models/prices_paginated_response_market_item.py +107 -0
  122. cs2cap/models/provider_features.py +99 -0
  123. cs2cap/models/provider_fees.py +106 -0
  124. cs2cap/models/provider_health.py +130 -0
  125. cs2cap/models/provider_info.py +128 -0
  126. cs2cap/models/providers.py +89 -0
  127. cs2cap/models/recent_sales_provider.py +43 -0
  128. cs2cap/models/sale_record_detail.py +160 -0
  129. cs2cap/models/sales_filters_meta.py +116 -0
  130. cs2cap/models/sales_history_response.py +111 -0
  131. cs2cap/models/sales_meta.py +98 -0
  132. cs2cap/models/steam_inventory_item.py +169 -0
  133. cs2cap/models/steam_inventory_response.py +97 -0
  134. cs2cap/models/sticker_info.py +96 -0
  135. cs2cap/models/transaction_create_request.py +153 -0
  136. cs2cap/models/transaction_out.py +141 -0
  137. cs2cap/models/transaction_update_request.py +160 -0
  138. cs2cap/models/validation_error_item.py +113 -0
  139. cs2cap/models/validation_error_response.py +97 -0
  140. cs2cap/models/watchlist_batch_create_response.py +97 -0
  141. cs2cap/models/watchlist_create_batch_request.py +88 -0
  142. cs2cap/models/watchlist_create_request.py +134 -0
  143. cs2cap/models/watchlist_create_response.py +134 -0
  144. cs2cap/models/watchlist_create_single_request.py +87 -0
  145. cs2cap/models/watchlist_item.py +101 -0
  146. cs2cap/models/watchlist_response.py +101 -0
  147. cs2cap/models/webhook_create_request.py +91 -0
  148. cs2cap/models/webhook_deliveries_response.py +101 -0
  149. cs2cap/models/webhook_delivery_attempt_summary.py +113 -0
  150. cs2cap/models/webhook_delivery_detail.py +144 -0
  151. cs2cap/models/webhook_delivery_summary.py +132 -0
  152. cs2cap/models/webhook_endpoint_summary.py +121 -0
  153. cs2cap/models/webhook_endpoints_response.py +95 -0
  154. cs2cap/models/webhook_secret_response.py +93 -0
  155. cs2cap/models/webhook_update_request.py +106 -0
  156. cs2cap/py.typed +0 -0
  157. cs2cap/rest.py +263 -0
  158. cs2cap-1.0.0.dist-info/METADATA +301 -0
  159. cs2cap-1.0.0.dist-info/RECORD +161 -0
  160. cs2cap-1.0.0.dist-info/WHEEL +5 -0
  161. cs2cap-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1799 @@
1
+ """
2
+ CS2Cap
3
+
4
+ CS2Cap aggregates and analyzes Counter-Strike 2 marketplace data across multiple providers via a unified REST API.
5
+
6
+ The version of the OpenAPI document: 1.0.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, StrictInt, StrictStr
19
+ from typing import Optional
20
+ from typing_extensions import Annotated
21
+ from uuid import UUID
22
+ from cs2cap.models.account_mutation_response import AccountMutationResponse
23
+ from cs2cap.models.alert_batch_create_request import AlertBatchCreateRequest
24
+ from cs2cap.models.alert_batch_create_response import AlertBatchCreateResponse
25
+ from cs2cap.models.alert_create_request import AlertCreateRequest
26
+ from cs2cap.models.alert_definition import AlertDefinition
27
+ from cs2cap.models.alert_events_response import AlertEventsResponse
28
+ from cs2cap.models.alert_list_response import AlertListResponse
29
+ from cs2cap.models.alert_update_request import AlertUpdateRequest
30
+
31
+ from cs2cap.api_client import ApiClient, RequestSerialized
32
+ from cs2cap.api_response import ApiResponse
33
+ from cs2cap.rest import RESTResponseType
34
+
35
+
36
+ class AccountAlertsApi:
37
+ """NOTE: This class is auto generated by OpenAPI Generator
38
+ Ref: https://openapi-generator.tech
39
+
40
+ Do not edit the class manually.
41
+ """
42
+
43
+ def __init__(self, api_client=None) -> None:
44
+ if api_client is None:
45
+ api_client = ApiClient.get_default()
46
+ self.api_client = api_client
47
+
48
+
49
+ @validate_call
50
+ def create_alert(
51
+ self,
52
+ alert_create_request: AlertCreateRequest,
53
+ _request_timeout: Union[
54
+ None,
55
+ Annotated[StrictFloat, Field(gt=0)],
56
+ Tuple[
57
+ Annotated[StrictFloat, Field(gt=0)],
58
+ Annotated[StrictFloat, Field(gt=0)]
59
+ ]
60
+ ] = None,
61
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
62
+ _content_type: Optional[StrictStr] = None,
63
+ _headers: Optional[Dict[StrictStr, Any]] = None,
64
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
65
+ ) -> AlertDefinition:
66
+ """Create Alert
67
+
68
+ Create a new item-scoped account alert. Supported kinds: - `price_below`: trigger when the current best ask is at or below the threshold - `price_above`: trigger when the current best ask is at or above the threshold - `spread_exceeds`: trigger when `((best_ask - best_bid) / best_ask) * 100` meets or exceeds the threshold Rules: - accepts either a real API key or a session JWT bearer token - `spread_exceeds` ignores `threshold_currency` - price alerts default `threshold_currency` to the account preferred currency when omitted; accounts that have not set a preference use USD - enabled alerts require at least one configured delivery channel (verified email delivery or an active webhook destination) - the active enabled-alert cap is tier-controlled
69
+
70
+ :param alert_create_request: (required)
71
+ :type alert_create_request: AlertCreateRequest
72
+ :param _request_timeout: timeout setting for this request. If one
73
+ number provided, it will be total request
74
+ timeout. It can also be a pair (tuple) of
75
+ (connection, read) timeouts.
76
+ :type _request_timeout: int, tuple(int, int), optional
77
+ :param _request_auth: set to override the auth_settings for an a single
78
+ request; this effectively ignores the
79
+ authentication in the spec for a single request.
80
+ :type _request_auth: dict, optional
81
+ :param _content_type: force content-type for the request.
82
+ :type _content_type: str, Optional
83
+ :param _headers: set to override the headers for a single
84
+ request; this effectively ignores the headers
85
+ in the spec for a single request.
86
+ :type _headers: dict, optional
87
+ :param _host_index: set to override the host_index for a single
88
+ request; this effectively ignores the host_index
89
+ in the spec for a single request.
90
+ :type _host_index: int, optional
91
+ :return: Returns the result object.
92
+ """ # noqa: E501
93
+
94
+ _param = self._create_alert_serialize(
95
+ alert_create_request=alert_create_request,
96
+ _request_auth=_request_auth,
97
+ _content_type=_content_type,
98
+ _headers=_headers,
99
+ _host_index=_host_index
100
+ )
101
+
102
+ _response_types_map: Dict[str, Optional[str]] = {
103
+ '201': "AlertDefinition",
104
+ '401': "ErrorResponse",
105
+ '403': "ErrorResponse",
106
+ '429': "ErrorResponse",
107
+ '422': "ValidationErrorResponse",
108
+ }
109
+ response_data = self.api_client.call_api(
110
+ *_param,
111
+ _request_timeout=_request_timeout
112
+ )
113
+ response_data.read()
114
+ return self.api_client.response_deserialize(
115
+ response_data=response_data,
116
+ response_types_map=_response_types_map,
117
+ ).data
118
+
119
+
120
+ @validate_call
121
+ def create_alert_with_http_info(
122
+ self,
123
+ alert_create_request: AlertCreateRequest,
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[AlertDefinition]:
137
+ """Create Alert
138
+
139
+ Create a new item-scoped account alert. Supported kinds: - `price_below`: trigger when the current best ask is at or below the threshold - `price_above`: trigger when the current best ask is at or above the threshold - `spread_exceeds`: trigger when `((best_ask - best_bid) / best_ask) * 100` meets or exceeds the threshold Rules: - accepts either a real API key or a session JWT bearer token - `spread_exceeds` ignores `threshold_currency` - price alerts default `threshold_currency` to the account preferred currency when omitted; accounts that have not set a preference use USD - enabled alerts require at least one configured delivery channel (verified email delivery or an active webhook destination) - the active enabled-alert cap is tier-controlled
140
+
141
+ :param alert_create_request: (required)
142
+ :type alert_create_request: AlertCreateRequest
143
+ :param _request_timeout: timeout setting for this request. If one
144
+ number provided, it will be total request
145
+ timeout. It can also be a pair (tuple) of
146
+ (connection, read) timeouts.
147
+ :type _request_timeout: int, tuple(int, int), optional
148
+ :param _request_auth: set to override the auth_settings for an a single
149
+ request; this effectively ignores the
150
+ authentication in the spec for a single request.
151
+ :type _request_auth: dict, optional
152
+ :param _content_type: force content-type for the request.
153
+ :type _content_type: str, Optional
154
+ :param _headers: set to override the headers for a single
155
+ request; this effectively ignores the headers
156
+ in the spec for a single request.
157
+ :type _headers: dict, optional
158
+ :param _host_index: set to override the host_index for a single
159
+ request; this effectively ignores the host_index
160
+ in the spec for a single request.
161
+ :type _host_index: int, optional
162
+ :return: Returns the result object.
163
+ """ # noqa: E501
164
+
165
+ _param = self._create_alert_serialize(
166
+ alert_create_request=alert_create_request,
167
+ _request_auth=_request_auth,
168
+ _content_type=_content_type,
169
+ _headers=_headers,
170
+ _host_index=_host_index
171
+ )
172
+
173
+ _response_types_map: Dict[str, Optional[str]] = {
174
+ '201': "AlertDefinition",
175
+ '401': "ErrorResponse",
176
+ '403': "ErrorResponse",
177
+ '429': "ErrorResponse",
178
+ '422': "ValidationErrorResponse",
179
+ }
180
+ response_data = self.api_client.call_api(
181
+ *_param,
182
+ _request_timeout=_request_timeout
183
+ )
184
+ response_data.read()
185
+ return self.api_client.response_deserialize(
186
+ response_data=response_data,
187
+ response_types_map=_response_types_map,
188
+ )
189
+
190
+
191
+ @validate_call
192
+ def create_alert_without_preload_content(
193
+ self,
194
+ alert_create_request: AlertCreateRequest,
195
+ _request_timeout: Union[
196
+ None,
197
+ Annotated[StrictFloat, Field(gt=0)],
198
+ Tuple[
199
+ Annotated[StrictFloat, Field(gt=0)],
200
+ Annotated[StrictFloat, Field(gt=0)]
201
+ ]
202
+ ] = None,
203
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
204
+ _content_type: Optional[StrictStr] = None,
205
+ _headers: Optional[Dict[StrictStr, Any]] = None,
206
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
207
+ ) -> RESTResponseType:
208
+ """Create Alert
209
+
210
+ Create a new item-scoped account alert. Supported kinds: - `price_below`: trigger when the current best ask is at or below the threshold - `price_above`: trigger when the current best ask is at or above the threshold - `spread_exceeds`: trigger when `((best_ask - best_bid) / best_ask) * 100` meets or exceeds the threshold Rules: - accepts either a real API key or a session JWT bearer token - `spread_exceeds` ignores `threshold_currency` - price alerts default `threshold_currency` to the account preferred currency when omitted; accounts that have not set a preference use USD - enabled alerts require at least one configured delivery channel (verified email delivery or an active webhook destination) - the active enabled-alert cap is tier-controlled
211
+
212
+ :param alert_create_request: (required)
213
+ :type alert_create_request: AlertCreateRequest
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._create_alert_serialize(
237
+ alert_create_request=alert_create_request,
238
+ _request_auth=_request_auth,
239
+ _content_type=_content_type,
240
+ _headers=_headers,
241
+ _host_index=_host_index
242
+ )
243
+
244
+ _response_types_map: Dict[str, Optional[str]] = {
245
+ '201': "AlertDefinition",
246
+ '401': "ErrorResponse",
247
+ '403': "ErrorResponse",
248
+ '429': "ErrorResponse",
249
+ '422': "ValidationErrorResponse",
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 _create_alert_serialize(
259
+ self,
260
+ alert_create_request,
261
+ _request_auth,
262
+ _content_type,
263
+ _headers,
264
+ _host_index,
265
+ ) -> RequestSerialized:
266
+
267
+ _host = None
268
+
269
+ _collection_formats: Dict[str, str] = {
270
+ }
271
+
272
+ _path_params: Dict[str, str] = {}
273
+ _query_params: List[Tuple[str, str]] = []
274
+ _header_params: Dict[str, Optional[str]] = _headers or {}
275
+ _form_params: List[Tuple[str, str]] = []
276
+ _files: Dict[
277
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
278
+ ] = {}
279
+ _body_params: Optional[bytes] = None
280
+
281
+ # process the path parameters
282
+ # process the query parameters
283
+ # process the header parameters
284
+ # process the form parameters
285
+ # process the body parameter
286
+ if alert_create_request is not None:
287
+ _body_params = alert_create_request
288
+
289
+
290
+ # set the HTTP header `Accept`
291
+ if 'Accept' not in _header_params:
292
+ _header_params['Accept'] = self.api_client.select_header_accept(
293
+ [
294
+ 'application/json'
295
+ ]
296
+ )
297
+
298
+ # set the HTTP header `Content-Type`
299
+ if _content_type:
300
+ _header_params['Content-Type'] = _content_type
301
+ else:
302
+ _default_content_type = (
303
+ self.api_client.select_header_content_type(
304
+ [
305
+ 'application/json'
306
+ ]
307
+ )
308
+ )
309
+ if _default_content_type is not None:
310
+ _header_params['Content-Type'] = _default_content_type
311
+
312
+ # authentication setting
313
+ _auth_settings: List[str] = [
314
+ 'BearerAuth'
315
+ ]
316
+
317
+ return self.api_client.param_serialize(
318
+ method='POST',
319
+ resource_path='/v1/account/alerts',
320
+ path_params=_path_params,
321
+ query_params=_query_params,
322
+ header_params=_header_params,
323
+ body=_body_params,
324
+ post_params=_form_params,
325
+ files=_files,
326
+ auth_settings=_auth_settings,
327
+ collection_formats=_collection_formats,
328
+ _host=_host,
329
+ _request_auth=_request_auth
330
+ )
331
+
332
+
333
+
334
+
335
+ @validate_call
336
+ def create_alerts_batch(
337
+ self,
338
+ alert_batch_create_request: AlertBatchCreateRequest,
339
+ _request_timeout: Union[
340
+ None,
341
+ Annotated[StrictFloat, Field(gt=0)],
342
+ Tuple[
343
+ Annotated[StrictFloat, Field(gt=0)],
344
+ Annotated[StrictFloat, Field(gt=0)]
345
+ ]
346
+ ] = None,
347
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
348
+ _content_type: Optional[StrictStr] = None,
349
+ _headers: Optional[Dict[StrictStr, Any]] = None,
350
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
351
+ ) -> AlertBatchCreateResponse:
352
+ """Create Alerts Batch
353
+
354
+ Create multiple item-scoped account alerts in one request. Rules: - accepts either a real API key or a session JWT bearer token - maximum 100 alerts per request - gated by the `batch_alert_creation_access` feature flag - enabled alerts are preflight-checked against the tier active-alert cap before inserts - exact duplicate alert payloads in the same request are rejected inline - the response preserves request order and reports per-item created/error status - the request consumes one API call regardless of batch size
355
+
356
+ :param alert_batch_create_request: (required)
357
+ :type alert_batch_create_request: AlertBatchCreateRequest
358
+ :param _request_timeout: timeout setting for this request. If one
359
+ number provided, it will be total request
360
+ timeout. It can also be a pair (tuple) of
361
+ (connection, read) timeouts.
362
+ :type _request_timeout: int, tuple(int, int), optional
363
+ :param _request_auth: set to override the auth_settings for an a single
364
+ request; this effectively ignores the
365
+ authentication in the spec for a single request.
366
+ :type _request_auth: dict, optional
367
+ :param _content_type: force content-type for the request.
368
+ :type _content_type: str, Optional
369
+ :param _headers: set to override the headers for a single
370
+ request; this effectively ignores the headers
371
+ in the spec for a single request.
372
+ :type _headers: dict, optional
373
+ :param _host_index: set to override the host_index for a single
374
+ request; this effectively ignores the host_index
375
+ in the spec for a single request.
376
+ :type _host_index: int, optional
377
+ :return: Returns the result object.
378
+ """ # noqa: E501
379
+
380
+ _param = self._create_alerts_batch_serialize(
381
+ alert_batch_create_request=alert_batch_create_request,
382
+ _request_auth=_request_auth,
383
+ _content_type=_content_type,
384
+ _headers=_headers,
385
+ _host_index=_host_index
386
+ )
387
+
388
+ _response_types_map: Dict[str, Optional[str]] = {
389
+ '200': "AlertBatchCreateResponse",
390
+ '401': "ErrorResponse",
391
+ '403': "ErrorResponse",
392
+ '429': "ErrorResponse",
393
+ '422': "ValidationErrorResponse",
394
+ '400': "ErrorResponse",
395
+ '402': "ErrorResponse",
396
+ }
397
+ response_data = self.api_client.call_api(
398
+ *_param,
399
+ _request_timeout=_request_timeout
400
+ )
401
+ response_data.read()
402
+ return self.api_client.response_deserialize(
403
+ response_data=response_data,
404
+ response_types_map=_response_types_map,
405
+ ).data
406
+
407
+
408
+ @validate_call
409
+ def create_alerts_batch_with_http_info(
410
+ self,
411
+ alert_batch_create_request: AlertBatchCreateRequest,
412
+ _request_timeout: Union[
413
+ None,
414
+ Annotated[StrictFloat, Field(gt=0)],
415
+ Tuple[
416
+ Annotated[StrictFloat, Field(gt=0)],
417
+ Annotated[StrictFloat, Field(gt=0)]
418
+ ]
419
+ ] = None,
420
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
421
+ _content_type: Optional[StrictStr] = None,
422
+ _headers: Optional[Dict[StrictStr, Any]] = None,
423
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
424
+ ) -> ApiResponse[AlertBatchCreateResponse]:
425
+ """Create Alerts Batch
426
+
427
+ Create multiple item-scoped account alerts in one request. Rules: - accepts either a real API key or a session JWT bearer token - maximum 100 alerts per request - gated by the `batch_alert_creation_access` feature flag - enabled alerts are preflight-checked against the tier active-alert cap before inserts - exact duplicate alert payloads in the same request are rejected inline - the response preserves request order and reports per-item created/error status - the request consumes one API call regardless of batch size
428
+
429
+ :param alert_batch_create_request: (required)
430
+ :type alert_batch_create_request: AlertBatchCreateRequest
431
+ :param _request_timeout: timeout setting for this request. If one
432
+ number provided, it will be total request
433
+ timeout. It can also be a pair (tuple) of
434
+ (connection, read) timeouts.
435
+ :type _request_timeout: int, tuple(int, int), optional
436
+ :param _request_auth: set to override the auth_settings for an a single
437
+ request; this effectively ignores the
438
+ authentication in the spec for a single request.
439
+ :type _request_auth: dict, optional
440
+ :param _content_type: force content-type for the request.
441
+ :type _content_type: str, Optional
442
+ :param _headers: set to override the headers for a single
443
+ request; this effectively ignores the headers
444
+ in the spec for a single request.
445
+ :type _headers: dict, optional
446
+ :param _host_index: set to override the host_index for a single
447
+ request; this effectively ignores the host_index
448
+ in the spec for a single request.
449
+ :type _host_index: int, optional
450
+ :return: Returns the result object.
451
+ """ # noqa: E501
452
+
453
+ _param = self._create_alerts_batch_serialize(
454
+ alert_batch_create_request=alert_batch_create_request,
455
+ _request_auth=_request_auth,
456
+ _content_type=_content_type,
457
+ _headers=_headers,
458
+ _host_index=_host_index
459
+ )
460
+
461
+ _response_types_map: Dict[str, Optional[str]] = {
462
+ '200': "AlertBatchCreateResponse",
463
+ '401': "ErrorResponse",
464
+ '403': "ErrorResponse",
465
+ '429': "ErrorResponse",
466
+ '422': "ValidationErrorResponse",
467
+ '400': "ErrorResponse",
468
+ '402': "ErrorResponse",
469
+ }
470
+ response_data = self.api_client.call_api(
471
+ *_param,
472
+ _request_timeout=_request_timeout
473
+ )
474
+ response_data.read()
475
+ return self.api_client.response_deserialize(
476
+ response_data=response_data,
477
+ response_types_map=_response_types_map,
478
+ )
479
+
480
+
481
+ @validate_call
482
+ def create_alerts_batch_without_preload_content(
483
+ self,
484
+ alert_batch_create_request: AlertBatchCreateRequest,
485
+ _request_timeout: Union[
486
+ None,
487
+ Annotated[StrictFloat, Field(gt=0)],
488
+ Tuple[
489
+ Annotated[StrictFloat, Field(gt=0)],
490
+ Annotated[StrictFloat, Field(gt=0)]
491
+ ]
492
+ ] = None,
493
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
494
+ _content_type: Optional[StrictStr] = None,
495
+ _headers: Optional[Dict[StrictStr, Any]] = None,
496
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
497
+ ) -> RESTResponseType:
498
+ """Create Alerts Batch
499
+
500
+ Create multiple item-scoped account alerts in one request. Rules: - accepts either a real API key or a session JWT bearer token - maximum 100 alerts per request - gated by the `batch_alert_creation_access` feature flag - enabled alerts are preflight-checked against the tier active-alert cap before inserts - exact duplicate alert payloads in the same request are rejected inline - the response preserves request order and reports per-item created/error status - the request consumes one API call regardless of batch size
501
+
502
+ :param alert_batch_create_request: (required)
503
+ :type alert_batch_create_request: AlertBatchCreateRequest
504
+ :param _request_timeout: timeout setting for this request. If one
505
+ number provided, it will be total request
506
+ timeout. It can also be a pair (tuple) of
507
+ (connection, read) timeouts.
508
+ :type _request_timeout: int, tuple(int, int), optional
509
+ :param _request_auth: set to override the auth_settings for an a single
510
+ request; this effectively ignores the
511
+ authentication in the spec for a single request.
512
+ :type _request_auth: dict, optional
513
+ :param _content_type: force content-type for the request.
514
+ :type _content_type: str, Optional
515
+ :param _headers: set to override the headers for a single
516
+ request; this effectively ignores the headers
517
+ in the spec for a single request.
518
+ :type _headers: dict, optional
519
+ :param _host_index: set to override the host_index for a single
520
+ request; this effectively ignores the host_index
521
+ in the spec for a single request.
522
+ :type _host_index: int, optional
523
+ :return: Returns the result object.
524
+ """ # noqa: E501
525
+
526
+ _param = self._create_alerts_batch_serialize(
527
+ alert_batch_create_request=alert_batch_create_request,
528
+ _request_auth=_request_auth,
529
+ _content_type=_content_type,
530
+ _headers=_headers,
531
+ _host_index=_host_index
532
+ )
533
+
534
+ _response_types_map: Dict[str, Optional[str]] = {
535
+ '200': "AlertBatchCreateResponse",
536
+ '401': "ErrorResponse",
537
+ '403': "ErrorResponse",
538
+ '429': "ErrorResponse",
539
+ '422': "ValidationErrorResponse",
540
+ '400': "ErrorResponse",
541
+ '402': "ErrorResponse",
542
+ }
543
+ response_data = self.api_client.call_api(
544
+ *_param,
545
+ _request_timeout=_request_timeout
546
+ )
547
+ return response_data.response
548
+
549
+
550
+ def _create_alerts_batch_serialize(
551
+ self,
552
+ alert_batch_create_request,
553
+ _request_auth,
554
+ _content_type,
555
+ _headers,
556
+ _host_index,
557
+ ) -> RequestSerialized:
558
+
559
+ _host = None
560
+
561
+ _collection_formats: Dict[str, str] = {
562
+ }
563
+
564
+ _path_params: Dict[str, str] = {}
565
+ _query_params: List[Tuple[str, str]] = []
566
+ _header_params: Dict[str, Optional[str]] = _headers or {}
567
+ _form_params: List[Tuple[str, str]] = []
568
+ _files: Dict[
569
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
570
+ ] = {}
571
+ _body_params: Optional[bytes] = None
572
+
573
+ # process the path parameters
574
+ # process the query parameters
575
+ # process the header parameters
576
+ # process the form parameters
577
+ # process the body parameter
578
+ if alert_batch_create_request is not None:
579
+ _body_params = alert_batch_create_request
580
+
581
+
582
+ # set the HTTP header `Accept`
583
+ if 'Accept' not in _header_params:
584
+ _header_params['Accept'] = self.api_client.select_header_accept(
585
+ [
586
+ 'application/json'
587
+ ]
588
+ )
589
+
590
+ # set the HTTP header `Content-Type`
591
+ if _content_type:
592
+ _header_params['Content-Type'] = _content_type
593
+ else:
594
+ _default_content_type = (
595
+ self.api_client.select_header_content_type(
596
+ [
597
+ 'application/json'
598
+ ]
599
+ )
600
+ )
601
+ if _default_content_type is not None:
602
+ _header_params['Content-Type'] = _default_content_type
603
+
604
+ # authentication setting
605
+ _auth_settings: List[str] = [
606
+ 'BearerAuth'
607
+ ]
608
+
609
+ return self.api_client.param_serialize(
610
+ method='POST',
611
+ resource_path='/v1/account/alerts/batch',
612
+ path_params=_path_params,
613
+ query_params=_query_params,
614
+ header_params=_header_params,
615
+ body=_body_params,
616
+ post_params=_form_params,
617
+ files=_files,
618
+ auth_settings=_auth_settings,
619
+ collection_formats=_collection_formats,
620
+ _host=_host,
621
+ _request_auth=_request_auth
622
+ )
623
+
624
+
625
+
626
+
627
+ @validate_call
628
+ def delete_alert(
629
+ self,
630
+ alert_id: UUID,
631
+ _request_timeout: Union[
632
+ None,
633
+ Annotated[StrictFloat, Field(gt=0)],
634
+ Tuple[
635
+ Annotated[StrictFloat, Field(gt=0)],
636
+ Annotated[StrictFloat, Field(gt=0)]
637
+ ]
638
+ ] = None,
639
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
640
+ _content_type: Optional[StrictStr] = None,
641
+ _headers: Optional[Dict[StrictStr, Any]] = None,
642
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
643
+ ) -> AccountMutationResponse:
644
+ """Delete Alert
645
+
646
+ Delete one alert definition owned by the authenticated user.
647
+
648
+ :param alert_id: (required)
649
+ :type alert_id: UUID
650
+ :param _request_timeout: timeout setting for this request. If one
651
+ number provided, it will be total request
652
+ timeout. It can also be a pair (tuple) of
653
+ (connection, read) timeouts.
654
+ :type _request_timeout: int, tuple(int, int), optional
655
+ :param _request_auth: set to override the auth_settings for an a single
656
+ request; this effectively ignores the
657
+ authentication in the spec for a single request.
658
+ :type _request_auth: dict, optional
659
+ :param _content_type: force content-type for the request.
660
+ :type _content_type: str, Optional
661
+ :param _headers: set to override the headers for a single
662
+ request; this effectively ignores the headers
663
+ in the spec for a single request.
664
+ :type _headers: dict, optional
665
+ :param _host_index: set to override the host_index for a single
666
+ request; this effectively ignores the host_index
667
+ in the spec for a single request.
668
+ :type _host_index: int, optional
669
+ :return: Returns the result object.
670
+ """ # noqa: E501
671
+
672
+ _param = self._delete_alert_serialize(
673
+ alert_id=alert_id,
674
+ _request_auth=_request_auth,
675
+ _content_type=_content_type,
676
+ _headers=_headers,
677
+ _host_index=_host_index
678
+ )
679
+
680
+ _response_types_map: Dict[str, Optional[str]] = {
681
+ '200': "AccountMutationResponse",
682
+ '401': "ErrorResponse",
683
+ '403': "ErrorResponse",
684
+ '429': "ErrorResponse",
685
+ '422': "ValidationErrorResponse",
686
+ }
687
+ response_data = self.api_client.call_api(
688
+ *_param,
689
+ _request_timeout=_request_timeout
690
+ )
691
+ response_data.read()
692
+ return self.api_client.response_deserialize(
693
+ response_data=response_data,
694
+ response_types_map=_response_types_map,
695
+ ).data
696
+
697
+
698
+ @validate_call
699
+ def delete_alert_with_http_info(
700
+ self,
701
+ alert_id: UUID,
702
+ _request_timeout: Union[
703
+ None,
704
+ Annotated[StrictFloat, Field(gt=0)],
705
+ Tuple[
706
+ Annotated[StrictFloat, Field(gt=0)],
707
+ Annotated[StrictFloat, Field(gt=0)]
708
+ ]
709
+ ] = None,
710
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
711
+ _content_type: Optional[StrictStr] = None,
712
+ _headers: Optional[Dict[StrictStr, Any]] = None,
713
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
714
+ ) -> ApiResponse[AccountMutationResponse]:
715
+ """Delete Alert
716
+
717
+ Delete one alert definition owned by the authenticated user.
718
+
719
+ :param alert_id: (required)
720
+ :type alert_id: UUID
721
+ :param _request_timeout: timeout setting for this request. If one
722
+ number provided, it will be total request
723
+ timeout. It can also be a pair (tuple) of
724
+ (connection, read) timeouts.
725
+ :type _request_timeout: int, tuple(int, int), optional
726
+ :param _request_auth: set to override the auth_settings for an a single
727
+ request; this effectively ignores the
728
+ authentication in the spec for a single request.
729
+ :type _request_auth: dict, optional
730
+ :param _content_type: force content-type for the request.
731
+ :type _content_type: str, Optional
732
+ :param _headers: set to override the headers for a single
733
+ request; this effectively ignores the headers
734
+ in the spec for a single request.
735
+ :type _headers: dict, optional
736
+ :param _host_index: set to override the host_index for a single
737
+ request; this effectively ignores the host_index
738
+ in the spec for a single request.
739
+ :type _host_index: int, optional
740
+ :return: Returns the result object.
741
+ """ # noqa: E501
742
+
743
+ _param = self._delete_alert_serialize(
744
+ alert_id=alert_id,
745
+ _request_auth=_request_auth,
746
+ _content_type=_content_type,
747
+ _headers=_headers,
748
+ _host_index=_host_index
749
+ )
750
+
751
+ _response_types_map: Dict[str, Optional[str]] = {
752
+ '200': "AccountMutationResponse",
753
+ '401': "ErrorResponse",
754
+ '403': "ErrorResponse",
755
+ '429': "ErrorResponse",
756
+ '422': "ValidationErrorResponse",
757
+ }
758
+ response_data = self.api_client.call_api(
759
+ *_param,
760
+ _request_timeout=_request_timeout
761
+ )
762
+ response_data.read()
763
+ return self.api_client.response_deserialize(
764
+ response_data=response_data,
765
+ response_types_map=_response_types_map,
766
+ )
767
+
768
+
769
+ @validate_call
770
+ def delete_alert_without_preload_content(
771
+ self,
772
+ alert_id: UUID,
773
+ _request_timeout: Union[
774
+ None,
775
+ Annotated[StrictFloat, Field(gt=0)],
776
+ Tuple[
777
+ Annotated[StrictFloat, Field(gt=0)],
778
+ Annotated[StrictFloat, Field(gt=0)]
779
+ ]
780
+ ] = None,
781
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
782
+ _content_type: Optional[StrictStr] = None,
783
+ _headers: Optional[Dict[StrictStr, Any]] = None,
784
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
785
+ ) -> RESTResponseType:
786
+ """Delete Alert
787
+
788
+ Delete one alert definition owned by the authenticated user.
789
+
790
+ :param alert_id: (required)
791
+ :type alert_id: UUID
792
+ :param _request_timeout: timeout setting for this request. If one
793
+ number provided, it will be total request
794
+ timeout. It can also be a pair (tuple) of
795
+ (connection, read) timeouts.
796
+ :type _request_timeout: int, tuple(int, int), optional
797
+ :param _request_auth: set to override the auth_settings for an a single
798
+ request; this effectively ignores the
799
+ authentication in the spec for a single request.
800
+ :type _request_auth: dict, optional
801
+ :param _content_type: force content-type for the request.
802
+ :type _content_type: str, Optional
803
+ :param _headers: set to override the headers for a single
804
+ request; this effectively ignores the headers
805
+ in the spec for a single request.
806
+ :type _headers: dict, optional
807
+ :param _host_index: set to override the host_index for a single
808
+ request; this effectively ignores the host_index
809
+ in the spec for a single request.
810
+ :type _host_index: int, optional
811
+ :return: Returns the result object.
812
+ """ # noqa: E501
813
+
814
+ _param = self._delete_alert_serialize(
815
+ alert_id=alert_id,
816
+ _request_auth=_request_auth,
817
+ _content_type=_content_type,
818
+ _headers=_headers,
819
+ _host_index=_host_index
820
+ )
821
+
822
+ _response_types_map: Dict[str, Optional[str]] = {
823
+ '200': "AccountMutationResponse",
824
+ '401': "ErrorResponse",
825
+ '403': "ErrorResponse",
826
+ '429': "ErrorResponse",
827
+ '422': "ValidationErrorResponse",
828
+ }
829
+ response_data = self.api_client.call_api(
830
+ *_param,
831
+ _request_timeout=_request_timeout
832
+ )
833
+ return response_data.response
834
+
835
+
836
+ def _delete_alert_serialize(
837
+ self,
838
+ alert_id,
839
+ _request_auth,
840
+ _content_type,
841
+ _headers,
842
+ _host_index,
843
+ ) -> RequestSerialized:
844
+
845
+ _host = None
846
+
847
+ _collection_formats: Dict[str, str] = {
848
+ }
849
+
850
+ _path_params: Dict[str, str] = {}
851
+ _query_params: List[Tuple[str, str]] = []
852
+ _header_params: Dict[str, Optional[str]] = _headers or {}
853
+ _form_params: List[Tuple[str, str]] = []
854
+ _files: Dict[
855
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
856
+ ] = {}
857
+ _body_params: Optional[bytes] = None
858
+
859
+ # process the path parameters
860
+ if alert_id is not None:
861
+ _path_params['alert_id'] = alert_id
862
+ # process the query parameters
863
+ # process the header parameters
864
+ # process the form parameters
865
+ # process the body parameter
866
+
867
+
868
+ # set the HTTP header `Accept`
869
+ if 'Accept' not in _header_params:
870
+ _header_params['Accept'] = self.api_client.select_header_accept(
871
+ [
872
+ 'application/json'
873
+ ]
874
+ )
875
+
876
+
877
+ # authentication setting
878
+ _auth_settings: List[str] = [
879
+ 'BearerAuth'
880
+ ]
881
+
882
+ return self.api_client.param_serialize(
883
+ method='DELETE',
884
+ resource_path='/v1/account/alerts/{alert_id}',
885
+ path_params=_path_params,
886
+ query_params=_query_params,
887
+ header_params=_header_params,
888
+ body=_body_params,
889
+ post_params=_form_params,
890
+ files=_files,
891
+ auth_settings=_auth_settings,
892
+ collection_formats=_collection_formats,
893
+ _host=_host,
894
+ _request_auth=_request_auth
895
+ )
896
+
897
+
898
+
899
+
900
+ @validate_call
901
+ def list_alert_events(
902
+ self,
903
+ limit: Annotated[Optional[StrictInt], Field(description="Requested page size. Values are clamped to the range 1..100.")] = None,
904
+ offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Requested offset into the event history.")] = None,
905
+ _request_timeout: Union[
906
+ None,
907
+ Annotated[StrictFloat, Field(gt=0)],
908
+ Tuple[
909
+ Annotated[StrictFloat, Field(gt=0)],
910
+ Annotated[StrictFloat, Field(gt=0)]
911
+ ]
912
+ ] = None,
913
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
914
+ _content_type: Optional[StrictStr] = None,
915
+ _headers: Optional[Dict[StrictStr, Any]] = None,
916
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
917
+ ) -> AlertEventsResponse:
918
+ """List Alert Events
919
+
920
+ List recent alert trigger events and delivery attempts for the authenticated user. Behavior: - accepts either a real API key or a session JWT bearer token - offset pagination ordered by newest event first - delivery rows currently reflect email delivery attempts
921
+
922
+ :param limit: Requested page size. Values are clamped to the range 1..100.
923
+ :type limit: int
924
+ :param offset: Requested offset into the event history.
925
+ :type offset: int
926
+ :param _request_timeout: timeout setting for this request. If one
927
+ number provided, it will be total request
928
+ timeout. It can also be a pair (tuple) of
929
+ (connection, read) timeouts.
930
+ :type _request_timeout: int, tuple(int, int), optional
931
+ :param _request_auth: set to override the auth_settings for an a single
932
+ request; this effectively ignores the
933
+ authentication in the spec for a single request.
934
+ :type _request_auth: dict, optional
935
+ :param _content_type: force content-type for the request.
936
+ :type _content_type: str, Optional
937
+ :param _headers: set to override the headers for a single
938
+ request; this effectively ignores the headers
939
+ in the spec for a single request.
940
+ :type _headers: dict, optional
941
+ :param _host_index: set to override the host_index for a single
942
+ request; this effectively ignores the host_index
943
+ in the spec for a single request.
944
+ :type _host_index: int, optional
945
+ :return: Returns the result object.
946
+ """ # noqa: E501
947
+
948
+ _param = self._list_alert_events_serialize(
949
+ limit=limit,
950
+ offset=offset,
951
+ _request_auth=_request_auth,
952
+ _content_type=_content_type,
953
+ _headers=_headers,
954
+ _host_index=_host_index
955
+ )
956
+
957
+ _response_types_map: Dict[str, Optional[str]] = {
958
+ '200': "AlertEventsResponse",
959
+ '401': "ErrorResponse",
960
+ '403': "ErrorResponse",
961
+ '429': "ErrorResponse",
962
+ '422': "ValidationErrorResponse",
963
+ }
964
+ response_data = self.api_client.call_api(
965
+ *_param,
966
+ _request_timeout=_request_timeout
967
+ )
968
+ response_data.read()
969
+ return self.api_client.response_deserialize(
970
+ response_data=response_data,
971
+ response_types_map=_response_types_map,
972
+ ).data
973
+
974
+
975
+ @validate_call
976
+ def list_alert_events_with_http_info(
977
+ self,
978
+ limit: Annotated[Optional[StrictInt], Field(description="Requested page size. Values are clamped to the range 1..100.")] = None,
979
+ offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Requested offset into the event history.")] = None,
980
+ _request_timeout: Union[
981
+ None,
982
+ Annotated[StrictFloat, Field(gt=0)],
983
+ Tuple[
984
+ Annotated[StrictFloat, Field(gt=0)],
985
+ Annotated[StrictFloat, Field(gt=0)]
986
+ ]
987
+ ] = None,
988
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
989
+ _content_type: Optional[StrictStr] = None,
990
+ _headers: Optional[Dict[StrictStr, Any]] = None,
991
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
992
+ ) -> ApiResponse[AlertEventsResponse]:
993
+ """List Alert Events
994
+
995
+ List recent alert trigger events and delivery attempts for the authenticated user. Behavior: - accepts either a real API key or a session JWT bearer token - offset pagination ordered by newest event first - delivery rows currently reflect email delivery attempts
996
+
997
+ :param limit: Requested page size. Values are clamped to the range 1..100.
998
+ :type limit: int
999
+ :param offset: Requested offset into the event history.
1000
+ :type offset: int
1001
+ :param _request_timeout: timeout setting for this request. If one
1002
+ number provided, it will be total request
1003
+ timeout. It can also be a pair (tuple) of
1004
+ (connection, read) timeouts.
1005
+ :type _request_timeout: int, tuple(int, int), optional
1006
+ :param _request_auth: set to override the auth_settings for an a single
1007
+ request; this effectively ignores the
1008
+ authentication in the spec for a single request.
1009
+ :type _request_auth: dict, optional
1010
+ :param _content_type: force content-type for the request.
1011
+ :type _content_type: str, Optional
1012
+ :param _headers: set to override the headers for a single
1013
+ request; this effectively ignores the headers
1014
+ in the spec for a single request.
1015
+ :type _headers: dict, optional
1016
+ :param _host_index: set to override the host_index for a single
1017
+ request; this effectively ignores the host_index
1018
+ in the spec for a single request.
1019
+ :type _host_index: int, optional
1020
+ :return: Returns the result object.
1021
+ """ # noqa: E501
1022
+
1023
+ _param = self._list_alert_events_serialize(
1024
+ limit=limit,
1025
+ offset=offset,
1026
+ _request_auth=_request_auth,
1027
+ _content_type=_content_type,
1028
+ _headers=_headers,
1029
+ _host_index=_host_index
1030
+ )
1031
+
1032
+ _response_types_map: Dict[str, Optional[str]] = {
1033
+ '200': "AlertEventsResponse",
1034
+ '401': "ErrorResponse",
1035
+ '403': "ErrorResponse",
1036
+ '429': "ErrorResponse",
1037
+ '422': "ValidationErrorResponse",
1038
+ }
1039
+ response_data = self.api_client.call_api(
1040
+ *_param,
1041
+ _request_timeout=_request_timeout
1042
+ )
1043
+ response_data.read()
1044
+ return self.api_client.response_deserialize(
1045
+ response_data=response_data,
1046
+ response_types_map=_response_types_map,
1047
+ )
1048
+
1049
+
1050
+ @validate_call
1051
+ def list_alert_events_without_preload_content(
1052
+ self,
1053
+ limit: Annotated[Optional[StrictInt], Field(description="Requested page size. Values are clamped to the range 1..100.")] = None,
1054
+ offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Requested offset into the event history.")] = None,
1055
+ _request_timeout: Union[
1056
+ None,
1057
+ Annotated[StrictFloat, Field(gt=0)],
1058
+ Tuple[
1059
+ Annotated[StrictFloat, Field(gt=0)],
1060
+ Annotated[StrictFloat, Field(gt=0)]
1061
+ ]
1062
+ ] = None,
1063
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1064
+ _content_type: Optional[StrictStr] = None,
1065
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1066
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1067
+ ) -> RESTResponseType:
1068
+ """List Alert Events
1069
+
1070
+ List recent alert trigger events and delivery attempts for the authenticated user. Behavior: - accepts either a real API key or a session JWT bearer token - offset pagination ordered by newest event first - delivery rows currently reflect email delivery attempts
1071
+
1072
+ :param limit: Requested page size. Values are clamped to the range 1..100.
1073
+ :type limit: int
1074
+ :param offset: Requested offset into the event history.
1075
+ :type offset: int
1076
+ :param _request_timeout: timeout setting for this request. If one
1077
+ number provided, it will be total request
1078
+ timeout. It can also be a pair (tuple) of
1079
+ (connection, read) timeouts.
1080
+ :type _request_timeout: int, tuple(int, int), optional
1081
+ :param _request_auth: set to override the auth_settings for an a single
1082
+ request; this effectively ignores the
1083
+ authentication in the spec for a single request.
1084
+ :type _request_auth: dict, optional
1085
+ :param _content_type: force content-type for the request.
1086
+ :type _content_type: str, Optional
1087
+ :param _headers: set to override the headers for a single
1088
+ request; this effectively ignores the headers
1089
+ in the spec for a single request.
1090
+ :type _headers: dict, optional
1091
+ :param _host_index: set to override the host_index for a single
1092
+ request; this effectively ignores the host_index
1093
+ in the spec for a single request.
1094
+ :type _host_index: int, optional
1095
+ :return: Returns the result object.
1096
+ """ # noqa: E501
1097
+
1098
+ _param = self._list_alert_events_serialize(
1099
+ limit=limit,
1100
+ offset=offset,
1101
+ _request_auth=_request_auth,
1102
+ _content_type=_content_type,
1103
+ _headers=_headers,
1104
+ _host_index=_host_index
1105
+ )
1106
+
1107
+ _response_types_map: Dict[str, Optional[str]] = {
1108
+ '200': "AlertEventsResponse",
1109
+ '401': "ErrorResponse",
1110
+ '403': "ErrorResponse",
1111
+ '429': "ErrorResponse",
1112
+ '422': "ValidationErrorResponse",
1113
+ }
1114
+ response_data = self.api_client.call_api(
1115
+ *_param,
1116
+ _request_timeout=_request_timeout
1117
+ )
1118
+ return response_data.response
1119
+
1120
+
1121
+ def _list_alert_events_serialize(
1122
+ self,
1123
+ limit,
1124
+ offset,
1125
+ _request_auth,
1126
+ _content_type,
1127
+ _headers,
1128
+ _host_index,
1129
+ ) -> RequestSerialized:
1130
+
1131
+ _host = None
1132
+
1133
+ _collection_formats: Dict[str, str] = {
1134
+ }
1135
+
1136
+ _path_params: Dict[str, str] = {}
1137
+ _query_params: List[Tuple[str, str]] = []
1138
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1139
+ _form_params: List[Tuple[str, str]] = []
1140
+ _files: Dict[
1141
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1142
+ ] = {}
1143
+ _body_params: Optional[bytes] = None
1144
+
1145
+ # process the path parameters
1146
+ # process the query parameters
1147
+ if limit is not None:
1148
+
1149
+ _query_params.append(('limit', limit))
1150
+
1151
+ if offset is not None:
1152
+
1153
+ _query_params.append(('offset', offset))
1154
+
1155
+ # process the header parameters
1156
+ # process the form parameters
1157
+ # process the body parameter
1158
+
1159
+
1160
+ # set the HTTP header `Accept`
1161
+ if 'Accept' not in _header_params:
1162
+ _header_params['Accept'] = self.api_client.select_header_accept(
1163
+ [
1164
+ 'application/json'
1165
+ ]
1166
+ )
1167
+
1168
+
1169
+ # authentication setting
1170
+ _auth_settings: List[str] = [
1171
+ 'BearerAuth'
1172
+ ]
1173
+
1174
+ return self.api_client.param_serialize(
1175
+ method='GET',
1176
+ resource_path='/v1/account/alerts/events',
1177
+ path_params=_path_params,
1178
+ query_params=_query_params,
1179
+ header_params=_header_params,
1180
+ body=_body_params,
1181
+ post_params=_form_params,
1182
+ files=_files,
1183
+ auth_settings=_auth_settings,
1184
+ collection_formats=_collection_formats,
1185
+ _host=_host,
1186
+ _request_auth=_request_auth
1187
+ )
1188
+
1189
+
1190
+
1191
+
1192
+ @validate_call
1193
+ def list_alerts(
1194
+ self,
1195
+ limit: Annotated[Optional[StrictInt], Field(description="Requested page size. Values are clamped to the range 1..200.")] = None,
1196
+ offset: Annotated[Optional[StrictInt], Field(description="Zero-based starting position for this page.")] = None,
1197
+ search: Annotated[Optional[StrictStr], Field(description="Exact numeric item_id match or case-insensitive market_hash_name substring.")] = None,
1198
+ _request_timeout: Union[
1199
+ None,
1200
+ Annotated[StrictFloat, Field(gt=0)],
1201
+ Tuple[
1202
+ Annotated[StrictFloat, Field(gt=0)],
1203
+ Annotated[StrictFloat, Field(gt=0)]
1204
+ ]
1205
+ ] = None,
1206
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1207
+ _content_type: Optional[StrictStr] = None,
1208
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1209
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1210
+ ) -> AlertListResponse:
1211
+ """List Alerts
1212
+
1213
+ List configured item alerts for the authenticated user. Behavior: - accepts either a real API key or a session JWT bearer token - offset pagination ordered by newest created first - `search` matches exact numeric `item_id` or case-insensitive item-name substring - response pagination includes a real `total` count
1214
+
1215
+ :param limit: Requested page size. Values are clamped to the range 1..200.
1216
+ :type limit: int
1217
+ :param offset: Zero-based starting position for this page.
1218
+ :type offset: int
1219
+ :param search: Exact numeric item_id match or case-insensitive market_hash_name substring.
1220
+ :type search: str
1221
+ :param _request_timeout: timeout setting for this request. If one
1222
+ number provided, it will be total request
1223
+ timeout. It can also be a pair (tuple) of
1224
+ (connection, read) timeouts.
1225
+ :type _request_timeout: int, tuple(int, int), optional
1226
+ :param _request_auth: set to override the auth_settings for an a single
1227
+ request; this effectively ignores the
1228
+ authentication in the spec for a single request.
1229
+ :type _request_auth: dict, optional
1230
+ :param _content_type: force content-type for the request.
1231
+ :type _content_type: str, Optional
1232
+ :param _headers: set to override the headers for a single
1233
+ request; this effectively ignores the headers
1234
+ in the spec for a single request.
1235
+ :type _headers: dict, optional
1236
+ :param _host_index: set to override the host_index for a single
1237
+ request; this effectively ignores the host_index
1238
+ in the spec for a single request.
1239
+ :type _host_index: int, optional
1240
+ :return: Returns the result object.
1241
+ """ # noqa: E501
1242
+
1243
+ _param = self._list_alerts_serialize(
1244
+ limit=limit,
1245
+ offset=offset,
1246
+ search=search,
1247
+ _request_auth=_request_auth,
1248
+ _content_type=_content_type,
1249
+ _headers=_headers,
1250
+ _host_index=_host_index
1251
+ )
1252
+
1253
+ _response_types_map: Dict[str, Optional[str]] = {
1254
+ '200': "AlertListResponse",
1255
+ '401': "ErrorResponse",
1256
+ '403': "ErrorResponse",
1257
+ '429': "ErrorResponse",
1258
+ '422': "ValidationErrorResponse",
1259
+ }
1260
+ response_data = self.api_client.call_api(
1261
+ *_param,
1262
+ _request_timeout=_request_timeout
1263
+ )
1264
+ response_data.read()
1265
+ return self.api_client.response_deserialize(
1266
+ response_data=response_data,
1267
+ response_types_map=_response_types_map,
1268
+ ).data
1269
+
1270
+
1271
+ @validate_call
1272
+ def list_alerts_with_http_info(
1273
+ self,
1274
+ limit: Annotated[Optional[StrictInt], Field(description="Requested page size. Values are clamped to the range 1..200.")] = None,
1275
+ offset: Annotated[Optional[StrictInt], Field(description="Zero-based starting position for this page.")] = None,
1276
+ search: Annotated[Optional[StrictStr], Field(description="Exact numeric item_id match or case-insensitive market_hash_name substring.")] = None,
1277
+ _request_timeout: Union[
1278
+ None,
1279
+ Annotated[StrictFloat, Field(gt=0)],
1280
+ Tuple[
1281
+ Annotated[StrictFloat, Field(gt=0)],
1282
+ Annotated[StrictFloat, Field(gt=0)]
1283
+ ]
1284
+ ] = None,
1285
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1286
+ _content_type: Optional[StrictStr] = None,
1287
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1288
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1289
+ ) -> ApiResponse[AlertListResponse]:
1290
+ """List Alerts
1291
+
1292
+ List configured item alerts for the authenticated user. Behavior: - accepts either a real API key or a session JWT bearer token - offset pagination ordered by newest created first - `search` matches exact numeric `item_id` or case-insensitive item-name substring - response pagination includes a real `total` count
1293
+
1294
+ :param limit: Requested page size. Values are clamped to the range 1..200.
1295
+ :type limit: int
1296
+ :param offset: Zero-based starting position for this page.
1297
+ :type offset: int
1298
+ :param search: Exact numeric item_id match or case-insensitive market_hash_name substring.
1299
+ :type search: str
1300
+ :param _request_timeout: timeout setting for this request. If one
1301
+ number provided, it will be total request
1302
+ timeout. It can also be a pair (tuple) of
1303
+ (connection, read) timeouts.
1304
+ :type _request_timeout: int, tuple(int, int), optional
1305
+ :param _request_auth: set to override the auth_settings for an a single
1306
+ request; this effectively ignores the
1307
+ authentication in the spec for a single request.
1308
+ :type _request_auth: dict, optional
1309
+ :param _content_type: force content-type for the request.
1310
+ :type _content_type: str, Optional
1311
+ :param _headers: set to override the headers for a single
1312
+ request; this effectively ignores the headers
1313
+ in the spec for a single request.
1314
+ :type _headers: dict, optional
1315
+ :param _host_index: set to override the host_index for a single
1316
+ request; this effectively ignores the host_index
1317
+ in the spec for a single request.
1318
+ :type _host_index: int, optional
1319
+ :return: Returns the result object.
1320
+ """ # noqa: E501
1321
+
1322
+ _param = self._list_alerts_serialize(
1323
+ limit=limit,
1324
+ offset=offset,
1325
+ search=search,
1326
+ _request_auth=_request_auth,
1327
+ _content_type=_content_type,
1328
+ _headers=_headers,
1329
+ _host_index=_host_index
1330
+ )
1331
+
1332
+ _response_types_map: Dict[str, Optional[str]] = {
1333
+ '200': "AlertListResponse",
1334
+ '401': "ErrorResponse",
1335
+ '403': "ErrorResponse",
1336
+ '429': "ErrorResponse",
1337
+ '422': "ValidationErrorResponse",
1338
+ }
1339
+ response_data = self.api_client.call_api(
1340
+ *_param,
1341
+ _request_timeout=_request_timeout
1342
+ )
1343
+ response_data.read()
1344
+ return self.api_client.response_deserialize(
1345
+ response_data=response_data,
1346
+ response_types_map=_response_types_map,
1347
+ )
1348
+
1349
+
1350
+ @validate_call
1351
+ def list_alerts_without_preload_content(
1352
+ self,
1353
+ limit: Annotated[Optional[StrictInt], Field(description="Requested page size. Values are clamped to the range 1..200.")] = None,
1354
+ offset: Annotated[Optional[StrictInt], Field(description="Zero-based starting position for this page.")] = None,
1355
+ search: Annotated[Optional[StrictStr], Field(description="Exact numeric item_id match or case-insensitive market_hash_name substring.")] = None,
1356
+ _request_timeout: Union[
1357
+ None,
1358
+ Annotated[StrictFloat, Field(gt=0)],
1359
+ Tuple[
1360
+ Annotated[StrictFloat, Field(gt=0)],
1361
+ Annotated[StrictFloat, Field(gt=0)]
1362
+ ]
1363
+ ] = None,
1364
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1365
+ _content_type: Optional[StrictStr] = None,
1366
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1367
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1368
+ ) -> RESTResponseType:
1369
+ """List Alerts
1370
+
1371
+ List configured item alerts for the authenticated user. Behavior: - accepts either a real API key or a session JWT bearer token - offset pagination ordered by newest created first - `search` matches exact numeric `item_id` or case-insensitive item-name substring - response pagination includes a real `total` count
1372
+
1373
+ :param limit: Requested page size. Values are clamped to the range 1..200.
1374
+ :type limit: int
1375
+ :param offset: Zero-based starting position for this page.
1376
+ :type offset: int
1377
+ :param search: Exact numeric item_id match or case-insensitive market_hash_name substring.
1378
+ :type search: str
1379
+ :param _request_timeout: timeout setting for this request. If one
1380
+ number provided, it will be total request
1381
+ timeout. It can also be a pair (tuple) of
1382
+ (connection, read) timeouts.
1383
+ :type _request_timeout: int, tuple(int, int), optional
1384
+ :param _request_auth: set to override the auth_settings for an a single
1385
+ request; this effectively ignores the
1386
+ authentication in the spec for a single request.
1387
+ :type _request_auth: dict, optional
1388
+ :param _content_type: force content-type for the request.
1389
+ :type _content_type: str, Optional
1390
+ :param _headers: set to override the headers for a single
1391
+ request; this effectively ignores the headers
1392
+ in the spec for a single request.
1393
+ :type _headers: dict, optional
1394
+ :param _host_index: set to override the host_index for a single
1395
+ request; this effectively ignores the host_index
1396
+ in the spec for a single request.
1397
+ :type _host_index: int, optional
1398
+ :return: Returns the result object.
1399
+ """ # noqa: E501
1400
+
1401
+ _param = self._list_alerts_serialize(
1402
+ limit=limit,
1403
+ offset=offset,
1404
+ search=search,
1405
+ _request_auth=_request_auth,
1406
+ _content_type=_content_type,
1407
+ _headers=_headers,
1408
+ _host_index=_host_index
1409
+ )
1410
+
1411
+ _response_types_map: Dict[str, Optional[str]] = {
1412
+ '200': "AlertListResponse",
1413
+ '401': "ErrorResponse",
1414
+ '403': "ErrorResponse",
1415
+ '429': "ErrorResponse",
1416
+ '422': "ValidationErrorResponse",
1417
+ }
1418
+ response_data = self.api_client.call_api(
1419
+ *_param,
1420
+ _request_timeout=_request_timeout
1421
+ )
1422
+ return response_data.response
1423
+
1424
+
1425
+ def _list_alerts_serialize(
1426
+ self,
1427
+ limit,
1428
+ offset,
1429
+ search,
1430
+ _request_auth,
1431
+ _content_type,
1432
+ _headers,
1433
+ _host_index,
1434
+ ) -> RequestSerialized:
1435
+
1436
+ _host = None
1437
+
1438
+ _collection_formats: Dict[str, str] = {
1439
+ }
1440
+
1441
+ _path_params: Dict[str, str] = {}
1442
+ _query_params: List[Tuple[str, str]] = []
1443
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1444
+ _form_params: List[Tuple[str, str]] = []
1445
+ _files: Dict[
1446
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1447
+ ] = {}
1448
+ _body_params: Optional[bytes] = None
1449
+
1450
+ # process the path parameters
1451
+ # process the query parameters
1452
+ if limit is not None:
1453
+
1454
+ _query_params.append(('limit', limit))
1455
+
1456
+ if offset is not None:
1457
+
1458
+ _query_params.append(('offset', offset))
1459
+
1460
+ if search is not None:
1461
+
1462
+ _query_params.append(('search', search))
1463
+
1464
+ # process the header parameters
1465
+ # process the form parameters
1466
+ # process the body parameter
1467
+
1468
+
1469
+ # set the HTTP header `Accept`
1470
+ if 'Accept' not in _header_params:
1471
+ _header_params['Accept'] = self.api_client.select_header_accept(
1472
+ [
1473
+ 'application/json'
1474
+ ]
1475
+ )
1476
+
1477
+
1478
+ # authentication setting
1479
+ _auth_settings: List[str] = [
1480
+ 'BearerAuth'
1481
+ ]
1482
+
1483
+ return self.api_client.param_serialize(
1484
+ method='GET',
1485
+ resource_path='/v1/account/alerts',
1486
+ path_params=_path_params,
1487
+ query_params=_query_params,
1488
+ header_params=_header_params,
1489
+ body=_body_params,
1490
+ post_params=_form_params,
1491
+ files=_files,
1492
+ auth_settings=_auth_settings,
1493
+ collection_formats=_collection_formats,
1494
+ _host=_host,
1495
+ _request_auth=_request_auth
1496
+ )
1497
+
1498
+
1499
+
1500
+
1501
+ @validate_call
1502
+ def update_alert(
1503
+ self,
1504
+ alert_id: UUID,
1505
+ alert_update_request: AlertUpdateRequest,
1506
+ _request_timeout: Union[
1507
+ None,
1508
+ Annotated[StrictFloat, Field(gt=0)],
1509
+ Tuple[
1510
+ Annotated[StrictFloat, Field(gt=0)],
1511
+ Annotated[StrictFloat, Field(gt=0)]
1512
+ ]
1513
+ ] = None,
1514
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1515
+ _content_type: Optional[StrictStr] = None,
1516
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1517
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1518
+ ) -> AlertDefinition:
1519
+ """Update Alert
1520
+
1521
+ Update threshold fields or enabled state for an existing alert. At least one of `threshold_value`, `threshold_currency`, or `is_enabled` must be provided. Enabling an alert re-applies tier, configured-delivery-channel, and enabled-alert-limit checks.
1522
+
1523
+ :param alert_id: (required)
1524
+ :type alert_id: UUID
1525
+ :param alert_update_request: (required)
1526
+ :type alert_update_request: AlertUpdateRequest
1527
+ :param _request_timeout: timeout setting for this request. If one
1528
+ number provided, it will be total request
1529
+ timeout. It can also be a pair (tuple) of
1530
+ (connection, read) timeouts.
1531
+ :type _request_timeout: int, tuple(int, int), optional
1532
+ :param _request_auth: set to override the auth_settings for an a single
1533
+ request; this effectively ignores the
1534
+ authentication in the spec for a single request.
1535
+ :type _request_auth: dict, optional
1536
+ :param _content_type: force content-type for the request.
1537
+ :type _content_type: str, Optional
1538
+ :param _headers: set to override the headers for a single
1539
+ request; this effectively ignores the headers
1540
+ in the spec for a single request.
1541
+ :type _headers: dict, optional
1542
+ :param _host_index: set to override the host_index for a single
1543
+ request; this effectively ignores the host_index
1544
+ in the spec for a single request.
1545
+ :type _host_index: int, optional
1546
+ :return: Returns the result object.
1547
+ """ # noqa: E501
1548
+
1549
+ _param = self._update_alert_serialize(
1550
+ alert_id=alert_id,
1551
+ alert_update_request=alert_update_request,
1552
+ _request_auth=_request_auth,
1553
+ _content_type=_content_type,
1554
+ _headers=_headers,
1555
+ _host_index=_host_index
1556
+ )
1557
+
1558
+ _response_types_map: Dict[str, Optional[str]] = {
1559
+ '200': "AlertDefinition",
1560
+ '401': "ErrorResponse",
1561
+ '403': "ErrorResponse",
1562
+ '429': "ErrorResponse",
1563
+ '422': "ValidationErrorResponse",
1564
+ }
1565
+ response_data = self.api_client.call_api(
1566
+ *_param,
1567
+ _request_timeout=_request_timeout
1568
+ )
1569
+ response_data.read()
1570
+ return self.api_client.response_deserialize(
1571
+ response_data=response_data,
1572
+ response_types_map=_response_types_map,
1573
+ ).data
1574
+
1575
+
1576
+ @validate_call
1577
+ def update_alert_with_http_info(
1578
+ self,
1579
+ alert_id: UUID,
1580
+ alert_update_request: AlertUpdateRequest,
1581
+ _request_timeout: Union[
1582
+ None,
1583
+ Annotated[StrictFloat, Field(gt=0)],
1584
+ Tuple[
1585
+ Annotated[StrictFloat, Field(gt=0)],
1586
+ Annotated[StrictFloat, Field(gt=0)]
1587
+ ]
1588
+ ] = None,
1589
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1590
+ _content_type: Optional[StrictStr] = None,
1591
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1592
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1593
+ ) -> ApiResponse[AlertDefinition]:
1594
+ """Update Alert
1595
+
1596
+ Update threshold fields or enabled state for an existing alert. At least one of `threshold_value`, `threshold_currency`, or `is_enabled` must be provided. Enabling an alert re-applies tier, configured-delivery-channel, and enabled-alert-limit checks.
1597
+
1598
+ :param alert_id: (required)
1599
+ :type alert_id: UUID
1600
+ :param alert_update_request: (required)
1601
+ :type alert_update_request: AlertUpdateRequest
1602
+ :param _request_timeout: timeout setting for this request. If one
1603
+ number provided, it will be total request
1604
+ timeout. It can also be a pair (tuple) of
1605
+ (connection, read) timeouts.
1606
+ :type _request_timeout: int, tuple(int, int), optional
1607
+ :param _request_auth: set to override the auth_settings for an a single
1608
+ request; this effectively ignores the
1609
+ authentication in the spec for a single request.
1610
+ :type _request_auth: dict, optional
1611
+ :param _content_type: force content-type for the request.
1612
+ :type _content_type: str, Optional
1613
+ :param _headers: set to override the headers for a single
1614
+ request; this effectively ignores the headers
1615
+ in the spec for a single request.
1616
+ :type _headers: dict, optional
1617
+ :param _host_index: set to override the host_index for a single
1618
+ request; this effectively ignores the host_index
1619
+ in the spec for a single request.
1620
+ :type _host_index: int, optional
1621
+ :return: Returns the result object.
1622
+ """ # noqa: E501
1623
+
1624
+ _param = self._update_alert_serialize(
1625
+ alert_id=alert_id,
1626
+ alert_update_request=alert_update_request,
1627
+ _request_auth=_request_auth,
1628
+ _content_type=_content_type,
1629
+ _headers=_headers,
1630
+ _host_index=_host_index
1631
+ )
1632
+
1633
+ _response_types_map: Dict[str, Optional[str]] = {
1634
+ '200': "AlertDefinition",
1635
+ '401': "ErrorResponse",
1636
+ '403': "ErrorResponse",
1637
+ '429': "ErrorResponse",
1638
+ '422': "ValidationErrorResponse",
1639
+ }
1640
+ response_data = self.api_client.call_api(
1641
+ *_param,
1642
+ _request_timeout=_request_timeout
1643
+ )
1644
+ response_data.read()
1645
+ return self.api_client.response_deserialize(
1646
+ response_data=response_data,
1647
+ response_types_map=_response_types_map,
1648
+ )
1649
+
1650
+
1651
+ @validate_call
1652
+ def update_alert_without_preload_content(
1653
+ self,
1654
+ alert_id: UUID,
1655
+ alert_update_request: AlertUpdateRequest,
1656
+ _request_timeout: Union[
1657
+ None,
1658
+ Annotated[StrictFloat, Field(gt=0)],
1659
+ Tuple[
1660
+ Annotated[StrictFloat, Field(gt=0)],
1661
+ Annotated[StrictFloat, Field(gt=0)]
1662
+ ]
1663
+ ] = None,
1664
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1665
+ _content_type: Optional[StrictStr] = None,
1666
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1667
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1668
+ ) -> RESTResponseType:
1669
+ """Update Alert
1670
+
1671
+ Update threshold fields or enabled state for an existing alert. At least one of `threshold_value`, `threshold_currency`, or `is_enabled` must be provided. Enabling an alert re-applies tier, configured-delivery-channel, and enabled-alert-limit checks.
1672
+
1673
+ :param alert_id: (required)
1674
+ :type alert_id: UUID
1675
+ :param alert_update_request: (required)
1676
+ :type alert_update_request: AlertUpdateRequest
1677
+ :param _request_timeout: timeout setting for this request. If one
1678
+ number provided, it will be total request
1679
+ timeout. It can also be a pair (tuple) of
1680
+ (connection, read) timeouts.
1681
+ :type _request_timeout: int, tuple(int, int), optional
1682
+ :param _request_auth: set to override the auth_settings for an a single
1683
+ request; this effectively ignores the
1684
+ authentication in the spec for a single request.
1685
+ :type _request_auth: dict, optional
1686
+ :param _content_type: force content-type for the request.
1687
+ :type _content_type: str, Optional
1688
+ :param _headers: set to override the headers for a single
1689
+ request; this effectively ignores the headers
1690
+ in the spec for a single request.
1691
+ :type _headers: dict, optional
1692
+ :param _host_index: set to override the host_index for a single
1693
+ request; this effectively ignores the host_index
1694
+ in the spec for a single request.
1695
+ :type _host_index: int, optional
1696
+ :return: Returns the result object.
1697
+ """ # noqa: E501
1698
+
1699
+ _param = self._update_alert_serialize(
1700
+ alert_id=alert_id,
1701
+ alert_update_request=alert_update_request,
1702
+ _request_auth=_request_auth,
1703
+ _content_type=_content_type,
1704
+ _headers=_headers,
1705
+ _host_index=_host_index
1706
+ )
1707
+
1708
+ _response_types_map: Dict[str, Optional[str]] = {
1709
+ '200': "AlertDefinition",
1710
+ '401': "ErrorResponse",
1711
+ '403': "ErrorResponse",
1712
+ '429': "ErrorResponse",
1713
+ '422': "ValidationErrorResponse",
1714
+ }
1715
+ response_data = self.api_client.call_api(
1716
+ *_param,
1717
+ _request_timeout=_request_timeout
1718
+ )
1719
+ return response_data.response
1720
+
1721
+
1722
+ def _update_alert_serialize(
1723
+ self,
1724
+ alert_id,
1725
+ alert_update_request,
1726
+ _request_auth,
1727
+ _content_type,
1728
+ _headers,
1729
+ _host_index,
1730
+ ) -> RequestSerialized:
1731
+
1732
+ _host = None
1733
+
1734
+ _collection_formats: Dict[str, str] = {
1735
+ }
1736
+
1737
+ _path_params: Dict[str, str] = {}
1738
+ _query_params: List[Tuple[str, str]] = []
1739
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1740
+ _form_params: List[Tuple[str, str]] = []
1741
+ _files: Dict[
1742
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1743
+ ] = {}
1744
+ _body_params: Optional[bytes] = None
1745
+
1746
+ # process the path parameters
1747
+ if alert_id is not None:
1748
+ _path_params['alert_id'] = alert_id
1749
+ # process the query parameters
1750
+ # process the header parameters
1751
+ # process the form parameters
1752
+ # process the body parameter
1753
+ if alert_update_request is not None:
1754
+ _body_params = alert_update_request
1755
+
1756
+
1757
+ # set the HTTP header `Accept`
1758
+ if 'Accept' not in _header_params:
1759
+ _header_params['Accept'] = self.api_client.select_header_accept(
1760
+ [
1761
+ 'application/json'
1762
+ ]
1763
+ )
1764
+
1765
+ # set the HTTP header `Content-Type`
1766
+ if _content_type:
1767
+ _header_params['Content-Type'] = _content_type
1768
+ else:
1769
+ _default_content_type = (
1770
+ self.api_client.select_header_content_type(
1771
+ [
1772
+ 'application/json'
1773
+ ]
1774
+ )
1775
+ )
1776
+ if _default_content_type is not None:
1777
+ _header_params['Content-Type'] = _default_content_type
1778
+
1779
+ # authentication setting
1780
+ _auth_settings: List[str] = [
1781
+ 'BearerAuth'
1782
+ ]
1783
+
1784
+ return self.api_client.param_serialize(
1785
+ method='PATCH',
1786
+ resource_path='/v1/account/alerts/{alert_id}',
1787
+ path_params=_path_params,
1788
+ query_params=_query_params,
1789
+ header_params=_header_params,
1790
+ body=_body_params,
1791
+ post_params=_form_params,
1792
+ files=_files,
1793
+ auth_settings=_auth_settings,
1794
+ collection_formats=_collection_formats,
1795
+ _host=_host,
1796
+ _request_auth=_request_auth
1797
+ )
1798
+
1799
+