moru 0.1.0__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.
- moru/__init__.py +174 -0
- moru/api/__init__.py +164 -0
- moru/api/client/__init__.py +8 -0
- moru/api/client/api/__init__.py +1 -0
- moru/api/client/api/sandboxes/__init__.py +1 -0
- moru/api/client/api/sandboxes/delete_sandboxes_sandbox_id.py +161 -0
- moru/api/client/api/sandboxes/get_sandboxes.py +176 -0
- moru/api/client/api/sandboxes/get_sandboxes_metrics.py +173 -0
- moru/api/client/api/sandboxes/get_sandboxes_sandbox_id.py +163 -0
- moru/api/client/api/sandboxes/get_sandboxes_sandbox_id_logs.py +199 -0
- moru/api/client/api/sandboxes/get_sandboxes_sandbox_id_metrics.py +212 -0
- moru/api/client/api/sandboxes/get_v2_sandboxes.py +230 -0
- moru/api/client/api/sandboxes/post_sandboxes.py +172 -0
- moru/api/client/api/sandboxes/post_sandboxes_sandbox_id_connect.py +193 -0
- moru/api/client/api/sandboxes/post_sandboxes_sandbox_id_pause.py +165 -0
- moru/api/client/api/sandboxes/post_sandboxes_sandbox_id_refreshes.py +181 -0
- moru/api/client/api/sandboxes/post_sandboxes_sandbox_id_resume.py +189 -0
- moru/api/client/api/sandboxes/post_sandboxes_sandbox_id_timeout.py +193 -0
- moru/api/client/api/templates/__init__.py +1 -0
- moru/api/client/api/templates/delete_templates_template_id.py +157 -0
- moru/api/client/api/templates/get_templates.py +172 -0
- moru/api/client/api/templates/get_templates_template_id.py +195 -0
- moru/api/client/api/templates/get_templates_template_id_builds_build_id_status.py +217 -0
- moru/api/client/api/templates/get_templates_template_id_files_hash.py +180 -0
- moru/api/client/api/templates/patch_templates_template_id.py +183 -0
- moru/api/client/api/templates/post_templates.py +172 -0
- moru/api/client/api/templates/post_templates_template_id.py +181 -0
- moru/api/client/api/templates/post_templates_template_id_builds_build_id.py +170 -0
- moru/api/client/api/templates/post_v2_templates.py +172 -0
- moru/api/client/api/templates/post_v3_templates.py +172 -0
- moru/api/client/api/templates/post_v_2_templates_template_id_builds_build_id.py +192 -0
- moru/api/client/client.py +286 -0
- moru/api/client/errors.py +16 -0
- moru/api/client/models/__init__.py +123 -0
- moru/api/client/models/aws_registry.py +85 -0
- moru/api/client/models/aws_registry_type.py +8 -0
- moru/api/client/models/build_log_entry.py +89 -0
- moru/api/client/models/build_status_reason.py +95 -0
- moru/api/client/models/connect_sandbox.py +59 -0
- moru/api/client/models/created_access_token.py +100 -0
- moru/api/client/models/created_team_api_key.py +166 -0
- moru/api/client/models/disk_metrics.py +91 -0
- moru/api/client/models/error.py +67 -0
- moru/api/client/models/gcp_registry.py +69 -0
- moru/api/client/models/gcp_registry_type.py +8 -0
- moru/api/client/models/general_registry.py +77 -0
- moru/api/client/models/general_registry_type.py +8 -0
- moru/api/client/models/identifier_masking_details.py +83 -0
- moru/api/client/models/listed_sandbox.py +154 -0
- moru/api/client/models/log_level.py +11 -0
- moru/api/client/models/max_team_metric.py +78 -0
- moru/api/client/models/mcp_type_0.py +44 -0
- moru/api/client/models/new_access_token.py +59 -0
- moru/api/client/models/new_sandbox.py +172 -0
- moru/api/client/models/new_team_api_key.py +59 -0
- moru/api/client/models/node.py +155 -0
- moru/api/client/models/node_detail.py +165 -0
- moru/api/client/models/node_metrics.py +122 -0
- moru/api/client/models/node_status.py +11 -0
- moru/api/client/models/node_status_change.py +79 -0
- moru/api/client/models/post_sandboxes_sandbox_id_refreshes_body.py +59 -0
- moru/api/client/models/post_sandboxes_sandbox_id_timeout_body.py +59 -0
- moru/api/client/models/resumed_sandbox.py +68 -0
- moru/api/client/models/sandbox.py +145 -0
- moru/api/client/models/sandbox_detail.py +183 -0
- moru/api/client/models/sandbox_log.py +70 -0
- moru/api/client/models/sandbox_log_entry.py +93 -0
- moru/api/client/models/sandbox_log_entry_fields.py +44 -0
- moru/api/client/models/sandbox_logs.py +91 -0
- moru/api/client/models/sandbox_metric.py +118 -0
- moru/api/client/models/sandbox_network_config.py +92 -0
- moru/api/client/models/sandbox_state.py +9 -0
- moru/api/client/models/sandboxes_with_metrics.py +59 -0
- moru/api/client/models/team.py +83 -0
- moru/api/client/models/team_api_key.py +158 -0
- moru/api/client/models/team_metric.py +86 -0
- moru/api/client/models/team_user.py +68 -0
- moru/api/client/models/template.py +217 -0
- moru/api/client/models/template_build.py +139 -0
- moru/api/client/models/template_build_file_upload.py +70 -0
- moru/api/client/models/template_build_info.py +126 -0
- moru/api/client/models/template_build_request.py +115 -0
- moru/api/client/models/template_build_request_v2.py +88 -0
- moru/api/client/models/template_build_request_v3.py +88 -0
- moru/api/client/models/template_build_start_v2.py +184 -0
- moru/api/client/models/template_build_status.py +11 -0
- moru/api/client/models/template_legacy.py +207 -0
- moru/api/client/models/template_request_response_v3.py +83 -0
- moru/api/client/models/template_step.py +91 -0
- moru/api/client/models/template_update_request.py +59 -0
- moru/api/client/models/template_with_builds.py +148 -0
- moru/api/client/models/update_team_api_key.py +59 -0
- moru/api/client/py.typed +1 -0
- moru/api/client/types.py +54 -0
- moru/api/client_async/__init__.py +50 -0
- moru/api/client_sync/__init__.py +52 -0
- moru/api/metadata.py +14 -0
- moru/connection_config.py +217 -0
- moru/envd/api.py +59 -0
- moru/envd/filesystem/filesystem_connect.py +193 -0
- moru/envd/filesystem/filesystem_pb2.py +76 -0
- moru/envd/filesystem/filesystem_pb2.pyi +233 -0
- moru/envd/process/process_connect.py +155 -0
- moru/envd/process/process_pb2.py +92 -0
- moru/envd/process/process_pb2.pyi +304 -0
- moru/envd/rpc.py +61 -0
- moru/envd/versions.py +6 -0
- moru/exceptions.py +95 -0
- moru/sandbox/commands/command_handle.py +69 -0
- moru/sandbox/commands/main.py +39 -0
- moru/sandbox/filesystem/filesystem.py +94 -0
- moru/sandbox/filesystem/watch_handle.py +60 -0
- moru/sandbox/main.py +210 -0
- moru/sandbox/mcp.py +1120 -0
- moru/sandbox/network.py +8 -0
- moru/sandbox/sandbox_api.py +210 -0
- moru/sandbox/signature.py +45 -0
- moru/sandbox/utils.py +34 -0
- moru/sandbox_async/commands/command.py +336 -0
- moru/sandbox_async/commands/command_handle.py +196 -0
- moru/sandbox_async/commands/pty.py +240 -0
- moru/sandbox_async/filesystem/filesystem.py +531 -0
- moru/sandbox_async/filesystem/watch_handle.py +62 -0
- moru/sandbox_async/main.py +734 -0
- moru/sandbox_async/paginator.py +69 -0
- moru/sandbox_async/sandbox_api.py +325 -0
- moru/sandbox_async/utils.py +7 -0
- moru/sandbox_sync/commands/command.py +328 -0
- moru/sandbox_sync/commands/command_handle.py +150 -0
- moru/sandbox_sync/commands/pty.py +230 -0
- moru/sandbox_sync/filesystem/filesystem.py +518 -0
- moru/sandbox_sync/filesystem/watch_handle.py +69 -0
- moru/sandbox_sync/main.py +726 -0
- moru/sandbox_sync/paginator.py +69 -0
- moru/sandbox_sync/sandbox_api.py +308 -0
- moru/template/consts.py +30 -0
- moru/template/dockerfile_parser.py +275 -0
- moru/template/logger.py +232 -0
- moru/template/main.py +1360 -0
- moru/template/readycmd.py +138 -0
- moru/template/types.py +105 -0
- moru/template/utils.py +320 -0
- moru/template_async/build_api.py +202 -0
- moru/template_async/main.py +366 -0
- moru/template_sync/build_api.py +199 -0
- moru/template_sync/main.py +371 -0
- moru-0.1.0.dist-info/METADATA +63 -0
- moru-0.1.0.dist-info/RECORD +152 -0
- moru-0.1.0.dist-info/WHEEL +4 -0
- moru-0.1.0.dist-info/licenses/LICENSE +9 -0
- moru_connect/__init__.py +1 -0
- moru_connect/client.py +493 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
from ..models.general_registry_type import GeneralRegistryType
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="GeneralRegistry")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class GeneralRegistry:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
password (str): Password to use for the registry
|
|
17
|
+
type_ (GeneralRegistryType): Type of registry authentication
|
|
18
|
+
username (str): Username to use for the registry
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
password: str
|
|
22
|
+
type_: GeneralRegistryType
|
|
23
|
+
username: str
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
password = self.password
|
|
28
|
+
|
|
29
|
+
type_ = self.type_.value
|
|
30
|
+
|
|
31
|
+
username = self.username
|
|
32
|
+
|
|
33
|
+
field_dict: dict[str, Any] = {}
|
|
34
|
+
field_dict.update(self.additional_properties)
|
|
35
|
+
field_dict.update(
|
|
36
|
+
{
|
|
37
|
+
"password": password,
|
|
38
|
+
"type": type_,
|
|
39
|
+
"username": username,
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
return field_dict
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
47
|
+
d = dict(src_dict)
|
|
48
|
+
password = d.pop("password")
|
|
49
|
+
|
|
50
|
+
type_ = GeneralRegistryType(d.pop("type"))
|
|
51
|
+
|
|
52
|
+
username = d.pop("username")
|
|
53
|
+
|
|
54
|
+
general_registry = cls(
|
|
55
|
+
password=password,
|
|
56
|
+
type_=type_,
|
|
57
|
+
username=username,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
general_registry.additional_properties = d
|
|
61
|
+
return general_registry
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def additional_keys(self) -> list[str]:
|
|
65
|
+
return list(self.additional_properties.keys())
|
|
66
|
+
|
|
67
|
+
def __getitem__(self, key: str) -> Any:
|
|
68
|
+
return self.additional_properties[key]
|
|
69
|
+
|
|
70
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
71
|
+
self.additional_properties[key] = value
|
|
72
|
+
|
|
73
|
+
def __delitem__(self, key: str) -> None:
|
|
74
|
+
del self.additional_properties[key]
|
|
75
|
+
|
|
76
|
+
def __contains__(self, key: str) -> bool:
|
|
77
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
T = TypeVar("T", bound="IdentifierMaskingDetails")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class IdentifierMaskingDetails:
|
|
12
|
+
"""
|
|
13
|
+
Attributes:
|
|
14
|
+
masked_value_prefix (str): Prefix used in masked version of the token or key
|
|
15
|
+
masked_value_suffix (str): Suffix used in masked version of the token or key
|
|
16
|
+
prefix (str): Prefix that identifies the token or key type
|
|
17
|
+
value_length (int): Length of the token or key
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
masked_value_prefix: str
|
|
21
|
+
masked_value_suffix: str
|
|
22
|
+
prefix: str
|
|
23
|
+
value_length: int
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
masked_value_prefix = self.masked_value_prefix
|
|
28
|
+
|
|
29
|
+
masked_value_suffix = self.masked_value_suffix
|
|
30
|
+
|
|
31
|
+
prefix = self.prefix
|
|
32
|
+
|
|
33
|
+
value_length = self.value_length
|
|
34
|
+
|
|
35
|
+
field_dict: dict[str, Any] = {}
|
|
36
|
+
field_dict.update(self.additional_properties)
|
|
37
|
+
field_dict.update(
|
|
38
|
+
{
|
|
39
|
+
"maskedValuePrefix": masked_value_prefix,
|
|
40
|
+
"maskedValueSuffix": masked_value_suffix,
|
|
41
|
+
"prefix": prefix,
|
|
42
|
+
"valueLength": value_length,
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
return field_dict
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
50
|
+
d = dict(src_dict)
|
|
51
|
+
masked_value_prefix = d.pop("maskedValuePrefix")
|
|
52
|
+
|
|
53
|
+
masked_value_suffix = d.pop("maskedValueSuffix")
|
|
54
|
+
|
|
55
|
+
prefix = d.pop("prefix")
|
|
56
|
+
|
|
57
|
+
value_length = d.pop("valueLength")
|
|
58
|
+
|
|
59
|
+
identifier_masking_details = cls(
|
|
60
|
+
masked_value_prefix=masked_value_prefix,
|
|
61
|
+
masked_value_suffix=masked_value_suffix,
|
|
62
|
+
prefix=prefix,
|
|
63
|
+
value_length=value_length,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
identifier_masking_details.additional_properties = d
|
|
67
|
+
return identifier_masking_details
|
|
68
|
+
|
|
69
|
+
@property
|
|
70
|
+
def additional_keys(self) -> list[str]:
|
|
71
|
+
return list(self.additional_properties.keys())
|
|
72
|
+
|
|
73
|
+
def __getitem__(self, key: str) -> Any:
|
|
74
|
+
return self.additional_properties[key]
|
|
75
|
+
|
|
76
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
77
|
+
self.additional_properties[key] = value
|
|
78
|
+
|
|
79
|
+
def __delitem__(self, key: str) -> None:
|
|
80
|
+
del self.additional_properties[key]
|
|
81
|
+
|
|
82
|
+
def __contains__(self, key: str) -> bool:
|
|
83
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import Any, TypeVar, Union
|
|
4
|
+
|
|
5
|
+
from attrs import define as _attrs_define
|
|
6
|
+
from attrs import field as _attrs_field
|
|
7
|
+
from dateutil.parser import isoparse
|
|
8
|
+
|
|
9
|
+
from ..models.sandbox_state import SandboxState
|
|
10
|
+
from ..types import UNSET, Unset
|
|
11
|
+
|
|
12
|
+
T = TypeVar("T", bound="ListedSandbox")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@_attrs_define
|
|
16
|
+
class ListedSandbox:
|
|
17
|
+
"""
|
|
18
|
+
Attributes:
|
|
19
|
+
client_id (str): Identifier of the client
|
|
20
|
+
cpu_count (int): CPU cores for the sandbox
|
|
21
|
+
disk_size_mb (int): Disk size for the sandbox in MiB
|
|
22
|
+
end_at (datetime.datetime): Time when the sandbox will expire
|
|
23
|
+
envd_version (str): Version of the envd running in the sandbox
|
|
24
|
+
memory_mb (int): Memory for the sandbox in MiB
|
|
25
|
+
sandbox_id (str): Identifier of the sandbox
|
|
26
|
+
started_at (datetime.datetime): Time when the sandbox was started
|
|
27
|
+
state (SandboxState): State of the sandbox
|
|
28
|
+
template_id (str): Identifier of the template from which is the sandbox created
|
|
29
|
+
alias (Union[Unset, str]): Alias of the template
|
|
30
|
+
metadata (Union[Unset, Any]):
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
client_id: str
|
|
34
|
+
cpu_count: int
|
|
35
|
+
disk_size_mb: int
|
|
36
|
+
end_at: datetime.datetime
|
|
37
|
+
envd_version: str
|
|
38
|
+
memory_mb: int
|
|
39
|
+
sandbox_id: str
|
|
40
|
+
started_at: datetime.datetime
|
|
41
|
+
state: SandboxState
|
|
42
|
+
template_id: str
|
|
43
|
+
alias: Union[Unset, str] = UNSET
|
|
44
|
+
metadata: Union[Unset, Any] = UNSET
|
|
45
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
46
|
+
|
|
47
|
+
def to_dict(self) -> dict[str, Any]:
|
|
48
|
+
client_id = self.client_id
|
|
49
|
+
|
|
50
|
+
cpu_count = self.cpu_count
|
|
51
|
+
|
|
52
|
+
disk_size_mb = self.disk_size_mb
|
|
53
|
+
|
|
54
|
+
end_at = self.end_at.isoformat()
|
|
55
|
+
|
|
56
|
+
envd_version = self.envd_version
|
|
57
|
+
|
|
58
|
+
memory_mb = self.memory_mb
|
|
59
|
+
|
|
60
|
+
sandbox_id = self.sandbox_id
|
|
61
|
+
|
|
62
|
+
started_at = self.started_at.isoformat()
|
|
63
|
+
|
|
64
|
+
state = self.state.value
|
|
65
|
+
|
|
66
|
+
template_id = self.template_id
|
|
67
|
+
|
|
68
|
+
alias = self.alias
|
|
69
|
+
|
|
70
|
+
metadata = self.metadata
|
|
71
|
+
|
|
72
|
+
field_dict: dict[str, Any] = {}
|
|
73
|
+
field_dict.update(self.additional_properties)
|
|
74
|
+
field_dict.update(
|
|
75
|
+
{
|
|
76
|
+
"clientID": client_id,
|
|
77
|
+
"cpuCount": cpu_count,
|
|
78
|
+
"diskSizeMB": disk_size_mb,
|
|
79
|
+
"endAt": end_at,
|
|
80
|
+
"envdVersion": envd_version,
|
|
81
|
+
"memoryMB": memory_mb,
|
|
82
|
+
"sandboxID": sandbox_id,
|
|
83
|
+
"startedAt": started_at,
|
|
84
|
+
"state": state,
|
|
85
|
+
"templateID": template_id,
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
if alias is not UNSET:
|
|
89
|
+
field_dict["alias"] = alias
|
|
90
|
+
if metadata is not UNSET:
|
|
91
|
+
field_dict["metadata"] = metadata
|
|
92
|
+
|
|
93
|
+
return field_dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
97
|
+
d = dict(src_dict)
|
|
98
|
+
client_id = d.pop("clientID")
|
|
99
|
+
|
|
100
|
+
cpu_count = d.pop("cpuCount")
|
|
101
|
+
|
|
102
|
+
disk_size_mb = d.pop("diskSizeMB")
|
|
103
|
+
|
|
104
|
+
end_at = isoparse(d.pop("endAt"))
|
|
105
|
+
|
|
106
|
+
envd_version = d.pop("envdVersion")
|
|
107
|
+
|
|
108
|
+
memory_mb = d.pop("memoryMB")
|
|
109
|
+
|
|
110
|
+
sandbox_id = d.pop("sandboxID")
|
|
111
|
+
|
|
112
|
+
started_at = isoparse(d.pop("startedAt"))
|
|
113
|
+
|
|
114
|
+
state = SandboxState(d.pop("state"))
|
|
115
|
+
|
|
116
|
+
template_id = d.pop("templateID")
|
|
117
|
+
|
|
118
|
+
alias = d.pop("alias", UNSET)
|
|
119
|
+
|
|
120
|
+
metadata = d.pop("metadata", UNSET)
|
|
121
|
+
|
|
122
|
+
listed_sandbox = cls(
|
|
123
|
+
client_id=client_id,
|
|
124
|
+
cpu_count=cpu_count,
|
|
125
|
+
disk_size_mb=disk_size_mb,
|
|
126
|
+
end_at=end_at,
|
|
127
|
+
envd_version=envd_version,
|
|
128
|
+
memory_mb=memory_mb,
|
|
129
|
+
sandbox_id=sandbox_id,
|
|
130
|
+
started_at=started_at,
|
|
131
|
+
state=state,
|
|
132
|
+
template_id=template_id,
|
|
133
|
+
alias=alias,
|
|
134
|
+
metadata=metadata,
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
listed_sandbox.additional_properties = d
|
|
138
|
+
return listed_sandbox
|
|
139
|
+
|
|
140
|
+
@property
|
|
141
|
+
def additional_keys(self) -> list[str]:
|
|
142
|
+
return list(self.additional_properties.keys())
|
|
143
|
+
|
|
144
|
+
def __getitem__(self, key: str) -> Any:
|
|
145
|
+
return self.additional_properties[key]
|
|
146
|
+
|
|
147
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
148
|
+
self.additional_properties[key] = value
|
|
149
|
+
|
|
150
|
+
def __delitem__(self, key: str) -> None:
|
|
151
|
+
del self.additional_properties[key]
|
|
152
|
+
|
|
153
|
+
def __contains__(self, key: str) -> bool:
|
|
154
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import Any, TypeVar
|
|
4
|
+
|
|
5
|
+
from attrs import define as _attrs_define
|
|
6
|
+
from attrs import field as _attrs_field
|
|
7
|
+
from dateutil.parser import isoparse
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="MaxTeamMetric")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class MaxTeamMetric:
|
|
14
|
+
"""Team metric with timestamp
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
timestamp (datetime.datetime): Timestamp of the metric entry
|
|
18
|
+
timestamp_unix (int): Timestamp of the metric entry in Unix time (seconds since epoch)
|
|
19
|
+
value (float): The maximum value of the requested metric in the given interval
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
timestamp: datetime.datetime
|
|
23
|
+
timestamp_unix: int
|
|
24
|
+
value: float
|
|
25
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
26
|
+
|
|
27
|
+
def to_dict(self) -> dict[str, Any]:
|
|
28
|
+
timestamp = self.timestamp.isoformat()
|
|
29
|
+
|
|
30
|
+
timestamp_unix = self.timestamp_unix
|
|
31
|
+
|
|
32
|
+
value = self.value
|
|
33
|
+
|
|
34
|
+
field_dict: dict[str, Any] = {}
|
|
35
|
+
field_dict.update(self.additional_properties)
|
|
36
|
+
field_dict.update(
|
|
37
|
+
{
|
|
38
|
+
"timestamp": timestamp,
|
|
39
|
+
"timestampUnix": timestamp_unix,
|
|
40
|
+
"value": value,
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
return field_dict
|
|
45
|
+
|
|
46
|
+
@classmethod
|
|
47
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
48
|
+
d = dict(src_dict)
|
|
49
|
+
timestamp = isoparse(d.pop("timestamp"))
|
|
50
|
+
|
|
51
|
+
timestamp_unix = d.pop("timestampUnix")
|
|
52
|
+
|
|
53
|
+
value = d.pop("value")
|
|
54
|
+
|
|
55
|
+
max_team_metric = cls(
|
|
56
|
+
timestamp=timestamp,
|
|
57
|
+
timestamp_unix=timestamp_unix,
|
|
58
|
+
value=value,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
max_team_metric.additional_properties = d
|
|
62
|
+
return max_team_metric
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def additional_keys(self) -> list[str]:
|
|
66
|
+
return list(self.additional_properties.keys())
|
|
67
|
+
|
|
68
|
+
def __getitem__(self, key: str) -> Any:
|
|
69
|
+
return self.additional_properties[key]
|
|
70
|
+
|
|
71
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
72
|
+
self.additional_properties[key] = value
|
|
73
|
+
|
|
74
|
+
def __delitem__(self, key: str) -> None:
|
|
75
|
+
del self.additional_properties[key]
|
|
76
|
+
|
|
77
|
+
def __contains__(self, key: str) -> bool:
|
|
78
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
T = TypeVar("T", bound="McpType0")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class McpType0:
|
|
12
|
+
"""MCP configuration for the sandbox"""
|
|
13
|
+
|
|
14
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
15
|
+
|
|
16
|
+
def to_dict(self) -> dict[str, Any]:
|
|
17
|
+
field_dict: dict[str, Any] = {}
|
|
18
|
+
field_dict.update(self.additional_properties)
|
|
19
|
+
|
|
20
|
+
return field_dict
|
|
21
|
+
|
|
22
|
+
@classmethod
|
|
23
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
24
|
+
d = dict(src_dict)
|
|
25
|
+
mcp_type_0 = cls()
|
|
26
|
+
|
|
27
|
+
mcp_type_0.additional_properties = d
|
|
28
|
+
return mcp_type_0
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def additional_keys(self) -> list[str]:
|
|
32
|
+
return list(self.additional_properties.keys())
|
|
33
|
+
|
|
34
|
+
def __getitem__(self, key: str) -> Any:
|
|
35
|
+
return self.additional_properties[key]
|
|
36
|
+
|
|
37
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
38
|
+
self.additional_properties[key] = value
|
|
39
|
+
|
|
40
|
+
def __delitem__(self, key: str) -> None:
|
|
41
|
+
del self.additional_properties[key]
|
|
42
|
+
|
|
43
|
+
def __contains__(self, key: str) -> bool:
|
|
44
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
T = TypeVar("T", bound="NewAccessToken")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class NewAccessToken:
|
|
12
|
+
"""
|
|
13
|
+
Attributes:
|
|
14
|
+
name (str): Name of the access token
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
name: str
|
|
18
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
19
|
+
|
|
20
|
+
def to_dict(self) -> dict[str, Any]:
|
|
21
|
+
name = self.name
|
|
22
|
+
|
|
23
|
+
field_dict: dict[str, Any] = {}
|
|
24
|
+
field_dict.update(self.additional_properties)
|
|
25
|
+
field_dict.update(
|
|
26
|
+
{
|
|
27
|
+
"name": name,
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
return field_dict
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
35
|
+
d = dict(src_dict)
|
|
36
|
+
name = d.pop("name")
|
|
37
|
+
|
|
38
|
+
new_access_token = cls(
|
|
39
|
+
name=name,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
new_access_token.additional_properties = d
|
|
43
|
+
return new_access_token
|
|
44
|
+
|
|
45
|
+
@property
|
|
46
|
+
def additional_keys(self) -> list[str]:
|
|
47
|
+
return list(self.additional_properties.keys())
|
|
48
|
+
|
|
49
|
+
def __getitem__(self, key: str) -> Any:
|
|
50
|
+
return self.additional_properties[key]
|
|
51
|
+
|
|
52
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
53
|
+
self.additional_properties[key] = value
|
|
54
|
+
|
|
55
|
+
def __delitem__(self, key: str) -> None:
|
|
56
|
+
del self.additional_properties[key]
|
|
57
|
+
|
|
58
|
+
def __contains__(self, key: str) -> bool:
|
|
59
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
from ..types import UNSET, Unset
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ..models.mcp_type_0 import McpType0
|
|
11
|
+
from ..models.sandbox_network_config import SandboxNetworkConfig
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
T = TypeVar("T", bound="NewSandbox")
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@_attrs_define
|
|
18
|
+
class NewSandbox:
|
|
19
|
+
"""
|
|
20
|
+
Attributes:
|
|
21
|
+
template_id (str): Identifier of the required template
|
|
22
|
+
allow_internet_access (Union[Unset, bool]): Allow sandbox to access the internet. When set to false, it behaves
|
|
23
|
+
the same as specifying denyOut to 0.0.0.0/0 in the network config.
|
|
24
|
+
auto_pause (Union[Unset, bool]): Automatically pauses the sandbox after the timeout Default: False.
|
|
25
|
+
env_vars (Union[Unset, Any]):
|
|
26
|
+
mcp (Union['McpType0', None, Unset]): MCP configuration for the sandbox
|
|
27
|
+
metadata (Union[Unset, Any]):
|
|
28
|
+
network (Union[Unset, SandboxNetworkConfig]):
|
|
29
|
+
secure (Union[Unset, bool]): Secure all system communication with sandbox
|
|
30
|
+
timeout (Union[Unset, int]): Time to live for the sandbox in seconds. Default: 15.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
template_id: str
|
|
34
|
+
allow_internet_access: Union[Unset, bool] = UNSET
|
|
35
|
+
auto_pause: Union[Unset, bool] = False
|
|
36
|
+
env_vars: Union[Unset, Any] = UNSET
|
|
37
|
+
mcp: Union["McpType0", None, Unset] = UNSET
|
|
38
|
+
metadata: Union[Unset, Any] = UNSET
|
|
39
|
+
network: Union[Unset, "SandboxNetworkConfig"] = UNSET
|
|
40
|
+
secure: Union[Unset, bool] = UNSET
|
|
41
|
+
timeout: Union[Unset, int] = 15
|
|
42
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
43
|
+
|
|
44
|
+
def to_dict(self) -> dict[str, Any]:
|
|
45
|
+
from ..models.mcp_type_0 import McpType0
|
|
46
|
+
|
|
47
|
+
template_id = self.template_id
|
|
48
|
+
|
|
49
|
+
allow_internet_access = self.allow_internet_access
|
|
50
|
+
|
|
51
|
+
auto_pause = self.auto_pause
|
|
52
|
+
|
|
53
|
+
env_vars = self.env_vars
|
|
54
|
+
|
|
55
|
+
mcp: Union[None, Unset, dict[str, Any]]
|
|
56
|
+
if isinstance(self.mcp, Unset):
|
|
57
|
+
mcp = UNSET
|
|
58
|
+
elif isinstance(self.mcp, McpType0):
|
|
59
|
+
mcp = self.mcp.to_dict()
|
|
60
|
+
else:
|
|
61
|
+
mcp = self.mcp
|
|
62
|
+
|
|
63
|
+
metadata = self.metadata
|
|
64
|
+
|
|
65
|
+
network: Union[Unset, dict[str, Any]] = UNSET
|
|
66
|
+
if not isinstance(self.network, Unset):
|
|
67
|
+
network = self.network.to_dict()
|
|
68
|
+
|
|
69
|
+
secure = self.secure
|
|
70
|
+
|
|
71
|
+
timeout = self.timeout
|
|
72
|
+
|
|
73
|
+
field_dict: dict[str, Any] = {}
|
|
74
|
+
field_dict.update(self.additional_properties)
|
|
75
|
+
field_dict.update(
|
|
76
|
+
{
|
|
77
|
+
"templateID": template_id,
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
if allow_internet_access is not UNSET:
|
|
81
|
+
field_dict["allow_internet_access"] = allow_internet_access
|
|
82
|
+
if auto_pause is not UNSET:
|
|
83
|
+
field_dict["autoPause"] = auto_pause
|
|
84
|
+
if env_vars is not UNSET:
|
|
85
|
+
field_dict["envVars"] = env_vars
|
|
86
|
+
if mcp is not UNSET:
|
|
87
|
+
field_dict["mcp"] = mcp
|
|
88
|
+
if metadata is not UNSET:
|
|
89
|
+
field_dict["metadata"] = metadata
|
|
90
|
+
if network is not UNSET:
|
|
91
|
+
field_dict["network"] = network
|
|
92
|
+
if secure is not UNSET:
|
|
93
|
+
field_dict["secure"] = secure
|
|
94
|
+
if timeout is not UNSET:
|
|
95
|
+
field_dict["timeout"] = timeout
|
|
96
|
+
|
|
97
|
+
return field_dict
|
|
98
|
+
|
|
99
|
+
@classmethod
|
|
100
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
101
|
+
from ..models.mcp_type_0 import McpType0
|
|
102
|
+
from ..models.sandbox_network_config import SandboxNetworkConfig
|
|
103
|
+
|
|
104
|
+
d = dict(src_dict)
|
|
105
|
+
template_id = d.pop("templateID")
|
|
106
|
+
|
|
107
|
+
allow_internet_access = d.pop("allow_internet_access", UNSET)
|
|
108
|
+
|
|
109
|
+
auto_pause = d.pop("autoPause", UNSET)
|
|
110
|
+
|
|
111
|
+
env_vars = d.pop("envVars", UNSET)
|
|
112
|
+
|
|
113
|
+
def _parse_mcp(data: object) -> Union["McpType0", None, Unset]:
|
|
114
|
+
if data is None:
|
|
115
|
+
return data
|
|
116
|
+
if isinstance(data, Unset):
|
|
117
|
+
return data
|
|
118
|
+
try:
|
|
119
|
+
if not isinstance(data, dict):
|
|
120
|
+
raise TypeError()
|
|
121
|
+
componentsschemas_mcp_type_0 = McpType0.from_dict(data)
|
|
122
|
+
|
|
123
|
+
return componentsschemas_mcp_type_0
|
|
124
|
+
except: # noqa: E722
|
|
125
|
+
pass
|
|
126
|
+
return cast(Union["McpType0", None, Unset], data)
|
|
127
|
+
|
|
128
|
+
mcp = _parse_mcp(d.pop("mcp", UNSET))
|
|
129
|
+
|
|
130
|
+
metadata = d.pop("metadata", UNSET)
|
|
131
|
+
|
|
132
|
+
_network = d.pop("network", UNSET)
|
|
133
|
+
network: Union[Unset, SandboxNetworkConfig]
|
|
134
|
+
if isinstance(_network, Unset):
|
|
135
|
+
network = UNSET
|
|
136
|
+
else:
|
|
137
|
+
network = SandboxNetworkConfig.from_dict(_network)
|
|
138
|
+
|
|
139
|
+
secure = d.pop("secure", UNSET)
|
|
140
|
+
|
|
141
|
+
timeout = d.pop("timeout", UNSET)
|
|
142
|
+
|
|
143
|
+
new_sandbox = cls(
|
|
144
|
+
template_id=template_id,
|
|
145
|
+
allow_internet_access=allow_internet_access,
|
|
146
|
+
auto_pause=auto_pause,
|
|
147
|
+
env_vars=env_vars,
|
|
148
|
+
mcp=mcp,
|
|
149
|
+
metadata=metadata,
|
|
150
|
+
network=network,
|
|
151
|
+
secure=secure,
|
|
152
|
+
timeout=timeout,
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
new_sandbox.additional_properties = d
|
|
156
|
+
return new_sandbox
|
|
157
|
+
|
|
158
|
+
@property
|
|
159
|
+
def additional_keys(self) -> list[str]:
|
|
160
|
+
return list(self.additional_properties.keys())
|
|
161
|
+
|
|
162
|
+
def __getitem__(self, key: str) -> Any:
|
|
163
|
+
return self.additional_properties[key]
|
|
164
|
+
|
|
165
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
166
|
+
self.additional_properties[key] = value
|
|
167
|
+
|
|
168
|
+
def __delitem__(self, key: str) -> None:
|
|
169
|
+
del self.additional_properties[key]
|
|
170
|
+
|
|
171
|
+
def __contains__(self, key: str) -> bool:
|
|
172
|
+
return key in self.additional_properties
|