cribl-control-plane 0.0.14__py3-none-any.whl → 0.0.16__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 cribl-control-plane might be problematic. Click here for more details.

Files changed (65) hide show
  1. cribl_control_plane/_version.py +3 -3
  2. cribl_control_plane/{outputs.py → destinations.py} +69 -71
  3. cribl_control_plane/models/__init__.py +5329 -8
  4. cribl_control_plane/models/createinputop.py +19253 -2
  5. cribl_control_plane/models/createoutputop.py +20578 -4
  6. cribl_control_plane/models/createoutputtestbyidop.py +2 -2
  7. cribl_control_plane/models/createpipelineop.py +24 -0
  8. cribl_control_plane/models/deleteoutputbyidop.py +2 -2
  9. cribl_control_plane/models/deleteoutputpqbyidop.py +2 -2
  10. cribl_control_plane/models/deletepipelinebyidop.py +37 -0
  11. cribl_control_plane/models/getoutputbyidop.py +2 -2
  12. cribl_control_plane/models/getoutputpqbyidop.py +2 -2
  13. cribl_control_plane/models/getoutputsamplesbyidop.py +2 -2
  14. cribl_control_plane/models/getpipelinebyidop.py +37 -0
  15. cribl_control_plane/models/inputconfluentcloud.py +5 -3
  16. cribl_control_plane/models/inputcriblhttp.py +5 -3
  17. cribl_control_plane/models/inputcribllakehttp.py +5 -3
  18. cribl_control_plane/models/inputcribltcp.py +5 -3
  19. cribl_control_plane/models/inputdatadogagent.py +5 -3
  20. cribl_control_plane/models/inputedgeprometheus.py +5 -3
  21. cribl_control_plane/models/inputelastic.py +5 -3
  22. cribl_control_plane/models/inputeventhub.py +5 -3
  23. cribl_control_plane/models/inputfirehose.py +5 -3
  24. cribl_control_plane/models/inputgooglepubsub.py +5 -3
  25. cribl_control_plane/models/inputgrafana_union.py +10 -6
  26. cribl_control_plane/models/inputhttp.py +5 -3
  27. cribl_control_plane/models/inputhttpraw.py +5 -3
  28. cribl_control_plane/models/inputjournalfiles.py +5 -3
  29. cribl_control_plane/models/inputkafka.py +5 -3
  30. cribl_control_plane/models/inputkinesis.py +5 -3
  31. cribl_control_plane/models/inputloki.py +5 -3
  32. cribl_control_plane/models/inputmodeldriventelemetry.py +6 -5
  33. cribl_control_plane/models/inputmsk.py +5 -3
  34. cribl_control_plane/models/inputnetflow.py +5 -3
  35. cribl_control_plane/models/inputoffice365mgmt.py +5 -3
  36. cribl_control_plane/models/inputoffice365msgtrace.py +5 -5
  37. cribl_control_plane/models/inputoffice365service.py +5 -5
  38. cribl_control_plane/models/inputopentelemetry.py +5 -3
  39. cribl_control_plane/models/inputprometheus.py +5 -3
  40. cribl_control_plane/models/inputprometheusrw.py +5 -3
  41. cribl_control_plane/models/inputrawudp.py +5 -3
  42. cribl_control_plane/models/inputsnmp.py +5 -3
  43. cribl_control_plane/models/inputsplunk.py +5 -3
  44. cribl_control_plane/models/inputsplunkhec.py +5 -3
  45. cribl_control_plane/models/inputsplunksearch.py +5 -3
  46. cribl_control_plane/models/inputsqs.py +5 -3
  47. cribl_control_plane/models/inputtcp.py +5 -3
  48. cribl_control_plane/models/inputtcpjson.py +5 -3
  49. cribl_control_plane/models/inputwef.py +5 -3
  50. cribl_control_plane/models/inputwiz.py +5 -3
  51. cribl_control_plane/models/inputzscalerhec.py +5 -3
  52. cribl_control_plane/models/listoutputop.py +2 -2
  53. cribl_control_plane/models/listpipelineop.py +24 -0
  54. cribl_control_plane/models/pipeline.py +70 -0
  55. cribl_control_plane/models/pipelinefunctionconf.py +53 -0
  56. cribl_control_plane/models/routes.py +6 -6
  57. cribl_control_plane/models/updateoutputbyidop.py +4 -4
  58. cribl_control_plane/models/updatepipelinebyidop.py +47 -0
  59. cribl_control_plane/pipelines.py +903 -0
  60. cribl_control_plane/routes_sdk.py +8 -4
  61. cribl_control_plane/sdk.py +7 -5
  62. cribl_control_plane/sources.py +8 -10
  63. {cribl_control_plane-0.0.14.dist-info → cribl_control_plane-0.0.16.dist-info}/METADATA +20 -12
  64. {cribl_control_plane-0.0.14.dist-info → cribl_control_plane-0.0.16.dist-info}/RECORD +65 -57
  65. {cribl_control_plane-0.0.14.dist-info → cribl_control_plane-0.0.16.dist-info}/WHEEL +0 -0
