blaxel 0.2.33__py3-none-any.whl → 0.2.35__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. blaxel/__init__.py +2 -2
  2. blaxel/core/__init__.py +2 -1
  3. blaxel/core/client/api/agents/create_agent.py +64 -19
  4. blaxel/core/client/api/agents/delete_agent.py +44 -15
  5. blaxel/core/client/api/agents/get_agent.py +43 -14
  6. blaxel/core/client/api/agents/list_agents.py +40 -11
  7. blaxel/core/client/api/agents/update_agent.py +60 -19
  8. blaxel/core/client/api/compute/create_sandbox.py +60 -23
  9. blaxel/core/client/api/compute/delete_sandbox.py +40 -19
  10. blaxel/core/client/api/compute/get_sandbox.py +39 -18
  11. blaxel/core/client/api/compute/list_sandboxes.py +40 -19
  12. blaxel/core/client/api/compute/update_sandbox.py +56 -23
  13. blaxel/core/client/api/configurations/get_configuration.py +16 -4
  14. blaxel/core/client/api/customdomains/create_custom_domain.py +12 -0
  15. blaxel/core/client/api/customdomains/list_custom_domains.py +16 -4
  16. blaxel/core/client/api/default/get_template.py +8 -4
  17. blaxel/core/client/api/functions/create_function.py +62 -19
  18. blaxel/core/client/api/functions/delete_function.py +46 -15
  19. blaxel/core/client/api/functions/get_function.py +45 -14
  20. blaxel/core/client/api/functions/list_functions.py +44 -15
  21. blaxel/core/client/api/functions/update_function.py +62 -19
  22. blaxel/core/client/api/images/cleanup_images.py +12 -12
  23. blaxel/core/client/api/images/delete_image.py +12 -8
  24. blaxel/core/client/api/images/delete_image_tag.py +12 -8
  25. blaxel/core/client/api/images/get_image.py +12 -8
  26. blaxel/core/client/api/images/list_images.py +12 -8
  27. blaxel/core/client/api/integrations/create_integration_connection.py +56 -23
  28. blaxel/core/client/api/integrations/delete_integration_connection.py +48 -19
  29. blaxel/core/client/api/integrations/get_integration.py +12 -8
  30. blaxel/core/client/api/integrations/get_integration_connection.py +44 -19
  31. blaxel/core/client/api/integrations/get_integration_connection_model.py +2 -2
  32. blaxel/core/client/api/integrations/list_integration_connections.py +36 -19
  33. blaxel/core/client/api/integrations/update_integration_connection.py +52 -19
  34. blaxel/core/client/api/jobs/create_job.py +20 -12
  35. blaxel/core/client/api/jobs/create_job_execution.py +22 -16
  36. blaxel/core/client/api/jobs/delete_job.py +12 -8
  37. blaxel/core/client/api/jobs/delete_job_execution.py +12 -8
  38. blaxel/core/client/api/jobs/get_job.py +24 -20
  39. blaxel/core/client/api/jobs/get_job_execution.py +8 -4
  40. blaxel/core/client/api/jobs/list_job_executions.py +8 -4
  41. blaxel/core/client/api/jobs/list_jobs.py +12 -8
  42. blaxel/core/client/api/jobs/update_job.py +20 -12
  43. blaxel/core/client/api/locations/list_locations.py +12 -8
  44. blaxel/core/client/api/{default → mcphub}/list_mcp_hub_definitions.py +20 -4
  45. blaxel/core/client/api/models/create_model.py +52 -23
  46. blaxel/core/client/api/models/delete_model.py +40 -19
  47. blaxel/core/client/api/models/get_model.py +40 -19
  48. blaxel/core/client/api/models/list_models.py +40 -19
  49. blaxel/core/client/api/models/update_model.py +52 -23
  50. blaxel/core/client/api/policies/create_policy.py +12 -8
  51. blaxel/core/client/api/policies/delete_policy.py +12 -8
  52. blaxel/core/client/api/policies/get_policy.py +12 -8
  53. blaxel/core/client/api/policies/list_policies.py +12 -8
  54. blaxel/core/client/api/policies/update_policy.py +12 -8
  55. blaxel/core/client/api/public_ipslist/list_public_ips.py +37 -5
  56. blaxel/core/client/api/sandboxhub/__init__.py +0 -0
  57. blaxel/core/client/api/{default → sandboxhub}/list_sandbox_hub_definitions.py +20 -4
  58. blaxel/core/client/api/service_accounts/create_api_key_for_service_account.py +12 -8
  59. blaxel/core/client/api/service_accounts/create_workspace_service_account.py +12 -8
  60. blaxel/core/client/api/service_accounts/delete_api_key_for_service_account.py +6 -4
  61. blaxel/core/client/api/service_accounts/delete_workspace_service_account.py +12 -8
  62. blaxel/core/client/api/service_accounts/get_workspace_service_accounts.py +12 -8
  63. blaxel/core/client/api/service_accounts/list_api_keys_for_service_account.py +12 -8
  64. blaxel/core/client/api/service_accounts/update_workspace_service_account.py +8 -8
  65. blaxel/core/client/api/templates/list_templates.py +12 -8
  66. blaxel/core/client/api/volume_templates/create_volume_template.py +8 -4
  67. blaxel/core/client/api/volume_templates/list_volume_templates.py +8 -4
  68. blaxel/core/client/api/volumes/create_volume.py +56 -23
  69. blaxel/core/client/api/volumes/delete_volume.py +44 -19
  70. blaxel/core/client/api/volumes/get_volume.py +40 -19
  71. blaxel/core/client/api/volumes/list_volumes.py +40 -19
  72. blaxel/core/client/api/workspaces/create_workspace.py +54 -23
  73. blaxel/core/client/api/workspaces/delete_workspace.py +42 -19
  74. blaxel/core/client/api/workspaces/get_workspace.py +42 -19
  75. blaxel/core/client/api/workspaces/invite_workspace_user.py +8 -4
  76. blaxel/core/client/api/workspaces/list_workspace_users.py +12 -8
  77. blaxel/core/client/api/workspaces/list_workspaces.py +36 -19
  78. blaxel/core/client/api/workspaces/update_workspace.py +50 -19
  79. blaxel/core/client/models/__init__.py +76 -146
  80. blaxel/core/client/models/agent.py +43 -47
  81. blaxel/core/client/models/agent_runtime.py +139 -0
  82. blaxel/core/client/models/agent_runtime_generation.py +18 -0
  83. blaxel/core/client/models/agent_spec.py +33 -110
  84. blaxel/core/client/models/api_key.py +5 -4
  85. blaxel/core/client/models/core_event.py +5 -5
  86. blaxel/core/client/models/create_api_key_for_service_account_body.py +2 -1
  87. blaxel/core/client/models/create_job_execution_request.py +1 -1
  88. blaxel/core/client/models/create_job_execution_response.py +13 -9
  89. blaxel/core/client/models/custom_domain.py +19 -36
  90. blaxel/core/client/models/custom_domain_metadata.py +4 -3
  91. blaxel/core/client/models/custom_domain_spec.py +14 -5
  92. blaxel/core/client/models/custom_domain_spec_status.py +19 -0
  93. blaxel/core/client/models/entrypoint.py +39 -13
  94. blaxel/core/client/models/{workspace_labels.py → entrypoint_args_item.py} +6 -6
  95. blaxel/core/client/models/entrypoint_env.py +3 -3
  96. blaxel/core/client/models/{job_metrics_executions_total.py → entrypoint_super_gateway_args_item.py} +6 -6
  97. blaxel/core/client/models/{spec_configuration.py → env.py} +17 -8
  98. blaxel/core/{sandbox/client/models/welcome_response.py → client/models/error.py} +26 -23
  99. blaxel/core/client/models/expiration_policy.py +30 -11
  100. blaxel/core/client/models/expiration_policy_action.py +17 -0
  101. blaxel/core/client/models/expiration_policy_type.py +19 -0
  102. blaxel/core/client/models/flavor.py +13 -5
  103. blaxel/core/client/models/flavor_type.py +18 -0
  104. blaxel/core/client/models/form.py +6 -6
  105. blaxel/core/client/models/function.py +43 -47
  106. blaxel/core/client/models/function_runtime.py +138 -0
  107. blaxel/core/client/models/function_runtime_generation.py +18 -0
  108. blaxel/core/client/models/function_spec.py +27 -73
  109. blaxel/core/client/models/function_spec_transport.py +18 -0
  110. blaxel/core/client/models/image.py +19 -36
  111. blaxel/core/client/models/integration_connection.py +25 -39
  112. blaxel/core/client/models/integration_connection_spec.py +8 -5
  113. blaxel/core/client/models/integration_connection_spec_config.py +1 -1
  114. blaxel/core/client/models/integration_connection_spec_secret.py +1 -1
  115. blaxel/core/client/models/integration_endpoint.py +41 -11
  116. blaxel/core/client/models/integration_endpoint_ignore_models_item.py +45 -0
  117. blaxel/core/client/models/{mcp_definition_entrypoint.py → integration_endpoint_models_item.py} +6 -6
  118. blaxel/core/client/models/job.py +43 -47
  119. blaxel/core/client/models/job_execution.py +30 -37
  120. blaxel/core/client/models/job_execution_metadata.py +3 -3
  121. blaxel/core/client/models/job_execution_spec.py +2 -2
  122. blaxel/core/client/models/job_execution_stats.py +5 -5
  123. blaxel/core/client/models/job_execution_status.py +24 -0
  124. blaxel/core/client/models/job_execution_task.py +12 -4
  125. blaxel/core/client/models/job_execution_task_metadata.py +1 -1
  126. blaxel/core/client/models/job_execution_task_spec.py +2 -2
  127. blaxel/core/client/models/job_execution_task_status.py +23 -0
  128. blaxel/core/client/models/job_runtime.py +172 -0
  129. blaxel/core/client/models/job_runtime_generation.py +18 -0
  130. blaxel/core/client/models/job_spec.py +20 -88
  131. blaxel/core/client/models/location_response.py +5 -5
  132. blaxel/core/client/models/mcp_definition.py +30 -17
  133. blaxel/core/client/models/{job_metrics_tasks_total.py → mcp_definition_categories_item.py} +6 -6
  134. blaxel/core/client/models/metadata.py +23 -17
  135. blaxel/core/client/models/metadata_labels.py +4 -1
  136. blaxel/core/client/models/model.py +43 -47
  137. blaxel/core/client/models/model_runtime.py +99 -0
  138. blaxel/core/client/models/model_runtime_type.py +34 -0
  139. blaxel/core/client/models/model_spec.py +12 -58
  140. blaxel/core/client/models/o_auth.py +23 -6
  141. blaxel/core/client/models/{form_oauth.py → o_auth_scope_item.py} +6 -6
  142. blaxel/core/client/models/pending_invitation_accept.py +2 -1
  143. blaxel/core/client/models/pending_invitation_workspace_details.py +27 -6
  144. blaxel/core/client/models/{metrics_request_total_per_code.py → pending_invitation_workspace_details_emails_item.py} +6 -6
  145. blaxel/core/client/models/policy.py +20 -36
  146. blaxel/core/client/models/policy_location.py +13 -5
  147. blaxel/core/client/models/policy_location_type.py +19 -0
  148. blaxel/core/client/models/policy_max_tokens.py +6 -6
  149. blaxel/core/client/models/policy_resource_type.py +20 -0
  150. blaxel/core/client/models/policy_spec.py +31 -10
  151. blaxel/core/client/models/policy_spec_type.py +19 -0
  152. blaxel/core/client/models/port.py +25 -15
  153. blaxel/core/client/models/port_protocol.py +19 -0
  154. blaxel/core/client/models/preview.py +19 -36
  155. blaxel/core/client/models/preview_metadata.py +12 -10
  156. blaxel/core/client/models/preview_token.py +19 -36
  157. blaxel/core/client/models/preview_token_metadata.py +8 -6
  158. blaxel/core/client/models/repository.py +2 -2
  159. blaxel/core/client/models/revision_configuration.py +3 -3
  160. blaxel/core/client/models/sandbox.py +45 -58
  161. blaxel/core/client/models/sandbox_definition.py +37 -22
  162. blaxel/core/client/models/sandbox_definition_categories_item.py +45 -0
  163. blaxel/core/client/models/sandbox_error.py +148 -0
  164. blaxel/core/client/models/sandbox_error_details.py +45 -0
  165. blaxel/core/client/models/sandbox_lifecycle.py +3 -2
  166. blaxel/core/client/models/sandbox_runtime.py +145 -0
  167. blaxel/core/client/models/sandbox_spec.py +33 -134
  168. blaxel/core/client/models/status.py +25 -0
  169. blaxel/core/client/models/template.py +8 -7
  170. blaxel/core/client/models/template_variable.py +5 -5
  171. blaxel/core/client/models/trigger.py +14 -6
  172. blaxel/core/client/models/trigger_configuration.py +7 -6
  173. blaxel/core/client/models/trigger_type.py +19 -0
  174. blaxel/core/client/models/volume.py +35 -47
  175. blaxel/core/client/models/volume_attachment.py +6 -4
  176. blaxel/core/client/models/volume_spec.py +7 -4
  177. blaxel/core/client/models/volume_state.py +3 -3
  178. blaxel/core/client/models/volume_template.py +19 -33
  179. blaxel/core/client/models/volume_template_state.py +12 -4
  180. blaxel/core/client/models/volume_template_state_status.py +19 -0
  181. blaxel/core/client/models/volume_template_version.py +12 -4
  182. blaxel/core/client/models/volume_template_version_status.py +19 -0
  183. blaxel/core/client/models/workspace.py +35 -25
  184. blaxel/core/client/models/workspace_runtime.py +3 -2
  185. blaxel/core/client/models/workspace_status.py +22 -0
  186. blaxel/core/common/__init__.py +1 -1
  187. blaxel/core/jobs/__init__.py +0 -1
  188. blaxel/core/sandbox/__init__.py +2 -0
  189. blaxel/core/sandbox/client/api/process/post_process.py +8 -4
  190. blaxel/core/sandbox/client/models/__init__.py +0 -2
  191. blaxel/core/sandbox/client/models/process_response.py +16 -0
  192. blaxel/core/sandbox/client/models/process_response_status.py +9 -0
  193. blaxel/core/sandbox/default/__init__.py +2 -0
  194. blaxel/core/sandbox/default/interpreter.py +5 -1
  195. blaxel/core/sandbox/default/preview.py +3 -1
  196. blaxel/core/sandbox/default/sandbox.py +85 -26
  197. blaxel/core/sandbox/sync/process.py +2 -1
  198. blaxel/core/sandbox/sync/sandbox.py +68 -23
  199. blaxel/core/sandbox/types.py +3 -0
  200. blaxel/core/tools/common.py +16 -2
  201. blaxel/core/volume/__init__.py +2 -2
  202. blaxel/core/volume/volume.py +227 -11
  203. blaxel/langgraph/tools.py +34 -2
  204. blaxel/openai/tools.py +33 -1
  205. {blaxel-0.2.33.dist-info → blaxel-0.2.35.dist-info}/METADATA +3 -3
  206. {blaxel-0.2.33.dist-info → blaxel-0.2.35.dist-info}/RECORD +209 -248
  207. blaxel/core/client/models/acl.py +0 -133
  208. blaxel/core/client/models/billable_time_metric.py +0 -89
  209. blaxel/core/client/models/core_spec.py +0 -194
  210. blaxel/core/client/models/core_spec_configurations.py +0 -77
  211. blaxel/core/client/models/histogram_bucket.py +0 -79
  212. blaxel/core/client/models/histogram_stats.py +0 -88
  213. blaxel/core/client/models/integration_model.py +0 -162
  214. blaxel/core/client/models/job_execution_config.py +0 -79
  215. blaxel/core/client/models/job_metrics.py +0 -262
  216. blaxel/core/client/models/jobs_chart_value.py +0 -70
  217. blaxel/core/client/models/jobs_network_chart.py +0 -102
  218. blaxel/core/client/models/jobs_success_failed_chart.py +0 -147
  219. blaxel/core/client/models/jobs_total.py +0 -88
  220. blaxel/core/client/models/last_n_requests_metric.py +0 -97
  221. blaxel/core/client/models/latency_metric.py +0 -148
  222. blaxel/core/client/models/logs_response.py +0 -63
  223. blaxel/core/client/models/logs_response_data.py +0 -99
  224. blaxel/core/client/models/mcp_definition_form.py +0 -45
  225. blaxel/core/client/models/memory_allocation_by_name.py +0 -70
  226. blaxel/core/client/models/memory_allocation_metric.py +0 -61
  227. blaxel/core/client/models/metric.py +0 -79
  228. blaxel/core/client/models/metrics.py +0 -273
  229. blaxel/core/client/models/metrics_models.py +0 -45
  230. blaxel/core/client/models/metrics_rps_per_code.py +0 -45
  231. blaxel/core/client/models/pod_template_spec.py +0 -45
  232. blaxel/core/client/models/request_duration_over_time_metric.py +0 -97
  233. blaxel/core/client/models/request_duration_over_time_metrics.py +0 -84
  234. blaxel/core/client/models/request_total_by_origin_metric.py +0 -129
  235. blaxel/core/client/models/request_total_by_origin_metric_request_total_by_origin.py +0 -45
  236. blaxel/core/client/models/request_total_by_origin_metric_request_total_by_origin_and_code.py +0 -45
  237. blaxel/core/client/models/request_total_metric.py +0 -155
  238. blaxel/core/client/models/request_total_metric_request_total_per_code.py +0 -45
  239. blaxel/core/client/models/request_total_metric_rps_per_code.py +0 -45
  240. blaxel/core/client/models/request_total_response_data.py +0 -97
  241. blaxel/core/client/models/resource.py +0 -99
  242. blaxel/core/client/models/resource_log.py +0 -88
  243. blaxel/core/client/models/resource_log_chart.py +0 -133
  244. blaxel/core/client/models/resource_log_response.py +0 -83
  245. blaxel/core/client/models/resource_metrics.py +0 -618
  246. blaxel/core/client/models/resource_metrics_request_total_per_code.py +0 -45
  247. blaxel/core/client/models/resource_metrics_request_total_per_code_previous.py +0 -45
  248. blaxel/core/client/models/resource_metrics_rps_per_code.py +0 -45
  249. blaxel/core/client/models/resource_metrics_rps_per_code_previous.py +0 -45
  250. blaxel/core/client/models/resource_trace.py +0 -97
  251. blaxel/core/client/models/runtime.py +0 -317
  252. blaxel/core/client/models/runtime_configuration.py +0 -45
  253. blaxel/core/client/models/runtime_startup_probe.py +0 -45
  254. blaxel/core/client/models/sandbox_metrics.py +0 -88
  255. blaxel/core/client/models/serverless_config.py +0 -117
  256. blaxel/core/client/models/serverless_config_configuration.py +0 -45
  257. blaxel/core/client/models/start_sandbox.py +0 -98
  258. blaxel/core/client/models/stop_sandbox.py +0 -98
  259. blaxel/core/client/models/store_agent.py +0 -181
  260. blaxel/core/client/models/store_agent_labels.py +0 -45
  261. blaxel/core/client/models/store_configuration.py +0 -156
  262. blaxel/core/client/models/store_configuration_option.py +0 -79
  263. blaxel/core/client/models/time_to_first_token_over_time_metrics.py +0 -87
  264. blaxel/core/client/models/token_rate_metric.py +0 -106
  265. blaxel/core/client/models/token_rate_metrics.py +0 -124
  266. blaxel/core/client/models/token_total_metric.py +0 -112
  267. blaxel/core/client/models/trace_ids_response.py +0 -45
  268. blaxel/core/client/models/websocket_channel.py +0 -97
  269. blaxel/core/client/models/websocket_message.py +0 -106
  270. blaxel/core/sandbox/client/api/root/delete.py +0 -130
  271. blaxel/core/sandbox/client/api/root/get.py +0 -130
  272. blaxel/core/sandbox/client/api/root/options.py +0 -130
  273. blaxel/core/sandbox/client/api/root/patch.py +0 -130
  274. blaxel/core/sandbox/client/api/root/post.py +0 -130
  275. blaxel/core/sandbox/client/api/root/put.py +0 -130
  276. /blaxel/core/{sandbox/client/api/root → client/api/mcphub}/__init__.py +0 -0
  277. {blaxel-0.2.33.dist-info → blaxel-0.2.35.dist-info}/WHEEL +0 -0
  278. {blaxel-0.2.33.dist-info → blaxel-0.2.35.dist-info}/licenses/LICENSE +0 -0
