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.
Files changed (142) hide show
  1. beamlit/api/agents/delete_agent_history.py +155 -0
  2. beamlit/api/agents/get_agent_deployment.py +1 -22
  3. beamlit/api/agents/get_agent_environment_logs.py +151 -0
  4. beamlit/api/agents/get_agent_history.py +155 -0
  5. beamlit/api/agents/list_agent_history.py +151 -0
  6. beamlit/api/agents/put_agent_history.py +181 -0
  7. beamlit/api/functions/get_function_environment_logs.py +151 -0
  8. beamlit/api/models/get_model_environment_logs.py +155 -0
  9. beamlit/common/generate.py +8 -3
  10. beamlit/common/settings.py +1 -6
  11. beamlit/models/__init__.py +28 -30
  12. beamlit/models/acl.py +2 -0
  13. beamlit/models/agent.py +2 -0
  14. beamlit/models/agent_chain.py +2 -0
  15. beamlit/models/agent_configuration.py +2 -0
  16. beamlit/models/agent_deployment.py +44 -99
  17. beamlit/models/agent_deployment_configuration.py +45 -0
  18. beamlit/models/agent_deployment_history.py +15 -46
  19. beamlit/models/agent_deployment_history_event.py +24 -78
  20. beamlit/models/agent_deployment_pod_template.py +45 -0
  21. beamlit/models/agent_history.py +165 -0
  22. beamlit/models/agent_history_event.py +131 -0
  23. beamlit/models/agent_metadata.py +144 -0
  24. beamlit/models/agent_release.py +2 -0
  25. beamlit/models/agent_spec.py +238 -0
  26. beamlit/models/agent_with_deployments.py +2 -0
  27. beamlit/models/api_key.py +2 -0
  28. beamlit/models/authentication_provider_model.py +2 -0
  29. beamlit/models/authentication_provider_organization.py +2 -0
  30. beamlit/models/configuration.py +2 -0
  31. beamlit/models/continent.py +2 -0
  32. beamlit/models/core_spec.py +179 -0
  33. beamlit/models/country.py +2 -0
  34. beamlit/models/create_api_key_for_service_account_body.py +2 -0
  35. beamlit/models/create_workspace_service_account_body.py +2 -0
  36. beamlit/models/create_workspace_service_account_response_200.py +2 -0
  37. beamlit/models/delete_workspace_service_account_response_200.py +2 -0
  38. beamlit/models/deployment_configuration.py +2 -0
  39. beamlit/models/deployment_configurations.py +2 -0
  40. beamlit/models/deployment_serverless_config.py +131 -0
  41. beamlit/models/environment.py +2 -0
  42. beamlit/models/environment_metrics.py +2 -0
  43. beamlit/models/environment_spec.py +61 -0
  44. beamlit/models/flavor.py +2 -0
  45. beamlit/models/function.py +2 -0
  46. beamlit/models/function_configuration.py +2 -0
  47. beamlit/models/function_deployment.py +44 -99
  48. beamlit/models/function_deployment_configuration.py +45 -0
  49. beamlit/models/function_deployment_pod_template.py +45 -0
  50. beamlit/models/function_kit.py +2 -0
  51. beamlit/models/function_metadata.py +144 -0
  52. beamlit/models/function_provider_ref.py +2 -0
  53. beamlit/models/function_release.py +2 -0
  54. beamlit/models/function_spec.py +240 -0
  55. beamlit/models/function_with_deployments.py +2 -0
  56. beamlit/models/get_workspace_service_accounts_response_200_item.py +2 -0
  57. beamlit/models/increase_and_rate_metric.py +2 -0
  58. beamlit/models/integration.py +2 -0
  59. beamlit/models/integration_config.py +2 -0
  60. beamlit/models/integration_connection.py +2 -0
  61. beamlit/models/integration_connection_config.py +2 -0
  62. beamlit/models/integration_connection_secret.py +2 -0
  63. beamlit/models/integration_connection_spec.py +99 -0
  64. beamlit/models/integration_model.py +2 -0
  65. beamlit/models/integration_secret.py +2 -0
  66. beamlit/models/invite_workspace_user_body.py +2 -0
  67. beamlit/models/labels_type_0.py +2 -0
  68. beamlit/models/location.py +2 -0
  69. beamlit/models/location_response.py +2 -0
  70. beamlit/models/metadata.py +135 -0
  71. beamlit/models/metadata_labels.py +43 -0
  72. beamlit/models/metric.py +2 -0
  73. beamlit/models/metrics.py +2 -0
  74. beamlit/models/model.py +2 -0
  75. beamlit/models/model_deployment.py +66 -85
  76. beamlit/models/model_deployment_log.py +2 -0
  77. beamlit/models/model_deployment_metrics.py +2 -0
  78. beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +2 -0
  79. beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +2 -0
  80. beamlit/models/model_deployment_pod_template.py +45 -0
  81. beamlit/models/model_metadata.py +144 -0
  82. beamlit/models/model_metrics.py +2 -0
  83. beamlit/models/model_provider.py +2 -0
  84. beamlit/models/model_provider_ref.py +2 -0
  85. beamlit/models/model_release.py +2 -0
  86. beamlit/models/model_spec.py +188 -0
  87. beamlit/models/model_with_deployments.py +2 -0
  88. beamlit/models/owner_fields.py +68 -0
  89. beamlit/models/pending_invitation.py +2 -0
  90. beamlit/models/pending_invitation_accept.py +2 -0
  91. beamlit/models/pending_invitation_render.py +2 -0
  92. beamlit/models/pending_invitation_render_invited_by.py +2 -0
  93. beamlit/models/pending_invitation_render_workspace.py +2 -0
  94. beamlit/models/pending_invitation_workspace_details.py +2 -0
  95. beamlit/models/pod_template_spec.py +43 -0
  96. beamlit/models/policy.py +36 -8
  97. beamlit/models/policy_location.py +2 -0
  98. beamlit/models/policy_spec.py +119 -0
  99. beamlit/models/provider_config.py +2 -0
  100. beamlit/models/qps.py +2 -0
  101. beamlit/models/resource_deployment_log.py +2 -0
  102. beamlit/models/resource_deployment_metrics.py +70 -155
  103. beamlit/models/resource_deployment_metrics_inference_per_region.py +77 -0
  104. beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +77 -0
  105. beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +75 -0
  106. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +75 -0
  107. beamlit/models/resource_environment_metrics.py +172 -0
  108. beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +75 -0
  109. beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +73 -0
  110. beamlit/models/resource_log.py +68 -0
  111. beamlit/models/resource_metrics.py +2 -0
  112. beamlit/models/runtime.py +14 -29
  113. beamlit/models/runtime_readiness_probe.py +45 -0
  114. beamlit/models/runtime_resources.py +2 -0
  115. beamlit/models/runtime_type_0.py +111 -0
  116. beamlit/models/runtime_type_0_readiness_probe.py +43 -0
  117. beamlit/models/runtime_type_0_readiness_probe_type_0.py +43 -0
  118. beamlit/models/runtime_type_0_resources.py +59 -0
  119. beamlit/models/serverless_config.py +2 -0
  120. beamlit/models/spec_configuration.py +68 -0
  121. beamlit/models/standard_fields_dynamo_db.py +2 -0
  122. beamlit/models/store_agent.py +15 -29
  123. beamlit/models/store_agent_configuration.py +2 -0
  124. beamlit/models/store_agent_labels.py +45 -0
  125. beamlit/models/store_configuration.py +6 -15
  126. beamlit/models/store_configuration_option.py +7 -18
  127. beamlit/models/store_function.py +15 -29
  128. beamlit/models/store_function_configuration.py +2 -0
  129. beamlit/models/store_function_kit.py +2 -0
  130. beamlit/models/store_function_labels.py +45 -0
  131. beamlit/models/store_function_parameter.py +2 -0
  132. beamlit/models/time_fields.py +68 -0
  133. beamlit/models/update_workspace_service_account_body.py +2 -0
  134. beamlit/models/update_workspace_service_account_response_200.py +2 -0
  135. beamlit/models/update_workspace_user_role_body.py +2 -0
  136. beamlit/models/websocket_channel.py +86 -0
  137. beamlit/models/workspace.py +2 -0
  138. beamlit/models/workspace_labels.py +2 -0
  139. beamlit/models/workspace_user.py +2 -0
  140. {beamlit-0.0.20rc2.dist-info → beamlit-0.0.20rc4.dist-info}/METADATA +1 -1
  141. {beamlit-0.0.20rc2.dist-info → beamlit-0.0.20rc4.dist-info}/RECORD +142 -95
  142. {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
@@ -101,6 +101,8 @@ class ModelWithDeployments:
101
101
  from ..models.labels_type_0 import LabelsType0
102
102
  from ..models.model_deployment import ModelDeployment
103
103
 
104
+ if not src_dict:
105
+ return None
104
106
  d = src_dict.copy()
105
107
  created_at = d.pop("created_at", UNSET)
106
108
 
@@ -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
@@ -74,6 +74,8 @@ class PendingInvitation:
74
74
 
75
75
  @classmethod
76
76
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
77
+ if not src_dict:
78
+ return None
77
79
  d = src_dict.copy()
78
80
  created_at = d.pop("created_at", UNSET)
79
81
 
@@ -46,6 +46,8 @@ class PendingInvitationAccept:
46
46
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
47
47
  from ..models.workspace import Workspace
48
48
 
49
+ if not src_dict:
50
+ return None
49
51
  d = src_dict.copy()
50
52
  email = d.pop("email", UNSET)
51
53
 
@@ -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
 
@@ -50,6 +50,8 @@ class PendingInvitationRenderInvitedBy:
50
50
 
51
51
  @classmethod
52
52
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
53
+ if not src_dict:
54
+ return None
53
55
  d = src_dict.copy()
54
56
  email = d.pop("email", UNSET)
55
57
 
@@ -38,6 +38,8 @@ class PendingInvitationRenderWorkspace:
38
38
 
39
39
  @classmethod
40
40
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
41
+ if not src_dict:
42
+ return None
41
43
  d = src_dict.copy()
42
44
  display_name = d.pop("display_name", UNSET)
43
45
 
@@ -40,6 +40,8 @@ class PendingInvitationWorkspaceDetails:
40
40
 
41
41
  @classmethod
42
42
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
43
+ if not src_dict:
44
+ return None
43
45
  d = src_dict.copy()
44
46
  emails = cast(List[Any], d.pop("emails", UNSET))
45
47
 
@@ -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, Any]): Flavors allowed by the policy. If not set, all flavors are allowed.
27
+ flavors (Union[Unset, List['Flavor']]): Types of hardware available for deployments
26
28
  labels (Union['LabelsType0', None, Unset]): Labels
