beamlit 0.0.24rc19__py3-none-any.whl → 0.0.24rc21__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. beamlit/agents/chat.py +37 -11
  2. beamlit/agents/decorator.py +97 -65
  3. beamlit/api/agents/create_agent.py +9 -14
  4. beamlit/api/agents/delete_agent.py +22 -1
  5. beamlit/api/agents/delete_agent_history.py +2 -6
  6. beamlit/api/agents/get_agent.py +22 -1
  7. beamlit/api/agents/get_agent_environment_logs.py +11 -11
  8. beamlit/api/agents/get_agent_history.py +2 -6
  9. beamlit/api/agents/get_agent_metrics.py +22 -1
  10. beamlit/api/agents/list_agent_history.py +11 -11
  11. beamlit/api/agents/list_agents.py +36 -4
  12. beamlit/api/agents/put_agent_history.py +2 -6
  13. beamlit/api/agents/update_agent.py +9 -14
  14. beamlit/api/functions/create_function.py +9 -14
  15. beamlit/api/functions/delete_function.py +22 -1
  16. beamlit/api/functions/get_function.py +22 -1
  17. beamlit/api/functions/get_function_environment_logs.py +11 -11
  18. beamlit/api/functions/get_function_metrics.py +22 -1
  19. beamlit/api/functions/list_functions.py +36 -4
  20. beamlit/api/functions/update_function.py +9 -14
  21. beamlit/api/history/get_agents_history.py +12 -12
  22. beamlit/api/history/list_agents_history.py +12 -12
  23. beamlit/api/integrations/get_integration_connection.py +16 -12
  24. beamlit/api/integrations/get_integration_connection_model.py +8 -1
  25. beamlit/api/integrations/get_integration_model.py +8 -1
  26. beamlit/api/locations/list_locations.py +12 -12
  27. beamlit/api/models/create_model.py +13 -14
  28. beamlit/api/models/delete_model.py +22 -1
  29. beamlit/api/models/get_model.py +22 -1
  30. beamlit/api/models/get_model_environment_logs.py +11 -11
  31. beamlit/api/models/get_model_metrics.py +38 -13
  32. beamlit/api/models/list_models.py +36 -4
  33. beamlit/api/models/update_model.py +13 -14
  34. beamlit/api/privateclusters/__init__.py +0 -0
  35. beamlit/api/{agents/get_agent_deployment_metrics.py → privateclusters/create_private_cluster.py} +28 -55
  36. beamlit/api/{functions/list_function_deployments.py → privateclusters/delete_private_cluster.py} +38 -37
  37. beamlit/api/{agents/get_agent_deployment.py → privateclusters/get_private_cluster.py} +40 -44
  38. beamlit/api/privateclusters/get_private_cluster_health.py +97 -0
  39. beamlit/api/{agents/list_agent_deployments.py → privateclusters/list_private_clusters.py} +30 -45
  40. beamlit/api/{models/list_model_deployments.py → privateclusters/update_private_cluster.py} +38 -45
  41. beamlit/api/privateclusters/update_private_cluster_health.py +97 -0
  42. beamlit/authentication/device_mode.py +3 -9
  43. beamlit/common/generate.py +47 -34
  44. beamlit/common/settings.py +29 -27
  45. beamlit/deploy/deploy.py +101 -342
  46. beamlit/deploy/format.py +70 -0
  47. beamlit/deploy/parser.py +175 -0
  48. beamlit/functions/decorator.py +17 -14
  49. beamlit/models/__init__.py +64 -78
  50. beamlit/models/acl.py +4 -22
  51. beamlit/models/agent.py +34 -95
  52. beamlit/models/agent_history.py +7 -5
  53. beamlit/models/agent_history_event.py +11 -9
  54. beamlit/models/agent_metadata.py +5 -3
  55. beamlit/models/agent_spec.py +54 -45
  56. beamlit/models/api_key.py +14 -14
  57. beamlit/models/configuration.py +11 -0
  58. beamlit/models/core_spec.py +45 -32
  59. beamlit/models/{model_deployment_metrics_query_per_second_per_region_per_code.py → core_spec_configurations.py} +22 -22
  60. beamlit/models/environment.py +33 -105
  61. beamlit/models/environment_metadata.py +146 -0
  62. beamlit/models/environment_spec.py +8 -6
  63. beamlit/models/function.py +34 -95
  64. beamlit/models/function_metadata.py +5 -3
  65. beamlit/models/function_spec.py +53 -40
  66. beamlit/models/integration_connection.py +31 -137
  67. beamlit/models/integration_connection_spec.py +6 -4
  68. beamlit/models/metadata.py +5 -3
  69. beamlit/models/metadata_labels.py +4 -2
  70. beamlit/models/model.py +33 -94
  71. beamlit/models/model_metadata.py +5 -3
  72. beamlit/models/{function_provider_ref.py → model_private_cluster.py} +23 -14
  73. beamlit/models/model_provider.py +27 -43
  74. beamlit/models/model_spec.py +45 -32
  75. beamlit/models/owner_fields.py +4 -2
  76. beamlit/models/pending_invitation.py +14 -14
  77. beamlit/models/pod_template_spec.py +4 -2
  78. beamlit/models/policy.py +33 -159
  79. beamlit/models/policy_spec.py +24 -28
  80. beamlit/models/private_cluster.py +183 -0
  81. beamlit/models/{model_provider_ref.py → private_location.py} +7 -16
  82. beamlit/models/resource_deployment_metrics.py +0 -108
  83. beamlit/models/resource_environment_metrics.py +143 -71
  84. beamlit/models/{resource_deployment_metrics_inference_per_region.py → resource_environment_metrics_inference_per_region.py} +5 -5
  85. beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +9 -11
  86. beamlit/models/{resource_deployment_metrics_query_per_region_per_code.py → resource_environment_metrics_query_per_region_per_code.py} +5 -5
  87. beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +5 -3
  88. beamlit/models/resource_log.py +4 -2
  89. beamlit/models/runtime.py +20 -2
  90. beamlit/models/serverless_config.py +28 -21
  91. beamlit/models/spec_configuration.py +7 -5
  92. beamlit/models/store_agent.py +14 -14
  93. beamlit/models/store_function.py +14 -14
  94. beamlit/models/time_fields.py +4 -2
  95. beamlit/models/websocket_channel.py +4 -2
  96. beamlit/models/workspace.py +23 -14
  97. beamlit/run.py +0 -1
  98. beamlit/serve/app.py +1 -0
  99. beamlit/serve/middlewares/accesslog.py +3 -1
  100. {beamlit-0.0.24rc19.dist-info → beamlit-0.0.24rc21.dist-info}/METADATA +1 -1
  101. beamlit-0.0.24rc21.dist-info/RECORD +243 -0
  102. beamlit/api/agents/delete_agent_deployment.py +0 -163
  103. beamlit/api/agents/delete_agent_deployment_history.py +0 -172
  104. beamlit/api/agents/get_agent_deployment_history.py +0 -172
  105. beamlit/api/agents/get_agent_deployment_logs.py +0 -164
  106. beamlit/api/agents/list_agent_deployment_history.py +0 -164
  107. beamlit/api/agents/put_agent_deployment.py +0 -185
  108. beamlit/api/agents/put_agent_deployment_history.py +0 -198
  109. beamlit/api/functions/delete_function_deployment.py +0 -163
  110. beamlit/api/functions/get_function_deployment.py +0 -163
  111. beamlit/api/functions/get_function_deployment_logs.py +0 -164
  112. beamlit/api/functions/get_function_deployment_metrics.py +0 -159
  113. beamlit/api/functions/put_function_deployment.py +0 -185
  114. beamlit/api/models/delete_model_deployment.py +0 -171
  115. beamlit/api/models/get_model_deployment.py +0 -171
  116. beamlit/api/models/get_model_deployment_logs.py +0 -168
  117. beamlit/api/models/get_model_deployment_metrics.py +0 -163
  118. beamlit/api/models/put_model_deployment.py +0 -193
  119. beamlit/models/agent_configuration.py +0 -70
  120. beamlit/models/agent_deployment.py +0 -340
  121. beamlit/models/agent_deployment_configuration.py +0 -45
  122. beamlit/models/agent_deployment_configuration_type_0.py +0 -43
  123. beamlit/models/agent_deployment_history.py +0 -185
  124. beamlit/models/agent_deployment_history_event.py +0 -133
  125. beamlit/models/agent_deployment_pod_template.py +0 -45
  126. beamlit/models/agent_deployment_pod_template_type_0.py +0 -43
  127. beamlit/models/agent_with_deployments.py +0 -176
  128. beamlit/models/authentication_provider_model.py +0 -144
  129. beamlit/models/authentication_provider_organization.py +0 -88
  130. beamlit/models/deployment_configuration.py +0 -70
  131. beamlit/models/deployment_configurations.py +0 -58
  132. beamlit/models/deployment_serverless_config.py +0 -131
  133. beamlit/models/deployment_serverless_config_type_0.py +0 -220
  134. beamlit/models/function_configuration.py +0 -70
  135. beamlit/models/function_deployment.py +0 -340
  136. beamlit/models/function_deployment_configuration.py +0 -45
  137. beamlit/models/function_deployment_configuration_type_0.py +0 -43
  138. beamlit/models/function_deployment_pod_template.py +0 -45
  139. beamlit/models/function_deployment_pod_template_type_0.py +0 -43
  140. beamlit/models/function_with_deployments.py +0 -176
  141. beamlit/models/integration.py +0 -198
  142. beamlit/models/integration_config.py +0 -45
  143. beamlit/models/integration_secret.py +0 -61
  144. beamlit/models/labels_type_0.py +0 -45
  145. beamlit/models/location.py +0 -122
  146. beamlit/models/model_deployment.py +0 -296
  147. beamlit/models/model_deployment_log.py +0 -70
  148. beamlit/models/model_deployment_metrics.py +0 -172
  149. beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +0 -77
  150. beamlit/models/model_deployment_pod_template.py +0 -45
  151. beamlit/models/model_deployment_pod_template_type_0.py +0 -43
  152. beamlit/models/model_metrics.py +0 -96
  153. beamlit/models/model_with_deployments.py +0 -176
  154. beamlit/models/resource_deployment_log.py +0 -70
  155. beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +0 -79
  156. beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +0 -79
  157. beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +0 -73
  158. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py +0 -73
  159. beamlit/models/runtime_readiness_probe_type_0.py +0 -43
  160. beamlit/models/runtime_type_0.py +0 -111
  161. beamlit/models/runtime_type_0_readiness_probe.py +0 -43
  162. beamlit/models/runtime_type_0_readiness_probe_type_0.py +0 -43
  163. beamlit/models/runtime_type_0_resources.py +0 -59
  164. beamlit/models/standard_fields_dynamo_db.py +0 -88
  165. beamlit/models/store_agent_configuration.py +0 -97
  166. beamlit/models/store_agent_labels_type_0.py +0 -43
  167. beamlit/models/store_function_configuration.py +0 -97
  168. beamlit/models/store_function_labels_type_0.py +0 -43
  169. beamlit-0.0.24rc19.dist-info/RECORD +0 -303
  170. {beamlit-0.0.24rc19.dist-info → beamlit-0.0.24rc21.dist-info}/WHEEL +0 -0