@@ -1,10 +1,16 @@
1
- from typing import 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
5
5
 
6
6
  from ..types import UNSET, Unset
7
7
 
8
+ if TYPE_CHECKING:
9
+ from ..models.pending_invitation_workspace_details_emails_item import (
10
+ PendingInvitationWorkspaceDetailsEmailsItem,
11
+ )
12
+
13
+
8
14
  T = TypeVar("T", bound="PendingInvitationWorkspaceDetails")
9
15
 
10
16
 
@@ -13,18 +19,24 @@ class PendingInvitationWorkspaceDetails:
13
19
  """Workspace details
14
20
 
15
21
  Attributes:
16
- emails (Union[Unset, list[Any]]): List of user emails in the workspace
22
+ emails (Union[Unset, list['PendingInvitationWorkspaceDetailsEmailsItem']]): List of user emails in the workspace
17
23
  user_number (Union[Unset, float]): Number of users in the workspace
18
24
  """
19
25
 
20
- emails: Union[Unset, list[Any]] = UNSET
26
+ emails: Union[Unset, list["PendingInvitationWorkspaceDetailsEmailsItem"]] = UNSET
21
27
  user_number: Union[Unset, float] = UNSET
22
28
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
29
 
24
30
  def to_dict(self) -> dict[str, Any]:
25
- emails: Union[Unset, list[Any]] = UNSET
31
+ emails: Union[Unset, list[dict[str, Any]]] = UNSET
26
32
  if not isinstance(self.emails, Unset):
27
- emails = self.emails
33
+ emails = []
34
+ for emails_item_data in self.emails:
35
+ if type(emails_item_data) is dict:
36
+ emails_item = emails_item_data
37
+ else:
38
+ emails_item = emails_item_data.to_dict()
39
+ emails.append(emails_item)
28
40
 
29
41
  user_number = self.user_number
30
42
 
@@ -40,10 +52,19 @@ class PendingInvitationWorkspaceDetails:
40
52
 
41
53
  @classmethod
42
54
  def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None:
55
+ from ..models.pending_invitation_workspace_details_emails_item import (
56
+ PendingInvitationWorkspaceDetailsEmailsItem,
57
+ )
58
+
43
59
  if not src_dict:
44
60
  return None
45
61
  d = src_dict.copy()
46
- emails = cast(list[Any], d.pop("emails", UNSET))
62
+ emails = []
63
+ _emails = d.pop("emails", UNSET)
64
+ for emails_item_data in _emails or []:
65
+ emails_item = PendingInvitationWorkspaceDetailsEmailsItem.from_dict(emails_item_data)
66
+
67
+ emails.append(emails_item)
47
68
 
48
69
  user_number = d.pop("user_number", UNSET)
49
70
 
@@ -3,12 +3,12 @@ from typing import Any, TypeVar
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
- T = TypeVar("T", bound="MetricsRequestTotalPerCode")
6
+ T = TypeVar("T", bound="PendingInvitationWorkspaceDetailsEmailsItem")
7
7
 
8
8
 
9
9
  @_attrs_define
10
- class MetricsRequestTotalPerCode:
11
- """Number of requests for all resources globally per code"""
10
+ class PendingInvitationWorkspaceDetailsEmailsItem:
11
+ """ """
12
12
 
13
13
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
14
14
 
@@ -23,10 +23,10 @@ class MetricsRequestTotalPerCode:
23
23
  if not src_dict:
24
24
  return None
25
25
  d = src_dict.copy()
26
- metrics_request_total_per_code = cls()
26
+ pending_invitation_workspace_details_emails_item = cls()
27
27
 
28
- metrics_request_total_per_code.additional_properties = d
29
- return metrics_request_total_per_code
28
+ pending_invitation_workspace_details_emails_item.additional_properties = d
29
+ return pending_invitation_workspace_details_emails_item
30
30
 
31
31
  @property
32
32
  def additional_keys(self) -> list[str]:
@@ -1,10 +1,8 @@
1
- from typing import TYPE_CHECKING, Any, TypeVar, Union
1
+ from typing import TYPE_CHECKING, Any, TypeVar
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
- from ..types import UNSET, Unset
7
-
8
6
  if TYPE_CHECKING:
9
7
  from ..models.metadata import Metadata
10
8
  from ..models.policy_spec import PolicySpec
@@ -18,38 +16,34 @@ class Policy:
18
16
  """Rule that controls how a deployment is made and served (e.g. location restrictions)
19
17
 
20
18
  Attributes:
21
- metadata (Union[Unset, Metadata]): Metadata
22
- spec (Union[Unset, PolicySpec]): Policy specification
19
+ metadata (Metadata): Common metadata fields shared by all Blaxel resources including name, labels, timestamps,
20
+ and ownership information
21
+ spec (PolicySpec): Policy specification
23
22
  """
24
23
 
25
- metadata: Union[Unset, "Metadata"] = UNSET
26
- spec: Union[Unset, "PolicySpec"] = UNSET
24
+ metadata: "Metadata"
25
+ spec: "PolicySpec"
27
26
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
28
27
 
29
28
  def to_dict(self) -> dict[str, Any]:
30
- metadata: Union[Unset, dict[str, Any]] = UNSET
31
- if (
32
- self.metadata
33
- and not isinstance(self.metadata, Unset)
34
- and not isinstance(self.metadata, dict)
35
- ):
36
- metadata = self.metadata.to_dict()
37
- elif self.metadata and isinstance(self.metadata, dict):
29
+ if type(self.metadata) is dict:
38
30
  metadata = self.metadata
31
+ else:
32
+ metadata = self.metadata.to_dict()
39
33
 
40
- spec: Union[Unset, dict[str, Any]] = UNSET
41
- if self.spec and not isinstance(self.spec, Unset) and not isinstance(self.spec, dict):
42
- spec = self.spec.to_dict()
43
- elif self.spec and isinstance(self.spec, dict):
34
+ if type(self.spec) is dict:
44
35
  spec = self.spec
36
+ else:
37
+ spec = self.spec.to_dict()
45
38
 
46
39
  field_dict: dict[str, Any] = {}
47
40
  field_dict.update(self.additional_properties)
48
- field_dict.update({})
49
- if metadata is not UNSET:
50
- field_dict["metadata"] = metadata
51
- if spec is not UNSET:
52
- field_dict["spec"] = spec
41
+ field_dict.update(
42
+ {
43
+ "metadata": metadata,
44
+ "spec": spec,
45
+ }
46
+ )
53
47
 
54
48
  return field_dict
55
49
 
@@ -61,19 +55,9 @@ class Policy:
61
55
  if not src_dict:
62
56
  return None
63
57
  d = src_dict.copy()
