beamlit 0.0.20rc3__py3-none-any.whl → 0.0.20rc5__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) 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/authentication/__init__.py +4 -0
  10. beamlit/authentication/apikey.py +6 -0
  11. beamlit/authentication/authentication.py +31 -2
  12. beamlit/authentication/clientcredentials.py +20 -9
  13. beamlit/authentication/credentials.py +1 -0
  14. beamlit/authentication/device_mode.py +10 -1
  15. beamlit/common/generate.py +8 -3
  16. beamlit/common/logger.py +2 -0
  17. beamlit/common/settings.py +1 -5
  18. beamlit/models/__init__.py +28 -30
  19. beamlit/models/acl.py +2 -0
  20. beamlit/models/agent.py +2 -0
  21. beamlit/models/agent_chain.py +2 -0
  22. beamlit/models/agent_configuration.py +2 -0
  23. beamlit/models/agent_deployment.py +44 -99
  24. beamlit/models/agent_deployment_configuration.py +45 -0
  25. beamlit/models/agent_deployment_history.py +15 -46
  26. beamlit/models/agent_deployment_history_event.py +24 -78
  27. beamlit/models/agent_deployment_pod_template.py +45 -0
  28. beamlit/models/agent_history.py +165 -0
  29. beamlit/models/agent_history_event.py +131 -0
  30. beamlit/models/agent_metadata.py +144 -0
  31. beamlit/models/agent_release.py +2 -0
  32. beamlit/models/agent_spec.py +238 -0
  33. beamlit/models/agent_with_deployments.py +2 -0
  34. beamlit/models/api_key.py +2 -0
  35. beamlit/models/authentication_provider_model.py +2 -0
  36. beamlit/models/authentication_provider_organization.py +2 -0
  37. beamlit/models/configuration.py +2 -0
  38. beamlit/models/continent.py +2 -0
  39. beamlit/models/core_spec.py +179 -0
  40. beamlit/models/country.py +2 -0
  41. beamlit/models/create_api_key_for_service_account_body.py +2 -0
  42. beamlit/models/create_workspace_service_account_body.py +2 -0
  43. beamlit/models/create_workspace_service_account_response_200.py +2 -0
  44. beamlit/models/delete_workspace_service_account_response_200.py +2 -0
  45. beamlit/models/deployment_configuration.py +2 -0
  46. beamlit/models/deployment_configurations.py +2 -0
  47. beamlit/models/deployment_serverless_config.py +131 -0
  48. beamlit/models/environment.py +2 -0
  49. beamlit/models/environment_metrics.py +2 -0
  50. beamlit/models/environment_spec.py +61 -0
  51. beamlit/models/flavor.py +2 -0
  52. beamlit/models/function.py +2 -0
  53. beamlit/models/function_configuration.py +2 -0
  54. beamlit/models/function_deployment.py +44 -99
  55. beamlit/models/function_deployment_configuration.py +45 -0
  56. beamlit/models/function_deployment_pod_template.py +45 -0
  57. beamlit/models/function_kit.py +2 -0
  58. beamlit/models/function_metadata.py +144 -0
  59. beamlit/models/function_provider_ref.py +2 -0
  60. beamlit/models/function_release.py +2 -0
  61. beamlit/models/function_spec.py +240 -0
  62. beamlit/models/function_with_deployments.py +2 -0
  63. beamlit/models/get_workspace_service_accounts_response_200_item.py +2 -0
  64. beamlit/models/increase_and_rate_metric.py +2 -0
  65. beamlit/models/integration.py +2 -0
  66. beamlit/models/integration_config.py +2 -0
  67. beamlit/models/integration_connection.py +2 -0
  68. beamlit/models/integration_connection_config.py +2 -0
  69. beamlit/models/integration_connection_secret.py +2 -0
  70. beamlit/models/integration_connection_spec.py +99 -0
  71. beamlit/models/integration_model.py +2 -0
  72. beamlit/models/integration_secret.py +2 -0
  73. beamlit/models/invite_workspace_user_body.py +2 -0
  74. beamlit/models/labels_type_0.py +2 -0
  75. beamlit/models/location.py +2 -0
  76. beamlit/models/location_response.py +2 -0
  77. beamlit/models/metadata.py +135 -0
  78. beamlit/models/metadata_labels.py +43 -0
  79. beamlit/models/metric.py +2 -0
  80. beamlit/models/metrics.py +2 -0
  81. beamlit/models/model.py +2 -0
  82. beamlit/models/model_deployment.py +66 -85
  83. beamlit/models/model_deployment_log.py +2 -0
  84. beamlit/models/model_deployment_metrics.py +2 -0
  85. beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +2 -0
  86. beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +2 -0
  87. beamlit/models/model_deployment_pod_template.py +45 -0
  88. beamlit/models/model_metadata.py +144 -0
  89. beamlit/models/model_metrics.py +2 -0
  90. beamlit/models/model_provider.py +2 -0
  91. beamlit/models/model_provider_ref.py +2 -0
  92. beamlit/models/model_release.py +2 -0
  93. beamlit/models/model_spec.py +188 -0
  94. beamlit/models/model_with_deployments.py +2 -0
  95. beamlit/models/owner_fields.py +68 -0
  96. beamlit/models/pending_invitation.py +2 -0
  97. beamlit/models/pending_invitation_accept.py +2 -0
  98. beamlit/models/pending_invitation_render.py +2 -0
  99. beamlit/models/pending_invitation_render_invited_by.py +2 -0
  100. beamlit/models/pending_invitation_render_workspace.py +2 -0
  101. beamlit/models/pending_invitation_workspace_details.py +2 -0
  102. beamlit/models/pod_template_spec.py +43 -0
  103. beamlit/models/policy.py +36 -8
  104. beamlit/models/policy_location.py +2 -0
  105. beamlit/models/policy_spec.py +119 -0
  106. beamlit/models/provider_config.py +2 -0
  107. beamlit/models/qps.py +2 -0
  108. beamlit/models/resource_deployment_log.py +2 -0
  109. beamlit/models/resource_deployment_metrics.py +70 -155
  110. beamlit/models/resource_deployment_metrics_inference_per_region.py +77 -0
  111. beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +77 -0
  112. beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +75 -0
  113. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +75 -0
  114. beamlit/models/resource_environment_metrics.py +172 -0
  115. beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +75 -0
  116. beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +73 -0
  117. beamlit/models/resource_log.py +68 -0
  118. beamlit/models/resource_metrics.py +2 -0
  119. beamlit/models/runtime.py +14 -29
  120. beamlit/models/runtime_readiness_probe.py +45 -0
  121. beamlit/models/runtime_resources.py +2 -0
  122. beamlit/models/runtime_type_0.py +111 -0
  123. beamlit/models/runtime_type_0_readiness_probe.py +43 -0
  124. beamlit/models/runtime_type_0_readiness_probe_type_0.py +43 -0
  125. beamlit/models/runtime_type_0_resources.py +59 -0
  126. beamlit/models/serverless_config.py +2 -0
  127. beamlit/models/spec_configuration.py +68 -0
  128. beamlit/models/standard_fields_dynamo_db.py +2 -0
  129. beamlit/models/store_agent.py +15 -29
  130. beamlit/models/store_agent_configuration.py +2 -0
  131. beamlit/models/store_agent_labels.py +45 -0
  132. beamlit/models/store_configuration.py +6 -15
  133. beamlit/models/store_configuration_option.py +7 -18
  134. beamlit/models/store_function.py +15 -29
  135. beamlit/models/store_function_configuration.py +2 -0
  136. beamlit/models/store_function_kit.py +2 -0
  137. beamlit/models/store_function_labels.py +45 -0
  138. beamlit/models/store_function_parameter.py +2 -0
  139. beamlit/models/time_fields.py +68 -0
  140. beamlit/models/update_workspace_service_account_body.py +2 -0
  141. beamlit/models/update_workspace_service_account_response_200.py +2 -0
  142. beamlit/models/update_workspace_user_role_body.py +2 -0
  143. beamlit/models/websocket_channel.py +86 -0
  144. beamlit/models/workspace.py +2 -0
  145. beamlit/models/workspace_labels.py +2 -0
  146. beamlit/models/workspace_user.py +2 -0
  147. {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc5.dist-info}/METADATA +1 -1
  148. {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc5.dist-info}/RECORD +149 -102
  149. {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc5.dist-info}/WHEEL +0 -0
@@ -0,0 +1,144 @@
1
+ from typing import TYPE_CHECKING, Any, Dict, 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
+ if TYPE_CHECKING:
9
+ from ..models.metadata_labels import MetadataLabels
10
+
11
+
12
+ T = TypeVar("T", bound="ModelMetadata")
13
+
14
+
15
+ @_attrs_define
16
+ class ModelMetadata:
17
+ """Model metadata
18
+
19
+ Attributes:
20
+ created_at (Union[Unset, str]): The date and time when the resource was created
21
+ updated_at (Union[Unset, str]): The date and time when the resource was updated
22
+ created_by (Union[Unset, str]): The user or service account who created the resource
23
+ updated_by (Union[Unset, str]): The user or service account who updated the resource
24
+ display_name (Union[Unset, str]): Model display name
25
+ labels (Union[Unset, MetadataLabels]): Labels
26
+ name (Union[Unset, str]): Model name
27
+ workspace (Union[Unset, str]): Workspace name
28
+ environment (Union[Unset, str]): Environment name
29
+ """
30
+
31
+ created_at: Union[Unset, str] = UNSET
32
+ updated_at: Union[Unset, str] = UNSET
33
+ created_by: Union[Unset, str] = UNSET
34
+ updated_by: Union[Unset, str] = UNSET
35
+ display_name: Union[Unset, str] = UNSET
36
+ labels: Union[Unset, "MetadataLabels"] = UNSET
37
+ name: Union[Unset, str] = UNSET
38
+ workspace: Union[Unset, str] = UNSET
39
+ environment: Union[Unset, str] = UNSET
40
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
41
+
42
+ def to_dict(self) -> dict[str, Any]:
43
+ created_at = self.created_at
44
+
45
+ updated_at = self.updated_at
46
+
47
+ created_by = self.created_by
48
+
49
+ updated_by = self.updated_by
50
+
51
+ display_name = self.display_name
52
+
53
+ labels: Union[Unset, Dict[str, Any]] = UNSET
54
+ if not isinstance(self.labels, Unset):
55
+ labels = self.labels.to_dict()
56
+
57
+ name = self.name
58
+
59
+ workspace = self.workspace
60
+
61
+ environment = self.environment
62
+
63
+ field_dict: dict[str, Any] = {}
64
+ field_dict.update(self.additional_properties)
65
+ field_dict.update({})
66
+ if created_at is not UNSET:
67
+ field_dict["createdAt"] = created_at
68
+ if updated_at is not UNSET:
69
+ field_dict["updatedAt"] = updated_at
70
+ if created_by is not UNSET:
71
+ field_dict["createdBy"] = created_by
72
+ if updated_by is not UNSET:
73
+ field_dict["updatedBy"] = updated_by
74
+ if display_name is not UNSET:
75
+ field_dict["displayName"] = display_name
76
+ if labels is not UNSET:
77
+ field_dict["labels"] = labels
78
+ if name is not UNSET:
79
+ field_dict["name"] = name
80
+ if workspace is not UNSET:
81
+ field_dict["workspace"] = workspace
82
+ if environment is not UNSET:
83
+ field_dict["environment"] = environment
84
+
85
+ return field_dict
86
+
87
+ @classmethod
88
+ def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
89
+ from ..models.metadata_labels import MetadataLabels
90
+
91
+ d = src_dict.copy()
92
+ created_at = d.pop("createdAt", UNSET)
93
+
94
+ updated_at = d.pop("updatedAt", UNSET)
95
+
96
+ created_by = d.pop("createdBy", UNSET)
97
+
98
+ updated_by = d.pop("updatedBy", UNSET)
99
+
100
+ display_name = d.pop("displayName", UNSET)
101
+
102
+ _labels = d.pop("labels", UNSET)
103
+ labels: Union[Unset, MetadataLabels]
104
+ if isinstance(_labels, Unset):
105
+ labels = UNSET
106
+ else:
107
+ labels = MetadataLabels.from_dict(_labels)
108
+
109
+ name = d.pop("name", UNSET)
110
+
111
+ workspace = d.pop("workspace", UNSET)
112
+
113
+ environment = d.pop("environment", UNSET)
114
+
115
+ model_metadata = cls(
116
+ created_at=created_at,
117
+ updated_at=updated_at,
118
+ created_by=created_by,
119
+ updated_by=updated_by,
120
+ display_name=display_name,
121
+ labels=labels,
122
+ name=name,
123
+ workspace=workspace,
124
+ environment=environment,
125
+ )
126
+
127
+ model_metadata.additional_properties = d
128
+ return model_metadata
129
+
130
+ @property
131
+ def additional_keys(self) -> list[str]:
132
+ return list(self.additional_properties.keys())
133
+
134
+ def __getitem__(self, key: str) -> Any:
135
+ return self.additional_properties[key]
136
+
137
+ def __setitem__(self, key: str, value: Any) -> None:
138
+ self.additional_properties[key] = value
139
+
140
+ def __delitem__(self, key: str) -> None:
141
+ del self.additional_properties[key]
142
+
143
+ def __contains__(self, key: str) -> bool:
144
+ return key in self.additional_properties
@@ -54,6 +54,8 @@ class ModelMetrics:
54
54
  from ..models.metric import Metric
55
55
  from ..models.qps import QPS
56
56
 
57
+ if not src_dict:
58
+ return None
57
59
  d = src_dict.copy()
58
60
  inference_per_second_global = []
59
61
  _inference_per_second_global = d.pop("inference_per_second_global", UNSET)
@@ -110,6 +110,8 @@ class ModelProvider:
110
110
  from ..models.labels_type_0 import LabelsType0
111
111
  from ..models.provider_config import ProviderConfig
112
112
 
113
+ if not src_dict:
114
+ return None
113
115
  d = src_dict.copy()
114
116
  created_at = d.pop("created_at", UNSET)
115
117
 
@@ -38,6 +38,8 @@ class ModelProviderRef:
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
  kind = d.pop("kind", UNSET)
43
45
 
@@ -38,6 +38,8 @@ class ModelRelease:
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
  from_ = d.pop("from", UNSET)
43
45
 
@@ -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