@@ -14,8 +14,8 @@ class PendingInvitation:
14
14
 
15
15
  Attributes:
16
16
  created_at (Union[Unset, str]): The date and time when the resource was created
17
- created_by (Union[Unset, str]): The user or service account who created the resource
18
17
  updated_at (Union[Unset, str]): The date and time when the resource was updated
18
+ created_by (Union[Unset, str]): The user or service account who created the resource
19
19
  updated_by (Union[Unset, str]): The user or service account who updated the resource
20
20
  email (Union[Unset, str]): User email
21
21
  invited_by (Union[Unset, str]): User sub
@@ -24,8 +24,8 @@ class PendingInvitation:
24
24
  """
25
25
 
26
26
  created_at: Union[Unset, str] = UNSET
27
- created_by: Union[Unset, str] = UNSET
28
27
  updated_at: Union[Unset, str] = UNSET
28
+ created_by: Union[Unset, str] = UNSET
29
29
  updated_by: Union[Unset, str] = UNSET
30
30
  email: Union[Unset, str] = UNSET
31
31
  invited_by: Union[Unset, str] = UNSET
@@ -36,10 +36,10 @@ class PendingInvitation:
36
36
  def to_dict(self) -> dict[str, Any]:
37
37
  created_at = self.created_at
38
38
 
39
- created_by = self.created_by
40
-
41
39
  updated_at = self.updated_at
42
40
 
41
+ created_by = self.created_by
42
+
43
43
  updated_by = self.updated_by
44
44
 
45
45
  email = self.email
@@ -54,13 +54,13 @@ class PendingInvitation:
54
54
  field_dict.update(self.additional_properties)
55
55
  field_dict.update({})
56
56
  if created_at is not UNSET:
57
- field_dict["created_at"] = created_at
58
- if created_by is not UNSET:
59
- field_dict["created_by"] = created_by
57
+ field_dict["createdAt"] = created_at
60
58
  if updated_at is not UNSET:
61
- field_dict["updated_at"] = updated_at
59
+ field_dict["updatedAt"] = updated_at
60
+ if created_by is not UNSET:
61
+ field_dict["createdBy"] = created_by
62
62
  if updated_by is not UNSET:
63
- field_dict["updated_by"] = updated_by
63
+ field_dict["updatedBy"] = updated_by
64
64
  if email is not UNSET:
65
65
  field_dict["email"] = email
66
66
  if invited_by is not UNSET:
@@ -77,13 +77,13 @@ class PendingInvitation:
77
77
  if not src_dict:
78
78
  return None
79
79
  d = src_dict.copy()
80
- created_at = d.pop("created_at", UNSET)
80
+ created_at = d.pop("createdAt", UNSET)
81
81
 
82
- created_by = d.pop("created_by", UNSET)
82
+ updated_at = d.pop("updatedAt", UNSET)
83
83
 
84
- updated_at = d.pop("updated_at", UNSET)
84
+ created_by = d.pop("createdBy", UNSET)
85
85
 
86
- updated_by = d.pop("updated_by", UNSET)
86
+ updated_by = d.pop("updatedBy", UNSET)
87
87
 
88
88
  email = d.pop("email", UNSET)
89
89
 
@@ -95,8 +95,8 @@ class PendingInvitation:
95
95
 
96
96
  pending_invitation = cls(
97
97
  created_at=created_at,
98
- created_by=created_by,
99
98
  updated_at=updated_at,
99
+ created_by=created_by,
100
100
  updated_by=updated_by,
101
101
  email=email,
102
102
  invited_by=invited_by,
@@ -1,4 +1,4 @@
1
- from typing import Any, Type, TypeVar
1
+ from typing import Any, TypeVar
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -19,7 +19,9 @@ class PodTemplateSpec:
19
19
  return field_dict
20
20
 
21
21
  @classmethod
22
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
22
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
23
+ if not src_dict:
24
+ return None
23
25
  d = src_dict.copy()
24
26
  pod_template_spec = cls()
25
27
 
beamlit/models/policy.py CHANGED
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
1
+ from typing import TYPE_CHECKING, Any, TypeVar, Union
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -6,9 +6,8 @@ from attrs import field as _attrs_field
6
6
  from ..types import UNSET, Unset
7
7
 
8
8
  if TYPE_CHECKING:
9
- from ..models.flavor import Flavor
10
- from ..models.labels_type_0 import LabelsType0
11
- from ..models.policy_location import PolicyLocation
9
+ from ..models.metadata import Metadata
10
+ from ..models.policy_spec import PolicySpec
12
11
 
13
12
 
14
13
  T = TypeVar("T", bound="Policy")
@@ -19,183 +18,58 @@ class Policy:
19
18
  """Rule that controls how a deployment is made and served (e.g. location restrictions)