64
- _metadata = d.pop("metadata", UNSET)
65
- metadata: Union[Unset, Metadata]
66
- if isinstance(_metadata, Unset):
67
- metadata = UNSET
68
- else:
69
- metadata = Metadata.from_dict(_metadata)
58
+ metadata = Metadata.from_dict(d.pop("metadata"))
70
59
 
71
- _spec = d.pop("spec", UNSET)
72
- spec: Union[Unset, PolicySpec]
73
- if isinstance(_spec, Unset):
74
- spec = UNSET
75
- else:
76
- spec = PolicySpec.from_dict(_spec)
60
+ spec = PolicySpec.from_dict(d.pop("spec"))
77
61
 
78
62
  policy = cls(
79
63
  metadata=metadata,
@@ -3,6 +3,7 @@ from typing import Any, TypeVar, Union
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
+ from ..models.policy_location_type import PolicyLocationType
6
7
  from ..types import UNSET, Unset
7
8
 
8
9
  T = TypeVar("T", bound="PolicyLocation")
@@ -13,18 +14,20 @@ class PolicyLocation:
13
14
  """Policy location
14
15
 
15
16
  Attributes:
16
- name (Union[Unset, str]): Policy location name
17
- type_ (Union[Unset, str]): Policy location type
17
+ name (Union[Unset, str]): Policy location name Example: EU.
18
+ type_ (Union[Unset, PolicyLocationType]): Policy location type Example: continent.
18
19
  """
19
20
 
20
21
  name: Union[Unset, str] = UNSET
21
- type_: Union[Unset, str] = UNSET
22
+ type_: Union[Unset, PolicyLocationType] = UNSET
22
23
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
24
 
24
25
  def to_dict(self) -> dict[str, Any]:
25
26
  name = self.name
26
27
 
27
- type_ = self.type_
28
+ type_: Union[Unset, str] = UNSET
29
+ if not isinstance(self.type_, Unset):
30
+ type_ = self.type_.value
28
31
 
29
32
  field_dict: dict[str, Any] = {}
30
33
  field_dict.update(self.additional_properties)
@@ -43,7 +46,12 @@ class PolicyLocation:
43
46
  d = src_dict.copy()
44
47
  name = d.pop("name", UNSET)
45
48
 
46
- type_ = d.pop("type", d.pop("type_", UNSET))
49
+ _type_ = d.pop("type", d.pop("type_", UNSET))
50
+ type_: Union[Unset, PolicyLocationType]
51
+ if isinstance(_type_, Unset):
52
+ type_ = UNSET
53
+ else:
54
+ type_ = PolicyLocationType(_type_)
47
55
 
48
56
  policy_location = cls(
49
57
  name=name,
@@ -0,0 +1,19 @@
1
+ from enum import Enum
2
+
3
+
4
+ class PolicyLocationType(str, Enum):
5
+ CONTINENT = "continent"
6
+ COUNTRY = "country"
7
+ LOCATION = "location"
8
+
9
+ def __str__(self) -> str:
10
+ return str(self.value)
11
+
12
+ @classmethod
13
+ def _missing_(cls, value: object) -> "PolicyLocationType | None":
14
+ if isinstance(value, str):
15
+ upper_value = value.upper()
16
+ for member in cls:
17
+ if member.value.upper() == upper_value:
18
+ return member
19
+ return None
@@ -13,12 +13,12 @@ class PolicyMaxTokens:
13
13
  """PolicyMaxTokens is a local type that wraps a slice of PolicyMaxTokens
14
14
 
15
15
  Attributes:
16
- granularity (Union[Unset, str]): Granularity
17
- input_ (Union[Unset, int]): Input
18
- output (Union[Unset, int]): Output
19
- ratio_input_over_output (Union[Unset, int]): RatioInputOverOutput
20
- step (Union[Unset, int]): Step
21
- total (Union[Unset, int]): Total
16
+ granularity (Union[Unset, str]): Granularity Example: minute.
17
+ input_ (Union[Unset, int]): Input Example: 10000.
18
+ output (Union[Unset, int]): Output Example: 5000.
19
+ ratio_input_over_output (Union[Unset, int]): RatioInputOverOutput Example: 2.
20
+ step (Union[Unset, int]): Step Example: 1.
21
+ total (Union[Unset, int]): Total Example: 15000.
22
22
  """
23
23
 
24
24
  granularity: Union[Unset, str] = UNSET
@@ -0,0 +1,20 @@
1
+ from enum import Enum
2
+
3
+
4
+ class PolicyResourceType(str, Enum):
5
+ AGENT = "agent"
6
+ FUNCTION = "function"
7
+ MODEL = "model"
8
+ SANDBOX = "sandbox"
9
+
10
+ def __str__(self) -> str:
11
+ return str(self.value)
12
+
13
+ @classmethod
14
+ def _missing_(cls, value: object) -> "PolicyResourceType | None":
15
+ if isinstance(value, str):
16
+ upper_value = value.upper()
17
+ for member in cls:
18
+ if member.value.upper() == upper_value:
19
+ return member
20
+ return None
@@ -1,8 +1,10 @@
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
5
5
 
6
+ from ..models.policy_resource_type import PolicyResourceType
7
+ from ..models.policy_spec_type import PolicySpecType
6
8
  from ..types import UNSET, Unset
7
9
 
8
10
  if TYPE_CHECKING:
@@ -23,18 +25,18 @@ class PolicySpec:
23
25
  locations (Union[Unset, list['PolicyLocation']]): PolicyLocations is a local type that wraps a slice of Location
24
26
  max_tokens (Union[Unset, PolicyMaxTokens]): PolicyMaxTokens is a local type that wraps a slice of
25
27
  PolicyMaxTokens
26
- resource_types (Union[Unset, list[str]]): PolicyResourceTypes is a local type that wraps a slice of
27
- PolicyResourceType
28
+ resource_types (Union[Unset, list[PolicyResourceType]]): PolicyResourceTypes is a local type that wraps a slice
29
+ of PolicyResourceType
28
30
  sandbox (Union[Unset, bool]): Sandbox mode
29
- type_ (Union[Unset, str]): Policy type, can be location or flavor
31
+ type_ (Union[Unset, PolicySpecType]): Policy type, can be location or flavor Example: location.
30
32
  """
31
33
 
32
34
  flavors: Union[Unset, list["Flavor"]] = UNSET
33
35
  locations: Union[Unset, list["PolicyLocation"]] = UNSET
34
36
  max_tokens: Union[Unset, "PolicyMaxTokens"] = UNSET
35
- resource_types: Union[Unset, list[str]] = UNSET
37
+ resource_types: Union[Unset, list[PolicyResourceType]] = UNSET
36
38
  sandbox: Union[Unset, bool] = UNSET
37
- type_: Union[Unset, str] = UNSET
39
+ type_: Union[Unset, PolicySpecType] = UNSET
38
40
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
39
41
 
40
42
  def to_dict(self) -> dict[str, Any]:
@@ -74,11 +76,18 @@ class PolicySpec:
74
76
 
75
77
  resource_types: Union[Unset, list[str]] = UNSET
76
78
  if not isinstance(self.resource_types, Unset):
77
- resource_types = self.resource_types
79
+ resource_types = []
80
+ for componentsschemas_policy_resource_types_item_data in self.resource_types:
81
+ componentsschemas_policy_resource_types_item = (
82
+ componentsschemas_policy_resource_types_item_data.value
83
+ )
84
+ resource_types.append(componentsschemas_policy_resource_types_item)
78
85
 
79
86
  sandbox = self.sandbox
80
87
 
81
- type_ = self.type_
88
+ type_: Union[Unset, str] = UNSET
89
+ if not isinstance(self.type_, Unset):
90
+ type_ = self.type_.value
82
91
 
83
92
  field_dict: dict[str, Any] = {}
84
93
  field_dict.update(self.additional_properties)
@@ -130,11 +139,23 @@ class PolicySpec:
130
139
  else:
131
140
  max_tokens = PolicyMaxTokens.from_dict(_max_tokens)
132
141
 
133
- resource_types = cast(list[str], d.pop("resourceTypes", d.pop("resource_types", UNSET)))
142
+ resource_types = []
143
+ _resource_types = d.pop("resourceTypes", d.pop("resource_types", UNSET))
144
+ for componentsschemas_policy_resource_types_item_data in _resource_types or []:
145
+ componentsschemas_policy_resource_types_item = PolicyResourceType(
146
+ componentsschemas_policy_resource_types_item_data
147
+ )
148
+
149
+ resource_types.append(componentsschemas_policy_resource_types_item)
134
150
 
135
151
  sandbox = d.pop("sandbox", UNSET)
136
152
 
137
- type_ = d.pop("type", d.pop("type_", UNSET))
153
+ _type_ = d.pop("type", d.pop("type_", UNSET))
154
+ type_: Union[Unset, PolicySpecType]
155
+ if isinstance(_type_, Unset):
156
+ type_ = UNSET
157
+ else:
158
+ type_ = PolicySpecType(_type_)
138
159
 
139
160
  policy_spec = cls(
140
161
  flavors=flavors,
@@ -0,0 +1,19 @@
1
+ from enum import Enum
2
+
3
+
4
+ class PolicySpecType(str, Enum):
5
+ FLAVOR = "flavor"
6
+ LOCATION = "location"
7
+ MAXTOKEN = "maxToken"
8
+
9
+ def __str__(self) -> str:
10
+ return str(self.value)
11
+
12
+ @classmethod
13
+ def _missing_(cls, value: object) -> "PolicySpecType | None":
14
+ if isinstance(value, str):
15
+ upper_value = value.upper()
16
+ for member in cls:
17
+ if member.value.upper() == upper_value:
18
+ return member
19
+ return None
@@ -3,6 +3,7 @@ from typing import Any, TypeVar, Union
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
+ from ..models.port_protocol import PortProtocol
6
7
  from ..types import UNSET, Unset
7
8
 
8
9
  T = TypeVar("T", bound="Port")
@@ -13,32 +14,36 @@ class Port:
13
14
  """A port for a resource
14
15
 
15
16
  Attributes:
16
- name (Union[Unset, str]): The name of the port
17
- protocol (Union[Unset, str]): The protocol of the port
18
- target (Union[Unset, int]): The target port of the port
17
+ target (int): The target port of the port Example: 8080.
18
+ name (Union[Unset, str]): The name of the port Example: http.
19
+ protocol (Union[Unset, PortProtocol]): The protocol of the port Example: HTTP.
19
20
  """
20
21
 
22
+ target: int
21
23
  name: Union[Unset, str] = UNSET
22
- protocol: Union[Unset, str] = UNSET
23
- target: Union[Unset, int] = UNSET
24
+ protocol: Union[Unset, PortProtocol] = UNSET
24
25
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25
26
 
26
27
  def to_dict(self) -> dict[str, Any]:
28
+ target = self.target
29
+
27
30
  name = self.name
28
31
 
29
- protocol = self.protocol
30
-
31
- target = self.target
32
+ protocol: Union[Unset, str] = UNSET
33
+ if not isinstance(self.protocol, Unset):
34
+ protocol = self.protocol.value
32
35
 
33
36
  field_dict: dict[str, Any] = {}
34
37
  field_dict.update(self.additional_properties)
35
- field_dict.update({})
38
+ field_dict.update(
39
+ {
40
+ "target": target,
41
+ }
42
+ )
36
43
  if name is not UNSET:
37
44
  field_dict["name"] = name
38
45
  if protocol is not UNSET:
39
46
  field_dict["protocol"] = protocol
40
- if target is not UNSET:
41
- field_dict["target"] = target
42
47
 
43
48
  return field_dict
44
49
 
@@ -47,16 +52,21 @@ class Port:
47
52
  if not src_dict:
48
53
  return None
49
54
  d = src_dict.copy()
50
- name = d.pop("name", UNSET)
55
+ target = d.pop("target")
51
56
 
52
- protocol = d.pop("protocol", UNSET)
57
+ name = d.pop("name", UNSET)
53
58
 
54
- target = d.pop("target", UNSET)
59
+ _protocol = d.pop("protocol", UNSET)
60
+ protocol: Union[Unset, PortProtocol]
61
+ if isinstance(_protocol, Unset):
62
+ protocol = UNSET
63
+ else:
64
+ protocol = PortProtocol(_protocol)
55
65
 
56
66
  port = cls(
67
+ target=target,
57
68
  name=name,
58
69
  protocol=protocol,
59
- target=target,
60
70
  )
61
71
 
62
72
  port.additional_properties = d
@@ -0,0 +1,19 @@
1
+ from enum import Enum
2
+
3
+
4
+ class PortProtocol(str, Enum):
5
+ HTTP = "HTTP"
6
+ TCP = "TCP"
7
+ UDP = "UDP"
8
+
9
+ def __str__(self) -> str:
10
+ return str(self.value)
11
+
12
+ @classmethod
13
+ def _missing_(cls, value: object) -> "PortProtocol | None":
14
+ if isinstance(value, str):
15
+ upper_value = value.upper()
16
+ for member in cls:
17
+ if member.value.upper() == upper_value:
18
+ return member
19
+ return None
@@ -1,10 +1,8 @@
1
- from typing import TYPE_CHECKING, Any, TypeVar, Union
1
+ from typing import TYPE_CHECKING, Any, TypeVar
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
- from ..types import UNSET, Unset
7
-
8
6
  if TYPE_CHECKING:
9
7
  from ..models.preview_metadata import PreviewMetadata
10
8
  from ..models.preview_spec import PreviewSpec
@@ -18,38 +16,33 @@ class Preview:
18
16
  """Preview of a Resource
19
17
 
20
18
  Attributes:
21
- metadata (Union[Unset, PreviewMetadata]): PreviewMetadata
22
- spec (Union[Unset, PreviewSpec]): Preview of a Resource
19
+ metadata (PreviewMetadata): PreviewMetadata
20
+ spec (PreviewSpec): Preview of a Resource
23
21
  """
24
22
 
25
- metadata: Union[Unset, "PreviewMetadata"] = UNSET
26
- spec: Union[Unset, "PreviewSpec"] = UNSET
23
+ metadata: "PreviewMetadata"
24
+ spec: "PreviewSpec"
27
25
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
28
26
 
29
27
  def to_dict(self) -> dict[str, Any]:
30
- metadata: Union[Unset, dict[str, Any]] = UNSET
31
- if (
32
- self.metadata
33
- and not isinstance(self.metadata, Unset)
34
- and not isinstance(self.metadata, dict)
35
- ):
36
- metadata = self.metadata.to_dict()
37
- elif self.metadata and isinstance(self.metadata, dict):
28
+ if type(self.metadata) is dict:
38
29
  metadata = self.metadata
30
+ else:
31
+ metadata = self.metadata.to_dict()
39
32
 
40
- spec: Union[Unset, dict[str, Any]] = UNSET
41
- if self.spec and not isinstance(self.spec, Unset) and not isinstance(self.spec, dict):
42
- spec = self.spec.to_dict()
43
- elif self.spec and isinstance(self.spec, dict):
33
+ if type(self.spec) is dict:
44
34
  spec = self.spec
35
+ else:
36
+ spec = self.spec.to_dict()
45
37
 
46
38
  field_dict: dict[str, Any] = {}
47
39
  field_dict.update(self.additional_properties)
48
- field_dict.update({})
49
- if metadata is not UNSET:
50
- field_dict["metadata"] = metadata
51
- if spec is not UNSET:
52
- field_dict["spec"] = spec
40
+ field_dict.update(
41
+ {
42
+ "metadata": metadata,
43
+ "spec": spec,
44
+ }
45
+ )
53
46
 
54
47
  return field_dict
55
48
 
@@ -61,19 +54,9 @@ class Preview:
61
54
  if not src_dict:
62
55
  return None
63
56
  d = src_dict.copy()
64
- _metadata = d.pop("metadata", UNSET)
65
- metadata: Union[Unset, PreviewMetadata]
66
- if isinstance(_metadata, Unset):
67
- metadata = UNSET
68
- else:
69
- metadata = PreviewMetadata.from_dict(_metadata)
57
+ metadata = PreviewMetadata.from_dict(d.pop("metadata"))
70
58
 
71
- _spec = d.pop("spec", UNSET)
72
- spec: Union[Unset, PreviewSpec]
73
- if isinstance(_spec, Unset):
74
- spec = UNSET
75
- else:
76
- spec = PreviewSpec.from_dict(_spec)
59
+ spec = PreviewSpec.from_dict(d.pop("spec"))
77
60
 
78
61
  preview = cls(
79
62
  metadata=metadata,