hatchet-sdk 1.16.4__py3-none-any.whl → 1.17.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.
Potentially problematic release.
This version of hatchet-sdk might be problematic. Click here for more details.
- hatchet_sdk/__init__.py +2 -1
- hatchet_sdk/clients/events.py +5 -2
- hatchet_sdk/clients/rest/__init__.py +32 -0
- hatchet_sdk/clients/rest/api/__init__.py +1 -0
- hatchet_sdk/clients/rest/api/webhook_api.py +1551 -0
- hatchet_sdk/clients/rest/models/__init__.py +31 -0
- hatchet_sdk/clients/rest/models/v1_create_webhook_request.py +215 -0
- hatchet_sdk/clients/rest/models/v1_create_webhook_request_api_key.py +126 -0
- hatchet_sdk/clients/rest/models/v1_create_webhook_request_api_key_all_of_auth_type.py +82 -0
- hatchet_sdk/clients/rest/models/v1_create_webhook_request_base.py +98 -0
- hatchet_sdk/clients/rest/models/v1_create_webhook_request_basic_auth.py +126 -0
- hatchet_sdk/clients/rest/models/v1_create_webhook_request_basic_auth_all_of_auth_type.py +82 -0
- hatchet_sdk/clients/rest/models/v1_create_webhook_request_hmac.py +126 -0
- hatchet_sdk/clients/rest/models/v1_create_webhook_request_hmac_all_of_auth_type.py +82 -0
- hatchet_sdk/clients/rest/models/v1_event.py +7 -0
- hatchet_sdk/clients/rest/models/v1_webhook.py +126 -0
- hatchet_sdk/clients/rest/models/v1_webhook_api_key_auth.py +90 -0
- hatchet_sdk/clients/rest/models/v1_webhook_auth_type.py +38 -0
- hatchet_sdk/clients/rest/models/v1_webhook_basic_auth.py +86 -0
- hatchet_sdk/clients/rest/models/v1_webhook_hmac_algorithm.py +39 -0
- hatchet_sdk/clients/rest/models/v1_webhook_hmac_auth.py +115 -0
- hatchet_sdk/clients/rest/models/v1_webhook_hmac_encoding.py +38 -0
- hatchet_sdk/clients/rest/models/v1_webhook_list.py +110 -0
- hatchet_sdk/clients/rest/models/v1_webhook_receive200_response.py +83 -0
- hatchet_sdk/clients/rest/models/v1_webhook_source_name.py +38 -0
- hatchet_sdk/context/context.py +31 -2
- hatchet_sdk/exceptions.py +70 -5
- hatchet_sdk/hatchet.py +29 -11
- hatchet_sdk/rate_limit.py +1 -21
- hatchet_sdk/runnables/task.py +109 -19
- hatchet_sdk/runnables/workflow.py +23 -8
- hatchet_sdk/utils/typing.py +27 -0
- hatchet_sdk/worker/runner/runner.py +27 -19
- hatchet_sdk/worker/runner/utils/capture_logs.py +24 -11
- {hatchet_sdk-1.16.4.dist-info → hatchet_sdk-1.17.0.dist-info}/METADATA +2 -3
- {hatchet_sdk-1.16.4.dist-info → hatchet_sdk-1.17.0.dist-info}/RECORD +38 -19
- {hatchet_sdk-1.16.4.dist-info → hatchet_sdk-1.17.0.dist-info}/WHEEL +0 -0
- {hatchet_sdk-1.16.4.dist-info → hatchet_sdk-1.17.0.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,1551 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Hatchet API
|
|
5
|
+
|
|
6
|
+
The Hatchet API
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
import warnings
|
|
15
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
16
|
+
|
|
17
|
+
from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
|
|
18
|
+
from typing_extensions import Annotated
|
|
19
|
+
|
|
20
|
+
from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized
|
|
21
|
+
from hatchet_sdk.clients.rest.api_response import ApiResponse
|
|
22
|
+
from hatchet_sdk.clients.rest.models.v1_create_webhook_request import (
|
|
23
|
+
V1CreateWebhookRequest,
|
|
24
|
+
)
|
|
25
|
+
from hatchet_sdk.clients.rest.models.v1_webhook import V1Webhook
|
|
26
|
+
from hatchet_sdk.clients.rest.models.v1_webhook_list import V1WebhookList
|
|
27
|
+
from hatchet_sdk.clients.rest.models.v1_webhook_receive200_response import (
|
|
28
|
+
V1WebhookReceive200Response,
|
|
29
|
+
)
|
|
30
|
+
from hatchet_sdk.clients.rest.models.v1_webhook_source_name import V1WebhookSourceName
|
|
31
|
+
from hatchet_sdk.clients.rest.rest import RESTResponseType
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class WebhookApi:
|
|
35
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
36
|
+
Ref: https://openapi-generator.tech
|
|
37
|
+
|
|
38
|
+
Do not edit the class manually.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
def __init__(self, api_client=None) -> None:
|
|
42
|
+
if api_client is None:
|
|
43
|
+
api_client = ApiClient.get_default()
|
|
44
|
+
self.api_client = api_client
|
|
45
|
+
|
|
46
|
+
@validate_call
|
|
47
|
+
def v1_webhook_create(
|
|
48
|
+
self,
|
|
49
|
+
tenant: Annotated[
|
|
50
|
+
str,
|
|
51
|
+
Field(
|
|
52
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
53
|
+
),
|
|
54
|
+
],
|
|
55
|
+
v1_create_webhook_request: Annotated[
|
|
56
|
+
V1CreateWebhookRequest,
|
|
57
|
+
Field(description="The input to the webhook creation"),
|
|
58
|
+
],
|
|
59
|
+
_request_timeout: Union[
|
|
60
|
+
None,
|
|
61
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
62
|
+
Tuple[
|
|
63
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
64
|
+
],
|
|
65
|
+
] = None,
|
|
66
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
67
|
+
_content_type: Optional[StrictStr] = None,
|
|
68
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
69
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
70
|
+
) -> V1Webhook:
|
|
71
|
+
"""Create a webhook
|
|
72
|
+
|
|
73
|
+
Create a new webhook
|
|
74
|
+
|
|
75
|
+
:param tenant: The tenant id (required)
|
|
76
|
+
:type tenant: str
|
|
77
|
+
:param v1_create_webhook_request: The input to the webhook creation (required)
|
|
78
|
+
:type v1_create_webhook_request: V1CreateWebhookRequest
|
|
79
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
80
|
+
number provided, it will be total request
|
|
81
|
+
timeout. It can also be a pair (tuple) of
|
|
82
|
+
(connection, read) timeouts.
|
|
83
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
84
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
85
|
+
request; this effectively ignores the
|
|
86
|
+
authentication in the spec for a single request.
|
|
87
|
+
:type _request_auth: dict, optional
|
|
88
|
+
:param _content_type: force content-type for the request.
|
|
89
|
+
:type _content_type: str, Optional
|
|
90
|
+
:param _headers: set to override the headers for a single
|
|
91
|
+
request; this effectively ignores the headers
|
|
92
|
+
in the spec for a single request.
|
|
93
|
+
:type _headers: dict, optional
|
|
94
|
+
:param _host_index: set to override the host_index for a single
|
|
95
|
+
request; this effectively ignores the host_index
|
|
96
|
+
in the spec for a single request.
|
|
97
|
+
:type _host_index: int, optional
|
|
98
|
+
:return: Returns the result object.
|
|
99
|
+
""" # noqa: E501
|
|
100
|
+
|
|
101
|
+
_param = self._v1_webhook_create_serialize(
|
|
102
|
+
tenant=tenant,
|
|
103
|
+
v1_create_webhook_request=v1_create_webhook_request,
|
|
104
|
+
_request_auth=_request_auth,
|
|
105
|
+
_content_type=_content_type,
|
|
106
|
+
_headers=_headers,
|
|
107
|
+
_host_index=_host_index,
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
111
|
+
"200": "V1Webhook",
|
|
112
|
+
"400": "APIErrors",
|
|
113
|
+
"403": "APIErrors",
|
|
114
|
+
"404": "APIErrors",
|
|
115
|
+
}
|
|
116
|
+
response_data = self.api_client.call_api(
|
|
117
|
+
*_param, _request_timeout=_request_timeout
|
|
118
|
+
)
|
|
119
|
+
response_data.read()
|
|
120
|
+
return self.api_client.response_deserialize(
|
|
121
|
+
response_data=response_data,
|
|
122
|
+
response_types_map=_response_types_map,
|
|
123
|
+
).data
|
|
124
|
+
|
|
125
|
+
@validate_call
|
|
126
|
+
def v1_webhook_create_with_http_info(
|
|
127
|
+
self,
|
|
128
|
+
tenant: Annotated[
|
|
129
|
+
str,
|
|
130
|
+
Field(
|
|
131
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
132
|
+
),
|
|
133
|
+
],
|
|
134
|
+
v1_create_webhook_request: Annotated[
|
|
135
|
+
V1CreateWebhookRequest,
|
|
136
|
+
Field(description="The input to the webhook creation"),
|
|
137
|
+
],
|
|
138
|
+
_request_timeout: Union[
|
|
139
|
+
None,
|
|
140
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
141
|
+
Tuple[
|
|
142
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
143
|
+
],
|
|
144
|
+
] = None,
|
|
145
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
146
|
+
_content_type: Optional[StrictStr] = None,
|
|
147
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
148
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
149
|
+
) -> ApiResponse[V1Webhook]:
|
|
150
|
+
"""Create a webhook
|
|
151
|
+
|
|
152
|
+
Create a new webhook
|
|
153
|
+
|
|
154
|
+
:param tenant: The tenant id (required)
|
|
155
|
+
:type tenant: str
|
|
156
|
+
:param v1_create_webhook_request: The input to the webhook creation (required)
|
|
157
|
+
:type v1_create_webhook_request: V1CreateWebhookRequest
|
|
158
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
159
|
+
number provided, it will be total request
|
|
160
|
+
timeout. It can also be a pair (tuple) of
|
|
161
|
+
(connection, read) timeouts.
|
|
162
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
163
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
164
|
+
request; this effectively ignores the
|
|
165
|
+
authentication in the spec for a single request.
|
|
166
|
+
:type _request_auth: dict, optional
|
|
167
|
+
:param _content_type: force content-type for the request.
|
|
168
|
+
:type _content_type: str, Optional
|
|
169
|
+
:param _headers: set to override the headers for a single
|
|
170
|
+
request; this effectively ignores the headers
|
|
171
|
+
in the spec for a single request.
|
|
172
|
+
:type _headers: dict, optional
|
|
173
|
+
:param _host_index: set to override the host_index for a single
|
|
174
|
+
request; this effectively ignores the host_index
|
|
175
|
+
in the spec for a single request.
|
|
176
|
+
:type _host_index: int, optional
|
|
177
|
+
:return: Returns the result object.
|
|
178
|
+
""" # noqa: E501
|
|
179
|
+
|
|
180
|
+
_param = self._v1_webhook_create_serialize(
|
|
181
|
+
tenant=tenant,
|
|
182
|
+
v1_create_webhook_request=v1_create_webhook_request,
|
|
183
|
+
_request_auth=_request_auth,
|
|
184
|
+
_content_type=_content_type,
|
|
185
|
+
_headers=_headers,
|
|
186
|
+
_host_index=_host_index,
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
190
|
+
"200": "V1Webhook",
|
|
191
|
+
"400": "APIErrors",
|
|
192
|
+
"403": "APIErrors",
|
|
193
|
+
"404": "APIErrors",
|
|
194
|
+
}
|
|
195
|
+
response_data = self.api_client.call_api(
|
|
196
|
+
*_param, _request_timeout=_request_timeout
|
|
197
|
+
)
|
|
198
|
+
response_data.read()
|
|
199
|
+
return self.api_client.response_deserialize(
|
|
200
|
+
response_data=response_data,
|
|
201
|
+
response_types_map=_response_types_map,
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
@validate_call
|
|
205
|
+
def v1_webhook_create_without_preload_content(
|
|
206
|
+
self,
|
|
207
|
+
tenant: Annotated[
|
|
208
|
+
str,
|
|
209
|
+
Field(
|
|
210
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
211
|
+
),
|
|
212
|
+
],
|
|
213
|
+
v1_create_webhook_request: Annotated[
|
|
214
|
+
V1CreateWebhookRequest,
|
|
215
|
+
Field(description="The input to the webhook creation"),
|
|
216
|
+
],
|
|
217
|
+
_request_timeout: Union[
|
|
218
|
+
None,
|
|
219
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
220
|
+
Tuple[
|
|
221
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
222
|
+
],
|
|
223
|
+
] = None,
|
|
224
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
225
|
+
_content_type: Optional[StrictStr] = None,
|
|
226
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
227
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
228
|
+
) -> RESTResponseType:
|
|
229
|
+
"""Create a webhook
|
|
230
|
+
|
|
231
|
+
Create a new webhook
|
|
232
|
+
|
|
233
|
+
:param tenant: The tenant id (required)
|
|
234
|
+
:type tenant: str
|
|
235
|
+
:param v1_create_webhook_request: The input to the webhook creation (required)
|
|
236
|
+
:type v1_create_webhook_request: V1CreateWebhookRequest
|
|
237
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
238
|
+
number provided, it will be total request
|
|
239
|
+
timeout. It can also be a pair (tuple) of
|
|
240
|
+
(connection, read) timeouts.
|
|
241
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
242
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
243
|
+
request; this effectively ignores the
|
|
244
|
+
authentication in the spec for a single request.
|
|
245
|
+
:type _request_auth: dict, optional
|
|
246
|
+
:param _content_type: force content-type for the request.
|
|
247
|
+
:type _content_type: str, Optional
|
|
248
|
+
:param _headers: set to override the headers for a single
|
|
249
|
+
request; this effectively ignores the headers
|
|
250
|
+
in the spec for a single request.
|
|
251
|
+
:type _headers: dict, optional
|
|
252
|
+
:param _host_index: set to override the host_index for a single
|
|
253
|
+
request; this effectively ignores the host_index
|
|
254
|
+
in the spec for a single request.
|
|
255
|
+
:type _host_index: int, optional
|
|
256
|
+
:return: Returns the result object.
|
|
257
|
+
""" # noqa: E501
|
|
258
|
+
|
|
259
|
+
_param = self._v1_webhook_create_serialize(
|
|
260
|
+
tenant=tenant,
|
|
261
|
+
v1_create_webhook_request=v1_create_webhook_request,
|
|
262
|
+
_request_auth=_request_auth,
|
|
263
|
+
_content_type=_content_type,
|
|
264
|
+
_headers=_headers,
|
|
265
|
+
_host_index=_host_index,
|
|
266
|
+
)
|
|
267
|
+
|
|
268
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
269
|
+
"200": "V1Webhook",
|
|
270
|
+
"400": "APIErrors",
|
|
271
|
+
"403": "APIErrors",
|
|
272
|
+
"404": "APIErrors",
|
|
273
|
+
}
|
|
274
|
+
response_data = self.api_client.call_api(
|
|
275
|
+
*_param, _request_timeout=_request_timeout
|
|
276
|
+
)
|
|
277
|
+
return response_data.response
|
|
278
|
+
|
|
279
|
+
def _v1_webhook_create_serialize(
|
|
280
|
+
self,
|
|
281
|
+
tenant,
|
|
282
|
+
v1_create_webhook_request,
|
|
283
|
+
_request_auth,
|
|
284
|
+
_content_type,
|
|
285
|
+
_headers,
|
|
286
|
+
_host_index,
|
|
287
|
+
) -> RequestSerialized:
|
|
288
|
+
|
|
289
|
+
_host = None
|
|
290
|
+
|
|
291
|
+
_collection_formats: Dict[str, str] = {}
|
|
292
|
+
|
|
293
|
+
_path_params: Dict[str, str] = {}
|
|
294
|
+
_query_params: List[Tuple[str, str]] = []
|
|
295
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
296
|
+
_form_params: List[Tuple[str, str]] = []
|
|
297
|
+
_files: Dict[
|
|
298
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
299
|
+
] = {}
|
|
300
|
+
_body_params: Optional[bytes] = None
|
|
301
|
+
|
|
302
|
+
# process the path parameters
|
|
303
|
+
if tenant is not None:
|
|
304
|
+
_path_params["tenant"] = tenant
|
|
305
|
+
# process the query parameters
|
|
306
|
+
# process the header parameters
|
|
307
|
+
# process the form parameters
|
|
308
|
+
# process the body parameter
|
|
309
|
+
if v1_create_webhook_request is not None:
|
|
310
|
+
_body_params = v1_create_webhook_request
|
|
311
|
+
|
|
312
|
+
# set the HTTP header `Accept`
|
|
313
|
+
if "Accept" not in _header_params:
|
|
314
|
+
_header_params["Accept"] = self.api_client.select_header_accept(
|
|
315
|
+
["application/json"]
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
# set the HTTP header `Content-Type`
|
|
319
|
+
if _content_type:
|
|
320
|
+
_header_params["Content-Type"] = _content_type
|
|
321
|
+
else:
|
|
322
|
+
_default_content_type = self.api_client.select_header_content_type(
|
|
323
|
+
["application/json"]
|
|
324
|
+
)
|
|
325
|
+
if _default_content_type is not None:
|
|
326
|
+
_header_params["Content-Type"] = _default_content_type
|
|
327
|
+
|
|
328
|
+
# authentication setting
|
|
329
|
+
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
|
|
330
|
+
|
|
331
|
+
return self.api_client.param_serialize(
|
|
332
|
+
method="POST",
|
|
333
|
+
resource_path="/api/v1/stable/tenants/{tenant}/webhooks",
|
|
334
|
+
path_params=_path_params,
|
|
335
|
+
query_params=_query_params,
|
|
336
|
+
header_params=_header_params,
|
|
337
|
+
body=_body_params,
|
|
338
|
+
post_params=_form_params,
|
|
339
|
+
files=_files,
|
|
340
|
+
auth_settings=_auth_settings,
|
|
341
|
+
collection_formats=_collection_formats,
|
|
342
|
+
_host=_host,
|
|
343
|
+
_request_auth=_request_auth,
|
|
344
|
+
)
|
|
345
|
+
|
|
346
|
+
@validate_call
|
|
347
|
+
def v1_webhook_delete(
|
|
348
|
+
self,
|
|
349
|
+
tenant: Annotated[
|
|
350
|
+
str,
|
|
351
|
+
Field(
|
|
352
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
353
|
+
),
|
|
354
|
+
],
|
|
355
|
+
v1_webhook: Annotated[
|
|
356
|
+
StrictStr, Field(description="The name of the webhook to delete")
|
|
357
|
+
],
|
|
358
|
+
_request_timeout: Union[
|
|
359
|
+
None,
|
|
360
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
361
|
+
Tuple[
|
|
362
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
363
|
+
],
|
|
364
|
+
] = None,
|
|
365
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
366
|
+
_content_type: Optional[StrictStr] = None,
|
|
367
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
368
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
369
|
+
) -> V1Webhook:
|
|
370
|
+
"""v1_webhook_delete
|
|
371
|
+
|
|
372
|
+
Delete a webhook
|
|
373
|
+
|
|
374
|
+
:param tenant: The tenant id (required)
|
|
375
|
+
:type tenant: str
|
|
376
|
+
:param v1_webhook: The name of the webhook to delete (required)
|
|
377
|
+
:type v1_webhook: str
|
|
378
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
379
|
+
number provided, it will be total request
|
|
380
|
+
timeout. It can also be a pair (tuple) of
|
|
381
|
+
(connection, read) timeouts.
|
|
382
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
383
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
384
|
+
request; this effectively ignores the
|
|
385
|
+
authentication in the spec for a single request.
|
|
386
|
+
:type _request_auth: dict, optional
|
|
387
|
+
:param _content_type: force content-type for the request.
|
|
388
|
+
:type _content_type: str, Optional
|
|
389
|
+
:param _headers: set to override the headers for a single
|
|
390
|
+
request; this effectively ignores the headers
|
|
391
|
+
in the spec for a single request.
|
|
392
|
+
:type _headers: dict, optional
|
|
393
|
+
:param _host_index: set to override the host_index for a single
|
|
394
|
+
request; this effectively ignores the host_index
|
|
395
|
+
in the spec for a single request.
|
|
396
|
+
:type _host_index: int, optional
|
|
397
|
+
:return: Returns the result object.
|
|
398
|
+
""" # noqa: E501
|
|
399
|
+
|
|
400
|
+
_param = self._v1_webhook_delete_serialize(
|
|
401
|
+
tenant=tenant,
|
|
402
|
+
v1_webhook=v1_webhook,
|
|
403
|
+
_request_auth=_request_auth,
|
|
404
|
+
_content_type=_content_type,
|
|
405
|
+
_headers=_headers,
|
|
406
|
+
_host_index=_host_index,
|
|
407
|
+
)
|
|
408
|
+
|
|
409
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
410
|
+
"200": "V1Webhook",
|
|
411
|
+
"400": "APIErrors",
|
|
412
|
+
"403": "APIErrors",
|
|
413
|
+
"404": "APIErrors",
|
|
414
|
+
}
|
|
415
|
+
response_data = self.api_client.call_api(
|
|
416
|
+
*_param, _request_timeout=_request_timeout
|
|
417
|
+
)
|
|
418
|
+
response_data.read()
|
|
419
|
+
return self.api_client.response_deserialize(
|
|
420
|
+
response_data=response_data,
|
|
421
|
+
response_types_map=_response_types_map,
|
|
422
|
+
).data
|
|
423
|
+
|
|
424
|
+
@validate_call
|
|
425
|
+
def v1_webhook_delete_with_http_info(
|
|
426
|
+
self,
|
|
427
|
+
tenant: Annotated[
|
|
428
|
+
str,
|
|
429
|
+
Field(
|
|
430
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
431
|
+
),
|
|
432
|
+
],
|
|
433
|
+
v1_webhook: Annotated[
|
|
434
|
+
StrictStr, Field(description="The name of the webhook to delete")
|
|
435
|
+
],
|
|
436
|
+
_request_timeout: Union[
|
|
437
|
+
None,
|
|
438
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
439
|
+
Tuple[
|
|
440
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
441
|
+
],
|
|
442
|
+
] = None,
|
|
443
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
444
|
+
_content_type: Optional[StrictStr] = None,
|
|
445
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
446
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
447
|
+
) -> ApiResponse[V1Webhook]:
|
|
448
|
+
"""v1_webhook_delete
|
|
449
|
+
|
|
450
|
+
Delete a webhook
|
|
451
|
+
|
|
452
|
+
:param tenant: The tenant id (required)
|
|
453
|
+
:type tenant: str
|
|
454
|
+
:param v1_webhook: The name of the webhook to delete (required)
|
|
455
|
+
:type v1_webhook: str
|
|
456
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
457
|
+
number provided, it will be total request
|
|
458
|
+
timeout. It can also be a pair (tuple) of
|
|
459
|
+
(connection, read) timeouts.
|
|
460
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
461
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
462
|
+
request; this effectively ignores the
|
|
463
|
+
authentication in the spec for a single request.
|
|
464
|
+
:type _request_auth: dict, optional
|
|
465
|
+
:param _content_type: force content-type for the request.
|
|
466
|
+
:type _content_type: str, Optional
|
|
467
|
+
:param _headers: set to override the headers for a single
|
|
468
|
+
request; this effectively ignores the headers
|
|
469
|
+
in the spec for a single request.
|
|
470
|
+
:type _headers: dict, optional
|
|
471
|
+
:param _host_index: set to override the host_index for a single
|
|
472
|
+
request; this effectively ignores the host_index
|
|
473
|
+
in the spec for a single request.
|
|
474
|
+
:type _host_index: int, optional
|
|
475
|
+
:return: Returns the result object.
|
|
476
|
+
""" # noqa: E501
|
|
477
|
+
|
|
478
|
+
_param = self._v1_webhook_delete_serialize(
|
|
479
|
+
tenant=tenant,
|
|
480
|
+
v1_webhook=v1_webhook,
|
|
481
|
+
_request_auth=_request_auth,
|
|
482
|
+
_content_type=_content_type,
|
|
483
|
+
_headers=_headers,
|
|
484
|
+
_host_index=_host_index,
|
|
485
|
+
)
|
|
486
|
+
|
|
487
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
488
|
+
"200": "V1Webhook",
|
|
489
|
+
"400": "APIErrors",
|
|
490
|
+
"403": "APIErrors",
|
|
491
|
+
"404": "APIErrors",
|
|
492
|
+
}
|
|
493
|
+
response_data = self.api_client.call_api(
|
|
494
|
+
*_param, _request_timeout=_request_timeout
|
|
495
|
+
)
|
|
496
|
+
response_data.read()
|
|
497
|
+
return self.api_client.response_deserialize(
|
|
498
|
+
response_data=response_data,
|
|
499
|
+
response_types_map=_response_types_map,
|
|
500
|
+
)
|
|
501
|
+
|
|
502
|
+
@validate_call
|
|
503
|
+
def v1_webhook_delete_without_preload_content(
|
|
504
|
+
self,
|
|
505
|
+
tenant: Annotated[
|
|
506
|
+
str,
|
|
507
|
+
Field(
|
|
508
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
509
|
+
),
|
|
510
|
+
],
|
|
511
|
+
v1_webhook: Annotated[
|
|
512
|
+
StrictStr, Field(description="The name of the webhook to delete")
|
|
513
|
+
],
|
|
514
|
+
_request_timeout: Union[
|
|
515
|
+
None,
|
|
516
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
517
|
+
Tuple[
|
|
518
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
519
|
+
],
|
|
520
|
+
] = None,
|
|
521
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
522
|
+
_content_type: Optional[StrictStr] = None,
|
|
523
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
524
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
525
|
+
) -> RESTResponseType:
|
|
526
|
+
"""v1_webhook_delete
|
|
527
|
+
|
|
528
|
+
Delete a webhook
|
|
529
|
+
|
|
530
|
+
:param tenant: The tenant id (required)
|
|
531
|
+
:type tenant: str
|
|
532
|
+
:param v1_webhook: The name of the webhook to delete (required)
|
|
533
|
+
:type v1_webhook: str
|
|
534
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
535
|
+
number provided, it will be total request
|
|
536
|
+
timeout. It can also be a pair (tuple) of
|
|
537
|
+
(connection, read) timeouts.
|
|
538
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
539
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
540
|
+
request; this effectively ignores the
|
|
541
|
+
authentication in the spec for a single request.
|
|
542
|
+
:type _request_auth: dict, optional
|
|
543
|
+
:param _content_type: force content-type for the request.
|
|
544
|
+
:type _content_type: str, Optional
|
|
545
|
+
:param _headers: set to override the headers for a single
|
|
546
|
+
request; this effectively ignores the headers
|
|
547
|
+
in the spec for a single request.
|
|
548
|
+
:type _headers: dict, optional
|
|
549
|
+
:param _host_index: set to override the host_index for a single
|
|
550
|
+
request; this effectively ignores the host_index
|
|
551
|
+
in the spec for a single request.
|
|
552
|
+
:type _host_index: int, optional
|
|
553
|
+
:return: Returns the result object.
|
|
554
|
+
""" # noqa: E501
|
|
555
|
+
|
|
556
|
+
_param = self._v1_webhook_delete_serialize(
|
|
557
|
+
tenant=tenant,
|
|
558
|
+
v1_webhook=v1_webhook,
|
|
559
|
+
_request_auth=_request_auth,
|
|
560
|
+
_content_type=_content_type,
|
|
561
|
+
_headers=_headers,
|
|
562
|
+
_host_index=_host_index,
|
|
563
|
+
)
|
|
564
|
+
|
|
565
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
566
|
+
"200": "V1Webhook",
|
|
567
|
+
"400": "APIErrors",
|
|
568
|
+
"403": "APIErrors",
|
|
569
|
+
"404": "APIErrors",
|
|
570
|
+
}
|
|
571
|
+
response_data = self.api_client.call_api(
|
|
572
|
+
*_param, _request_timeout=_request_timeout
|
|
573
|
+
)
|
|
574
|
+
return response_data.response
|
|
575
|
+
|
|
576
|
+
def _v1_webhook_delete_serialize(
|
|
577
|
+
self,
|
|
578
|
+
tenant,
|
|
579
|
+
v1_webhook,
|
|
580
|
+
_request_auth,
|
|
581
|
+
_content_type,
|
|
582
|
+
_headers,
|
|
583
|
+
_host_index,
|
|
584
|
+
) -> RequestSerialized:
|
|
585
|
+
|
|
586
|
+
_host = None
|
|
587
|
+
|
|
588
|
+
_collection_formats: Dict[str, str] = {}
|
|
589
|
+
|
|
590
|
+
_path_params: Dict[str, str] = {}
|
|
591
|
+
_query_params: List[Tuple[str, str]] = []
|
|
592
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
593
|
+
_form_params: List[Tuple[str, str]] = []
|
|
594
|
+
_files: Dict[
|
|
595
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
596
|
+
] = {}
|
|
597
|
+
_body_params: Optional[bytes] = None
|
|
598
|
+
|
|
599
|
+
# process the path parameters
|
|
600
|
+
if tenant is not None:
|
|
601
|
+
_path_params["tenant"] = tenant
|
|
602
|
+
if v1_webhook is not None:
|
|
603
|
+
_path_params["v1-webhook"] = v1_webhook
|
|
604
|
+
# process the query parameters
|
|
605
|
+
# process the header parameters
|
|
606
|
+
# process the form parameters
|
|
607
|
+
# process the body parameter
|
|
608
|
+
|
|
609
|
+
# set the HTTP header `Accept`
|
|
610
|
+
if "Accept" not in _header_params:
|
|
611
|
+
_header_params["Accept"] = self.api_client.select_header_accept(
|
|
612
|
+
["application/json"]
|
|
613
|
+
)
|
|
614
|
+
|
|
615
|
+
# authentication setting
|
|
616
|
+
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
|
|
617
|
+
|
|
618
|
+
return self.api_client.param_serialize(
|
|
619
|
+
method="DELETE",
|
|
620
|
+
resource_path="/api/v1/stable/tenants/{tenant}/webhooks/{v1-webhook}",
|
|
621
|
+
path_params=_path_params,
|
|
622
|
+
query_params=_query_params,
|
|
623
|
+
header_params=_header_params,
|
|
624
|
+
body=_body_params,
|
|
625
|
+
post_params=_form_params,
|
|
626
|
+
files=_files,
|
|
627
|
+
auth_settings=_auth_settings,
|
|
628
|
+
collection_formats=_collection_formats,
|
|
629
|
+
_host=_host,
|
|
630
|
+
_request_auth=_request_auth,
|
|
631
|
+
)
|
|
632
|
+
|
|
633
|
+
@validate_call
|
|
634
|
+
def v1_webhook_get(
|
|
635
|
+
self,
|
|
636
|
+
tenant: Annotated[
|
|
637
|
+
str,
|
|
638
|
+
Field(
|
|
639
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
640
|
+
),
|
|
641
|
+
],
|
|
642
|
+
v1_webhook: Annotated[StrictStr, Field(description="The webhook name")],
|
|
643
|
+
_request_timeout: Union[
|
|
644
|
+
None,
|
|
645
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
646
|
+
Tuple[
|
|
647
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
648
|
+
],
|
|
649
|
+
] = None,
|
|
650
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
651
|
+
_content_type: Optional[StrictStr] = None,
|
|
652
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
653
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
654
|
+
) -> V1Webhook:
|
|
655
|
+
"""Get a webhook
|
|
656
|
+
|
|
657
|
+
Get a webhook by its name
|
|
658
|
+
|
|
659
|
+
:param tenant: The tenant id (required)
|
|
660
|
+
:type tenant: str
|
|
661
|
+
:param v1_webhook: The webhook name (required)
|
|
662
|
+
:type v1_webhook: str
|
|
663
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
664
|
+
number provided, it will be total request
|
|
665
|
+
timeout. It can also be a pair (tuple) of
|
|
666
|
+
(connection, read) timeouts.
|
|
667
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
668
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
669
|
+
request; this effectively ignores the
|
|
670
|
+
authentication in the spec for a single request.
|
|
671
|
+
:type _request_auth: dict, optional
|
|
672
|
+
:param _content_type: force content-type for the request.
|
|
673
|
+
:type _content_type: str, Optional
|
|
674
|
+
:param _headers: set to override the headers for a single
|
|
675
|
+
request; this effectively ignores the headers
|
|
676
|
+
in the spec for a single request.
|
|
677
|
+
:type _headers: dict, optional
|
|
678
|
+
:param _host_index: set to override the host_index for a single
|
|
679
|
+
request; this effectively ignores the host_index
|
|
680
|
+
in the spec for a single request.
|
|
681
|
+
:type _host_index: int, optional
|
|
682
|
+
:return: Returns the result object.
|
|
683
|
+
""" # noqa: E501
|
|
684
|
+
|
|
685
|
+
_param = self._v1_webhook_get_serialize(
|
|
686
|
+
tenant=tenant,
|
|
687
|
+
v1_webhook=v1_webhook,
|
|
688
|
+
_request_auth=_request_auth,
|
|
689
|
+
_content_type=_content_type,
|
|
690
|
+
_headers=_headers,
|
|
691
|
+
_host_index=_host_index,
|
|
692
|
+
)
|
|
693
|
+
|
|
694
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
695
|
+
"200": "V1Webhook",
|
|
696
|
+
"400": "APIErrors",
|
|
697
|
+
"403": "APIErrors",
|
|
698
|
+
}
|
|
699
|
+
response_data = self.api_client.call_api(
|
|
700
|
+
*_param, _request_timeout=_request_timeout
|
|
701
|
+
)
|
|
702
|
+
response_data.read()
|
|
703
|
+
return self.api_client.response_deserialize(
|
|
704
|
+
response_data=response_data,
|
|
705
|
+
response_types_map=_response_types_map,
|
|
706
|
+
).data
|
|
707
|
+
|
|
708
|
+
@validate_call
|
|
709
|
+
def v1_webhook_get_with_http_info(
|
|
710
|
+
self,
|
|
711
|
+
tenant: Annotated[
|
|
712
|
+
str,
|
|
713
|
+
Field(
|
|
714
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
715
|
+
),
|
|
716
|
+
],
|
|
717
|
+
v1_webhook: Annotated[StrictStr, Field(description="The webhook name")],
|
|
718
|
+
_request_timeout: Union[
|
|
719
|
+
None,
|
|
720
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
721
|
+
Tuple[
|
|
722
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
723
|
+
],
|
|
724
|
+
] = None,
|
|
725
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
726
|
+
_content_type: Optional[StrictStr] = None,
|
|
727
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
728
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
729
|
+
) -> ApiResponse[V1Webhook]:
|
|
730
|
+
"""Get a webhook
|
|
731
|
+
|
|
732
|
+
Get a webhook by its name
|
|
733
|
+
|
|
734
|
+
:param tenant: The tenant id (required)
|
|
735
|
+
:type tenant: str
|
|
736
|
+
:param v1_webhook: The webhook name (required)
|
|
737
|
+
:type v1_webhook: str
|
|
738
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
739
|
+
number provided, it will be total request
|
|
740
|
+
timeout. It can also be a pair (tuple) of
|
|
741
|
+
(connection, read) timeouts.
|
|
742
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
743
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
744
|
+
request; this effectively ignores the
|
|
745
|
+
authentication in the spec for a single request.
|
|
746
|
+
:type _request_auth: dict, optional
|
|
747
|
+
:param _content_type: force content-type for the request.
|
|
748
|
+
:type _content_type: str, Optional
|
|
749
|
+
:param _headers: set to override the headers for a single
|
|
750
|
+
request; this effectively ignores the headers
|
|
751
|
+
in the spec for a single request.
|
|
752
|
+
:type _headers: dict, optional
|
|
753
|
+
:param _host_index: set to override the host_index for a single
|
|
754
|
+
request; this effectively ignores the host_index
|
|
755
|
+
in the spec for a single request.
|
|
756
|
+
:type _host_index: int, optional
|
|
757
|
+
:return: Returns the result object.
|
|
758
|
+
""" # noqa: E501
|
|
759
|
+
|
|
760
|
+
_param = self._v1_webhook_get_serialize(
|
|
761
|
+
tenant=tenant,
|
|
762
|
+
v1_webhook=v1_webhook,
|
|
763
|
+
_request_auth=_request_auth,
|
|
764
|
+
_content_type=_content_type,
|
|
765
|
+
_headers=_headers,
|
|
766
|
+
_host_index=_host_index,
|
|
767
|
+
)
|
|
768
|
+
|
|
769
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
770
|
+
"200": "V1Webhook",
|
|
771
|
+
"400": "APIErrors",
|
|
772
|
+
"403": "APIErrors",
|
|
773
|
+
}
|
|
774
|
+
response_data = self.api_client.call_api(
|
|
775
|
+
*_param, _request_timeout=_request_timeout
|
|
776
|
+
)
|
|
777
|
+
response_data.read()
|
|
778
|
+
return self.api_client.response_deserialize(
|
|
779
|
+
response_data=response_data,
|
|
780
|
+
response_types_map=_response_types_map,
|
|
781
|
+
)
|
|
782
|
+
|
|
783
|
+
@validate_call
|
|
784
|
+
def v1_webhook_get_without_preload_content(
|
|
785
|
+
self,
|
|
786
|
+
tenant: Annotated[
|
|
787
|
+
str,
|
|
788
|
+
Field(
|
|
789
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
790
|
+
),
|
|
791
|
+
],
|
|
792
|
+
v1_webhook: Annotated[StrictStr, Field(description="The webhook name")],
|
|
793
|
+
_request_timeout: Union[
|
|
794
|
+
None,
|
|
795
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
796
|
+
Tuple[
|
|
797
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
798
|
+
],
|
|
799
|
+
] = None,
|
|
800
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
801
|
+
_content_type: Optional[StrictStr] = None,
|
|
802
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
803
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
804
|
+
) -> RESTResponseType:
|
|
805
|
+
"""Get a webhook
|
|
806
|
+
|
|
807
|
+
Get a webhook by its name
|
|
808
|
+
|
|
809
|
+
:param tenant: The tenant id (required)
|
|
810
|
+
:type tenant: str
|
|
811
|
+
:param v1_webhook: The webhook name (required)
|
|
812
|
+
:type v1_webhook: str
|
|
813
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
814
|
+
number provided, it will be total request
|
|
815
|
+
timeout. It can also be a pair (tuple) of
|
|
816
|
+
(connection, read) timeouts.
|
|
817
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
818
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
819
|
+
request; this effectively ignores the
|
|
820
|
+
authentication in the spec for a single request.
|
|
821
|
+
:type _request_auth: dict, optional
|
|
822
|
+
:param _content_type: force content-type for the request.
|
|
823
|
+
:type _content_type: str, Optional
|
|
824
|
+
:param _headers: set to override the headers for a single
|
|
825
|
+
request; this effectively ignores the headers
|
|
826
|
+
in the spec for a single request.
|
|
827
|
+
:type _headers: dict, optional
|
|
828
|
+
:param _host_index: set to override the host_index for a single
|
|
829
|
+
request; this effectively ignores the host_index
|
|
830
|
+
in the spec for a single request.
|
|
831
|
+
:type _host_index: int, optional
|
|
832
|
+
:return: Returns the result object.
|
|
833
|
+
""" # noqa: E501
|
|
834
|
+
|
|
835
|
+
_param = self._v1_webhook_get_serialize(
|
|
836
|
+
tenant=tenant,
|
|
837
|
+
v1_webhook=v1_webhook,
|
|
838
|
+
_request_auth=_request_auth,
|
|
839
|
+
_content_type=_content_type,
|
|
840
|
+
_headers=_headers,
|
|
841
|
+
_host_index=_host_index,
|
|
842
|
+
)
|
|
843
|
+
|
|
844
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
845
|
+
"200": "V1Webhook",
|
|
846
|
+
"400": "APIErrors",
|
|
847
|
+
"403": "APIErrors",
|
|
848
|
+
}
|
|
849
|
+
response_data = self.api_client.call_api(
|
|
850
|
+
*_param, _request_timeout=_request_timeout
|
|
851
|
+
)
|
|
852
|
+
return response_data.response
|
|
853
|
+
|
|
854
|
+
def _v1_webhook_get_serialize(
|
|
855
|
+
self,
|
|
856
|
+
tenant,
|
|
857
|
+
v1_webhook,
|
|
858
|
+
_request_auth,
|
|
859
|
+
_content_type,
|
|
860
|
+
_headers,
|
|
861
|
+
_host_index,
|
|
862
|
+
) -> RequestSerialized:
|
|
863
|
+
|
|
864
|
+
_host = None
|
|
865
|
+
|
|
866
|
+
_collection_formats: Dict[str, str] = {}
|
|
867
|
+
|
|
868
|
+
_path_params: Dict[str, str] = {}
|
|
869
|
+
_query_params: List[Tuple[str, str]] = []
|
|
870
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
871
|
+
_form_params: List[Tuple[str, str]] = []
|
|
872
|
+
_files: Dict[
|
|
873
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
874
|
+
] = {}
|
|
875
|
+
_body_params: Optional[bytes] = None
|
|
876
|
+
|
|
877
|
+
# process the path parameters
|
|
878
|
+
if tenant is not None:
|
|
879
|
+
_path_params["tenant"] = tenant
|
|
880
|
+
if v1_webhook is not None:
|
|
881
|
+
_path_params["v1-webhook"] = v1_webhook
|
|
882
|
+
# process the query parameters
|
|
883
|
+
# process the header parameters
|
|
884
|
+
# process the form parameters
|
|
885
|
+
# process the body parameter
|
|
886
|
+
|
|
887
|
+
# set the HTTP header `Accept`
|
|
888
|
+
if "Accept" not in _header_params:
|
|
889
|
+
_header_params["Accept"] = self.api_client.select_header_accept(
|
|
890
|
+
["application/json"]
|
|
891
|
+
)
|
|
892
|
+
|
|
893
|
+
# authentication setting
|
|
894
|
+
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
|
|
895
|
+
|
|
896
|
+
return self.api_client.param_serialize(
|
|
897
|
+
method="GET",
|
|
898
|
+
resource_path="/api/v1/stable/tenants/{tenant}/webhooks/{v1-webhook}",
|
|
899
|
+
path_params=_path_params,
|
|
900
|
+
query_params=_query_params,
|
|
901
|
+
header_params=_header_params,
|
|
902
|
+
body=_body_params,
|
|
903
|
+
post_params=_form_params,
|
|
904
|
+
files=_files,
|
|
905
|
+
auth_settings=_auth_settings,
|
|
906
|
+
collection_formats=_collection_formats,
|
|
907
|
+
_host=_host,
|
|
908
|
+
_request_auth=_request_auth,
|
|
909
|
+
)
|
|
910
|
+
|
|
911
|
+
@validate_call
|
|
912
|
+
def v1_webhook_list(
|
|
913
|
+
self,
|
|
914
|
+
tenant: Annotated[
|
|
915
|
+
str,
|
|
916
|
+
Field(
|
|
917
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
918
|
+
),
|
|
919
|
+
],
|
|
920
|
+
offset: Annotated[
|
|
921
|
+
Optional[StrictInt], Field(description="The number to skip")
|
|
922
|
+
] = None,
|
|
923
|
+
limit: Annotated[
|
|
924
|
+
Optional[StrictInt], Field(description="The number to limit by")
|
|
925
|
+
] = None,
|
|
926
|
+
source_names: Annotated[
|
|
927
|
+
Optional[List[V1WebhookSourceName]],
|
|
928
|
+
Field(description="The source names to filter by"),
|
|
929
|
+
] = None,
|
|
930
|
+
webhook_names: Annotated[
|
|
931
|
+
Optional[List[StrictStr]],
|
|
932
|
+
Field(description="The webhook names to filter by"),
|
|
933
|
+
] = None,
|
|
934
|
+
_request_timeout: Union[
|
|
935
|
+
None,
|
|
936
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
937
|
+
Tuple[
|
|
938
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
939
|
+
],
|
|
940
|
+
] = None,
|
|
941
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
942
|
+
_content_type: Optional[StrictStr] = None,
|
|
943
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
944
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
945
|
+
) -> V1WebhookList:
|
|
946
|
+
"""List webhooks
|
|
947
|
+
|
|
948
|
+
Lists all webhook for a tenant.
|
|
949
|
+
|
|
950
|
+
:param tenant: The tenant id (required)
|
|
951
|
+
:type tenant: str
|
|
952
|
+
:param offset: The number to skip
|
|
953
|
+
:type offset: int
|
|
954
|
+
:param limit: The number to limit by
|
|
955
|
+
:type limit: int
|
|
956
|
+
:param source_names: The source names to filter by
|
|
957
|
+
:type source_names: List[V1WebhookSourceName]
|
|
958
|
+
:param webhook_names: The webhook names to filter by
|
|
959
|
+
:type webhook_names: List[str]
|
|
960
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
961
|
+
number provided, it will be total request
|
|
962
|
+
timeout. It can also be a pair (tuple) of
|
|
963
|
+
(connection, read) timeouts.
|
|
964
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
965
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
966
|
+
request; this effectively ignores the
|
|
967
|
+
authentication in the spec for a single request.
|
|
968
|
+
:type _request_auth: dict, optional
|
|
969
|
+
:param _content_type: force content-type for the request.
|
|
970
|
+
:type _content_type: str, Optional
|
|
971
|
+
:param _headers: set to override the headers for a single
|
|
972
|
+
request; this effectively ignores the headers
|
|
973
|
+
in the spec for a single request.
|
|
974
|
+
:type _headers: dict, optional
|
|
975
|
+
:param _host_index: set to override the host_index for a single
|
|
976
|
+
request; this effectively ignores the host_index
|
|
977
|
+
in the spec for a single request.
|
|
978
|
+
:type _host_index: int, optional
|
|
979
|
+
:return: Returns the result object.
|
|
980
|
+
""" # noqa: E501
|
|
981
|
+
|
|
982
|
+
_param = self._v1_webhook_list_serialize(
|
|
983
|
+
tenant=tenant,
|
|
984
|
+
offset=offset,
|
|
985
|
+
limit=limit,
|
|
986
|
+
source_names=source_names,
|
|
987
|
+
webhook_names=webhook_names,
|
|
988
|
+
_request_auth=_request_auth,
|
|
989
|
+
_content_type=_content_type,
|
|
990
|
+
_headers=_headers,
|
|
991
|
+
_host_index=_host_index,
|
|
992
|
+
)
|
|
993
|
+
|
|
994
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
995
|
+
"200": "V1WebhookList",
|
|
996
|
+
"400": "APIErrors",
|
|
997
|
+
"403": "APIErrors",
|
|
998
|
+
}
|
|
999
|
+
response_data = self.api_client.call_api(
|
|
1000
|
+
*_param, _request_timeout=_request_timeout
|
|
1001
|
+
)
|
|
1002
|
+
response_data.read()
|
|
1003
|
+
return self.api_client.response_deserialize(
|
|
1004
|
+
response_data=response_data,
|
|
1005
|
+
response_types_map=_response_types_map,
|
|
1006
|
+
).data
|
|
1007
|
+
|
|
1008
|
+
@validate_call
|
|
1009
|
+
def v1_webhook_list_with_http_info(
|
|
1010
|
+
self,
|
|
1011
|
+
tenant: Annotated[
|
|
1012
|
+
str,
|
|
1013
|
+
Field(
|
|
1014
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
1015
|
+
),
|
|
1016
|
+
],
|
|
1017
|
+
offset: Annotated[
|
|
1018
|
+
Optional[StrictInt], Field(description="The number to skip")
|
|
1019
|
+
] = None,
|
|
1020
|
+
limit: Annotated[
|
|
1021
|
+
Optional[StrictInt], Field(description="The number to limit by")
|
|
1022
|
+
] = None,
|
|
1023
|
+
source_names: Annotated[
|
|
1024
|
+
Optional[List[V1WebhookSourceName]],
|
|
1025
|
+
Field(description="The source names to filter by"),
|
|
1026
|
+
] = None,
|
|
1027
|
+
webhook_names: Annotated[
|
|
1028
|
+
Optional[List[StrictStr]],
|
|
1029
|
+
Field(description="The webhook names to filter by"),
|
|
1030
|
+
] = None,
|
|
1031
|
+
_request_timeout: Union[
|
|
1032
|
+
None,
|
|
1033
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1034
|
+
Tuple[
|
|
1035
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
1036
|
+
],
|
|
1037
|
+
] = None,
|
|
1038
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1039
|
+
_content_type: Optional[StrictStr] = None,
|
|
1040
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1041
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1042
|
+
) -> ApiResponse[V1WebhookList]:
|
|
1043
|
+
"""List webhooks
|
|
1044
|
+
|
|
1045
|
+
Lists all webhook for a tenant.
|
|
1046
|
+
|
|
1047
|
+
:param tenant: The tenant id (required)
|
|
1048
|
+
:type tenant: str
|
|
1049
|
+
:param offset: The number to skip
|
|
1050
|
+
:type offset: int
|
|
1051
|
+
:param limit: The number to limit by
|
|
1052
|
+
:type limit: int
|
|
1053
|
+
:param source_names: The source names to filter by
|
|
1054
|
+
:type source_names: List[V1WebhookSourceName]
|
|
1055
|
+
:param webhook_names: The webhook names to filter by
|
|
1056
|
+
:type webhook_names: List[str]
|
|
1057
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1058
|
+
number provided, it will be total request
|
|
1059
|
+
timeout. It can also be a pair (tuple) of
|
|
1060
|
+
(connection, read) timeouts.
|
|
1061
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1062
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1063
|
+
request; this effectively ignores the
|
|
1064
|
+
authentication in the spec for a single request.
|
|
1065
|
+
:type _request_auth: dict, optional
|
|
1066
|
+
:param _content_type: force content-type for the request.
|
|
1067
|
+
:type _content_type: str, Optional
|
|
1068
|
+
:param _headers: set to override the headers for a single
|
|
1069
|
+
request; this effectively ignores the headers
|
|
1070
|
+
in the spec for a single request.
|
|
1071
|
+
:type _headers: dict, optional
|
|
1072
|
+
:param _host_index: set to override the host_index for a single
|
|
1073
|
+
request; this effectively ignores the host_index
|
|
1074
|
+
in the spec for a single request.
|
|
1075
|
+
:type _host_index: int, optional
|
|
1076
|
+
:return: Returns the result object.
|
|
1077
|
+
""" # noqa: E501
|
|
1078
|
+
|
|
1079
|
+
_param = self._v1_webhook_list_serialize(
|
|
1080
|
+
tenant=tenant,
|
|
1081
|
+
offset=offset,
|
|
1082
|
+
limit=limit,
|
|
1083
|
+
source_names=source_names,
|
|
1084
|
+
webhook_names=webhook_names,
|
|
1085
|
+
_request_auth=_request_auth,
|
|
1086
|
+
_content_type=_content_type,
|
|
1087
|
+
_headers=_headers,
|
|
1088
|
+
_host_index=_host_index,
|
|
1089
|
+
)
|
|
1090
|
+
|
|
1091
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1092
|
+
"200": "V1WebhookList",
|
|
1093
|
+
"400": "APIErrors",
|
|
1094
|
+
"403": "APIErrors",
|
|
1095
|
+
}
|
|
1096
|
+
response_data = self.api_client.call_api(
|
|
1097
|
+
*_param, _request_timeout=_request_timeout
|
|
1098
|
+
)
|
|
1099
|
+
response_data.read()
|
|
1100
|
+
return self.api_client.response_deserialize(
|
|
1101
|
+
response_data=response_data,
|
|
1102
|
+
response_types_map=_response_types_map,
|
|
1103
|
+
)
|
|
1104
|
+
|
|
1105
|
+
@validate_call
|
|
1106
|
+
def v1_webhook_list_without_preload_content(
|
|
1107
|
+
self,
|
|
1108
|
+
tenant: Annotated[
|
|
1109
|
+
str,
|
|
1110
|
+
Field(
|
|
1111
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
1112
|
+
),
|
|
1113
|
+
],
|
|
1114
|
+
offset: Annotated[
|
|
1115
|
+
Optional[StrictInt], Field(description="The number to skip")
|
|
1116
|
+
] = None,
|
|
1117
|
+
limit: Annotated[
|
|
1118
|
+
Optional[StrictInt], Field(description="The number to limit by")
|
|
1119
|
+
] = None,
|
|
1120
|
+
source_names: Annotated[
|
|
1121
|
+
Optional[List[V1WebhookSourceName]],
|
|
1122
|
+
Field(description="The source names to filter by"),
|
|
1123
|
+
] = None,
|
|
1124
|
+
webhook_names: Annotated[
|
|
1125
|
+
Optional[List[StrictStr]],
|
|
1126
|
+
Field(description="The webhook names to filter by"),
|
|
1127
|
+
] = None,
|
|
1128
|
+
_request_timeout: Union[
|
|
1129
|
+
None,
|
|
1130
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1131
|
+
Tuple[
|
|
1132
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
1133
|
+
],
|
|
1134
|
+
] = None,
|
|
1135
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1136
|
+
_content_type: Optional[StrictStr] = None,
|
|
1137
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1138
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1139
|
+
) -> RESTResponseType:
|
|
1140
|
+
"""List webhooks
|
|
1141
|
+
|
|
1142
|
+
Lists all webhook for a tenant.
|
|
1143
|
+
|
|
1144
|
+
:param tenant: The tenant id (required)
|
|
1145
|
+
:type tenant: str
|
|
1146
|
+
:param offset: The number to skip
|
|
1147
|
+
:type offset: int
|
|
1148
|
+
:param limit: The number to limit by
|
|
1149
|
+
:type limit: int
|
|
1150
|
+
:param source_names: The source names to filter by
|
|
1151
|
+
:type source_names: List[V1WebhookSourceName]
|
|
1152
|
+
:param webhook_names: The webhook names to filter by
|
|
1153
|
+
:type webhook_names: List[str]
|
|
1154
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1155
|
+
number provided, it will be total request
|
|
1156
|
+
timeout. It can also be a pair (tuple) of
|
|
1157
|
+
(connection, read) timeouts.
|
|
1158
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1159
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1160
|
+
request; this effectively ignores the
|
|
1161
|
+
authentication in the spec for a single request.
|
|
1162
|
+
:type _request_auth: dict, optional
|
|
1163
|
+
:param _content_type: force content-type for the request.
|
|
1164
|
+
:type _content_type: str, Optional
|
|
1165
|
+
:param _headers: set to override the headers for a single
|
|
1166
|
+
request; this effectively ignores the headers
|
|
1167
|
+
in the spec for a single request.
|
|
1168
|
+
:type _headers: dict, optional
|
|
1169
|
+
:param _host_index: set to override the host_index for a single
|
|
1170
|
+
request; this effectively ignores the host_index
|
|
1171
|
+
in the spec for a single request.
|
|
1172
|
+
:type _host_index: int, optional
|
|
1173
|
+
:return: Returns the result object.
|
|
1174
|
+
""" # noqa: E501
|
|
1175
|
+
|
|
1176
|
+
_param = self._v1_webhook_list_serialize(
|
|
1177
|
+
tenant=tenant,
|
|
1178
|
+
offset=offset,
|
|
1179
|
+
limit=limit,
|
|
1180
|
+
source_names=source_names,
|
|
1181
|
+
webhook_names=webhook_names,
|
|
1182
|
+
_request_auth=_request_auth,
|
|
1183
|
+
_content_type=_content_type,
|
|
1184
|
+
_headers=_headers,
|
|
1185
|
+
_host_index=_host_index,
|
|
1186
|
+
)
|
|
1187
|
+
|
|
1188
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1189
|
+
"200": "V1WebhookList",
|
|
1190
|
+
"400": "APIErrors",
|
|
1191
|
+
"403": "APIErrors",
|
|
1192
|
+
}
|
|
1193
|
+
response_data = self.api_client.call_api(
|
|
1194
|
+
*_param, _request_timeout=_request_timeout
|
|
1195
|
+
)
|
|
1196
|
+
return response_data.response
|
|
1197
|
+
|
|
1198
|
+
def _v1_webhook_list_serialize(
|
|
1199
|
+
self,
|
|
1200
|
+
tenant,
|
|
1201
|
+
offset,
|
|
1202
|
+
limit,
|
|
1203
|
+
source_names,
|
|
1204
|
+
webhook_names,
|
|
1205
|
+
_request_auth,
|
|
1206
|
+
_content_type,
|
|
1207
|
+
_headers,
|
|
1208
|
+
_host_index,
|
|
1209
|
+
) -> RequestSerialized:
|
|
1210
|
+
|
|
1211
|
+
_host = None
|
|
1212
|
+
|
|
1213
|
+
_collection_formats: Dict[str, str] = {
|
|
1214
|
+
"sourceNames": "multi",
|
|
1215
|
+
"webhookNames": "multi",
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
_path_params: Dict[str, str] = {}
|
|
1219
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1220
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1221
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1222
|
+
_files: Dict[
|
|
1223
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1224
|
+
] = {}
|
|
1225
|
+
_body_params: Optional[bytes] = None
|
|
1226
|
+
|
|
1227
|
+
# process the path parameters
|
|
1228
|
+
if tenant is not None:
|
|
1229
|
+
_path_params["tenant"] = tenant
|
|
1230
|
+
# process the query parameters
|
|
1231
|
+
if offset is not None:
|
|
1232
|
+
|
|
1233
|
+
_query_params.append(("offset", offset))
|
|
1234
|
+
|
|
1235
|
+
if limit is not None:
|
|
1236
|
+
|
|
1237
|
+
_query_params.append(("limit", limit))
|
|
1238
|
+
|
|
1239
|
+
if source_names is not None:
|
|
1240
|
+
|
|
1241
|
+
_query_params.append(("sourceNames", source_names))
|
|
1242
|
+
|
|
1243
|
+
if webhook_names is not None:
|
|
1244
|
+
|
|
1245
|
+
_query_params.append(("webhookNames", webhook_names))
|
|
1246
|
+
|
|
1247
|
+
# process the header parameters
|
|
1248
|
+
# process the form parameters
|
|
1249
|
+
# process the body parameter
|
|
1250
|
+
|
|
1251
|
+
# set the HTTP header `Accept`
|
|
1252
|
+
if "Accept" not in _header_params:
|
|
1253
|
+
_header_params["Accept"] = self.api_client.select_header_accept(
|
|
1254
|
+
["application/json"]
|
|
1255
|
+
)
|
|
1256
|
+
|
|
1257
|
+
# authentication setting
|
|
1258
|
+
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
|
|
1259
|
+
|
|
1260
|
+
return self.api_client.param_serialize(
|
|
1261
|
+
method="GET",
|
|
1262
|
+
resource_path="/api/v1/stable/tenants/{tenant}/webhooks",
|
|
1263
|
+
path_params=_path_params,
|
|
1264
|
+
query_params=_query_params,
|
|
1265
|
+
header_params=_header_params,
|
|
1266
|
+
body=_body_params,
|
|
1267
|
+
post_params=_form_params,
|
|
1268
|
+
files=_files,
|
|
1269
|
+
auth_settings=_auth_settings,
|
|
1270
|
+
collection_formats=_collection_formats,
|
|
1271
|
+
_host=_host,
|
|
1272
|
+
_request_auth=_request_auth,
|
|
1273
|
+
)
|
|
1274
|
+
|
|
1275
|
+
@validate_call
|
|
1276
|
+
def v1_webhook_receive(
|
|
1277
|
+
self,
|
|
1278
|
+
tenant: Annotated[
|
|
1279
|
+
str,
|
|
1280
|
+
Field(
|
|
1281
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
1282
|
+
),
|
|
1283
|
+
],
|
|
1284
|
+
v1_webhook: Annotated[StrictStr, Field(description="The webhook name")],
|
|
1285
|
+
_request_timeout: Union[
|
|
1286
|
+
None,
|
|
1287
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1288
|
+
Tuple[
|
|
1289
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
1290
|
+
],
|
|
1291
|
+
] = None,
|
|
1292
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1293
|
+
_content_type: Optional[StrictStr] = None,
|
|
1294
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1295
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1296
|
+
) -> V1WebhookReceive200Response:
|
|
1297
|
+
"""Post a webhook message
|
|
1298
|
+
|
|
1299
|
+
Post an incoming webhook message
|
|
1300
|
+
|
|
1301
|
+
:param tenant: The tenant id (required)
|
|
1302
|
+
:type tenant: str
|
|
1303
|
+
:param v1_webhook: The webhook name (required)
|
|
1304
|
+
:type v1_webhook: str
|
|
1305
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1306
|
+
number provided, it will be total request
|
|
1307
|
+
timeout. It can also be a pair (tuple) of
|
|
1308
|
+
(connection, read) timeouts.
|
|
1309
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1310
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1311
|
+
request; this effectively ignores the
|
|
1312
|
+
authentication in the spec for a single request.
|
|
1313
|
+
:type _request_auth: dict, optional
|
|
1314
|
+
:param _content_type: force content-type for the request.
|
|
1315
|
+
:type _content_type: str, Optional
|
|
1316
|
+
:param _headers: set to override the headers for a single
|
|
1317
|
+
request; this effectively ignores the headers
|
|
1318
|
+
in the spec for a single request.
|
|
1319
|
+
:type _headers: dict, optional
|
|
1320
|
+
:param _host_index: set to override the host_index for a single
|
|
1321
|
+
request; this effectively ignores the host_index
|
|
1322
|
+
in the spec for a single request.
|
|
1323
|
+
:type _host_index: int, optional
|
|
1324
|
+
:return: Returns the result object.
|
|
1325
|
+
""" # noqa: E501
|
|
1326
|
+
|
|
1327
|
+
_param = self._v1_webhook_receive_serialize(
|
|
1328
|
+
tenant=tenant,
|
|
1329
|
+
v1_webhook=v1_webhook,
|
|
1330
|
+
_request_auth=_request_auth,
|
|
1331
|
+
_content_type=_content_type,
|
|
1332
|
+
_headers=_headers,
|
|
1333
|
+
_host_index=_host_index,
|
|
1334
|
+
)
|
|
1335
|
+
|
|
1336
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1337
|
+
"200": "V1WebhookReceive200Response",
|
|
1338
|
+
"400": "APIErrors",
|
|
1339
|
+
"403": "APIErrors",
|
|
1340
|
+
}
|
|
1341
|
+
response_data = self.api_client.call_api(
|
|
1342
|
+
*_param, _request_timeout=_request_timeout
|
|
1343
|
+
)
|
|
1344
|
+
response_data.read()
|
|
1345
|
+
return self.api_client.response_deserialize(
|
|
1346
|
+
response_data=response_data,
|
|
1347
|
+
response_types_map=_response_types_map,
|
|
1348
|
+
).data
|
|
1349
|
+
|
|
1350
|
+
@validate_call
|
|
1351
|
+
def v1_webhook_receive_with_http_info(
|
|
1352
|
+
self,
|
|
1353
|
+
tenant: Annotated[
|
|
1354
|
+
str,
|
|
1355
|
+
Field(
|
|
1356
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
1357
|
+
),
|
|
1358
|
+
],
|
|
1359
|
+
v1_webhook: Annotated[StrictStr, Field(description="The webhook name")],
|
|
1360
|
+
_request_timeout: Union[
|
|
1361
|
+
None,
|
|
1362
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1363
|
+
Tuple[
|
|
1364
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
1365
|
+
],
|
|
1366
|
+
] = None,
|
|
1367
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1368
|
+
_content_type: Optional[StrictStr] = None,
|
|
1369
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1370
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1371
|
+
) -> ApiResponse[V1WebhookReceive200Response]:
|
|
1372
|
+
"""Post a webhook message
|
|
1373
|
+
|
|
1374
|
+
Post an incoming webhook message
|
|
1375
|
+
|
|
1376
|
+
:param tenant: The tenant id (required)
|
|
1377
|
+
:type tenant: str
|
|
1378
|
+
:param v1_webhook: The webhook name (required)
|
|
1379
|
+
:type v1_webhook: str
|
|
1380
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1381
|
+
number provided, it will be total request
|
|
1382
|
+
timeout. It can also be a pair (tuple) of
|
|
1383
|
+
(connection, read) timeouts.
|
|
1384
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1385
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1386
|
+
request; this effectively ignores the
|
|
1387
|
+
authentication in the spec for a single request.
|
|
1388
|
+
:type _request_auth: dict, optional
|
|
1389
|
+
:param _content_type: force content-type for the request.
|
|
1390
|
+
:type _content_type: str, Optional
|
|
1391
|
+
:param _headers: set to override the headers for a single
|
|
1392
|
+
request; this effectively ignores the headers
|
|
1393
|
+
in the spec for a single request.
|
|
1394
|
+
:type _headers: dict, optional
|
|
1395
|
+
:param _host_index: set to override the host_index for a single
|
|
1396
|
+
request; this effectively ignores the host_index
|
|
1397
|
+
in the spec for a single request.
|
|
1398
|
+
:type _host_index: int, optional
|
|
1399
|
+
:return: Returns the result object.
|
|
1400
|
+
""" # noqa: E501
|
|
1401
|
+
|
|
1402
|
+
_param = self._v1_webhook_receive_serialize(
|
|
1403
|
+
tenant=tenant,
|
|
1404
|
+
v1_webhook=v1_webhook,
|
|
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": "V1WebhookReceive200Response",
|
|
1413
|
+
"400": "APIErrors",
|
|
1414
|
+
"403": "APIErrors",
|
|
1415
|
+
}
|
|
1416
|
+
response_data = self.api_client.call_api(
|
|
1417
|
+
*_param, _request_timeout=_request_timeout
|
|
1418
|
+
)
|
|
1419
|
+
response_data.read()
|
|
1420
|
+
return self.api_client.response_deserialize(
|
|
1421
|
+
response_data=response_data,
|
|
1422
|
+
response_types_map=_response_types_map,
|
|
1423
|
+
)
|
|
1424
|
+
|
|
1425
|
+
@validate_call
|
|
1426
|
+
def v1_webhook_receive_without_preload_content(
|
|
1427
|
+
self,
|
|
1428
|
+
tenant: Annotated[
|
|
1429
|
+
str,
|
|
1430
|
+
Field(
|
|
1431
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
1432
|
+
),
|
|
1433
|
+
],
|
|
1434
|
+
v1_webhook: Annotated[StrictStr, Field(description="The webhook name")],
|
|
1435
|
+
_request_timeout: Union[
|
|
1436
|
+
None,
|
|
1437
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1438
|
+
Tuple[
|
|
1439
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
1440
|
+
],
|
|
1441
|
+
] = None,
|
|
1442
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1443
|
+
_content_type: Optional[StrictStr] = None,
|
|
1444
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1445
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1446
|
+
) -> RESTResponseType:
|
|
1447
|
+
"""Post a webhook message
|
|
1448
|
+
|
|
1449
|
+
Post an incoming webhook message
|
|
1450
|
+
|
|
1451
|
+
:param tenant: The tenant id (required)
|
|
1452
|
+
:type tenant: str
|
|
1453
|
+
:param v1_webhook: The webhook name (required)
|
|
1454
|
+
:type v1_webhook: str
|
|
1455
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1456
|
+
number provided, it will be total request
|
|
1457
|
+
timeout. It can also be a pair (tuple) of
|
|
1458
|
+
(connection, read) timeouts.
|
|
1459
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1460
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1461
|
+
request; this effectively ignores the
|
|
1462
|
+
authentication in the spec for a single request.
|
|
1463
|
+
:type _request_auth: dict, optional
|
|
1464
|
+
:param _content_type: force content-type for the request.
|
|
1465
|
+
:type _content_type: str, Optional
|
|
1466
|
+
:param _headers: set to override the headers for a single
|
|
1467
|
+
request; this effectively ignores the headers
|
|
1468
|
+
in the spec for a single request.
|
|
1469
|
+
:type _headers: dict, optional
|
|
1470
|
+
:param _host_index: set to override the host_index for a single
|
|
1471
|
+
request; this effectively ignores the host_index
|
|
1472
|
+
in the spec for a single request.
|
|
1473
|
+
:type _host_index: int, optional
|
|
1474
|
+
:return: Returns the result object.
|
|
1475
|
+
""" # noqa: E501
|
|
1476
|
+
|
|
1477
|
+
_param = self._v1_webhook_receive_serialize(
|
|
1478
|
+
tenant=tenant,
|
|
1479
|
+
v1_webhook=v1_webhook,
|
|
1480
|
+
_request_auth=_request_auth,
|
|
1481
|
+
_content_type=_content_type,
|
|
1482
|
+
_headers=_headers,
|
|
1483
|
+
_host_index=_host_index,
|
|
1484
|
+
)
|
|
1485
|
+
|
|
1486
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1487
|
+
"200": "V1WebhookReceive200Response",
|
|
1488
|
+
"400": "APIErrors",
|
|
1489
|
+
"403": "APIErrors",
|
|
1490
|
+
}
|
|
1491
|
+
response_data = self.api_client.call_api(
|
|
1492
|
+
*_param, _request_timeout=_request_timeout
|
|
1493
|
+
)
|
|
1494
|
+
return response_data.response
|
|
1495
|
+
|
|
1496
|
+
def _v1_webhook_receive_serialize(
|
|
1497
|
+
self,
|
|
1498
|
+
tenant,
|
|
1499
|
+
v1_webhook,
|
|
1500
|
+
_request_auth,
|
|
1501
|
+
_content_type,
|
|
1502
|
+
_headers,
|
|
1503
|
+
_host_index,
|
|
1504
|
+
) -> RequestSerialized:
|
|
1505
|
+
|
|
1506
|
+
_host = None
|
|
1507
|
+
|
|
1508
|
+
_collection_formats: Dict[str, str] = {}
|
|
1509
|
+
|
|
1510
|
+
_path_params: Dict[str, str] = {}
|
|
1511
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1512
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1513
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1514
|
+
_files: Dict[
|
|
1515
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1516
|
+
] = {}
|
|
1517
|
+
_body_params: Optional[bytes] = None
|
|
1518
|
+
|
|
1519
|
+
# process the path parameters
|
|
1520
|
+
if tenant is not None:
|
|
1521
|
+
_path_params["tenant"] = tenant
|
|
1522
|
+
if v1_webhook is not None:
|
|
1523
|
+
_path_params["v1-webhook"] = v1_webhook
|
|
1524
|
+
# process the query parameters
|
|
1525
|
+
# process the header parameters
|
|
1526
|
+
# process the form parameters
|
|
1527
|
+
# process the body parameter
|
|
1528
|
+
|
|
1529
|
+
# set the HTTP header `Accept`
|
|
1530
|
+
if "Accept" not in _header_params:
|
|
1531
|
+
_header_params["Accept"] = self.api_client.select_header_accept(
|
|
1532
|
+
["application/json"]
|
|
1533
|
+
)
|
|
1534
|
+
|
|
1535
|
+
# authentication setting
|
|
1536
|
+
_auth_settings: List[str] = []
|
|
1537
|
+
|
|
1538
|
+
return self.api_client.param_serialize(
|
|
1539
|
+
method="POST",
|
|
1540
|
+
resource_path="/api/v1/stable/tenants/{tenant}/webhooks/{v1-webhook}",
|
|
1541
|
+
path_params=_path_params,
|
|
1542
|
+
query_params=_query_params,
|
|
1543
|
+
header_params=_header_params,
|
|
1544
|
+
body=_body_params,
|
|
1545
|
+
post_params=_form_params,
|
|
1546
|
+
files=_files,
|
|
1547
|
+
auth_settings=_auth_settings,
|
|
1548
|
+
collection_formats=_collection_formats,
|
|
1549
|
+
_host=_host,
|
|
1550
|
+
_request_auth=_request_auth,
|
|
1551
|
+
)
|