beamlit 0.0.20rc2__py3-none-any.whl → 0.0.20rc4__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- beamlit/api/agents/delete_agent_history.py +155 -0
- beamlit/api/agents/get_agent_deployment.py +1 -22
- beamlit/api/agents/get_agent_environment_logs.py +151 -0
- beamlit/api/agents/get_agent_history.py +155 -0
- beamlit/api/agents/list_agent_history.py +151 -0
- beamlit/api/agents/put_agent_history.py +181 -0
- beamlit/api/functions/get_function_environment_logs.py +151 -0
- beamlit/api/models/get_model_environment_logs.py +155 -0
- beamlit/common/generate.py +8 -3
- beamlit/common/settings.py +1 -6
- beamlit/models/__init__.py +28 -30
- beamlit/models/acl.py +2 -0
- beamlit/models/agent.py +2 -0
- beamlit/models/agent_chain.py +2 -0
- beamlit/models/agent_configuration.py +2 -0
- beamlit/models/agent_deployment.py +44 -99
- beamlit/models/agent_deployment_configuration.py +45 -0
- beamlit/models/agent_deployment_history.py +15 -46
- beamlit/models/agent_deployment_history_event.py +24 -78
- beamlit/models/agent_deployment_pod_template.py +45 -0
- beamlit/models/agent_history.py +165 -0
- beamlit/models/agent_history_event.py +131 -0
- beamlit/models/agent_metadata.py +144 -0
- beamlit/models/agent_release.py +2 -0
- beamlit/models/agent_spec.py +238 -0
- beamlit/models/agent_with_deployments.py +2 -0
- beamlit/models/api_key.py +2 -0
- beamlit/models/authentication_provider_model.py +2 -0
- beamlit/models/authentication_provider_organization.py +2 -0
- beamlit/models/configuration.py +2 -0
- beamlit/models/continent.py +2 -0
- beamlit/models/core_spec.py +179 -0
- beamlit/models/country.py +2 -0
- beamlit/models/create_api_key_for_service_account_body.py +2 -0
- beamlit/models/create_workspace_service_account_body.py +2 -0
- beamlit/models/create_workspace_service_account_response_200.py +2 -0
- beamlit/models/delete_workspace_service_account_response_200.py +2 -0
- beamlit/models/deployment_configuration.py +2 -0
- beamlit/models/deployment_configurations.py +2 -0
- beamlit/models/deployment_serverless_config.py +131 -0
- beamlit/models/environment.py +2 -0
- beamlit/models/environment_metrics.py +2 -0
- beamlit/models/environment_spec.py +61 -0
- beamlit/models/flavor.py +2 -0
- beamlit/models/function.py +2 -0
- beamlit/models/function_configuration.py +2 -0
- beamlit/models/function_deployment.py +44 -99
- beamlit/models/function_deployment_configuration.py +45 -0
- beamlit/models/function_deployment_pod_template.py +45 -0
- beamlit/models/function_kit.py +2 -0
- beamlit/models/function_metadata.py +144 -0
- beamlit/models/function_provider_ref.py +2 -0
- beamlit/models/function_release.py +2 -0
- beamlit/models/function_spec.py +240 -0
- beamlit/models/function_with_deployments.py +2 -0
- beamlit/models/get_workspace_service_accounts_response_200_item.py +2 -0
- beamlit/models/increase_and_rate_metric.py +2 -0
- beamlit/models/integration.py +2 -0
- beamlit/models/integration_config.py +2 -0
- beamlit/models/integration_connection.py +2 -0
- beamlit/models/integration_connection_config.py +2 -0
- beamlit/models/integration_connection_secret.py +2 -0
- beamlit/models/integration_connection_spec.py +99 -0
- beamlit/models/integration_model.py +2 -0
- beamlit/models/integration_secret.py +2 -0
- beamlit/models/invite_workspace_user_body.py +2 -0
- beamlit/models/labels_type_0.py +2 -0
- beamlit/models/location.py +2 -0
- beamlit/models/location_response.py +2 -0
- beamlit/models/metadata.py +135 -0
- beamlit/models/metadata_labels.py +43 -0
- beamlit/models/metric.py +2 -0
- beamlit/models/metrics.py +2 -0
- beamlit/models/model.py +2 -0
- beamlit/models/model_deployment.py +66 -85
- beamlit/models/model_deployment_log.py +2 -0
- beamlit/models/model_deployment_metrics.py +2 -0
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +2 -0
- beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +2 -0
- beamlit/models/model_deployment_pod_template.py +45 -0
- beamlit/models/model_metadata.py +144 -0
- beamlit/models/model_metrics.py +2 -0
- beamlit/models/model_provider.py +2 -0
- beamlit/models/model_provider_ref.py +2 -0
- beamlit/models/model_release.py +2 -0
- beamlit/models/model_spec.py +188 -0
- beamlit/models/model_with_deployments.py +2 -0
- beamlit/models/owner_fields.py +68 -0
- beamlit/models/pending_invitation.py +2 -0
- beamlit/models/pending_invitation_accept.py +2 -0
- beamlit/models/pending_invitation_render.py +2 -0
- beamlit/models/pending_invitation_render_invited_by.py +2 -0
- beamlit/models/pending_invitation_render_workspace.py +2 -0
- beamlit/models/pending_invitation_workspace_details.py +2 -0
- beamlit/models/pod_template_spec.py +43 -0
- beamlit/models/policy.py +36 -8
- beamlit/models/policy_location.py +2 -0
- beamlit/models/policy_spec.py +119 -0
- beamlit/models/provider_config.py +2 -0
- beamlit/models/qps.py +2 -0
- beamlit/models/resource_deployment_log.py +2 -0
- beamlit/models/resource_deployment_metrics.py +70 -155
- beamlit/models/resource_deployment_metrics_inference_per_region.py +77 -0
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +77 -0
- beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +75 -0
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +75 -0
- beamlit/models/resource_environment_metrics.py +172 -0
- beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +75 -0
- beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +73 -0
- beamlit/models/resource_log.py +68 -0
- beamlit/models/resource_metrics.py +2 -0
- beamlit/models/runtime.py +14 -29
- beamlit/models/runtime_readiness_probe.py +45 -0
- beamlit/models/runtime_resources.py +2 -0
- beamlit/models/runtime_type_0.py +111 -0
- beamlit/models/runtime_type_0_readiness_probe.py +43 -0
- beamlit/models/runtime_type_0_readiness_probe_type_0.py +43 -0
- beamlit/models/runtime_type_0_resources.py +59 -0
- beamlit/models/serverless_config.py +2 -0
- beamlit/models/spec_configuration.py +68 -0
- beamlit/models/standard_fields_dynamo_db.py +2 -0
- beamlit/models/store_agent.py +15 -29
- beamlit/models/store_agent_configuration.py +2 -0
- beamlit/models/store_agent_labels.py +45 -0
- beamlit/models/store_configuration.py +6 -15
- beamlit/models/store_configuration_option.py +7 -18
- beamlit/models/store_function.py +15 -29
- beamlit/models/store_function_configuration.py +2 -0
- beamlit/models/store_function_kit.py +2 -0
- beamlit/models/store_function_labels.py +45 -0
- beamlit/models/store_function_parameter.py +2 -0
- beamlit/models/time_fields.py +68 -0
- beamlit/models/update_workspace_service_account_body.py +2 -0
- beamlit/models/update_workspace_service_account_response_200.py +2 -0
- beamlit/models/update_workspace_user_role_body.py +2 -0
- beamlit/models/websocket_channel.py +86 -0
- beamlit/models/workspace.py +2 -0
- beamlit/models/workspace_labels.py +2 -0
- beamlit/models/workspace_user.py +2 -0
- {beamlit-0.0.20rc2.dist-info → beamlit-0.0.20rc4.dist-info}/METADATA +1 -1
- {beamlit-0.0.20rc2.dist-info → beamlit-0.0.20rc4.dist-info}/RECORD +142 -95
- {beamlit-0.0.20rc2.dist-info → beamlit-0.0.20rc4.dist-info}/WHEEL +0 -0
@@ -0,0 +1,188 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.flavor import Flavor
|
10
|
+
from ..models.pod_template_spec import PodTemplateSpec
|
11
|
+
from ..models.runtime import Runtime
|
12
|
+
from ..models.serverless_config import ServerlessConfig
|
13
|
+
from ..models.spec_configuration import SpecConfiguration
|
14
|
+
|
15
|
+
|
16
|
+
T = TypeVar("T", bound="ModelSpec")
|
17
|
+
|
18
|
+
|
19
|
+
@_attrs_define
|
20
|
+
class ModelSpec:
|
21
|
+
"""Model specification
|
22
|
+
|
23
|
+
Attributes:
|
24
|
+
configurations (Union[Unset, SpecConfiguration]): Agent configuration, this is a key value storage. In your
|
25
|
+
agent you can retrieve the value with config[key]
|
26
|
+
enabled (Union[Unset, bool]): Enable or disable the agent
|
27
|
+
flavors (Union[Unset, List['Flavor']]): Types of hardware available for deployments
|
28
|
+
integration_connections (Union[Unset, List[str]]):
|
29
|
+
pod_template (Union[Unset, PodTemplateSpec]): Pod template specification
|
30
|
+
policies (Union[Unset, List[str]]):
|
31
|
+
runtime (Union[Unset, Runtime]): Set of configurations for a deployment
|
32
|
+
serverless_config (Union[Unset, ServerlessConfig]): Configuration for a serverless deployment
|
33
|
+
model_provider (Union[Unset, str]): Model provider name
|
34
|
+
"""
|
35
|
+
|
36
|
+
configurations: Union[Unset, "SpecConfiguration"] = UNSET
|
37
|
+
enabled: Union[Unset, bool] = UNSET
|
38
|
+
flavors: Union[Unset, List["Flavor"]] = UNSET
|
39
|
+
integration_connections: Union[Unset, List[str]] = UNSET
|
40
|
+
pod_template: Union[Unset, "PodTemplateSpec"] = UNSET
|
41
|
+
policies: Union[Unset, List[str]] = UNSET
|
42
|
+
runtime: Union[Unset, "Runtime"] = UNSET
|
43
|
+
serverless_config: Union[Unset, "ServerlessConfig"] = UNSET
|
44
|
+
model_provider: Union[Unset, str] = UNSET
|
45
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
46
|
+
|
47
|
+
def to_dict(self) -> dict[str, Any]:
|
48
|
+
configurations: Union[Unset, Dict[str, Any]] = UNSET
|
49
|
+
if not isinstance(self.configurations, Unset):
|
50
|
+
configurations = self.configurations.to_dict()
|
51
|
+
|
52
|
+
enabled = self.enabled
|
53
|
+
|
54
|
+
flavors: Union[Unset, List[Dict[str, Any]]] = UNSET
|
55
|
+
if not isinstance(self.flavors, Unset):
|
56
|
+
flavors = []
|
57
|
+
for componentsschemas_flavors_item_data in self.flavors:
|
58
|
+
componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
|
59
|
+
flavors.append(componentsschemas_flavors_item)
|
60
|
+
|
61
|
+
integration_connections: Union[Unset, List[str]] = UNSET
|
62
|
+
if not isinstance(self.integration_connections, Unset):
|
63
|
+
integration_connections = self.integration_connections
|
64
|
+
|
65
|
+
pod_template: Union[Unset, Dict[str, Any]] = UNSET
|
66
|
+
if not isinstance(self.pod_template, Unset):
|
67
|
+
pod_template = self.pod_template.to_dict()
|
68
|
+
|
69
|
+
policies: Union[Unset, List[str]] = UNSET
|
70
|
+
if not isinstance(self.policies, Unset):
|
71
|
+
policies = self.policies
|
72
|
+
|
73
|
+
runtime: Union[Unset, Dict[str, Any]] = UNSET
|
74
|
+
if not isinstance(self.runtime, Unset):
|
75
|
+
runtime = self.runtime.to_dict()
|
76
|
+
|
77
|
+
serverless_config: Union[Unset, Dict[str, Any]] = UNSET
|
78
|
+
if not isinstance(self.serverless_config, Unset):
|
79
|
+
serverless_config = self.serverless_config.to_dict()
|
80
|
+
|
81
|
+
model_provider = self.model_provider
|
82
|
+
|
83
|
+
field_dict: dict[str, Any] = {}
|
84
|
+
field_dict.update(self.additional_properties)
|
85
|
+
field_dict.update({})
|
86
|
+
if configurations is not UNSET:
|
87
|
+
field_dict["configurations"] = configurations
|
88
|
+
if enabled is not UNSET:
|
89
|
+
field_dict["enabled"] = enabled
|
90
|
+
if flavors is not UNSET:
|
91
|
+
field_dict["flavors"] = flavors
|
92
|
+
if integration_connections is not UNSET:
|
93
|
+
field_dict["integrationConnections"] = integration_connections
|
94
|
+
if pod_template is not UNSET:
|
95
|
+
field_dict["podTemplate"] = pod_template
|
96
|
+
if policies is not UNSET:
|
97
|
+
field_dict["policies"] = policies
|
98
|
+
if runtime is not UNSET:
|
99
|
+
field_dict["runtime"] = runtime
|
100
|
+
if serverless_config is not UNSET:
|
101
|
+
field_dict["serverlessConfig"] = serverless_config
|
102
|
+
if model_provider is not UNSET:
|
103
|
+
field_dict["modelProvider"] = model_provider
|
104
|
+
|
105
|
+
return field_dict
|
106
|
+
|
107
|
+
@classmethod
|
108
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
109
|
+
from ..models.flavor import Flavor
|
110
|
+
from ..models.pod_template_spec import PodTemplateSpec
|
111
|
+
from ..models.runtime import Runtime
|
112
|
+
from ..models.serverless_config import ServerlessConfig
|
113
|
+
from ..models.spec_configuration import SpecConfiguration
|
114
|
+
|
115
|
+
d = src_dict.copy()
|
116
|
+
_configurations = d.pop("configurations", UNSET)
|
117
|
+
configurations: Union[Unset, SpecConfiguration]
|
118
|
+
if isinstance(_configurations, Unset):
|
119
|
+
configurations = UNSET
|
120
|
+
else:
|
121
|
+
configurations = SpecConfiguration.from_dict(_configurations)
|
122
|
+
|
123
|
+
enabled = d.pop("enabled", UNSET)
|
124
|
+
|
125
|
+
flavors = []
|
126
|
+
_flavors = d.pop("flavors", UNSET)
|
127
|
+
for componentsschemas_flavors_item_data in _flavors or []:
|
128
|
+
componentsschemas_flavors_item = Flavor.from_dict(componentsschemas_flavors_item_data)
|
129
|
+
|
130
|
+
flavors.append(componentsschemas_flavors_item)
|
131
|
+
|
132
|
+
integration_connections = cast(List[str], d.pop("integrationConnections", UNSET))
|
133
|
+
|
134
|
+
_pod_template = d.pop("podTemplate", UNSET)
|
135
|
+
pod_template: Union[Unset, PodTemplateSpec]
|
136
|
+
if isinstance(_pod_template, Unset):
|
137
|
+
pod_template = UNSET
|
138
|
+
else:
|
139
|
+
pod_template = PodTemplateSpec.from_dict(_pod_template)
|
140
|
+
|
141
|
+
policies = cast(List[str], d.pop("policies", UNSET))
|
142
|
+
|
143
|
+
_runtime = d.pop("runtime", UNSET)
|
144
|
+
runtime: Union[Unset, Runtime]
|
145
|
+
if isinstance(_runtime, Unset):
|
146
|
+
runtime = UNSET
|
147
|
+
else:
|
148
|
+
runtime = Runtime.from_dict(_runtime)
|
149
|
+
|
150
|
+
_serverless_config = d.pop("serverlessConfig", UNSET)
|
151
|
+
serverless_config: Union[Unset, ServerlessConfig]
|
152
|
+
if isinstance(_serverless_config, Unset):
|
153
|
+
serverless_config = UNSET
|
154
|
+
else:
|
155
|
+
serverless_config = ServerlessConfig.from_dict(_serverless_config)
|
156
|
+
|
157
|
+
model_provider = d.pop("modelProvider", UNSET)
|
158
|
+
|
159
|
+
model_spec = cls(
|
160
|
+
configurations=configurations,
|
161
|
+
enabled=enabled,
|
162
|
+
flavors=flavors,
|
163
|
+
integration_connections=integration_connections,
|
164
|
+
pod_template=pod_template,
|
165
|
+
policies=policies,
|
166
|
+
runtime=runtime,
|
167
|
+
serverless_config=serverless_config,
|
168
|
+
model_provider=model_provider,
|
169
|
+
)
|
170
|
+
|
171
|
+
model_spec.additional_properties = d
|
172
|
+
return model_spec
|
173
|
+
|
174
|
+
@property
|
175
|
+
def additional_keys(self) -> list[str]:
|
176
|
+
return list(self.additional_properties.keys())
|
177
|
+
|
178
|
+
def __getitem__(self, key: str) -> Any:
|
179
|
+
return self.additional_properties[key]
|
180
|
+
|
181
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
182
|
+
self.additional_properties[key] = value
|
183
|
+
|
184
|
+
def __delitem__(self, key: str) -> None:
|
185
|
+
del self.additional_properties[key]
|
186
|
+
|
187
|
+
def __contains__(self, key: str) -> bool:
|
188
|
+
return key in self.additional_properties
|
@@ -0,0 +1,68 @@
|
|
1
|
+
from typing import Any, Type, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="OwnerFields")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class OwnerFields:
|
13
|
+
"""Owner fields for Persistance
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
created_by (Union[Unset, str]): The user or service account who created the resource
|
17
|
+
updated_by (Union[Unset, str]): The user or service account who updated the resource
|
18
|
+
"""
|
19
|
+
|
20
|
+
created_by: Union[Unset, str] = UNSET
|
21
|
+
updated_by: Union[Unset, str] = UNSET
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
|
+
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
25
|
+
created_by = self.created_by
|
26
|
+
|
27
|
+
updated_by = self.updated_by
|
28
|
+
|
29
|
+
field_dict: dict[str, Any] = {}
|
30
|
+
field_dict.update(self.additional_properties)
|
31
|
+
field_dict.update({})
|
32
|
+
if created_by is not UNSET:
|
33
|
+
field_dict["createdBy"] = created_by
|
34
|
+
if updated_by is not UNSET:
|
35
|
+
field_dict["updatedBy"] = updated_by
|
36
|
+
|
37
|
+
return field_dict
|
38
|
+
|
39
|
+
@classmethod
|
40
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
41
|
+
d = src_dict.copy()
|
42
|
+
created_by = d.pop("createdBy", UNSET)
|
43
|
+
|
44
|
+
updated_by = d.pop("updatedBy", UNSET)
|
45
|
+
|
46
|
+
owner_fields = cls(
|
47
|
+
created_by=created_by,
|
48
|
+
updated_by=updated_by,
|
49
|
+
)
|
50
|
+
|
51
|
+
owner_fields.additional_properties = d
|
52
|
+
return owner_fields
|
53
|
+
|
54
|
+
@property
|
55
|
+
def additional_keys(self) -> list[str]:
|
56
|
+
return list(self.additional_properties.keys())
|
57
|
+
|
58
|
+
def __getitem__(self, key: str) -> Any:
|
59
|
+
return self.additional_properties[key]
|
60
|
+
|
61
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
62
|
+
self.additional_properties[key] = value
|
63
|
+
|
64
|
+
def __delitem__(self, key: str) -> None:
|
65
|
+
del self.additional_properties[key]
|
66
|
+
|
67
|
+
def __contains__(self, key: str) -> bool:
|
68
|
+
return key in self.additional_properties
|
@@ -78,6 +78,8 @@ class PendingInvitationRender:
|
|
78
78
|
from ..models.pending_invitation_render_workspace import PendingInvitationRenderWorkspace
|
79
79
|
from ..models.pending_invitation_workspace_details import PendingInvitationWorkspaceDetails
|
80
80
|
|
81
|
+
if not src_dict:
|
82
|
+
return None
|
81
83
|
d = src_dict.copy()
|
82
84
|
email = d.pop("email", UNSET)
|
83
85
|
|
@@ -0,0 +1,43 @@
|
|
1
|
+
from typing import Any, Type, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="PodTemplateSpec")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class PodTemplateSpec:
|
11
|
+
"""Pod template specification"""
|
12
|
+
|
13
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
14
|
+
|
15
|
+
def to_dict(self) -> dict[str, Any]:
|
16
|
+
field_dict: dict[str, Any] = {}
|
17
|
+
field_dict.update(self.additional_properties)
|
18
|
+
|
19
|
+
return field_dict
|
20
|
+
|
21
|
+
@classmethod
|
22
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
23
|
+
d = src_dict.copy()
|
24
|
+
pod_template_spec = cls()
|
25
|
+
|
26
|
+
pod_template_spec.additional_properties = d
|
27
|
+
return pod_template_spec
|
28
|
+
|
29
|
+
@property
|
30
|
+
def additional_keys(self) -> list[str]:
|
31
|
+
return list(self.additional_properties.keys())
|
32
|
+
|
33
|
+
def __getitem__(self, key: str) -> Any:
|
34
|
+
return self.additional_properties[key]
|
35
|
+
|
36
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
37
|
+
self.additional_properties[key] = value
|
38
|
+
|
39
|
+
def __delitem__(self, key: str) -> None:
|
40
|
+
del self.additional_properties[key]
|
41
|
+
|
42
|
+
def __contains__(self, key: str) -> bool:
|
43
|
+
return key in self.additional_properties
|
beamlit/models/policy.py
CHANGED
@@ -6,7 +6,9 @@ from attrs import field as _attrs_field
|
|
6
6
|
from ..types import UNSET, Unset
|
7
7
|
|
8
8
|
if TYPE_CHECKING:
|
9
|
+
from ..models.flavor import Flavor
|
9
10
|
from ..models.labels_type_0 import LabelsType0
|
11
|
+
from ..models.policy_location import PolicyLocation
|
10
12
|
|
11
13
|
|
12
14
|
T = TypeVar("T", bound="Policy")
|
@@ -22,9 +24,9 @@ class Policy:
|
|
22
24
|
updated_at (Union[Unset, str]): The date and time when the resource was updated
|
23
25
|
updated_by (Union[Unset, str]): The user or service account who updated the resource
|
24
26
|
display_name (Union[Unset, str]): Policy display name
|
25
|
-
flavors (Union[Unset,
|
27
|
+
flavors (Union[Unset, List['Flavor']]): Types of hardware available for deployments
|
26
28
|
labels (Union['LabelsType0', None, Unset]): Labels
|
27
|
-
locations (Union[Unset,
|
29
|
+
locations (Union[Unset, List['PolicyLocation']]): PolicyLocations is a local type that wraps a slice of Location
|
28
30
|
name (Union[Unset, str]): Policy name
|
29
31
|
resource_types (Union[Unset, List[str]]): PolicyResourceTypes is a local type that wraps a slice of
|
30
32
|
PolicyResourceType
|
@@ -37,9 +39,9 @@ class Policy:
|
|
37
39
|
updated_at: Union[Unset, str] = UNSET
|
38
40
|
updated_by: Union[Unset, str] = UNSET
|
39
41
|
display_name: Union[Unset, str] = UNSET
|
40
|
-
flavors: Union[Unset,
|
42
|
+
flavors: Union[Unset, List["Flavor"]] = UNSET
|
41
43
|
labels: Union["LabelsType0", None, Unset] = UNSET
|
42
|
-
locations: Union[Unset,
|
44
|
+
locations: Union[Unset, List["PolicyLocation"]] = UNSET
|
43
45
|
name: Union[Unset, str] = UNSET
|
44
46
|
resource_types: Union[Unset, List[str]] = UNSET
|
45
47
|
type: Union[Unset, str] = UNSET
|
@@ -59,7 +61,12 @@ class Policy:
|
|
59
61
|
|
60
62
|
display_name = self.display_name
|
61
63
|
|
62
|
-
flavors =
|
64
|
+
flavors: Union[Unset, List[Dict[str, Any]]] = UNSET
|
65
|
+
if not isinstance(self.flavors, Unset):
|
66
|
+
flavors = []
|
67
|
+
for componentsschemas_flavors_item_data in self.flavors:
|
68
|
+
componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
|
69
|
+
flavors.append(componentsschemas_flavors_item)
|
63
70
|
|
64
71
|
labels: Union[Dict[str, Any], None, Unset]
|
65
72
|
if isinstance(self.labels, Unset):
|
@@ -69,7 +76,12 @@ class Policy:
|
|
69
76
|
else:
|
70
77
|
labels = self.labels
|
71
78
|
|
72
|
-
locations =
|
79
|
+
locations: Union[Unset, List[Dict[str, Any]]] = UNSET
|
80
|
+
if not isinstance(self.locations, Unset):
|
81
|
+
locations = []
|
82
|
+
for componentsschemas_policy_locations_item_data in self.locations:
|
83
|
+
componentsschemas_policy_locations_item = componentsschemas_policy_locations_item_data.to_dict()
|
84
|
+
locations.append(componentsschemas_policy_locations_item)
|
73
85
|
|
74
86
|
name = self.name
|
75
87
|
|
@@ -113,8 +125,12 @@ class Policy:
|
|
113
125
|
|
114
126
|
@classmethod
|
115
127
|
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
128
|
+
from ..models.flavor import Flavor
|
116
129
|
from ..models.labels_type_0 import LabelsType0
|
130
|
+
from ..models.policy_location import PolicyLocation
|
117
131
|
|
132
|
+
if not src_dict:
|
133
|
+
return None
|
118
134
|
d = src_dict.copy()
|
119
135
|
created_at = d.pop("created_at", UNSET)
|
120
136
|
|
@@ -126,7 +142,12 @@ class Policy:
|
|
126
142
|
|
127
143
|
display_name = d.pop("display_name", UNSET)
|
128
144
|
|
129
|
-
flavors =
|
145
|
+
flavors = []
|
146
|
+
_flavors = d.pop("flavors", UNSET)
|
147
|
+
for componentsschemas_flavors_item_data in _flavors or []:
|
148
|
+
componentsschemas_flavors_item = Flavor.from_dict(componentsschemas_flavors_item_data)
|
149
|
+
|
150
|
+
flavors.append(componentsschemas_flavors_item)
|
130
151
|
|
131
152
|
def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
|
132
153
|
if data is None:
|
@@ -145,7 +166,14 @@ class Policy:
|
|
145
166
|
|
146
167
|
labels = _parse_labels(d.pop("labels", UNSET))
|
147
168
|
|
148
|
-
locations =
|
169
|
+
locations = []
|
170
|
+
_locations = d.pop("locations", UNSET)
|
171
|
+
for componentsschemas_policy_locations_item_data in _locations or []:
|
172
|
+
componentsschemas_policy_locations_item = PolicyLocation.from_dict(
|
173
|
+
componentsschemas_policy_locations_item_data
|
174
|
+
)
|
175
|
+
|
176
|
+
locations.append(componentsschemas_policy_locations_item)
|
149
177
|
|
150
178
|
name = d.pop("name", UNSET)
|
151
179
|
|
@@ -0,0 +1,119 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.flavor import Flavor
|
10
|
+
from ..models.policy_location import PolicyLocation
|
11
|
+
|
12
|
+
|
13
|
+
T = TypeVar("T", bound="PolicySpec")
|
14
|
+
|
15
|
+
|
16
|
+
@_attrs_define
|
17
|
+
class PolicySpec:
|
18
|
+
"""Policy specification
|
19
|
+
|
20
|
+
Attributes:
|
21
|
+
flavors (Union[Unset, List['Flavor']]): Types of hardware available for deployments
|
22
|
+
locations (Union[Unset, List['PolicyLocation']]): PolicyLocations is a local type that wraps a slice of Location
|
23
|
+
resource_types (Union[Unset, List[str]]): PolicyResourceTypes is a local type that wraps a slice of
|
24
|
+
PolicyResourceType
|
25
|
+
type (Union[Unset, str]): Policy type, can be location or flavor
|
26
|
+
"""
|
27
|
+
|
28
|
+
flavors: Union[Unset, List["Flavor"]] = UNSET
|
29
|
+
locations: Union[Unset, List["PolicyLocation"]] = UNSET
|
30
|
+
resource_types: Union[Unset, List[str]] = UNSET
|
31
|
+
type: Union[Unset, str] = UNSET
|
32
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
33
|
+
|
34
|
+
def to_dict(self) -> dict[str, Any]:
|
35
|
+
flavors: Union[Unset, List[Dict[str, Any]]] = UNSET
|
36
|
+
if not isinstance(self.flavors, Unset):
|
37
|
+
flavors = []
|
38
|
+
for componentsschemas_flavors_item_data in self.flavors:
|
39
|
+
componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
|
40
|
+
flavors.append(componentsschemas_flavors_item)
|
41
|
+
|
42
|
+
locations: Union[Unset, List[Dict[str, Any]]] = UNSET
|
43
|
+
if not isinstance(self.locations, Unset):
|
44
|
+
locations = []
|
45
|
+
for componentsschemas_policy_locations_item_data in self.locations:
|
46
|
+
componentsschemas_policy_locations_item = componentsschemas_policy_locations_item_data.to_dict()
|
47
|
+
locations.append(componentsschemas_policy_locations_item)
|
48
|
+
|
49
|
+
resource_types: Union[Unset, List[str]] = UNSET
|
50
|
+
if not isinstance(self.resource_types, Unset):
|
51
|
+
resource_types = self.resource_types
|
52
|
+
|
53
|
+
type = self.type
|
54
|
+
|
55
|
+
field_dict: dict[str, Any] = {}
|
56
|
+
field_dict.update(self.additional_properties)
|
57
|
+
field_dict.update({})
|
58
|
+
if flavors is not UNSET:
|
59
|
+
field_dict["flavors"] = flavors
|
60
|
+
if locations is not UNSET:
|
61
|
+
field_dict["locations"] = locations
|
62
|
+
if resource_types is not UNSET:
|
63
|
+
field_dict["resourceTypes"] = resource_types
|
64
|
+
if type is not UNSET:
|
65
|
+
field_dict["type"] = type
|
66
|
+
|
67
|
+
return field_dict
|
68
|
+
|
69
|
+
@classmethod
|
70
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
71
|
+
from ..models.flavor import Flavor
|
72
|
+
from ..models.policy_location import PolicyLocation
|
73
|
+
|
74
|
+
d = src_dict.copy()
|
75
|
+
flavors = []
|
76
|
+
_flavors = d.pop("flavors", UNSET)
|
77
|
+
for componentsschemas_flavors_item_data in _flavors or []:
|
78
|
+
componentsschemas_flavors_item = Flavor.from_dict(componentsschemas_flavors_item_data)
|
79
|
+
|
80
|
+
flavors.append(componentsschemas_flavors_item)
|
81
|
+
|
82
|
+
locations = []
|
83
|
+
_locations = d.pop("locations", UNSET)
|
84
|
+
for componentsschemas_policy_locations_item_data in _locations or []:
|
85
|
+
componentsschemas_policy_locations_item = PolicyLocation.from_dict(
|
86
|
+
componentsschemas_policy_locations_item_data
|
87
|
+
)
|
88
|
+
|
89
|
+
locations.append(componentsschemas_policy_locations_item)
|
90
|
+
|
91
|
+
resource_types = cast(List[str], d.pop("resourceTypes", UNSET))
|
92
|
+
|
93
|
+
type = d.pop("type", UNSET)
|
94
|
+
|
95
|
+
policy_spec = cls(
|
96
|
+
flavors=flavors,
|
97
|
+
locations=locations,
|
98
|
+
resource_types=resource_types,
|
99
|
+
type=type,
|
100
|
+
)
|
101
|
+
|
102
|
+
policy_spec.additional_properties = d
|
103
|
+
return policy_spec
|
104
|
+
|
105
|
+
@property
|
106
|
+
def additional_keys(self) -> list[str]:
|
107
|
+
return list(self.additional_properties.keys())
|
108
|
+
|
109
|
+
def __getitem__(self, key: str) -> Any:
|
110
|
+
return self.additional_properties[key]
|
111
|
+
|
112
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
113
|
+
self.additional_properties[key] = value
|
114
|
+
|
115
|
+
def __delitem__(self, key: str) -> None:
|
116
|
+
del self.additional_properties[key]
|
117
|
+
|
118
|
+
def __contains__(self, key: str) -> bool:
|
119
|
+
return key in self.additional_properties
|
beamlit/models/qps.py
CHANGED