20
19
 
21
20
  Attributes:
22
- created_at (Union[Unset, str]): The date and time when the resource was created
23
- created_by (Union[Unset, str]): The user or service account who created the resource
24
- updated_at (Union[Unset, str]): The date and time when the resource was updated
25
- updated_by (Union[Unset, str]): The user or service account who updated the resource
26
- display_name (Union[Unset, str]): Policy display name
27
- flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
28
- labels (Union['LabelsType0', None, Unset]): Labels
29
- locations (Union[Unset, list['PolicyLocation']]): PolicyLocations is a local type that wraps a slice of Location
30
- name (Union[Unset, str]): Policy name
31
- resource_types (Union[Unset, list[str]]): PolicyResourceTypes is a local type that wraps a slice of
32
- PolicyResourceType
33
- type_ (Union[Unset, str]): Policy type, can be location or flavor
34
- workspace (Union[Unset, str]): The workspace the policy belongs to
21
+ metadata (Union[Unset, Metadata]): Metadata
22
+ spec (Union[Unset, PolicySpec]): Policy specification
35
23
  """
36
24
 
37
- created_at: Union[Unset, str] = UNSET
38
- created_by: Union[Unset, str] = UNSET
39
- updated_at: Union[Unset, str] = UNSET
40
- updated_by: Union[Unset, str] = UNSET
41
- display_name: Union[Unset, str] = UNSET
42
- flavors: Union[Unset, list["Flavor"]] = UNSET
43
- labels: Union["LabelsType0", None, Unset] = UNSET
44
- locations: Union[Unset, list["PolicyLocation"]] = UNSET
45
- name: Union[Unset, str] = UNSET
46
- resource_types: Union[Unset, list[str]] = UNSET
47
- type_: Union[Unset, str] = UNSET
48
- workspace: Union[Unset, str] = UNSET
25
+ metadata: Union[Unset, "Metadata"] = UNSET
26
+ spec: Union[Unset, "PolicySpec"] = UNSET
49
27
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
50
28
 
51
29
  def to_dict(self) -> dict[str, Any]:
52
- from ..models.labels_type_0 import LabelsType0
30
+ metadata: Union[Unset, dict[str, Any]] = UNSET
31
+ if not isinstance(self.metadata, Unset):
32
+ metadata = self.metadata.to_dict()
53
33
 
54
- created_at = self.created_at
55
-
56
- created_by = self.created_by
57
-
58
- updated_at = self.updated_at
59
-
60
- updated_by = self.updated_by
61
-
62
- display_name = self.display_name
63
-
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)
70
-
71
- labels: Union[None, Unset, dict[str, Any]]
72
- if isinstance(self.labels, Unset):
73
- labels = UNSET
74
- elif isinstance(self.labels, LabelsType0):
75
- labels = self.labels.to_dict()
76
- else:
77
- labels = self.labels
78
-
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)
85
-
86
- name = self.name
87
-
88
- resource_types: Union[Unset, list[str]] = UNSET
89
- if not isinstance(self.resource_types, Unset):
90
- resource_types = self.resource_types
91
-
92
- type_ = self.type_
93
-
94
- workspace = self.workspace
34
+ spec: Union[Unset, dict[str, Any]] = UNSET
35
+ if not isinstance(self.spec, Unset):
36
+ spec = self.spec.to_dict()
95
37
 
96
38
  field_dict: dict[str, Any] = {}
97
39
  field_dict.update(self.additional_properties)
98
40
  field_dict.update({})
99
- if created_at is not UNSET:
100
- field_dict["created_at"] = created_at
101
- if created_by is not UNSET:
102
- field_dict["created_by"] = created_by
103
- if updated_at is not UNSET:
104
- field_dict["updated_at"] = updated_at
105
- if updated_by is not UNSET:
106
- field_dict["updated_by"] = updated_by
107
- if display_name is not UNSET:
108
- field_dict["display_name"] = display_name
109
- if flavors is not UNSET:
110
- field_dict["flavors"] = flavors
111
- if labels is not UNSET:
112
- field_dict["labels"] = labels
113
- if locations is not UNSET:
114
- field_dict["locations"] = locations
115
- if name is not UNSET:
116
- field_dict["name"] = name
117
- if resource_types is not UNSET:
118
- field_dict["resource_types"] = resource_types
119
- if type_ is not UNSET:
120
- field_dict["type"] = type_
121
- if workspace is not UNSET:
122
- field_dict["workspace"] = workspace
41
+ if metadata is not UNSET:
42
+ field_dict["metadata"] = metadata
43
+ if spec is not UNSET:
44
+ field_dict["spec"] = spec
123
45
 
124
46
  return field_dict
125
47
 
126
48
  @classmethod
127
49
  def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
128
- from ..models.flavor import Flavor
129
- from ..models.labels_type_0 import LabelsType0
130
- from ..models.policy_location import PolicyLocation
50
+ from ..models.metadata import Metadata
51
+ from ..models.policy_spec import PolicySpec
131
52
 
132
53
  if not src_dict:
133
54
  return None
134
55
  d = src_dict.copy()
135
- created_at = d.pop("created_at", UNSET)
136
-
137
- created_by = d.pop("created_by", UNSET)
138
-
139
- updated_at = d.pop("updated_at", UNSET)
140
-
141
- updated_by = d.pop("updated_by", UNSET)
142
-
143
- display_name = d.pop("display_name", UNSET)
144
-
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)
151
-
152
- def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
153
- if data is None:
154
- return data
155
- if isinstance(data, Unset):
156
- return data
157
- try:
158
- if not isinstance(data, dict):
159
- raise TypeError()
160
- componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
161
-
162
- return componentsschemas_labels_type_0
163
- except: # noqa: E722
164
- pass
165
- return cast(Union["LabelsType0", None, Unset], data)
166
-
167
- labels = _parse_labels(d.pop("labels", UNSET))
168
-
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)
177
-
178
- name = d.pop("name", UNSET)
179
-
180
- resource_types = cast(list[str], d.pop("resource_types", UNSET))
181
-
182
- type_ = d.pop("type", UNSET)
56
+ _metadata = d.pop("metadata", UNSET)
57
+ metadata: Union[Unset, Metadata]
58
+ if isinstance(_metadata, Unset):
59
+ metadata = UNSET
60
+ else:
61
+ metadata = Metadata.from_dict(_metadata)
183
62
 
184
- workspace = d.pop("workspace", UNSET)
63
+ _spec = d.pop("spec", UNSET)
64
+ spec: Union[Unset, PolicySpec]
65
+ if isinstance(_spec, Unset):
66
+ spec = UNSET
67
+ else:
68
+ spec = PolicySpec.from_dict(_spec)
185
69
 
186
70
  policy = cls(
187
- created_at=created_at,
188
- created_by=created_by,
189
- updated_at=updated_at,
190
- updated_by=updated_by,
191
- display_name=display_name,
192
- flavors=flavors,
193
- labels=labels,
194
- locations=locations,
195
- name=name,
196
- resource_types=resource_types,
197
- type_=type_,
198
- workspace=workspace,
71
+ metadata=metadata,
72
+ spec=spec,
199
73
  )
200
74
 
201
75
  policy.additional_properties = d
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
1
+ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -18,43 +18,39 @@ class PolicySpec:
18
18
  """Policy specification
