langflow-control-plane-sdk 0.0.0.dev0__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 (26) hide show
  1. langflow_control_plane_sdk/__init__.py +72 -0
  2. langflow_control_plane_sdk/api/__init__.py +5 -0
  3. langflow_control_plane_sdk/api/deployments_api.py +1846 -0
  4. langflow_control_plane_sdk/api_client.py +822 -0
  5. langflow_control_plane_sdk/api_response.py +21 -0
  6. langflow_control_plane_sdk/configuration.py +625 -0
  7. langflow_control_plane_sdk/exceptions.py +218 -0
  8. langflow_control_plane_sdk/models/__init__.py +28 -0
  9. langflow_control_plane_sdk/models/create_deployment.py +108 -0
  10. langflow_control_plane_sdk/models/deployment_detail.py +105 -0
  11. langflow_control_plane_sdk/models/deployment_list.py +103 -0
  12. langflow_control_plane_sdk/models/deployment_list_item.py +103 -0
  13. langflow_control_plane_sdk/models/error_body.py +96 -0
  14. langflow_control_plane_sdk/models/error_code.py +57 -0
  15. langflow_control_plane_sdk/models/error_envelope.py +92 -0
  16. langflow_control_plane_sdk/models/flow_input.py +104 -0
  17. langflow_control_plane_sdk/models/flow_payload.py +105 -0
  18. langflow_control_plane_sdk/models/flow_payload_data.py +103 -0
  19. langflow_control_plane_sdk/models/patch_deployment.py +89 -0
  20. langflow_control_plane_sdk/models/replace_deployment.py +99 -0
  21. langflow_control_plane_sdk/py.typed +0 -0
  22. langflow_control_plane_sdk/rest.py +201 -0
  23. langflow_control_plane_sdk-0.0.0.dev0.dist-info/METADATA +142 -0
  24. langflow_control_plane_sdk-0.0.0.dev0.dist-info/RECORD +26 -0
  25. langflow_control_plane_sdk-0.0.0.dev0.dist-info/WHEEL +4 -0
  26. langflow_control_plane_sdk-0.0.0.dev0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,1846 @@
