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.
- langflow_control_plane_sdk/__init__.py +72 -0
- langflow_control_plane_sdk/api/__init__.py +5 -0
- langflow_control_plane_sdk/api/deployments_api.py +1846 -0
- langflow_control_plane_sdk/api_client.py +822 -0
- langflow_control_plane_sdk/api_response.py +21 -0
- langflow_control_plane_sdk/configuration.py +625 -0
- langflow_control_plane_sdk/exceptions.py +218 -0
- langflow_control_plane_sdk/models/__init__.py +28 -0
- langflow_control_plane_sdk/models/create_deployment.py +108 -0
- langflow_control_plane_sdk/models/deployment_detail.py +105 -0
- langflow_control_plane_sdk/models/deployment_list.py +103 -0
- langflow_control_plane_sdk/models/deployment_list_item.py +103 -0
- langflow_control_plane_sdk/models/error_body.py +96 -0
- langflow_control_plane_sdk/models/error_code.py +57 -0
- langflow_control_plane_sdk/models/error_envelope.py +92 -0
- langflow_control_plane_sdk/models/flow_input.py +104 -0
- langflow_control_plane_sdk/models/flow_payload.py +105 -0
- langflow_control_plane_sdk/models/flow_payload_data.py +103 -0
- langflow_control_plane_sdk/models/patch_deployment.py +89 -0
- langflow_control_plane_sdk/models/replace_deployment.py +99 -0
- langflow_control_plane_sdk/py.typed +0 -0
- langflow_control_plane_sdk/rest.py +201 -0
- langflow_control_plane_sdk-0.0.0.dev0.dist-info/METADATA +142 -0
- langflow_control_plane_sdk-0.0.0.dev0.dist-info/RECORD +26 -0
- langflow_control_plane_sdk-0.0.0.dev0.dist-info/WHEEL +4 -0
- langflow_control_plane_sdk-0.0.0.dev0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,218 @@
|
|
|
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
|
+
from typing import Any, Optional
|
|
14
|
+
from typing_extensions import Self
|
|
15
|
+
|
|
16
|
+
class OpenApiException(Exception):
|
|
17
|
+
"""The base exception class for all OpenAPIExceptions"""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ApiTypeError(OpenApiException, TypeError):
|
|
21
|
+
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
|
22
|
+
key_type=None) -> None:
|
|
23
|
+
""" Raises an exception for TypeErrors
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
msg (str): the exception message
|
|
27
|
+
|
|
28
|
+
Keyword Args:
|
|
29
|
+
path_to_item (list): a list of keys an indices to get to the
|
|
30
|
+
current_item
|
|
31
|
+
None if unset
|
|
32
|
+
valid_classes (tuple): the primitive classes that current item
|
|
33
|
+
should be an instance of
|
|
34
|
+
None if unset
|
|
35
|
+
key_type (bool): False if our value is a value in a dict
|
|
36
|
+
True if it is a key in a dict
|
|
37
|
+
False if our item is an item in a list
|
|
38
|
+
None if unset
|
|
39
|
+
"""
|
|
40
|
+
self.path_to_item = path_to_item
|
|
41
|
+
self.valid_classes = valid_classes
|
|
42
|
+
self.key_type = key_type
|
|
43
|
+
full_msg = msg
|
|
44
|
+
if path_to_item:
|
|
45
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
46
|
+
super(ApiTypeError, self).__init__(full_msg)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class ApiValueError(OpenApiException, ValueError):
|
|
50
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
51
|
+
"""
|
|
52
|
+
Args:
|
|
53
|
+
msg (str): the exception message
|
|
54
|
+
|
|
55
|
+
Keyword Args:
|
|
56
|
+
path_to_item (list) the path to the exception in the
|
|
57
|
+
received_data dict. None if unset
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
self.path_to_item = path_to_item
|
|
61
|
+
full_msg = msg
|
|
62
|
+
if path_to_item:
|
|
63
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
64
|
+
super(ApiValueError, self).__init__(full_msg)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class ApiAttributeError(OpenApiException, AttributeError):
|
|
68
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
69
|
+
"""
|
|
70
|
+
Raised when an attribute reference or assignment fails.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
msg (str): the exception message
|
|
74
|
+
|
|
75
|
+
Keyword Args:
|
|
76
|
+
path_to_item (None/list) the path to the exception in the
|
|
77
|
+
received_data dict
|
|
78
|
+
"""
|
|
79
|
+
self.path_to_item = path_to_item
|
|
80
|
+
full_msg = msg
|
|
81
|
+
if path_to_item:
|
|
82
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
83
|
+
super(ApiAttributeError, self).__init__(full_msg)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
class ApiKeyError(OpenApiException, KeyError):
|
|
87
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
88
|
+
"""
|
|
89
|
+
Args:
|
|
90
|
+
msg (str): the exception message
|
|
91
|
+
|
|
92
|
+
Keyword Args:
|
|
93
|
+
path_to_item (None/list) the path to the exception in the
|
|
94
|
+
received_data dict
|
|
95
|
+
"""
|
|
96
|
+
self.path_to_item = path_to_item
|
|
97
|
+
full_msg = msg
|
|
98
|
+
if path_to_item:
|
|
99
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
100
|
+
super(ApiKeyError, self).__init__(full_msg)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
class ApiException(OpenApiException):
|
|
104
|
+
|
|
105
|
+
def __init__(
|
|
106
|
+
self,
|
|
107
|
+
status=None,
|
|
108
|
+
reason=None,
|
|
109
|
+
http_resp=None,
|
|
110
|
+
*,
|
|
111
|
+
body: Optional[str] = None,
|
|
112
|
+
data: Optional[Any] = None,
|
|
113
|
+
) -> None:
|
|
114
|
+
self.status = status
|
|
115
|
+
self.reason = reason
|
|
116
|
+
self.body = body
|
|
117
|
+
self.data = data
|
|
118
|
+
self.headers = None
|
|
119
|
+
|
|
120
|
+
if http_resp:
|
|
121
|
+
if self.status is None:
|
|
122
|
+
self.status = http_resp.status
|
|
123
|
+
if self.reason is None:
|
|
124
|
+
self.reason = http_resp.reason
|
|
125
|
+
if self.body is None:
|
|
126
|
+
try:
|
|
127
|
+
self.body = http_resp.data.decode('utf-8')
|
|
128
|
+
except Exception:
|
|
129
|
+
pass
|
|
130
|
+
self.headers = http_resp.headers
|
|
131
|
+
|
|
132
|
+
@classmethod
|
|
133
|
+
def from_response(
|
|
134
|
+
cls,
|
|
135
|
+
*,
|
|
136
|
+
http_resp,
|
|
137
|
+
body: Optional[str],
|
|
138
|
+
data: Optional[Any],
|
|
139
|
+
) -> Self:
|
|
140
|
+
if http_resp.status == 400:
|
|
141
|
+
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
|
142
|
+
|
|
143
|
+
if http_resp.status == 401:
|
|
144
|
+
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
|
145
|
+
|
|
146
|
+
if http_resp.status == 403:
|
|
147
|
+
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
|
148
|
+
|
|
149
|
+
if http_resp.status == 404:
|
|
150
|
+
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
|
151
|
+
|
|
152
|
+
# Added new conditions for 409 and 422
|
|
153
|
+
if http_resp.status == 409:
|
|
154
|
+
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
|
155
|
+
|
|
156
|
+
if http_resp.status == 422:
|
|
157
|
+
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
|
|
158
|
+
|
|
159
|
+
if 500 <= http_resp.status <= 599:
|
|
160
|
+
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
|
161
|
+
raise ApiException(http_resp=http_resp, body=body, data=data)
|
|
162
|
+
|
|
163
|
+
def __str__(self):
|
|
164
|
+
"""Custom error messages for exception"""
|
|
165
|
+
error_message = "({0})\n"\
|
|
166
|
+
"Reason: {1}\n".format(self.status, self.reason)
|
|
167
|
+
if self.headers:
|
|
168
|
+
error_message += "HTTP response headers: {0}\n".format(
|
|
169
|
+
self.headers)
|
|
170
|
+
|
|
171
|
+
if self.body:
|
|
172
|
+
error_message += "HTTP response body: {0}\n".format(self.body)
|
|
173
|
+
|
|
174
|
+
if self.data:
|
|
175
|
+
error_message += "HTTP response data: {0}\n".format(self.data)
|
|
176
|
+
|
|
177
|
+
return error_message
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
class BadRequestException(ApiException):
|
|
181
|
+
pass
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
class NotFoundException(ApiException):
|
|
185
|
+
pass
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
class UnauthorizedException(ApiException):
|
|
189
|
+
pass
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
class ForbiddenException(ApiException):
|
|
193
|
+
pass
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
class ServiceException(ApiException):
|
|
197
|
+
pass
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
class ConflictException(ApiException):
|
|
201
|
+
"""Exception for HTTP 409 Conflict."""
|
|
202
|
+
pass
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
class UnprocessableEntityException(ApiException):
|
|
206
|
+
"""Exception for HTTP 422 Unprocessable Entity."""
|
|
207
|
+
pass
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def render_path(path_to_item):
|
|
211
|
+
"""Returns a string representation of a path"""
|
|
212
|
+
result = ""
|
|
213
|
+
for pth in path_to_item:
|
|
214
|
+
if isinstance(pth, int):
|
|
215
|
+
result += "[{0}]".format(pth)
|
|
216
|
+
else:
|
|
217
|
+
result += "['{0}']".format(pth)
|
|
218
|
+
return result
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
"""
|
|
5
|
+
Langflow Control Plane API
|
|
6
|
+
|
|
7
|
+
Manage Langflow Runtime Deployments.
|
|
8
|
+
|
|
9
|
+
The version of the OpenAPI document: 0.0
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
# import models into model package
|
|
16
|
+
from langflow_control_plane_sdk.models.create_deployment import CreateDeployment
|
|
17
|
+
from langflow_control_plane_sdk.models.deployment_detail import DeploymentDetail
|
|
18
|
+
from langflow_control_plane_sdk.models.deployment_list import DeploymentList
|
|
19
|
+
from langflow_control_plane_sdk.models.deployment_list_item import DeploymentListItem
|
|
20
|
+
from langflow_control_plane_sdk.models.error_body import ErrorBody
|
|
21
|
+
from langflow_control_plane_sdk.models.error_code import ErrorCode
|
|
22
|
+
from langflow_control_plane_sdk.models.error_envelope import ErrorEnvelope
|
|
23
|
+
from langflow_control_plane_sdk.models.flow_input import FlowInput
|
|
24
|
+
from langflow_control_plane_sdk.models.flow_payload import FlowPayload
|
|
25
|
+
from langflow_control_plane_sdk.models.flow_payload_data import FlowPayloadData
|
|
26
|
+
from langflow_control_plane_sdk.models.patch_deployment import PatchDeployment
|
|
27
|
+
from langflow_control_plane_sdk.models.replace_deployment import ReplaceDeployment
|
|
28
|
+
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Langflow Control Plane API
|
|
5
|
+
|
|
6
|
+
Manage Langflow Runtime Deployments.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from langflow_control_plane_sdk.models.flow_input import FlowInput
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
27
|
+
|
|
28
|
+
class CreateDeployment(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
CreateDeployment
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
slug: Annotated[str, Field(min_length=1, strict=True, max_length=63)]
|
|
33
|
+
description: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None
|
|
34
|
+
flows: List[FlowInput]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["slug", "description", "flows"]
|
|
36
|
+
|
|
37
|
+
@field_validator('slug', mode="before")
|
|
38
|
+
def slug_validate_regular_expression(cls, value):
|
|
39
|
+
"""Validates the regular expression"""
|
|
40
|
+
if isinstance(value, str) and not re.match(r"^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$", value):
|
|
41
|
+
raise ValueError(r"must validate the regular expression /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/")
|
|
42
|
+
return value
|
|
43
|
+
|
|
44
|
+
model_config = ConfigDict(
|
|
45
|
+
validate_by_name=True,
|
|
46
|
+
validate_by_alias=True,
|
|
47
|
+
validate_assignment=True,
|
|
48
|
+
protected_namespaces=(),
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def to_str(self) -> str:
|
|
53
|
+
"""Returns the string representation of the model using alias"""
|
|
54
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
55
|
+
|
|
56
|
+
def to_json(self) -> str:
|
|
57
|
+
"""Returns the JSON representation of the model using alias"""
|
|
58
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
59
|
+
|
|
60
|
+
@classmethod
|
|
61
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
62
|
+
"""Create an instance of CreateDeployment from a JSON string"""
|
|
63
|
+
return cls.from_dict(json.loads(json_str))
|
|
64
|
+
|
|
65
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
66
|
+
"""Return the dictionary representation of the model using alias.
|
|
67
|
+
|
|
68
|
+
This has the following differences from calling pydantic's
|
|
69
|
+
`self.model_dump(by_alias=True)`:
|
|
70
|
+
|
|
71
|
+
* `None` is only added to the output dict for nullable fields that
|
|
72
|
+
were set at model initialization. Other fields with value `None`
|
|
73
|
+
are ignored.
|
|
74
|
+
"""
|
|
75
|
+
excluded_fields: Set[str] = set([
|
|
76
|
+
])
|
|
77
|
+
|
|
78
|
+
_dict = self.model_dump(
|
|
79
|
+
by_alias=True,
|
|
80
|
+
exclude=excluded_fields,
|
|
81
|
+
exclude_none=True,
|
|
82
|
+
)
|
|
83
|
+
# override the default output from pydantic by calling `to_dict()` of each item in flows (list)
|
|
84
|
+
_items = []
|
|
85
|
+
if self.flows:
|
|
86
|
+
for _item_flows in self.flows:
|
|
87
|
+
if _item_flows:
|
|
88
|
+
_items.append(_item_flows.to_dict())
|
|
89
|
+
_dict['flows'] = _items
|
|
90
|
+
return _dict
|
|
91
|
+
|
|
92
|
+
@classmethod
|
|
93
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
94
|
+
"""Create an instance of CreateDeployment from a dict"""
|
|
95
|
+
if obj is None:
|
|
96
|
+
return None
|
|
97
|
+
|
|
98
|
+
if not isinstance(obj, dict):
|
|
99
|
+
return cls.model_validate(obj)
|
|
100
|
+
|
|
101
|
+
_obj = cls.model_validate({
|
|
102
|
+
"slug": obj.get("slug"),
|
|
103
|
+
"description": obj.get("description"),
|
|
104
|
+
"flows": [FlowInput.from_dict(_item) for _item in obj["flows"]] if obj.get("flows") is not None else None
|
|
105
|
+
})
|
|
106
|
+
return _obj
|
|
107
|
+
|
|
108
|
+
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Langflow Control Plane API
|
|
5
|
+
|
|
6
|
+
Manage Langflow Runtime Deployments.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from uuid import UUID
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
27
|
+
|
|
28
|
+
class DeploymentDetail(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
DeploymentDetail
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
id: UUID
|
|
33
|
+
slug: Annotated[str, Field(min_length=1, strict=True, max_length=63)]
|
|
34
|
+
description: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None
|
|
35
|
+
flow_ids: List[UUID] = Field(alias="flowIds")
|
|
36
|
+
runtime_base_url: StrictStr = Field(alias="runtimeBaseUrl")
|
|
37
|
+
__properties: ClassVar[List[str]] = ["id", "slug", "description", "flowIds", "runtimeBaseUrl"]
|
|
38
|
+
|
|
39
|
+
@field_validator('slug', mode="before")
|
|
40
|
+
def slug_validate_regular_expression(cls, value):
|
|
41
|
+
"""Validates the regular expression"""
|
|
42
|
+
if isinstance(value, str) and not re.match(r"^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$", value):
|
|
43
|
+
raise ValueError(r"must validate the regular expression /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/")
|
|
44
|
+
return value
|
|
45
|
+
|
|
46
|
+
model_config = ConfigDict(
|
|
47
|
+
validate_by_name=True,
|
|
48
|
+
validate_by_alias=True,
|
|
49
|
+
validate_assignment=True,
|
|
50
|
+
protected_namespaces=(),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def to_str(self) -> str:
|
|
55
|
+
"""Returns the string representation of the model using alias"""
|
|
56
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
57
|
+
|
|
58
|
+
def to_json(self) -> str:
|
|
59
|
+
"""Returns the JSON representation of the model using alias"""
|
|
60
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
61
|
+
|
|
62
|
+
@classmethod
|
|
63
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
64
|
+
"""Create an instance of DeploymentDetail from a JSON string"""
|
|
65
|
+
return cls.from_dict(json.loads(json_str))
|
|
66
|
+
|
|
67
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
68
|
+
"""Return the dictionary representation of the model using alias.
|
|
69
|
+
|
|
70
|
+
This has the following differences from calling pydantic's
|
|
71
|
+
`self.model_dump(by_alias=True)`:
|
|
72
|
+
|
|
73
|
+
* `None` is only added to the output dict for nullable fields that
|
|
74
|
+
were set at model initialization. Other fields with value `None`
|
|
75
|
+
are ignored.
|
|
76
|
+
"""
|
|
77
|
+
excluded_fields: Set[str] = set([
|
|
78
|
+
])
|
|
79
|
+
|
|
80
|
+
_dict = self.model_dump(
|
|
81
|
+
by_alias=True,
|
|
82
|
+
exclude=excluded_fields,
|
|
83
|
+
exclude_none=True,
|
|
84
|
+
)
|
|
85
|
+
return _dict
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
89
|
+
"""Create an instance of DeploymentDetail from a dict"""
|
|
90
|
+
if obj is None:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
if not isinstance(obj, dict):
|
|
94
|
+
return cls.model_validate(obj)
|
|
95
|
+
|
|
96
|
+
_obj = cls.model_validate({
|
|
97
|
+
"id": obj.get("id"),
|
|
98
|
+
"slug": obj.get("slug"),
|
|
99
|
+
"description": obj.get("description"),
|
|
100
|
+
"flowIds": obj.get("flowIds"),
|
|
101
|
+
"runtimeBaseUrl": obj.get("runtimeBaseUrl")
|
|
102
|
+
})
|
|
103
|
+
return _obj
|
|
104
|
+
|
|
105
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Langflow Control Plane API
|
|
5
|
+
|
|
6
|
+
Manage Langflow Runtime Deployments.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from langflow_control_plane_sdk.models.deployment_list_item import DeploymentListItem
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class DeploymentList(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
DeploymentList
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
items: List[DeploymentListItem]
|
|
32
|
+
next_cursor: Optional[StrictStr] = Field(description="Opaque cursor for the next page, or null on the final page.", alias="nextCursor")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["items", "nextCursor"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
validate_by_name=True,
|
|
37
|
+
validate_by_alias=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of DeploymentList from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
|
75
|
+
_items = []
|
|
76
|
+
if self.items:
|
|
77
|
+
for _item_items in self.items:
|
|
78
|
+
if _item_items:
|
|
79
|
+
_items.append(_item_items.to_dict())
|
|
80
|
+
_dict['items'] = _items
|
|
81
|
+
# set to None if next_cursor (nullable) is None
|
|
82
|
+
# and model_fields_set contains the field
|
|
83
|
+
if self.next_cursor is None and "next_cursor" in self.model_fields_set:
|
|
84
|
+
_dict['nextCursor'] = None
|
|
85
|
+
|
|
86
|
+
return _dict
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
90
|
+
"""Create an instance of DeploymentList from a dict"""
|
|
91
|
+
if obj is None:
|
|
92
|
+
return None
|
|
93
|
+
|
|
94
|
+
if not isinstance(obj, dict):
|
|
95
|
+
return cls.model_validate(obj)
|
|
96
|
+
|
|
97
|
+
_obj = cls.model_validate({
|
|
98
|
+
"items": [DeploymentListItem.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
|
|
99
|
+
"nextCursor": obj.get("nextCursor")
|
|
100
|
+
})
|
|
101
|
+
return _obj
|
|
102
|
+
|
|
103
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Langflow Control Plane API
|
|
5
|
+
|
|
6
|
+
Manage Langflow Runtime Deployments.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, Optional
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from uuid import UUID
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
27
|
+
|
|
28
|
+
class DeploymentListItem(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
DeploymentListItem
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
id: UUID
|
|
33
|
+
slug: Annotated[str, Field(min_length=1, strict=True, max_length=63)]
|
|
34
|
+
description: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None
|
|
35
|
+
runtime_base_url: StrictStr = Field(alias="runtimeBaseUrl")
|
|
36
|
+
__properties: ClassVar[List[str]] = ["id", "slug", "description", "runtimeBaseUrl"]
|
|
37
|
+
|
|
38
|
+
@field_validator('slug', mode="before")
|
|
39
|
+
def slug_validate_regular_expression(cls, value):
|
|
40
|
+
"""Validates the regular expression"""
|
|
41
|
+
if isinstance(value, str) and not re.match(r"^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$", value):
|
|
42
|
+
raise ValueError(r"must validate the regular expression /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/")
|
|
43
|
+
return value
|
|
44
|
+
|
|
45
|
+
model_config = ConfigDict(
|
|
46
|
+
validate_by_name=True,
|
|
47
|
+
validate_by_alias=True,
|
|
48
|
+
validate_assignment=True,
|
|
49
|
+
protected_namespaces=(),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def to_str(self) -> str:
|
|
54
|
+
"""Returns the string representation of the model using alias"""
|
|
55
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
56
|
+
|
|
57
|
+
def to_json(self) -> str:
|
|
58
|
+
"""Returns the JSON representation of the model using alias"""
|
|
59
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
63
|
+
"""Create an instance of DeploymentListItem from a JSON string"""
|
|
64
|
+
return cls.from_dict(json.loads(json_str))
|
|
65
|
+
|
|
66
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
67
|
+
"""Return the dictionary representation of the model using alias.
|
|
68
|
+
|
|
69
|
+
This has the following differences from calling pydantic's
|
|
70
|
+
`self.model_dump(by_alias=True)`:
|
|
71
|
+
|
|
72
|
+
* `None` is only added to the output dict for nullable fields that
|
|
73
|
+
were set at model initialization. Other fields with value `None`
|
|
74
|
+
are ignored.
|
|
75
|
+
"""
|
|
76
|
+
excluded_fields: Set[str] = set([
|
|
77
|
+
])
|
|
78
|
+
|
|
79
|
+
_dict = self.model_dump(
|
|
80
|
+
by_alias=True,
|
|
81
|
+
exclude=excluded_fields,
|
|
82
|
+
exclude_none=True,
|
|
83
|
+
)
|
|
84
|
+
return _dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
88
|
+
"""Create an instance of DeploymentListItem from a dict"""
|
|
89
|
+
if obj is None:
|
|
90
|
+
return None
|
|
91
|
+
|
|
92
|
+
if not isinstance(obj, dict):
|
|
93
|
+
return cls.model_validate(obj)
|
|
94
|
+
|
|
95
|
+
_obj = cls.model_validate({
|
|
96
|
+
"id": obj.get("id"),
|
|
97
|
+
"slug": obj.get("slug"),
|
|
98
|
+
"description": obj.get("description"),
|
|
99
|
+
"runtimeBaseUrl": obj.get("runtimeBaseUrl")
|
|
100
|
+
})
|
|
101
|
+
return _obj
|
|
102
|
+
|
|
103
|
+
|