@@ -0,0 +1,903 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from .basesdk import BaseSDK
4
+ from cribl_control_plane import errors, models, utils
5
+ from cribl_control_plane._hooks import HookContext
6
+ from cribl_control_plane.types import OptionalNullable, UNSET
7
+ from cribl_control_plane.utils import get_security_from_env
8
+ from cribl_control_plane.utils.unmarshal_json_response import unmarshal_json_response
9
+ from typing import Any, Mapping, Optional, Union
10
+
11
+
12
+ class Pipelines(BaseSDK):
13
+ r"""Actions related to Pipelines"""
14
+
15
+ def list_pipeline(
16
+ self,
17
+ *,
18
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
19
+ server_url: Optional[str] = None,
20
+ timeout_ms: Optional[int] = None,
21
+ http_headers: Optional[Mapping[str, str]] = None,
22
+ ) -> models.ListPipelineResponse:
23
+ r"""Get a list of Pipeline objects
24
+
25
+ Get a list of Pipeline objects
26
+
27
+ :param retries: Override the default retry configuration for this method
28
+ :param server_url: Override the default server URL for this method
29
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
30
+ :param http_headers: Additional headers to set or replace on requests.
31
+ """
32
+ base_url = None
33
+ url_variables = None
34
+ if timeout_ms is None:
35
+ timeout_ms = self.sdk_configuration.timeout_ms
36
+
37
+ if server_url is not None:
38
+ base_url = server_url
39
+ else:
40
+ base_url = self._get_url(base_url, url_variables)
41
+ req = self._build_request(
42
+ method="GET",
43
+ path="/pipelines",
44
+ base_url=base_url,
45
+ url_variables=url_variables,
46
+ request=None,
47
+ request_body_required=False,
48
+ request_has_path_params=False,
49
+ request_has_query_params=True,
50
+ user_agent_header="user-agent",
51
+ accept_header_value="application/json",
52
+ http_headers=http_headers,
53
+ security=self.sdk_configuration.security,
54
+ timeout_ms=timeout_ms,
55
+ )
56
+
57
+ if retries == UNSET:
58
+ if self.sdk_configuration.retry_config is not UNSET:
59
+ retries = self.sdk_configuration.retry_config
60
+
61
+ retry_config = None
62
+ if isinstance(retries, utils.RetryConfig):
63
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
64
+
65
+ http_res = self.do_request(
66
+ hook_ctx=HookContext(
67
+ config=self.sdk_configuration,
68
+ base_url=base_url or "",
69
+ operation_id="listPipeline",
70
+ oauth2_scopes=[],
71
+ security_source=get_security_from_env(
72
+ self.sdk_configuration.security, models.Security
73
+ ),
74
+ ),
75
+ request=req,
76
+ error_status_codes=["401", "4XX", "500", "5XX"],
77
+ retry_config=retry_config,
78
+ )
79
+
80
+ response_data: Any = None
81
+ if utils.match_response(http_res, "200", "application/json"):
82
+ return unmarshal_json_response(models.ListPipelineResponse, http_res)
83
+ if utils.match_response(http_res, "500", "application/json"):
84
+ response_data = unmarshal_json_response(errors.ErrorData, http_res)
85
+ raise errors.Error(response_data, http_res)
86
+ if utils.match_response(http_res, ["401", "4XX"], "*"):
87
+ http_res_text = utils.stream_to_text(http_res)
88
+ raise errors.APIError("API error occurred", http_res, http_res_text)
89
+ if utils.match_response(http_res, "5XX", "*"):
90
+ http_res_text = utils.stream_to_text(http_res)
91
+ raise errors.APIError("API error occurred", http_res, http_res_text)
92
+
93
+ raise errors.APIError("Unexpected response received", http_res)
94
+
95
+ async def list_pipeline_async(
96
+ self,
97
+ *,
98
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
99
+ server_url: Optional[str] = None,
100
+ timeout_ms: Optional[int] = None,
101
+ http_headers: Optional[Mapping[str, str]] = None,
102
+ ) -> models.ListPipelineResponse:
103
+ r"""Get a list of Pipeline objects
104
+
105
+ Get a list of Pipeline objects
106
+
107
+ :param retries: Override the default retry configuration for this method
108
+ :param server_url: Override the default server URL for this method
109
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
110
+ :param http_headers: Additional headers to set or replace on requests.
111
+ """
112
+ base_url = None
113
+ url_variables = None
114
+ if timeout_ms is None:
115
+ timeout_ms = self.sdk_configuration.timeout_ms
116
+
117
+ if server_url is not None:
118
+ base_url = server_url
119
+ else:
120
+ base_url = self._get_url(base_url, url_variables)
121
+ req = self._build_request_async(
122
+ method="GET",
123
+ path="/pipelines",
124
+ base_url=base_url,
125
+ url_variables=url_variables,
126
+ request=None,
127
+ request_body_required=False,
128
+ request_has_path_params=False,
129
+ request_has_query_params=True,
130
+ user_agent_header="user-agent",
131
+ accept_header_value="application/json",
132
+ http_headers=http_headers,
133
+ security=self.sdk_configuration.security,
134
+ timeout_ms=timeout_ms,
135
+ )
136
+
137
+ if retries == UNSET:
138
+ if self.sdk_configuration.retry_config is not UNSET:
139
+ retries = self.sdk_configuration.retry_config
140
+
141
+ retry_config = None
142
+ if isinstance(retries, utils.RetryConfig):
143
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
144
+
145
+ http_res = await self.do_request_async(
146
+ hook_ctx=HookContext(
147
+ config=self.sdk_configuration,
148
+ base_url=base_url or "",
149
+ operation_id="listPipeline",
150
+ oauth2_scopes=[],
151
+ security_source=get_security_from_env(
152
+ self.sdk_configuration.security, models.Security
153
+ ),
154
+ ),
155
+ request=req,
156
+ error_status_codes=["401", "4XX", "500", "5XX"],
157
+ retry_config=retry_config,
158
+ )
159
+
160
+ response_data: Any = None
161
+ if utils.match_response(http_res, "200", "application/json"):
162
+ return unmarshal_json_response(models.ListPipelineResponse, http_res)
163
+ if utils.match_response(http_res, "500", "application/json"):
164
+ response_data = unmarshal_json_response(errors.ErrorData, http_res)
165
+ raise errors.Error(response_data, http_res)
166
+ if utils.match_response(http_res, ["401", "4XX"], "*"):
167
+ http_res_text = await utils.stream_to_text_async(http_res)
168
+ raise errors.APIError("API error occurred", http_res, http_res_text)
169
+ if utils.match_response(http_res, "5XX", "*"):
170
+ http_res_text = await utils.stream_to_text_async(http_res)
171
+ raise errors.APIError("API error occurred", http_res, http_res_text)
172
+
173
+ raise errors.APIError("Unexpected response received", http_res)
174
+
175
+ def create_pipeline(
176
+ self,
177
+ *,
178
+ id: str,
179
+ conf: Union[models.Conf, models.ConfTypedDict],
180
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
181
+ server_url: Optional[str] = None,
182
+ timeout_ms: Optional[int] = None,
183
+ http_headers: Optional[Mapping[str, str]] = None,
184
+ ) -> models.CreatePipelineResponse:
185
+ r"""Create Pipeline
186
+
187
+ Create Pipeline
188
+
189
+ :param id:
190
+ :param conf:
191
+ :param retries: Override the default retry configuration for this method
192
+ :param server_url: Override the default server URL for this method
193
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
194
+ :param http_headers: Additional headers to set or replace on requests.
195
+ """
196
+ base_url = None
197
+ url_variables = None
198
+ if timeout_ms is None:
199
+ timeout_ms = self.sdk_configuration.timeout_ms
200
+
201
+ if server_url is not None:
202
+ base_url = server_url
203
+ else:
204
+ base_url = self._get_url(base_url, url_variables)
205
+
206
+ request = models.Pipeline(
207
+ id=id,
208
+ conf=utils.get_pydantic_model(conf, models.Conf),
209
+ )
210
+
211
+ req = self._build_request(
212
+ method="POST",
213
+ path="/pipelines",
214
+ base_url=base_url,
215
+ url_variables=url_variables,
216
+ request=request,
217
+ request_body_required=True,
218
+ request_has_path_params=False,
219
+ request_has_query_params=True,
220
+ user_agent_header="user-agent",
221
+ accept_header_value="application/json",
222
+ http_headers=http_headers,
223
+ security=self.sdk_configuration.security,
224
+ get_serialized_body=lambda: utils.serialize_request_body(
225
+ request, False, False, "json", models.Pipeline
226
+ ),
227
+ timeout_ms=timeout_ms,
228
+ )
229
+
230
+ if retries == UNSET:
231
+ if self.sdk_configuration.retry_config is not UNSET:
232
+ retries = self.sdk_configuration.retry_config
233
+
234
+ retry_config = None
235
+ if isinstance(retries, utils.RetryConfig):
236
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
237
+
238
+ http_res = self.do_request(
239
+ hook_ctx=HookContext(
240
+ config=self.sdk_configuration,
241
+ base_url=base_url or "",
242
+ operation_id="createPipeline",
243
+ oauth2_scopes=[],
244
+ security_source=get_security_from_env(
245
+ self.sdk_configuration.security, models.Security
246
+ ),
247
+ ),
248
+ request=req,
249
+ error_status_codes=["401", "4XX", "500", "5XX"],
250
+ retry_config=retry_config,
251
+ )
252
+
253
+ response_data: Any = None
254
+ if utils.match_response(http_res, "200", "application/json"):
255
+ return unmarshal_json_response(models.CreatePipelineResponse, http_res)
256
+ if utils.match_response(http_res, "500", "application/json"):
257
+ response_data = unmarshal_json_response(errors.ErrorData, http_res)
258
+ raise errors.Error(response_data, http_res)
259
+ if utils.match_response(http_res, ["401", "4XX"], "*"):
260
+ http_res_text = utils.stream_to_text(http_res)
261
+ raise errors.APIError("API error occurred", http_res, http_res_text)
262
+ if utils.match_response(http_res, "5XX", "*"):
263
+ http_res_text = utils.stream_to_text(http_res)
264
+ raise errors.APIError("API error occurred", http_res, http_res_text)
265
+
266
+ raise errors.APIError("Unexpected response received", http_res)
267
+
268
+ async def create_pipeline_async(
269
+ self,
270
+ *,
271
+ id: str,
272
+ conf: Union[models.Conf, models.ConfTypedDict],
273
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
274
+ server_url: Optional[str] = None,
275
+ timeout_ms: Optional[int] = None,
276
+ http_headers: Optional[Mapping[str, str]] = None,
277
+ ) -> models.CreatePipelineResponse:
278
+ r"""Create Pipeline
279
+
280
+ Create Pipeline
281
+
282
+ :param id:
283
+ :param conf:
284
+ :param retries: Override the default retry configuration for this method
285
+ :param server_url: Override the default server URL for this method
286
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
287
+ :param http_headers: Additional headers to set or replace on requests.
288
+ """
289
+ base_url = None
290
+ url_variables = None
291
+ if timeout_ms is None:
292
+ timeout_ms = self.sdk_configuration.timeout_ms
293
+
294
+ if server_url is not None:
295
+ base_url = server_url
296
+ else:
297
+ base_url = self._get_url(base_url, url_variables)
298
+
299
+ request = models.Pipeline(
300
+ id=id,
301
+ conf=utils.get_pydantic_model(conf, models.Conf),
302
+ )
303
+
304
+ req = self._build_request_async(
305
+ method="POST",
306
+ path="/pipelines",
307
+ base_url=base_url,
308
+ url_variables=url_variables,
309
+ request=request,
310
+ request_body_required=True,
311
+ request_has_path_params=False,
312
+ request_has_query_params=True,
313
+ user_agent_header="user-agent",
314
+ accept_header_value="application/json",
315
+ http_headers=http_headers,
316
+ security=self.sdk_configuration.security,
317
+ get_serialized_body=lambda: utils.serialize_request_body(
318
+ request, False, False, "json", models.Pipeline
319
+ ),
320
+ timeout_ms=timeout_ms,
321
+ )
322
+
323
+ if retries == UNSET:
324
+ if self.sdk_configuration.retry_config is not UNSET:
325
+ retries = self.sdk_configuration.retry_config
326
+
327
+ retry_config = None
328
+ if isinstance(retries, utils.RetryConfig):
329
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
330
+
331
+ http_res = await self.do_request_async(
332
+ hook_ctx=HookContext(
333
+ config=self.sdk_configuration,
334
+ base_url=base_url or "",
335
+ operation_id="createPipeline",
336
+ oauth2_scopes=[],
337
+ security_source=get_security_from_env(
338
+ self.sdk_configuration.security, models.Security
339
+ ),
340
+ ),
341
+ request=req,
342
+ error_status_codes=["401", "4XX", "500", "5XX"],
343
+ retry_config=retry_config,
344
+ )
345
+
346
+ response_data: Any = None
347
+ if utils.match_response(http_res, "200", "application/json"):
348
+ return unmarshal_json_response(models.CreatePipelineResponse, http_res)
349
+ if utils.match_response(http_res, "500", "application/json"):
350
+ response_data = unmarshal_json_response(errors.ErrorData, http_res)
351
+ raise errors.Error(response_data, http_res)
352
+ if utils.match_response(http_res, ["401", "4XX"], "*"):
353
+ http_res_text = await utils.stream_to_text_async(http_res)
354
+ raise errors.APIError("API error occurred", http_res, http_res_text)
355
+ if utils.match_response(http_res, "5XX", "*"):
356
+ http_res_text = await utils.stream_to_text_async(http_res)
357
+ raise errors.APIError("API error occurred", http_res, http_res_text)
358
+
359
+ raise errors.APIError("Unexpected response received", http_res)
360
+
361
+ def get_pipeline_by_id(
362
+ self,
363
+ *,
364
+ id: str,
365
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
366
+ server_url: Optional[str] = None,
367
+ timeout_ms: Optional[int] = None,
368
+ http_headers: Optional[Mapping[str, str]] = None,
369
+ ) -> models.GetPipelineByIDResponse:
370
+ r"""Get Pipeline by ID
371
+
372
+ Get Pipeline by ID
373
+
374
+ :param id: Unique ID to GET
375
+ :param retries: Override the default retry configuration for this method
376
+ :param server_url: Override the default server URL for this method
377
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
378
+ :param http_headers: Additional headers to set or replace on requests.
379
+ """
380
+ base_url = None
381
+ url_variables = None
382
+ if timeout_ms is None:
383
+ timeout_ms = self.sdk_configuration.timeout_ms
384
+
385
+ if server_url is not None:
386
+ base_url = server_url
387
+ else:
388
+ base_url = self._get_url(base_url, url_variables)
389
+
390
+ request = models.GetPipelineByIDRequest(
391
+ id=id,
392
+ )
393
+
394
+ req = self._build_request(
395
+ method="GET",
396
+ path="/pipelines/{id}",
397
+ base_url=base_url,
398
+ url_variables=url_variables,
399
+ request=request,
400
+ request_body_required=False,
401
+ request_has_path_params=True,
402
+ request_has_query_params=True,
403
+ user_agent_header="user-agent",
404
+ accept_header_value="application/json",
405
+ http_headers=http_headers,
406
+ security=self.sdk_configuration.security,
407
+ timeout_ms=timeout_ms,
408
+ )
409
+
410
+ if retries == UNSET:
411
+ if self.sdk_configuration.retry_config is not UNSET:
412
+ retries = self.sdk_configuration.retry_config
413
+
414
+ retry_config = None
415
+ if isinstance(retries, utils.RetryConfig):
416
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
417
+
418
+ http_res = self.do_request(
419
+ hook_ctx=HookContext(
420
+ config=self.sdk_configuration,
421
+ base_url=base_url or "",
422
+ operation_id="getPipelineById",
423
+ oauth2_scopes=[],
424
+ security_source=get_security_from_env(
425
+ self.sdk_configuration.security, models.Security
426
+ ),
427
+ ),
428
+ request=req,
429
+ error_status_codes=["401", "4XX", "500", "5XX"],
430
+ retry_config=retry_config,
431
+ )
432
+
433
+ response_data: Any = None
434
+ if utils.match_response(http_res, "200", "application/json"):
435
+ return unmarshal_json_response(models.GetPipelineByIDResponse, http_res)
436
+ if utils.match_response(http_res, "500", "application/json"):
437
+ response_data = unmarshal_json_response(errors.ErrorData, http_res)
438
+ raise errors.Error(response_data, http_res)
439
+ if utils.match_response(http_res, ["401", "4XX"], "*"):
440
+ http_res_text = utils.stream_to_text(http_res)
441
+ raise errors.APIError("API error occurred", http_res, http_res_text)
442
+ if utils.match_response(http_res, "5XX", "*"):
443
+ http_res_text = utils.stream_to_text(http_res)
444
+ raise errors.APIError("API error occurred", http_res, http_res_text)
445
+
446
+ raise errors.APIError("Unexpected response received", http_res)
447
+
448
+ async def get_pipeline_by_id_async(
449
+ self,
450
+ *,
451
+ id: str,
452
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
453
+ server_url: Optional[str] = None,
454
+ timeout_ms: Optional[int] = None,
455
+ http_headers: Optional[Mapping[str, str]] = None,
456
+ ) -> models.GetPipelineByIDResponse:
457
+ r"""Get Pipeline by ID
458
+
459
+ Get Pipeline by ID
460
+
461
+ :param id: Unique ID to GET
462
+ :param retries: Override the default retry configuration for this method
463
+ :param server_url: Override the default server URL for this method
464
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
465
+ :param http_headers: Additional headers to set or replace on requests.
466
+ """
467
+ base_url = None
468
+ url_variables = None
469
+ if timeout_ms is None:
470
+ timeout_ms = self.sdk_configuration.timeout_ms
471
+
472
+ if server_url is not None:
473
+ base_url = server_url
474
+ else:
475
+ base_url = self._get_url(base_url, url_variables)
476
+
477
+ request = models.GetPipelineByIDRequest(
478
+ id=id,
479
+ )
480
+
481
+ req = self._build_request_async(
482
+ method="GET",
483
+ path="/pipelines/{id}",
484
+ base_url=base_url,
485
+ url_variables=url_variables,
486
+ request=request,
487
+ request_body_required=False,
488
+ request_has_path_params=True,
489
+ request_has_query_params=True,
490
+ user_agent_header="user-agent",
491
+ accept_header_value="application/json",
492
+ http_headers=http_headers,
493
+ security=self.sdk_configuration.security,
494
+ timeout_ms=timeout_ms,
495
+ )
496
+
497
+ if retries == UNSET:
498
+ if self.sdk_configuration.retry_config is not UNSET:
499
+ retries = self.sdk_configuration.retry_config
500
+
501
+ retry_config = None
502
+ if isinstance(retries, utils.RetryConfig):
503
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
504
+
505
+ http_res = await self.do_request_async(
506
+ hook_ctx=HookContext(
507
+ config=self.sdk_configuration,
508
+ base_url=base_url or "",
509
+ operation_id="getPipelineById",
510
+ oauth2_scopes=[],
511
+ security_source=get_security_from_env(
512
+ self.sdk_configuration.security, models.Security
513
+ ),
514
+ ),
515
+ request=req,
516
+ error_status_codes=["401", "4XX", "500", "5XX"],
517
+ retry_config=retry_config,
518
+ )
519
+
520
+ response_data: Any = None
521
+ if utils.match_response(http_res, "200", "application/json"):
522
+ return unmarshal_json_response(models.GetPipelineByIDResponse, http_res)
523
+ if utils.match_response(http_res, "500", "application/json"):
524
+ response_data = unmarshal_json_response(errors.ErrorData, http_res)
525
+ raise errors.Error(response_data, http_res)
526
+ if utils.match_response(http_res, ["401", "4XX"], "*"):
527
+ http_res_text = await utils.stream_to_text_async(http_res)
528
+ raise errors.APIError("API error occurred", http_res, http_res_text)
529
+ if utils.match_response(http_res, "5XX", "*"):
530
+ http_res_text = await utils.stream_to_text_async(http_res)
531
+ raise errors.APIError("API error occurred", http_res, http_res_text)
532
+
533
+ raise errors.APIError("Unexpected response received", http_res)
534
+
535
+ def update_pipeline_by_id(
536
+ self,
537
+ *,
538
+ id_param: str,
539
+ id: str,
540
+ conf: Union[models.Conf, models.ConfTypedDict],
541
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
542
+ server_url: Optional[str] = None,
543
+ timeout_ms: Optional[int] = None,
544
+ http_headers: Optional[Mapping[str, str]] = None,
545
+ ) -> models.UpdatePipelineByIDResponse:
546
+ r"""Update Pipeline
547
+
548
+ Update Pipeline
549
+
550
+ :param id_param: Unique ID to PATCH
551
+ :param id:
552
+ :param conf:
553
+ :param retries: Override the default retry configuration for this method
554
+ :param server_url: Override the default server URL for this method
555
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
556
+ :param http_headers: Additional headers to set or replace on requests.
557
+ """
558
+ base_url = None
559
+ url_variables = None
560
+ if timeout_ms is None:
561
+ timeout_ms = self.sdk_configuration.timeout_ms
562
+
563
+ if server_url is not None:
564
+ base_url = server_url
565
+ else:
566
+ base_url = self._get_url(base_url, url_variables)
567
+
568
+ request = models.UpdatePipelineByIDRequest(
569
+ id_param=id_param,
570
+ pipeline=models.Pipeline(
571
+ id=id,
572
+ conf=utils.get_pydantic_model(conf, models.Conf),
573
+ ),
574
+ )
575
+
576
+ req = self._build_request(
577
+ method="PATCH",
578
+ path="/pipelines/{id}",
579
+ base_url=base_url,
580
+ url_variables=url_variables,
581
+ request=request,
582
+ request_body_required=True,
583
+ request_has_path_params=True,
584
+ request_has_query_params=True,
585
+ user_agent_header="user-agent",
586
+ accept_header_value="application/json",
587
+ http_headers=http_headers,
588
+ security=self.sdk_configuration.security,
589
+ get_serialized_body=lambda: utils.serialize_request_body(
590
+ request.pipeline, False, False, "json", models.Pipeline
591
+ ),
592
+ timeout_ms=timeout_ms,
593
+ )
594
+
595
+ if retries == UNSET:
596
+ if self.sdk_configuration.retry_config is not UNSET:
597
+ retries = self.sdk_configuration.retry_config
598
+
599
+ retry_config = None
600
+ if isinstance(retries, utils.RetryConfig):
601
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
602
+
603
+ http_res = self.do_request(
604
+ hook_ctx=HookContext(
605
+ config=self.sdk_configuration,
606
+ base_url=base_url or "",
607
+ operation_id="updatePipelineById",
608
+ oauth2_scopes=[],
609
+ security_source=get_security_from_env(
610
+ self.sdk_configuration.security, models.Security
611
+ ),
612
+ ),
613
+ request=req,
614
+ error_status_codes=["401", "4XX", "500", "5XX"],
615
+ retry_config=retry_config,
616
+ )
617
+
618
+ response_data: Any = None
619
+ if utils.match_response(http_res, "200", "application/json"):
620
+ return unmarshal_json_response(models.UpdatePipelineByIDResponse, http_res)
621
+ if utils.match_response(http_res, "500", "application/json"):
622
+ response_data = unmarshal_json_response(errors.ErrorData, http_res)
623
+ raise errors.Error(response_data, http_res)
624
+ if utils.match_response(http_res, ["401", "4XX"], "*"):
625
+ http_res_text = utils.stream_to_text(http_res)
626
+ raise errors.APIError("API error occurred", http_res, http_res_text)
627
+ if utils.match_response(http_res, "5XX", "*"):
628
+ http_res_text = utils.stream_to_text(http_res)
629
+ raise errors.APIError("API error occurred", http_res, http_res_text)
630
+
631
+ raise errors.APIError("Unexpected response received", http_res)
632
+
633
+ async def update_pipeline_by_id_async(
634
+ self,
635
+ *,
636
+ id_param: str,
637
+ id: str,
638
+ conf: Union[models.Conf, models.ConfTypedDict],
639
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
640
+ server_url: Optional[str] = None,
641
+ timeout_ms: Optional[int] = None,
642
+ http_headers: Optional[Mapping[str, str]] = None,
643
+ ) -> models.UpdatePipelineByIDResponse:
644
+ r"""Update Pipeline
645
+
646
+ Update Pipeline
647
+
648
+ :param id_param: Unique ID to PATCH
649
+ :param id:
650
+ :param conf:
651
+ :param retries: Override the default retry configuration for this method
652
+ :param server_url: Override the default server URL for this method
653
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
654
+ :param http_headers: Additional headers to set or replace on requests.
655
+ """
656
+ base_url = None
657
+ url_variables = None
658
+ if timeout_ms is None:
659
+ timeout_ms = self.sdk_configuration.timeout_ms
660
+
661
+ if server_url is not None:
662
+ base_url = server_url
663
+ else:
664
+ base_url = self._get_url(base_url, url_variables)
665
+
666
+ request = models.UpdatePipelineByIDRequest(
667
+ id_param=id_param,
668
+ pipeline=models.Pipeline(
669
+ id=id,
670
+ conf=utils.get_pydantic_model(conf, models.Conf),
671
+ ),
672
+ )
673
+
674
+ req = self._build_request_async(
675
+ method="PATCH",
676
+ path="/pipelines/{id}",
677
+ base_url=base_url,
678
+ url_variables=url_variables,
679
+ request=request,
680
+ request_body_required=True,
681
+ request_has_path_params=True,
682
+ request_has_query_params=True,
683
+ user_agent_header="user-agent",
684
+ accept_header_value="application/json",
685
+ http_headers=http_headers,
686
+ security=self.sdk_configuration.security,
687
+ get_serialized_body=lambda: utils.serialize_request_body(
688
+ request.pipeline, False, False, "json", models.Pipeline
689
+ ),
690
+ timeout_ms=timeout_ms,
691
+ )
692
+
693
+ if retries == UNSET:
694
+ if self.sdk_configuration.retry_config is not UNSET:
695
+ retries = self.sdk_configuration.retry_config
696
+
697
+ retry_config = None
698
+ if isinstance(retries, utils.RetryConfig):
699
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
700
+
701
+ http_res = await self.do_request_async(
702
+ hook_ctx=HookContext(
703
+ config=self.sdk_configuration,
704
+ base_url=base_url or "",
705
+ operation_id="updatePipelineById",
706
+ oauth2_scopes=[],
707
+ security_source=get_security_from_env(
708
+ self.sdk_configuration.security, models.Security
709
+ ),
710
+ ),
711
+ request=req,
712
+ error_status_codes=["401", "4XX", "500", "5XX"],
713
+ retry_config=retry_config,
714
+ )
715
+
716
+ response_data: Any = None
717
+ if utils.match_response(http_res, "200", "application/json"):
718
+ return unmarshal_json_response(models.UpdatePipelineByIDResponse, http_res)
719
+ if utils.match_response(http_res, "500", "application/json"):
720
+ response_data = unmarshal_json_response(errors.ErrorData, http_res)
721
+ raise errors.Error(response_data, http_res)
722
+ if utils.match_response(http_res, ["401", "4XX"], "*"):
723
+ http_res_text = await utils.stream_to_text_async(http_res)
724
+ raise errors.APIError("API error occurred", http_res, http_res_text)
725
+ if utils.match_response(http_res, "5XX", "*"):
726
+ http_res_text = await utils.stream_to_text_async(http_res)
727
+ raise errors.APIError("API error occurred", http_res, http_res_text)
728
+
729
+ raise errors.APIError("Unexpected response received", http_res)
730
+
731
+ def delete_pipeline_by_id(
732
+ self,
733
+ *,
734
+ id: str,
735
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
736
+ server_url: Optional[str] = None,
737
+ timeout_ms: Optional[int] = None,
738
+ http_headers: Optional[Mapping[str, str]] = None,
739
+ ) -> models.DeletePipelineByIDResponse:
740
+ r"""Delete Pipeline
741
+
742
+ Delete Pipeline
743
+
744
+ :param id: Unique ID to DELETE
745
+ :param retries: Override the default retry configuration for this method
746
+ :param server_url: Override the default server URL for this method
747
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
748
+ :param http_headers: Additional headers to set or replace on requests.
749
+ """
750
+ base_url = None
751
+ url_variables = None
752
+ if timeout_ms is None:
753
+ timeout_ms = self.sdk_configuration.timeout_ms
754
+
755
+ if server_url is not None:
756
+ base_url = server_url
757
+ else:
758
+ base_url = self._get_url(base_url, url_variables)
759
+
760
+ request = models.DeletePipelineByIDRequest(
761
+ id=id,
762
+ )
763
+
764
+ req = self._build_request(
765
+ method="DELETE",
766
+ path="/pipelines/{id}",
767
+ base_url=base_url,
768
+ url_variables=url_variables,
769
+ request=request,
770
+ request_body_required=False,
771
+ request_has_path_params=True,
772
+ request_has_query_params=True,
773
+ user_agent_header="user-agent",
774
+ accept_header_value="application/json",
775
+ http_headers=http_headers,
776
+ security=self.sdk_configuration.security,
777
+ timeout_ms=timeout_ms,
778
+ )
779
+
780
+ if retries == UNSET:
781
+ if self.sdk_configuration.retry_config is not UNSET:
782
+ retries = self.sdk_configuration.retry_config
783
+
784
+ retry_config = None
785
+ if isinstance(retries, utils.RetryConfig):
786
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
787
+
788
+ http_res = self.do_request(
789
+ hook_ctx=HookContext(
790
+ config=self.sdk_configuration,
791
+ base_url=base_url or "",
792
+ operation_id="deletePipelineById",
793
+ oauth2_scopes=[],
794
+ security_source=get_security_from_env(
795
+ self.sdk_configuration.security, models.Security
796
+ ),
797
+ ),
798
+ request=req,
799
+ error_status_codes=["401", "4XX", "500", "5XX"],
800
+ retry_config=retry_config,
801
+ )
802
+
803
+ response_data: Any = None
804
+ if utils.match_response(http_res, "200", "application/json"):
805
+ return unmarshal_json_response(models.DeletePipelineByIDResponse, http_res)
806
+ if utils.match_response(http_res, "500", "application/json"):
807
+ response_data = unmarshal_json_response(errors.ErrorData, http_res)
808
+ raise errors.Error(response_data, http_res)
809
+ if utils.match_response(http_res, ["401", "4XX"], "*"):
810
+ http_res_text = utils.stream_to_text(http_res)
811
+ raise errors.APIError("API error occurred", http_res, http_res_text)
812
+ if utils.match_response(http_res, "5XX", "*"):
813
+ http_res_text = utils.stream_to_text(http_res)
814
+ raise errors.APIError("API error occurred", http_res, http_res_text)
815
+
816
+ raise errors.APIError("Unexpected response received", http_res)
817
+
818
+ async def delete_pipeline_by_id_async(
819
+ self,
820
+ *,
821
+ id: str,
822
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
823
+ server_url: Optional[str] = None,
824
+ timeout_ms: Optional[int] = None,
825
+ http_headers: Optional[Mapping[str, str]] = None,
826
+ ) -> models.DeletePipelineByIDResponse:
827
+ r"""Delete Pipeline
828
+
829
+ Delete Pipeline
830
+
831
+ :param id: Unique ID to DELETE
832
+ :param retries: Override the default retry configuration for this method
833
+ :param server_url: Override the default server URL for this method
834
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
835
+ :param http_headers: Additional headers to set or replace on requests.
836
+ """
837
+ base_url = None
838
+ url_variables = None
839
+ if timeout_ms is None:
840
+ timeout_ms = self.sdk_configuration.timeout_ms
841
+
842
+ if server_url is not None:
843
+ base_url = server_url
844
+ else:
845
+ base_url = self._get_url(base_url, url_variables)
846
+
847
+ request = models.DeletePipelineByIDRequest(
848
+ id=id,
849
+ )
850
+
851
+ req = self._build_request_async(
852
+ method="DELETE",
853
+ path="/pipelines/{id}",
854
+ base_url=base_url,
855
+ url_variables=url_variables,
856
+ request=request,
857
+ request_body_required=False,
858
+ request_has_path_params=True,
859
+ request_has_query_params=True,
860
+ user_agent_header="user-agent",
861
+ accept_header_value="application/json",
862
+ http_headers=http_headers,
863
+ security=self.sdk_configuration.security,
864
+ timeout_ms=timeout_ms,
865
+ )
866
+
867
+ if retries == UNSET:
868
+ if self.sdk_configuration.retry_config is not UNSET:
869
+ retries = self.sdk_configuration.retry_config
870
+
871
+ retry_config = None
872
+ if isinstance(retries, utils.RetryConfig):
873
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
874
+
875
+ http_res = await self.do_request_async(
876
+ hook_ctx=HookContext(
877
+ config=self.sdk_configuration,
878
+ base_url=base_url or "",
879
+ operation_id="deletePipelineById",
880
+ oauth2_scopes=[],
881
+ security_source=get_security_from_env(
882
+ self.sdk_configuration.security, models.Security
883
+ ),
884
+ ),
885
+ request=req,
886
+ error_status_codes=["401", "4XX", "500", "5XX"],
887
+ retry_config=retry_config,
888
+ )
889
+
890
+ response_data: Any = None
891
+ if utils.match_response(http_res, "200", "application/json"):
892
+ return unmarshal_json_response(models.DeletePipelineByIDResponse, http_res)
893
+ if utils.match_response(http_res, "500", "application/json"):
894
+ response_data = unmarshal_json_response(errors.ErrorData, http_res)
895
+ raise errors.Error(response_data, http_res)
896
+ if utils.match_response(http_res, ["401", "4XX"], "*"):
897
+ http_res_text = await utils.stream_to_text_async(http_res)
898
+ raise errors.APIError("API error occurred", http_res, http_res_text)
899
+ if utils.match_response(http_res, "5XX", "*"):
900
+ http_res_text = await utils.stream_to_text_async(http_res)
901
+ raise errors.APIError("API error occurred", http_res, http_res_text)
902
+
903
+ raise errors.APIError("Unexpected response received", http_res)