19
19
 
20
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
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
24
  PolicyResourceType
25
- type (Union[Unset, str]): Policy type, can be location or flavor
25
+ type_ (Union[Unset, str]): Policy type, can be location or flavor
26
26
  """
27
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
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
32
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
33
33
 
34
34
  def to_dict(self) -> dict[str, Any]:
35
- flavors: Union[Unset, List[Dict[str, Any]]] = UNSET
35
+ flavors: Union[Unset, list[dict[str, Any]]] = UNSET
36
36
  if not isinstance(self.flavors, Unset):
37
37
  flavors = []
38
38
  for componentsschemas_flavors_item_data in self.flavors:
39
- componentsschemas_flavors_item = (
40
- componentsschemas_flavors_item_data.to_dict()
41
- )
39
+ componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
42
40
  flavors.append(componentsschemas_flavors_item)
43
41
 
44
- locations: Union[Unset, List[Dict[str, Any]]] = UNSET
42
+ locations: Union[Unset, list[dict[str, Any]]] = UNSET
45
43
  if not isinstance(self.locations, Unset):
46
44
  locations = []
47
45
  for componentsschemas_policy_locations_item_data in self.locations:
48
- componentsschemas_policy_locations_item = (
49
- componentsschemas_policy_locations_item_data.to_dict()
50
- )
46
+ componentsschemas_policy_locations_item = componentsschemas_policy_locations_item_data.to_dict()
51
47
  locations.append(componentsschemas_policy_locations_item)
52
48
 
53
- resource_types: Union[Unset, List[str]] = UNSET
49
+ resource_types: Union[Unset, list[str]] = UNSET
54
50
  if not isinstance(self.resource_types, Unset):
55
51
  resource_types = self.resource_types
56
52
 
57
- type = self.type
53
+ type_ = self.type_
58
54
 
59
55
  field_dict: dict[str, Any] = {}
60
56
  field_dict.update(self.additional_properties)
@@ -65,23 +61,23 @@ class PolicySpec:
65
61
  field_dict["locations"] = locations
66
62
  if resource_types is not UNSET:
67
63
  field_dict["resourceTypes"] = resource_types
68
- if type is not UNSET:
69
- field_dict["type"] = type
64
+ if type_ is not UNSET:
65
+ field_dict["type"] = type_
70
66
 
71
67
  return field_dict
72
68
 
73
69
  @classmethod
74
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
70
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
75
71
  from ..models.flavor import Flavor
76
72
  from ..models.policy_location import PolicyLocation
77
73
 
74
+ if not src_dict:
75
+ return None
78
76
  d = src_dict.copy()
79
77
  flavors = []
80
78
  _flavors = d.pop("flavors", UNSET)
81
79
  for componentsschemas_flavors_item_data in _flavors or []:
82
- componentsschemas_flavors_item = Flavor.from_dict(
83
- componentsschemas_flavors_item_data
84
- )
80
+ componentsschemas_flavors_item = Flavor.from_dict(componentsschemas_flavors_item_data)
85
81
 
86
82
  flavors.append(componentsschemas_flavors_item)
87
83
 
@@ -94,15 +90,15 @@ class PolicySpec:
94
90
 
95
91
  locations.append(componentsschemas_policy_locations_item)
96
92
 
97
- resource_types = cast(List[str], d.pop("resourceTypes", UNSET))
93
+ resource_types = cast(list[str], d.pop("resourceTypes", UNSET))
98
94
 
99
- type = d.pop("type", UNSET)
95
+ type_ = d.pop("type", UNSET)
100
96
 
101
97
  policy_spec = cls(
102
98
  flavors=flavors,
103
99
  locations=locations,
104
100
  resource_types=resource_types,
105
- type=type,
101
+ type_=type_,
106
102
  )
107
103
 
108
104
  policy_spec.additional_properties = d
@@ -0,0 +1,183 @@
1
+ from typing import Any, 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="PrivateCluster")
9
+
10
+
11
+ @_attrs_define
12
+ class PrivateCluster:
13
+ """A private cluster where models can be located on.
14
+
15
+ Attributes:
16
+ created_at (Union[Unset, str]): The date and time when the resource was created
17
+ updated_at (Union[Unset, str]): The date and time when the resource was updated
18
+ created_by (Union[Unset, str]): The user or service account who created the resource
19
+ updated_by (Union[Unset, str]): The user or service account who updated the resource
20
+ continent (Union[Unset, str]): The private cluster's continent, used to determine the closest private cluster to
21
+ serve inference requests based on the user's location
22
+ country (Union[Unset, str]): The country where the private cluster is located, used to determine the closest
23
+ private cluster to serve inference requests based on the user's location
24
+ display_name (Union[Unset, str]): The private cluster's display Name
25
+ healthy (Union[Unset, bool]): Whether the private cluster is healthy or not, used to determine if the private
26
+ cluster is ready to run inference
27
+ last_health_check_time (Union[Unset, str]): The private cluster's unique name
28
+ latitude (Union[Unset, str]): The private cluster's latitude, used to determine the closest private cluster to
29
+ serve inference requests based on the user's location
30
+ longitude (Union[Unset, str]): The private cluster's longitude, used to determine the closest private cluster to
31
+ serve inference requests based on the user's location
32
+ name (Union[Unset, str]): The name of the private cluster, it must be unique
33
+ owned_by (Union[Unset, str]): The service account (operator) that owns the cluster
34
+ workspace (Union[Unset, str]): The workspace the private cluster belongs to
35
+ """
36
+
37
+ created_at: Union[Unset, str] = UNSET
38
+ updated_at: Union[Unset, str] = UNSET
39
+ created_by: Union[Unset, str] = UNSET
40
+ updated_by: Union[Unset, str] = UNSET
41
+ continent: Union[Unset, str] = UNSET
42
+ country: Union[Unset, str] = UNSET
43
+ display_name: Union[Unset, str] = UNSET
44
+ healthy: Union[Unset, bool] = UNSET
45
+ last_health_check_time: Union[Unset, str] = UNSET
46
+ latitude: Union[Unset, str] = UNSET
47
+ longitude: Union[Unset, str] = UNSET
48
+ name: Union[Unset, str] = UNSET
49
+ owned_by: Union[Unset, str] = UNSET
50
+ workspace: Union[Unset, str] = UNSET
51
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
52
+
53
+ def to_dict(self) -> dict[str, Any]:
54
+ created_at = self.created_at
55
+
56
+ updated_at = self.updated_at
57
+
58
+ created_by = self.created_by
59
+
60
+ updated_by = self.updated_by
61
+
62
+ continent = self.continent
63
+
64
+ country = self.country
65
+
66
+ display_name = self.display_name
67
+
68
+ healthy = self.healthy
69
+
70
+ last_health_check_time = self.last_health_check_time
71
+
72
+ latitude = self.latitude
73
+
74
+ longitude = self.longitude
75
+
76
+ name = self.name
77
+
78
+ owned_by = self.owned_by
79
+
80
+ workspace = self.workspace
81
+
82
+ field_dict: dict[str, Any] = {}
83
+ field_dict.update(self.additional_properties)
84
+ field_dict.update({})
85
+ if created_at is not UNSET:
86
+ field_dict["createdAt"] = created_at
87
+ if updated_at is not UNSET:
88
+ field_dict["updatedAt"] = updated_at
89
+ if created_by is not UNSET:
90
+ field_dict["createdBy"] = created_by
91
+ if updated_by is not UNSET:
92
+ field_dict["updatedBy"] = updated_by
93
+ if continent is not UNSET:
94
+ field_dict["continent"] = continent
95
+ if country is not UNSET:
96
+ field_dict["country"] = country
97
+ if display_name is not UNSET:
98
+ field_dict["displayName"] = display_name
99
+ if healthy is not UNSET:
100
+ field_dict["healthy"] = healthy
101
+ if last_health_check_time is not UNSET:
102
+ field_dict["lastHealthCheckTime"] = last_health_check_time
103
+ if latitude is not UNSET:
104
+ field_dict["latitude"] = latitude
105
+ if longitude is not UNSET:
106
+ field_dict["longitude"] = longitude
107
+ if name is not UNSET:
108
+ field_dict["name"] = name
109
+ if owned_by is not UNSET:
110
+ field_dict["ownedBy"] = owned_by
111
+ if workspace is not UNSET:
112
+ field_dict["workspace"] = workspace
113
+
114
+ return field_dict
115
+
116
+ @classmethod
117
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
118
+ if not src_dict:
119
+ return None
120
+ d = src_dict.copy()
121
+ created_at = d.pop("createdAt", UNSET)
122
+
123
+ updated_at = d.pop("updatedAt", UNSET)
124
+
125
+ created_by = d.pop("createdBy", UNSET)
126
+
127
+ updated_by = d.pop("updatedBy", UNSET)
128
+
129
+ continent = d.pop("continent", UNSET)
130
+
131
+ country = d.pop("country", UNSET)
132
+
133
+ display_name = d.pop("displayName", UNSET)
134
+
135
+ healthy = d.pop("healthy", UNSET)
136
+
137
+ last_health_check_time = d.pop("lastHealthCheckTime", UNSET)
138
+
139
+ latitude = d.pop("latitude", UNSET)
140
+
141
+ longitude = d.pop("longitude", UNSET)
142
+
143
+ name = d.pop("name", UNSET)
144
+
145
+ owned_by = d.pop("ownedBy", UNSET)
146
+
147
+ workspace = d.pop("workspace", UNSET)
148
+
149
+ private_cluster = cls(
150
+ created_at=created_at,
151
+ updated_at=updated_at,
152
+ created_by=created_by,
153
+ updated_by=updated_by,
154
+ continent=continent,
155
+ country=country,
156
+ display_name=display_name,
157
+ healthy=healthy,
158
+ last_health_check_time=last_health_check_time,
159
+ latitude=latitude,
160
+ longitude=longitude,
161
+ name=name,
162
+ owned_by=owned_by,
163
+ workspace=workspace,
164
+ )
165
+
166
+ private_cluster.additional_properties = d
167
+ return private_cluster
168
+
169
+ @property
170
+ def additional_keys(self) -> list[str]:
171
+ return list(self.additional_properties.keys())
172
+
173
+ def __getitem__(self, key: str) -> Any:
174
+ return self.additional_properties[key]
175
+
176
+ def __setitem__(self, key: str, value: Any) -> None:
177
+ self.additional_properties[key] = value
178
+
179
+ def __delitem__(self, key: str) -> None:
180
+ del self.additional_properties[key]
181
+
182
+ def __contains__(self, key: str) -> bool:
183
+ return key in self.additional_properties
@@ -5,32 +5,26 @@ from attrs import field as _attrs_field
5
5
 
6
6
  from ..types import UNSET, Unset
7
7
 
8
- T = TypeVar("T", bound="ModelProviderRef")
8
+ T = TypeVar("T", bound="PrivateLocation")
9
9
 
10
10
 
11
11
  @_attrs_define
12
- class ModelProviderRef:
13
- """Reference to a model provider
12
+ class PrivateLocation:
13
+ """Private location available for policies
14
14
 
15
15
  Attributes:
16
- kind (Union[Unset, str]): The kind of the model provider, can be Provider
17
- name (Union[Unset, str]): The name of the model provider
16
+ name (Union[Unset, str]): Location name
18
17
  """
19
18
 
20
- kind: Union[Unset, str] = UNSET
21
19
  name: Union[Unset, str] = UNSET
22
20
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
21
 
24
22
  def to_dict(self) -> dict[str, Any]:
25
- kind = self.kind
26
-
27
23
  name = self.name
28
24
 
29
25
  field_dict: dict[str, Any] = {}
30
26
  field_dict.update(self.additional_properties)
31
27
  field_dict.update({})
32
- if kind is not UNSET:
33
- field_dict["kind"] = kind
34
28
  if name is not UNSET:
35
29
  field_dict["name"] = name
36
30
 
@@ -41,17 +35,14 @@ class ModelProviderRef:
41
35
  if not src_dict:
42
36
  return None
43
37
  d = src_dict.copy()
44
- kind = d.pop("kind", UNSET)
45
-
46
38
  name = d.pop("name", UNSET)
47
39
 
48
- model_provider_ref = cls(
49
- kind=kind,
40
+ private_location = cls(
50
41
  name=name,
51
42
  )
52
43
 
53
- model_provider_ref.additional_properties = d
54
- return model_provider_ref
44
+ private_location.additional_properties = d
45
+ return private_location
55
46
 
56
47
  @property
57
48
  def additional_keys(self) -> list[str]: