stackgen-sdk 0.1.1__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 (73) hide show
  1. stackgen/__init__.py +52 -0
  2. stackgen/_http.py +96 -0
  3. stackgen/_version.py +24 -0
  4. stackgen/aiden/__init__.py +9 -0
  5. stackgen/aiden/namespace.py +26 -0
  6. stackgen/aiden/runs.py +36 -0
  7. stackgen/aiden/webhook.py +185 -0
  8. stackgen/cli.py +33 -0
  9. stackgen/client.py +31 -0
  10. stackgen/config.py +88 -0
  11. stackgen/errors.py +41 -0
  12. stackgen/generated/.openapi-generator/FILES +141 -0
  13. stackgen/generated/.openapi-generator/VERSION +1 -0
  14. stackgen/generated/.openapi-generator-ignore +23 -0
  15. stackgen/generated/__init__.py +131 -0
  16. stackgen/generated/api/__init__.py +6 -0
  17. stackgen/generated/api/aiden_api.py +1806 -0
  18. stackgen/generated/api/sre_api.py +1618 -0
  19. stackgen/generated/api_client.py +801 -0
  20. stackgen/generated/api_response.py +21 -0
  21. stackgen/generated/configuration.py +600 -0
  22. stackgen/generated/exceptions.py +216 -0
  23. stackgen/generated/models/__init__.py +57 -0
  24. stackgen/generated/models/alert_analysis_status.py +40 -0
  25. stackgen/generated/models/alert_attention.py +39 -0
  26. stackgen/generated/models/alert_categorization_summary.py +97 -0
  27. stackgen/generated/models/alert_role.py +38 -0
  28. stackgen/generated/models/alert_sort_by.py +37 -0
  29. stackgen/generated/models/alert_status.py +38 -0
  30. stackgen/generated/models/alert_summary.py +95 -0
  31. stackgen/generated/models/alert_sync_run_status.py +38 -0
  32. stackgen/generated/models/alert_v1.py +213 -0
  33. stackgen/generated/models/artifact_info.py +98 -0
  34. stackgen/generated/models/error_response.py +91 -0
  35. stackgen/generated/models/investigate_alert_request.py +91 -0
  36. stackgen/generated/models/investigate_response.py +91 -0
  37. stackgen/generated/models/investigation.py +167 -0
  38. stackgen/generated/models/investigation_evidence.py +114 -0
  39. stackgen/generated/models/investigation_evidence_kind.py +44 -0
  40. stackgen/generated/models/investigation_evidence_source.py +39 -0
  41. stackgen/generated/models/investigation_hypothesis.py +112 -0
  42. stackgen/generated/models/investigation_plain_summary.py +104 -0
  43. stackgen/generated/models/investigation_prior_incident.py +109 -0
  44. stackgen/generated/models/investigation_recommended_next_step.py +101 -0
  45. stackgen/generated/models/investigation_ref.py +118 -0
  46. stackgen/generated/models/investigation_status.py +42 -0
  47. stackgen/generated/models/investigation_structured_hypothesis_entry.py +115 -0
  48. stackgen/generated/models/investigation_structured_limitation_entry.py +120 -0
  49. stackgen/generated/models/investigation_structured_rca.py +139 -0
  50. stackgen/generated/models/investigation_triage_metadata.py +134 -0
  51. stackgen/generated/models/json_error.py +91 -0
  52. stackgen/generated/models/list_alerts_response.py +119 -0
  53. stackgen/generated/models/list_investigations_response.py +101 -0
  54. stackgen/generated/models/pagination.py +91 -0
  55. stackgen/generated/models/schedule_run_status.py +39 -0
  56. stackgen/generated/models/schedule_target_type.py +38 -0
  57. stackgen/generated/models/session.py +141 -0
  58. stackgen/generated/models/session_responder_kind.py +40 -0
  59. stackgen/generated/models/signal_severity.py +40 -0
  60. stackgen/generated/models/sync_response.py +136 -0
  61. stackgen/generated/models/trigger_webhook202_response.py +98 -0
  62. stackgen/generated/models/webhook_run.py +129 -0
  63. stackgen/generated/models/webhook_run_detail.py +136 -0
  64. stackgen/generated/models/webhook_run_list_response.py +97 -0
  65. stackgen/generated/rest.py +258 -0
  66. stackgen/sre/__init__.py +5 -0
  67. stackgen/sre/namespace.py +57 -0
  68. stackgen/vault/__init__.py +5 -0
  69. stackgen/vault/namespace.py +17 -0
  70. stackgen_sdk-0.1.1.dist-info/METADATA +60 -0
  71. stackgen_sdk-0.1.1.dist-info/RECORD +73 -0
  72. stackgen_sdk-0.1.1.dist-info/WHEEL +4 -0
  73. stackgen_sdk-0.1.1.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,1806 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ StackGen External API
