beamlit 0.0.24rc20__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 +8 -11
- 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.24rc20.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.24rc20.dist-info/RECORD +0 -303
- {beamlit-0.0.24rc20.dist-info → beamlit-0.0.24rc21.dist-info}/WHEEL +0 -0
@@ -8,13 +8,9 @@ from ..types import UNSET, Unset
|
|
8
8
|
if TYPE_CHECKING:
|
9
9
|
from ..models.metric import Metric
|
10
10
|
from ..models.qps import QPS
|
11
|
-
from ..models.resource_deployment_metrics_inference_per_region import ResourceDeploymentMetricsInferencePerRegion
|
12
11
|
from ..models.resource_deployment_metrics_inference_per_second_per_region import (
|
13
12
|
ResourceDeploymentMetricsInferencePerSecondPerRegion,
|
14
13
|
)
|
15
|
-
from ..models.resource_deployment_metrics_query_per_region_per_code import (
|
16
|
-
ResourceDeploymentMetricsQueryPerRegionPerCode,
|
17
|
-
)
|
18
14
|
from ..models.resource_deployment_metrics_query_per_second_per_region_per_code import (
|
19
15
|
ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode,
|
20
16
|
)
|
@@ -28,19 +24,9 @@ class ResourceDeploymentMetrics:
|
|
28
24
|
"""Metrics for a single resource deployment (eg. model deployment, function deployment)
|
29
25
|
|
30
26
|
Attributes:
|
31
|
-
inference_global (Union[Unset, list['Metric']]): Array of metrics
|
32
|
-
inference_per_region (Union[Unset, ResourceDeploymentMetricsInferencePerRegion]): Historical requests (in last
|
33
|
-
24 hours) per location, for the model deployment
|
34
27
|
inference_per_second_global (Union[Unset, list['Metric']]): Array of metrics
|
35
28
|
inference_per_second_per_region (Union[Unset, ResourceDeploymentMetricsInferencePerSecondPerRegion]): Historical
|
36
29
|
requests per second (RPS) per location, for the model deployment
|
37
|
-
query_global (Union[Unset, float]): Number of requests done on the resource for the model deployment
|
38
|
-
query_per_code_global (Union[Unset, QPS]): Query per second per element, can be per response status code (e.g.
|
39
|
-
200, 400) or per location
|
40
|
-
query_per_region (Union[Unset, QPS]): Query per second per element, can be per response status code (e.g. 200,
|
41
|
-
400) or per location
|
42
|
-
query_per_region_per_code (Union[Unset, ResourceDeploymentMetricsQueryPerRegionPerCode]): Number of requests
|
43
|
-
done on the resource for the model deployment
|
44
30
|
query_per_second_global (Union[Unset, float]): RPS value (in last 24 hours) for the model deployment globally
|
45
31
|
query_per_second_per_code_global (Union[Unset, QPS]): Query per second per element, can be per response status
|
46
32
|
code (e.g. 200, 400) or per location
|
@@ -50,14 +36,8 @@ class ResourceDeploymentMetrics:
|
|
50
36
|
RPS value (in last 24 hours) per response status code per location, for the model deployment
|
51
37
|
"""
|
52
38
|
|
53
|
-
inference_global: Union[Unset, list["Metric"]] = UNSET
|
54
|
-
inference_per_region: Union[Unset, "ResourceDeploymentMetricsInferencePerRegion"] = UNSET
|
55
39
|
inference_per_second_global: Union[Unset, list["Metric"]] = UNSET
|
56
40
|
inference_per_second_per_region: Union[Unset, "ResourceDeploymentMetricsInferencePerSecondPerRegion"] = UNSET
|
57
|
-
query_global: Union[Unset, float] = UNSET
|
58
|
-
query_per_code_global: Union[Unset, "QPS"] = UNSET
|
59
|
-
query_per_region: Union[Unset, "QPS"] = UNSET
|
60
|
-
query_per_region_per_code: Union[Unset, "ResourceDeploymentMetricsQueryPerRegionPerCode"] = UNSET
|
61
41
|
query_per_second_global: Union[Unset, float] = UNSET
|
62
42
|
query_per_second_per_code_global: Union[Unset, "QPS"] = UNSET
|
63
43
|
query_per_second_per_region: Union[Unset, "QPS"] = UNSET
|
@@ -67,17 +47,6 @@ class ResourceDeploymentMetrics:
|
|
67
47
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
68
48
|
|
69
49
|
def to_dict(self) -> dict[str, Any]:
|
70
|
-
inference_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
71
|
-
if not isinstance(self.inference_global, Unset):
|
72
|
-
inference_global = []
|
73
|
-
for componentsschemas_array_metric_item_data in self.inference_global:
|
74
|
-
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
75
|
-
inference_global.append(componentsschemas_array_metric_item)
|
76
|
-
|
77
|
-
inference_per_region: Union[Unset, dict[str, Any]] = UNSET
|
78
|
-
if not isinstance(self.inference_per_region, Unset):
|
79
|
-
inference_per_region = self.inference_per_region.to_dict()
|
80
|
-
|
81
50
|
inference_per_second_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
82
51
|
if not isinstance(self.inference_per_second_global, Unset):
|
83
52
|
inference_per_second_global = []
|
@@ -89,20 +58,6 @@ class ResourceDeploymentMetrics:
|
|
89
58
|
if not isinstance(self.inference_per_second_per_region, Unset):
|
90
59
|
inference_per_second_per_region = self.inference_per_second_per_region.to_dict()
|
91
60
|
|
92
|
-
query_global = self.query_global
|
93
|
-
|
94
|
-
query_per_code_global: Union[Unset, dict[str, Any]] = UNSET
|
95
|
-
if not isinstance(self.query_per_code_global, Unset):
|
96
|
-
query_per_code_global = self.query_per_code_global.to_dict()
|
97
|
-
|
98
|
-
query_per_region: Union[Unset, dict[str, Any]] = UNSET
|
99
|
-
if not isinstance(self.query_per_region, Unset):
|
100
|
-
query_per_region = self.query_per_region.to_dict()
|
101
|
-
|
102
|
-
query_per_region_per_code: Union[Unset, dict[str, Any]] = UNSET
|
103
|
-
if not isinstance(self.query_per_region_per_code, Unset):
|
104
|
-
query_per_region_per_code = self.query_per_region_per_code.to_dict()
|
105
|
-
|
106
61
|
query_per_second_global = self.query_per_second_global
|
107
62
|
|
108
63
|
query_per_second_per_code_global: Union[Unset, dict[str, Any]] = UNSET
|
@@ -120,22 +75,10 @@ class ResourceDeploymentMetrics:
|
|
120
75
|
field_dict: dict[str, Any] = {}
|
121
76
|
field_dict.update(self.additional_properties)
|
122
77
|
field_dict.update({})
|
123
|
-
if inference_global is not UNSET:
|
124
|
-
field_dict["inference_global"] = inference_global
|
125
|
-
if inference_per_region is not UNSET:
|
126
|
-
field_dict["inference_per_region"] = inference_per_region
|
127
78
|
if inference_per_second_global is not UNSET:
|
128
79
|
field_dict["inference_per_second_global"] = inference_per_second_global
|
129
80
|
if inference_per_second_per_region is not UNSET:
|
130
81
|
field_dict["inference_per_second_per_region"] = inference_per_second_per_region
|
131
|
-
if query_global is not UNSET:
|
132
|
-
field_dict["query_global"] = query_global
|
133
|
-
if query_per_code_global is not UNSET:
|
134
|
-
field_dict["query_per_code_global"] = query_per_code_global
|
135
|
-
if query_per_region is not UNSET:
|
136
|
-
field_dict["query_per_region"] = query_per_region
|
137
|
-
if query_per_region_per_code is not UNSET:
|
138
|
-
field_dict["query_per_region_per_code"] = query_per_region_per_code
|
139
82
|
if query_per_second_global is not UNSET:
|
140
83
|
field_dict["query_per_second_global"] = query_per_second_global
|
141
84
|
if query_per_second_per_code_global is not UNSET:
|
@@ -151,15 +94,9 @@ class ResourceDeploymentMetrics:
|
|
151
94
|
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
152
95
|
from ..models.metric import Metric
|
153
96
|
from ..models.qps import QPS
|
154
|
-
from ..models.resource_deployment_metrics_inference_per_region import (
|
155
|
-
ResourceDeploymentMetricsInferencePerRegion,
|
156
|
-
)
|
157
97
|
from ..models.resource_deployment_metrics_inference_per_second_per_region import (
|
158
98
|
ResourceDeploymentMetricsInferencePerSecondPerRegion,
|
159
99
|
)
|
160
|
-
from ..models.resource_deployment_metrics_query_per_region_per_code import (
|
161
|
-
ResourceDeploymentMetricsQueryPerRegionPerCode,
|
162
|
-
)
|
163
100
|
from ..models.resource_deployment_metrics_query_per_second_per_region_per_code import (
|
164
101
|
ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode,
|
165
102
|
)
|
@@ -167,20 +104,6 @@ class ResourceDeploymentMetrics:
|
|
167
104
|
if not src_dict:
|
168
105
|
return None
|
169
106
|
d = src_dict.copy()
|
170
|
-
inference_global = []
|
171
|
-
_inference_global = d.pop("inference_global", UNSET)
|
172
|
-
for componentsschemas_array_metric_item_data in _inference_global or []:
|
173
|
-
componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
|
174
|
-
|
175
|
-
inference_global.append(componentsschemas_array_metric_item)
|
176
|
-
|
177
|
-
_inference_per_region = d.pop("inference_per_region", UNSET)
|
178
|
-
inference_per_region: Union[Unset, ResourceDeploymentMetricsInferencePerRegion]
|
179
|
-
if isinstance(_inference_per_region, Unset):
|
180
|
-
inference_per_region = UNSET
|
181
|
-
else:
|
182
|
-
inference_per_region = ResourceDeploymentMetricsInferencePerRegion.from_dict(_inference_per_region)
|
183
|
-
|
184
107
|
inference_per_second_global = []
|
185
108
|
_inference_per_second_global = d.pop("inference_per_second_global", UNSET)
|
186
109
|
for componentsschemas_array_metric_item_data in _inference_per_second_global or []:
|
@@ -197,31 +120,6 @@ class ResourceDeploymentMetrics:
|
|
197
120
|
_inference_per_second_per_region
|
198
121
|
)
|
199
122
|
|
200
|
-
query_global = d.pop("query_global", UNSET)
|
201
|
-
|
202
|
-
_query_per_code_global = d.pop("query_per_code_global", UNSET)
|
203
|
-
query_per_code_global: Union[Unset, QPS]
|
204
|
-
if isinstance(_query_per_code_global, Unset):
|
205
|
-
query_per_code_global = UNSET
|
206
|
-
else:
|
207
|
-
query_per_code_global = QPS.from_dict(_query_per_code_global)
|
208
|
-
|
209
|
-
_query_per_region = d.pop("query_per_region", UNSET)
|
210
|
-
query_per_region: Union[Unset, QPS]
|
211
|
-
if isinstance(_query_per_region, Unset):
|
212
|
-
query_per_region = UNSET
|
213
|
-
else:
|
214
|
-
query_per_region = QPS.from_dict(_query_per_region)
|
215
|
-
|
216
|
-
_query_per_region_per_code = d.pop("query_per_region_per_code", UNSET)
|
217
|
-
query_per_region_per_code: Union[Unset, ResourceDeploymentMetricsQueryPerRegionPerCode]
|
218
|
-
if isinstance(_query_per_region_per_code, Unset):
|
219
|
-
query_per_region_per_code = UNSET
|
220
|
-
else:
|
221
|
-
query_per_region_per_code = ResourceDeploymentMetricsQueryPerRegionPerCode.from_dict(
|
222
|
-
_query_per_region_per_code
|
223
|
-
)
|
224
|
-
|
225
123
|
query_per_second_global = d.pop("query_per_second_global", UNSET)
|
226
124
|
|
227
125
|
_query_per_second_per_code_global = d.pop("query_per_second_per_code_global", UNSET)
|
@@ -248,14 +146,8 @@ class ResourceDeploymentMetrics:
|
|
248
146
|
)
|
249
147
|
|
250
148
|
resource_deployment_metrics = cls(
|
251
|
-
inference_global=inference_global,
|
252
|
-
inference_per_region=inference_per_region,
|
253
149
|
inference_per_second_global=inference_per_second_global,
|
254
150
|
inference_per_second_per_region=inference_per_second_per_region,
|
255
|
-
query_global=query_global,
|
256
|
-
query_per_code_global=query_per_code_global,
|
257
|
-
query_per_region=query_per_region,
|
258
|
-
query_per_region_per_code=query_per_region_per_code,
|
259
151
|
query_per_second_global=query_per_second_global,
|
260
152
|
query_per_second_per_code_global=query_per_second_per_code_global,
|
261
153
|
query_per_second_per_region=query_per_second_per_region,
|
@@ -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
|
@@ -8,9 +8,13 @@ from ..types import UNSET, Unset
|
|
8
8
|
if TYPE_CHECKING:
|
9
9
|
from ..models.metric import Metric
|
10
10
|
from ..models.qps import QPS
|
11
|
+
from ..models.resource_environment_metrics_inference_per_region import ResourceEnvironmentMetricsInferencePerRegion
|
11
12
|
from ..models.resource_environment_metrics_inference_per_second_per_region import (
|
12
13
|
ResourceEnvironmentMetricsInferencePerSecondPerRegion,
|
13
14
|
)
|
15
|
+
from ..models.resource_environment_metrics_query_per_region_per_code import (
|
16
|
+
ResourceEnvironmentMetricsQueryPerRegionPerCode,
|
17
|
+
)
|
14
18
|
from ..models.resource_environment_metrics_query_per_second_per_region_per_code import (
|
15
19
|
ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode,
|
16
20
|
)
|
@@ -24,9 +28,19 @@ class ResourceEnvironmentMetrics:
|
|
24
28
|
"""Metrics for a single resource deployment (eg. model deployment, function deployment)
|
25
29
|
|
26
30
|
Attributes:
|
27
|
-
|
31
|
+
inference_global (Union[Unset, list['Metric']]): Array of metrics
|
32
|
+
inference_per_region (Union[Unset, ResourceEnvironmentMetricsInferencePerRegion]): Historical requests (in last
|
33
|
+
24 hours) per location, for the model deployment
|
34
|
+
inference_per_second_global (Union[Unset, list['Metric']]): Array of metrics
|
28
35
|
inference_per_second_per_region (Union[Unset, ResourceEnvironmentMetricsInferencePerSecondPerRegion]):
|
29
36
|
Historical requests per second (RPS) per location, for the model deployment
|
37
|
+
query_global (Union[Unset, float]): Number of requests done on the resource for the model deployment
|
38
|
+
query_per_code_global (Union[Unset, QPS]): Query per second per element, can be per response status code (e.g.
|
39
|
+
200, 400) or per location
|
40
|
+
query_per_region (Union[Unset, QPS]): Query per second per element, can be per response status code (e.g. 200,
|
41
|
+
400) or per location
|
42
|
+
query_per_region_per_code (Union[Unset, ResourceEnvironmentMetricsQueryPerRegionPerCode]): Number of requests
|
43
|
+
done on the resource for the model deployment
|
30
44
|
query_per_second_global (Union[Unset, float]): RPS value (in last 24 hours) for the model deployment globally
|
31
45
|
query_per_second_per_code_global (Union[Unset, QPS]): Query per second per element, can be per response status
|
32
46
|
code (e.g. 200, 400) or per location
|
@@ -36,128 +50,186 @@ class ResourceEnvironmentMetrics:
|
|
36
50
|
RPS value (in last 24 hours) per response status code per location, for the model deployment
|
37
51
|
"""
|
38
52
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
] = UNSET
|
53
|
+
inference_global: Union[Unset, list["Metric"]] = UNSET
|
54
|
+
inference_per_region: Union[Unset, "ResourceEnvironmentMetricsInferencePerRegion"] = UNSET
|
55
|
+
inference_per_second_global: Union[Unset, list["Metric"]] = UNSET
|
56
|
+
inference_per_second_per_region: Union[Unset, "ResourceEnvironmentMetricsInferencePerSecondPerRegion"] = UNSET
|
57
|
+
query_global: Union[Unset, float] = UNSET
|
58
|
+
query_per_code_global: Union[Unset, "QPS"] = UNSET
|
59
|
+
query_per_region: Union[Unset, "QPS"] = UNSET
|
60
|
+
query_per_region_per_code: Union[Unset, "ResourceEnvironmentMetricsQueryPerRegionPerCode"] = UNSET
|
43
61
|
query_per_second_global: Union[Unset, float] = UNSET
|
44
62
|
query_per_second_per_code_global: Union[Unset, "QPS"] = UNSET
|
45
63
|
query_per_second_per_region: Union[Unset, "QPS"] = UNSET
|
46
|
-
query_per_second_per_region_per_code: Union[
|
47
|
-
|
48
|
-
|
64
|
+
query_per_second_per_region_per_code: Union[Unset, "ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode"] = (
|
65
|
+
UNSET
|
66
|
+
)
|
49
67
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
50
68
|
|
51
69
|
def to_dict(self) -> dict[str, Any]:
|
52
|
-
|
70
|
+
inference_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
71
|
+
if not isinstance(self.inference_global, Unset):
|
72
|
+
inference_global = []
|
73
|
+
for componentsschemas_array_metric_item_data in self.inference_global:
|
74
|
+
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
75
|
+
inference_global.append(componentsschemas_array_metric_item)
|
76
|
+
|
77
|
+
inference_per_region: Union[Unset, dict[str, Any]] = UNSET
|
78
|
+
if not isinstance(self.inference_per_region, Unset):
|
79
|
+
inference_per_region = self.inference_per_region.to_dict()
|
80
|
+
|
81
|
+
inference_per_second_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
53
82
|
if not isinstance(self.inference_per_second_global, Unset):
|
54
83
|
inference_per_second_global = []
|
55
|
-
for
|
56
|
-
componentsschemas_array_metric_item_data
|
57
|
-
) in self.inference_per_second_global:
|
58
|
-
componentsschemas_array_metric_item = (
|
59
|
-
componentsschemas_array_metric_item_data.to_dict()
|
60
|
-
)
|
84
|
+
for componentsschemas_array_metric_item_data in self.inference_per_second_global:
|
85
|
+
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
61
86
|
inference_per_second_global.append(componentsschemas_array_metric_item)
|
62
87
|
|
63
|
-
inference_per_second_per_region: Union[Unset,
|
88
|
+
inference_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
|
64
89
|
if not isinstance(self.inference_per_second_per_region, Unset):
|
65
|
-
inference_per_second_per_region = (
|
66
|
-
|
67
|
-
|
90
|
+
inference_per_second_per_region = self.inference_per_second_per_region.to_dict()
|
91
|
+
|
92
|
+
query_global = self.query_global
|
93
|
+
|
94
|
+
query_per_code_global: Union[Unset, dict[str, Any]] = UNSET
|
95
|
+
if not isinstance(self.query_per_code_global, Unset):
|
96
|
+
query_per_code_global = self.query_per_code_global.to_dict()
|
97
|
+
|
98
|
+
query_per_region: Union[Unset, dict[str, Any]] = UNSET
|
99
|
+
if not isinstance(self.query_per_region, Unset):
|
100
|
+
query_per_region = self.query_per_region.to_dict()
|
101
|
+
|
102
|
+
query_per_region_per_code: Union[Unset, dict[str, Any]] = UNSET
|
103
|
+
if not isinstance(self.query_per_region_per_code, Unset):
|
104
|
+
query_per_region_per_code = self.query_per_region_per_code.to_dict()
|
68
105
|
|
69
106
|
query_per_second_global = self.query_per_second_global
|
70
107
|
|
71
|
-
query_per_second_per_code_global: Union[Unset,
|
108
|
+
query_per_second_per_code_global: Union[Unset, dict[str, Any]] = UNSET
|
72
109
|
if not isinstance(self.query_per_second_per_code_global, Unset):
|
73
|
-
query_per_second_per_code_global = (
|
74
|
-
self.query_per_second_per_code_global.to_dict()
|
75
|
-
)
|
110
|
+
query_per_second_per_code_global = self.query_per_second_per_code_global.to_dict()
|
76
111
|
|
77
|
-
query_per_second_per_region: Union[Unset,
|
112
|
+
query_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
|
78
113
|
if not isinstance(self.query_per_second_per_region, Unset):
|
79
114
|
query_per_second_per_region = self.query_per_second_per_region.to_dict()
|
80
115
|
|
81
|
-
query_per_second_per_region_per_code: Union[Unset,
|
116
|
+
query_per_second_per_region_per_code: Union[Unset, dict[str, Any]] = UNSET
|
82
117
|
if not isinstance(self.query_per_second_per_region_per_code, Unset):
|
83
|
-
query_per_second_per_region_per_code = (
|
84
|
-
self.query_per_second_per_region_per_code.to_dict()
|
85
|
-
)
|
118
|
+
query_per_second_per_region_per_code = self.query_per_second_per_region_per_code.to_dict()
|
86
119
|
|
87
120
|
field_dict: dict[str, Any] = {}
|
88
121
|
field_dict.update(self.additional_properties)
|
89
122
|
field_dict.update({})
|
123
|
+
if inference_global is not UNSET:
|
124
|
+
field_dict["inference_global"] = inference_global
|
125
|
+
if inference_per_region is not UNSET:
|
126
|
+
field_dict["inference_per_region"] = inference_per_region
|
90
127
|
if inference_per_second_global is not UNSET:
|
91
128
|
field_dict["inference_per_second_global"] = inference_per_second_global
|
92
129
|
if inference_per_second_per_region is not UNSET:
|
93
|
-
field_dict["inference_per_second_per_region"] =
|
94
|
-
|
95
|
-
|
130
|
+
field_dict["inference_per_second_per_region"] = inference_per_second_per_region
|
131
|
+
if query_global is not UNSET:
|
132
|
+
field_dict["query_global"] = query_global
|
133
|
+
if query_per_code_global is not UNSET:
|
134
|
+
field_dict["query_per_code_global"] = query_per_code_global
|
135
|
+
if query_per_region is not UNSET:
|
136
|
+
field_dict["query_per_region"] = query_per_region
|
137
|
+
if query_per_region_per_code is not UNSET:
|
138
|
+
field_dict["query_per_region_per_code"] = query_per_region_per_code
|
96
139
|
if query_per_second_global is not UNSET:
|
97
140
|
field_dict["query_per_second_global"] = query_per_second_global
|
98
141
|
if query_per_second_per_code_global is not UNSET:
|
99
|
-
field_dict["query_per_second_per_code_global"] =
|
100
|
-
query_per_second_per_code_global
|
101
|
-
)
|
142
|
+
field_dict["query_per_second_per_code_global"] = query_per_second_per_code_global
|
102
143
|
if query_per_second_per_region is not UNSET:
|
103
144
|
field_dict["query_per_second_per_region"] = query_per_second_per_region
|
104
145
|
if query_per_second_per_region_per_code is not UNSET:
|
105
|
-
field_dict["query_per_second_per_region_per_code"] =
|
106
|
-
query_per_second_per_region_per_code
|
107
|
-
)
|
146
|
+
field_dict["query_per_second_per_region_per_code"] = query_per_second_per_region_per_code
|
108
147
|
|
109
148
|
return field_dict
|
110
149
|
|
111
150
|
@classmethod
|
112
|
-
def from_dict(cls:
|
151
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
113
152
|
from ..models.metric import Metric
|
114
153
|
from ..models.qps import QPS
|
154
|
+
from ..models.resource_environment_metrics_inference_per_region import (
|
155
|
+
ResourceEnvironmentMetricsInferencePerRegion,
|
156
|
+
)
|
115
157
|
from ..models.resource_environment_metrics_inference_per_second_per_region import (
|
116
158
|
ResourceEnvironmentMetricsInferencePerSecondPerRegion,
|
117
159
|
)
|
160
|
+
from ..models.resource_environment_metrics_query_per_region_per_code import (
|
161
|
+
ResourceEnvironmentMetricsQueryPerRegionPerCode,
|
162
|
+
)
|
118
163
|
from ..models.resource_environment_metrics_query_per_second_per_region_per_code import (
|
119
164
|
ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode,
|
120
165
|
)
|
121
166
|
|
167
|
+
if not src_dict:
|
168
|
+
return None
|
122
169
|
d = src_dict.copy()
|
170
|
+
inference_global = []
|
171
|
+
_inference_global = d.pop("inference_global", UNSET)
|
172
|
+
for componentsschemas_array_metric_item_data in _inference_global or []:
|
173
|
+
componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
|
174
|
+
|
175
|
+
inference_global.append(componentsschemas_array_metric_item)
|
176
|
+
|
177
|
+
_inference_per_region = d.pop("inference_per_region", UNSET)
|
178
|
+
inference_per_region: Union[Unset, ResourceEnvironmentMetricsInferencePerRegion]
|
179
|
+
if isinstance(_inference_per_region, Unset):
|
180
|
+
inference_per_region = UNSET
|
181
|
+
else:
|
182
|
+
inference_per_region = ResourceEnvironmentMetricsInferencePerRegion.from_dict(_inference_per_region)
|
183
|
+
|
123
184
|
inference_per_second_global = []
|
124
185
|
_inference_per_second_global = d.pop("inference_per_second_global", UNSET)
|
125
|
-
for componentsschemas_array_metric_item_data in
|
126
|
-
|
127
|
-
):
|
128
|
-
componentsschemas_array_metric_item = Metric.from_dict(
|
129
|
-
componentsschemas_array_metric_item_data
|
130
|
-
)
|
186
|
+
for componentsschemas_array_metric_item_data in _inference_per_second_global or []:
|
187
|
+
componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
|
131
188
|
|
132
189
|
inference_per_second_global.append(componentsschemas_array_metric_item)
|
133
190
|
|
134
|
-
_inference_per_second_per_region = d.pop(
|
135
|
-
|
136
|
-
)
|
137
|
-
inference_per_second_per_region: Union[
|
138
|
-
Unset, ResourceEnvironmentMetricsInferencePerSecondPerRegion
|
139
|
-
]
|
191
|
+
_inference_per_second_per_region = d.pop("inference_per_second_per_region", UNSET)
|
192
|
+
inference_per_second_per_region: Union[Unset, ResourceEnvironmentMetricsInferencePerSecondPerRegion]
|
140
193
|
if isinstance(_inference_per_second_per_region, Unset):
|
141
194
|
inference_per_second_per_region = UNSET
|
142
195
|
else:
|
143
|
-
inference_per_second_per_region = (
|
144
|
-
|
145
|
-
|
146
|
-
|
196
|
+
inference_per_second_per_region = ResourceEnvironmentMetricsInferencePerSecondPerRegion.from_dict(
|
197
|
+
_inference_per_second_per_region
|
198
|
+
)
|
199
|
+
|
200
|
+
query_global = d.pop("query_global", UNSET)
|
201
|
+
|
202
|
+
_query_per_code_global = d.pop("query_per_code_global", UNSET)
|
203
|
+
query_per_code_global: Union[Unset, QPS]
|
204
|
+
if isinstance(_query_per_code_global, Unset):
|
205
|
+
query_per_code_global = UNSET
|
206
|
+
else:
|
207
|
+
query_per_code_global = QPS.from_dict(_query_per_code_global)
|
208
|
+
|
209
|
+
_query_per_region = d.pop("query_per_region", UNSET)
|
210
|
+
query_per_region: Union[Unset, QPS]
|
211
|
+
if isinstance(_query_per_region, Unset):
|
212
|
+
query_per_region = UNSET
|
213
|
+
else:
|
214
|
+
query_per_region = QPS.from_dict(_query_per_region)
|
215
|
+
|
216
|
+
_query_per_region_per_code = d.pop("query_per_region_per_code", UNSET)
|
217
|
+
query_per_region_per_code: Union[Unset, ResourceEnvironmentMetricsQueryPerRegionPerCode]
|
218
|
+
if isinstance(_query_per_region_per_code, Unset):
|
219
|
+
query_per_region_per_code = UNSET
|
220
|
+
else:
|
221
|
+
query_per_region_per_code = ResourceEnvironmentMetricsQueryPerRegionPerCode.from_dict(
|
222
|
+
_query_per_region_per_code
|
147
223
|
)
|
148
224
|
|
149
225
|
query_per_second_global = d.pop("query_per_second_global", UNSET)
|
150
226
|
|
151
|
-
_query_per_second_per_code_global = d.pop(
|
152
|
-
"query_per_second_per_code_global", UNSET
|
153
|
-
)
|
227
|
+
_query_per_second_per_code_global = d.pop("query_per_second_per_code_global", UNSET)
|
154
228
|
query_per_second_per_code_global: Union[Unset, QPS]
|
155
229
|
if isinstance(_query_per_second_per_code_global, Unset):
|
156
230
|
query_per_second_per_code_global = UNSET
|
157
231
|
else:
|
158
|
-
query_per_second_per_code_global = QPS.from_dict(
|
159
|
-
_query_per_second_per_code_global
|
160
|
-
)
|
232
|
+
query_per_second_per_code_global = QPS.from_dict(_query_per_second_per_code_global)
|
161
233
|
|
162
234
|
_query_per_second_per_region = d.pop("query_per_second_per_region", UNSET)
|
163
235
|
query_per_second_per_region: Union[Unset, QPS]
|
@@ -166,24 +238,24 @@ class ResourceEnvironmentMetrics:
|
|
166
238
|
else:
|
167
239
|
query_per_second_per_region = QPS.from_dict(_query_per_second_per_region)
|
168
240
|
|
169
|
-
_query_per_second_per_region_per_code = d.pop(
|
170
|
-
|
171
|
-
)
|
172
|
-
query_per_second_per_region_per_code: Union[
|
173
|
-
Unset, ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode
|
174
|
-
]
|
241
|
+
_query_per_second_per_region_per_code = d.pop("query_per_second_per_region_per_code", UNSET)
|
242
|
+
query_per_second_per_region_per_code: Union[Unset, ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode]
|
175
243
|
if isinstance(_query_per_second_per_region_per_code, Unset):
|
176
244
|
query_per_second_per_region_per_code = UNSET
|
177
245
|
else:
|
178
|
-
query_per_second_per_region_per_code = (
|
179
|
-
|
180
|
-
_query_per_second_per_region_per_code
|
181
|
-
)
|
246
|
+
query_per_second_per_region_per_code = ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode.from_dict(
|
247
|
+
_query_per_second_per_region_per_code
|
182
248
|
)
|
183
249
|
|
184
250
|
resource_environment_metrics = cls(
|
251
|
+
inference_global=inference_global,
|
252
|
+
inference_per_region=inference_per_region,
|
185
253
|
inference_per_second_global=inference_per_second_global,
|
186
254
|
inference_per_second_per_region=inference_per_second_per_region,
|
255
|
+
query_global=query_global,
|
256
|
+
query_per_code_global=query_per_code_global,
|
257
|
+
query_per_region=query_per_region,
|
258
|
+
query_per_region_per_code=query_per_region_per_code,
|
187
259
|
query_per_second_global=query_per_second_global,
|
188
260
|
query_per_second_per_code_global=query_per_second_per_code_global,
|
189
261
|
query_per_second_per_region=query_per_second_per_region,
|
@@ -9,11 +9,11 @@ if TYPE_CHECKING:
|
|
9
9
|
from ..models.metric import Metric
|
10
10
|
|
11
11
|
|
12
|
-
T = TypeVar("T", bound="
|
12
|
+
T = TypeVar("T", bound="ResourceEnvironmentMetricsInferencePerRegion")
|
13
13
|
|
14
14
|
|
15
15
|
@_attrs_define
|
16
|
-
class
|
16
|
+
class ResourceEnvironmentMetricsInferencePerRegion:
|
17
17
|
"""Historical requests (in last 24 hours) per location, for the model deployment
|
18
18
|
|
19
19
|
Attributes:
|
@@ -53,12 +53,12 @@ class ResourceDeploymentMetricsInferencePerRegion:
|
|
53
53
|
|
54
54
|
region.append(componentsschemas_array_metric_item)
|
55
55
|
|
56
|
-
|
56
|
+
resource_environment_metrics_inference_per_region = cls(
|
57
57
|
region=region,
|
58
58
|
)
|
59
59
|
|
60
|
-
|
61
|
-
return
|
60
|
+
resource_environment_metrics_inference_per_region.additional_properties = d
|
61
|
+
return resource_environment_metrics_inference_per_region
|
62
62
|
|
63
63
|
@property
|
64
64
|
def additional_keys(self) -> list[str]:
|
@@ -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
|
@@ -17,20 +17,18 @@ class ResourceEnvironmentMetricsInferencePerSecondPerRegion:
|
|
17
17
|
"""Historical requests per second (RPS) per location, for the model deployment
|
18
18
|
|
19
19
|
Attributes:
|
20
|
-
region (Union[Unset,
|
20
|
+
region (Union[Unset, list['Metric']]): Array of metrics
|
21
21
|
"""
|
22
22
|
|
23
|
-
region: Union[Unset,
|
23
|
+
region: Union[Unset, list["Metric"]] = UNSET
|
24
24
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
25
|
|
26
26
|
def to_dict(self) -> dict[str, Any]:
|
27
|
-
region: Union[Unset,
|
27
|
+
region: Union[Unset, list[dict[str, Any]]] = UNSET
|
28
28
|
if not isinstance(self.region, Unset):
|
29
29
|
region = []
|
30
30
|
for componentsschemas_array_metric_item_data in self.region:
|
31
|
-
componentsschemas_array_metric_item = (
|
32
|
-
componentsschemas_array_metric_item_data.to_dict()
|
33
|
-
)
|
31
|
+
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
34
32
|
region.append(componentsschemas_array_metric_item)
|
35
33
|
|
36
34
|
field_dict: dict[str, Any] = {}
|
@@ -42,16 +40,16 @@ class ResourceEnvironmentMetricsInferencePerSecondPerRegion:
|
|
42
40
|
return field_dict
|
43
41
|
|
44
42
|
@classmethod
|
45
|
-
def from_dict(cls:
|
43
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
46
44
|
from ..models.metric import Metric
|
47
45
|
|
46
|
+
if not src_dict:
|
47
|
+
return None
|
48
48
|
d = src_dict.copy()
|
49
49
|
region = []
|
50
50
|
_region = d.pop("region", UNSET)
|
51
51
|
for componentsschemas_array_metric_item_data in _region or []:
|
52
|
-
componentsschemas_array_metric_item = Metric.from_dict(
|
53
|
-
componentsschemas_array_metric_item_data
|
54
|
-
)
|
52
|
+
componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
|
55
53
|
|
56
54
|
region.append(componentsschemas_array_metric_item)
|
57
55
|
|
@@ -9,11 +9,11 @@ if TYPE_CHECKING:
|
|
9
9
|
from ..models.qps import QPS
|
10
10
|
|
11
11
|
|
12
|
-
T = TypeVar("T", bound="
|
12
|
+
T = TypeVar("T", bound="ResourceEnvironmentMetricsQueryPerRegionPerCode")
|
13
13
|
|
14
14
|
|
15
15
|
@_attrs_define
|
16
|
-
class
|
16
|
+
class ResourceEnvironmentMetricsQueryPerRegionPerCode:
|
17
17
|
"""Number of requests done on the resource for the model deployment
|
18
18
|
|
19
19
|
Attributes:
|
@@ -51,12 +51,12 @@ class ResourceDeploymentMetricsQueryPerRegionPerCode:
|
|
51
51
|
else:
|
52
52
|
region = QPS.from_dict(_region)
|
53
53
|
|
54
|
-
|
54
|
+
resource_environment_metrics_query_per_region_per_code = cls(
|
55
55
|
region=region,
|
56
56
|
)
|
57
57
|
|
58
|
-
|
59
|
-
return
|
58
|
+
resource_environment_metrics_query_per_region_per_code.additional_properties = d
|
59
|
+
return resource_environment_metrics_query_per_region_per_code
|
60
60
|
|
61
61
|
@property
|
62
62
|
def additional_keys(self) -> list[str]:
|
@@ -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
|
@@ -25,7 +25,7 @@ class ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode:
|
|
25
25
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
26
26
|
|
27
27
|
def to_dict(self) -> dict[str, Any]:
|
28
|
-
region: Union[Unset,
|
28
|
+
region: Union[Unset, dict[str, Any]] = UNSET
|
29
29
|
if not isinstance(self.region, Unset):
|
30
30
|
region = self.region.to_dict()
|
31
31
|
|
@@ -38,9 +38,11 @@ class ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode:
|
|
38
38
|
return field_dict
|
39
39
|
|
40
40
|
@classmethod
|
41
|
-
def from_dict(cls:
|
41
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
42
42
|
from ..models.qps import QPS
|
43
43
|
|
44
|
+
if not src_dict:
|
45
|
+
return None
|
44
46
|
d = src_dict.copy()
|
45
47
|
_region = d.pop("region", UNSET)
|
46
48
|
region: Union[Unset, QPS]
|