27
- locations (Union[Unset, Any]): Locations allowed by the policy. If not set, all locations are allowed.
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, Any] = UNSET
42
+ flavors: Union[Unset, List["Flavor"]] = UNSET
41
43
  labels: Union["LabelsType0", None, Unset] = UNSET
42
- locations: Union[Unset, Any] = 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 = self.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 = self.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 = d.pop("flavors", UNSET)
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 = d.pop("locations", UNSET)
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
 
@@ -38,6 +38,8 @@ class PolicyLocation:
38
38
 
39
39
  @classmethod
40
40
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
41
+ if not src_dict:
42
+ return None
41
43
  d = src_dict.copy()
42
44
  name = d.pop("name", UNSET)
43
45
 
@@ -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
@@ -54,6 +54,8 @@ class ProviderConfig:
54
54
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
55
55
  from ..models.runtime import Runtime
56
56
 
57
+ if not src_dict:
58
+ return None
57
59
  d = src_dict.copy()
58
60
  filename = d.pop("filename", UNSET)
59
61
 
beamlit/models/qps.py CHANGED
@@ -32,6 +32,8 @@ class QPS:
32
32
 
33
33
  @classmethod
34
34
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
35
+ if not src_dict:
36
+ return None
35
37
  d = src_dict.copy()
36
38
  region_code = d.pop("region_code", UNSET)
37
39
 
@@ -38,6 +38,8 @@ class ResourceDeploymentLog:
38
38
 
39
39
  @classmethod
40
40
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
41
+ if not src_dict:
42
+ return None
41
43
  d = src_dict.copy()
42
44
  message = d.pop("message", UNSET)
43
45