1
+ """
2
+ Langflow Control Plane API
3
+
4
+ Manage Langflow Runtime Deployments.
5
+
6
+ The version of the OpenAPI document: 0.0
7
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+
9
+ Do not edit the class manually.
10
+ """ # noqa: E501
11
+
12
+
13
+ import warnings
14
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+ from typing_extensions import Annotated
17
+
18
+ from pydantic import Field, StrictStr, field_validator
19
+ from typing import Optional
20
+ from typing_extensions import Annotated
21
+ from uuid import UUID
22
+ from langflow_control_plane_sdk.models.create_deployment import CreateDeployment
23
+ from langflow_control_plane_sdk.models.deployment_detail import DeploymentDetail
24
+ from langflow_control_plane_sdk.models.deployment_list import DeploymentList
25
+ from langflow_control_plane_sdk.models.patch_deployment import PatchDeployment
26
+ from langflow_control_plane_sdk.models.replace_deployment import ReplaceDeployment
27
+
28
+ from langflow_control_plane_sdk.api_client import ApiClient, RequestSerialized
29
+ from langflow_control_plane_sdk.api_response import ApiResponse
30
+ from langflow_control_plane_sdk.rest import RESTResponseType
31
+
32
+
33
+ class DeploymentsApi:
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
+ async def create_deployment(
48
+ self,
49
+ create_deployment: CreateDeployment,
50
+ _request_timeout: Union[
51
+ None,
52
+ Annotated[StrictFloat, Field(gt=0)],
53
+ Tuple[
54
+ Annotated[StrictFloat, Field(gt=0)],
55
+ Annotated[StrictFloat, Field(gt=0)]
56
+ ]
57
+ ] = None,
58
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
59
+ _content_type: Optional[StrictStr] = None,
60
+ _headers: Optional[Dict[StrictStr, Any]] = None,
61
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
62
+ ) -> DeploymentDetail:
63
+ """Create a Deployment and its Flows
64
+
65
+ Creates the Deployment resource. Provisioning may take effect asynchronously.
66
+
67
+ :param create_deployment: (required)
68
+ :type create_deployment: CreateDeployment
69
+ :param _request_timeout: timeout setting for this request. If one
70
+ number provided, it will be total request
71
+ timeout. It can also be a pair (tuple) of
72
+ (connection, read) timeouts.
73
+ :type _request_timeout: int, tuple(int, int), optional
74
+ :param _request_auth: set to override the auth_settings for an a single
75
+ request; this effectively ignores the
76
+ authentication in the spec for a single request.
77
+ :type _request_auth: dict, optional
78
+ :param _content_type: force content-type for the request.
79
+ :type _content_type: str, Optional
80
+ :param _headers: set to override the headers for a single
81
+ request; this effectively ignores the headers
82
+ in the spec for a single request.
83
+ :type _headers: dict, optional
84
+ :param _host_index: set to override the host_index for a single
85
+ request; this effectively ignores the host_index
86
+ in the spec for a single request.
87
+ :type _host_index: int, optional
88
+ :return: Returns the result object.
89
+ """ # noqa: E501
90
+
91
+ _param = self._create_deployment_serialize(
92
+ create_deployment=create_deployment,
93
+ _request_auth=_request_auth,
94
+ _content_type=_content_type,
95
+ _headers=_headers,
96
+ _host_index=_host_index
97
+ )
98
+
99
+ _response_types_map: Dict[str, Optional[str]] = {
100
+ '201': "DeploymentDetail",
101
+ '400': "ErrorEnvelope",
102
+ '401': "ErrorEnvelope",
103
+ '403': "ErrorEnvelope",
104
+ '409': "ErrorEnvelope",
105
+ '413': "ErrorEnvelope",
106
+ '422': "ErrorEnvelope",
107
+ '429': "ErrorEnvelope",
108
+ '500': "ErrorEnvelope",
109
+ '503': "ErrorEnvelope",
110
+ }
111
+ response_data = await self.api_client.call_api(
112
+ *_param,
113
+ _request_timeout=_request_timeout
114
+ )
115
+ await response_data.read()
116
+ return self.api_client.response_deserialize(
117
+ response_data=response_data,
118
+ response_types_map=_response_types_map,
119
+ ).data
120
+
121
+
122
+ @validate_call
123
+ async def create_deployment_with_http_info(
124
+ self,
125
+ create_deployment: CreateDeployment,
126
+ _request_timeout: Union[
127
+ None,
128
+ Annotated[StrictFloat, Field(gt=0)],
129
+ Tuple[
130
+ Annotated[StrictFloat, Field(gt=0)],
131
+ Annotated[StrictFloat, Field(gt=0)]
132
+ ]
133
+ ] = None,
134
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
135
+ _content_type: Optional[StrictStr] = None,
136
+ _headers: Optional[Dict[StrictStr, Any]] = None,
137
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
138
+ ) -> ApiResponse[DeploymentDetail]:
139
+ """Create a Deployment and its Flows
140
+
141
+ Creates the Deployment resource. Provisioning may take effect asynchronously.
142
+
143
+ :param create_deployment: (required)
144
+ :type create_deployment: CreateDeployment
145
+ :param _request_timeout: timeout setting for this request. If one
146
+ number provided, it will be total request
147
+ timeout. It can also be a pair (tuple) of
148
+ (connection, read) timeouts.
149
+ :type _request_timeout: int, tuple(int, int), optional
150
+ :param _request_auth: set to override the auth_settings for an a single
151
+ request; this effectively ignores the
152
+ authentication in the spec for a single request.
153
+ :type _request_auth: dict, optional
154
+ :param _content_type: force content-type for the request.
155
+ :type _content_type: str, Optional
156
+ :param _headers: set to override the headers for a single
157
+ request; this effectively ignores the headers
158
+ in the spec for a single request.
159
+ :type _headers: dict, optional
160
+ :param _host_index: set to override the host_index for a single
161
+ request; this effectively ignores the host_index
162
+ in the spec for a single request.
163
+ :type _host_index: int, optional
164
+ :return: Returns the result object.
165
+ """ # noqa: E501
166
+
167
+ _param = self._create_deployment_serialize(
168
+ create_deployment=create_deployment,
169
+ _request_auth=_request_auth,
170
+ _content_type=_content_type,
171
+ _headers=_headers,
172
+ _host_index=_host_index
173
+ )
174
+
175
+ _response_types_map: Dict[str, Optional[str]] = {
176
+ '201': "DeploymentDetail",
177
+ '400': "ErrorEnvelope",
178
+ '401': "ErrorEnvelope",
179
+ '403': "ErrorEnvelope",
180
+ '409': "ErrorEnvelope",
181
+ '413': "ErrorEnvelope",
182
+ '422': "ErrorEnvelope",
183
+ '429': "ErrorEnvelope",
184
+ '500': "ErrorEnvelope",
185
+ '503': "ErrorEnvelope",
186
+ }
187
+ response_data = await self.api_client.call_api(
188
+ *_param,
189
+ _request_timeout=_request_timeout
190
+ )
191
+ await response_data.read()
192
+ return self.api_client.response_deserialize(
193
+ response_data=response_data,
194
+ response_types_map=_response_types_map,
195
+ )
196
+
197
+
198
+ @validate_call
199
+ async def create_deployment_without_preload_content(
200
+ self,
201
+ create_deployment: CreateDeployment,
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
+ """Create a Deployment and its Flows
216
+
217
+ Creates the Deployment resource. Provisioning may take effect asynchronously.
218
+
219
+ :param create_deployment: (required)
220
+ :type create_deployment: CreateDeployment
221
+ :param _request_timeout: timeout setting for this request. If one
222
+ number provided, it will be total request
223
+ timeout. It can also be a pair (tuple) of
224
+ (connection, read) timeouts.
225
+ :type _request_timeout: int, tuple(int, int), optional
226
+ :param _request_auth: set to override the auth_settings for an a single
227
+ request; this effectively ignores the
228
+ authentication in the spec for a single request.
229
+ :type _request_auth: dict, optional
230
+ :param _content_type: force content-type for the request.
231
+ :type _content_type: str, Optional
232
+ :param _headers: set to override the headers for a single
233
+ request; this effectively ignores the headers
234
+ in the spec for a single request.
235
+ :type _headers: dict, optional
236
+ :param _host_index: set to override the host_index for a single
237
+ request; this effectively ignores the host_index
238
+ in the spec for a single request.
239
+ :type _host_index: int, optional
240
+ :return: Returns the result object.
241
+ """ # noqa: E501
242
+
243
+ _param = self._create_deployment_serialize(
244
+ create_deployment=create_deployment,
245
+ _request_auth=_request_auth,
246
+ _content_type=_content_type,
247
+ _headers=_headers,
248
+ _host_index=_host_index
249
+ )
250
+
251
+ _response_types_map: Dict[str, Optional[str]] = {
252
+ '201': "DeploymentDetail",
253
+ '400': "ErrorEnvelope",
254
+ '401': "ErrorEnvelope",
255
+ '403': "ErrorEnvelope",
256
+ '409': "ErrorEnvelope",
257
+ '413': "ErrorEnvelope",
258
+ '422': "ErrorEnvelope",
259
+ '429': "ErrorEnvelope",
260
+ '500': "ErrorEnvelope",
261
+ '503': "ErrorEnvelope",
262
+ }
263
+ response_data = await self.api_client.call_api(
264
+ *_param,
265
+ _request_timeout=_request_timeout
266
+ )
267
+ return response_data.response
268
+
269
+
270
+ def _create_deployment_serialize(
271
+ self,
272
+ create_deployment,
273
+ _request_auth,
274
+ _content_type,
275
+ _headers,
276
+ _host_index,
277
+ ) -> RequestSerialized:
278
+
279
+ _host = None
280
+
281
+ _collection_formats: Dict[str, str] = {
282
+ }
283
+
284
+ _path_params: Dict[str, str] = {}
285
+ _query_params: List[Tuple[str, str]] = []
286
+ _header_params: Dict[str, Optional[str]] = _headers or {}
287
+ _form_params: List[Tuple[str, str]] = []
288
+ _files: Dict[
289
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
290
+ ] = {}
291
+ _body_params: Optional[bytes] = None
292
+
293
+ # process the path parameters
294
+ # process the query parameters
295
+ # process the header parameters
296
+ # process the form parameters
297
+ # process the body parameter
298
+ if create_deployment is not None:
299
+ _body_params = create_deployment
300
+
301
+
302
+ # set the HTTP header `Accept`
303
+ if 'Accept' not in _header_params:
304
+ _header_params['Accept'] = self.api_client.select_header_accept(
305
+ [
306
+ 'application/json'
307
+ ]
308
+ )
309
+
310
+ # set the HTTP header `Content-Type`
311
+ if _content_type:
312
+ _header_params['Content-Type'] = _content_type
313
+ else:
314
+ _default_content_type = (
315
+ self.api_client.select_header_content_type(
316
+ [
317
+ 'application/json'
318
+ ]
319
+ )
320
+ )
321
+ if _default_content_type is not None:
322
+ _header_params['Content-Type'] = _default_content_type
323
+
324
+ # authentication setting
325
+ _auth_settings: List[str] = [
326
+ 'LangflowAPIKey'
327
+ ]
328
+
329
+ return self.api_client.param_serialize(
330
+ method='POST',
331
+ resource_path='/api/v1/deployments',
332
+ path_params=_path_params,
333
+ query_params=_query_params,
334
+ header_params=_header_params,
335
+ body=_body_params,
336
+ post_params=_form_params,
337
+ files=_files,
338
+ auth_settings=_auth_settings,
339
+ collection_formats=_collection_formats,
340
+ _host=_host,
341
+ _request_auth=_request_auth
342
+ )
343
+
344
+
345
+
346
+
347
+ @validate_call
348
+ async def delete_deployment(
349
+ self,
350
+ deployment_id: UUID,
351
+ _request_timeout: Union[
352
+ None,
353
+ Annotated[StrictFloat, Field(gt=0)],
354
+ Tuple[
355
+ Annotated[StrictFloat, Field(gt=0)],
356
+ Annotated[StrictFloat, Field(gt=0)]
357
+ ]
358
+ ] = None,
359
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
360
+ _content_type: Optional[StrictStr] = None,
361
+ _headers: Optional[Dict[StrictStr, Any]] = None,
362
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
363
+ ) -> None:
364
+ """Delete a Deployment and its owned Flows
365
+
366
+ Deletes the Deployment record. May take effect in runtime asynchronously.
367
+
368
+ :param deployment_id: (required)
369
+ :type deployment_id: UUID
370
+ :param _request_timeout: timeout setting for this request. If one
371
+ number provided, it will be total request
372
+ timeout. It can also be a pair (tuple) of
373
+ (connection, read) timeouts.
374
+ :type _request_timeout: int, tuple(int, int), optional
375
+ :param _request_auth: set to override the auth_settings for an a single
376
+ request; this effectively ignores the
377
+ authentication in the spec for a single request.
378
+ :type _request_auth: dict, optional
379
+ :param _content_type: force content-type for the request.
380
+ :type _content_type: str, Optional
381
+ :param _headers: set to override the headers for a single
382
+ request; this effectively ignores the headers
383
+ in the spec for a single request.
384
+ :type _headers: dict, optional
385
+ :param _host_index: set to override the host_index for a single
386
+ request; this effectively ignores the host_index
387
+ in the spec for a single request.
388
+ :type _host_index: int, optional
389
+ :return: Returns the result object.
390
+ """ # noqa: E501
391
+
392
+ _param = self._delete_deployment_serialize(
393
+ deployment_id=deployment_id,
394
+ _request_auth=_request_auth,
395
+ _content_type=_content_type,
396
+ _headers=_headers,
397
+ _host_index=_host_index
398
+ )
399
+
400
+ _response_types_map: Dict[str, Optional[str]] = {
401
+ '200': None,
402
+ '401': "ErrorEnvelope",
403
+ '403': "ErrorEnvelope",
404
+ '404': "ErrorEnvelope",
405
+ '429': "ErrorEnvelope",
406
+ '500': "ErrorEnvelope",
407
+ '503': "ErrorEnvelope",
408
+ }
409
+ response_data = await self.api_client.call_api(
410
+ *_param,
411
+ _request_timeout=_request_timeout
412
+ )
413
+ await response_data.read()
414
+ return self.api_client.response_deserialize(
415
+ response_data=response_data,
416
+ response_types_map=_response_types_map,
417
+ ).data
418
+
419
+
420
+ @validate_call
421
+ async def delete_deployment_with_http_info(
422
+ self,
423
+ deployment_id: UUID,
424
+ _request_timeout: Union[
425
+ None,
426
+ Annotated[StrictFloat, Field(gt=0)],
427
+ Tuple[
428
+ Annotated[StrictFloat, Field(gt=0)],
429
+ Annotated[StrictFloat, Field(gt=0)]
430
+ ]
431
+ ] = None,
432
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
433
+ _content_type: Optional[StrictStr] = None,
434
+ _headers: Optional[Dict[StrictStr, Any]] = None,
435
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
436
+ ) -> ApiResponse[None]:
437
+ """Delete a Deployment and its owned Flows
438
+
439
+ Deletes the Deployment record. May take effect in runtime asynchronously.
440
+
441
+ :param deployment_id: (required)
442
+ :type deployment_id: UUID
443
+ :param _request_timeout: timeout setting for this request. If one
444
+ number provided, it will be total request
445
+ timeout. It can also be a pair (tuple) of
446
+ (connection, read) timeouts.
447
+ :type _request_timeout: int, tuple(int, int), optional
448
+ :param _request_auth: set to override the auth_settings for an a single
449
+ request; this effectively ignores the
450
+ authentication in the spec for a single request.
451
+ :type _request_auth: dict, optional
452
+ :param _content_type: force content-type for the request.
453
+ :type _content_type: str, Optional
454
+ :param _headers: set to override the headers for a single
455
+ request; this effectively ignores the headers
456
+ in the spec for a single request.
457
+ :type _headers: dict, optional
458
+ :param _host_index: set to override the host_index for a single
459
+ request; this effectively ignores the host_index
460
+ in the spec for a single request.
461
+ :type _host_index: int, optional
462
+ :return: Returns the result object.
463
+ """ # noqa: E501
464
+
465
+ _param = self._delete_deployment_serialize(
466
+ deployment_id=deployment_id,
467
+ _request_auth=_request_auth,
468
+ _content_type=_content_type,
469
+ _headers=_headers,
470
+ _host_index=_host_index
471
+ )
472
+
473
+ _response_types_map: Dict[str, Optional[str]] = {
474
+ '200': None,
475
+ '401': "ErrorEnvelope",
476
+ '403': "ErrorEnvelope",
477
+ '404': "ErrorEnvelope",
478
+ '429': "ErrorEnvelope",
479
+ '500': "ErrorEnvelope",
480
+ '503': "ErrorEnvelope",
481
+ }
482
+ response_data = await self.api_client.call_api(
483
+ *_param,
484
+ _request_timeout=_request_timeout
485
+ )
486
+ await response_data.read()
487
+ return self.api_client.response_deserialize(
488
+ response_data=response_data,
489
+ response_types_map=_response_types_map,
490
+ )
491
+
492
+
493
+ @validate_call
494
+ async def delete_deployment_without_preload_content(
495
+ self,
496
+ deployment_id: UUID,
497
+ _request_timeout: Union[
498
+ None,
499
+ Annotated[StrictFloat, Field(gt=0)],
500
+ Tuple[
501
+ Annotated[StrictFloat, Field(gt=0)],
502
+ Annotated[StrictFloat, Field(gt=0)]
503
+ ]
504
+ ] = None,
505
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
506
+ _content_type: Optional[StrictStr] = None,
507
+ _headers: Optional[Dict[StrictStr, Any]] = None,
508
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
509
+ ) -> RESTResponseType:
510
+ """Delete a Deployment and its owned Flows
511
+
512
+ Deletes the Deployment record. May take effect in runtime asynchronously.
513
+
514
+ :param deployment_id: (required)
515
+ :type deployment_id: UUID
516
+ :param _request_timeout: timeout setting for this request. If one
517
+ number provided, it will be total request
518
+ timeout. It can also be a pair (tuple) of
519
+ (connection, read) timeouts.
520
+ :type _request_timeout: int, tuple(int, int), optional
521
+ :param _request_auth: set to override the auth_settings for an a single
522
+ request; this effectively ignores the
523
+ authentication in the spec for a single request.
524
+ :type _request_auth: dict, optional
525
+ :param _content_type: force content-type for the request.
526
+ :type _content_type: str, Optional
527
+ :param _headers: set to override the headers for a single
528
+ request; this effectively ignores the headers
529
+ in the spec for a single request.
530
+ :type _headers: dict, optional
531
+ :param _host_index: set to override the host_index for a single
532
+ request; this effectively ignores the host_index
533
+ in the spec for a single request.
534
+ :type _host_index: int, optional
535
+ :return: Returns the result object.
536
+ """ # noqa: E501
537
+
538
+ _param = self._delete_deployment_serialize(
539
+ deployment_id=deployment_id,
540
+ _request_auth=_request_auth,
541
+ _content_type=_content_type,
542
+ _headers=_headers,
543
+ _host_index=_host_index
544
+ )
545
+
546
+ _response_types_map: Dict[str, Optional[str]] = {
547
+ '200': None,
548
+ '401': "ErrorEnvelope",
549
+ '403': "ErrorEnvelope",
550
+ '404': "ErrorEnvelope",
551
+ '429': "ErrorEnvelope",
552
+ '500': "ErrorEnvelope",
553
+ '503': "ErrorEnvelope",
554
+ }
555
+ response_data = await self.api_client.call_api(
556
+ *_param,
557
+ _request_timeout=_request_timeout
558
+ )
559
+ return response_data.response
560
+
561
+
562
+ def _delete_deployment_serialize(
563
+ self,
564
+ deployment_id,
565
+ _request_auth,
566
+ _content_type,
567
+ _headers,
568
+ _host_index,
569
+ ) -> RequestSerialized:
570
+
571
+ _host = None
572
+
573
+ _collection_formats: Dict[str, str] = {
574
+ }
575
+
576
+ _path_params: Dict[str, str] = {}
577
+ _query_params: List[Tuple[str, str]] = []
578
+ _header_params: Dict[str, Optional[str]] = _headers or {}
579
+ _form_params: List[Tuple[str, str]] = []
580
+ _files: Dict[
581
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
582
+ ] = {}
583
+ _body_params: Optional[bytes] = None
584
+
585
+ # process the path parameters
586
+ if deployment_id is not None:
587
+ _path_params['deploymentId'] = deployment_id
588
+ # process the query parameters
589
+ # process the header parameters
590
+ # process the form parameters
591
+ # process the body parameter
592
+
593
+
594
+ # set the HTTP header `Accept`
595
+ if 'Accept' not in _header_params:
596
+ _header_params['Accept'] = self.api_client.select_header_accept(
597
+ [
598
+ 'application/json'
599
+ ]
600
+ )
601
+
602
+
603
+ # authentication setting
604
+ _auth_settings: List[str] = [
605
+ 'LangflowAPIKey'
606
+ ]
607
+
608
+ return self.api_client.param_serialize(
609
+ method='DELETE',
610
+ resource_path='/api/v1/deployments/{deploymentId}',
611
+ path_params=_path_params,
612
+ query_params=_query_params,
613
+ header_params=_header_params,
614
+ body=_body_params,
615
+ post_params=_form_params,
616
+ files=_files,
617
+ auth_settings=_auth_settings,
618
+ collection_formats=_collection_formats,
619
+ _host=_host,
620
+ _request_auth=_request_auth
621
+ )
622
+
623
+
624
+
625
+
626
+ @validate_call
627
+ async def get_deployment(
628
+ self,
629
+ deployment_id: UUID,
630
+ _request_timeout: Union[
631
+ None,
632
+ Annotated[StrictFloat, Field(gt=0)],
633
+ Tuple[
634
+ Annotated[StrictFloat, Field(gt=0)],
635
+ Annotated[StrictFloat, Field(gt=0)]
636
+ ]
637
+ ] = None,
638
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
639
+ _content_type: Optional[StrictStr] = None,
640
+ _headers: Optional[Dict[StrictStr, Any]] = None,
641
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
642
+ ) -> DeploymentDetail:
643
+ """Get a Deployment and current Flow membership
644
+
645
+
646
+ :param deployment_id: (required)
647
+ :type deployment_id: UUID
648
+ :param _request_timeout: timeout setting for this request. If one
649
+ number provided, it will be total request
650
+ timeout. It can also be a pair (tuple) of
651
+ (connection, read) timeouts.
652
+ :type _request_timeout: int, tuple(int, int), optional
653
+ :param _request_auth: set to override the auth_settings for an a single
654
+ request; this effectively ignores the
655
+ authentication in the spec for a single request.
656
+ :type _request_auth: dict, optional
657
+ :param _content_type: force content-type for the request.
658
+ :type _content_type: str, Optional
659
+ :param _headers: set to override the headers for a single
660
+ request; this effectively ignores the headers
661
+ in the spec for a single request.
662
+ :type _headers: dict, optional
663
+ :param _host_index: set to override the host_index for a single
664
+ request; this effectively ignores the host_index
665
+ in the spec for a single request.
666
+ :type _host_index: int, optional
667
+ :return: Returns the result object.
668
+ """ # noqa: E501
669
+
670
+ _param = self._get_deployment_serialize(
671
+ deployment_id=deployment_id,
672
+ _request_auth=_request_auth,
673
+ _content_type=_content_type,
674
+ _headers=_headers,
675
+ _host_index=_host_index
676
+ )
677
+
678
+ _response_types_map: Dict[str, Optional[str]] = {
679
+ '200': "DeploymentDetail",
680
+ '401': "ErrorEnvelope",
681
+ '403': "ErrorEnvelope",
682
+ '404': "ErrorEnvelope",
683
+ '429': "ErrorEnvelope",
684
+ '500': "ErrorEnvelope",
685
+ '503': "ErrorEnvelope",
686
+ }
687
+ response_data = await self.api_client.call_api(
688
+ *_param,
689
+ _request_timeout=_request_timeout
690
+ )
691
+ await response_data.read()
692
+ return self.api_client.response_deserialize(
693
+ response_data=response_data,
694
+ response_types_map=_response_types_map,
695
+ ).data
696
+
697
+
698
+ @validate_call
699
+ async def get_deployment_with_http_info(
700
+ self,
701
+ deployment_id: UUID,
702
+ _request_timeout: Union[
703
+ None,
704
+ Annotated[StrictFloat, Field(gt=0)],
705
+ Tuple[
706
+ Annotated[StrictFloat, Field(gt=0)],
707
+ Annotated[StrictFloat, Field(gt=0)]
708
+ ]
709
+ ] = None,
710
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
711
+ _content_type: Optional[StrictStr] = None,
712
+ _headers: Optional[Dict[StrictStr, Any]] = None,
713
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
714
+ ) -> ApiResponse[DeploymentDetail]:
715
+ """Get a Deployment and current Flow membership
716
+
717
+
718
+ :param deployment_id: (required)
719
+ :type deployment_id: UUID
720
+ :param _request_timeout: timeout setting for this request. If one
721
+ number provided, it will be total request
722
+ timeout. It can also be a pair (tuple) of
723
+ (connection, read) timeouts.
724
+ :type _request_timeout: int, tuple(int, int), optional
725
+ :param _request_auth: set to override the auth_settings for an a single
726
+ request; this effectively ignores the
727
+ authentication in the spec for a single request.
728
+ :type _request_auth: dict, optional
729
+ :param _content_type: force content-type for the request.
730
+ :type _content_type: str, Optional
731
+ :param _headers: set to override the headers for a single
732
+ request; this effectively ignores the headers
733
+ in the spec for a single request.
734
+ :type _headers: dict, optional
735
+ :param _host_index: set to override the host_index for a single
736
+ request; this effectively ignores the host_index
737
+ in the spec for a single request.
738
+ :type _host_index: int, optional
739
+ :return: Returns the result object.
740
+ """ # noqa: E501
741
+
742
+ _param = self._get_deployment_serialize(
743
+ deployment_id=deployment_id,
744
+ _request_auth=_request_auth,
745
+ _content_type=_content_type,
746
+ _headers=_headers,
747
+ _host_index=_host_index
748
+ )
749
+
750
+ _response_types_map: Dict[str, Optional[str]] = {
751
+ '200': "DeploymentDetail",
752
+ '401': "ErrorEnvelope",
753
+ '403': "ErrorEnvelope",
754
+ '404': "ErrorEnvelope",
755
+ '429': "ErrorEnvelope",
756
+ '500': "ErrorEnvelope",
757
+ '503': "ErrorEnvelope",
758
+ }
759
+ response_data = await self.api_client.call_api(
760
+ *_param,
761
+ _request_timeout=_request_timeout
762
+ )
763
+ await response_data.read()
764
+ return self.api_client.response_deserialize(
765
+ response_data=response_data,
766
+ response_types_map=_response_types_map,
767
+ )
768
+
769
+
770
+ @validate_call
771
+ async def get_deployment_without_preload_content(
772
+ self,
773
+ deployment_id: UUID,
774
+ _request_timeout: Union[
775
+ None,
776
+ Annotated[StrictFloat, Field(gt=0)],
777
+ Tuple[
778
+ Annotated[StrictFloat, Field(gt=0)],
779
+ Annotated[StrictFloat, Field(gt=0)]
780
+ ]
781
+ ] = None,
782
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
783
+ _content_type: Optional[StrictStr] = None,
784
+ _headers: Optional[Dict[StrictStr, Any]] = None,
785
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
786
+ ) -> RESTResponseType:
787
+ """Get a Deployment and current Flow membership
788
+
789
+
790
+ :param deployment_id: (required)
791
+ :type deployment_id: UUID
792
+ :param _request_timeout: timeout setting for this request. If one
793
+ number provided, it will be total request
794
+ timeout. It can also be a pair (tuple) of
795
+ (connection, read) timeouts.
796
+ :type _request_timeout: int, tuple(int, int), optional
797
+ :param _request_auth: set to override the auth_settings for an a single
798
+ request; this effectively ignores the
799
+ authentication in the spec for a single request.
800
+ :type _request_auth: dict, optional
801
+ :param _content_type: force content-type for the request.
802
+ :type _content_type: str, Optional
803
+ :param _headers: set to override the headers for a single
804
+ request; this effectively ignores the headers
805
+ in the spec for a single request.
806
+ :type _headers: dict, optional
807
+ :param _host_index: set to override the host_index for a single
808
+ request; this effectively ignores the host_index
809
+ in the spec for a single request.
810
+ :type _host_index: int, optional
811
+ :return: Returns the result object.
812
+ """ # noqa: E501
813
+
814
+ _param = self._get_deployment_serialize(
815
+ deployment_id=deployment_id,
816
+ _request_auth=_request_auth,
817
+ _content_type=_content_type,
818
+ _headers=_headers,
819
+ _host_index=_host_index
820
+ )
821
+
822
+ _response_types_map: Dict[str, Optional[str]] = {
823
+ '200': "DeploymentDetail",
824
+ '401': "ErrorEnvelope",
825
+ '403': "ErrorEnvelope",
826
+ '404': "ErrorEnvelope",
827
+ '429': "ErrorEnvelope",
828
+ '500': "ErrorEnvelope",
829
+ '503': "ErrorEnvelope",
830
+ }
831
+ response_data = await self.api_client.call_api(
832
+ *_param,
833
+ _request_timeout=_request_timeout
834
+ )
835
+ return response_data.response
836
+
837
+
838
+ def _get_deployment_serialize(
839
+ self,
840
+ deployment_id,
841
+ _request_auth,
842
+ _content_type,
843
+ _headers,
844
+ _host_index,
845
+ ) -> RequestSerialized:
846
+
847
+ _host = None
848
+
849
+ _collection_formats: Dict[str, str] = {
850
+ }
851
+
852
+ _path_params: Dict[str, str] = {}
853
+ _query_params: List[Tuple[str, str]] = []
854
+ _header_params: Dict[str, Optional[str]] = _headers or {}
855
+ _form_params: List[Tuple[str, str]] = []
856
+ _files: Dict[
857
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
858
+ ] = {}
859
+ _body_params: Optional[bytes] = None
860
+
861
+ # process the path parameters
862
+ if deployment_id is not None:
863
+ _path_params['deploymentId'] = deployment_id
864
+ # process the query parameters
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
+ 'LangflowAPIKey'
882
+ ]
883
+
884
+ return self.api_client.param_serialize(
885
+ method='GET',
886
+ resource_path='/api/v1/deployments/{deploymentId}',
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
+ async def list_deployments(
904
+ self,
905
+ slug: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=63)]] = None,
906
+ cursor: Optional[StrictStr] = None,
907
+ limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None,
908
+ _request_timeout: Union[
909
+ None,
910
+ Annotated[StrictFloat, Field(gt=0)],
911
+ Tuple[
912
+ Annotated[StrictFloat, Field(gt=0)],
913
+ Annotated[StrictFloat, Field(gt=0)]
914
+ ]
915
+ ] = None,
916
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
917
+ _content_type: Optional[StrictStr] = None,
918
+ _headers: Optional[Dict[StrictStr, Any]] = None,
919
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
920
+ ) -> DeploymentList:
921
+ """List Deployments
922
+
923
+
924
+ :param slug:
925
+ :type slug: str
926
+ :param cursor:
927
+ :type cursor: str
928
+ :param limit:
929
+ :type limit: int
930
+ :param _request_timeout: timeout setting for this request. If one
931
+ number provided, it will be total request
932
+ timeout. It can also be a pair (tuple) of
933
+ (connection, read) timeouts.
934
+ :type _request_timeout: int, tuple(int, int), optional
935
+ :param _request_auth: set to override the auth_settings for an a single
936
+ request; this effectively ignores the
937
+ authentication in the spec for a single request.
938
+ :type _request_auth: dict, optional
939
+ :param _content_type: force content-type for the request.
940
+ :type _content_type: str, Optional
941
+ :param _headers: set to override the headers for a single
942
+ request; this effectively ignores the headers
943
+ in the spec for a single request.
944
+ :type _headers: dict, optional
945
+ :param _host_index: set to override the host_index for a single
946
+ request; this effectively ignores the host_index
947
+ in the spec for a single request.
948
+ :type _host_index: int, optional
949
+ :return: Returns the result object.
950
+ """ # noqa: E501
951
+
952
+ _param = self._list_deployments_serialize(
953
+ slug=slug,
954
+ cursor=cursor,
955
+ limit=limit,
956
+ _request_auth=_request_auth,
957
+ _content_type=_content_type,
958
+ _headers=_headers,
959
+ _host_index=_host_index
960
+ )
961
+
962
+ _response_types_map: Dict[str, Optional[str]] = {
963
+ '200': "DeploymentList",
964
+ '400': "ErrorEnvelope",
965
+ '401': "ErrorEnvelope",
966
+ '403': "ErrorEnvelope",
967
+ '429': "ErrorEnvelope",
968
+ '500': "ErrorEnvelope",
969
+ '503': "ErrorEnvelope",
970
+ }
971
+ response_data = await self.api_client.call_api(
972
+ *_param,
973
+ _request_timeout=_request_timeout
974
+ )
975
+ await response_data.read()
976
+ return self.api_client.response_deserialize(
977
+ response_data=response_data,
978
+ response_types_map=_response_types_map,
979
+ ).data
980
+
981
+
982
+ @validate_call
983
+ async def list_deployments_with_http_info(
984
+ self,
985
+ slug: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=63)]] = None,
986
+ cursor: Optional[StrictStr] = None,
987
+ limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None,
988
+ _request_timeout: Union[
989
+ None,
990
+ Annotated[StrictFloat, Field(gt=0)],
991
+ Tuple[
992
+ Annotated[StrictFloat, Field(gt=0)],
993
+ Annotated[StrictFloat, Field(gt=0)]
994
+ ]
995
+ ] = None,
996
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
997
+ _content_type: Optional[StrictStr] = None,
998
+ _headers: Optional[Dict[StrictStr, Any]] = None,
999
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1000
+ ) -> ApiResponse[DeploymentList]:
1001
+ """List Deployments
1002
+
1003
+
1004
+ :param slug:
1005
+ :type slug: str
1006
+ :param cursor:
1007
+ :type cursor: str
1008
+ :param limit:
1009
+ :type limit: int
1010
+ :param _request_timeout: timeout setting for this request. If one
1011
+ number provided, it will be total request
1012
+ timeout. It can also be a pair (tuple) of
1013
+ (connection, read) timeouts.
1014
+ :type _request_timeout: int, tuple(int, int), optional
1015
+ :param _request_auth: set to override the auth_settings for an a single
1016
+ request; this effectively ignores the
1017
+ authentication in the spec for a single request.
1018
+ :type _request_auth: dict, optional
1019
+ :param _content_type: force content-type for the request.
1020
+ :type _content_type: str, Optional
1021
+ :param _headers: set to override the headers for a single
1022
+ request; this effectively ignores the headers
1023
+ in the spec for a single request.
1024
+ :type _headers: dict, optional
1025
+ :param _host_index: set to override the host_index for a single
1026
+ request; this effectively ignores the host_index
1027
+ in the spec for a single request.
1028
+ :type _host_index: int, optional
1029
+ :return: Returns the result object.
1030
+ """ # noqa: E501
1031
+
1032
+ _param = self._list_deployments_serialize(
1033
+ slug=slug,
1034
+ cursor=cursor,
1035
+ limit=limit,
1036
+ _request_auth=_request_auth,
1037
+ _content_type=_content_type,
1038
+ _headers=_headers,
1039
+ _host_index=_host_index
1040
+ )
1041
+
1042
+ _response_types_map: Dict[str, Optional[str]] = {
1043
+ '200': "DeploymentList",
1044
+ '400': "ErrorEnvelope",
1045
+ '401': "ErrorEnvelope",
1046
+ '403': "ErrorEnvelope",
1047
+ '429': "ErrorEnvelope",
1048
+ '500': "ErrorEnvelope",
1049
+ '503': "ErrorEnvelope",
1050
+ }
1051
+ response_data = await self.api_client.call_api(
1052
+ *_param,
1053
+ _request_timeout=_request_timeout
1054
+ )
1055
+ await response_data.read()
1056
+ return self.api_client.response_deserialize(
1057
+ response_data=response_data,
1058
+ response_types_map=_response_types_map,
1059
+ )
1060
+
1061
+
1062
+ @validate_call
1063
+ async def list_deployments_without_preload_content(
1064
+ self,
1065
+ slug: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=63)]] = None,
1066
+ cursor: Optional[StrictStr] = None,
1067
+ limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None,
1068
+ _request_timeout: Union[
1069
+ None,
1070
+ Annotated[StrictFloat, Field(gt=0)],
1071
+ Tuple[
1072
+ Annotated[StrictFloat, Field(gt=0)],
1073
+ Annotated[StrictFloat, Field(gt=0)]
1074
+ ]
1075
+ ] = None,
1076
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1077
+ _content_type: Optional[StrictStr] = None,
1078
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1079
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1080
+ ) -> RESTResponseType:
1081
+ """List Deployments
1082
+
1083
+
1084
+ :param slug:
1085
+ :type slug: str
1086
+ :param cursor:
1087
+ :type cursor: str
1088
+ :param limit:
1089
+ :type limit: int
1090
+ :param _request_timeout: timeout setting for this request. If one
1091
+ number provided, it will be total request
1092
+ timeout. It can also be a pair (tuple) of
1093
+ (connection, read) timeouts.
1094
+ :type _request_timeout: int, tuple(int, int), optional
1095
+ :param _request_auth: set to override the auth_settings for an a single
1096
+ request; this effectively ignores the
1097
+ authentication in the spec for a single request.
1098
+ :type _request_auth: dict, optional
1099
+ :param _content_type: force content-type for the request.
1100
+ :type _content_type: str, Optional
1101
+ :param _headers: set to override the headers for a single
1102
+ request; this effectively ignores the headers
1103
+ in the spec for a single request.
1104
+ :type _headers: dict, optional
1105
+ :param _host_index: set to override the host_index for a single
1106
+ request; this effectively ignores the host_index
1107
+ in the spec for a single request.
1108
+ :type _host_index: int, optional
1109
+ :return: Returns the result object.
1110
+ """ # noqa: E501
1111
+
1112
+ _param = self._list_deployments_serialize(
1113
+ slug=slug,
1114
+ cursor=cursor,
1115
+ limit=limit,
1116
+ _request_auth=_request_auth,
1117
+ _content_type=_content_type,
1118
+ _headers=_headers,
1119
+ _host_index=_host_index
1120
+ )
1121
+
1122
+ _response_types_map: Dict[str, Optional[str]] = {
1123
+ '200': "DeploymentList",
1124
+ '400': "ErrorEnvelope",
1125
+ '401': "ErrorEnvelope",
1126
+ '403': "ErrorEnvelope",
1127
+ '429': "ErrorEnvelope",
1128
+ '500': "ErrorEnvelope",
1129
+ '503': "ErrorEnvelope",
1130
+ }
1131
+ response_data = await self.api_client.call_api(
1132
+ *_param,
1133
+ _request_timeout=_request_timeout
1134
+ )
1135
+ return response_data.response
1136
+
1137
+
1138
+ def _list_deployments_serialize(
1139
+ self,
1140
+ slug,
1141
+ cursor,
1142
+ limit,
1143
+ _request_auth,
1144
+ _content_type,
1145
+ _headers,
1146
+ _host_index,
1147
+ ) -> RequestSerialized:
1148
+
1149
+ _host = None
1150
+
1151
+ _collection_formats: Dict[str, str] = {
1152
+ }
1153
+
1154
+ _path_params: Dict[str, str] = {}
1155
+ _query_params: List[Tuple[str, str]] = []
1156
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1157
+ _form_params: List[Tuple[str, str]] = []
1158
+ _files: Dict[
1159
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1160
+ ] = {}
1161
+ _body_params: Optional[bytes] = None
1162
+
1163
+ # process the path parameters
1164
+ # process the query parameters
1165
+ if slug is not None:
1166
+
1167
+ _query_params.append(('slug', slug))
1168
+
1169
+ if cursor is not None:
1170
+
1171
+ _query_params.append(('cursor', cursor))
1172
+
1173
+ if limit is not None:
1174
+
1175
+ _query_params.append(('limit', limit))
1176
+
1177
+ # process the header parameters
1178
+ # process the form parameters
1179
+ # process the body parameter
1180
+
1181
+
1182
+ # set the HTTP header `Accept`
1183
+ if 'Accept' not in _header_params:
1184
+ _header_params['Accept'] = self.api_client.select_header_accept(
1185
+ [
1186
+ 'application/json'
1187
+ ]
1188
+ )
1189
+
1190
+
1191
+ # authentication setting
1192
+ _auth_settings: List[str] = [
1193
+ 'LangflowAPIKey'
1194
+ ]
1195
+
1196
+ return self.api_client.param_serialize(
1197
+ method='GET',
1198
+ resource_path='/api/v1/deployments',
1199
+ path_params=_path_params,
1200
+ query_params=_query_params,
1201
+ header_params=_header_params,
1202
+ body=_body_params,
1203
+ post_params=_form_params,
1204
+ files=_files,
1205
+ auth_settings=_auth_settings,
1206
+ collection_formats=_collection_formats,
1207
+ _host=_host,
1208
+ _request_auth=_request_auth
1209
+ )
1210
+
1211
+
1212
+
1213
+
1214
+ @validate_call
1215
+ async def patch_deployment(
1216
+ self,
1217
+ deployment_id: UUID,
1218
+ patch_deployment: PatchDeployment,
1219
+ _request_timeout: Union[
1220
+ None,
1221
+ Annotated[StrictFloat, Field(gt=0)],
1222
+ Tuple[
1223
+ Annotated[StrictFloat, Field(gt=0)],
1224
+ Annotated[StrictFloat, Field(gt=0)]
1225
+ ]
1226
+ ] = None,
1227
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1228
+ _content_type: Optional[StrictStr] = None,
1229
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1230
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1231
+ ) -> DeploymentDetail:
1232
+ """Update only the Deployment description
1233
+
1234
+ Updates the Deployment description.
1235
+
1236
+ :param deployment_id: (required)
1237
+ :type deployment_id: UUID
1238
+ :param patch_deployment: (required)
1239
+ :type patch_deployment: PatchDeployment
1240
+ :param _request_timeout: timeout setting for this request. If one
1241
+ number provided, it will be total request
1242
+ timeout. It can also be a pair (tuple) of
1243
+ (connection, read) timeouts.
1244
+ :type _request_timeout: int, tuple(int, int), optional
1245
+ :param _request_auth: set to override the auth_settings for an a single
1246
+ request; this effectively ignores the
1247
+ authentication in the spec for a single request.
1248
+ :type _request_auth: dict, optional
1249
+ :param _content_type: force content-type for the request.
1250
+ :type _content_type: str, Optional
1251
+ :param _headers: set to override the headers for a single
1252
+ request; this effectively ignores the headers
1253
+ in the spec for a single request.
1254
+ :type _headers: dict, optional
1255
+ :param _host_index: set to override the host_index for a single
1256
+ request; this effectively ignores the host_index
1257
+ in the spec for a single request.
1258
+ :type _host_index: int, optional
1259
+ :return: Returns the result object.
1260
+ """ # noqa: E501
1261
+
1262
+ _param = self._patch_deployment_serialize(
1263
+ deployment_id=deployment_id,
1264
+ patch_deployment=patch_deployment,
1265
+ _request_auth=_request_auth,
1266
+ _content_type=_content_type,
1267
+ _headers=_headers,
1268
+ _host_index=_host_index
1269
+ )
1270
+
1271
+ _response_types_map: Dict[str, Optional[str]] = {
1272
+ '200': "DeploymentDetail",
1273
+ '400': "ErrorEnvelope",
1274
+ '401': "ErrorEnvelope",
1275
+ '403': "ErrorEnvelope",
1276
+ '404': "ErrorEnvelope",
1277
+ '413': "ErrorEnvelope",
1278
+ '422': "ErrorEnvelope",
1279
+ '429': "ErrorEnvelope",
1280
+ '500': "ErrorEnvelope",
1281
+ '503': "ErrorEnvelope",
1282
+ }
1283
+ response_data = await self.api_client.call_api(
1284
+ *_param,
1285
+ _request_timeout=_request_timeout
1286
+ )
1287
+ await response_data.read()
1288
+ return self.api_client.response_deserialize(
1289
+ response_data=response_data,
1290
+ response_types_map=_response_types_map,
1291
+ ).data
1292
+
1293
+
1294
+ @validate_call
1295
+ async def patch_deployment_with_http_info(
1296
+ self,
1297
+ deployment_id: UUID,
1298
+ patch_deployment: PatchDeployment,
1299
+ _request_timeout: Union[
1300
+ None,
1301
+ Annotated[StrictFloat, Field(gt=0)],
1302
+ Tuple[
1303
+ Annotated[StrictFloat, Field(gt=0)],
1304
+ Annotated[StrictFloat, Field(gt=0)]
1305
+ ]
1306
+ ] = None,
1307
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1308
+ _content_type: Optional[StrictStr] = None,
1309
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1310
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1311
+ ) -> ApiResponse[DeploymentDetail]:
1312
+ """Update only the Deployment description
1313
+
1314
+ Updates the Deployment description.
1315
+
1316
+ :param deployment_id: (required)
1317
+ :type deployment_id: UUID
1318
+ :param patch_deployment: (required)
1319
+ :type patch_deployment: PatchDeployment
1320
+ :param _request_timeout: timeout setting for this request. If one
1321
+ number provided, it will be total request
1322
+ timeout. It can also be a pair (tuple) of
1323
+ (connection, read) timeouts.
1324
+ :type _request_timeout: int, tuple(int, int), optional
1325
+ :param _request_auth: set to override the auth_settings for an a single
1326
+ request; this effectively ignores the
1327
+ authentication in the spec for a single request.
1328
+ :type _request_auth: dict, optional
1329
+ :param _content_type: force content-type for the request.
1330
+ :type _content_type: str, Optional
1331
+ :param _headers: set to override the headers for a single
1332
+ request; this effectively ignores the headers
1333
+ in the spec for a single request.
1334
+ :type _headers: dict, optional
1335
+ :param _host_index: set to override the host_index for a single
1336
+ request; this effectively ignores the host_index
1337
+ in the spec for a single request.
1338
+ :type _host_index: int, optional
1339
+ :return: Returns the result object.
1340
+ """ # noqa: E501
1341
+
1342
+ _param = self._patch_deployment_serialize(
1343
+ deployment_id=deployment_id,
1344
+ patch_deployment=patch_deployment,
1345
+ _request_auth=_request_auth,
1346
+ _content_type=_content_type,
1347
+ _headers=_headers,
1348
+ _host_index=_host_index
1349
+ )
1350
+
1351
+ _response_types_map: Dict[str, Optional[str]] = {
1352
+ '200': "DeploymentDetail",
1353
+ '400': "ErrorEnvelope",
1354
+ '401': "ErrorEnvelope",
1355
+ '403': "ErrorEnvelope",
1356
+ '404': "ErrorEnvelope",
1357
+ '413': "ErrorEnvelope",
1358
+ '422': "ErrorEnvelope",
1359
+ '429': "ErrorEnvelope",
1360
+ '500': "ErrorEnvelope",
1361
+ '503': "ErrorEnvelope",
1362
+ }
1363
+ response_data = await self.api_client.call_api(
1364
+ *_param,
1365
+ _request_timeout=_request_timeout
1366
+ )
1367
+ await response_data.read()
1368
+ return self.api_client.response_deserialize(
1369
+ response_data=response_data,
1370
+ response_types_map=_response_types_map,
1371
+ )
1372
+
1373
+
1374
+ @validate_call
1375
+ async def patch_deployment_without_preload_content(
1376
+ self,
1377
+ deployment_id: UUID,
1378
+ patch_deployment: PatchDeployment,
1379
+ _request_timeout: Union[
1380
+ None,
1381
+ Annotated[StrictFloat, Field(gt=0)],
1382
+ Tuple[
1383
+ Annotated[StrictFloat, Field(gt=0)],
1384
+ Annotated[StrictFloat, Field(gt=0)]
1385
+ ]
1386
+ ] = None,
1387
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1388
+ _content_type: Optional[StrictStr] = None,
1389
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1390
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1391
+ ) -> RESTResponseType:
1392
+ """Update only the Deployment description
1393
+
1394
+ Updates the Deployment description.
1395
+
1396
+ :param deployment_id: (required)
1397
+ :type deployment_id: UUID
1398
+ :param patch_deployment: (required)
1399
+ :type patch_deployment: PatchDeployment
1400
+ :param _request_timeout: timeout setting for this request. If one
1401
+ number provided, it will be total request
1402
+ timeout. It can also be a pair (tuple) of
1403
+ (connection, read) timeouts.
1404
+ :type _request_timeout: int, tuple(int, int), optional
1405
+ :param _request_auth: set to override the auth_settings for an a single
1406
+ request; this effectively ignores the
1407
+ authentication in the spec for a single request.
1408
+ :type _request_auth: dict, optional
1409
+ :param _content_type: force content-type for the request.
1410
+ :type _content_type: str, Optional
1411
+ :param _headers: set to override the headers for a single
1412
+ request; this effectively ignores the headers
1413
+ in the spec for a single request.
1414
+ :type _headers: dict, optional
1415
+ :param _host_index: set to override the host_index for a single
1416
+ request; this effectively ignores the host_index
1417
+ in the spec for a single request.
1418
+ :type _host_index: int, optional
1419
+ :return: Returns the result object.
1420
+ """ # noqa: E501
1421
+
1422
+ _param = self._patch_deployment_serialize(
1423
+ deployment_id=deployment_id,
1424
+ patch_deployment=patch_deployment,
1425
+ _request_auth=_request_auth,
1426
+ _content_type=_content_type,
1427
+ _headers=_headers,
1428
+ _host_index=_host_index
1429
+ )
1430
+
1431
+ _response_types_map: Dict[str, Optional[str]] = {
1432
+ '200': "DeploymentDetail",
1433
+ '400': "ErrorEnvelope",
1434
+ '401': "ErrorEnvelope",
1435
+ '403': "ErrorEnvelope",
1436
+ '404': "ErrorEnvelope",
1437
+ '413': "ErrorEnvelope",
1438
+ '422': "ErrorEnvelope",
1439
+ '429': "ErrorEnvelope",
1440
+ '500': "ErrorEnvelope",
1441
+ '503': "ErrorEnvelope",
1442
+ }
1443
+ response_data = await self.api_client.call_api(
1444
+ *_param,
1445
+ _request_timeout=_request_timeout
1446
+ )
1447
+ return response_data.response
1448
+
1449
+
1450
+ def _patch_deployment_serialize(
1451
+ self,
1452
+ deployment_id,
1453
+ patch_deployment,
1454
+ _request_auth,
1455
+ _content_type,
1456
+ _headers,
1457
+ _host_index,
1458
+ ) -> RequestSerialized:
1459
+
1460
+ _host = None
1461
+
1462
+ _collection_formats: Dict[str, str] = {
1463
+ }
1464
+
1465
+ _path_params: Dict[str, str] = {}
1466
+ _query_params: List[Tuple[str, str]] = []
1467
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1468
+ _form_params: List[Tuple[str, str]] = []
1469
+ _files: Dict[
1470
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1471
+ ] = {}
1472
+ _body_params: Optional[bytes] = None
1473
+
1474
+ # process the path parameters
1475
+ if deployment_id is not None:
1476
+ _path_params['deploymentId'] = deployment_id
1477
+ # process the query parameters
1478
+ # process the header parameters
1479
+ # process the form parameters
1480
+ # process the body parameter
1481
+ if patch_deployment is not None:
1482
+ _body_params = patch_deployment
1483
+
1484
+
1485
+ # set the HTTP header `Accept`
1486
+ if 'Accept' not in _header_params:
1487
+ _header_params['Accept'] = self.api_client.select_header_accept(
1488
+ [
1489
+ 'application/json'
1490
+ ]
1491
+ )
1492
+
1493
+ # set the HTTP header `Content-Type`
1494
+ if _content_type:
1495
+ _header_params['Content-Type'] = _content_type
1496
+ else:
1497
+ _default_content_type = (
1498
+ self.api_client.select_header_content_type(
1499
+ [
1500
+ 'application/json'
1501
+ ]
1502
+ )
1503
+ )
1504
+ if _default_content_type is not None:
1505
+ _header_params['Content-Type'] = _default_content_type
1506
+
1507
+ # authentication setting
1508
+ _auth_settings: List[str] = [
1509
+ 'LangflowAPIKey'
1510
+ ]
1511
+
1512
+ return self.api_client.param_serialize(
1513
+ method='PATCH',
1514
+ resource_path='/api/v1/deployments/{deploymentId}',
1515
+ path_params=_path_params,
1516
+ query_params=_query_params,
1517
+ header_params=_header_params,
1518
+ body=_body_params,
1519
+ post_params=_form_params,
1520
+ files=_files,
1521
+ auth_settings=_auth_settings,
1522
+ collection_formats=_collection_formats,
1523
+ _host=_host,
1524
+ _request_auth=_request_auth
1525
+ )
1526
+
1527
+
1528
+
1529
+
1530
+ @validate_call
1531
+ async def replace_deployment(
1532
+ self,
1533
+ deployment_id: UUID,
1534
+ replace_deployment: ReplaceDeployment,
1535
+ _request_timeout: Union[
1536
+ None,
1537
+ Annotated[StrictFloat, Field(gt=0)],
1538
+ Tuple[
1539
+ Annotated[StrictFloat, Field(gt=0)],
1540
+ Annotated[StrictFloat, Field(gt=0)]
1541
+ ]
1542
+ ] = None,
1543
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1544
+ _content_type: Optional[StrictStr] = None,
1545
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1546
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1547
+ ) -> DeploymentDetail:
1548
+ """Replace Deployment metadata and complete Flow membership
1549
+
1550
+ Replaces the Deployment definition. Changes may take effect asynchronously.
1551
+
1552
+ :param deployment_id: (required)
1553
+ :type deployment_id: UUID
1554
+ :param replace_deployment: (required)
1555
+ :type replace_deployment: ReplaceDeployment
1556
+ :param _request_timeout: timeout setting for this request. If one
1557
+ number provided, it will be total request
1558
+ timeout. It can also be a pair (tuple) of
1559
+ (connection, read) timeouts.
1560
+ :type _request_timeout: int, tuple(int, int), optional
1561
+ :param _request_auth: set to override the auth_settings for an a single
1562
+ request; this effectively ignores the
1563
+ authentication in the spec for a single request.
1564
+ :type _request_auth: dict, optional
1565
+ :param _content_type: force content-type for the request.
1566
+ :type _content_type: str, Optional
1567
+ :param _headers: set to override the headers for a single
1568
+ request; this effectively ignores the headers
1569
+ in the spec for a single request.
1570
+ :type _headers: dict, optional
1571
+ :param _host_index: set to override the host_index for a single
1572
+ request; this effectively ignores the host_index
1573
+ in the spec for a single request.
1574
+ :type _host_index: int, optional
1575
+ :return: Returns the result object.
1576
+ """ # noqa: E501
1577
+
1578
+ _param = self._replace_deployment_serialize(
1579
+ deployment_id=deployment_id,
1580
+ replace_deployment=replace_deployment,
1581
+ _request_auth=_request_auth,
1582
+ _content_type=_content_type,
1583
+ _headers=_headers,
1584
+ _host_index=_host_index
1585
+ )
1586
+
1587
+ _response_types_map: Dict[str, Optional[str]] = {
1588
+ '200': "DeploymentDetail",
1589
+ '400': "ErrorEnvelope",
1590
+ '401': "ErrorEnvelope",
1591
+ '403': "ErrorEnvelope",
1592
+ '404': "ErrorEnvelope",
1593
+ '409': "ErrorEnvelope",
1594
+ '413': "ErrorEnvelope",
1595
+ '422': "ErrorEnvelope",
1596
+ '429': "ErrorEnvelope",
1597
+ '500': "ErrorEnvelope",
1598
+ '503': "ErrorEnvelope",
1599
+ }
1600
+ response_data = await self.api_client.call_api(
1601
+ *_param,
1602
+ _request_timeout=_request_timeout
1603
+ )
1604
+ await response_data.read()
1605
+ return self.api_client.response_deserialize(
1606
+ response_data=response_data,
1607
+ response_types_map=_response_types_map,
1608
+ ).data
1609
+
1610
+
1611
+ @validate_call
1612
+ async def replace_deployment_with_http_info(
1613
+ self,
1614
+ deployment_id: UUID,
1615
+ replace_deployment: ReplaceDeployment,
1616
+ _request_timeout: Union[
1617
+ None,
1618
+ Annotated[StrictFloat, Field(gt=0)],
1619
+ Tuple[
1620
+ Annotated[StrictFloat, Field(gt=0)],
1621
+ Annotated[StrictFloat, Field(gt=0)]
1622
+ ]
1623
+ ] = None,
1624
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1625
+ _content_type: Optional[StrictStr] = None,
1626
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1627
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1628
+ ) -> ApiResponse[DeploymentDetail]:
1629
+ """Replace Deployment metadata and complete Flow membership
1630
+
1631
+ Replaces the Deployment definition. Changes may take effect asynchronously.
1632
+
1633
+ :param deployment_id: (required)
1634
+ :type deployment_id: UUID
1635
+ :param replace_deployment: (required)
1636
+ :type replace_deployment: ReplaceDeployment
1637
+ :param _request_timeout: timeout setting for this request. If one
1638
+ number provided, it will be total request
1639
+ timeout. It can also be a pair (tuple) of
1640
+ (connection, read) timeouts.
1641
+ :type _request_timeout: int, tuple(int, int), optional
1642
+ :param _request_auth: set to override the auth_settings for an a single
1643
+ request; this effectively ignores the
1644
+ authentication in the spec for a single request.
1645
+ :type _request_auth: dict, optional
1646
+ :param _content_type: force content-type for the request.
1647
+ :type _content_type: str, Optional
1648
+ :param _headers: set to override the headers for a single
1649
+ request; this effectively ignores the headers
1650
+ in the spec for a single request.
1651
+ :type _headers: dict, optional
1652
+ :param _host_index: set to override the host_index for a single
1653
+ request; this effectively ignores the host_index
1654
+ in the spec for a single request.
1655
+ :type _host_index: int, optional
1656
+ :return: Returns the result object.
1657
+ """ # noqa: E501
1658
+
1659
+ _param = self._replace_deployment_serialize(
1660
+ deployment_id=deployment_id,
1661
+ replace_deployment=replace_deployment,
1662
+ _request_auth=_request_auth,
1663
+ _content_type=_content_type,
1664
+ _headers=_headers,
1665
+ _host_index=_host_index
1666
+ )
1667
+
1668
+ _response_types_map: Dict[str, Optional[str]] = {
1669
+ '200': "DeploymentDetail",
1670
+ '400': "ErrorEnvelope",
1671
+ '401': "ErrorEnvelope",
1672
+ '403': "ErrorEnvelope",
1673
+ '404': "ErrorEnvelope",
1674
+ '409': "ErrorEnvelope",
1675
+ '413': "ErrorEnvelope",
1676
+ '422': "ErrorEnvelope",
1677
+ '429': "ErrorEnvelope",
1678
+ '500': "ErrorEnvelope",
1679
+ '503': "ErrorEnvelope",
1680
+ }
1681
+ response_data = await self.api_client.call_api(
1682
+ *_param,
1683
+ _request_timeout=_request_timeout
1684
+ )
1685
+ await response_data.read()
1686
+ return self.api_client.response_deserialize(
1687
+ response_data=response_data,
1688
+ response_types_map=_response_types_map,
1689
+ )
1690
+
1691
+
1692
+ @validate_call
1693
+ async def replace_deployment_without_preload_content(
1694
+ self,
1695
+ deployment_id: UUID,
1696
+ replace_deployment: ReplaceDeployment,
1697
+ _request_timeout: Union[
1698
+ None,
1699
+ Annotated[StrictFloat, Field(gt=0)],
1700
+ Tuple[
1701
+ Annotated[StrictFloat, Field(gt=0)],
1702
+ Annotated[StrictFloat, Field(gt=0)]
1703
+ ]
1704
+ ] = None,
1705
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1706
+ _content_type: Optional[StrictStr] = None,
1707
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1708
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1709
+ ) -> RESTResponseType:
1710
+ """Replace Deployment metadata and complete Flow membership
1711
+
1712
+ Replaces the Deployment definition. Changes may take effect asynchronously.
1713
+
1714
+ :param deployment_id: (required)
1715
+ :type deployment_id: UUID
1716
+ :param replace_deployment: (required)
1717
+ :type replace_deployment: ReplaceDeployment
1718
+ :param _request_timeout: timeout setting for this request. If one
1719
+ number provided, it will be total request
1720
+ timeout. It can also be a pair (tuple) of
1721
+ (connection, read) timeouts.
1722
+ :type _request_timeout: int, tuple(int, int), optional
1723
+ :param _request_auth: set to override the auth_settings for an a single
1724
+ request; this effectively ignores the
1725
+ authentication in the spec for a single request.
1726
+ :type _request_auth: dict, optional
1727
+ :param _content_type: force content-type for the request.
1728
+ :type _content_type: str, Optional
1729
+ :param _headers: set to override the headers for a single
1730
+ request; this effectively ignores the headers
1731
+ in the spec for a single request.
1732
+ :type _headers: dict, optional
1733
+ :param _host_index: set to override the host_index for a single
1734
+ request; this effectively ignores the host_index
1735
+ in the spec for a single request.
1736
+ :type _host_index: int, optional
1737
+ :return: Returns the result object.
1738
+ """ # noqa: E501
1739
+
1740
+ _param = self._replace_deployment_serialize(
1741
+ deployment_id=deployment_id,
1742
+ replace_deployment=replace_deployment,
1743
+ _request_auth=_request_auth,
1744
+ _content_type=_content_type,
1745
+ _headers=_headers,
1746
+ _host_index=_host_index
1747
+ )
1748
+
1749
+ _response_types_map: Dict[str, Optional[str]] = {
1750
+ '200': "DeploymentDetail",
1751
+ '400': "ErrorEnvelope",
1752
+ '401': "ErrorEnvelope",
1753
+ '403': "ErrorEnvelope",
1754
+ '404': "ErrorEnvelope",
1755
+ '409': "ErrorEnvelope",
1756
+ '413': "ErrorEnvelope",
1757
+ '422': "ErrorEnvelope",
1758
+ '429': "ErrorEnvelope",
1759
+ '500': "ErrorEnvelope",
1760
+ '503': "ErrorEnvelope",
1761
+ }
1762
+ response_data = await self.api_client.call_api(
1763
+ *_param,
1764
+ _request_timeout=_request_timeout
1765
+ )
1766
+ return response_data.response
1767
+
1768
+
1769
+ def _replace_deployment_serialize(
1770
+ self,
1771
+ deployment_id,
1772
+ replace_deployment,
1773
+ _request_auth,
1774
+ _content_type,
1775
+ _headers,
1776
+ _host_index,
1777
+ ) -> RequestSerialized:
1778
+
1779
+ _host = None
1780
+
1781
+ _collection_formats: Dict[str, str] = {
1782
+ }
1783
+
1784
+ _path_params: Dict[str, str] = {}
1785
+ _query_params: List[Tuple[str, str]] = []
1786
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1787
+ _form_params: List[Tuple[str, str]] = []
1788
+ _files: Dict[
1789
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1790
+ ] = {}
1791
+ _body_params: Optional[bytes] = None
1792
+
1793
+ # process the path parameters
1794
+ if deployment_id is not None:
1795
+ _path_params['deploymentId'] = deployment_id
1796
+ # process the query parameters
1797
+ # process the header parameters
1798
+ # process the form parameters
1799
+ # process the body parameter
1800
+ if replace_deployment is not None:
1801
+ _body_params = replace_deployment
1802
+
1803
+
1804
+ # set the HTTP header `Accept`
1805
+ if 'Accept' not in _header_params:
1806
+ _header_params['Accept'] = self.api_client.select_header_accept(
1807
+ [
1808
+ 'application/json'
1809
+ ]
1810
+ )
1811
+
1812
+ # set the HTTP header `Content-Type`
1813
+ if _content_type:
1814
+ _header_params['Content-Type'] = _content_type
1815
+ else:
1816
+ _default_content_type = (
1817
+ self.api_client.select_header_content_type(
1818
+ [
1819
+ 'application/json'
1820
+ ]
1821
+ )
1822
+ )
1823
+ if _default_content_type is not None:
1824
+ _header_params['Content-Type'] = _default_content_type
1825
+
1826
+ # authentication setting
1827
+ _auth_settings: List[str] = [
1828
+ 'LangflowAPIKey'
1829
+ ]
1830
+
1831
+ return self.api_client.param_serialize(
1832
+ method='PUT',
1833
+ resource_path='/api/v1/deployments/{deploymentId}',
1834
+ path_params=_path_params,
1835
+ query_params=_query_params,
1836
+ header_params=_header_params,
1837
+ body=_body_params,
1838
+ post_params=_form_params,
1839
+ files=_files,
1840
+ auth_settings=_auth_settings,
1841
+ collection_formats=_collection_formats,
1842
+ _host=_host,
1843
+ _request_auth=_request_auth
1844
+ )
1845
+
1846
+