5
+
6
+ Allowlisted StackGen API surface for the public SDK. Managed via api-docs/product/allowlists/external.yaml.
7
+
8
+ The version of the OpenAPI document: 0.1.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 pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictBytes, StrictStr
20
+ from typing import List, Optional, Tuple, Union
21
+ from typing_extensions import Annotated
22
+ from stackgen.generated.models.artifact_info import ArtifactInfo
23
+ from stackgen.generated.models.session import Session
24
+ from stackgen.generated.models.trigger_webhook202_response import TriggerWebhook202Response
25
+ from stackgen.generated.models.webhook_run_detail import WebhookRunDetail
26
+ from stackgen.generated.models.webhook_run_list_response import WebhookRunListResponse
27
+
28
+ from stackgen.generated.api_client import ApiClient, RequestSerialized
29
+ from stackgen.generated.api_response import ApiResponse
30
+ from stackgen.generated.rest import RESTResponseType
31
+
32
+
33
+ class AidenApi:
34
+ """NOTE: This class is auto generated by OpenAPI Generator
35
+ Ref: https://openapi-generator.tech
36
+
37
+ Do not edit the class manually.
38
+ """
39
+
40
+ def __init__(self, api_client=None) -> None:
41
+ if api_client is None:
42
+ api_client = ApiClient.get_default()
43
+ self.api_client = api_client
44
+
45
+
46
+ @validate_call
47
+ def download_session_artifact(
48
+ self,
49
+ session_id: Annotated[StrictStr, Field(description="Session ID")],
50
+ artifact_id: Annotated[StrictStr, Field(description="Artifact UUID or filename (case-insensitive)")],
51
+ org_id: Annotated[Optional[StrictStr], Field(description="The organization ID to scope the request to. If not provided, the personal namespace is assumed.")] = None,
52
+ _request_timeout: Union[
53
+ None,
54
+ Annotated[StrictFloat, Field(gt=0)],
55
+ Tuple[
56
+ Annotated[StrictFloat, Field(gt=0)],
57
+ Annotated[StrictFloat, Field(gt=0)]
58
+ ]
59
+ ] = None,
60
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
61
+ _content_type: Optional[StrictStr] = None,
62
+ _headers: Optional[Dict[StrictStr, Any]] = None,
63
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
64
+ ) -> bytearray:
65
+ """Download an artifact by ID or filename
66
+
67
+
68
+ :param session_id: Session ID (required)
69
+ :type session_id: str
70
+ :param artifact_id: Artifact UUID or filename (case-insensitive) (required)
71
+ :type artifact_id: str
72
+ :param org_id: The organization ID to scope the request to. If not provided, the personal namespace is assumed.
73
+ :type org_id: str
74
+ :param _request_timeout: timeout setting for this request. If one
75
+ number provided, it will be total request
76
+ timeout. It can also be a pair (tuple) of
77
+ (connection, read) timeouts.
78
+ :type _request_timeout: int, tuple(int, int), optional
79
+ :param _request_auth: set to override the auth_settings for an a single
80
+ request; this effectively ignores the
81
+ authentication in the spec for a single request.
82
+ :type _request_auth: dict, optional
83
+ :param _content_type: force content-type for the request.
84
+ :type _content_type: str, Optional
85
+ :param _headers: set to override the headers for a single
86
+ request; this effectively ignores the headers
87
+ in the spec for a single request.
88
+ :type _headers: dict, optional
89
+ :param _host_index: set to override the host_index for a single
90
+ request; this effectively ignores the host_index
91
+ in the spec for a single request.
92
+ :type _host_index: int, optional
93
+ :return: Returns the result object.
94
+ """ # noqa: E501
95
+
96
+ _param = self._download_session_artifact_serialize(
97
+ session_id=session_id,
98
+ artifact_id=artifact_id,
99
+ org_id=org_id,
100
+ _request_auth=_request_auth,
101
+ _content_type=_content_type,
102
+ _headers=_headers,
103
+ _host_index=_host_index
104
+ )
105
+
106
+ _response_types_map: Dict[str, Optional[str]] = {
107
+ '200': "bytearray",
108
+ '404': None,
109
+ }
110
+ response_data = self.api_client.call_api(
111
+ *_param,
112
+ _request_timeout=_request_timeout
113
+ )
114
+ response_data.read()
115
+ return self.api_client.response_deserialize(
116
+ response_data=response_data,
117
+ response_types_map=_response_types_map,
118
+ ).data
119
+
120
+
121
+ @validate_call
122
+ def download_session_artifact_with_http_info(
123
+ self,
124
+ session_id: Annotated[StrictStr, Field(description="Session ID")],
125
+ artifact_id: Annotated[StrictStr, Field(description="Artifact UUID or filename (case-insensitive)")],
126
+ org_id: Annotated[Optional[StrictStr], Field(description="The organization ID to scope the request to. If not provided, the personal namespace is assumed.")] = None,
127
+ _request_timeout: Union[
128
+ None,
129
+ Annotated[StrictFloat, Field(gt=0)],
130
+ Tuple[
131
+ Annotated[StrictFloat, Field(gt=0)],
132
+ Annotated[StrictFloat, Field(gt=0)]
133
+ ]
134
+ ] = None,
135
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
136
+ _content_type: Optional[StrictStr] = None,
137
+ _headers: Optional[Dict[StrictStr, Any]] = None,
138
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
139
+ ) -> ApiResponse[bytearray]:
140
+ """Download an artifact by ID or filename
141
+
142
+
143
+ :param session_id: Session ID (required)
144
+ :type session_id: str
145
+ :param artifact_id: Artifact UUID or filename (case-insensitive) (required)
146
+ :type artifact_id: str
147
+ :param org_id: The organization ID to scope the request to. If not provided, the personal namespace is assumed.
148
+ :type org_id: str
149
+ :param _request_timeout: timeout setting for this request. If one
150
+ number provided, it will be total request
151
+ timeout. It can also be a pair (tuple) of
152
+ (connection, read) timeouts.
153
+ :type _request_timeout: int, tuple(int, int), optional
154
+ :param _request_auth: set to override the auth_settings for an a single
155
+ request; this effectively ignores the
156
+ authentication in the spec for a single request.
157
+ :type _request_auth: dict, optional
158
+ :param _content_type: force content-type for the request.
159
+ :type _content_type: str, Optional
160
+ :param _headers: set to override the headers for a single
161
+ request; this effectively ignores the headers
162
+ in the spec for a single request.
163
+ :type _headers: dict, optional
164
+ :param _host_index: set to override the host_index for a single
165
+ request; this effectively ignores the host_index
166
+ in the spec for a single request.
167
+ :type _host_index: int, optional
168
+ :return: Returns the result object.
169
+ """ # noqa: E501
170
+
171
+ _param = self._download_session_artifact_serialize(
172
+ session_id=session_id,
173
+ artifact_id=artifact_id,
174
+ org_id=org_id,
175
+ _request_auth=_request_auth,
176
+ _content_type=_content_type,
177
+ _headers=_headers,
178
+ _host_index=_host_index
179
+ )
180
+
181
+ _response_types_map: Dict[str, Optional[str]] = {
182
+ '200': "bytearray",
183
+ '404': None,
184
+ }
185
+ response_data = self.api_client.call_api(
186
+ *_param,
187
+ _request_timeout=_request_timeout
188
+ )
189
+ response_data.read()
190
+ return self.api_client.response_deserialize(
191
+ response_data=response_data,
192
+ response_types_map=_response_types_map,
193
+ )
194
+
195
+
196
+ @validate_call
197
+ def download_session_artifact_without_preload_content(
198
+ self,
199
+ session_id: Annotated[StrictStr, Field(description="Session ID")],
200
+ artifact_id: Annotated[StrictStr, Field(description="Artifact UUID or filename (case-insensitive)")],
201
+ org_id: Annotated[Optional[StrictStr], Field(description="The organization ID to scope the request to. If not provided, the personal namespace is assumed.")] = None,
202
+ _request_timeout: Union[
203
+ None,
204
+ Annotated[StrictFloat, Field(gt=0)],
205
+ Tuple[
206
+ Annotated[StrictFloat, Field(gt=0)],
207
+ Annotated[StrictFloat, Field(gt=0)]
208
+ ]
209
+ ] = None,
210
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
211
+ _content_type: Optional[StrictStr] = None,
212
+ _headers: Optional[Dict[StrictStr, Any]] = None,
213
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
214
+ ) -> RESTResponseType:
215
+ """Download an artifact by ID or filename
216
+
217
+
218
+ :param session_id: Session ID (required)
219
+ :type session_id: str
220
+ :param artifact_id: Artifact UUID or filename (case-insensitive) (required)
221
+ :type artifact_id: str
222
+ :param org_id: The organization ID to scope the request to. If not provided, the personal namespace is assumed.
223
+ :type org_id: str
224
+ :param _request_timeout: timeout setting for this request. If one
225
+ number provided, it will be total request
226
+ timeout. It can also be a pair (tuple) of
227
+ (connection, read) timeouts.
228
+ :type _request_timeout: int, tuple(int, int), optional
229
+ :param _request_auth: set to override the auth_settings for an a single
230
+ request; this effectively ignores the
231
+ authentication in the spec for a single request.
232
+ :type _request_auth: dict, optional
233
+ :param _content_type: force content-type for the request.
234
+ :type _content_type: str, Optional
235
+ :param _headers: set to override the headers for a single
236
+ request; this effectively ignores the headers
237
+ in the spec for a single request.
238
+ :type _headers: dict, optional
239
+ :param _host_index: set to override the host_index for a single
240
+ request; this effectively ignores the host_index
241
+ in the spec for a single request.
242
+ :type _host_index: int, optional
243
+ :return: Returns the result object.
244
+ """ # noqa: E501
245
+
246
+ _param = self._download_session_artifact_serialize(
247
+ session_id=session_id,
248
+ artifact_id=artifact_id,
249
+ org_id=org_id,
250
+ _request_auth=_request_auth,
251
+ _content_type=_content_type,
252
+ _headers=_headers,
253
+ _host_index=_host_index
254
+ )
255
+
256
+ _response_types_map: Dict[str, Optional[str]] = {
257
+ '200': "bytearray",
258
+ '404': None,
259
+ }
260
+ response_data = self.api_client.call_api(
261
+ *_param,
262
+ _request_timeout=_request_timeout
263
+ )
264
+ return response_data.response
265
+
266
+
267
+ def _download_session_artifact_serialize(
268
+ self,
269
+ session_id,
270
+ artifact_id,
271
+ org_id,
272
+ _request_auth,
273
+ _content_type,
274
+ _headers,
275
+ _host_index,
276
+ ) -> RequestSerialized:
277
+
278
+ _host = None
279
+
280
+ _collection_formats: Dict[str, str] = {
281
+ }
282
+
283
+ _path_params: Dict[str, str] = {}
284
+ _query_params: List[Tuple[str, str]] = []
285
+ _header_params: Dict[str, Optional[str]] = _headers or {}
286
+ _form_params: List[Tuple[str, str]] = []
287
+ _files: Dict[
288
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
289
+ ] = {}
290
+ _body_params: Optional[bytes] = None
291
+
292
+ # process the path parameters
293
+ if session_id is not None:
294
+ _path_params['session_id'] = session_id
295
+ if artifact_id is not None:
296
+ _path_params['artifact_id'] = artifact_id
297
+ # process the query parameters
298
+ if org_id is not None:
299
+
300
+ _query_params.append(('orgId', org_id))
301
+
302
+ # process the header parameters
303
+ # process the form parameters
304
+ # process the body parameter
305
+
306
+
307
+ # set the HTTP header `Accept`
308
+ if 'Accept' not in _header_params:
309
+ _header_params['Accept'] = self.api_client.select_header_accept(
310
+ [
311
+ 'application/octet-stream'
312
+ ]
313
+ )
314
+
315
+
316
+ # authentication setting
317
+ _auth_settings: List[str] = [
318
+ 'ApiToken'
319
+ ]
320
+
321
+ return self.api_client.param_serialize(
322
+ method='GET',
323
+ resource_path='/guild/api/v1/sessions/{session_id}/artifacts/{artifact_id}/download',
324
+ path_params=_path_params,
325
+ query_params=_query_params,
326
+ header_params=_header_params,
327
+ body=_body_params,
328
+ post_params=_form_params,
329
+ files=_files,
330
+ auth_settings=_auth_settings,
331
+ collection_formats=_collection_formats,
332
+ _host=_host,
333
+ _request_auth=_request_auth
334
+ )
335
+
336
+
337
+
338
+
339
+ @validate_call
340
+ def get_session_by_id(
341
+ self,
342
+ session_id: Annotated[StrictStr, Field(description="Session ID (e.g. session-{tenant}-{agent}-{channel}).")],
343
+ _request_timeout: Union[
344
+ None,
345
+ Annotated[StrictFloat, Field(gt=0)],
346
+ Tuple[
347
+ Annotated[StrictFloat, Field(gt=0)],
348
+ Annotated[StrictFloat, Field(gt=0)]
349
+ ]
350
+ ] = None,
351
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
352
+ _content_type: Optional[StrictStr] = None,
353
+ _headers: Optional[Dict[StrictStr, Any]] = None,
354
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
355
+ ) -> Session:
356
+ """Get session by ID
357
+
358
+ Retrieves profound details about a specific session, including dynamic computations, cost aggregations, and AI-generated summaries.
359
+
360
+ :param session_id: Session ID (e.g. session-{tenant}-{agent}-{channel}). (required)
361
+ :type session_id: str
362
+ :param _request_timeout: timeout setting for this request. If one
363
+ number provided, it will be total request
364
+ timeout. It can also be a pair (tuple) of
365
+ (connection, read) timeouts.
366
+ :type _request_timeout: int, tuple(int, int), optional
367
+ :param _request_auth: set to override the auth_settings for an a single
368
+ request; this effectively ignores the
369
+ authentication in the spec for a single request.
370
+ :type _request_auth: dict, optional
371
+ :param _content_type: force content-type for the request.
372
+ :type _content_type: str, Optional
373
+ :param _headers: set to override the headers for a single
374
+ request; this effectively ignores the headers
375
+ in the spec for a single request.
376
+ :type _headers: dict, optional
377
+ :param _host_index: set to override the host_index for a single
378
+ request; this effectively ignores the host_index
379
+ in the spec for a single request.
380
+ :type _host_index: int, optional
381
+ :return: Returns the result object.
382
+ """ # noqa: E501
383
+
384
+ _param = self._get_session_by_id_serialize(
385
+ session_id=session_id,
386
+ _request_auth=_request_auth,
387
+ _content_type=_content_type,
388
+ _headers=_headers,
389
+ _host_index=_host_index
390
+ )
391
+
392
+ _response_types_map: Dict[str, Optional[str]] = {
393
+ '200': "Session",
394
+ '404': None,
395
+ '500': None,
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 get_session_by_id_with_http_info(
410
+ self,
411
+ session_id: Annotated[StrictStr, Field(description="Session ID (e.g. session-{tenant}-{agent}-{channel}).")],
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[Session]:
425
+ """Get session by ID
426
+
427
+ Retrieves profound details about a specific session, including dynamic computations, cost aggregations, and AI-generated summaries.
428
+
429
+ :param session_id: Session ID (e.g. session-{tenant}-{agent}-{channel}). (required)
430
+ :type session_id: str
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._get_session_by_id_serialize(
454
+ session_id=session_id,
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': "Session",
463
+ '404': None,
464
+ '500': None,
465
+ }
466
+ response_data = self.api_client.call_api(
467
+ *_param,
468
+ _request_timeout=_request_timeout
469
+ )
470
+ response_data.read()
471
+ return self.api_client.response_deserialize(
472
+ response_data=response_data,
473
+ response_types_map=_response_types_map,
474
+ )
475
+
476
+
477
+ @validate_call
478
+ def get_session_by_id_without_preload_content(
479
+ self,
480
+ session_id: Annotated[StrictStr, Field(description="Session ID (e.g. session-{tenant}-{agent}-{channel}).")],
481
+ _request_timeout: Union[
482
+ None,
483
+ Annotated[StrictFloat, Field(gt=0)],
484
+ Tuple[
485
+ Annotated[StrictFloat, Field(gt=0)],
486
+ Annotated[StrictFloat, Field(gt=0)]
487
+ ]
488
+ ] = None,
489
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
490
+ _content_type: Optional[StrictStr] = None,
491
+ _headers: Optional[Dict[StrictStr, Any]] = None,
492
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
493
+ ) -> RESTResponseType:
494
+ """Get session by ID
495
+
496
+ Retrieves profound details about a specific session, including dynamic computations, cost aggregations, and AI-generated summaries.
497
+
498
+ :param session_id: Session ID (e.g. session-{tenant}-{agent}-{channel}). (required)
499
+ :type session_id: str
500
+ :param _request_timeout: timeout setting for this request. If one
501
+ number provided, it will be total request
502
+ timeout. It can also be a pair (tuple) of
503
+ (connection, read) timeouts.
504
+ :type _request_timeout: int, tuple(int, int), optional
505
+ :param _request_auth: set to override the auth_settings for an a single
506
+ request; this effectively ignores the
507
+ authentication in the spec for a single request.
508
+ :type _request_auth: dict, optional
509
+ :param _content_type: force content-type for the request.
510
+ :type _content_type: str, Optional
511
+ :param _headers: set to override the headers for a single
512
+ request; this effectively ignores the headers
513
+ in the spec for a single request.
514
+ :type _headers: dict, optional
515
+ :param _host_index: set to override the host_index for a single
516
+ request; this effectively ignores the host_index
517
+ in the spec for a single request.
518
+ :type _host_index: int, optional
519
+ :return: Returns the result object.
520
+ """ # noqa: E501
521
+
522
+ _param = self._get_session_by_id_serialize(
523
+ session_id=session_id,
524
+ _request_auth=_request_auth,
525
+ _content_type=_content_type,
526
+ _headers=_headers,
527
+ _host_index=_host_index
528
+ )
529
+
530
+ _response_types_map: Dict[str, Optional[str]] = {
531
+ '200': "Session",
532
+ '404': None,
533
+ '500': None,
534
+ }
535
+ response_data = self.api_client.call_api(
536
+ *_param,
537
+ _request_timeout=_request_timeout
538
+ )
539
+ return response_data.response
540
+
541
+
542
+ def _get_session_by_id_serialize(
543
+ self,
544
+ session_id,
545
+ _request_auth,
546
+ _content_type,
547
+ _headers,
548
+ _host_index,
549
+ ) -> RequestSerialized:
550
+
551
+ _host = None
552
+
553
+ _collection_formats: Dict[str, str] = {
554
+ }
555
+
556
+ _path_params: Dict[str, str] = {}
557
+ _query_params: List[Tuple[str, str]] = []
558
+ _header_params: Dict[str, Optional[str]] = _headers or {}
559
+ _form_params: List[Tuple[str, str]] = []
560
+ _files: Dict[
561
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
562
+ ] = {}
563
+ _body_params: Optional[bytes] = None
564
+
565
+ # process the path parameters
566
+ if session_id is not None:
567
+ _path_params['session_id'] = session_id
568
+ # process the query parameters
569
+ # process the header parameters
570
+ # process the form parameters
571
+ # process the body parameter
572
+
573
+
574
+ # set the HTTP header `Accept`
575
+ if 'Accept' not in _header_params:
576
+ _header_params['Accept'] = self.api_client.select_header_accept(
577
+ [
578
+ 'application/json'
579
+ ]
580
+ )
581
+
582
+
583
+ # authentication setting
584
+ _auth_settings: List[str] = [
585
+ 'ApiToken'
586
+ ]
587
+
588
+ return self.api_client.param_serialize(
589
+ method='GET',
590
+ resource_path='/guild/api/v1/sessions/{session_id}',
591
+ path_params=_path_params,
592
+ query_params=_query_params,
593
+ header_params=_header_params,
594
+ body=_body_params,
595
+ post_params=_form_params,
596
+ files=_files,
597
+ auth_settings=_auth_settings,
598
+ collection_formats=_collection_formats,
599
+ _host=_host,
600
+ _request_auth=_request_auth
601
+ )
602
+
603
+
604
+
605
+
606
+ @validate_call
607
+ def get_webhook_run(
608
+ self,
609
+ webhook_id: StrictStr,
610
+ run_id: StrictStr,
611
+ org_id: Annotated[Optional[StrictStr], Field(description="The organization ID to scope the request to. If not provided, the personal namespace is assumed.")] = None,
612
+ _request_timeout: Union[
613
+ None,
614
+ Annotated[StrictFloat, Field(gt=0)],
615
+ Tuple[
616
+ Annotated[StrictFloat, Field(gt=0)],
617
+ Annotated[StrictFloat, Field(gt=0)]
618
+ ]
619
+ ] = None,
620
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
621
+ _content_type: Optional[StrictStr] = None,
622
+ _headers: Optional[Dict[StrictStr, Any]] = None,
623
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
624
+ ) -> WebhookRunDetail:
625
+ """Get a single webhook invocation
626
+
627
+ Returns one webhook invocation with the stored request payload. The run_id path segment accepts either the invocation ID or the downstream execution run ID when one has been recorded.
628
+
629
+ :param webhook_id: (required)
630
+ :type webhook_id: str
631
+ :param run_id: (required)
632
+ :type run_id: str
633
+ :param org_id: The organization ID to scope the request to. If not provided, the personal namespace is assumed.
634
+ :type org_id: str
635
+ :param _request_timeout: timeout setting for this request. If one
636
+ number provided, it will be total request
637
+ timeout. It can also be a pair (tuple) of
638
+ (connection, read) timeouts.
639
+ :type _request_timeout: int, tuple(int, int), optional
640
+ :param _request_auth: set to override the auth_settings for an a single
641
+ request; this effectively ignores the
642
+ authentication in the spec for a single request.
643
+ :type _request_auth: dict, optional
644
+ :param _content_type: force content-type for the request.
645
+ :type _content_type: str, Optional
646
+ :param _headers: set to override the headers for a single
647
+ request; this effectively ignores the headers
648
+ in the spec for a single request.
649
+ :type _headers: dict, optional
650
+ :param _host_index: set to override the host_index for a single
651
+ request; this effectively ignores the host_index
652
+ in the spec for a single request.
653
+ :type _host_index: int, optional
654
+ :return: Returns the result object.
655
+ """ # noqa: E501
656
+
657
+ _param = self._get_webhook_run_serialize(
658
+ webhook_id=webhook_id,
659
+ run_id=run_id,
660
+ org_id=org_id,
661
+ _request_auth=_request_auth,
662
+ _content_type=_content_type,
663
+ _headers=_headers,
664
+ _host_index=_host_index
665
+ )
666
+
667
+ _response_types_map: Dict[str, Optional[str]] = {
668
+ '200': "WebhookRunDetail",
669
+ '404': None,
670
+ }
671
+ response_data = self.api_client.call_api(
672
+ *_param,
673
+ _request_timeout=_request_timeout
674
+ )
675
+ response_data.read()
676
+ return self.api_client.response_deserialize(
677
+ response_data=response_data,
678
+ response_types_map=_response_types_map,
679
+ ).data
680
+
681
+
682
+ @validate_call
683
+ def get_webhook_run_with_http_info(
684
+ self,
685
+ webhook_id: StrictStr,
686
+ run_id: StrictStr,
687
+ org_id: Annotated[Optional[StrictStr], Field(description="The organization ID to scope the request to. If not provided, the personal namespace is assumed.")] = None,
688
+ _request_timeout: Union[
689
+ None,
690
+ Annotated[StrictFloat, Field(gt=0)],
691
+ Tuple[
692
+ Annotated[StrictFloat, Field(gt=0)],
693
+ Annotated[StrictFloat, Field(gt=0)]
694
+ ]
695
+ ] = None,
696
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
697
+ _content_type: Optional[StrictStr] = None,
698
+ _headers: Optional[Dict[StrictStr, Any]] = None,
699
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
700
+ ) -> ApiResponse[WebhookRunDetail]:
701
+ """Get a single webhook invocation
702
+
703
+ Returns one webhook invocation with the stored request payload. The run_id path segment accepts either the invocation ID or the downstream execution run ID when one has been recorded.
704
+
705
+ :param webhook_id: (required)
706
+ :type webhook_id: str
707
+ :param run_id: (required)
708
+ :type run_id: str
709
+ :param org_id: The organization ID to scope the request to. If not provided, the personal namespace is assumed.
710
+ :type org_id: str
711
+ :param _request_timeout: timeout setting for this request. If one
712
+ number provided, it will be total request
713
+ timeout. It can also be a pair (tuple) of
714
+ (connection, read) timeouts.
715
+ :type _request_timeout: int, tuple(int, int), optional
716
+ :param _request_auth: set to override the auth_settings for an a single
717
+ request; this effectively ignores the
718
+ authentication in the spec for a single request.
719
+ :type _request_auth: dict, optional
720
+ :param _content_type: force content-type for the request.
721
+ :type _content_type: str, Optional
722
+ :param _headers: set to override the headers for a single
723
+ request; this effectively ignores the headers
724
+ in the spec for a single request.
725
+ :type _headers: dict, optional
726
+ :param _host_index: set to override the host_index for a single
727
+ request; this effectively ignores the host_index
728
+ in the spec for a single request.
729
+ :type _host_index: int, optional
730
+ :return: Returns the result object.
731
+ """ # noqa: E501
732
+
733
+ _param = self._get_webhook_run_serialize(
734
+ webhook_id=webhook_id,
735
+ run_id=run_id,
736
+ org_id=org_id,
737
+ _request_auth=_request_auth,
738
+ _content_type=_content_type,
739
+ _headers=_headers,
740
+ _host_index=_host_index
741
+ )
742
+
743
+ _response_types_map: Dict[str, Optional[str]] = {
744
+ '200': "WebhookRunDetail",
745
+ '404': None,
746
+ }
747
+ response_data = self.api_client.call_api(
748
+ *_param,
749
+ _request_timeout=_request_timeout
750
+ )
751
+ response_data.read()
752
+ return self.api_client.response_deserialize(
753
+ response_data=response_data,
754
+ response_types_map=_response_types_map,
755
+ )
756
+
757
+
758
+ @validate_call
759
+ def get_webhook_run_without_preload_content(
760
+ self,
761
+ webhook_id: StrictStr,
762
+ run_id: StrictStr,
763
+ org_id: Annotated[Optional[StrictStr], Field(description="The organization ID to scope the request to. If not provided, the personal namespace is assumed.")] = None,
764
+ _request_timeout: Union[
765
+ None,
766
+ Annotated[StrictFloat, Field(gt=0)],
767
+ Tuple[
768
+ Annotated[StrictFloat, Field(gt=0)],
769
+ Annotated[StrictFloat, Field(gt=0)]
770
+ ]
771
+ ] = None,
772
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
773
+ _content_type: Optional[StrictStr] = None,
774
+ _headers: Optional[Dict[StrictStr, Any]] = None,
775
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
776
+ ) -> RESTResponseType:
777
+ """Get a single webhook invocation
778
+
779
+ Returns one webhook invocation with the stored request payload. The run_id path segment accepts either the invocation ID or the downstream execution run ID when one has been recorded.
780
+
781
+ :param webhook_id: (required)
782
+ :type webhook_id: str
783
+ :param run_id: (required)
784
+ :type run_id: str
785
+ :param org_id: The organization ID to scope the request to. If not provided, the personal namespace is assumed.
786
+ :type org_id: str
787
+ :param _request_timeout: timeout setting for this request. If one
788
+ number provided, it will be total request
789
+ timeout. It can also be a pair (tuple) of
790
+ (connection, read) timeouts.
791
+ :type _request_timeout: int, tuple(int, int), optional
792
+ :param _request_auth: set to override the auth_settings for an a single
793
+ request; this effectively ignores the
794
+ authentication in the spec for a single request.
795
+ :type _request_auth: dict, optional
796
+ :param _content_type: force content-type for the request.
797
+ :type _content_type: str, Optional
798
+ :param _headers: set to override the headers for a single
799
+ request; this effectively ignores the headers
800
+ in the spec for a single request.
801
+ :type _headers: dict, optional
802
+ :param _host_index: set to override the host_index for a single
803
+ request; this effectively ignores the host_index
804
+ in the spec for a single request.
805
+ :type _host_index: int, optional
806
+ :return: Returns the result object.
807
+ """ # noqa: E501
808
+
809
+ _param = self._get_webhook_run_serialize(
810
+ webhook_id=webhook_id,
811
+ run_id=run_id,
812
+ org_id=org_id,
813
+ _request_auth=_request_auth,
814
+ _content_type=_content_type,
815
+ _headers=_headers,
816
+ _host_index=_host_index
817
+ )
818
+
819
+ _response_types_map: Dict[str, Optional[str]] = {
820
+ '200': "WebhookRunDetail",
821
+ '404': None,
822
+ }
823
+ response_data = self.api_client.call_api(
824
+ *_param,
825
+ _request_timeout=_request_timeout
826
+ )
827
+ return response_data.response
828
+
829
+
830
+ def _get_webhook_run_serialize(
831
+ self,
832
+ webhook_id,
833
+ run_id,
834
+ org_id,
835
+ _request_auth,
836
+ _content_type,
837
+ _headers,
838
+ _host_index,
839
+ ) -> RequestSerialized:
840
+
841
+ _host = None
842
+
843
+ _collection_formats: Dict[str, str] = {
844
+ }
845
+
846
+ _path_params: Dict[str, str] = {}
847
+ _query_params: List[Tuple[str, str]] = []
848
+ _header_params: Dict[str, Optional[str]] = _headers or {}
849
+ _form_params: List[Tuple[str, str]] = []
850
+ _files: Dict[
851
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
852
+ ] = {}
853
+ _body_params: Optional[bytes] = None
854
+
855
+ # process the path parameters
856
+ if webhook_id is not None:
857
+ _path_params['webhook_id'] = webhook_id
858
+ if run_id is not None:
859
+ _path_params['run_id'] = run_id
860
+ # process the query parameters
861
+ if org_id is not None:
862
+
863
+ _query_params.append(('orgId', org_id))
864
+
865
+ # process the header parameters
866
+ # process the form parameters
867
+ # process the body parameter
868
+
869
+
870
+ # set the HTTP header `Accept`
871
+ if 'Accept' not in _header_params:
872
+ _header_params['Accept'] = self.api_client.select_header_accept(
873
+ [
874
+ 'application/json'
875
+ ]
876
+ )
877
+
878
+
879
+ # authentication setting
880
+ _auth_settings: List[str] = [
881
+ 'ApiToken'
882
+ ]
883
+
884
+ return self.api_client.param_serialize(
885
+ method='GET',
886
+ resource_path='/guild/api/v1/webhooks/{webhook_id}/runs/{run_id}',
887
+ path_params=_path_params,
888
+ query_params=_query_params,
889
+ header_params=_header_params,
890
+ body=_body_params,
891
+ post_params=_form_params,
892
+ files=_files,
893
+ auth_settings=_auth_settings,
894
+ collection_formats=_collection_formats,
895
+ _host=_host,
896
+ _request_auth=_request_auth
897
+ )
898
+
899
+
900
+
901
+
902
+ @validate_call
903
+ def list_session_artifacts(
904
+ self,
905
+ session_id: Annotated[StrictStr, Field(description="Session ID (e.g. session-{tenant}-{agent}-{channel}).")],
906
+ org_id: Annotated[Optional[StrictStr], Field(description="The organization ID to scope the request to. If not provided, the personal namespace is assumed.")] = None,
907
+ _request_timeout: Union[
908
+ None,
909
+ Annotated[StrictFloat, Field(gt=0)],
910
+ Tuple[
911
+ Annotated[StrictFloat, Field(gt=0)],
912
+ Annotated[StrictFloat, Field(gt=0)]
913
+ ]
914
+ ] = None,
915
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
916
+ _content_type: Optional[StrictStr] = None,
917
+ _headers: Optional[Dict[StrictStr, Any]] = None,
918
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
919
+ ) -> List[ArtifactInfo]:
920
+ """List artifacts for a session
921
+
922
+
923
+ :param session_id: Session ID (e.g. session-{tenant}-{agent}-{channel}). (required)
924
+ :type session_id: str
925
+ :param org_id: The organization ID to scope the request to. If not provided, the personal namespace is assumed.
926
+ :type org_id: str
927
+ :param _request_timeout: timeout setting for this request. If one
928
+ number provided, it will be total request
929
+ timeout. It can also be a pair (tuple) of
930
+ (connection, read) timeouts.
931
+ :type _request_timeout: int, tuple(int, int), optional
932
+ :param _request_auth: set to override the auth_settings for an a single
933
+ request; this effectively ignores the
934
+ authentication in the spec for a single request.
935
+ :type _request_auth: dict, optional
936
+ :param _content_type: force content-type for the request.
937
+ :type _content_type: str, Optional
938
+ :param _headers: set to override the headers for a single
939
+ request; this effectively ignores the headers
940
+ in the spec for a single request.
941
+ :type _headers: dict, optional
942
+ :param _host_index: set to override the host_index for a single
943
+ request; this effectively ignores the host_index
944
+ in the spec for a single request.
945
+ :type _host_index: int, optional
946
+ :return: Returns the result object.
947
+ """ # noqa: E501
948
+
949
+ _param = self._list_session_artifacts_serialize(
950
+ session_id=session_id,
951
+ org_id=org_id,
952
+ _request_auth=_request_auth,
953
+ _content_type=_content_type,
954
+ _headers=_headers,
955
+ _host_index=_host_index
956
+ )
957
+
958
+ _response_types_map: Dict[str, Optional[str]] = {
959
+ '200': "List[ArtifactInfo]",
960
+ }
961
+ response_data = self.api_client.call_api(
962
+ *_param,
963
+ _request_timeout=_request_timeout
964
+ )
965
+ response_data.read()
966
+ return self.api_client.response_deserialize(
967
+ response_data=response_data,
968
+ response_types_map=_response_types_map,
969
+ ).data
970
+
971
+
972
+ @validate_call
973
+ def list_session_artifacts_with_http_info(
974
+ self,
975
+ session_id: Annotated[StrictStr, Field(description="Session ID (e.g. session-{tenant}-{agent}-{channel}).")],
976
+ org_id: Annotated[Optional[StrictStr], Field(description="The organization ID to scope the request to. If not provided, the personal namespace is assumed.")] = None,
977
+ _request_timeout: Union[
978
+ None,
979
+ Annotated[StrictFloat, Field(gt=0)],
980
+ Tuple[
981
+ Annotated[StrictFloat, Field(gt=0)],
982
+ Annotated[StrictFloat, Field(gt=0)]
983
+ ]
984
+ ] = None,
985
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
986
+ _content_type: Optional[StrictStr] = None,
987
+ _headers: Optional[Dict[StrictStr, Any]] = None,
988
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
989
+ ) -> ApiResponse[List[ArtifactInfo]]:
990
+ """List artifacts for a session
991
+
992
+
993
+ :param session_id: Session ID (e.g. session-{tenant}-{agent}-{channel}). (required)
994
+ :type session_id: str
995
+ :param org_id: The organization ID to scope the request to. If not provided, the personal namespace is assumed.
996
+ :type org_id: str
997
+ :param _request_timeout: timeout setting for this request. If one
998
+ number provided, it will be total request
999
+ timeout. It can also be a pair (tuple) of
1000
+ (connection, read) timeouts.
1001
+ :type _request_timeout: int, tuple(int, int), optional
1002
+ :param _request_auth: set to override the auth_settings for an a single
1003
+ request; this effectively ignores the
1004
+ authentication in the spec for a single request.
1005
+ :type _request_auth: dict, optional
1006
+ :param _content_type: force content-type for the request.
1007
+ :type _content_type: str, Optional
1008
+ :param _headers: set to override the headers for a single
1009
+ request; this effectively ignores the headers
1010
+ in the spec for a single request.
1011
+ :type _headers: dict, optional
1012
+ :param _host_index: set to override the host_index for a single
1013
+ request; this effectively ignores the host_index
1014
+ in the spec for a single request.
1015
+ :type _host_index: int, optional
1016
+ :return: Returns the result object.
1017
+ """ # noqa: E501
1018
+
1019
+ _param = self._list_session_artifacts_serialize(
1020
+ session_id=session_id,
1021
+ org_id=org_id,
1022
+ _request_auth=_request_auth,
1023
+ _content_type=_content_type,
1024
+ _headers=_headers,
1025
+ _host_index=_host_index
1026
+ )
1027
+
1028
+ _response_types_map: Dict[str, Optional[str]] = {
1029
+ '200': "List[ArtifactInfo]",
1030
+ }
1031
+ response_data = self.api_client.call_api(
1032
+ *_param,
1033
+ _request_timeout=_request_timeout
1034
+ )
1035
+ response_data.read()
1036
+ return self.api_client.response_deserialize(
1037
+ response_data=response_data,
1038
+ response_types_map=_response_types_map,
1039
+ )
1040
+
1041
+
1042
+ @validate_call
1043
+ def list_session_artifacts_without_preload_content(
1044
+ self,
1045
+ session_id: Annotated[StrictStr, Field(description="Session ID (e.g. session-{tenant}-{agent}-{channel}).")],
1046
+ org_id: Annotated[Optional[StrictStr], Field(description="The organization ID to scope the request to. If not provided, the personal namespace is assumed.")] = None,
1047
+ _request_timeout: Union[
1048
+ None,
1049
+ Annotated[StrictFloat, Field(gt=0)],
1050
+ Tuple[
1051
+ Annotated[StrictFloat, Field(gt=0)],
1052
+ Annotated[StrictFloat, Field(gt=0)]
1053
+ ]
1054
+ ] = None,
1055
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1056
+ _content_type: Optional[StrictStr] = None,
1057
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1058
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1059
+ ) -> RESTResponseType:
1060
+ """List artifacts for a session
1061
+
1062
+
1063
+ :param session_id: Session ID (e.g. session-{tenant}-{agent}-{channel}). (required)
1064
+ :type session_id: str
1065
+ :param org_id: The organization ID to scope the request to. If not provided, the personal namespace is assumed.
1066
+ :type org_id: str
1067
+ :param _request_timeout: timeout setting for this request. If one
1068
+ number provided, it will be total request
1069
+ timeout. It can also be a pair (tuple) of
1070
+ (connection, read) timeouts.
1071
+ :type _request_timeout: int, tuple(int, int), optional
1072
+ :param _request_auth: set to override the auth_settings for an a single
1073
+ request; this effectively ignores the
1074
+ authentication in the spec for a single request.
1075
+ :type _request_auth: dict, optional
1076
+ :param _content_type: force content-type for the request.
1077
+ :type _content_type: str, Optional
1078
+ :param _headers: set to override the headers for a single
1079
+ request; this effectively ignores the headers
1080
+ in the spec for a single request.
1081
+ :type _headers: dict, optional
1082
+ :param _host_index: set to override the host_index for a single
1083
+ request; this effectively ignores the host_index
1084
+ in the spec for a single request.
1085
+ :type _host_index: int, optional
1086
+ :return: Returns the result object.
1087
+ """ # noqa: E501
1088
+
1089
+ _param = self._list_session_artifacts_serialize(
1090
+ session_id=session_id,
1091
+ org_id=org_id,
1092
+ _request_auth=_request_auth,
1093
+ _content_type=_content_type,
1094
+ _headers=_headers,
1095
+ _host_index=_host_index
1096
+ )
1097
+
1098
+ _response_types_map: Dict[str, Optional[str]] = {
1099
+ '200': "List[ArtifactInfo]",
1100
+ }
1101
+ response_data = self.api_client.call_api(
1102
+ *_param,
1103
+ _request_timeout=_request_timeout
1104
+ )
1105
+ return response_data.response
1106
+
1107
+
1108
+ def _list_session_artifacts_serialize(
1109
+ self,
1110
+ session_id,
1111
+ org_id,
1112
+ _request_auth,
1113
+ _content_type,
1114
+ _headers,
1115
+ _host_index,
1116
+ ) -> RequestSerialized:
1117
+
1118
+ _host = None
1119
+
1120
+ _collection_formats: Dict[str, str] = {
1121
+ }
1122
+
1123
+ _path_params: Dict[str, str] = {}
1124
+ _query_params: List[Tuple[str, str]] = []
1125
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1126
+ _form_params: List[Tuple[str, str]] = []
1127
+ _files: Dict[
1128
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1129
+ ] = {}
1130
+ _body_params: Optional[bytes] = None
1131
+
1132
+ # process the path parameters
1133
+ if session_id is not None:
1134
+ _path_params['session_id'] = session_id
1135
+ # process the query parameters
1136
+ if org_id is not None:
1137
+
1138
+ _query_params.append(('orgId', org_id))
1139
+
1140
+ # process the header parameters
1141
+ # process the form parameters
1142
+ # process the body parameter
1143
+
1144
+
1145
+ # set the HTTP header `Accept`
1146
+ if 'Accept' not in _header_params:
1147
+ _header_params['Accept'] = self.api_client.select_header_accept(
1148
+ [
1149
+ 'application/json'
1150
+ ]
1151
+ )
1152
+
1153
+
1154
+ # authentication setting
1155
+ _auth_settings: List[str] = [
1156
+ 'ApiToken'
1157
+ ]
1158
+
1159
+ return self.api_client.param_serialize(
1160
+ method='GET',
1161
+ resource_path='/guild/api/v1/sessions/{session_id}/artifacts',
1162
+ path_params=_path_params,
1163
+ query_params=_query_params,
1164
+ header_params=_header_params,
1165
+ body=_body_params,
1166
+ post_params=_form_params,
1167
+ files=_files,
1168
+ auth_settings=_auth_settings,
1169
+ collection_formats=_collection_formats,
1170
+ _host=_host,
1171
+ _request_auth=_request_auth
1172
+ )
1173
+
1174
+
1175
+
1176
+
1177
+ @validate_call
1178
+ def list_webhook_runs(
1179
+ self,
1180
+ webhook_id: StrictStr,
1181
+ limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum number of items to return.")] = None,
1182
+ offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of items to skip.")] = None,
1183
+ org_id: Annotated[Optional[StrictStr], Field(description="The organization ID to scope the request to. If not provided, the personal namespace is assumed.")] = None,
1184
+ _request_timeout: Union[
1185
+ None,
1186
+ Annotated[StrictFloat, Field(gt=0)],
1187
+ Tuple[
1188
+ Annotated[StrictFloat, Field(gt=0)],
1189
+ Annotated[StrictFloat, Field(gt=0)]
1190
+ ]
1191
+ ] = None,
1192
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1193
+ _content_type: Optional[StrictStr] = None,
1194
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1195
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1196
+ ) -> WebhookRunListResponse:
1197
+ """List invocation history for a webhook
1198
+
1199
+ Returns a paginated history of incoming named webhook invocations, ordered newest-first. Payload bodies are not included in this list response; use the run detail endpoint for the stored payload.
1200
+
1201
+ :param webhook_id: (required)
1202
+ :type webhook_id: str
1203
+ :param limit: Maximum number of items to return.
1204
+ :type limit: int
1205
+ :param offset: Number of items to skip.
1206
+ :type offset: int
1207
+ :param org_id: The organization ID to scope the request to. If not provided, the personal namespace is assumed.
1208
+ :type org_id: str
1209
+ :param _request_timeout: timeout setting for this request. If one
1210
+ number provided, it will be total request
1211
+ timeout. It can also be a pair (tuple) of
1212
+ (connection, read) timeouts.
1213
+ :type _request_timeout: int, tuple(int, int), optional
1214
+ :param _request_auth: set to override the auth_settings for an a single
1215
+ request; this effectively ignores the
1216
+ authentication in the spec for a single request.
1217
+ :type _request_auth: dict, optional
1218
+ :param _content_type: force content-type for the request.
1219
+ :type _content_type: str, Optional
1220
+ :param _headers: set to override the headers for a single
1221
+ request; this effectively ignores the headers
1222
+ in the spec for a single request.
1223
+ :type _headers: dict, optional
1224
+ :param _host_index: set to override the host_index for a single
1225
+ request; this effectively ignores the host_index
1226
+ in the spec for a single request.
1227
+ :type _host_index: int, optional
1228
+ :return: Returns the result object.
1229
+ """ # noqa: E501
1230
+
1231
+ _param = self._list_webhook_runs_serialize(
1232
+ webhook_id=webhook_id,
1233
+ limit=limit,
1234
+ offset=offset,
1235
+ org_id=org_id,
1236
+ _request_auth=_request_auth,
1237
+ _content_type=_content_type,
1238
+ _headers=_headers,
1239
+ _host_index=_host_index
1240
+ )
1241
+
1242
+ _response_types_map: Dict[str, Optional[str]] = {
1243
+ '200': "WebhookRunListResponse",
1244
+ '404': None,
1245
+ }
1246
+ response_data = self.api_client.call_api(
1247
+ *_param,
1248
+ _request_timeout=_request_timeout
1249
+ )
1250
+ response_data.read()
1251
+ return self.api_client.response_deserialize(
1252
+ response_data=response_data,
1253
+ response_types_map=_response_types_map,
1254
+ ).data
1255
+
1256
+
1257
+ @validate_call
1258
+ def list_webhook_runs_with_http_info(
1259
+ self,
1260
+ webhook_id: StrictStr,
1261
+ limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum number of items to return.")] = None,
1262
+ offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of items to skip.")] = None,
1263
+ org_id: Annotated[Optional[StrictStr], Field(description="The organization ID to scope the request to. If not provided, the personal namespace is assumed.")] = None,
1264
+ _request_timeout: Union[
1265
+ None,
1266
+ Annotated[StrictFloat, Field(gt=0)],
1267
+ Tuple[
1268
+ Annotated[StrictFloat, Field(gt=0)],
1269
+ Annotated[StrictFloat, Field(gt=0)]
1270
+ ]
1271
+ ] = None,
1272
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1273
+ _content_type: Optional[StrictStr] = None,
1274
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1275
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1276
+ ) -> ApiResponse[WebhookRunListResponse]:
1277
+ """List invocation history for a webhook
1278
+
1279
+ Returns a paginated history of incoming named webhook invocations, ordered newest-first. Payload bodies are not included in this list response; use the run detail endpoint for the stored payload.
1280
+
1281
+ :param webhook_id: (required)
1282
+ :type webhook_id: str
1283
+ :param limit: Maximum number of items to return.
1284
+ :type limit: int
1285
+ :param offset: Number of items to skip.
1286
+ :type offset: int
1287
+ :param org_id: The organization ID to scope the request to. If not provided, the personal namespace is assumed.
1288
+ :type org_id: str
1289
+ :param _request_timeout: timeout setting for this request. If one
1290
+ number provided, it will be total request
1291
+ timeout. It can also be a pair (tuple) of
1292
+ (connection, read) timeouts.
1293
+ :type _request_timeout: int, tuple(int, int), optional
1294
+ :param _request_auth: set to override the auth_settings for an a single
1295
+ request; this effectively ignores the
1296
+ authentication in the spec for a single request.
1297
+ :type _request_auth: dict, optional
1298
+ :param _content_type: force content-type for the request.
1299
+ :type _content_type: str, Optional
1300
+ :param _headers: set to override the headers for a single
1301
+ request; this effectively ignores the headers
1302
+ in the spec for a single request.
1303
+ :type _headers: dict, optional
1304
+ :param _host_index: set to override the host_index for a single
1305
+ request; this effectively ignores the host_index
1306
+ in the spec for a single request.
1307
+ :type _host_index: int, optional
1308
+ :return: Returns the result object.
1309
+ """ # noqa: E501
1310
+
1311
+ _param = self._list_webhook_runs_serialize(
1312
+ webhook_id=webhook_id,
1313
+ limit=limit,
1314
+ offset=offset,
1315
+ org_id=org_id,
1316
+ _request_auth=_request_auth,
1317
+ _content_type=_content_type,
1318
+ _headers=_headers,
1319
+ _host_index=_host_index
1320
+ )
1321
+
1322
+ _response_types_map: Dict[str, Optional[str]] = {
1323
+ '200': "WebhookRunListResponse",
1324
+ '404': None,
1325
+ }
1326
+ response_data = self.api_client.call_api(
1327
+ *_param,
1328
+ _request_timeout=_request_timeout
1329
+ )
1330
+ response_data.read()
1331
+ return self.api_client.response_deserialize(
1332
+ response_data=response_data,
1333
+ response_types_map=_response_types_map,
1334
+ )
1335
+
1336
+
1337
+ @validate_call
1338
+ def list_webhook_runs_without_preload_content(
1339
+ self,
1340
+ webhook_id: StrictStr,
1341
+ limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum number of items to return.")] = None,
1342
+ offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of items to skip.")] = None,
1343
+ org_id: Annotated[Optional[StrictStr], Field(description="The organization ID to scope the request to. If not provided, the personal namespace is assumed.")] = None,
1344
+ _request_timeout: Union[
1345
+ None,
1346
+ Annotated[StrictFloat, Field(gt=0)],
1347
+ Tuple[
1348
+ Annotated[StrictFloat, Field(gt=0)],
1349
+ Annotated[StrictFloat, Field(gt=0)]
1350
+ ]
1351
+ ] = None,
1352
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1353
+ _content_type: Optional[StrictStr] = None,
1354
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1355
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1356
+ ) -> RESTResponseType:
1357
+ """List invocation history for a webhook
1358
+
1359
+ Returns a paginated history of incoming named webhook invocations, ordered newest-first. Payload bodies are not included in this list response; use the run detail endpoint for the stored payload.
1360
+
1361
+ :param webhook_id: (required)
1362
+ :type webhook_id: str
1363
+ :param limit: Maximum number of items to return.
1364
+ :type limit: int
1365
+ :param offset: Number of items to skip.
1366
+ :type offset: int
1367
+ :param org_id: The organization ID to scope the request to. If not provided, the personal namespace is assumed.
1368
+ :type org_id: str
1369
+ :param _request_timeout: timeout setting for this request. If one
1370
+ number provided, it will be total request
1371
+ timeout. It can also be a pair (tuple) of
1372
+ (connection, read) timeouts.
1373
+ :type _request_timeout: int, tuple(int, int), optional
1374
+ :param _request_auth: set to override the auth_settings for an a single
1375
+ request; this effectively ignores the
1376
+ authentication in the spec for a single request.
1377
+ :type _request_auth: dict, optional
1378
+ :param _content_type: force content-type for the request.
1379
+ :type _content_type: str, Optional
1380
+ :param _headers: set to override the headers for a single
1381
+ request; this effectively ignores the headers
1382
+ in the spec for a single request.
1383
+ :type _headers: dict, optional
1384
+ :param _host_index: set to override the host_index for a single
1385
+ request; this effectively ignores the host_index
1386
+ in the spec for a single request.
1387
+ :type _host_index: int, optional
1388
+ :return: Returns the result object.
1389
+ """ # noqa: E501
1390
+
1391
+ _param = self._list_webhook_runs_serialize(
1392
+ webhook_id=webhook_id,
1393
+ limit=limit,
1394
+ offset=offset,
1395
+ org_id=org_id,
1396
+ _request_auth=_request_auth,
1397
+ _content_type=_content_type,
1398
+ _headers=_headers,
1399
+ _host_index=_host_index
1400
+ )
1401
+
1402
+ _response_types_map: Dict[str, Optional[str]] = {
1403
+ '200': "WebhookRunListResponse",
1404
+ '404': None,
1405
+ }
1406
+ response_data = self.api_client.call_api(
1407
+ *_param,
1408
+ _request_timeout=_request_timeout
1409
+ )
1410
+ return response_data.response
1411
+
1412
+
1413
+ def _list_webhook_runs_serialize(
1414
+ self,
1415
+ webhook_id,
1416
+ limit,
1417
+ offset,
1418
+ org_id,
1419
+ _request_auth,
1420
+ _content_type,
1421
+ _headers,
1422
+ _host_index,
1423
+ ) -> RequestSerialized:
1424
+
1425
+ _host = None
1426
+
1427
+ _collection_formats: Dict[str, str] = {
1428
+ }
1429
+
1430
+ _path_params: Dict[str, str] = {}
1431
+ _query_params: List[Tuple[str, str]] = []
1432
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1433
+ _form_params: List[Tuple[str, str]] = []
1434
+ _files: Dict[
1435
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1436
+ ] = {}
1437
+ _body_params: Optional[bytes] = None
1438
+
1439
+ # process the path parameters
1440
+ if webhook_id is not None:
1441
+ _path_params['webhook_id'] = webhook_id
1442
+ # process the query parameters
1443
+ if limit is not None:
1444
+
1445
+ _query_params.append(('limit', limit))
1446
+
1447
+ if offset is not None:
1448
+
1449
+ _query_params.append(('offset', offset))
1450
+
1451
+ if org_id is not None:
1452
+
1453
+ _query_params.append(('orgId', org_id))
1454
+
1455
+ # process the header parameters
1456
+ # process the form parameters
1457
+ # process the body parameter
1458
+
1459
+
1460
+ # set the HTTP header `Accept`
1461
+ if 'Accept' not in _header_params:
1462
+ _header_params['Accept'] = self.api_client.select_header_accept(
1463
+ [
1464
+ 'application/json'
1465
+ ]
1466
+ )
1467
+
1468
+
1469
+ # authentication setting
1470
+ _auth_settings: List[str] = [
1471
+ 'ApiToken'
1472
+ ]
1473
+
1474
+ return self.api_client.param_serialize(
1475
+ method='GET',
1476
+ resource_path='/guild/api/v1/webhooks/{webhook_id}/runs',
1477
+ path_params=_path_params,
1478
+ query_params=_query_params,
1479
+ header_params=_header_params,
1480
+ body=_body_params,
1481
+ post_params=_form_params,
1482
+ files=_files,
1483
+ auth_settings=_auth_settings,
1484
+ collection_formats=_collection_formats,
1485
+ _host=_host,
1486
+ _request_auth=_request_auth
1487
+ )
1488
+
1489
+
1490
+
1491
+
1492
+ @validate_call
1493
+ def trigger_webhook(
1494
+ self,
1495
+ org_id: Annotated[Optional[StrictStr], Field(description="The organization ID to scope the request to. If not provided, the personal namespace is assumed.")] = None,
1496
+ api_key: Annotated[Optional[StrictStr], Field(description="Webhook token. Use this when the sender cannot set custom HTTP headers.")] = None,
1497
+ body: Optional[StrictStr] = None,
1498
+ _request_timeout: Union[
1499
+ None,
1500
+ Annotated[StrictFloat, Field(gt=0)],
1501
+ Tuple[
1502
+ Annotated[StrictFloat, Field(gt=0)],
1503
+ Annotated[StrictFloat, Field(gt=0)]
1504
+ ]
1505
+ ] = None,
1506
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1507
+ _content_type: Optional[StrictStr] = None,
1508
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1509
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1510
+ ) -> TriggerWebhook202Response:
1511
+ """Trigger a webhook to start a session
1512
+
1513
+ Public endpoint authenticated by a webhook token. Provide the token via the `apiKey` query parameter or the Authorization header (`Bearer <token>`). This endpoint is NOT behind session authentication. The 202 body includes webhook_id, invocation_id, and target identity so clients can poll GET /api/v1/webhooks/{webhook_id}/runs/{invocation_id} until session_id and trace_id are populated.
1514
+
1515
+ :param org_id: The organization ID to scope the request to. If not provided, the personal namespace is assumed.
1516
+ :type org_id: str
1517
+ :param api_key: Webhook token. Use this when the sender cannot set custom HTTP headers.
1518
+ :type api_key: str
1519
+ :param body:
1520
+ :type body: str
1521
+ :param _request_timeout: timeout setting for this request. If one
1522
+ number provided, it will be total request
1523
+ timeout. It can also be a pair (tuple) of
1524
+ (connection, read) timeouts.
1525
+ :type _request_timeout: int, tuple(int, int), optional
1526
+ :param _request_auth: set to override the auth_settings for an a single
1527
+ request; this effectively ignores the
1528
+ authentication in the spec for a single request.
1529
+ :type _request_auth: dict, optional
1530
+ :param _content_type: force content-type for the request.
1531
+ :type _content_type: str, Optional
1532
+ :param _headers: set to override the headers for a single
1533
+ request; this effectively ignores the headers
1534
+ in the spec for a single request.
1535
+ :type _headers: dict, optional
1536
+ :param _host_index: set to override the host_index for a single
1537
+ request; this effectively ignores the host_index
1538
+ in the spec for a single request.
1539
+ :type _host_index: int, optional
1540
+ :return: Returns the result object.
1541
+ """ # noqa: E501
1542
+
1543
+ _param = self._trigger_webhook_serialize(
1544
+ org_id=org_id,
1545
+ api_key=api_key,
1546
+ body=body,
1547
+ _request_auth=_request_auth,
1548
+ _content_type=_content_type,
1549
+ _headers=_headers,
1550
+ _host_index=_host_index
1551
+ )
1552
+
1553
+ _response_types_map: Dict[str, Optional[str]] = {
1554
+ '202': "TriggerWebhook202Response",
1555
+ '401': None,
1556
+ '404': None,
1557
+ '423': "JsonError",
1558
+ }
1559
+ response_data = self.api_client.call_api(
1560
+ *_param,
1561
+ _request_timeout=_request_timeout
1562
+ )
1563
+ response_data.read()
1564
+ return self.api_client.response_deserialize(
1565
+ response_data=response_data,
1566
+ response_types_map=_response_types_map,
1567
+ ).data
1568
+
1569
+
1570
+ @validate_call
1571
+ def trigger_webhook_with_http_info(
1572
+ self,
1573
+ org_id: Annotated[Optional[StrictStr], Field(description="The organization ID to scope the request to. If not provided, the personal namespace is assumed.")] = None,
1574
+ api_key: Annotated[Optional[StrictStr], Field(description="Webhook token. Use this when the sender cannot set custom HTTP headers.")] = None,
1575
+ body: Optional[StrictStr] = None,
1576
+ _request_timeout: Union[
1577
+ None,
1578
+ Annotated[StrictFloat, Field(gt=0)],
1579
+ Tuple[
1580
+ Annotated[StrictFloat, Field(gt=0)],
1581
+ Annotated[StrictFloat, Field(gt=0)]
1582
+ ]
1583
+ ] = None,
1584
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1585
+ _content_type: Optional[StrictStr] = None,
1586
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1587
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1588
+ ) -> ApiResponse[TriggerWebhook202Response]:
1589
+ """Trigger a webhook to start a session
1590
+
1591
+ Public endpoint authenticated by a webhook token. Provide the token via the `apiKey` query parameter or the Authorization header (`Bearer <token>`). This endpoint is NOT behind session authentication. The 202 body includes webhook_id, invocation_id, and target identity so clients can poll GET /api/v1/webhooks/{webhook_id}/runs/{invocation_id} until session_id and trace_id are populated.
1592
+
1593
+ :param org_id: The organization ID to scope the request to. If not provided, the personal namespace is assumed.
1594
+ :type org_id: str
1595
+ :param api_key: Webhook token. Use this when the sender cannot set custom HTTP headers.
1596
+ :type api_key: str
1597
+ :param body:
1598
+ :type body: str
1599
+ :param _request_timeout: timeout setting for this request. If one
1600
+ number provided, it will be total request
1601
+ timeout. It can also be a pair (tuple) of
1602
+ (connection, read) timeouts.
1603
+ :type _request_timeout: int, tuple(int, int), optional
1604
+ :param _request_auth: set to override the auth_settings for an a single
1605
+ request; this effectively ignores the
1606
+ authentication in the spec for a single request.
1607
+ :type _request_auth: dict, optional
1608
+ :param _content_type: force content-type for the request.
1609
+ :type _content_type: str, Optional
1610
+ :param _headers: set to override the headers for a single
1611
+ request; this effectively ignores the headers
1612
+ in the spec for a single request.
1613
+ :type _headers: dict, optional
1614
+ :param _host_index: set to override the host_index for a single
1615
+ request; this effectively ignores the host_index
1616
+ in the spec for a single request.
1617
+ :type _host_index: int, optional
1618
+ :return: Returns the result object.
1619
+ """ # noqa: E501
1620
+
1621
+ _param = self._trigger_webhook_serialize(
1622
+ org_id=org_id,
1623
+ api_key=api_key,
1624
+ body=body,
1625
+ _request_auth=_request_auth,
1626
+ _content_type=_content_type,
1627
+ _headers=_headers,
1628
+ _host_index=_host_index
1629
+ )
1630
+
1631
+ _response_types_map: Dict[str, Optional[str]] = {
1632
+ '202': "TriggerWebhook202Response",
1633
+ '401': None,
1634
+ '404': None,
1635
+ '423': "JsonError",
1636
+ }
1637
+ response_data = self.api_client.call_api(
1638
+ *_param,
1639
+ _request_timeout=_request_timeout
1640
+ )
1641
+ response_data.read()
1642
+ return self.api_client.response_deserialize(
1643
+ response_data=response_data,
1644
+ response_types_map=_response_types_map,
1645
+ )
1646
+
1647
+
1648
+ @validate_call
1649
+ def trigger_webhook_without_preload_content(
1650
+ self,
1651
+ org_id: Annotated[Optional[StrictStr], Field(description="The organization ID to scope the request to. If not provided, the personal namespace is assumed.")] = None,
1652
+ api_key: Annotated[Optional[StrictStr], Field(description="Webhook token. Use this when the sender cannot set custom HTTP headers.")] = None,
1653
+ body: Optional[StrictStr] = None,
1654
+ _request_timeout: Union[
1655
+ None,
1656
+ Annotated[StrictFloat, Field(gt=0)],
1657
+ Tuple[
1658
+ Annotated[StrictFloat, Field(gt=0)],
1659
+ Annotated[StrictFloat, Field(gt=0)]
1660
+ ]
1661
+ ] = None,
1662
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1663
+ _content_type: Optional[StrictStr] = None,
1664
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1665
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1666
+ ) -> RESTResponseType:
1667
+ """Trigger a webhook to start a session
1668
+
1669
+ Public endpoint authenticated by a webhook token. Provide the token via the `apiKey` query parameter or the Authorization header (`Bearer <token>`). This endpoint is NOT behind session authentication. The 202 body includes webhook_id, invocation_id, and target identity so clients can poll GET /api/v1/webhooks/{webhook_id}/runs/{invocation_id} until session_id and trace_id are populated.
1670
+
1671
+ :param org_id: The organization ID to scope the request to. If not provided, the personal namespace is assumed.
1672
+ :type org_id: str
1673
+ :param api_key: Webhook token. Use this when the sender cannot set custom HTTP headers.
1674
+ :type api_key: str
1675
+ :param body:
1676
+ :type body: str
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._trigger_webhook_serialize(
1700
+ org_id=org_id,
1701
+ api_key=api_key,
1702
+ body=body,
1703
+ _request_auth=_request_auth,
1704
+ _content_type=_content_type,
1705
+ _headers=_headers,
1706
+ _host_index=_host_index
1707
+ )
1708
+
1709
+ _response_types_map: Dict[str, Optional[str]] = {
1710
+ '202': "TriggerWebhook202Response",
1711
+ '401': None,
1712
+ '404': None,
1713
+ '423': "JsonError",
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 _trigger_webhook_serialize(
1723
+ self,
1724
+ org_id,
1725
+ api_key,
1726
+ body,
1727
+ _request_auth,
1728
+ _content_type,
1729
+ _headers,
1730
+ _host_index,
1731
+ ) -> RequestSerialized:
1732
+
1733
+ _host = None
1734
+
1735
+ _collection_formats: Dict[str, str] = {
1736
+ }
1737
+
1738
+ _path_params: Dict[str, str] = {}
1739
+ _query_params: List[Tuple[str, str]] = []
1740
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1741
+ _form_params: List[Tuple[str, str]] = []
1742
+ _files: Dict[
1743
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1744
+ ] = {}
1745
+ _body_params: Optional[bytes] = None
1746
+
1747
+ # process the path parameters
1748
+ # process the query parameters
1749
+ if org_id is not None:
1750
+
1751
+ _query_params.append(('orgId', org_id))
1752
+
1753
+ if api_key is not None:
1754
+
1755
+ _query_params.append(('apiKey', api_key))
1756
+
1757
+ # process the header parameters
1758
+ # process the form parameters
1759
+ # process the body parameter
1760
+ if body is not None:
1761
+ _body_params = body
1762
+
1763
+
1764
+ # set the HTTP header `Accept`
1765
+ if 'Accept' not in _header_params:
1766
+ _header_params['Accept'] = self.api_client.select_header_accept(
1767
+ [
1768
+ 'application/json'
1769
+ ]
1770
+ )
1771
+
1772
+ # set the HTTP header `Content-Type`
1773
+ if _content_type:
1774
+ _header_params['Content-Type'] = _content_type
1775
+ else:
1776
+ _default_content_type = (
1777
+ self.api_client.select_header_content_type(
1778
+ [
1779
+ 'text/plain'
1780
+ ]
1781
+ )
1782
+ )
1783
+ if _default_content_type is not None:
1784
+ _header_params['Content-Type'] = _default_content_type
1785
+
1786
+ # authentication setting
1787
+ _auth_settings: List[str] = [
1788
+ 'WebhookToken'
1789
+ ]
1790
+
1791
+ return self.api_client.param_serialize(
1792
+ method='POST',
1793
+ resource_path='/guild/api/v1/webhooks/trigger',
1794
+ path_params=_path_params,
1795
+ query_params=_query_params,
1796
+ header_params=_header_params,
1797
+ body=_body_params,
1798
+ post_params=_form_params,
1799
+ files=_files,
1800
+ auth_settings=_auth_settings,
1801
+ collection_formats=_collection_formats,
1802
+ _host=_host,
1803
+ _request_auth=_request_auth
1804
+ )
1805
+
1806
+