blaxel 0.1.9rc35__py3-none-any.whl → 0.1.9rc36__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 (59) hide show
  1. blaxel/agents/__init__.py +1 -1
  2. blaxel/authentication/__init__.py +3 -4
  3. blaxel/client/api/compute/__init__.py +0 -0
  4. blaxel/client/api/compute/create_sandbox.py +166 -0
  5. blaxel/client/api/compute/delete_sandbox.py +154 -0
  6. blaxel/client/api/compute/get_sandbox.py +154 -0
  7. blaxel/client/api/compute/list_sandboxes.py +135 -0
  8. blaxel/client/api/compute/start_sandbox.py +157 -0
  9. blaxel/client/api/compute/stop_sandbox.py +157 -0
  10. blaxel/client/api/compute/update_sandbox.py +179 -0
  11. blaxel/client/api/default/list_sandbox_hub_definitions.py +123 -0
  12. blaxel/client/api/functions/list_function_revisions.py +16 -11
  13. blaxel/client/api/knowledgebases/list_knowledgebase_revisions.py +16 -11
  14. blaxel/client/api/models/list_model_revisions.py +16 -11
  15. blaxel/client/api/templates/list_templates.py +16 -11
  16. blaxel/client/models/__init__.py +32 -2
  17. blaxel/client/models/agent_spec.py +25 -69
  18. blaxel/client/models/core_spec.py +1 -45
  19. blaxel/client/models/function_spec.py +1 -45
  20. blaxel/client/models/last_n_requests_metric.py +18 -0
  21. blaxel/client/models/metrics.py +20 -0
  22. blaxel/client/models/model_spec.py +1 -45
  23. blaxel/client/models/{agent_chain.py → port.py} +23 -32
  24. blaxel/client/models/request_total_metric.py +12 -1
  25. blaxel/client/models/request_total_response_data.py +97 -0
  26. blaxel/client/models/resource_log.py +9 -0
  27. blaxel/client/models/resource_metrics.py +144 -0
  28. blaxel/client/models/resource_metrics_request_total_per_code_previous.py +45 -0
  29. blaxel/client/models/resource_metrics_rps_per_code_previous.py +45 -0
  30. blaxel/client/models/runtime.py +83 -7
  31. blaxel/client/models/runtime_configuration.py +45 -0
  32. blaxel/client/models/sandbox.py +129 -0
  33. blaxel/client/models/sandbox_definition.py +181 -0
  34. blaxel/client/models/sandbox_spec.py +208 -0
  35. blaxel/client/models/sandboxes.py +129 -0
  36. blaxel/client/models/serverless_config.py +29 -1
  37. blaxel/client/models/serverless_config_configuration.py +45 -0
  38. blaxel/client/models/start_sandbox.py +94 -0
  39. blaxel/client/models/stop_sandbox.py +94 -0
  40. blaxel/client/models/trigger.py +98 -0
  41. blaxel/client/models/trigger_configuration.py +45 -0
  42. blaxel/client/models/workspace.py +20 -0
  43. blaxel/client/models/workspace_runtime.py +61 -0
  44. blaxel/common/autoload.py +0 -1
  45. blaxel/instrumentation/exporters.py +3 -6
  46. blaxel/instrumentation/manager.py +5 -3
  47. blaxel/mcp/client.py +1 -3
  48. blaxel/mcp/server.py +2 -3
  49. blaxel/models/__init__.py +2 -1
  50. blaxel/models/custom/langchain/gemini.py +41 -18
  51. blaxel/models/custom/llamaindex/cohere.py +25 -16
  52. blaxel/models/custom/pydantic/gemini.py +0 -1
  53. blaxel/models/livekit.py +1 -1
  54. blaxel/tools/__init__.py +1 -1
  55. blaxel/tools/langchain.py +1 -2
  56. {blaxel-0.1.9rc35.dist-info → blaxel-0.1.9rc36.dist-info}/METADATA +1 -4
  57. {blaxel-0.1.9rc35.dist-info → blaxel-0.1.9rc36.dist-info}/RECORD +59 -36
  58. {blaxel-0.1.9rc35.dist-info → blaxel-0.1.9rc36.dist-info}/WHEEL +0 -0
  59. {blaxel-0.1.9rc35.dist-info → blaxel-0.1.9rc36.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,208 @@
1
+ from typing import TYPE_CHECKING, Any, 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.core_spec_configurations import CoreSpecConfigurations
10
+ from ..models.flavor import Flavor
11
+ from ..models.model_private_cluster import ModelPrivateCluster
12
+ from ..models.revision_configuration import RevisionConfiguration
13
+ from ..models.runtime import Runtime
14
+
15
+
16
+ T = TypeVar("T", bound="SandboxSpec")
17
+
18
+
19
+ @_attrs_define
20
+ class SandboxSpec:
21
+ """Sandbox specification
22
+
23
+ Attributes:
24
+ configurations (Union[Unset, CoreSpecConfigurations]): Optional configurations for the object
25
+ enabled (Union[Unset, bool]): Enable or disable the resource
26
+ flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
27
+ integration_connections (Union[Unset, list[str]]):
28
+ policies (Union[Unset, list[str]]):
29
+ private_clusters (Union[Unset, ModelPrivateCluster]): Private cluster where the model deployment is deployed
30
+ revision (Union[Unset, RevisionConfiguration]): Revision configuration
31
+ runtime (Union[Unset, Runtime]): Set of configurations for a deployment
32
+ sandbox (Union[Unset, bool]): Sandbox mode
33
+ """
34
+
35
+ configurations: Union[Unset, "CoreSpecConfigurations"] = UNSET
36
+ enabled: Union[Unset, bool] = UNSET
37
+ flavors: Union[Unset, list["Flavor"]] = UNSET
38
+ integration_connections: Union[Unset, list[str]] = UNSET
39
+ policies: Union[Unset, list[str]] = UNSET
40
+ private_clusters: Union[Unset, "ModelPrivateCluster"] = UNSET
41
+ revision: Union[Unset, "RevisionConfiguration"] = UNSET
42
+ runtime: Union[Unset, "Runtime"] = UNSET
43
+ sandbox: Union[Unset, bool] = UNSET
44
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
45
+
46
+ def to_dict(self) -> dict[str, Any]:
47
+ configurations: Union[Unset, dict[str, Any]] = UNSET
48
+ if (
49
+ self.configurations
50
+ and not isinstance(self.configurations, Unset)
51
+ and not isinstance(self.configurations, dict)
52
+ ):
53
+ configurations = self.configurations.to_dict()
54
+ elif self.configurations and isinstance(self.configurations, dict):
55
+ configurations = self.configurations
56
+
57
+ enabled = self.enabled
58
+
59
+ flavors: Union[Unset, list[dict[str, Any]]] = UNSET
60
+ if not isinstance(self.flavors, Unset):
61
+ flavors = []
62
+ for componentsschemas_flavors_item_data in self.flavors:
63
+ if type(componentsschemas_flavors_item_data) == dict:
64
+ componentsschemas_flavors_item = componentsschemas_flavors_item_data
65
+ else:
66
+ componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
67
+ flavors.append(componentsschemas_flavors_item)
68
+
69
+ integration_connections: Union[Unset, list[str]] = UNSET
70
+ if not isinstance(self.integration_connections, Unset):
71
+ integration_connections = self.integration_connections
72
+
73
+ policies: Union[Unset, list[str]] = UNSET
74
+ if not isinstance(self.policies, Unset):
75
+ policies = self.policies
76
+
77
+ private_clusters: Union[Unset, dict[str, Any]] = UNSET
78
+ if (
79
+ self.private_clusters
80
+ and not isinstance(self.private_clusters, Unset)
81
+ and not isinstance(self.private_clusters, dict)
82
+ ):
83
+ private_clusters = self.private_clusters.to_dict()
84
+ elif self.private_clusters and isinstance(self.private_clusters, dict):
85
+ private_clusters = self.private_clusters
86
+
87
+ revision: Union[Unset, dict[str, Any]] = UNSET
88
+ if self.revision and not isinstance(self.revision, Unset) and not isinstance(self.revision, dict):
89
+ revision = self.revision.to_dict()
90
+ elif self.revision and isinstance(self.revision, dict):
91
+ revision = self.revision
92
+
93
+ runtime: Union[Unset, dict[str, Any]] = UNSET
94
+ if self.runtime and not isinstance(self.runtime, Unset) and not isinstance(self.runtime, dict):
95
+ runtime = self.runtime.to_dict()
96
+ elif self.runtime and isinstance(self.runtime, dict):
97
+ runtime = self.runtime
98
+
99
+ sandbox = self.sandbox
100
+
101
+ field_dict: dict[str, Any] = {}
102
+ field_dict.update(self.additional_properties)
103
+ field_dict.update({})
104
+ if configurations is not UNSET:
105
+ field_dict["configurations"] = configurations
106
+ if enabled is not UNSET:
107
+ field_dict["enabled"] = enabled
108
+ if flavors is not UNSET:
109
+ field_dict["flavors"] = flavors
110
+ if integration_connections is not UNSET:
111
+ field_dict["integrationConnections"] = integration_connections
112
+ if policies is not UNSET:
113
+ field_dict["policies"] = policies
114
+ if private_clusters is not UNSET:
115
+ field_dict["privateClusters"] = private_clusters
116
+ if revision is not UNSET:
117
+ field_dict["revision"] = revision
118
+ if runtime is not UNSET:
119
+ field_dict["runtime"] = runtime
120
+ if sandbox is not UNSET:
121
+ field_dict["sandbox"] = sandbox
122
+
123
+ return field_dict
124
+
125
+ @classmethod
126
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
127
+ from ..models.core_spec_configurations import CoreSpecConfigurations
128
+ from ..models.flavor import Flavor
129
+ from ..models.model_private_cluster import ModelPrivateCluster
130
+ from ..models.revision_configuration import RevisionConfiguration
131
+ from ..models.runtime import Runtime
132
+
133
+ if not src_dict:
134
+ return None
135
+ d = src_dict.copy()
136
+ _configurations = d.pop("configurations", UNSET)
137
+ configurations: Union[Unset, CoreSpecConfigurations]
138
+ if isinstance(_configurations, Unset):
139
+ configurations = UNSET
140
+ else:
141
+ configurations = CoreSpecConfigurations.from_dict(_configurations)
142
+
143
+ enabled = d.pop("enabled", 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
+ integration_connections = cast(list[str], d.pop("integrationConnections", UNSET))
153
+
154
+ policies = cast(list[str], d.pop("policies", UNSET))
155
+
156
+ _private_clusters = d.pop("privateClusters", UNSET)
157
+ private_clusters: Union[Unset, ModelPrivateCluster]
158
+ if isinstance(_private_clusters, Unset):
159
+ private_clusters = UNSET
160
+ else:
161
+ private_clusters = ModelPrivateCluster.from_dict(_private_clusters)
162
+
163
+ _revision = d.pop("revision", UNSET)
164
+ revision: Union[Unset, RevisionConfiguration]
165
+ if isinstance(_revision, Unset):
166
+ revision = UNSET
167
+ else:
168
+ revision = RevisionConfiguration.from_dict(_revision)
169
+
170
+ _runtime = d.pop("runtime", UNSET)
171
+ runtime: Union[Unset, Runtime]
172
+ if isinstance(_runtime, Unset):
173
+ runtime = UNSET
174
+ else:
175
+ runtime = Runtime.from_dict(_runtime)
176
+
177
+ sandbox = d.pop("sandbox", UNSET)
178
+
179
+ sandbox_spec = cls(
180
+ configurations=configurations,
181
+ enabled=enabled,
182
+ flavors=flavors,
183
+ integration_connections=integration_connections,
184
+ policies=policies,
185
+ private_clusters=private_clusters,
186
+ revision=revision,
187
+ runtime=runtime,
188
+ sandbox=sandbox,
189
+ )
190
+
191
+ sandbox_spec.additional_properties = d
192
+ return sandbox_spec
193
+
194
+ @property
195
+ def additional_keys(self) -> list[str]:
196
+ return list(self.additional_properties.keys())
197
+
198
+ def __getitem__(self, key: str) -> Any:
199
+ return self.additional_properties[key]
200
+
201
+ def __setitem__(self, key: str, value: Any) -> None:
202
+ self.additional_properties[key] = value
203
+
204
+ def __delitem__(self, key: str) -> None:
205
+ del self.additional_properties[key]
206
+
207
+ def __contains__(self, key: str) -> bool:
208
+ return key in self.additional_properties
@@ -0,0 +1,129 @@
1
+ from typing import TYPE_CHECKING, 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
+ if TYPE_CHECKING:
9
+ from ..models.core_event import CoreEvent
10
+ from ..models.metadata import Metadata
11
+ from ..models.sandbox_spec import SandboxSpec
12
+
13
+
14
+ T = TypeVar("T", bound="Sandboxes")
15
+
16
+
17
+ @_attrs_define
18
+ class Sandboxes:
19
+ """Micro VM for running agentic tasks
20
+
21
+ Attributes:
22
+ events (Union[Unset, list['CoreEvent']]): Core events
23
+ metadata (Union[Unset, Metadata]): Metadata
24
+ spec (Union[Unset, SandboxSpec]): Sandbox specification
25
+ status (Union[Unset, str]): Sandbox status
26
+ """
27
+
28
+ events: Union[Unset, list["CoreEvent"]] = UNSET
29
+ metadata: Union[Unset, "Metadata"] = UNSET
30
+ spec: Union[Unset, "SandboxSpec"] = UNSET
31
+ status: Union[Unset, str] = UNSET
32
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
33
+
34
+ def to_dict(self) -> dict[str, Any]:
35
+ events: Union[Unset, list[dict[str, Any]]] = UNSET
36
+ if not isinstance(self.events, Unset):
37
+ events = []
38
+ for componentsschemas_core_events_item_data in self.events:
39
+ if type(componentsschemas_core_events_item_data) == dict:
40
+ componentsschemas_core_events_item = componentsschemas_core_events_item_data
41
+ else:
42
+ componentsschemas_core_events_item = componentsschemas_core_events_item_data.to_dict()
43
+ events.append(componentsschemas_core_events_item)
44
+
45
+ metadata: Union[Unset, dict[str, Any]] = UNSET
46
+ if self.metadata and not isinstance(self.metadata, Unset) and not isinstance(self.metadata, dict):
47
+ metadata = self.metadata.to_dict()
48
+ elif self.metadata and isinstance(self.metadata, dict):
49
+ metadata = self.metadata
50
+
51
+ spec: Union[Unset, dict[str, Any]] = UNSET
52
+ if self.spec and not isinstance(self.spec, Unset) and not isinstance(self.spec, dict):
53
+ spec = self.spec.to_dict()
54
+ elif self.spec and isinstance(self.spec, dict):
55
+ spec = self.spec
56
+
57
+ status = self.status
58
+
59
+ field_dict: dict[str, Any] = {}
60
+ field_dict.update(self.additional_properties)
61
+ field_dict.update({})
62
+ if events is not UNSET:
63
+ field_dict["events"] = events
64
+ if metadata is not UNSET:
65
+ field_dict["metadata"] = metadata
66
+ if spec is not UNSET:
67
+ field_dict["spec"] = spec
68
+ if status is not UNSET:
69
+ field_dict["status"] = status
70
+
71
+ return field_dict
72
+
73
+ @classmethod
74
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
75
+ from ..models.core_event import CoreEvent
76
+ from ..models.metadata import Metadata
77
+ from ..models.sandbox_spec import SandboxSpec
78
+
79
+ if not src_dict:
80
+ return None
81
+ d = src_dict.copy()
82
+ events = []
83
+ _events = d.pop("events", UNSET)
84
+ for componentsschemas_core_events_item_data in _events or []:
85
+ componentsschemas_core_events_item = CoreEvent.from_dict(componentsschemas_core_events_item_data)
86
+
87
+ events.append(componentsschemas_core_events_item)
88
+
89
+ _metadata = d.pop("metadata", UNSET)
90
+ metadata: Union[Unset, Metadata]
91
+ if isinstance(_metadata, Unset):
92
+ metadata = UNSET
93
+ else:
94
+ metadata = Metadata.from_dict(_metadata)
95
+
96
+ _spec = d.pop("spec", UNSET)
97
+ spec: Union[Unset, SandboxSpec]
98
+ if isinstance(_spec, Unset):
99
+ spec = UNSET
100
+ else:
101
+ spec = SandboxSpec.from_dict(_spec)
102
+
103
+ status = d.pop("status", UNSET)
104
+
105
+ sandboxes = cls(
106
+ events=events,
107
+ metadata=metadata,
108
+ spec=spec,
109
+ status=status,
110
+ )
111
+
112
+ sandboxes.additional_properties = d
113
+ return sandboxes
114
+
115
+ @property
116
+ def additional_keys(self) -> list[str]:
117
+ return list(self.additional_properties.keys())
118
+
119
+ def __getitem__(self, key: str) -> Any:
120
+ return self.additional_properties[key]
121
+
122
+ def __setitem__(self, key: str, value: Any) -> None:
123
+ self.additional_properties[key] = value
124
+
125
+ def __delitem__(self, key: str) -> None:
126
+ del self.additional_properties[key]
127
+
128
+ def __contains__(self, key: str) -> bool:
129
+ return key in self.additional_properties
@@ -1,10 +1,14 @@
1
- from typing import Any, TypeVar, Union
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.serverless_config_configuration import ServerlessConfigConfiguration
10
+
11
+
8
12
  T = TypeVar("T", bound="ServerlessConfig")
9
13
 
10
14
 
@@ -13,18 +17,30 @@ class ServerlessConfig:
13
17
  """Configuration for a serverless deployment
14
18
 
15
19
  Attributes:
20
+ configuration (Union[Unset, ServerlessConfigConfiguration]): The configuration for the deployment
16
21
  max_scale (Union[Unset, int]): The minimum number of replicas for the deployment. Can be 0 or 1 (in which case
17
22
  the deployment is always running in at least one location).
18
23
  min_scale (Union[Unset, int]): The maximum number of replicas for the deployment.
19
24
  timeout (Union[Unset, int]): The timeout for the deployment in seconds
20
25
  """
21
26
 
27
+ configuration: Union[Unset, "ServerlessConfigConfiguration"] = UNSET
22
28
  max_scale: Union[Unset, int] = UNSET
23
29
  min_scale: Union[Unset, int] = UNSET
24
30
  timeout: Union[Unset, int] = UNSET
25
31
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
26
32
 
27
33
  def to_dict(self) -> dict[str, Any]:
34
+ configuration: Union[Unset, dict[str, Any]] = UNSET
35
+ if (
36
+ self.configuration
37
+ and not isinstance(self.configuration, Unset)
38
+ and not isinstance(self.configuration, dict)
39
+ ):
40
+ configuration = self.configuration.to_dict()
41
+ elif self.configuration and isinstance(self.configuration, dict):
42
+ configuration = self.configuration
43
+
28
44
  max_scale = self.max_scale
29
45
 
30
46
  min_scale = self.min_scale
@@ -34,6 +50,8 @@ class ServerlessConfig:
34
50
  field_dict: dict[str, Any] = {}
35
51
  field_dict.update(self.additional_properties)
36
52
  field_dict.update({})
53
+ if configuration is not UNSET:
54
+ field_dict["configuration"] = configuration
37
55
  if max_scale is not UNSET:
38
56
  field_dict["maxScale"] = max_scale
39
57
  if min_scale is not UNSET:
@@ -45,9 +63,18 @@ class ServerlessConfig:
45
63
 
46
64
  @classmethod
47
65
  def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
66
+ from ..models.serverless_config_configuration import ServerlessConfigConfiguration
67
+
48
68
  if not src_dict:
49
69
  return None
50
70
  d = src_dict.copy()
71
+ _configuration = d.pop("configuration", UNSET)
72
+ configuration: Union[Unset, ServerlessConfigConfiguration]
73
+ if isinstance(_configuration, Unset):
74
+ configuration = UNSET
75
+ else:
76
+ configuration = ServerlessConfigConfiguration.from_dict(_configuration)
77
+
51
78
  max_scale = d.pop("maxScale", UNSET)
52
79
 
53
80
  min_scale = d.pop("minScale", UNSET)
@@ -55,6 +82,7 @@ class ServerlessConfig:
55
82
  timeout = d.pop("timeout", UNSET)
56
83
 
57
84
  serverless_config = cls(
85
+ configuration=configuration,
58
86
  max_scale=max_scale,
59
87
  min_scale=min_scale,
60
88
  timeout=timeout,
@@ -0,0 +1,45 @@
1
+ from typing import Any, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ T = TypeVar("T", bound="ServerlessConfigConfiguration")
7
+
8
+
9
+ @_attrs_define
10
+ class ServerlessConfigConfiguration:
11
+ """The configuration for the deployment"""
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
+ if not src_dict:
24
+ return None
25
+ d = src_dict.copy()
26
+ serverless_config_configuration = cls()
27
+
28
+ serverless_config_configuration.additional_properties = d
29
+ return serverless_config_configuration
30
+
31
+ @property
32
+ def additional_keys(self) -> list[str]:
33
+ return list(self.additional_properties.keys())
34
+
35
+ def __getitem__(self, key: str) -> Any:
36
+ return self.additional_properties[key]
37
+
38
+ def __setitem__(self, key: str, value: Any) -> None:
39
+ self.additional_properties[key] = value
40
+
41
+ def __delitem__(self, key: str) -> None:
42
+ del self.additional_properties[key]
43
+
44
+ def __contains__(self, key: str) -> bool:
45
+ return key in self.additional_properties
@@ -0,0 +1,94 @@
1
+ from typing import TYPE_CHECKING, 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
+ if TYPE_CHECKING:
9
+ from ..models.metadata import Metadata
10
+
11
+
12
+ T = TypeVar("T", bound="StartSandbox")
13
+
14
+
15
+ @_attrs_define
16
+ class StartSandbox:
17
+ """Response when starting a Sandbox
18
+
19
+ Attributes:
20
+ message (Union[Unset, str]): Human readable message about the start operation
21
+ metadata (Union[Unset, Metadata]): Metadata
22
+ status (Union[Unset, str]): Status of the Sandbox start operation
23
+ """
24
+
25
+ message: Union[Unset, str] = UNSET
26
+ metadata: Union[Unset, "Metadata"] = UNSET
27
+ status: Union[Unset, str] = UNSET
28
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
29
+
30
+ def to_dict(self) -> dict[str, Any]:
31
+ message = self.message
32
+
33
+ metadata: Union[Unset, dict[str, Any]] = UNSET
34
+ if self.metadata and not isinstance(self.metadata, Unset) and not isinstance(self.metadata, dict):
35
+ metadata = self.metadata.to_dict()
36
+ elif self.metadata and isinstance(self.metadata, dict):
37
+ metadata = self.metadata
38
+
39
+ status = self.status
40
+
41
+ field_dict: dict[str, Any] = {}
42
+ field_dict.update(self.additional_properties)
43
+ field_dict.update({})
44
+ if message is not UNSET:
45
+ field_dict["message"] = message
46
+ if metadata is not UNSET:
47
+ field_dict["metadata"] = metadata
48
+ if status is not UNSET:
49
+ field_dict["status"] = status
50
+
51
+ return field_dict
52
+
53
+ @classmethod
54
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
55
+ from ..models.metadata import Metadata
56
+
57
+ if not src_dict:
58
+ return None
59
+ d = src_dict.copy()
60
+ message = d.pop("message", UNSET)
61
+
62
+ _metadata = d.pop("metadata", UNSET)
63
+ metadata: Union[Unset, Metadata]
64
+ if isinstance(_metadata, Unset):
65
+ metadata = UNSET
66
+ else:
67
+ metadata = Metadata.from_dict(_metadata)
68
+
69
+ status = d.pop("status", UNSET)
70
+
71
+ start_sandbox = cls(
72
+ message=message,
73
+ metadata=metadata,
74
+ status=status,
75
+ )
76
+
77
+ start_sandbox.additional_properties = d
78
+ return start_sandbox
79
+
80
+ @property
81
+ def additional_keys(self) -> list[str]:
82
+ return list(self.additional_properties.keys())
83
+
84
+ def __getitem__(self, key: str) -> Any:
85
+ return self.additional_properties[key]
86
+
87
+ def __setitem__(self, key: str, value: Any) -> None:
88
+ self.additional_properties[key] = value
89
+
90
+ def __delitem__(self, key: str) -> None:
91
+ del self.additional_properties[key]
92
+
93
+ def __contains__(self, key: str) -> bool:
94
+ return key in self.additional_properties
@@ -0,0 +1,94 @@
1
+ from typing import TYPE_CHECKING, 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
+ if TYPE_CHECKING:
9
+ from ..models.metadata import Metadata
10
+
11
+
12
+ T = TypeVar("T", bound="StopSandbox")
13
+
14
+
15
+ @_attrs_define
16
+ class StopSandbox:
17
+ """Response when stopping a Sandbox
18
+
19
+ Attributes:
20
+ message (Union[Unset, str]): Human readable message about the stop operation
21
+ metadata (Union[Unset, Metadata]): Metadata
22
+ status (Union[Unset, str]): Status of the Sandbox stop operation
23
+ """
24
+
25
+ message: Union[Unset, str] = UNSET
26
+ metadata: Union[Unset, "Metadata"] = UNSET
27
+ status: Union[Unset, str] = UNSET
28
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
29
+
30
+ def to_dict(self) -> dict[str, Any]:
31
+ message = self.message
32
+
33
+ metadata: Union[Unset, dict[str, Any]] = UNSET
34
+ if self.metadata and not isinstance(self.metadata, Unset) and not isinstance(self.metadata, dict):
35
+ metadata = self.metadata.to_dict()
36
+ elif self.metadata and isinstance(self.metadata, dict):
37
+ metadata = self.metadata
38
+
39
+ status = self.status
40
+
41
+ field_dict: dict[str, Any] = {}
42
+ field_dict.update(self.additional_properties)
43
+ field_dict.update({})
44
+ if message is not UNSET:
45
+ field_dict["message"] = message
46
+ if metadata is not UNSET:
47
+ field_dict["metadata"] = metadata
48
+ if status is not UNSET:
49
+ field_dict["status"] = status
50
+
51
+ return field_dict
52
+
53
+ @classmethod
54
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
55
+ from ..models.metadata import Metadata
56
+
57
+ if not src_dict:
58
+ return None
59
+ d = src_dict.copy()
60
+ message = d.pop("message", UNSET)
61
+
62
+ _metadata = d.pop("metadata", UNSET)
63
+ metadata: Union[Unset, Metadata]
64
+ if isinstance(_metadata, Unset):
65
+ metadata = UNSET
66
+ else:
67
+ metadata = Metadata.from_dict(_metadata)
68
+
69
+ status = d.pop("status", UNSET)
70
+
71
+ stop_sandbox = cls(
72
+ message=message,
73
+ metadata=metadata,
74
+ status=status,
75
+ )
76
+
77
+ stop_sandbox.additional_properties = d
78
+ return stop_sandbox
79
+
80
+ @property
81
+ def additional_keys(self) -> list[str]:
82
+ return list(self.additional_properties.keys())
83
+
84
+ def __getitem__(self, key: str) -> Any:
85
+ return self.additional_properties[key]
86
+
87
+ def __setitem__(self, key: str, value: Any) -> None:
88
+ self.additional_properties[key] = value
89
+
90
+ def __delitem__(self, key: str) -> None:
91
+ del self.additional_properties[key]
92
+
93
+ def __contains__(self, key: str) -> bool:
94
+ return key in self.additional_properties