beamlit 0.0.24rc19__py3-none-any.whl → 0.0.24rc21__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- beamlit/agents/chat.py +37 -11
- beamlit/agents/decorator.py +97 -65
- beamlit/api/agents/create_agent.py +9 -14
- beamlit/api/agents/delete_agent.py +22 -1
- beamlit/api/agents/delete_agent_history.py +2 -6
- beamlit/api/agents/get_agent.py +22 -1
- beamlit/api/agents/get_agent_environment_logs.py +11 -11
- beamlit/api/agents/get_agent_history.py +2 -6
- beamlit/api/agents/get_agent_metrics.py +22 -1
- beamlit/api/agents/list_agent_history.py +11 -11
- beamlit/api/agents/list_agents.py +36 -4
- beamlit/api/agents/put_agent_history.py +2 -6
- beamlit/api/agents/update_agent.py +9 -14
- beamlit/api/functions/create_function.py +9 -14
- beamlit/api/functions/delete_function.py +22 -1
- beamlit/api/functions/get_function.py +22 -1
- beamlit/api/functions/get_function_environment_logs.py +11 -11
- beamlit/api/functions/get_function_metrics.py +22 -1
- beamlit/api/functions/list_functions.py +36 -4
- beamlit/api/functions/update_function.py +9 -14
- beamlit/api/history/get_agents_history.py +12 -12
- beamlit/api/history/list_agents_history.py +12 -12
- beamlit/api/integrations/get_integration_connection.py +16 -12
- beamlit/api/integrations/get_integration_connection_model.py +8 -1
- beamlit/api/integrations/get_integration_model.py +8 -1
- beamlit/api/locations/list_locations.py +12 -12
- beamlit/api/models/create_model.py +13 -14
- beamlit/api/models/delete_model.py +22 -1
- beamlit/api/models/get_model.py +22 -1
- beamlit/api/models/get_model_environment_logs.py +11 -11
- beamlit/api/models/get_model_metrics.py +38 -13
- beamlit/api/models/list_models.py +36 -4
- beamlit/api/models/update_model.py +13 -14
- beamlit/api/privateclusters/__init__.py +0 -0
- beamlit/api/{agents/get_agent_deployment_metrics.py → privateclusters/create_private_cluster.py} +28 -55
- beamlit/api/{functions/list_function_deployments.py → privateclusters/delete_private_cluster.py} +38 -37
- beamlit/api/{agents/get_agent_deployment.py → privateclusters/get_private_cluster.py} +40 -44
- beamlit/api/privateclusters/get_private_cluster_health.py +97 -0
- beamlit/api/{agents/list_agent_deployments.py → privateclusters/list_private_clusters.py} +30 -45
- beamlit/api/{models/list_model_deployments.py → privateclusters/update_private_cluster.py} +38 -45
- beamlit/api/privateclusters/update_private_cluster_health.py +97 -0
- beamlit/authentication/device_mode.py +3 -9
- beamlit/common/generate.py +47 -34
- beamlit/common/settings.py +29 -27
- beamlit/deploy/deploy.py +101 -342
- beamlit/deploy/format.py +70 -0
- beamlit/deploy/parser.py +175 -0
- beamlit/functions/decorator.py +17 -14
- beamlit/models/__init__.py +64 -78
- beamlit/models/acl.py +4 -22
- beamlit/models/agent.py +34 -95
- beamlit/models/agent_history.py +7 -5
- beamlit/models/agent_history_event.py +11 -9
- beamlit/models/agent_metadata.py +5 -3
- beamlit/models/agent_spec.py +54 -45
- beamlit/models/api_key.py +14 -14
- beamlit/models/configuration.py +11 -0
- beamlit/models/core_spec.py +45 -32
- beamlit/models/{model_deployment_metrics_query_per_second_per_region_per_code.py → core_spec_configurations.py} +22 -22
- beamlit/models/environment.py +33 -105
- beamlit/models/environment_metadata.py +146 -0
- beamlit/models/environment_spec.py +8 -6
- beamlit/models/function.py +34 -95
- beamlit/models/function_metadata.py +5 -3
- beamlit/models/function_spec.py +53 -40
- beamlit/models/integration_connection.py +31 -137
- beamlit/models/integration_connection_spec.py +6 -4
- beamlit/models/metadata.py +5 -3
- beamlit/models/metadata_labels.py +4 -2
- beamlit/models/model.py +33 -94
- beamlit/models/model_metadata.py +5 -3
- beamlit/models/{function_provider_ref.py → model_private_cluster.py} +23 -14
- beamlit/models/model_provider.py +27 -43
- beamlit/models/model_spec.py +45 -32
- beamlit/models/owner_fields.py +4 -2
- beamlit/models/pending_invitation.py +14 -14
- beamlit/models/pod_template_spec.py +4 -2
- beamlit/models/policy.py +33 -159
- beamlit/models/policy_spec.py +24 -28
- beamlit/models/private_cluster.py +183 -0
- beamlit/models/{model_provider_ref.py → private_location.py} +7 -16
- beamlit/models/resource_deployment_metrics.py +0 -108
- beamlit/models/resource_environment_metrics.py +143 -71
- beamlit/models/{resource_deployment_metrics_inference_per_region.py → resource_environment_metrics_inference_per_region.py} +5 -5
- beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +9 -11
- beamlit/models/{resource_deployment_metrics_query_per_region_per_code.py → resource_environment_metrics_query_per_region_per_code.py} +5 -5
- beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +5 -3
- beamlit/models/resource_log.py +4 -2
- beamlit/models/runtime.py +20 -2
- beamlit/models/serverless_config.py +28 -21
- beamlit/models/spec_configuration.py +7 -5
- beamlit/models/store_agent.py +14 -14
- beamlit/models/store_function.py +14 -14
- beamlit/models/time_fields.py +4 -2
- beamlit/models/websocket_channel.py +4 -2
- beamlit/models/workspace.py +23 -14
- beamlit/run.py +0 -1
- beamlit/serve/app.py +1 -0
- beamlit/serve/middlewares/accesslog.py +3 -1
- {beamlit-0.0.24rc19.dist-info → beamlit-0.0.24rc21.dist-info}/METADATA +1 -1
- beamlit-0.0.24rc21.dist-info/RECORD +243 -0
- beamlit/api/agents/delete_agent_deployment.py +0 -163
- beamlit/api/agents/delete_agent_deployment_history.py +0 -172
- beamlit/api/agents/get_agent_deployment_history.py +0 -172
- beamlit/api/agents/get_agent_deployment_logs.py +0 -164
- beamlit/api/agents/list_agent_deployment_history.py +0 -164
- beamlit/api/agents/put_agent_deployment.py +0 -185
- beamlit/api/agents/put_agent_deployment_history.py +0 -198
- beamlit/api/functions/delete_function_deployment.py +0 -163
- beamlit/api/functions/get_function_deployment.py +0 -163
- beamlit/api/functions/get_function_deployment_logs.py +0 -164
- beamlit/api/functions/get_function_deployment_metrics.py +0 -159
- beamlit/api/functions/put_function_deployment.py +0 -185
- beamlit/api/models/delete_model_deployment.py +0 -171
- beamlit/api/models/get_model_deployment.py +0 -171
- beamlit/api/models/get_model_deployment_logs.py +0 -168
- beamlit/api/models/get_model_deployment_metrics.py +0 -163
- beamlit/api/models/put_model_deployment.py +0 -193
- beamlit/models/agent_configuration.py +0 -70
- beamlit/models/agent_deployment.py +0 -340
- beamlit/models/agent_deployment_configuration.py +0 -45
- beamlit/models/agent_deployment_configuration_type_0.py +0 -43
- beamlit/models/agent_deployment_history.py +0 -185
- beamlit/models/agent_deployment_history_event.py +0 -133
- beamlit/models/agent_deployment_pod_template.py +0 -45
- beamlit/models/agent_deployment_pod_template_type_0.py +0 -43
- beamlit/models/agent_with_deployments.py +0 -176
- beamlit/models/authentication_provider_model.py +0 -144
- beamlit/models/authentication_provider_organization.py +0 -88
- beamlit/models/deployment_configuration.py +0 -70
- beamlit/models/deployment_configurations.py +0 -58
- beamlit/models/deployment_serverless_config.py +0 -131
- beamlit/models/deployment_serverless_config_type_0.py +0 -220
- beamlit/models/function_configuration.py +0 -70
- beamlit/models/function_deployment.py +0 -340
- beamlit/models/function_deployment_configuration.py +0 -45
- beamlit/models/function_deployment_configuration_type_0.py +0 -43
- beamlit/models/function_deployment_pod_template.py +0 -45
- beamlit/models/function_deployment_pod_template_type_0.py +0 -43
- beamlit/models/function_with_deployments.py +0 -176
- beamlit/models/integration.py +0 -198
- beamlit/models/integration_config.py +0 -45
- beamlit/models/integration_secret.py +0 -61
- beamlit/models/labels_type_0.py +0 -45
- beamlit/models/location.py +0 -122
- beamlit/models/model_deployment.py +0 -296
- beamlit/models/model_deployment_log.py +0 -70
- beamlit/models/model_deployment_metrics.py +0 -172
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +0 -77
- beamlit/models/model_deployment_pod_template.py +0 -45
- beamlit/models/model_deployment_pod_template_type_0.py +0 -43
- beamlit/models/model_metrics.py +0 -96
- beamlit/models/model_with_deployments.py +0 -176
- beamlit/models/resource_deployment_log.py +0 -70
- beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +0 -79
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +0 -79
- beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +0 -73
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py +0 -73
- beamlit/models/runtime_readiness_probe_type_0.py +0 -43
- beamlit/models/runtime_type_0.py +0 -111
- beamlit/models/runtime_type_0_readiness_probe.py +0 -43
- beamlit/models/runtime_type_0_readiness_probe_type_0.py +0 -43
- beamlit/models/runtime_type_0_resources.py +0 -59
- beamlit/models/standard_fields_dynamo_db.py +0 -88
- beamlit/models/store_agent_configuration.py +0 -97
- beamlit/models/store_agent_labels_type_0.py +0 -43
- beamlit/models/store_function_configuration.py +0 -97
- beamlit/models/store_function_labels_type_0.py +0 -43
- beamlit-0.0.24rc19.dist-info/RECORD +0 -303
- {beamlit-0.0.24rc19.dist-info → beamlit-0.0.24rc21.dist-info}/WHEEL +0 -0
beamlit/models/function.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -6,7 +6,8 @@ from attrs import field as _attrs_field
|
|
6
6
|
from ..types import UNSET, Unset
|
7
7
|
|
8
8
|
if TYPE_CHECKING:
|
9
|
-
from ..models.
|
9
|
+
from ..models.environment_metadata import EnvironmentMetadata
|
10
|
+
from ..models.function_spec import FunctionSpec
|
10
11
|
|
11
12
|
|
12
13
|
T = TypeVar("T", bound="Function")
|
@@ -14,123 +15,61 @@ T = TypeVar("T", bound="Function")
|
|
14
15
|
|
15
16
|
@_attrs_define
|
16
17
|
class Function:
|
17
|
-
"""Function
|
18
|
+
"""Function
|
18
19
|
|
19
20
|
Attributes:
|
20
|
-
|
21
|
-
|
22
|
-
updated_at (Union[Unset, str]): The date and time when the resource was updated
|
23
|
-
updated_by (Union[Unset, str]): The user or service account who updated the resource
|
24
|
-
display_name (Union[Unset, str]): Function display name
|
25
|
-
labels (Union['LabelsType0', None, Unset]): Labels
|
26
|
-
name (Union[Unset, str]): Function name
|
27
|
-
workspace (Union[Unset, str]): Workspace name
|
21
|
+
metadata (Union[Unset, EnvironmentMetadata]): Environment metadata
|
22
|
+
spec (Union[Unset, FunctionSpec]): Function specification
|
28
23
|
"""
|
29
24
|
|
30
|
-
|
31
|
-
|
32
|
-
updated_at: Union[Unset, str] = UNSET
|
33
|
-
updated_by: Union[Unset, str] = UNSET
|
34
|
-
display_name: Union[Unset, str] = UNSET
|
35
|
-
labels: Union["LabelsType0", None, Unset] = UNSET
|
36
|
-
name: Union[Unset, str] = UNSET
|
37
|
-
workspace: Union[Unset, str] = UNSET
|
25
|
+
metadata: Union[Unset, "EnvironmentMetadata"] = UNSET
|
26
|
+
spec: Union[Unset, "FunctionSpec"] = UNSET
|
38
27
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
39
28
|
|
40
29
|
def to_dict(self) -> dict[str, Any]:
|
41
|
-
|
30
|
+
metadata: Union[Unset, dict[str, Any]] = UNSET
|
31
|
+
if not isinstance(self.metadata, Unset):
|
32
|
+
metadata = self.metadata.to_dict()
|
42
33
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
updated_at = self.updated_at
|
48
|
-
|
49
|
-
updated_by = self.updated_by
|
50
|
-
|
51
|
-
display_name = self.display_name
|
52
|
-
|
53
|
-
labels: Union[None, Unset, dict[str, Any]]
|
54
|
-
if isinstance(self.labels, Unset):
|
55
|
-
labels = UNSET
|
56
|
-
elif isinstance(self.labels, LabelsType0):
|
57
|
-
labels = self.labels.to_dict()
|
58
|
-
else:
|
59
|
-
labels = self.labels
|
60
|
-
|
61
|
-
name = self.name
|
62
|
-
|
63
|
-
workspace = self.workspace
|
34
|
+
spec: Union[Unset, dict[str, Any]] = UNSET
|
35
|
+
if not isinstance(self.spec, Unset):
|
36
|
+
spec = self.spec.to_dict()
|
64
37
|
|
65
38
|
field_dict: dict[str, Any] = {}
|
66
39
|
field_dict.update(self.additional_properties)
|
67
40
|
field_dict.update({})
|
68
|
-
if
|
69
|
-
field_dict["
|
70
|
-
if
|
71
|
-
field_dict["
|
72
|
-
if updated_at is not UNSET:
|
73
|
-
field_dict["updated_at"] = updated_at
|
74
|
-
if updated_by is not UNSET:
|
75
|
-
field_dict["updated_by"] = updated_by
|
76
|
-
if display_name is not UNSET:
|
77
|
-
field_dict["display_name"] = display_name
|
78
|
-
if labels is not UNSET:
|
79
|
-
field_dict["labels"] = labels
|
80
|
-
if name is not UNSET:
|
81
|
-
field_dict["name"] = name
|
82
|
-
if workspace is not UNSET:
|
83
|
-
field_dict["workspace"] = workspace
|
41
|
+
if metadata is not UNSET:
|
42
|
+
field_dict["metadata"] = metadata
|
43
|
+
if spec is not UNSET:
|
44
|
+
field_dict["spec"] = spec
|
84
45
|
|
85
46
|
return field_dict
|
86
47
|
|
87
48
|
@classmethod
|
88
49
|
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
89
|
-
from ..models.
|
50
|
+
from ..models.environment_metadata import EnvironmentMetadata
|
51
|
+
from ..models.function_spec import FunctionSpec
|
90
52
|
|
91
53
|
if not src_dict:
|
92
54
|
return None
|
93
55
|
d = src_dict.copy()
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
updated_by = d.pop("updated_by", UNSET)
|
101
|
-
|
102
|
-
display_name = d.pop("display_name", UNSET)
|
103
|
-
|
104
|
-
def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
|
105
|
-
if data is None:
|
106
|
-
return data
|
107
|
-
if isinstance(data, Unset):
|
108
|
-
return data
|
109
|
-
try:
|
110
|
-
if not isinstance(data, dict):
|
111
|
-
raise TypeError()
|
112
|
-
componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
|
113
|
-
|
114
|
-
return componentsschemas_labels_type_0
|
115
|
-
except: # noqa: E722
|
116
|
-
pass
|
117
|
-
return cast(Union["LabelsType0", None, Unset], data)
|
118
|
-
|
119
|
-
labels = _parse_labels(d.pop("labels", UNSET))
|
120
|
-
|
121
|
-
name = d.pop("name", UNSET)
|
56
|
+
_metadata = d.pop("metadata", UNSET)
|
57
|
+
metadata: Union[Unset, EnvironmentMetadata]
|
58
|
+
if isinstance(_metadata, Unset):
|
59
|
+
metadata = UNSET
|
60
|
+
else:
|
61
|
+
metadata = EnvironmentMetadata.from_dict(_metadata)
|
122
62
|
|
123
|
-
|
63
|
+
_spec = d.pop("spec", UNSET)
|
64
|
+
spec: Union[Unset, FunctionSpec]
|
65
|
+
if isinstance(_spec, Unset):
|
66
|
+
spec = UNSET
|
67
|
+
else:
|
68
|
+
spec = FunctionSpec.from_dict(_spec)
|
124
69
|
|
125
70
|
function = cls(
|
126
|
-
|
127
|
-
|
128
|
-
updated_at=updated_at,
|
129
|
-
updated_by=updated_by,
|
130
|
-
display_name=display_name,
|
131
|
-
labels=labels,
|
132
|
-
name=name,
|
133
|
-
workspace=workspace,
|
71
|
+
metadata=metadata,
|
72
|
+
spec=spec,
|
134
73
|
)
|
135
74
|
|
136
75
|
function.additional_properties = d
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -50,7 +50,7 @@ class FunctionMetadata:
|
|
50
50
|
|
51
51
|
display_name = self.display_name
|
52
52
|
|
53
|
-
labels: Union[Unset,
|
53
|
+
labels: Union[Unset, dict[str, Any]] = UNSET
|
54
54
|
if not isinstance(self.labels, Unset):
|
55
55
|
labels = self.labels.to_dict()
|
56
56
|
|
@@ -85,9 +85,11 @@ class FunctionMetadata:
|
|
85
85
|
return field_dict
|
86
86
|
|
87
87
|
@classmethod
|
88
|
-
def from_dict(cls:
|
88
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
89
89
|
from ..models.metadata_labels import MetadataLabels
|
90
90
|
|
91
|
+
if not src_dict:
|
92
|
+
return None
|
91
93
|
d = src_dict.copy()
|
92
94
|
created_at = d.pop("createdAt", UNSET)
|
93
95
|
|
beamlit/models/function_spec.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -6,12 +6,13 @@ from attrs import field as _attrs_field
|
|
6
6
|
from ..types import UNSET, Unset
|
7
7
|
|
8
8
|
if TYPE_CHECKING:
|
9
|
+
from ..models.core_spec_configurations import CoreSpecConfigurations
|
9
10
|
from ..models.flavor import Flavor
|
10
11
|
from ..models.function_kit import FunctionKit
|
12
|
+
from ..models.model_private_cluster import ModelPrivateCluster
|
11
13
|
from ..models.pod_template_spec import PodTemplateSpec
|
12
14
|
from ..models.runtime import Runtime
|
13
15
|
from ..models.serverless_config import ServerlessConfig
|
14
|
-
from ..models.spec_configuration import SpecConfiguration
|
15
16
|
from ..models.store_function_parameter import StoreFunctionParameter
|
16
17
|
|
17
18
|
|
@@ -23,82 +24,85 @@ class FunctionSpec:
|
|
23
24
|
"""Function specification
|
24
25
|
|
25
26
|
Attributes:
|
26
|
-
configurations (Union[Unset,
|
27
|
-
agent you can retrieve the value with config[key]
|
27
|
+
configurations (Union[Unset, CoreSpecConfigurations]): Optional configurations for the object
|
28
28
|
enabled (Union[Unset, bool]): Enable or disable the agent
|
29
|
-
flavors (Union[Unset,
|
30
|
-
integration_connections (Union[Unset,
|
29
|
+
flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
|
30
|
+
integration_connections (Union[Unset, list[str]]):
|
31
31
|
pod_template (Union[Unset, PodTemplateSpec]): Pod template specification
|
32
|
-
policies (Union[Unset,
|
32
|
+
policies (Union[Unset, list[str]]):
|
33
|
+
private_clusters (Union[Unset, ModelPrivateCluster]): Private cluster where the model deployment is deployed
|
33
34
|
runtime (Union[Unset, Runtime]): Set of configurations for a deployment
|
34
35
|
serverless_config (Union[Unset, ServerlessConfig]): Configuration for a serverless deployment
|
35
36
|
description (Union[Unset, str]): Function description, very important for the agent function to work with an LLM
|
36
|
-
kit (Union[Unset,
|
37
|
-
parameters (Union[Unset,
|
37
|
+
kit (Union[Unset, list['FunctionKit']]): The kit of the function deployment
|
38
|
+
parameters (Union[Unset, list['StoreFunctionParameter']]): Function parameters, for your function to be callable
|
38
39
|
with Agent
|
39
40
|
store_id (Union[Unset, str]): Store id
|
40
41
|
"""
|
41
42
|
|
42
|
-
configurations: Union[Unset, "
|
43
|
+
configurations: Union[Unset, "CoreSpecConfigurations"] = UNSET
|
43
44
|
enabled: Union[Unset, bool] = UNSET
|
44
|
-
flavors: Union[Unset,
|
45
|
-
integration_connections: Union[Unset,
|
45
|
+
flavors: Union[Unset, list["Flavor"]] = UNSET
|
46
|
+
integration_connections: Union[Unset, list[str]] = UNSET
|
46
47
|
pod_template: Union[Unset, "PodTemplateSpec"] = UNSET
|
47
|
-
policies: Union[Unset,
|
48
|
+
policies: Union[Unset, list[str]] = UNSET
|
49
|
+
private_clusters: Union[Unset, "ModelPrivateCluster"] = UNSET
|
48
50
|
runtime: Union[Unset, "Runtime"] = UNSET
|
49
51
|
serverless_config: Union[Unset, "ServerlessConfig"] = UNSET
|
50
52
|
description: Union[Unset, str] = UNSET
|
51
|
-
kit: Union[Unset,
|
52
|
-
parameters: Union[Unset,
|
53
|
+
kit: Union[Unset, list["FunctionKit"]] = UNSET
|
54
|
+
parameters: Union[Unset, list["StoreFunctionParameter"]] = UNSET
|
53
55
|
store_id: Union[Unset, str] = UNSET
|
54
56
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
55
57
|
|
56
58
|
def to_dict(self) -> dict[str, Any]:
|
57
|
-
configurations: Union[Unset,
|
59
|
+
configurations: Union[Unset, dict[str, Any]] = UNSET
|
58
60
|
if not isinstance(self.configurations, Unset):
|
59
61
|
configurations = self.configurations.to_dict()
|
60
62
|
|
61
63
|
enabled = self.enabled
|
62
64
|
|
63
|
-
flavors: Union[Unset,
|
65
|
+
flavors: Union[Unset, list[dict[str, Any]]] = UNSET
|
64
66
|
if not isinstance(self.flavors, Unset):
|
65
67
|
flavors = []
|
66
68
|
for componentsschemas_flavors_item_data in self.flavors:
|
67
|
-
componentsschemas_flavors_item = (
|
68
|
-
componentsschemas_flavors_item_data.to_dict()
|
69
|
-
)
|
69
|
+
componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
|
70
70
|
flavors.append(componentsschemas_flavors_item)
|
71
71
|
|
72
|
-
integration_connections: Union[Unset,
|
72
|
+
integration_connections: Union[Unset, list[str]] = UNSET
|
73
73
|
if not isinstance(self.integration_connections, Unset):
|
74
74
|
integration_connections = self.integration_connections
|
75
75
|
|
76
|
-
pod_template: Union[Unset,
|
76
|
+
pod_template: Union[Unset, dict[str, Any]] = UNSET
|
77
77
|
if not isinstance(self.pod_template, Unset):
|
78
78
|
pod_template = self.pod_template.to_dict()
|
79
79
|
|
80
|
-
policies: Union[Unset,
|
80
|
+
policies: Union[Unset, list[str]] = UNSET
|
81
81
|
if not isinstance(self.policies, Unset):
|
82
82
|
policies = self.policies
|
83
83
|
|
84
|
-
|
84
|
+
private_clusters: Union[Unset, dict[str, Any]] = UNSET
|
85
|
+
if not isinstance(self.private_clusters, Unset):
|
86
|
+
private_clusters = self.private_clusters.to_dict()
|
87
|
+
|
88
|
+
runtime: Union[Unset, dict[str, Any]] = UNSET
|
85
89
|
if not isinstance(self.runtime, Unset):
|
86
90
|
runtime = self.runtime.to_dict()
|
87
91
|
|
88
|
-
serverless_config: Union[Unset,
|
92
|
+
serverless_config: Union[Unset, dict[str, Any]] = UNSET
|
89
93
|
if not isinstance(self.serverless_config, Unset):
|
90
94
|
serverless_config = self.serverless_config.to_dict()
|
91
95
|
|
92
96
|
description = self.description
|
93
97
|
|
94
|
-
kit: Union[Unset,
|
98
|
+
kit: Union[Unset, list[dict[str, Any]]] = UNSET
|
95
99
|
if not isinstance(self.kit, Unset):
|
96
100
|
kit = []
|
97
101
|
for kit_item_data in self.kit:
|
98
102
|
kit_item = kit_item_data.to_dict()
|
99
103
|
kit.append(kit_item)
|
100
104
|
|
101
|
-
parameters: Union[Unset,
|
105
|
+
parameters: Union[Unset, list[dict[str, Any]]] = UNSET
|
102
106
|
if not isinstance(self.parameters, Unset):
|
103
107
|
parameters = []
|
104
108
|
for parameters_item_data in self.parameters:
|
@@ -122,6 +126,8 @@ class FunctionSpec:
|
|
122
126
|
field_dict["podTemplate"] = pod_template
|
123
127
|
if policies is not UNSET:
|
124
128
|
field_dict["policies"] = policies
|
129
|
+
if private_clusters is not UNSET:
|
130
|
+
field_dict["privateClusters"] = private_clusters
|
125
131
|
if runtime is not UNSET:
|
126
132
|
field_dict["runtime"] = runtime
|
127
133
|
if serverless_config is not UNSET:
|
@@ -133,42 +139,41 @@ class FunctionSpec:
|
|
133
139
|
if parameters is not UNSET:
|
134
140
|
field_dict["parameters"] = parameters
|
135
141
|
if store_id is not UNSET:
|
136
|
-
field_dict["
|
142
|
+
field_dict["storeId"] = store_id
|
137
143
|
|
138
144
|
return field_dict
|
139
145
|
|
140
146
|
@classmethod
|
141
|
-
def from_dict(cls:
|
147
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
148
|
+
from ..models.core_spec_configurations import CoreSpecConfigurations
|
142
149
|
from ..models.flavor import Flavor
|
143
150
|
from ..models.function_kit import FunctionKit
|
151
|
+
from ..models.model_private_cluster import ModelPrivateCluster
|
144
152
|
from ..models.pod_template_spec import PodTemplateSpec
|
145
153
|
from ..models.runtime import Runtime
|
146
154
|
from ..models.serverless_config import ServerlessConfig
|
147
|
-
from ..models.spec_configuration import SpecConfiguration
|
148
155
|
from ..models.store_function_parameter import StoreFunctionParameter
|
149
156
|
|
157
|
+
if not src_dict:
|
158
|
+
return None
|
150
159
|
d = src_dict.copy()
|
151
160
|
_configurations = d.pop("configurations", UNSET)
|
152
|
-
configurations: Union[Unset,
|
161
|
+
configurations: Union[Unset, CoreSpecConfigurations]
|
153
162
|
if isinstance(_configurations, Unset):
|
154
163
|
configurations = UNSET
|
155
164
|
else:
|
156
|
-
configurations =
|
165
|
+
configurations = CoreSpecConfigurations.from_dict(_configurations)
|
157
166
|
|
158
167
|
enabled = d.pop("enabled", UNSET)
|
159
168
|
|
160
169
|
flavors = []
|
161
170
|
_flavors = d.pop("flavors", UNSET)
|
162
171
|
for componentsschemas_flavors_item_data in _flavors or []:
|
163
|
-
componentsschemas_flavors_item = Flavor.from_dict(
|
164
|
-
componentsschemas_flavors_item_data
|
165
|
-
)
|
172
|
+
componentsschemas_flavors_item = Flavor.from_dict(componentsschemas_flavors_item_data)
|
166
173
|
|
167
174
|
flavors.append(componentsschemas_flavors_item)
|
168
175
|
|
169
|
-
integration_connections = cast(
|
170
|
-
List[str], d.pop("integrationConnections", UNSET)
|
171
|
-
)
|
176
|
+
integration_connections = cast(list[str], d.pop("integrationConnections", UNSET))
|
172
177
|
|
173
178
|
_pod_template = d.pop("podTemplate", UNSET)
|
174
179
|
pod_template: Union[Unset, PodTemplateSpec]
|
@@ -177,7 +182,14 @@ class FunctionSpec:
|
|
177
182
|
else:
|
178
183
|
pod_template = PodTemplateSpec.from_dict(_pod_template)
|
179
184
|
|
180
|
-
policies = cast(
|
185
|
+
policies = cast(list[str], d.pop("policies", UNSET))
|
186
|
+
|
187
|
+
_private_clusters = d.pop("privateClusters", UNSET)
|
188
|
+
private_clusters: Union[Unset, ModelPrivateCluster]
|
189
|
+
if isinstance(_private_clusters, Unset):
|
190
|
+
private_clusters = UNSET
|
191
|
+
else:
|
192
|
+
private_clusters = ModelPrivateCluster.from_dict(_private_clusters)
|
181
193
|
|
182
194
|
_runtime = d.pop("runtime", UNSET)
|
183
195
|
runtime: Union[Unset, Runtime]
|
@@ -209,7 +221,7 @@ class FunctionSpec:
|
|
209
221
|
|
210
222
|
parameters.append(parameters_item)
|
211
223
|
|
212
|
-
store_id = d.pop("
|
224
|
+
store_id = d.pop("storeId", UNSET)
|
213
225
|
|
214
226
|
function_spec = cls(
|
215
227
|
configurations=configurations,
|
@@ -218,6 +230,7 @@ class FunctionSpec:
|
|
218
230
|
integration_connections=integration_connections,
|
219
231
|
pod_template=pod_template,
|
220
232
|
policies=policies,
|
233
|
+
private_clusters=private_clusters,
|
221
234
|
runtime=runtime,
|
222
235
|
serverless_config=serverless_config,
|
223
236
|
description=description,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -6,9 +6,8 @@ from attrs import field as _attrs_field
|
|
6
6
|
from ..types import UNSET, Unset
|
7
7
|
|
8
8
|
if TYPE_CHECKING:
|
9
|
-
from ..models.
|
10
|
-
from ..models.
|
11
|
-
from ..models.labels_type_0 import LabelsType0
|
9
|
+
from ..models.integration_connection_spec import IntegrationConnectionSpec
|
10
|
+
from ..models.metadata import Metadata
|
12
11
|
|
13
12
|
|
14
13
|
T = TypeVar("T", bound="IntegrationConnection")
|
@@ -19,163 +18,58 @@ class IntegrationConnection:
|
|
19
18
|
"""Integration Connection
|
20
19
|
|
21
20
|
Attributes:
|
22
|
-
|
23
|
-
|
24
|
-
updated_at (Union[Unset, str]): The date and time when the resource was updated
|
25
|
-
updated_by (Union[Unset, str]): The user or service account who updated the resource
|
26
|
-
config (Union[Unset, IntegrationConnectionConfig]): Integration config
|
27
|
-
display_name (Union[Unset, str]): Integration connection display name
|
28
|
-
integration (Union[Unset, str]): Integration type
|
29
|
-
labels (Union['LabelsType0', None, Unset]): Labels
|
30
|
-
name (Union[Unset, str]): Integration connection name
|
31
|
-
secret (Union[Unset, IntegrationConnectionSecret]): Integration secret
|
32
|
-
workspace (Union[Unset, str]): Workspace name
|
21
|
+
metadata (Union[Unset, Metadata]): Metadata
|
22
|
+
spec (Union[Unset, IntegrationConnectionSpec]): Integration connection specification
|
33
23
|
"""
|
34
24
|
|
35
|
-
|
36
|
-
|
37
|
-
updated_at: Union[Unset, str] = UNSET
|
38
|
-
updated_by: Union[Unset, str] = UNSET
|
39
|
-
config: Union[Unset, "IntegrationConnectionConfig"] = UNSET
|
40
|
-
display_name: Union[Unset, str] = UNSET
|
41
|
-
integration: Union[Unset, str] = UNSET
|
42
|
-
labels: Union["LabelsType0", None, Unset] = UNSET
|
43
|
-
name: Union[Unset, str] = UNSET
|
44
|
-
secret: Union[Unset, "IntegrationConnectionSecret"] = UNSET
|
45
|
-
workspace: Union[Unset, str] = UNSET
|
25
|
+
metadata: Union[Unset, "Metadata"] = UNSET
|
26
|
+
spec: Union[Unset, "IntegrationConnectionSpec"] = UNSET
|
46
27
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
47
28
|
|
48
29
|
def to_dict(self) -> dict[str, Any]:
|
49
|
-
|
30
|
+
metadata: Union[Unset, dict[str, Any]] = UNSET
|
31
|
+
if not isinstance(self.metadata, Unset):
|
32
|
+
metadata = self.metadata.to_dict()
|
50
33
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
updated_at = self.updated_at
|
56
|
-
|
57
|
-
updated_by = self.updated_by
|
58
|
-
|
59
|
-
config: Union[Unset, dict[str, Any]] = UNSET
|
60
|
-
if not isinstance(self.config, Unset):
|
61
|
-
config = self.config.to_dict()
|
62
|
-
|
63
|
-
display_name = self.display_name
|
64
|
-
|
65
|
-
integration = self.integration
|
66
|
-
|
67
|
-
labels: Union[None, Unset, dict[str, Any]]
|
68
|
-
if isinstance(self.labels, Unset):
|
69
|
-
labels = UNSET
|
70
|
-
elif isinstance(self.labels, LabelsType0):
|
71
|
-
labels = self.labels.to_dict()
|
72
|
-
else:
|
73
|
-
labels = self.labels
|
74
|
-
|
75
|
-
name = self.name
|
76
|
-
|
77
|
-
secret: Union[Unset, dict[str, Any]] = UNSET
|
78
|
-
if not isinstance(self.secret, Unset):
|
79
|
-
secret = self.secret.to_dict()
|
80
|
-
|
81
|
-
workspace = self.workspace
|
34
|
+
spec: Union[Unset, dict[str, Any]] = UNSET
|
35
|
+
if not isinstance(self.spec, Unset):
|
36
|
+
spec = self.spec.to_dict()
|
82
37
|
|
83
38
|
field_dict: dict[str, Any] = {}
|
84
39
|
field_dict.update(self.additional_properties)
|
85
40
|
field_dict.update({})
|
86
|
-
if
|
87
|
-
field_dict["
|
88
|
-
if
|
89
|
-
field_dict["
|
90
|
-
if updated_at is not UNSET:
|
91
|
-
field_dict["updated_at"] = updated_at
|
92
|
-
if updated_by is not UNSET:
|
93
|
-
field_dict["updated_by"] = updated_by
|
94
|
-
if config is not UNSET:
|
95
|
-
field_dict["config"] = config
|
96
|
-
if display_name is not UNSET:
|
97
|
-
field_dict["display_name"] = display_name
|
98
|
-
if integration is not UNSET:
|
99
|
-
field_dict["integration"] = integration
|
100
|
-
if labels is not UNSET:
|
101
|
-
field_dict["labels"] = labels
|
102
|
-
if name is not UNSET:
|
103
|
-
field_dict["name"] = name
|
104
|
-
if secret is not UNSET:
|
105
|
-
field_dict["secret"] = secret
|
106
|
-
if workspace is not UNSET:
|
107
|
-
field_dict["workspace"] = workspace
|
41
|
+
if metadata is not UNSET:
|
42
|
+
field_dict["metadata"] = metadata
|
43
|
+
if spec is not UNSET:
|
44
|
+
field_dict["spec"] = spec
|
108
45
|
|
109
46
|
return field_dict
|
110
47
|
|
111
48
|
@classmethod
|
112
49
|
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
113
|
-
from ..models.
|
114
|
-
from ..models.
|
115
|
-
from ..models.labels_type_0 import LabelsType0
|
50
|
+
from ..models.integration_connection_spec import IntegrationConnectionSpec
|
51
|
+
from ..models.metadata import Metadata
|
116
52
|
|
117
53
|
if not src_dict:
|
118
54
|
return None
|
119
55
|
d = src_dict.copy()
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
updated_at = d.pop("updated_at", UNSET)
|
125
|
-
|
126
|
-
updated_by = d.pop("updated_by", UNSET)
|
127
|
-
|
128
|
-
_config = d.pop("config", UNSET)
|
129
|
-
config: Union[Unset, IntegrationConnectionConfig]
|
130
|
-
if isinstance(_config, Unset):
|
131
|
-
config = UNSET
|
56
|
+
_metadata = d.pop("metadata", UNSET)
|
57
|
+
metadata: Union[Unset, Metadata]
|
58
|
+
if isinstance(_metadata, Unset):
|
59
|
+
metadata = UNSET
|
132
60
|
else:
|
133
|
-
|
134
|
-
|
135
|
-
display_name = d.pop("display_name", UNSET)
|
136
|
-
|
137
|
-
integration = d.pop("integration", UNSET)
|
61
|
+
metadata = Metadata.from_dict(_metadata)
|
138
62
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
return data
|
144
|
-
try:
|
145
|
-
if not isinstance(data, dict):
|
146
|
-
raise TypeError()
|
147
|
-
componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
|
148
|
-
|
149
|
-
return componentsschemas_labels_type_0
|
150
|
-
except: # noqa: E722
|
151
|
-
pass
|
152
|
-
return cast(Union["LabelsType0", None, Unset], data)
|
153
|
-
|
154
|
-
labels = _parse_labels(d.pop("labels", UNSET))
|
155
|
-
|
156
|
-
name = d.pop("name", UNSET)
|
157
|
-
|
158
|
-
_secret = d.pop("secret", UNSET)
|
159
|
-
secret: Union[Unset, IntegrationConnectionSecret]
|
160
|
-
if isinstance(_secret, Unset):
|
161
|
-
secret = UNSET
|
63
|
+
_spec = d.pop("spec", UNSET)
|
64
|
+
spec: Union[Unset, IntegrationConnectionSpec]
|
65
|
+
if isinstance(_spec, Unset):
|
66
|
+
spec = UNSET
|
162
67
|
else:
|
163
|
-
|
164
|
-
|
165
|
-
workspace = d.pop("workspace", UNSET)
|
68
|
+
spec = IntegrationConnectionSpec.from_dict(_spec)
|
166
69
|
|
167
70
|
integration_connection = cls(
|
168
|
-
|
169
|
-
|
170
|
-
updated_at=updated_at,
|
171
|
-
updated_by=updated_by,
|
172
|
-
config=config,
|
173
|
-
display_name=display_name,
|
174
|
-
integration=integration,
|
175
|
-
labels=labels,
|
176
|
-
name=name,
|
177
|
-
secret=secret,
|
178
|
-
workspace=workspace,
|
71
|
+
metadata=metadata,
|
72
|
+
spec=spec,
|
179
73
|
)
|
180
74
|
|
181
75
|
integration_connection.additional_properties = d
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -29,13 +29,13 @@ class IntegrationConnectionSpec:
|
|
29
29
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
30
30
|
|
31
31
|
def to_dict(self) -> dict[str, Any]:
|
32
|
-
config: Union[Unset,
|
32
|
+
config: Union[Unset, dict[str, Any]] = UNSET
|
33
33
|
if not isinstance(self.config, Unset):
|
34
34
|
config = self.config.to_dict()
|
35
35
|
|
36
36
|
integration = self.integration
|
37
37
|
|
38
|
-
secret: Union[Unset,
|
38
|
+
secret: Union[Unset, dict[str, Any]] = UNSET
|
39
39
|
if not isinstance(self.secret, Unset):
|
40
40
|
secret = self.secret.to_dict()
|
41
41
|
|
@@ -52,10 +52,12 @@ class IntegrationConnectionSpec:
|
|
52
52
|
return field_dict
|
53
53
|
|
54
54
|
@classmethod
|
55
|
-
def from_dict(cls:
|
55
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
56
56
|
from ..models.integration_connection_config import IntegrationConnectionConfig
|
57
57
|
from ..models.integration_connection_secret import IntegrationConnectionSecret
|
58
58
|
|
59
|
+
if not src_dict:
|
60
|
+
return None
|
59
61
|
d = src_dict.copy()
|
60
62
|
_config = d.pop("config", UNSET)
|
61
63
|
config: Union[Unset, IntegrationConnectionConfig]
|