chore: import upstream snapshot with attribution
This commit is contained in:
+185
@@ -0,0 +1,185 @@
|
||||
"""Contains all the data models used in inputs/outputs"""
|
||||
|
||||
from .admin_build_cancel_result import AdminBuildCancelResult
|
||||
from .admin_sandbox_kill_result import AdminSandboxKillResult
|
||||
from .assign_template_tags_request import AssignTemplateTagsRequest
|
||||
from .assigned_template_tags import AssignedTemplateTags
|
||||
from .aws_registry import AWSRegistry
|
||||
from .aws_registry_type import AWSRegistryType
|
||||
from .build_log_entry import BuildLogEntry
|
||||
from .build_status_reason import BuildStatusReason
|
||||
from .connect_sandbox import ConnectSandbox
|
||||
from .created_access_token import CreatedAccessToken
|
||||
from .created_team_api_key import CreatedTeamAPIKey
|
||||
from .delete_template_tags_request import DeleteTemplateTagsRequest
|
||||
from .disk_metrics import DiskMetrics
|
||||
from .error import Error
|
||||
from .gcp_registry import GCPRegistry
|
||||
from .gcp_registry_type import GCPRegistryType
|
||||
from .general_registry import GeneralRegistry
|
||||
from .general_registry_type import GeneralRegistryType
|
||||
from .identifier_masking_details import IdentifierMaskingDetails
|
||||
from .listed_sandbox import ListedSandbox
|
||||
from .log_level import LogLevel
|
||||
from .logs_direction import LogsDirection
|
||||
from .logs_source import LogsSource
|
||||
from .machine_info import MachineInfo
|
||||
from .max_team_metric import MaxTeamMetric
|
||||
from .mcp_type_0 import McpType0
|
||||
from .new_access_token import NewAccessToken
|
||||
from .new_sandbox import NewSandbox
|
||||
from .new_team_api_key import NewTeamAPIKey
|
||||
from .new_volume import NewVolume
|
||||
from .node import Node
|
||||
from .node_detail import NodeDetail
|
||||
from .node_metrics import NodeMetrics
|
||||
from .node_status import NodeStatus
|
||||
from .node_status_change import NodeStatusChange
|
||||
from .post_sandboxes_sandbox_id_refreshes_body import (
|
||||
PostSandboxesSandboxIDRefreshesBody,
|
||||
)
|
||||
from .post_sandboxes_sandbox_id_snapshots_body import (
|
||||
PostSandboxesSandboxIDSnapshotsBody,
|
||||
)
|
||||
from .post_sandboxes_sandbox_id_timeout_body import PostSandboxesSandboxIDTimeoutBody
|
||||
from .resumed_sandbox import ResumedSandbox
|
||||
from .sandbox import Sandbox
|
||||
from .sandbox_auto_resume_config import SandboxAutoResumeConfig
|
||||
from .sandbox_detail import SandboxDetail
|
||||
from .sandbox_lifecycle import SandboxLifecycle
|
||||
from .sandbox_log import SandboxLog
|
||||
from .sandbox_log_entry import SandboxLogEntry
|
||||
from .sandbox_log_entry_fields import SandboxLogEntryFields
|
||||
from .sandbox_logs import SandboxLogs
|
||||
from .sandbox_logs_v2_response import SandboxLogsV2Response
|
||||
from .sandbox_metric import SandboxMetric
|
||||
from .sandbox_network_config import SandboxNetworkConfig
|
||||
from .sandbox_network_config_rules import SandboxNetworkConfigRules
|
||||
from .sandbox_network_rule import SandboxNetworkRule
|
||||
from .sandbox_network_transform import SandboxNetworkTransform
|
||||
from .sandbox_network_transform_headers import SandboxNetworkTransformHeaders
|
||||
from .sandbox_network_update_config import SandboxNetworkUpdateConfig
|
||||
from .sandbox_network_update_config_rules import SandboxNetworkUpdateConfigRules
|
||||
from .sandbox_on_timeout import SandboxOnTimeout
|
||||
from .sandbox_pause_request import SandboxPauseRequest
|
||||
from .sandbox_state import SandboxState
|
||||
from .sandbox_volume_mount import SandboxVolumeMount
|
||||
from .sandboxes_with_metrics import SandboxesWithMetrics
|
||||
from .snapshot_info import SnapshotInfo
|
||||
from .team import Team
|
||||
from .team_api_key import TeamAPIKey
|
||||
from .team_metric import TeamMetric
|
||||
from .team_user import TeamUser
|
||||
from .template import Template
|
||||
from .template_alias_response import TemplateAliasResponse
|
||||
from .template_build import TemplateBuild
|
||||
from .template_build_file_upload import TemplateBuildFileUpload
|
||||
from .template_build_info import TemplateBuildInfo
|
||||
from .template_build_logs_response import TemplateBuildLogsResponse
|
||||
from .template_build_request import TemplateBuildRequest
|
||||
from .template_build_request_v2 import TemplateBuildRequestV2
|
||||
from .template_build_request_v3 import TemplateBuildRequestV3
|
||||
from .template_build_start_v2 import TemplateBuildStartV2
|
||||
from .template_build_status import TemplateBuildStatus
|
||||
from .template_legacy import TemplateLegacy
|
||||
from .template_request_response_v3 import TemplateRequestResponseV3
|
||||
from .template_step import TemplateStep
|
||||
from .template_tag import TemplateTag
|
||||
from .template_update_request import TemplateUpdateRequest
|
||||
from .template_update_response import TemplateUpdateResponse
|
||||
from .template_with_builds import TemplateWithBuilds
|
||||
from .update_team_api_key import UpdateTeamAPIKey
|
||||
from .volume import Volume
|
||||
from .volume_and_token import VolumeAndToken
|
||||
from .volume_token import VolumeToken
|
||||
|
||||
__all__ = (
|
||||
"AdminBuildCancelResult",
|
||||
"AdminSandboxKillResult",
|
||||
"AssignedTemplateTags",
|
||||
"AssignTemplateTagsRequest",
|
||||
"AWSRegistry",
|
||||
"AWSRegistryType",
|
||||
"BuildLogEntry",
|
||||
"BuildStatusReason",
|
||||
"ConnectSandbox",
|
||||
"CreatedAccessToken",
|
||||
"CreatedTeamAPIKey",
|
||||
"DeleteTemplateTagsRequest",
|
||||
"DiskMetrics",
|
||||
"Error",
|
||||
"GCPRegistry",
|
||||
"GCPRegistryType",
|
||||
"GeneralRegistry",
|
||||
"GeneralRegistryType",
|
||||
"IdentifierMaskingDetails",
|
||||
"ListedSandbox",
|
||||
"LogLevel",
|
||||
"LogsDirection",
|
||||
"LogsSource",
|
||||
"MachineInfo",
|
||||
"MaxTeamMetric",
|
||||
"McpType0",
|
||||
"NewAccessToken",
|
||||
"NewSandbox",
|
||||
"NewTeamAPIKey",
|
||||
"NewVolume",
|
||||
"Node",
|
||||
"NodeDetail",
|
||||
"NodeMetrics",
|
||||
"NodeStatus",
|
||||
"NodeStatusChange",
|
||||
"PostSandboxesSandboxIDRefreshesBody",
|
||||
"PostSandboxesSandboxIDSnapshotsBody",
|
||||
"PostSandboxesSandboxIDTimeoutBody",
|
||||
"ResumedSandbox",
|
||||
"Sandbox",
|
||||
"SandboxAutoResumeConfig",
|
||||
"SandboxDetail",
|
||||
"SandboxesWithMetrics",
|
||||
"SandboxLifecycle",
|
||||
"SandboxLog",
|
||||
"SandboxLogEntry",
|
||||
"SandboxLogEntryFields",
|
||||
"SandboxLogs",
|
||||
"SandboxLogsV2Response",
|
||||
"SandboxMetric",
|
||||
"SandboxNetworkConfig",
|
||||
"SandboxNetworkConfigRules",
|
||||
"SandboxNetworkRule",
|
||||
"SandboxNetworkTransform",
|
||||
"SandboxNetworkTransformHeaders",
|
||||
"SandboxNetworkUpdateConfig",
|
||||
"SandboxNetworkUpdateConfigRules",
|
||||
"SandboxOnTimeout",
|
||||
"SandboxPauseRequest",
|
||||
"SandboxState",
|
||||
"SandboxVolumeMount",
|
||||
"SnapshotInfo",
|
||||
"Team",
|
||||
"TeamAPIKey",
|
||||
"TeamMetric",
|
||||
"TeamUser",
|
||||
"Template",
|
||||
"TemplateAliasResponse",
|
||||
"TemplateBuild",
|
||||
"TemplateBuildFileUpload",
|
||||
"TemplateBuildInfo",
|
||||
"TemplateBuildLogsResponse",
|
||||
"TemplateBuildRequest",
|
||||
"TemplateBuildRequestV2",
|
||||
"TemplateBuildRequestV3",
|
||||
"TemplateBuildStartV2",
|
||||
"TemplateBuildStatus",
|
||||
"TemplateLegacy",
|
||||
"TemplateRequestResponseV3",
|
||||
"TemplateStep",
|
||||
"TemplateTag",
|
||||
"TemplateUpdateRequest",
|
||||
"TemplateUpdateResponse",
|
||||
"TemplateWithBuilds",
|
||||
"UpdateTeamAPIKey",
|
||||
"Volume",
|
||||
"VolumeAndToken",
|
||||
"VolumeToken",
|
||||
)
|
||||
@@ -0,0 +1,67 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="AdminBuildCancelResult")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class AdminBuildCancelResult:
|
||||
"""
|
||||
Attributes:
|
||||
cancelled_count (int): Number of builds successfully cancelled
|
||||
failed_count (int): Number of builds that failed to cancel
|
||||
"""
|
||||
|
||||
cancelled_count: int
|
||||
failed_count: int
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
cancelled_count = self.cancelled_count
|
||||
|
||||
failed_count = self.failed_count
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"cancelledCount": cancelled_count,
|
||||
"failedCount": failed_count,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
cancelled_count = d.pop("cancelledCount")
|
||||
|
||||
failed_count = d.pop("failedCount")
|
||||
|
||||
admin_build_cancel_result = cls(
|
||||
cancelled_count=cancelled_count,
|
||||
failed_count=failed_count,
|
||||
)
|
||||
|
||||
admin_build_cancel_result.additional_properties = d
|
||||
return admin_build_cancel_result
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,67 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="AdminSandboxKillResult")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class AdminSandboxKillResult:
|
||||
"""
|
||||
Attributes:
|
||||
failed_count (int): Number of sandboxes that failed to kill
|
||||
killed_count (int): Number of sandboxes successfully killed
|
||||
"""
|
||||
|
||||
failed_count: int
|
||||
killed_count: int
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
failed_count = self.failed_count
|
||||
|
||||
killed_count = self.killed_count
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"failedCount": failed_count,
|
||||
"killedCount": killed_count,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
failed_count = d.pop("failedCount")
|
||||
|
||||
killed_count = d.pop("killedCount")
|
||||
|
||||
admin_sandbox_kill_result = cls(
|
||||
failed_count=failed_count,
|
||||
killed_count=killed_count,
|
||||
)
|
||||
|
||||
admin_sandbox_kill_result.additional_properties = d
|
||||
return admin_sandbox_kill_result
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,67 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="AssignTemplateTagsRequest")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class AssignTemplateTagsRequest:
|
||||
"""
|
||||
Attributes:
|
||||
tags (list[str]): Tags to assign to the template
|
||||
target (str): Target template in "name:tag" format
|
||||
"""
|
||||
|
||||
tags: list[str]
|
||||
target: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
tags = self.tags
|
||||
|
||||
target = self.target
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"tags": tags,
|
||||
"target": target,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
tags = cast(list[str], d.pop("tags"))
|
||||
|
||||
target = d.pop("target")
|
||||
|
||||
assign_template_tags_request = cls(
|
||||
tags=tags,
|
||||
target=target,
|
||||
)
|
||||
|
||||
assign_template_tags_request.additional_properties = d
|
||||
return assign_template_tags_request
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,68 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, cast
|
||||
from uuid import UUID
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="AssignedTemplateTags")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class AssignedTemplateTags:
|
||||
"""
|
||||
Attributes:
|
||||
build_id (UUID): Identifier of the build associated with these tags
|
||||
tags (list[str]): Assigned tags of the template
|
||||
"""
|
||||
|
||||
build_id: UUID
|
||||
tags: list[str]
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
build_id = str(self.build_id)
|
||||
|
||||
tags = self.tags
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"buildID": build_id,
|
||||
"tags": tags,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
build_id = UUID(d.pop("buildID"))
|
||||
|
||||
tags = cast(list[str], d.pop("tags"))
|
||||
|
||||
assigned_template_tags = cls(
|
||||
build_id=build_id,
|
||||
tags=tags,
|
||||
)
|
||||
|
||||
assigned_template_tags.additional_properties = d
|
||||
return assigned_template_tags
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,85 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..models.aws_registry_type import AWSRegistryType
|
||||
|
||||
T = TypeVar("T", bound="AWSRegistry")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class AWSRegistry:
|
||||
"""
|
||||
Attributes:
|
||||
aws_access_key_id (str): AWS Access Key ID for ECR authentication
|
||||
aws_region (str): AWS Region where the ECR registry is located
|
||||
aws_secret_access_key (str): AWS Secret Access Key for ECR authentication
|
||||
type_ (AWSRegistryType): Type of registry authentication
|
||||
"""
|
||||
|
||||
aws_access_key_id: str
|
||||
aws_region: str
|
||||
aws_secret_access_key: str
|
||||
type_: AWSRegistryType
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
aws_access_key_id = self.aws_access_key_id
|
||||
|
||||
aws_region = self.aws_region
|
||||
|
||||
aws_secret_access_key = self.aws_secret_access_key
|
||||
|
||||
type_ = self.type_.value
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"awsAccessKeyId": aws_access_key_id,
|
||||
"awsRegion": aws_region,
|
||||
"awsSecretAccessKey": aws_secret_access_key,
|
||||
"type": type_,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
aws_access_key_id = d.pop("awsAccessKeyId")
|
||||
|
||||
aws_region = d.pop("awsRegion")
|
||||
|
||||
aws_secret_access_key = d.pop("awsSecretAccessKey")
|
||||
|
||||
type_ = AWSRegistryType(d.pop("type"))
|
||||
|
||||
aws_registry = cls(
|
||||
aws_access_key_id=aws_access_key_id,
|
||||
aws_region=aws_region,
|
||||
aws_secret_access_key=aws_secret_access_key,
|
||||
type_=type_,
|
||||
)
|
||||
|
||||
aws_registry.additional_properties = d
|
||||
return aws_registry
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,8 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class AWSRegistryType(str, Enum):
|
||||
AWS = "aws"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
||||
@@ -0,0 +1,89 @@
|
||||
import datetime
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, Union
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
from ..models.log_level import LogLevel
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="BuildLogEntry")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class BuildLogEntry:
|
||||
"""
|
||||
Attributes:
|
||||
level (LogLevel): State of the sandbox
|
||||
message (str): Log message content
|
||||
timestamp (datetime.datetime): Timestamp of the log entry
|
||||
step (Union[Unset, str]): Step in the build process related to the log entry
|
||||
"""
|
||||
|
||||
level: LogLevel
|
||||
message: str
|
||||
timestamp: datetime.datetime
|
||||
step: Union[Unset, str] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
level = self.level.value
|
||||
|
||||
message = self.message
|
||||
|
||||
timestamp = self.timestamp.isoformat()
|
||||
|
||||
step = self.step
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"level": level,
|
||||
"message": message,
|
||||
"timestamp": timestamp,
|
||||
}
|
||||
)
|
||||
if step is not UNSET:
|
||||
field_dict["step"] = step
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
level = LogLevel(d.pop("level"))
|
||||
|
||||
message = d.pop("message")
|
||||
|
||||
timestamp = isoparse(d.pop("timestamp"))
|
||||
|
||||
step = d.pop("step", UNSET)
|
||||
|
||||
build_log_entry = cls(
|
||||
level=level,
|
||||
message=message,
|
||||
timestamp=timestamp,
|
||||
step=step,
|
||||
)
|
||||
|
||||
build_log_entry.additional_properties = d
|
||||
return build_log_entry
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,95 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.build_log_entry import BuildLogEntry
|
||||
|
||||
|
||||
T = TypeVar("T", bound="BuildStatusReason")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class BuildStatusReason:
|
||||
"""
|
||||
Attributes:
|
||||
message (str): Message with the status reason, currently reporting only for error status
|
||||
log_entries (Union[Unset, list['BuildLogEntry']]): Log entries related to the status reason
|
||||
step (Union[Unset, str]): Step that failed
|
||||
"""
|
||||
|
||||
message: str
|
||||
log_entries: Union[Unset, list["BuildLogEntry"]] = UNSET
|
||||
step: Union[Unset, str] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
message = self.message
|
||||
|
||||
log_entries: Union[Unset, list[dict[str, Any]]] = UNSET
|
||||
if not isinstance(self.log_entries, Unset):
|
||||
log_entries = []
|
||||
for log_entries_item_data in self.log_entries:
|
||||
log_entries_item = log_entries_item_data.to_dict()
|
||||
log_entries.append(log_entries_item)
|
||||
|
||||
step = self.step
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"message": message,
|
||||
}
|
||||
)
|
||||
if log_entries is not UNSET:
|
||||
field_dict["logEntries"] = log_entries
|
||||
if step is not UNSET:
|
||||
field_dict["step"] = step
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.build_log_entry import BuildLogEntry
|
||||
|
||||
d = dict(src_dict)
|
||||
message = d.pop("message")
|
||||
|
||||
log_entries = []
|
||||
_log_entries = d.pop("logEntries", UNSET)
|
||||
for log_entries_item_data in _log_entries or []:
|
||||
log_entries_item = BuildLogEntry.from_dict(log_entries_item_data)
|
||||
|
||||
log_entries.append(log_entries_item)
|
||||
|
||||
step = d.pop("step", UNSET)
|
||||
|
||||
build_status_reason = cls(
|
||||
message=message,
|
||||
log_entries=log_entries,
|
||||
step=step,
|
||||
)
|
||||
|
||||
build_status_reason.additional_properties = d
|
||||
return build_status_reason
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,59 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="ConnectSandbox")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ConnectSandbox:
|
||||
"""
|
||||
Attributes:
|
||||
timeout (int): Timeout in seconds from the current time after which the sandbox should expire
|
||||
"""
|
||||
|
||||
timeout: int
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
timeout = self.timeout
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"timeout": timeout,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
timeout = d.pop("timeout")
|
||||
|
||||
connect_sandbox = cls(
|
||||
timeout=timeout,
|
||||
)
|
||||
|
||||
connect_sandbox.additional_properties = d
|
||||
return connect_sandbox
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,100 @@
|
||||
import datetime
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar
|
||||
from uuid import UUID
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.identifier_masking_details import IdentifierMaskingDetails
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreatedAccessToken")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreatedAccessToken:
|
||||
"""
|
||||
Attributes:
|
||||
created_at (datetime.datetime): Timestamp of access token creation
|
||||
id (UUID): Identifier of the access token
|
||||
mask (IdentifierMaskingDetails):
|
||||
name (str): Name of the access token
|
||||
token (str): The fully created access token
|
||||
"""
|
||||
|
||||
created_at: datetime.datetime
|
||||
id: UUID
|
||||
mask: "IdentifierMaskingDetails"
|
||||
name: str
|
||||
token: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
created_at = self.created_at.isoformat()
|
||||
|
||||
id = str(self.id)
|
||||
|
||||
mask = self.mask.to_dict()
|
||||
|
||||
name = self.name
|
||||
|
||||
token = self.token
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"createdAt": created_at,
|
||||
"id": id,
|
||||
"mask": mask,
|
||||
"name": name,
|
||||
"token": token,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.identifier_masking_details import IdentifierMaskingDetails
|
||||
|
||||
d = dict(src_dict)
|
||||
created_at = isoparse(d.pop("createdAt"))
|
||||
|
||||
id = UUID(d.pop("id"))
|
||||
|
||||
mask = IdentifierMaskingDetails.from_dict(d.pop("mask"))
|
||||
|
||||
name = d.pop("name")
|
||||
|
||||
token = d.pop("token")
|
||||
|
||||
created_access_token = cls(
|
||||
created_at=created_at,
|
||||
id=id,
|
||||
mask=mask,
|
||||
name=name,
|
||||
token=token,
|
||||
)
|
||||
|
||||
created_access_token.additional_properties = d
|
||||
return created_access_token
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,166 @@
|
||||
import datetime
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
||||
from uuid import UUID
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.identifier_masking_details import IdentifierMaskingDetails
|
||||
from ..models.team_user import TeamUser
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreatedTeamAPIKey")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreatedTeamAPIKey:
|
||||
"""
|
||||
Attributes:
|
||||
created_at (datetime.datetime): Timestamp of API key creation
|
||||
id (UUID): Identifier of the API key
|
||||
key (str): Raw value of the API key
|
||||
mask (IdentifierMaskingDetails):
|
||||
name (str): Name of the API key
|
||||
created_by (Union['TeamUser', None, Unset]):
|
||||
last_used (Union[None, Unset, datetime.datetime]): Last time this API key was used
|
||||
"""
|
||||
|
||||
created_at: datetime.datetime
|
||||
id: UUID
|
||||
key: str
|
||||
mask: "IdentifierMaskingDetails"
|
||||
name: str
|
||||
created_by: Union["TeamUser", None, Unset] = UNSET
|
||||
last_used: Union[None, Unset, datetime.datetime] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.team_user import TeamUser
|
||||
|
||||
created_at = self.created_at.isoformat()
|
||||
|
||||
id = str(self.id)
|
||||
|
||||
key = self.key
|
||||
|
||||
mask = self.mask.to_dict()
|
||||
|
||||
name = self.name
|
||||
|
||||
created_by: Union[None, Unset, dict[str, Any]]
|
||||
if isinstance(self.created_by, Unset):
|
||||
created_by = UNSET
|
||||
elif isinstance(self.created_by, TeamUser):
|
||||
created_by = self.created_by.to_dict()
|
||||
else:
|
||||
created_by = self.created_by
|
||||
|
||||
last_used: Union[None, Unset, str]
|
||||
if isinstance(self.last_used, Unset):
|
||||
last_used = UNSET
|
||||
elif isinstance(self.last_used, datetime.datetime):
|
||||
last_used = self.last_used.isoformat()
|
||||
else:
|
||||
last_used = self.last_used
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"createdAt": created_at,
|
||||
"id": id,
|
||||
"key": key,
|
||||
"mask": mask,
|
||||
"name": name,
|
||||
}
|
||||
)
|
||||
if created_by is not UNSET:
|
||||
field_dict["createdBy"] = created_by
|
||||
if last_used is not UNSET:
|
||||
field_dict["lastUsed"] = last_used
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.identifier_masking_details import IdentifierMaskingDetails
|
||||
from ..models.team_user import TeamUser
|
||||
|
||||
d = dict(src_dict)
|
||||
created_at = isoparse(d.pop("createdAt"))
|
||||
|
||||
id = UUID(d.pop("id"))
|
||||
|
||||
key = d.pop("key")
|
||||
|
||||
mask = IdentifierMaskingDetails.from_dict(d.pop("mask"))
|
||||
|
||||
name = d.pop("name")
|
||||
|
||||
def _parse_created_by(data: object) -> Union["TeamUser", None, Unset]:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
created_by_type_1 = TeamUser.from_dict(data)
|
||||
|
||||
return created_by_type_1
|
||||
except: # noqa: E722
|
||||
pass
|
||||
return cast(Union["TeamUser", None, Unset], data)
|
||||
|
||||
created_by = _parse_created_by(d.pop("createdBy", UNSET))
|
||||
|
||||
def _parse_last_used(data: object) -> Union[None, Unset, datetime.datetime]:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, str):
|
||||
raise TypeError()
|
||||
last_used_type_0 = isoparse(data)
|
||||
|
||||
return last_used_type_0
|
||||
except: # noqa: E722
|
||||
pass
|
||||
return cast(Union[None, Unset, datetime.datetime], data)
|
||||
|
||||
last_used = _parse_last_used(d.pop("lastUsed", UNSET))
|
||||
|
||||
created_team_api_key = cls(
|
||||
created_at=created_at,
|
||||
id=id,
|
||||
key=key,
|
||||
mask=mask,
|
||||
name=name,
|
||||
created_by=created_by,
|
||||
last_used=last_used,
|
||||
)
|
||||
|
||||
created_team_api_key.additional_properties = d
|
||||
return created_team_api_key
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,67 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="DeleteTemplateTagsRequest")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class DeleteTemplateTagsRequest:
|
||||
"""
|
||||
Attributes:
|
||||
name (str): Name of the template
|
||||
tags (list[str]): Tags to delete
|
||||
"""
|
||||
|
||||
name: str
|
||||
tags: list[str]
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
name = self.name
|
||||
|
||||
tags = self.tags
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"name": name,
|
||||
"tags": tags,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
name = d.pop("name")
|
||||
|
||||
tags = cast(list[str], d.pop("tags"))
|
||||
|
||||
delete_template_tags_request = cls(
|
||||
name=name,
|
||||
tags=tags,
|
||||
)
|
||||
|
||||
delete_template_tags_request.additional_properties = d
|
||||
return delete_template_tags_request
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,91 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="DiskMetrics")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class DiskMetrics:
|
||||
"""
|
||||
Attributes:
|
||||
device (str): Device name
|
||||
filesystem_type (str): Filesystem type (e.g., ext4, xfs)
|
||||
mount_point (str): Mount point of the disk
|
||||
total_bytes (int): Total space in bytes
|
||||
used_bytes (int): Used space in bytes
|
||||
"""
|
||||
|
||||
device: str
|
||||
filesystem_type: str
|
||||
mount_point: str
|
||||
total_bytes: int
|
||||
used_bytes: int
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
device = self.device
|
||||
|
||||
filesystem_type = self.filesystem_type
|
||||
|
||||
mount_point = self.mount_point
|
||||
|
||||
total_bytes = self.total_bytes
|
||||
|
||||
used_bytes = self.used_bytes
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"device": device,
|
||||
"filesystemType": filesystem_type,
|
||||
"mountPoint": mount_point,
|
||||
"totalBytes": total_bytes,
|
||||
"usedBytes": used_bytes,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
device = d.pop("device")
|
||||
|
||||
filesystem_type = d.pop("filesystemType")
|
||||
|
||||
mount_point = d.pop("mountPoint")
|
||||
|
||||
total_bytes = d.pop("totalBytes")
|
||||
|
||||
used_bytes = d.pop("usedBytes")
|
||||
|
||||
disk_metrics = cls(
|
||||
device=device,
|
||||
filesystem_type=filesystem_type,
|
||||
mount_point=mount_point,
|
||||
total_bytes=total_bytes,
|
||||
used_bytes=used_bytes,
|
||||
)
|
||||
|
||||
disk_metrics.additional_properties = d
|
||||
return disk_metrics
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="Error")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class Error:
|
||||
"""
|
||||
Attributes:
|
||||
code (int): Error code
|
||||
message (str): Error
|
||||
"""
|
||||
|
||||
code: int
|
||||
message: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
code = self.code
|
||||
|
||||
message = self.message
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"code": code,
|
||||
"message": message,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
code = d.pop("code")
|
||||
|
||||
message = d.pop("message")
|
||||
|
||||
error = cls(
|
||||
code=code,
|
||||
message=message,
|
||||
)
|
||||
|
||||
error.additional_properties = d
|
||||
return error
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,69 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..models.gcp_registry_type import GCPRegistryType
|
||||
|
||||
T = TypeVar("T", bound="GCPRegistry")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class GCPRegistry:
|
||||
"""
|
||||
Attributes:
|
||||
service_account_json (str): Service Account JSON for GCP authentication
|
||||
type_ (GCPRegistryType): Type of registry authentication
|
||||
"""
|
||||
|
||||
service_account_json: str
|
||||
type_: GCPRegistryType
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
service_account_json = self.service_account_json
|
||||
|
||||
type_ = self.type_.value
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"serviceAccountJson": service_account_json,
|
||||
"type": type_,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
service_account_json = d.pop("serviceAccountJson")
|
||||
|
||||
type_ = GCPRegistryType(d.pop("type"))
|
||||
|
||||
gcp_registry = cls(
|
||||
service_account_json=service_account_json,
|
||||
type_=type_,
|
||||
)
|
||||
|
||||
gcp_registry.additional_properties = d
|
||||
return gcp_registry
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,8 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class GCPRegistryType(str, Enum):
|
||||
GCP = "gcp"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
||||
@@ -0,0 +1,77 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..models.general_registry_type import GeneralRegistryType
|
||||
|
||||
T = TypeVar("T", bound="GeneralRegistry")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class GeneralRegistry:
|
||||
"""
|
||||
Attributes:
|
||||
password (str): Password to use for the registry
|
||||
type_ (GeneralRegistryType): Type of registry authentication
|
||||
username (str): Username to use for the registry
|
||||
"""
|
||||
|
||||
password: str
|
||||
type_: GeneralRegistryType
|
||||
username: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
password = self.password
|
||||
|
||||
type_ = self.type_.value
|
||||
|
||||
username = self.username
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"password": password,
|
||||
"type": type_,
|
||||
"username": username,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
password = d.pop("password")
|
||||
|
||||
type_ = GeneralRegistryType(d.pop("type"))
|
||||
|
||||
username = d.pop("username")
|
||||
|
||||
general_registry = cls(
|
||||
password=password,
|
||||
type_=type_,
|
||||
username=username,
|
||||
)
|
||||
|
||||
general_registry.additional_properties = d
|
||||
return general_registry
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,8 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class GeneralRegistryType(str, Enum):
|
||||
REGISTRY = "registry"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
||||
@@ -0,0 +1,83 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="IdentifierMaskingDetails")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class IdentifierMaskingDetails:
|
||||
"""
|
||||
Attributes:
|
||||
masked_value_prefix (str): Prefix used in masked version of the token or key
|
||||
masked_value_suffix (str): Suffix used in masked version of the token or key
|
||||
prefix (str): Prefix that identifies the token or key type
|
||||
value_length (int): Length of the token or key
|
||||
"""
|
||||
|
||||
masked_value_prefix: str
|
||||
masked_value_suffix: str
|
||||
prefix: str
|
||||
value_length: int
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
masked_value_prefix = self.masked_value_prefix
|
||||
|
||||
masked_value_suffix = self.masked_value_suffix
|
||||
|
||||
prefix = self.prefix
|
||||
|
||||
value_length = self.value_length
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"maskedValuePrefix": masked_value_prefix,
|
||||
"maskedValueSuffix": masked_value_suffix,
|
||||
"prefix": prefix,
|
||||
"valueLength": value_length,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
masked_value_prefix = d.pop("maskedValuePrefix")
|
||||
|
||||
masked_value_suffix = d.pop("maskedValueSuffix")
|
||||
|
||||
prefix = d.pop("prefix")
|
||||
|
||||
value_length = d.pop("valueLength")
|
||||
|
||||
identifier_masking_details = cls(
|
||||
masked_value_prefix=masked_value_prefix,
|
||||
masked_value_suffix=masked_value_suffix,
|
||||
prefix=prefix,
|
||||
value_length=value_length,
|
||||
)
|
||||
|
||||
identifier_masking_details.additional_properties = d
|
||||
return identifier_masking_details
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,179 @@
|
||||
import datetime
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
from ..models.sandbox_state import SandboxState
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.sandbox_volume_mount import SandboxVolumeMount
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ListedSandbox")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ListedSandbox:
|
||||
"""
|
||||
Attributes:
|
||||
client_id (str): Identifier of the client
|
||||
cpu_count (int): CPU cores for the sandbox
|
||||
disk_size_mb (int): Disk size for the sandbox in MiB
|
||||
end_at (datetime.datetime): Time when the sandbox will expire
|
||||
envd_version (str): Version of the envd running in the sandbox
|
||||
memory_mb (int): Memory for the sandbox in MiB
|
||||
sandbox_id (str): Identifier of the sandbox
|
||||
started_at (datetime.datetime): Time when the sandbox was started
|
||||
state (SandboxState): State of the sandbox
|
||||
template_id (str): Identifier of the template from which is the sandbox created
|
||||
alias (Union[Unset, str]): Alias of the template
|
||||
metadata (Union[Unset, Any]):
|
||||
volume_mounts (Union[Unset, list['SandboxVolumeMount']]):
|
||||
"""
|
||||
|
||||
client_id: str
|
||||
cpu_count: int
|
||||
disk_size_mb: int
|
||||
end_at: datetime.datetime
|
||||
envd_version: str
|
||||
memory_mb: int
|
||||
sandbox_id: str
|
||||
started_at: datetime.datetime
|
||||
state: SandboxState
|
||||
template_id: str
|
||||
alias: Union[Unset, str] = UNSET
|
||||
metadata: Union[Unset, Any] = UNSET
|
||||
volume_mounts: Union[Unset, list["SandboxVolumeMount"]] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
client_id = self.client_id
|
||||
|
||||
cpu_count = self.cpu_count
|
||||
|
||||
disk_size_mb = self.disk_size_mb
|
||||
|
||||
end_at = self.end_at.isoformat()
|
||||
|
||||
envd_version = self.envd_version
|
||||
|
||||
memory_mb = self.memory_mb
|
||||
|
||||
sandbox_id = self.sandbox_id
|
||||
|
||||
started_at = self.started_at.isoformat()
|
||||
|
||||
state = self.state.value
|
||||
|
||||
template_id = self.template_id
|
||||
|
||||
alias = self.alias
|
||||
|
||||
metadata = self.metadata
|
||||
|
||||
volume_mounts: Union[Unset, list[dict[str, Any]]] = UNSET
|
||||
if not isinstance(self.volume_mounts, Unset):
|
||||
volume_mounts = []
|
||||
for volume_mounts_item_data in self.volume_mounts:
|
||||
volume_mounts_item = volume_mounts_item_data.to_dict()
|
||||
volume_mounts.append(volume_mounts_item)
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"clientID": client_id,
|
||||
"cpuCount": cpu_count,
|
||||
"diskSizeMB": disk_size_mb,
|
||||
"endAt": end_at,
|
||||
"envdVersion": envd_version,
|
||||
"memoryMB": memory_mb,
|
||||
"sandboxID": sandbox_id,
|
||||
"startedAt": started_at,
|
||||
"state": state,
|
||||
"templateID": template_id,
|
||||
}
|
||||
)
|
||||
if alias is not UNSET:
|
||||
field_dict["alias"] = alias
|
||||
if metadata is not UNSET:
|
||||
field_dict["metadata"] = metadata
|
||||
if volume_mounts is not UNSET:
|
||||
field_dict["volumeMounts"] = volume_mounts
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.sandbox_volume_mount import SandboxVolumeMount
|
||||
|
||||
d = dict(src_dict)
|
||||
client_id = d.pop("clientID")
|
||||
|
||||
cpu_count = d.pop("cpuCount")
|
||||
|
||||
disk_size_mb = d.pop("diskSizeMB")
|
||||
|
||||
end_at = isoparse(d.pop("endAt"))
|
||||
|
||||
envd_version = d.pop("envdVersion")
|
||||
|
||||
memory_mb = d.pop("memoryMB")
|
||||
|
||||
sandbox_id = d.pop("sandboxID")
|
||||
|
||||
started_at = isoparse(d.pop("startedAt"))
|
||||
|
||||
state = SandboxState(d.pop("state"))
|
||||
|
||||
template_id = d.pop("templateID")
|
||||
|
||||
alias = d.pop("alias", UNSET)
|
||||
|
||||
metadata = d.pop("metadata", UNSET)
|
||||
|
||||
volume_mounts = []
|
||||
_volume_mounts = d.pop("volumeMounts", UNSET)
|
||||
for volume_mounts_item_data in _volume_mounts or []:
|
||||
volume_mounts_item = SandboxVolumeMount.from_dict(volume_mounts_item_data)
|
||||
|
||||
volume_mounts.append(volume_mounts_item)
|
||||
|
||||
listed_sandbox = cls(
|
||||
client_id=client_id,
|
||||
cpu_count=cpu_count,
|
||||
disk_size_mb=disk_size_mb,
|
||||
end_at=end_at,
|
||||
envd_version=envd_version,
|
||||
memory_mb=memory_mb,
|
||||
sandbox_id=sandbox_id,
|
||||
started_at=started_at,
|
||||
state=state,
|
||||
template_id=template_id,
|
||||
alias=alias,
|
||||
metadata=metadata,
|
||||
volume_mounts=volume_mounts,
|
||||
)
|
||||
|
||||
listed_sandbox.additional_properties = d
|
||||
return listed_sandbox
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,11 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class LogLevel(str, Enum):
|
||||
DEBUG = "debug"
|
||||
ERROR = "error"
|
||||
INFO = "info"
|
||||
WARN = "warn"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
||||
@@ -0,0 +1,9 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class LogsDirection(str, Enum):
|
||||
BACKWARD = "backward"
|
||||
FORWARD = "forward"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
||||
@@ -0,0 +1,9 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class LogsSource(str, Enum):
|
||||
PERSISTENT = "persistent"
|
||||
TEMPORARY = "temporary"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
||||
@@ -0,0 +1,83 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="MachineInfo")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class MachineInfo:
|
||||
"""
|
||||
Attributes:
|
||||
cpu_architecture (str): CPU architecture of the node
|
||||
cpu_family (str): CPU family of the node
|
||||
cpu_model (str): CPU model of the node
|
||||
cpu_model_name (str): CPU model name of the node
|
||||
"""
|
||||
|
||||
cpu_architecture: str
|
||||
cpu_family: str
|
||||
cpu_model: str
|
||||
cpu_model_name: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
cpu_architecture = self.cpu_architecture
|
||||
|
||||
cpu_family = self.cpu_family
|
||||
|
||||
cpu_model = self.cpu_model
|
||||
|
||||
cpu_model_name = self.cpu_model_name
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"cpuArchitecture": cpu_architecture,
|
||||
"cpuFamily": cpu_family,
|
||||
"cpuModel": cpu_model,
|
||||
"cpuModelName": cpu_model_name,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
cpu_architecture = d.pop("cpuArchitecture")
|
||||
|
||||
cpu_family = d.pop("cpuFamily")
|
||||
|
||||
cpu_model = d.pop("cpuModel")
|
||||
|
||||
cpu_model_name = d.pop("cpuModelName")
|
||||
|
||||
machine_info = cls(
|
||||
cpu_architecture=cpu_architecture,
|
||||
cpu_family=cpu_family,
|
||||
cpu_model=cpu_model,
|
||||
cpu_model_name=cpu_model_name,
|
||||
)
|
||||
|
||||
machine_info.additional_properties = d
|
||||
return machine_info
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,78 @@
|
||||
import datetime
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
T = TypeVar("T", bound="MaxTeamMetric")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class MaxTeamMetric:
|
||||
"""Team metric with timestamp
|
||||
|
||||
Attributes:
|
||||
timestamp (datetime.datetime): Timestamp of the metric entry
|
||||
timestamp_unix (int): Timestamp of the metric entry in Unix time (seconds since epoch)
|
||||
value (float): The maximum value of the requested metric in the given interval
|
||||
"""
|
||||
|
||||
timestamp: datetime.datetime
|
||||
timestamp_unix: int
|
||||
value: float
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
timestamp = self.timestamp.isoformat()
|
||||
|
||||
timestamp_unix = self.timestamp_unix
|
||||
|
||||
value = self.value
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"timestamp": timestamp,
|
||||
"timestampUnix": timestamp_unix,
|
||||
"value": value,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
timestamp = isoparse(d.pop("timestamp"))
|
||||
|
||||
timestamp_unix = d.pop("timestampUnix")
|
||||
|
||||
value = d.pop("value")
|
||||
|
||||
max_team_metric = cls(
|
||||
timestamp=timestamp,
|
||||
timestamp_unix=timestamp_unix,
|
||||
value=value,
|
||||
)
|
||||
|
||||
max_team_metric.additional_properties = d
|
||||
return max_team_metric
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,44 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="McpType0")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class McpType0:
|
||||
"""MCP configuration for the sandbox"""
|
||||
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
mcp_type_0 = cls()
|
||||
|
||||
mcp_type_0.additional_properties = d
|
||||
return mcp_type_0
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,59 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="NewAccessToken")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class NewAccessToken:
|
||||
"""
|
||||
Attributes:
|
||||
name (str): Name of the access token
|
||||
"""
|
||||
|
||||
name: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
name = self.name
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"name": name,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
name = d.pop("name")
|
||||
|
||||
new_access_token = cls(
|
||||
name=name,
|
||||
)
|
||||
|
||||
new_access_token.additional_properties = d
|
||||
return new_access_token
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,224 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.mcp_type_0 import McpType0
|
||||
from ..models.sandbox_auto_resume_config import SandboxAutoResumeConfig
|
||||
from ..models.sandbox_network_config import SandboxNetworkConfig
|
||||
from ..models.sandbox_volume_mount import SandboxVolumeMount
|
||||
|
||||
|
||||
T = TypeVar("T", bound="NewSandbox")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class NewSandbox:
|
||||
"""
|
||||
Attributes:
|
||||
template_id (str): Identifier of the required template
|
||||
allow_internet_access (Union[Unset, bool]): Allow sandbox to access the internet. When set to false, it behaves
|
||||
the same as specifying denyOut to 0.0.0.0/0 in the network config.
|
||||
auto_pause (Union[Unset, bool]): Automatically pauses the sandbox after the timeout Default: False.
|
||||
auto_pause_memory (Union[Unset, bool]): Controls the snapshot kind taken when the sandbox auto-pauses on timeout
|
||||
(only relevant when autoPause is true). When false, the auto-pause drops the in-memory state and persists only
|
||||
the filesystem (a filesystem-only snapshot); resuming it cold-boots (reboots) the sandbox from disk. Such a
|
||||
snapshot cannot be auto-resumed by traffic and must be resumed explicitly, so it cannot be combined with
|
||||
autoResume. Defaults to true (full memory snapshot). Default: True.
|
||||
auto_resume (Union[Unset, SandboxAutoResumeConfig]): Auto-resume configuration for paused sandboxes.
|
||||
env_vars (Union[Unset, Any]):
|
||||
mcp (Union['McpType0', None, Unset]): MCP configuration for the sandbox
|
||||
metadata (Union[Unset, Any]):
|
||||
network (Union[Unset, SandboxNetworkConfig]):
|
||||
secure (Union[Unset, bool]): Secure all system communication with sandbox
|
||||
timeout (Union[Unset, int]): Time to live for the sandbox in seconds. Default: 15.
|
||||
volume_mounts (Union[Unset, list['SandboxVolumeMount']]):
|
||||
"""
|
||||
|
||||
template_id: str
|
||||
allow_internet_access: Union[Unset, bool] = UNSET
|
||||
auto_pause: Union[Unset, bool] = False
|
||||
auto_pause_memory: Union[Unset, bool] = True
|
||||
auto_resume: Union[Unset, "SandboxAutoResumeConfig"] = UNSET
|
||||
env_vars: Union[Unset, Any] = UNSET
|
||||
mcp: Union["McpType0", None, Unset] = UNSET
|
||||
metadata: Union[Unset, Any] = UNSET
|
||||
network: Union[Unset, "SandboxNetworkConfig"] = UNSET
|
||||
secure: Union[Unset, bool] = UNSET
|
||||
timeout: Union[Unset, int] = 15
|
||||
volume_mounts: Union[Unset, list["SandboxVolumeMount"]] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.mcp_type_0 import McpType0
|
||||
|
||||
template_id = self.template_id
|
||||
|
||||
allow_internet_access = self.allow_internet_access
|
||||
|
||||
auto_pause = self.auto_pause
|
||||
|
||||
auto_pause_memory = self.auto_pause_memory
|
||||
|
||||
auto_resume: Union[Unset, dict[str, Any]] = UNSET
|
||||
if not isinstance(self.auto_resume, Unset):
|
||||
auto_resume = self.auto_resume.to_dict()
|
||||
|
||||
env_vars = self.env_vars
|
||||
|
||||
mcp: Union[None, Unset, dict[str, Any]]
|
||||
if isinstance(self.mcp, Unset):
|
||||
mcp = UNSET
|
||||
elif isinstance(self.mcp, McpType0):
|
||||
mcp = self.mcp.to_dict()
|
||||
else:
|
||||
mcp = self.mcp
|
||||
|
||||
metadata = self.metadata
|
||||
|
||||
network: Union[Unset, dict[str, Any]] = UNSET
|
||||
if not isinstance(self.network, Unset):
|
||||
network = self.network.to_dict()
|
||||
|
||||
secure = self.secure
|
||||
|
||||
timeout = self.timeout
|
||||
|
||||
volume_mounts: Union[Unset, list[dict[str, Any]]] = UNSET
|
||||
if not isinstance(self.volume_mounts, Unset):
|
||||
volume_mounts = []
|
||||
for volume_mounts_item_data in self.volume_mounts:
|
||||
volume_mounts_item = volume_mounts_item_data.to_dict()
|
||||
volume_mounts.append(volume_mounts_item)
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"templateID": template_id,
|
||||
}
|
||||
)
|
||||
if allow_internet_access is not UNSET:
|
||||
field_dict["allow_internet_access"] = allow_internet_access
|
||||
if auto_pause is not UNSET:
|
||||
field_dict["autoPause"] = auto_pause
|
||||
if auto_pause_memory is not UNSET:
|
||||
field_dict["autoPauseMemory"] = auto_pause_memory
|
||||
if auto_resume is not UNSET:
|
||||
field_dict["autoResume"] = auto_resume
|
||||
if env_vars is not UNSET:
|
||||
field_dict["envVars"] = env_vars
|
||||
if mcp is not UNSET:
|
||||
field_dict["mcp"] = mcp
|
||||
if metadata is not UNSET:
|
||||
field_dict["metadata"] = metadata
|
||||
if network is not UNSET:
|
||||
field_dict["network"] = network
|
||||
if secure is not UNSET:
|
||||
field_dict["secure"] = secure
|
||||
if timeout is not UNSET:
|
||||
field_dict["timeout"] = timeout
|
||||
if volume_mounts is not UNSET:
|
||||
field_dict["volumeMounts"] = volume_mounts
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.mcp_type_0 import McpType0
|
||||
from ..models.sandbox_auto_resume_config import SandboxAutoResumeConfig
|
||||
from ..models.sandbox_network_config import SandboxNetworkConfig
|
||||
from ..models.sandbox_volume_mount import SandboxVolumeMount
|
||||
|
||||
d = dict(src_dict)
|
||||
template_id = d.pop("templateID")
|
||||
|
||||
allow_internet_access = d.pop("allow_internet_access", UNSET)
|
||||
|
||||
auto_pause = d.pop("autoPause", UNSET)
|
||||
|
||||
auto_pause_memory = d.pop("autoPauseMemory", UNSET)
|
||||
|
||||
_auto_resume = d.pop("autoResume", UNSET)
|
||||
auto_resume: Union[Unset, SandboxAutoResumeConfig]
|
||||
if isinstance(_auto_resume, Unset):
|
||||
auto_resume = UNSET
|
||||
else:
|
||||
auto_resume = SandboxAutoResumeConfig.from_dict(_auto_resume)
|
||||
|
||||
env_vars = d.pop("envVars", UNSET)
|
||||
|
||||
def _parse_mcp(data: object) -> Union["McpType0", None, Unset]:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
componentsschemas_mcp_type_0 = McpType0.from_dict(data)
|
||||
|
||||
return componentsschemas_mcp_type_0
|
||||
except: # noqa: E722
|
||||
pass
|
||||
return cast(Union["McpType0", None, Unset], data)
|
||||
|
||||
mcp = _parse_mcp(d.pop("mcp", UNSET))
|
||||
|
||||
metadata = d.pop("metadata", UNSET)
|
||||
|
||||
_network = d.pop("network", UNSET)
|
||||
network: Union[Unset, SandboxNetworkConfig]
|
||||
if isinstance(_network, Unset):
|
||||
network = UNSET
|
||||
else:
|
||||
network = SandboxNetworkConfig.from_dict(_network)
|
||||
|
||||
secure = d.pop("secure", UNSET)
|
||||
|
||||
timeout = d.pop("timeout", UNSET)
|
||||
|
||||
volume_mounts = []
|
||||
_volume_mounts = d.pop("volumeMounts", UNSET)
|
||||
for volume_mounts_item_data in _volume_mounts or []:
|
||||
volume_mounts_item = SandboxVolumeMount.from_dict(volume_mounts_item_data)
|
||||
|
||||
volume_mounts.append(volume_mounts_item)
|
||||
|
||||
new_sandbox = cls(
|
||||
template_id=template_id,
|
||||
allow_internet_access=allow_internet_access,
|
||||
auto_pause=auto_pause,
|
||||
auto_pause_memory=auto_pause_memory,
|
||||
auto_resume=auto_resume,
|
||||
env_vars=env_vars,
|
||||
mcp=mcp,
|
||||
metadata=metadata,
|
||||
network=network,
|
||||
secure=secure,
|
||||
timeout=timeout,
|
||||
volume_mounts=volume_mounts,
|
||||
)
|
||||
|
||||
new_sandbox.additional_properties = d
|
||||
return new_sandbox
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,59 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="NewTeamAPIKey")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class NewTeamAPIKey:
|
||||
"""
|
||||
Attributes:
|
||||
name (str): Name of the API key
|
||||
"""
|
||||
|
||||
name: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
name = self.name
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"name": name,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
name = d.pop("name")
|
||||
|
||||
new_team_api_key = cls(
|
||||
name=name,
|
||||
)
|
||||
|
||||
new_team_api_key.additional_properties = d
|
||||
return new_team_api_key
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,59 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="NewVolume")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class NewVolume:
|
||||
"""
|
||||
Attributes:
|
||||
name (str): Name of the volume
|
||||
"""
|
||||
|
||||
name: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
name = self.name
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"name": name,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
name = d.pop("name")
|
||||
|
||||
new_volume = cls(
|
||||
name=name,
|
||||
)
|
||||
|
||||
new_volume.additional_properties = d
|
||||
return new_volume
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..models.node_status import NodeStatus
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.machine_info import MachineInfo
|
||||
from ..models.node_metrics import NodeMetrics
|
||||
|
||||
|
||||
T = TypeVar("T", bound="Node")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class Node:
|
||||
"""
|
||||
Attributes:
|
||||
cluster_id (str): Identifier of the cluster
|
||||
commit (str): Commit of the orchestrator
|
||||
create_fails (int): Number of sandbox create fails
|
||||
create_successes (int): Number of sandbox create successes
|
||||
id (str): Identifier of the node
|
||||
machine_info (MachineInfo):
|
||||
metrics (NodeMetrics): Node metrics
|
||||
sandbox_count (int): Number of sandboxes running on the node
|
||||
sandbox_starting_count (int): Number of starting Sandboxes
|
||||
service_instance_id (str): Service instance identifier of the node
|
||||
status (NodeStatus): Status of the node.
|
||||
- draining: the node is bound to be shut down. It will not accept new sandboxes and will stop once all existing
|
||||
sandboxes are done.
|
||||
- standby: the node is not actively used, but it can return to ready and continue serving traffic.
|
||||
version (str): Version of the orchestrator
|
||||
"""
|
||||
|
||||
cluster_id: str
|
||||
commit: str
|
||||
create_fails: int
|
||||
create_successes: int
|
||||
id: str
|
||||
machine_info: "MachineInfo"
|
||||
metrics: "NodeMetrics"
|
||||
sandbox_count: int
|
||||
sandbox_starting_count: int
|
||||
service_instance_id: str
|
||||
status: NodeStatus
|
||||
version: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
cluster_id = self.cluster_id
|
||||
|
||||
commit = self.commit
|
||||
|
||||
create_fails = self.create_fails
|
||||
|
||||
create_successes = self.create_successes
|
||||
|
||||
id = self.id
|
||||
|
||||
machine_info = self.machine_info.to_dict()
|
||||
|
||||
metrics = self.metrics.to_dict()
|
||||
|
||||
sandbox_count = self.sandbox_count
|
||||
|
||||
sandbox_starting_count = self.sandbox_starting_count
|
||||
|
||||
service_instance_id = self.service_instance_id
|
||||
|
||||
status = self.status.value
|
||||
|
||||
version = self.version
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"clusterID": cluster_id,
|
||||
"commit": commit,
|
||||
"createFails": create_fails,
|
||||
"createSuccesses": create_successes,
|
||||
"id": id,
|
||||
"machineInfo": machine_info,
|
||||
"metrics": metrics,
|
||||
"sandboxCount": sandbox_count,
|
||||
"sandboxStartingCount": sandbox_starting_count,
|
||||
"serviceInstanceID": service_instance_id,
|
||||
"status": status,
|
||||
"version": version,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.machine_info import MachineInfo
|
||||
from ..models.node_metrics import NodeMetrics
|
||||
|
||||
d = dict(src_dict)
|
||||
cluster_id = d.pop("clusterID")
|
||||
|
||||
commit = d.pop("commit")
|
||||
|
||||
create_fails = d.pop("createFails")
|
||||
|
||||
create_successes = d.pop("createSuccesses")
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
machine_info = MachineInfo.from_dict(d.pop("machineInfo"))
|
||||
|
||||
metrics = NodeMetrics.from_dict(d.pop("metrics"))
|
||||
|
||||
sandbox_count = d.pop("sandboxCount")
|
||||
|
||||
sandbox_starting_count = d.pop("sandboxStartingCount")
|
||||
|
||||
service_instance_id = d.pop("serviceInstanceID")
|
||||
|
||||
status = NodeStatus(d.pop("status"))
|
||||
|
||||
version = d.pop("version")
|
||||
|
||||
node = cls(
|
||||
cluster_id=cluster_id,
|
||||
commit=commit,
|
||||
create_fails=create_fails,
|
||||
create_successes=create_successes,
|
||||
id=id,
|
||||
machine_info=machine_info,
|
||||
metrics=metrics,
|
||||
sandbox_count=sandbox_count,
|
||||
sandbox_starting_count=sandbox_starting_count,
|
||||
service_instance_id=service_instance_id,
|
||||
status=status,
|
||||
version=version,
|
||||
)
|
||||
|
||||
node.additional_properties = d
|
||||
return node
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,160 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..models.node_status import NodeStatus
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.machine_info import MachineInfo
|
||||
from ..models.node_metrics import NodeMetrics
|
||||
|
||||
|
||||
T = TypeVar("T", bound="NodeDetail")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class NodeDetail:
|
||||
"""
|
||||
Attributes:
|
||||
cached_builds (list[str]): List of cached builds id on the node
|
||||
cluster_id (str): Identifier of the cluster
|
||||
commit (str): Commit of the orchestrator
|
||||
create_fails (int): Number of sandbox create fails
|
||||
create_successes (int): Number of sandbox create successes
|
||||
id (str): Identifier of the node
|
||||
machine_info (MachineInfo):
|
||||
metrics (NodeMetrics): Node metrics
|
||||
sandbox_count (int): Number of sandboxes running on the node
|
||||
service_instance_id (str): Service instance identifier of the node
|
||||
status (NodeStatus): Status of the node.
|
||||
- draining: the node is bound to be shut down. It will not accept new sandboxes and will stop once all existing
|
||||
sandboxes are done.
|
||||
- standby: the node is not actively used, but it can return to ready and continue serving traffic.
|
||||
version (str): Version of the orchestrator
|
||||
"""
|
||||
|
||||
cached_builds: list[str]
|
||||
cluster_id: str
|
||||
commit: str
|
||||
create_fails: int
|
||||
create_successes: int
|
||||
id: str
|
||||
machine_info: "MachineInfo"
|
||||
metrics: "NodeMetrics"
|
||||
sandbox_count: int
|
||||
service_instance_id: str
|
||||
status: NodeStatus
|
||||
version: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
cached_builds = self.cached_builds
|
||||
|
||||
cluster_id = self.cluster_id
|
||||
|
||||
commit = self.commit
|
||||
|
||||
create_fails = self.create_fails
|
||||
|
||||
create_successes = self.create_successes
|
||||
|
||||
id = self.id
|
||||
|
||||
machine_info = self.machine_info.to_dict()
|
||||
|
||||
metrics = self.metrics.to_dict()
|
||||
|
||||
sandbox_count = self.sandbox_count
|
||||
|
||||
service_instance_id = self.service_instance_id
|
||||
|
||||
status = self.status.value
|
||||
|
||||
version = self.version
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"cachedBuilds": cached_builds,
|
||||
"clusterID": cluster_id,
|
||||
"commit": commit,
|
||||
"createFails": create_fails,
|
||||
"createSuccesses": create_successes,
|
||||
"id": id,
|
||||
"machineInfo": machine_info,
|
||||
"metrics": metrics,
|
||||
"sandboxCount": sandbox_count,
|
||||
"serviceInstanceID": service_instance_id,
|
||||
"status": status,
|
||||
"version": version,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.machine_info import MachineInfo
|
||||
from ..models.node_metrics import NodeMetrics
|
||||
|
||||
d = dict(src_dict)
|
||||
cached_builds = cast(list[str], d.pop("cachedBuilds"))
|
||||
|
||||
cluster_id = d.pop("clusterID")
|
||||
|
||||
commit = d.pop("commit")
|
||||
|
||||
create_fails = d.pop("createFails")
|
||||
|
||||
create_successes = d.pop("createSuccesses")
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
machine_info = MachineInfo.from_dict(d.pop("machineInfo"))
|
||||
|
||||
metrics = NodeMetrics.from_dict(d.pop("metrics"))
|
||||
|
||||
sandbox_count = d.pop("sandboxCount")
|
||||
|
||||
service_instance_id = d.pop("serviceInstanceID")
|
||||
|
||||
status = NodeStatus(d.pop("status"))
|
||||
|
||||
version = d.pop("version")
|
||||
|
||||
node_detail = cls(
|
||||
cached_builds=cached_builds,
|
||||
cluster_id=cluster_id,
|
||||
commit=commit,
|
||||
create_fails=create_fails,
|
||||
create_successes=create_successes,
|
||||
id=id,
|
||||
machine_info=machine_info,
|
||||
metrics=metrics,
|
||||
sandbox_count=sandbox_count,
|
||||
service_instance_id=service_instance_id,
|
||||
status=status,
|
||||
version=version,
|
||||
)
|
||||
|
||||
node_detail.additional_properties = d
|
||||
return node_detail
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,122 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.disk_metrics import DiskMetrics
|
||||
|
||||
|
||||
T = TypeVar("T", bound="NodeMetrics")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class NodeMetrics:
|
||||
"""Node metrics
|
||||
|
||||
Attributes:
|
||||
allocated_cpu (int): Number of allocated CPU cores
|
||||
allocated_memory_bytes (int): Amount of allocated memory in bytes
|
||||
cpu_count (int): Total number of CPU cores on the node
|
||||
cpu_percent (int): Node CPU usage percentage
|
||||
disks (list['DiskMetrics']): Detailed metrics for each disk/mount point
|
||||
memory_total_bytes (int): Total node memory in bytes
|
||||
memory_used_bytes (int): Node memory used in bytes
|
||||
"""
|
||||
|
||||
allocated_cpu: int
|
||||
allocated_memory_bytes: int
|
||||
cpu_count: int
|
||||
cpu_percent: int
|
||||
disks: list["DiskMetrics"]
|
||||
memory_total_bytes: int
|
||||
memory_used_bytes: int
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
allocated_cpu = self.allocated_cpu
|
||||
|
||||
allocated_memory_bytes = self.allocated_memory_bytes
|
||||
|
||||
cpu_count = self.cpu_count
|
||||
|
||||
cpu_percent = self.cpu_percent
|
||||
|
||||
disks = []
|
||||
for disks_item_data in self.disks:
|
||||
disks_item = disks_item_data.to_dict()
|
||||
disks.append(disks_item)
|
||||
|
||||
memory_total_bytes = self.memory_total_bytes
|
||||
|
||||
memory_used_bytes = self.memory_used_bytes
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"allocatedCPU": allocated_cpu,
|
||||
"allocatedMemoryBytes": allocated_memory_bytes,
|
||||
"cpuCount": cpu_count,
|
||||
"cpuPercent": cpu_percent,
|
||||
"disks": disks,
|
||||
"memoryTotalBytes": memory_total_bytes,
|
||||
"memoryUsedBytes": memory_used_bytes,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.disk_metrics import DiskMetrics
|
||||
|
||||
d = dict(src_dict)
|
||||
allocated_cpu = d.pop("allocatedCPU")
|
||||
|
||||
allocated_memory_bytes = d.pop("allocatedMemoryBytes")
|
||||
|
||||
cpu_count = d.pop("cpuCount")
|
||||
|
||||
cpu_percent = d.pop("cpuPercent")
|
||||
|
||||
disks = []
|
||||
_disks = d.pop("disks")
|
||||
for disks_item_data in _disks:
|
||||
disks_item = DiskMetrics.from_dict(disks_item_data)
|
||||
|
||||
disks.append(disks_item)
|
||||
|
||||
memory_total_bytes = d.pop("memoryTotalBytes")
|
||||
|
||||
memory_used_bytes = d.pop("memoryUsedBytes")
|
||||
|
||||
node_metrics = cls(
|
||||
allocated_cpu=allocated_cpu,
|
||||
allocated_memory_bytes=allocated_memory_bytes,
|
||||
cpu_count=cpu_count,
|
||||
cpu_percent=cpu_percent,
|
||||
disks=disks,
|
||||
memory_total_bytes=memory_total_bytes,
|
||||
memory_used_bytes=memory_used_bytes,
|
||||
)
|
||||
|
||||
node_metrics.additional_properties = d
|
||||
return node_metrics
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,12 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class NodeStatus(str, Enum):
|
||||
CONNECTING = "connecting"
|
||||
DRAINING = "draining"
|
||||
READY = "ready"
|
||||
STANDBY = "standby"
|
||||
UNHEALTHY = "unhealthy"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
||||
@@ -0,0 +1,82 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, Union
|
||||
from uuid import UUID
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..models.node_status import NodeStatus
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="NodeStatusChange")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class NodeStatusChange:
|
||||
"""
|
||||
Attributes:
|
||||
status (NodeStatus): Status of the node.
|
||||
- draining: the node is bound to be shut down. It will not accept new sandboxes and will stop once all existing
|
||||
sandboxes are done.
|
||||
- standby: the node is not actively used, but it can return to ready and continue serving traffic.
|
||||
cluster_id (Union[Unset, UUID]): Identifier of the cluster
|
||||
"""
|
||||
|
||||
status: NodeStatus
|
||||
cluster_id: Union[Unset, UUID] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
status = self.status.value
|
||||
|
||||
cluster_id: Union[Unset, str] = UNSET
|
||||
if not isinstance(self.cluster_id, Unset):
|
||||
cluster_id = str(self.cluster_id)
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"status": status,
|
||||
}
|
||||
)
|
||||
if cluster_id is not UNSET:
|
||||
field_dict["clusterID"] = cluster_id
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
status = NodeStatus(d.pop("status"))
|
||||
|
||||
_cluster_id = d.pop("clusterID", UNSET)
|
||||
cluster_id: Union[Unset, UUID]
|
||||
if isinstance(_cluster_id, Unset):
|
||||
cluster_id = UNSET
|
||||
else:
|
||||
cluster_id = UUID(_cluster_id)
|
||||
|
||||
node_status_change = cls(
|
||||
status=status,
|
||||
cluster_id=cluster_id,
|
||||
)
|
||||
|
||||
node_status_change.additional_properties = d
|
||||
return node_status_change
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, Union
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="PostSandboxesSandboxIDRefreshesBody")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class PostSandboxesSandboxIDRefreshesBody:
|
||||
"""
|
||||
Attributes:
|
||||
duration (Union[Unset, int]): Duration for which the sandbox should be kept alive in seconds
|
||||
"""
|
||||
|
||||
duration: Union[Unset, int] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
duration = self.duration
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if duration is not UNSET:
|
||||
field_dict["duration"] = duration
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
duration = d.pop("duration", UNSET)
|
||||
|
||||
post_sandboxes_sandbox_id_refreshes_body = cls(
|
||||
duration=duration,
|
||||
)
|
||||
|
||||
post_sandboxes_sandbox_id_refreshes_body.additional_properties = d
|
||||
return post_sandboxes_sandbox_id_refreshes_body
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, Union
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="PostSandboxesSandboxIDSnapshotsBody")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class PostSandboxesSandboxIDSnapshotsBody:
|
||||
"""
|
||||
Attributes:
|
||||
name (Union[Unset, str]): Optional name for the snapshot template. If a snapshot template with this name already
|
||||
exists, a new build will be assigned to the existing template instead of creating a new one.
|
||||
"""
|
||||
|
||||
name: Union[Unset, str] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
name = self.name
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if name is not UNSET:
|
||||
field_dict["name"] = name
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
name = d.pop("name", UNSET)
|
||||
|
||||
post_sandboxes_sandbox_id_snapshots_body = cls(
|
||||
name=name,
|
||||
)
|
||||
|
||||
post_sandboxes_sandbox_id_snapshots_body.additional_properties = d
|
||||
return post_sandboxes_sandbox_id_snapshots_body
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="PostSandboxesSandboxIDTimeoutBody")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class PostSandboxesSandboxIDTimeoutBody:
|
||||
"""
|
||||
Attributes:
|
||||
timeout (int): Timeout in seconds from the current time after which the sandbox should expire
|
||||
"""
|
||||
|
||||
timeout: int
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
timeout = self.timeout
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"timeout": timeout,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
timeout = d.pop("timeout")
|
||||
|
||||
post_sandboxes_sandbox_id_timeout_body = cls(
|
||||
timeout=timeout,
|
||||
)
|
||||
|
||||
post_sandboxes_sandbox_id_timeout_body.additional_properties = d
|
||||
return post_sandboxes_sandbox_id_timeout_body
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,68 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, Union
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="ResumedSandbox")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ResumedSandbox:
|
||||
"""
|
||||
Attributes:
|
||||
auto_pause (Union[Unset, bool]): Automatically pauses the sandbox after the timeout
|
||||
timeout (Union[Unset, int]): Time to live for the sandbox in seconds. Default: 15.
|
||||
"""
|
||||
|
||||
auto_pause: Union[Unset, bool] = UNSET
|
||||
timeout: Union[Unset, int] = 15
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
auto_pause = self.auto_pause
|
||||
|
||||
timeout = self.timeout
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if auto_pause is not UNSET:
|
||||
field_dict["autoPause"] = auto_pause
|
||||
if timeout is not UNSET:
|
||||
field_dict["timeout"] = timeout
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
auto_pause = d.pop("autoPause", UNSET)
|
||||
|
||||
timeout = d.pop("timeout", UNSET)
|
||||
|
||||
resumed_sandbox = cls(
|
||||
auto_pause=auto_pause,
|
||||
timeout=timeout,
|
||||
)
|
||||
|
||||
resumed_sandbox.additional_properties = d
|
||||
return resumed_sandbox
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, Union, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="Sandbox")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class Sandbox:
|
||||
"""
|
||||
Attributes:
|
||||
client_id (str): Identifier of the client
|
||||
envd_version (str): Version of the envd running in the sandbox
|
||||
sandbox_id (str): Identifier of the sandbox
|
||||
template_id (str): Identifier of the template from which is the sandbox created
|
||||
alias (Union[Unset, str]): Alias of the template
|
||||
domain (Union[None, Unset, str]): Base domain where the sandbox traffic is accessible
|
||||
envd_access_token (Union[Unset, str]): Access token used for envd communication
|
||||
traffic_access_token (Union[None, Unset, str]): Token required for accessing sandbox via proxy.
|
||||
"""
|
||||
|
||||
client_id: str
|
||||
envd_version: str
|
||||
sandbox_id: str
|
||||
template_id: str
|
||||
alias: Union[Unset, str] = UNSET
|
||||
domain: Union[None, Unset, str] = UNSET
|
||||
envd_access_token: Union[Unset, str] = UNSET
|
||||
traffic_access_token: Union[None, Unset, str] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
client_id = self.client_id
|
||||
|
||||
envd_version = self.envd_version
|
||||
|
||||
sandbox_id = self.sandbox_id
|
||||
|
||||
template_id = self.template_id
|
||||
|
||||
alias = self.alias
|
||||
|
||||
domain: Union[None, Unset, str]
|
||||
if isinstance(self.domain, Unset):
|
||||
domain = UNSET
|
||||
else:
|
||||
domain = self.domain
|
||||
|
||||
envd_access_token = self.envd_access_token
|
||||
|
||||
traffic_access_token: Union[None, Unset, str]
|
||||
if isinstance(self.traffic_access_token, Unset):
|
||||
traffic_access_token = UNSET
|
||||
else:
|
||||
traffic_access_token = self.traffic_access_token
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"clientID": client_id,
|
||||
"envdVersion": envd_version,
|
||||
"sandboxID": sandbox_id,
|
||||
"templateID": template_id,
|
||||
}
|
||||
)
|
||||
if alias is not UNSET:
|
||||
field_dict["alias"] = alias
|
||||
if domain is not UNSET:
|
||||
field_dict["domain"] = domain
|
||||
if envd_access_token is not UNSET:
|
||||
field_dict["envdAccessToken"] = envd_access_token
|
||||
if traffic_access_token is not UNSET:
|
||||
field_dict["trafficAccessToken"] = traffic_access_token
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
client_id = d.pop("clientID")
|
||||
|
||||
envd_version = d.pop("envdVersion")
|
||||
|
||||
sandbox_id = d.pop("sandboxID")
|
||||
|
||||
template_id = d.pop("templateID")
|
||||
|
||||
alias = d.pop("alias", UNSET)
|
||||
|
||||
def _parse_domain(data: object) -> Union[None, Unset, str]:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(Union[None, Unset, str], data)
|
||||
|
||||
domain = _parse_domain(d.pop("domain", UNSET))
|
||||
|
||||
envd_access_token = d.pop("envdAccessToken", UNSET)
|
||||
|
||||
def _parse_traffic_access_token(data: object) -> Union[None, Unset, str]:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(Union[None, Unset, str], data)
|
||||
|
||||
traffic_access_token = _parse_traffic_access_token(
|
||||
d.pop("trafficAccessToken", UNSET)
|
||||
)
|
||||
|
||||
sandbox = cls(
|
||||
client_id=client_id,
|
||||
envd_version=envd_version,
|
||||
sandbox_id=sandbox_id,
|
||||
template_id=template_id,
|
||||
alias=alias,
|
||||
domain=domain,
|
||||
envd_access_token=envd_access_token,
|
||||
traffic_access_token=traffic_access_token,
|
||||
)
|
||||
|
||||
sandbox.additional_properties = d
|
||||
return sandbox
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,60 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="SandboxAutoResumeConfig")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxAutoResumeConfig:
|
||||
"""Auto-resume configuration for paused sandboxes.
|
||||
|
||||
Attributes:
|
||||
enabled (bool): Auto-resume enabled flag for paused sandboxes. Default false.
|
||||
"""
|
||||
|
||||
enabled: bool
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
enabled = self.enabled
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"enabled": enabled,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
enabled = d.pop("enabled")
|
||||
|
||||
sandbox_auto_resume_config = cls(
|
||||
enabled=enabled,
|
||||
)
|
||||
|
||||
sandbox_auto_resume_config.additional_properties = d
|
||||
return sandbox_auto_resume_config
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,267 @@
|
||||
import datetime
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
from ..models.sandbox_state import SandboxState
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.sandbox_lifecycle import SandboxLifecycle
|
||||
from ..models.sandbox_network_config import SandboxNetworkConfig
|
||||
from ..models.sandbox_volume_mount import SandboxVolumeMount
|
||||
|
||||
|
||||
T = TypeVar("T", bound="SandboxDetail")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxDetail:
|
||||
"""
|
||||
Attributes:
|
||||
client_id (str): Identifier of the client
|
||||
cpu_count (int): CPU cores for the sandbox
|
||||
disk_size_mb (int): Disk size for the sandbox in MiB
|
||||
end_at (datetime.datetime): Time when the sandbox will expire
|
||||
envd_version (str): Version of the envd running in the sandbox
|
||||
memory_mb (int): Memory for the sandbox in MiB
|
||||
sandbox_id (str): Identifier of the sandbox
|
||||
started_at (datetime.datetime): Time when the sandbox was started
|
||||
state (SandboxState): State of the sandbox
|
||||
template_id (str): Identifier of the template from which is the sandbox created
|
||||
alias (Union[Unset, str]): Alias of the template
|
||||
allow_internet_access (Union[None, Unset, bool]): Whether internet access was explicitly enabled or disabled for
|
||||
the sandbox. Null means it was not explicitly set.
|
||||
domain (Union[None, Unset, str]): Base domain where the sandbox traffic is accessible
|
||||
envd_access_token (Union[Unset, str]): Access token used for envd communication
|
||||
lifecycle (Union[Unset, SandboxLifecycle]): Sandbox lifecycle policy returned by sandbox info.
|
||||
metadata (Union[Unset, Any]):
|
||||
network (Union[Unset, SandboxNetworkConfig]):
|
||||
volume_mounts (Union[Unset, list['SandboxVolumeMount']]):
|
||||
"""
|
||||
|
||||
client_id: str
|
||||
cpu_count: int
|
||||
disk_size_mb: int
|
||||
end_at: datetime.datetime
|
||||
envd_version: str
|
||||
memory_mb: int
|
||||
sandbox_id: str
|
||||
started_at: datetime.datetime
|
||||
state: SandboxState
|
||||
template_id: str
|
||||
alias: Union[Unset, str] = UNSET
|
||||
allow_internet_access: Union[None, Unset, bool] = UNSET
|
||||
domain: Union[None, Unset, str] = UNSET
|
||||
envd_access_token: Union[Unset, str] = UNSET
|
||||
lifecycle: Union[Unset, "SandboxLifecycle"] = UNSET
|
||||
metadata: Union[Unset, Any] = UNSET
|
||||
network: Union[Unset, "SandboxNetworkConfig"] = UNSET
|
||||
volume_mounts: Union[Unset, list["SandboxVolumeMount"]] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
client_id = self.client_id
|
||||
|
||||
cpu_count = self.cpu_count
|
||||
|
||||
disk_size_mb = self.disk_size_mb
|
||||
|
||||
end_at = self.end_at.isoformat()
|
||||
|
||||
envd_version = self.envd_version
|
||||
|
||||
memory_mb = self.memory_mb
|
||||
|
||||
sandbox_id = self.sandbox_id
|
||||
|
||||
started_at = self.started_at.isoformat()
|
||||
|
||||
state = self.state.value
|
||||
|
||||
template_id = self.template_id
|
||||
|
||||
alias = self.alias
|
||||
|
||||
allow_internet_access: Union[None, Unset, bool]
|
||||
if isinstance(self.allow_internet_access, Unset):
|
||||
allow_internet_access = UNSET
|
||||
else:
|
||||
allow_internet_access = self.allow_internet_access
|
||||
|
||||
domain: Union[None, Unset, str]
|
||||
if isinstance(self.domain, Unset):
|
||||
domain = UNSET
|
||||
else:
|
||||
domain = self.domain
|
||||
|
||||
envd_access_token = self.envd_access_token
|
||||
|
||||
lifecycle: Union[Unset, dict[str, Any]] = UNSET
|
||||
if not isinstance(self.lifecycle, Unset):
|
||||
lifecycle = self.lifecycle.to_dict()
|
||||
|
||||
metadata = self.metadata
|
||||
|
||||
network: Union[Unset, dict[str, Any]] = UNSET
|
||||
if not isinstance(self.network, Unset):
|
||||
network = self.network.to_dict()
|
||||
|
||||
volume_mounts: Union[Unset, list[dict[str, Any]]] = UNSET
|
||||
if not isinstance(self.volume_mounts, Unset):
|
||||
volume_mounts = []
|
||||
for volume_mounts_item_data in self.volume_mounts:
|
||||
volume_mounts_item = volume_mounts_item_data.to_dict()
|
||||
volume_mounts.append(volume_mounts_item)
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"clientID": client_id,
|
||||
"cpuCount": cpu_count,
|
||||
"diskSizeMB": disk_size_mb,
|
||||
"endAt": end_at,
|
||||
"envdVersion": envd_version,
|
||||
"memoryMB": memory_mb,
|
||||
"sandboxID": sandbox_id,
|
||||
"startedAt": started_at,
|
||||
"state": state,
|
||||
"templateID": template_id,
|
||||
}
|
||||
)
|
||||
if alias is not UNSET:
|
||||
field_dict["alias"] = alias
|
||||
if allow_internet_access is not UNSET:
|
||||
field_dict["allowInternetAccess"] = allow_internet_access
|
||||
if domain is not UNSET:
|
||||
field_dict["domain"] = domain
|
||||
if envd_access_token is not UNSET:
|
||||
field_dict["envdAccessToken"] = envd_access_token
|
||||
if lifecycle is not UNSET:
|
||||
field_dict["lifecycle"] = lifecycle
|
||||
if metadata is not UNSET:
|
||||
field_dict["metadata"] = metadata
|
||||
if network is not UNSET:
|
||||
field_dict["network"] = network
|
||||
if volume_mounts is not UNSET:
|
||||
field_dict["volumeMounts"] = volume_mounts
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.sandbox_lifecycle import SandboxLifecycle
|
||||
from ..models.sandbox_network_config import SandboxNetworkConfig
|
||||
from ..models.sandbox_volume_mount import SandboxVolumeMount
|
||||
|
||||
d = dict(src_dict)
|
||||
client_id = d.pop("clientID")
|
||||
|
||||
cpu_count = d.pop("cpuCount")
|
||||
|
||||
disk_size_mb = d.pop("diskSizeMB")
|
||||
|
||||
end_at = isoparse(d.pop("endAt"))
|
||||
|
||||
envd_version = d.pop("envdVersion")
|
||||
|
||||
memory_mb = d.pop("memoryMB")
|
||||
|
||||
sandbox_id = d.pop("sandboxID")
|
||||
|
||||
started_at = isoparse(d.pop("startedAt"))
|
||||
|
||||
state = SandboxState(d.pop("state"))
|
||||
|
||||
template_id = d.pop("templateID")
|
||||
|
||||
alias = d.pop("alias", UNSET)
|
||||
|
||||
def _parse_allow_internet_access(data: object) -> Union[None, Unset, bool]:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(Union[None, Unset, bool], data)
|
||||
|
||||
allow_internet_access = _parse_allow_internet_access(
|
||||
d.pop("allowInternetAccess", UNSET)
|
||||
)
|
||||
|
||||
def _parse_domain(data: object) -> Union[None, Unset, str]:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(Union[None, Unset, str], data)
|
||||
|
||||
domain = _parse_domain(d.pop("domain", UNSET))
|
||||
|
||||
envd_access_token = d.pop("envdAccessToken", UNSET)
|
||||
|
||||
_lifecycle = d.pop("lifecycle", UNSET)
|
||||
lifecycle: Union[Unset, SandboxLifecycle]
|
||||
if isinstance(_lifecycle, Unset):
|
||||
lifecycle = UNSET
|
||||
else:
|
||||
lifecycle = SandboxLifecycle.from_dict(_lifecycle)
|
||||
|
||||
metadata = d.pop("metadata", UNSET)
|
||||
|
||||
_network = d.pop("network", UNSET)
|
||||
network: Union[Unset, SandboxNetworkConfig]
|
||||
if isinstance(_network, Unset):
|
||||
network = UNSET
|
||||
else:
|
||||
network = SandboxNetworkConfig.from_dict(_network)
|
||||
|
||||
volume_mounts = []
|
||||
_volume_mounts = d.pop("volumeMounts", UNSET)
|
||||
for volume_mounts_item_data in _volume_mounts or []:
|
||||
volume_mounts_item = SandboxVolumeMount.from_dict(volume_mounts_item_data)
|
||||
|
||||
volume_mounts.append(volume_mounts_item)
|
||||
|
||||
sandbox_detail = cls(
|
||||
client_id=client_id,
|
||||
cpu_count=cpu_count,
|
||||
disk_size_mb=disk_size_mb,
|
||||
end_at=end_at,
|
||||
envd_version=envd_version,
|
||||
memory_mb=memory_mb,
|
||||
sandbox_id=sandbox_id,
|
||||
started_at=started_at,
|
||||
state=state,
|
||||
template_id=template_id,
|
||||
alias=alias,
|
||||
allow_internet_access=allow_internet_access,
|
||||
domain=domain,
|
||||
envd_access_token=envd_access_token,
|
||||
lifecycle=lifecycle,
|
||||
metadata=metadata,
|
||||
network=network,
|
||||
volume_mounts=volume_mounts,
|
||||
)
|
||||
|
||||
sandbox_detail.additional_properties = d
|
||||
return sandbox_detail
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,70 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..models.sandbox_on_timeout import SandboxOnTimeout
|
||||
|
||||
T = TypeVar("T", bound="SandboxLifecycle")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxLifecycle:
|
||||
"""Sandbox lifecycle policy returned by sandbox info.
|
||||
|
||||
Attributes:
|
||||
auto_resume (bool): Whether the sandbox can auto-resume.
|
||||
on_timeout (SandboxOnTimeout): Action taken when the sandbox times out.
|
||||
"""
|
||||
|
||||
auto_resume: bool
|
||||
on_timeout: SandboxOnTimeout
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
auto_resume = self.auto_resume
|
||||
|
||||
on_timeout = self.on_timeout.value
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"autoResume": auto_resume,
|
||||
"onTimeout": on_timeout,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
auto_resume = d.pop("autoResume")
|
||||
|
||||
on_timeout = SandboxOnTimeout(d.pop("onTimeout"))
|
||||
|
||||
sandbox_lifecycle = cls(
|
||||
auto_resume=auto_resume,
|
||||
on_timeout=on_timeout,
|
||||
)
|
||||
|
||||
sandbox_lifecycle.additional_properties = d
|
||||
return sandbox_lifecycle
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,70 @@
|
||||
import datetime
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
T = TypeVar("T", bound="SandboxLog")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxLog:
|
||||
"""Log entry with timestamp and line
|
||||
|
||||
Attributes:
|
||||
line (str): Log line content
|
||||
timestamp (datetime.datetime): Timestamp of the log entry
|
||||
"""
|
||||
|
||||
line: str
|
||||
timestamp: datetime.datetime
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
line = self.line
|
||||
|
||||
timestamp = self.timestamp.isoformat()
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"line": line,
|
||||
"timestamp": timestamp,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
line = d.pop("line")
|
||||
|
||||
timestamp = isoparse(d.pop("timestamp"))
|
||||
|
||||
sandbox_log = cls(
|
||||
line=line,
|
||||
timestamp=timestamp,
|
||||
)
|
||||
|
||||
sandbox_log.additional_properties = d
|
||||
return sandbox_log
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,93 @@
|
||||
import datetime
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
from ..models.log_level import LogLevel
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.sandbox_log_entry_fields import SandboxLogEntryFields
|
||||
|
||||
|
||||
T = TypeVar("T", bound="SandboxLogEntry")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxLogEntry:
|
||||
"""
|
||||
Attributes:
|
||||
fields (SandboxLogEntryFields):
|
||||
level (LogLevel): State of the sandbox
|
||||
message (str): Log message content
|
||||
timestamp (datetime.datetime): Timestamp of the log entry
|
||||
"""
|
||||
|
||||
fields: "SandboxLogEntryFields"
|
||||
level: LogLevel
|
||||
message: str
|
||||
timestamp: datetime.datetime
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
fields = self.fields.to_dict()
|
||||
|
||||
level = self.level.value
|
||||
|
||||
message = self.message
|
||||
|
||||
timestamp = self.timestamp.isoformat()
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"fields": fields,
|
||||
"level": level,
|
||||
"message": message,
|
||||
"timestamp": timestamp,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.sandbox_log_entry_fields import SandboxLogEntryFields
|
||||
|
||||
d = dict(src_dict)
|
||||
fields = SandboxLogEntryFields.from_dict(d.pop("fields"))
|
||||
|
||||
level = LogLevel(d.pop("level"))
|
||||
|
||||
message = d.pop("message")
|
||||
|
||||
timestamp = isoparse(d.pop("timestamp"))
|
||||
|
||||
sandbox_log_entry = cls(
|
||||
fields=fields,
|
||||
level=level,
|
||||
message=message,
|
||||
timestamp=timestamp,
|
||||
)
|
||||
|
||||
sandbox_log_entry.additional_properties = d
|
||||
return sandbox_log_entry
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,44 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="SandboxLogEntryFields")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxLogEntryFields:
|
||||
""" """
|
||||
|
||||
additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
sandbox_log_entry_fields = cls()
|
||||
|
||||
sandbox_log_entry_fields.additional_properties = d
|
||||
return sandbox_log_entry_fields
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> str:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: str) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,91 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.sandbox_log import SandboxLog
|
||||
from ..models.sandbox_log_entry import SandboxLogEntry
|
||||
|
||||
|
||||
T = TypeVar("T", bound="SandboxLogs")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxLogs:
|
||||
"""
|
||||
Attributes:
|
||||
log_entries (list['SandboxLogEntry']): Structured logs of the sandbox
|
||||
logs (list['SandboxLog']): Logs of the sandbox
|
||||
"""
|
||||
|
||||
log_entries: list["SandboxLogEntry"]
|
||||
logs: list["SandboxLog"]
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
log_entries = []
|
||||
for log_entries_item_data in self.log_entries:
|
||||
log_entries_item = log_entries_item_data.to_dict()
|
||||
log_entries.append(log_entries_item)
|
||||
|
||||
logs = []
|
||||
for logs_item_data in self.logs:
|
||||
logs_item = logs_item_data.to_dict()
|
||||
logs.append(logs_item)
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"logEntries": log_entries,
|
||||
"logs": logs,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.sandbox_log import SandboxLog
|
||||
from ..models.sandbox_log_entry import SandboxLogEntry
|
||||
|
||||
d = dict(src_dict)
|
||||
log_entries = []
|
||||
_log_entries = d.pop("logEntries")
|
||||
for log_entries_item_data in _log_entries:
|
||||
log_entries_item = SandboxLogEntry.from_dict(log_entries_item_data)
|
||||
|
||||
log_entries.append(log_entries_item)
|
||||
|
||||
logs = []
|
||||
_logs = d.pop("logs")
|
||||
for logs_item_data in _logs:
|
||||
logs_item = SandboxLog.from_dict(logs_item_data)
|
||||
|
||||
logs.append(logs_item)
|
||||
|
||||
sandbox_logs = cls(
|
||||
log_entries=log_entries,
|
||||
logs=logs,
|
||||
)
|
||||
|
||||
sandbox_logs.additional_properties = d
|
||||
return sandbox_logs
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,73 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.sandbox_log_entry import SandboxLogEntry
|
||||
|
||||
|
||||
T = TypeVar("T", bound="SandboxLogsV2Response")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxLogsV2Response:
|
||||
"""
|
||||
Attributes:
|
||||
logs (list['SandboxLogEntry']): Sandbox logs structured
|
||||
"""
|
||||
|
||||
logs: list["SandboxLogEntry"]
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
logs = []
|
||||
for logs_item_data in self.logs:
|
||||
logs_item = logs_item_data.to_dict()
|
||||
logs.append(logs_item)
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"logs": logs,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.sandbox_log_entry import SandboxLogEntry
|
||||
|
||||
d = dict(src_dict)
|
||||
logs = []
|
||||
_logs = d.pop("logs")
|
||||
for logs_item_data in _logs:
|
||||
logs_item = SandboxLogEntry.from_dict(logs_item_data)
|
||||
|
||||
logs.append(logs_item)
|
||||
|
||||
sandbox_logs_v2_response = cls(
|
||||
logs=logs,
|
||||
)
|
||||
|
||||
sandbox_logs_v2_response.additional_properties = d
|
||||
return sandbox_logs_v2_response
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,126 @@
|
||||
import datetime
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
T = TypeVar("T", bound="SandboxMetric")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxMetric:
|
||||
"""Metric entry with timestamp and line
|
||||
|
||||
Attributes:
|
||||
cpu_count (int): Number of CPU cores
|
||||
cpu_used_pct (float): CPU usage percentage
|
||||
disk_total (int): Total disk space in bytes
|
||||
disk_used (int): Disk used in bytes
|
||||
mem_cache (int): Cached memory (page cache) in bytes
|
||||
mem_total (int): Total memory in bytes
|
||||
mem_used (int): Memory used in bytes
|
||||
timestamp (datetime.datetime): Timestamp of the metric entry
|
||||
timestamp_unix (int): Timestamp of the metric entry in Unix time (seconds since epoch)
|
||||
"""
|
||||
|
||||
cpu_count: int
|
||||
cpu_used_pct: float
|
||||
disk_total: int
|
||||
disk_used: int
|
||||
mem_cache: int
|
||||
mem_total: int
|
||||
mem_used: int
|
||||
timestamp: datetime.datetime
|
||||
timestamp_unix: int
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
cpu_count = self.cpu_count
|
||||
|
||||
cpu_used_pct = self.cpu_used_pct
|
||||
|
||||
disk_total = self.disk_total
|
||||
|
||||
disk_used = self.disk_used
|
||||
|
||||
mem_cache = self.mem_cache
|
||||
|
||||
mem_total = self.mem_total
|
||||
|
||||
mem_used = self.mem_used
|
||||
|
||||
timestamp = self.timestamp.isoformat()
|
||||
|
||||
timestamp_unix = self.timestamp_unix
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"cpuCount": cpu_count,
|
||||
"cpuUsedPct": cpu_used_pct,
|
||||
"diskTotal": disk_total,
|
||||
"diskUsed": disk_used,
|
||||
"memCache": mem_cache,
|
||||
"memTotal": mem_total,
|
||||
"memUsed": mem_used,
|
||||
"timestamp": timestamp,
|
||||
"timestampUnix": timestamp_unix,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
cpu_count = d.pop("cpuCount")
|
||||
|
||||
cpu_used_pct = d.pop("cpuUsedPct")
|
||||
|
||||
disk_total = d.pop("diskTotal")
|
||||
|
||||
disk_used = d.pop("diskUsed")
|
||||
|
||||
mem_cache = d.pop("memCache")
|
||||
|
||||
mem_total = d.pop("memTotal")
|
||||
|
||||
mem_used = d.pop("memUsed")
|
||||
|
||||
timestamp = isoparse(d.pop("timestamp"))
|
||||
|
||||
timestamp_unix = d.pop("timestampUnix")
|
||||
|
||||
sandbox_metric = cls(
|
||||
cpu_count=cpu_count,
|
||||
cpu_used_pct=cpu_used_pct,
|
||||
disk_total=disk_total,
|
||||
disk_used=disk_used,
|
||||
mem_cache=mem_cache,
|
||||
mem_total=mem_total,
|
||||
mem_used=mem_used,
|
||||
timestamp=timestamp,
|
||||
timestamp_unix=timestamp_unix,
|
||||
)
|
||||
|
||||
sandbox_metric.additional_properties = d
|
||||
return sandbox_metric
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,118 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.sandbox_network_config_rules import SandboxNetworkConfigRules
|
||||
|
||||
|
||||
T = TypeVar("T", bound="SandboxNetworkConfig")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxNetworkConfig:
|
||||
"""
|
||||
Attributes:
|
||||
allow_out (Union[Unset, list[str]]): List of allowed destinations for egress traffic. Each entry can be a CIDR
|
||||
block (e.g. "8.8.8.8/32"), a bare IP address (e.g. "8.8.8.8"), or a domain name (e.g. "example.com",
|
||||
"*.example.com"). Allowed entries always take precedence over denied entries.
|
||||
allow_public_traffic (Union[Unset, bool]): Specify if the sandbox URLs should be accessible only with
|
||||
authentication. Default: True.
|
||||
deny_out (Union[Unset, list[str]]): List of denied CIDR blocks or IP addresses for egress traffic. Domain names
|
||||
are not supported for deny rules.
|
||||
mask_request_host (Union[Unset, str]): Specify host mask which will be used for all sandbox requests
|
||||
rules (Union[Unset, SandboxNetworkConfigRules]): Per-domain transform rules applied to matching egress
|
||||
HTTP/HTTPS requests. Keys are domains (e.g. "api.example.com", "example.com"). A domain listed here is not
|
||||
automatically allowed - use allowOut to permit the traffic.
|
||||
"""
|
||||
|
||||
allow_out: Union[Unset, list[str]] = UNSET
|
||||
allow_public_traffic: Union[Unset, bool] = True
|
||||
deny_out: Union[Unset, list[str]] = UNSET
|
||||
mask_request_host: Union[Unset, str] = UNSET
|
||||
rules: Union[Unset, "SandboxNetworkConfigRules"] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
allow_out: Union[Unset, list[str]] = UNSET
|
||||
if not isinstance(self.allow_out, Unset):
|
||||
allow_out = self.allow_out
|
||||
|
||||
allow_public_traffic = self.allow_public_traffic
|
||||
|
||||
deny_out: Union[Unset, list[str]] = UNSET
|
||||
if not isinstance(self.deny_out, Unset):
|
||||
deny_out = self.deny_out
|
||||
|
||||
mask_request_host = self.mask_request_host
|
||||
|
||||
rules: Union[Unset, dict[str, Any]] = UNSET
|
||||
if not isinstance(self.rules, Unset):
|
||||
rules = self.rules.to_dict()
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if allow_out is not UNSET:
|
||||
field_dict["allowOut"] = allow_out
|
||||
if allow_public_traffic is not UNSET:
|
||||
field_dict["allowPublicTraffic"] = allow_public_traffic
|
||||
if deny_out is not UNSET:
|
||||
field_dict["denyOut"] = deny_out
|
||||
if mask_request_host is not UNSET:
|
||||
field_dict["maskRequestHost"] = mask_request_host
|
||||
if rules is not UNSET:
|
||||
field_dict["rules"] = rules
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.sandbox_network_config_rules import SandboxNetworkConfigRules
|
||||
|
||||
d = dict(src_dict)
|
||||
allow_out = cast(list[str], d.pop("allowOut", UNSET))
|
||||
|
||||
allow_public_traffic = d.pop("allowPublicTraffic", UNSET)
|
||||
|
||||
deny_out = cast(list[str], d.pop("denyOut", UNSET))
|
||||
|
||||
mask_request_host = d.pop("maskRequestHost", UNSET)
|
||||
|
||||
_rules = d.pop("rules", UNSET)
|
||||
rules: Union[Unset, SandboxNetworkConfigRules]
|
||||
if isinstance(_rules, Unset):
|
||||
rules = UNSET
|
||||
else:
|
||||
rules = SandboxNetworkConfigRules.from_dict(_rules)
|
||||
|
||||
sandbox_network_config = cls(
|
||||
allow_out=allow_out,
|
||||
allow_public_traffic=allow_public_traffic,
|
||||
deny_out=deny_out,
|
||||
mask_request_host=mask_request_host,
|
||||
rules=rules,
|
||||
)
|
||||
|
||||
sandbox_network_config.additional_properties = d
|
||||
return sandbox_network_config
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,72 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.sandbox_network_rule import SandboxNetworkRule
|
||||
|
||||
|
||||
T = TypeVar("T", bound="SandboxNetworkConfigRules")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxNetworkConfigRules:
|
||||
"""Per-domain transform rules applied to matching egress HTTP/HTTPS requests. Keys are domains (e.g. "api.example.com",
|
||||
"example.com"). A domain listed here is not automatically allowed - use allowOut to permit the traffic.
|
||||
|
||||
"""
|
||||
|
||||
additional_properties: dict[str, list["SandboxNetworkRule"]] = _attrs_field(
|
||||
init=False, factory=dict
|
||||
)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
field_dict: dict[str, Any] = {}
|
||||
for prop_name, prop in self.additional_properties.items():
|
||||
field_dict[prop_name] = []
|
||||
for additional_property_item_data in prop:
|
||||
additional_property_item = additional_property_item_data.to_dict()
|
||||
field_dict[prop_name].append(additional_property_item)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.sandbox_network_rule import SandboxNetworkRule
|
||||
|
||||
d = dict(src_dict)
|
||||
sandbox_network_config_rules = cls()
|
||||
|
||||
additional_properties = {}
|
||||
for prop_name, prop_dict in d.items():
|
||||
additional_property = []
|
||||
_additional_property = prop_dict
|
||||
for additional_property_item_data in _additional_property:
|
||||
additional_property_item = SandboxNetworkRule.from_dict(
|
||||
additional_property_item_data
|
||||
)
|
||||
|
||||
additional_property.append(additional_property_item)
|
||||
|
||||
additional_properties[prop_name] = additional_property
|
||||
|
||||
sandbox_network_config_rules.additional_properties = additional_properties
|
||||
return sandbox_network_config_rules
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> list["SandboxNetworkRule"]:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: list["SandboxNetworkRule"]) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,74 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.sandbox_network_transform import SandboxNetworkTransform
|
||||
|
||||
|
||||
T = TypeVar("T", bound="SandboxNetworkRule")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxNetworkRule:
|
||||
"""Transform rule applied to egress requests matching a domain pattern.
|
||||
|
||||
Attributes:
|
||||
transform (Union[Unset, SandboxNetworkTransform]): Transformations applied to matching egress requests before
|
||||
forwarding.
|
||||
"""
|
||||
|
||||
transform: Union[Unset, "SandboxNetworkTransform"] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
transform: Union[Unset, dict[str, Any]] = UNSET
|
||||
if not isinstance(self.transform, Unset):
|
||||
transform = self.transform.to_dict()
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if transform is not UNSET:
|
||||
field_dict["transform"] = transform
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.sandbox_network_transform import SandboxNetworkTransform
|
||||
|
||||
d = dict(src_dict)
|
||||
_transform = d.pop("transform", UNSET)
|
||||
transform: Union[Unset, SandboxNetworkTransform]
|
||||
if isinstance(_transform, Unset):
|
||||
transform = UNSET
|
||||
else:
|
||||
transform = SandboxNetworkTransform.from_dict(_transform)
|
||||
|
||||
sandbox_network_rule = cls(
|
||||
transform=transform,
|
||||
)
|
||||
|
||||
sandbox_network_rule.additional_properties = d
|
||||
return sandbox_network_rule
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,79 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.sandbox_network_transform_headers import (
|
||||
SandboxNetworkTransformHeaders,
|
||||
)
|
||||
|
||||
|
||||
T = TypeVar("T", bound="SandboxNetworkTransform")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxNetworkTransform:
|
||||
"""Transformations applied to matching egress requests before forwarding.
|
||||
|
||||
Attributes:
|
||||
headers (Union[Unset, SandboxNetworkTransformHeaders]): HTTP headers to inject or override in matching requests.
|
||||
An existing header with the same name is replaced. Values are plain strings; secret resolution happens client-
|
||||
side before sending to the API.
|
||||
"""
|
||||
|
||||
headers: Union[Unset, "SandboxNetworkTransformHeaders"] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
headers: Union[Unset, dict[str, Any]] = UNSET
|
||||
if not isinstance(self.headers, Unset):
|
||||
headers = self.headers.to_dict()
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if headers is not UNSET:
|
||||
field_dict["headers"] = headers
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.sandbox_network_transform_headers import (
|
||||
SandboxNetworkTransformHeaders,
|
||||
)
|
||||
|
||||
d = dict(src_dict)
|
||||
_headers = d.pop("headers", UNSET)
|
||||
headers: Union[Unset, SandboxNetworkTransformHeaders]
|
||||
if isinstance(_headers, Unset):
|
||||
headers = UNSET
|
||||
else:
|
||||
headers = SandboxNetworkTransformHeaders.from_dict(_headers)
|
||||
|
||||
sandbox_network_transform = cls(
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
sandbox_network_transform.additional_properties = d
|
||||
return sandbox_network_transform
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="SandboxNetworkTransformHeaders")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxNetworkTransformHeaders:
|
||||
"""HTTP headers to inject or override in matching requests. An existing header with the same name is replaced. Values
|
||||
are plain strings; secret resolution happens client-side before sending to the API.
|
||||
|
||||
"""
|
||||
|
||||
additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
sandbox_network_transform_headers = cls()
|
||||
|
||||
sandbox_network_transform_headers.additional_properties = d
|
||||
return sandbox_network_transform_headers
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> str:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: str) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,114 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.sandbox_network_update_config_rules import (
|
||||
SandboxNetworkUpdateConfigRules,
|
||||
)
|
||||
|
||||
|
||||
T = TypeVar("T", bound="SandboxNetworkUpdateConfig")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxNetworkUpdateConfig:
|
||||
"""Network configuration update for a running sandbox. Replaces the current egress rules with the provided
|
||||
configuration. Omitting a field clears it.
|
||||
|
||||
Attributes:
|
||||
allow_out (Union[Unset, list[str]]): List of allowed destinations for egress traffic. Each entry can be a CIDR
|
||||
block (e.g. "8.8.8.8/32"), a bare IP address (e.g. "8.8.8.8"), or a domain name (e.g. "example.com",
|
||||
"*.example.com"). Allowed entries always take precedence over denied entries.
|
||||
allow_internet_access (Union[Unset, bool]): Allow sandbox to access the internet. When set to false, it behaves
|
||||
the same as specifying denyOut to 0.0.0.0/0 in the network config.
|
||||
deny_out (Union[Unset, list[str]]): List of denied CIDR blocks or IP addresses for egress traffic. Domain names
|
||||
are not supported for deny rules.
|
||||
rules (Union[Unset, SandboxNetworkUpdateConfigRules]): Per-domain transform rules. Replaces all existing rules
|
||||
when provided.
|
||||
"""
|
||||
|
||||
allow_out: Union[Unset, list[str]] = UNSET
|
||||
allow_internet_access: Union[Unset, bool] = UNSET
|
||||
deny_out: Union[Unset, list[str]] = UNSET
|
||||
rules: Union[Unset, "SandboxNetworkUpdateConfigRules"] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
allow_out: Union[Unset, list[str]] = UNSET
|
||||
if not isinstance(self.allow_out, Unset):
|
||||
allow_out = self.allow_out
|
||||
|
||||
allow_internet_access = self.allow_internet_access
|
||||
|
||||
deny_out: Union[Unset, list[str]] = UNSET
|
||||
if not isinstance(self.deny_out, Unset):
|
||||
deny_out = self.deny_out
|
||||
|
||||
rules: Union[Unset, dict[str, Any]] = UNSET
|
||||
if not isinstance(self.rules, Unset):
|
||||
rules = self.rules.to_dict()
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if allow_out is not UNSET:
|
||||
field_dict["allowOut"] = allow_out
|
||||
if allow_internet_access is not UNSET:
|
||||
field_dict["allow_internet_access"] = allow_internet_access
|
||||
if deny_out is not UNSET:
|
||||
field_dict["denyOut"] = deny_out
|
||||
if rules is not UNSET:
|
||||
field_dict["rules"] = rules
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.sandbox_network_update_config_rules import (
|
||||
SandboxNetworkUpdateConfigRules,
|
||||
)
|
||||
|
||||
d = dict(src_dict)
|
||||
allow_out = cast(list[str], d.pop("allowOut", UNSET))
|
||||
|
||||
allow_internet_access = d.pop("allow_internet_access", UNSET)
|
||||
|
||||
deny_out = cast(list[str], d.pop("denyOut", UNSET))
|
||||
|
||||
_rules = d.pop("rules", UNSET)
|
||||
rules: Union[Unset, SandboxNetworkUpdateConfigRules]
|
||||
if isinstance(_rules, Unset):
|
||||
rules = UNSET
|
||||
else:
|
||||
rules = SandboxNetworkUpdateConfigRules.from_dict(_rules)
|
||||
|
||||
sandbox_network_update_config = cls(
|
||||
allow_out=allow_out,
|
||||
allow_internet_access=allow_internet_access,
|
||||
deny_out=deny_out,
|
||||
rules=rules,
|
||||
)
|
||||
|
||||
sandbox_network_update_config.additional_properties = d
|
||||
return sandbox_network_update_config
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.sandbox_network_rule import SandboxNetworkRule
|
||||
|
||||
|
||||
T = TypeVar("T", bound="SandboxNetworkUpdateConfigRules")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxNetworkUpdateConfigRules:
|
||||
"""Per-domain transform rules. Replaces all existing rules when provided."""
|
||||
|
||||
additional_properties: dict[str, list["SandboxNetworkRule"]] = _attrs_field(
|
||||
init=False, factory=dict
|
||||
)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
field_dict: dict[str, Any] = {}
|
||||
for prop_name, prop in self.additional_properties.items():
|
||||
field_dict[prop_name] = []
|
||||
for additional_property_item_data in prop:
|
||||
additional_property_item = additional_property_item_data.to_dict()
|
||||
field_dict[prop_name].append(additional_property_item)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.sandbox_network_rule import SandboxNetworkRule
|
||||
|
||||
d = dict(src_dict)
|
||||
sandbox_network_update_config_rules = cls()
|
||||
|
||||
additional_properties = {}
|
||||
for prop_name, prop_dict in d.items():
|
||||
additional_property = []
|
||||
_additional_property = prop_dict
|
||||
for additional_property_item_data in _additional_property:
|
||||
additional_property_item = SandboxNetworkRule.from_dict(
|
||||
additional_property_item_data
|
||||
)
|
||||
|
||||
additional_property.append(additional_property_item)
|
||||
|
||||
additional_properties[prop_name] = additional_property
|
||||
|
||||
sandbox_network_update_config_rules.additional_properties = (
|
||||
additional_properties
|
||||
)
|
||||
return sandbox_network_update_config_rules
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> list["SandboxNetworkRule"]:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: list["SandboxNetworkRule"]) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,9 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class SandboxOnTimeout(str, Enum):
|
||||
KILL = "kill"
|
||||
PAUSE = "pause"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
||||
@@ -0,0 +1,62 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, Union
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="SandboxPauseRequest")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxPauseRequest:
|
||||
"""
|
||||
Attributes:
|
||||
memory (Union[Unset, bool]): Whether to capture a full memory snapshot. When false, only the filesystem is
|
||||
persisted and resuming the sandbox cold-boots (reboots) it from disk, losing in-memory state, running processes,
|
||||
and open connections. Resume it with an explicit request (connect or resume); auto-resume, which can be
|
||||
triggered by arbitrary traffic, refuses such a sandbox. Defaults to true. Default: True.
|
||||
"""
|
||||
|
||||
memory: Union[Unset, bool] = True
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
memory = self.memory
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if memory is not UNSET:
|
||||
field_dict["memory"] = memory
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
memory = d.pop("memory", UNSET)
|
||||
|
||||
sandbox_pause_request = cls(
|
||||
memory=memory,
|
||||
)
|
||||
|
||||
sandbox_pause_request.additional_properties = d
|
||||
return sandbox_pause_request
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,9 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class SandboxState(str, Enum):
|
||||
PAUSED = "paused"
|
||||
RUNNING = "running"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
||||
@@ -0,0 +1,67 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="SandboxVolumeMount")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxVolumeMount:
|
||||
"""
|
||||
Attributes:
|
||||
name (str): Name of the volume
|
||||
path (str): Path of the volume
|
||||
"""
|
||||
|
||||
name: str
|
||||
path: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
name = self.name
|
||||
|
||||
path = self.path
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"name": name,
|
||||
"path": path,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
name = d.pop("name")
|
||||
|
||||
path = d.pop("path")
|
||||
|
||||
sandbox_volume_mount = cls(
|
||||
name=name,
|
||||
path=path,
|
||||
)
|
||||
|
||||
sandbox_volume_mount.additional_properties = d
|
||||
return sandbox_volume_mount
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,59 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="SandboxesWithMetrics")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SandboxesWithMetrics:
|
||||
"""
|
||||
Attributes:
|
||||
sandboxes (Any):
|
||||
"""
|
||||
|
||||
sandboxes: Any
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
sandboxes = self.sandboxes
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"sandboxes": sandboxes,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
sandboxes = d.pop("sandboxes")
|
||||
|
||||
sandboxes_with_metrics = cls(
|
||||
sandboxes=sandboxes,
|
||||
)
|
||||
|
||||
sandboxes_with_metrics.additional_properties = d
|
||||
return sandboxes_with_metrics
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,70 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="SnapshotInfo")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SnapshotInfo:
|
||||
"""
|
||||
Attributes:
|
||||
names (list[str]): Full names of the snapshot template including team namespace and tag (e.g. team-slug/my-
|
||||
snapshot:v2)
|
||||
snapshot_id (str): Identifier of the snapshot template including the tag. Uses namespace/alias when a name was
|
||||
provided (e.g. team-slug/my-snapshot:default), otherwise falls back to the raw template ID (e.g.
|
||||
abc123:default).
|
||||
"""
|
||||
|
||||
names: list[str]
|
||||
snapshot_id: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
names = self.names
|
||||
|
||||
snapshot_id = self.snapshot_id
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"names": names,
|
||||
"snapshotID": snapshot_id,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
names = cast(list[str], d.pop("names"))
|
||||
|
||||
snapshot_id = d.pop("snapshotID")
|
||||
|
||||
snapshot_info = cls(
|
||||
names=names,
|
||||
snapshot_id=snapshot_id,
|
||||
)
|
||||
|
||||
snapshot_info.additional_properties = d
|
||||
return snapshot_info
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="Team")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class Team:
|
||||
"""
|
||||
Attributes:
|
||||
api_key (str): API key for the team
|
||||
is_default (bool): Whether the team is the default team
|
||||
name (str): Name of the team
|
||||
team_id (str): Identifier of the team
|
||||
"""
|
||||
|
||||
api_key: str
|
||||
is_default: bool
|
||||
name: str
|
||||
team_id: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
api_key = self.api_key
|
||||
|
||||
is_default = self.is_default
|
||||
|
||||
name = self.name
|
||||
|
||||
team_id = self.team_id
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"apiKey": api_key,
|
||||
"isDefault": is_default,
|
||||
"name": name,
|
||||
"teamID": team_id,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_key = d.pop("apiKey")
|
||||
|
||||
is_default = d.pop("isDefault")
|
||||
|
||||
name = d.pop("name")
|
||||
|
||||
team_id = d.pop("teamID")
|
||||
|
||||
team = cls(
|
||||
api_key=api_key,
|
||||
is_default=is_default,
|
||||
name=name,
|
||||
team_id=team_id,
|
||||
)
|
||||
|
||||
team.additional_properties = d
|
||||
return team
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,158 @@
|
||||
import datetime
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
||||
from uuid import UUID
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.identifier_masking_details import IdentifierMaskingDetails
|
||||
from ..models.team_user import TeamUser
|
||||
|
||||
|
||||
T = TypeVar("T", bound="TeamAPIKey")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TeamAPIKey:
|
||||
"""
|
||||
Attributes:
|
||||
created_at (datetime.datetime): Timestamp of API key creation
|
||||
id (UUID): Identifier of the API key
|
||||
mask (IdentifierMaskingDetails):
|
||||
name (str): Name of the API key
|
||||
created_by (Union['TeamUser', None, Unset]):
|
||||
last_used (Union[None, Unset, datetime.datetime]): Last time this API key was used
|
||||
"""
|
||||
|
||||
created_at: datetime.datetime
|
||||
id: UUID
|
||||
mask: "IdentifierMaskingDetails"
|
||||
name: str
|
||||
created_by: Union["TeamUser", None, Unset] = UNSET
|
||||
last_used: Union[None, Unset, datetime.datetime] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.team_user import TeamUser
|
||||
|
||||
created_at = self.created_at.isoformat()
|
||||
|
||||
id = str(self.id)
|
||||
|
||||
mask = self.mask.to_dict()
|
||||
|
||||
name = self.name
|
||||
|
||||
created_by: Union[None, Unset, dict[str, Any]]
|
||||
if isinstance(self.created_by, Unset):
|
||||
created_by = UNSET
|
||||
elif isinstance(self.created_by, TeamUser):
|
||||
created_by = self.created_by.to_dict()
|
||||
else:
|
||||
created_by = self.created_by
|
||||
|
||||
last_used: Union[None, Unset, str]
|
||||
if isinstance(self.last_used, Unset):
|
||||
last_used = UNSET
|
||||
elif isinstance(self.last_used, datetime.datetime):
|
||||
last_used = self.last_used.isoformat()
|
||||
else:
|
||||
last_used = self.last_used
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"createdAt": created_at,
|
||||
"id": id,
|
||||
"mask": mask,
|
||||
"name": name,
|
||||
}
|
||||
)
|
||||
if created_by is not UNSET:
|
||||
field_dict["createdBy"] = created_by
|
||||
if last_used is not UNSET:
|
||||
field_dict["lastUsed"] = last_used
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.identifier_masking_details import IdentifierMaskingDetails
|
||||
from ..models.team_user import TeamUser
|
||||
|
||||
d = dict(src_dict)
|
||||
created_at = isoparse(d.pop("createdAt"))
|
||||
|
||||
id = UUID(d.pop("id"))
|
||||
|
||||
mask = IdentifierMaskingDetails.from_dict(d.pop("mask"))
|
||||
|
||||
name = d.pop("name")
|
||||
|
||||
def _parse_created_by(data: object) -> Union["TeamUser", None, Unset]:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
created_by_type_1 = TeamUser.from_dict(data)
|
||||
|
||||
return created_by_type_1
|
||||
except: # noqa: E722
|
||||
pass
|
||||
return cast(Union["TeamUser", None, Unset], data)
|
||||
|
||||
created_by = _parse_created_by(d.pop("createdBy", UNSET))
|
||||
|
||||
def _parse_last_used(data: object) -> Union[None, Unset, datetime.datetime]:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, str):
|
||||
raise TypeError()
|
||||
last_used_type_0 = isoparse(data)
|
||||
|
||||
return last_used_type_0
|
||||
except: # noqa: E722
|
||||
pass
|
||||
return cast(Union[None, Unset, datetime.datetime], data)
|
||||
|
||||
last_used = _parse_last_used(d.pop("lastUsed", UNSET))
|
||||
|
||||
team_api_key = cls(
|
||||
created_at=created_at,
|
||||
id=id,
|
||||
mask=mask,
|
||||
name=name,
|
||||
created_by=created_by,
|
||||
last_used=last_used,
|
||||
)
|
||||
|
||||
team_api_key.additional_properties = d
|
||||
return team_api_key
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,86 @@
|
||||
import datetime
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
T = TypeVar("T", bound="TeamMetric")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TeamMetric:
|
||||
"""Team metric with timestamp
|
||||
|
||||
Attributes:
|
||||
concurrent_sandboxes (int): The number of concurrent sandboxes for the team
|
||||
sandbox_start_rate (float): Number of sandboxes started per second
|
||||
timestamp (datetime.datetime): Timestamp of the metric entry
|
||||
timestamp_unix (int): Timestamp of the metric entry in Unix time (seconds since epoch)
|
||||
"""
|
||||
|
||||
concurrent_sandboxes: int
|
||||
sandbox_start_rate: float
|
||||
timestamp: datetime.datetime
|
||||
timestamp_unix: int
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
concurrent_sandboxes = self.concurrent_sandboxes
|
||||
|
||||
sandbox_start_rate = self.sandbox_start_rate
|
||||
|
||||
timestamp = self.timestamp.isoformat()
|
||||
|
||||
timestamp_unix = self.timestamp_unix
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"concurrentSandboxes": concurrent_sandboxes,
|
||||
"sandboxStartRate": sandbox_start_rate,
|
||||
"timestamp": timestamp,
|
||||
"timestampUnix": timestamp_unix,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
concurrent_sandboxes = d.pop("concurrentSandboxes")
|
||||
|
||||
sandbox_start_rate = d.pop("sandboxStartRate")
|
||||
|
||||
timestamp = isoparse(d.pop("timestamp"))
|
||||
|
||||
timestamp_unix = d.pop("timestampUnix")
|
||||
|
||||
team_metric = cls(
|
||||
concurrent_sandboxes=concurrent_sandboxes,
|
||||
sandbox_start_rate=sandbox_start_rate,
|
||||
timestamp=timestamp,
|
||||
timestamp_unix=timestamp_unix,
|
||||
)
|
||||
|
||||
team_metric.additional_properties = d
|
||||
return team_metric
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,75 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, Union, cast
|
||||
from uuid import UUID
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="TeamUser")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TeamUser:
|
||||
"""
|
||||
Attributes:
|
||||
email (Union[None, str]): Email of the user
|
||||
id (UUID): Identifier of the user
|
||||
"""
|
||||
|
||||
email: Union[None, str]
|
||||
id: UUID
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
email: Union[None, str]
|
||||
email = self.email
|
||||
|
||||
id = str(self.id)
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"email": email,
|
||||
"id": id,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
|
||||
def _parse_email(data: object) -> Union[None, str]:
|
||||
if data is None:
|
||||
return data
|
||||
return cast(Union[None, str], data)
|
||||
|
||||
email = _parse_email(d.pop("email"))
|
||||
|
||||
id = UUID(d.pop("id"))
|
||||
|
||||
team_user = cls(
|
||||
email=email,
|
||||
id=id,
|
||||
)
|
||||
|
||||
team_user.additional_properties = d
|
||||
return team_user
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
+225
@@ -0,0 +1,225 @@
|
||||
import datetime
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
from ..models.template_build_status import TemplateBuildStatus
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.team_user import TeamUser
|
||||
|
||||
|
||||
T = TypeVar("T", bound="Template")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class Template:
|
||||
"""
|
||||
Attributes:
|
||||
aliases (list[str]): Aliases of the template
|
||||
build_count (int): Number of times the template was built
|
||||
build_id (str): Identifier of the last successful build for given template
|
||||
build_status (TemplateBuildStatus): Status of the template build
|
||||
cpu_count (int): CPU cores for the sandbox
|
||||
created_at (datetime.datetime): Time when the template was created
|
||||
created_by (Union['TeamUser', None]):
|
||||
disk_size_mb (int): Disk size for the sandbox in MiB
|
||||
envd_version (str): Version of the envd running in the sandbox
|
||||
last_spawned_at (Union[None, datetime.datetime]): Time when the template was last used
|
||||
memory_mb (int): Memory for the sandbox in MiB
|
||||
names (list[str]): Names of the template (namespace/alias format when namespaced)
|
||||
public (bool): Whether the template is public or only accessible by the team
|
||||
spawn_count (int): Number of times the template was used
|
||||
template_id (str): Identifier of the template
|
||||
updated_at (datetime.datetime): Time when the template was last updated
|
||||
"""
|
||||
|
||||
aliases: list[str]
|
||||
build_count: int
|
||||
build_id: str
|
||||
build_status: TemplateBuildStatus
|
||||
cpu_count: int
|
||||
created_at: datetime.datetime
|
||||
created_by: Union["TeamUser", None]
|
||||
disk_size_mb: int
|
||||
envd_version: str
|
||||
last_spawned_at: Union[None, datetime.datetime]
|
||||
memory_mb: int
|
||||
names: list[str]
|
||||
public: bool
|
||||
spawn_count: int
|
||||
template_id: str
|
||||
updated_at: datetime.datetime
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.team_user import TeamUser
|
||||
|
||||
aliases = self.aliases
|
||||
|
||||
build_count = self.build_count
|
||||
|
||||
build_id = self.build_id
|
||||
|
||||
build_status = self.build_status.value
|
||||
|
||||
cpu_count = self.cpu_count
|
||||
|
||||
created_at = self.created_at.isoformat()
|
||||
|
||||
created_by: Union[None, dict[str, Any]]
|
||||
if isinstance(self.created_by, TeamUser):
|
||||
created_by = self.created_by.to_dict()
|
||||
else:
|
||||
created_by = self.created_by
|
||||
|
||||
disk_size_mb = self.disk_size_mb
|
||||
|
||||
envd_version = self.envd_version
|
||||
|
||||
last_spawned_at: Union[None, str]
|
||||
if isinstance(self.last_spawned_at, datetime.datetime):
|
||||
last_spawned_at = self.last_spawned_at.isoformat()
|
||||
else:
|
||||
last_spawned_at = self.last_spawned_at
|
||||
|
||||
memory_mb = self.memory_mb
|
||||
|
||||
names = self.names
|
||||
|
||||
public = self.public
|
||||
|
||||
spawn_count = self.spawn_count
|
||||
|
||||
template_id = self.template_id
|
||||
|
||||
updated_at = self.updated_at.isoformat()
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"aliases": aliases,
|
||||
"buildCount": build_count,
|
||||
"buildID": build_id,
|
||||
"buildStatus": build_status,
|
||||
"cpuCount": cpu_count,
|
||||
"createdAt": created_at,
|
||||
"createdBy": created_by,
|
||||
"diskSizeMB": disk_size_mb,
|
||||
"envdVersion": envd_version,
|
||||
"lastSpawnedAt": last_spawned_at,
|
||||
"memoryMB": memory_mb,
|
||||
"names": names,
|
||||
"public": public,
|
||||
"spawnCount": spawn_count,
|
||||
"templateID": template_id,
|
||||
"updatedAt": updated_at,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.team_user import TeamUser
|
||||
|
||||
d = dict(src_dict)
|
||||
aliases = cast(list[str], d.pop("aliases"))
|
||||
|
||||
build_count = d.pop("buildCount")
|
||||
|
||||
build_id = d.pop("buildID")
|
||||
|
||||
build_status = TemplateBuildStatus(d.pop("buildStatus"))
|
||||
|
||||
cpu_count = d.pop("cpuCount")
|
||||
|
||||
created_at = isoparse(d.pop("createdAt"))
|
||||
|
||||
def _parse_created_by(data: object) -> Union["TeamUser", None]:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
created_by_type_1 = TeamUser.from_dict(data)
|
||||
|
||||
return created_by_type_1
|
||||
except: # noqa: E722
|
||||
pass
|
||||
return cast(Union["TeamUser", None], data)
|
||||
|
||||
created_by = _parse_created_by(d.pop("createdBy"))
|
||||
|
||||
disk_size_mb = d.pop("diskSizeMB")
|
||||
|
||||
envd_version = d.pop("envdVersion")
|
||||
|
||||
def _parse_last_spawned_at(data: object) -> Union[None, datetime.datetime]:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, str):
|
||||
raise TypeError()
|
||||
last_spawned_at_type_0 = isoparse(data)
|
||||
|
||||
return last_spawned_at_type_0
|
||||
except: # noqa: E722
|
||||
pass
|
||||
return cast(Union[None, datetime.datetime], data)
|
||||
|
||||
last_spawned_at = _parse_last_spawned_at(d.pop("lastSpawnedAt"))
|
||||
|
||||
memory_mb = d.pop("memoryMB")
|
||||
|
||||
names = cast(list[str], d.pop("names"))
|
||||
|
||||
public = d.pop("public")
|
||||
|
||||
spawn_count = d.pop("spawnCount")
|
||||
|
||||
template_id = d.pop("templateID")
|
||||
|
||||
updated_at = isoparse(d.pop("updatedAt"))
|
||||
|
||||
template = cls(
|
||||
aliases=aliases,
|
||||
build_count=build_count,
|
||||
build_id=build_id,
|
||||
build_status=build_status,
|
||||
cpu_count=cpu_count,
|
||||
created_at=created_at,
|
||||
created_by=created_by,
|
||||
disk_size_mb=disk_size_mb,
|
||||
envd_version=envd_version,
|
||||
last_spawned_at=last_spawned_at,
|
||||
memory_mb=memory_mb,
|
||||
names=names,
|
||||
public=public,
|
||||
spawn_count=spawn_count,
|
||||
template_id=template_id,
|
||||
updated_at=updated_at,
|
||||
)
|
||||
|
||||
template.additional_properties = d
|
||||
return template
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,67 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="TemplateAliasResponse")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TemplateAliasResponse:
|
||||
"""
|
||||
Attributes:
|
||||
public (bool): Whether the template is public or only accessible by the team
|
||||
template_id (str): Identifier of the template
|
||||
"""
|
||||
|
||||
public: bool
|
||||
template_id: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
public = self.public
|
||||
|
||||
template_id = self.template_id
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"public": public,
|
||||
"templateID": template_id,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
public = d.pop("public")
|
||||
|
||||
template_id = d.pop("templateID")
|
||||
|
||||
template_alias_response = cls(
|
||||
public=public,
|
||||
template_id=template_id,
|
||||
)
|
||||
|
||||
template_alias_response.additional_properties = d
|
||||
return template_alias_response
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,139 @@
|
||||
import datetime
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, Union
|
||||
from uuid import UUID
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
from ..models.template_build_status import TemplateBuildStatus
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="TemplateBuild")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TemplateBuild:
|
||||
"""
|
||||
Attributes:
|
||||
build_id (UUID): Identifier of the build
|
||||
cpu_count (int): CPU cores for the sandbox
|
||||
created_at (datetime.datetime): Time when the build was created
|
||||
memory_mb (int): Memory for the sandbox in MiB
|
||||
status (TemplateBuildStatus): Status of the template build
|
||||
updated_at (datetime.datetime): Time when the build was last updated
|
||||
disk_size_mb (Union[Unset, int]): Disk size for the sandbox in MiB
|
||||
envd_version (Union[Unset, str]): Version of the envd running in the sandbox
|
||||
finished_at (Union[Unset, datetime.datetime]): Time when the build was finished
|
||||
"""
|
||||
|
||||
build_id: UUID
|
||||
cpu_count: int
|
||||
created_at: datetime.datetime
|
||||
memory_mb: int
|
||||
status: TemplateBuildStatus
|
||||
updated_at: datetime.datetime
|
||||
disk_size_mb: Union[Unset, int] = UNSET
|
||||
envd_version: Union[Unset, str] = UNSET
|
||||
finished_at: Union[Unset, datetime.datetime] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
build_id = str(self.build_id)
|
||||
|
||||
cpu_count = self.cpu_count
|
||||
|
||||
created_at = self.created_at.isoformat()
|
||||
|
||||
memory_mb = self.memory_mb
|
||||
|
||||
status = self.status.value
|
||||
|
||||
updated_at = self.updated_at.isoformat()
|
||||
|
||||
disk_size_mb = self.disk_size_mb
|
||||
|
||||
envd_version = self.envd_version
|
||||
|
||||
finished_at: Union[Unset, str] = UNSET
|
||||
if not isinstance(self.finished_at, Unset):
|
||||
finished_at = self.finished_at.isoformat()
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"buildID": build_id,
|
||||
"cpuCount": cpu_count,
|
||||
"createdAt": created_at,
|
||||
"memoryMB": memory_mb,
|
||||
"status": status,
|
||||
"updatedAt": updated_at,
|
||||
}
|
||||
)
|
||||
if disk_size_mb is not UNSET:
|
||||
field_dict["diskSizeMB"] = disk_size_mb
|
||||
if envd_version is not UNSET:
|
||||
field_dict["envdVersion"] = envd_version
|
||||
if finished_at is not UNSET:
|
||||
field_dict["finishedAt"] = finished_at
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
build_id = UUID(d.pop("buildID"))
|
||||
|
||||
cpu_count = d.pop("cpuCount")
|
||||
|
||||
created_at = isoparse(d.pop("createdAt"))
|
||||
|
||||
memory_mb = d.pop("memoryMB")
|
||||
|
||||
status = TemplateBuildStatus(d.pop("status"))
|
||||
|
||||
updated_at = isoparse(d.pop("updatedAt"))
|
||||
|
||||
disk_size_mb = d.pop("diskSizeMB", UNSET)
|
||||
|
||||
envd_version = d.pop("envdVersion", UNSET)
|
||||
|
||||
_finished_at = d.pop("finishedAt", UNSET)
|
||||
finished_at: Union[Unset, datetime.datetime]
|
||||
if isinstance(_finished_at, Unset):
|
||||
finished_at = UNSET
|
||||
else:
|
||||
finished_at = isoparse(_finished_at)
|
||||
|
||||
template_build = cls(
|
||||
build_id=build_id,
|
||||
cpu_count=cpu_count,
|
||||
created_at=created_at,
|
||||
memory_mb=memory_mb,
|
||||
status=status,
|
||||
updated_at=updated_at,
|
||||
disk_size_mb=disk_size_mb,
|
||||
envd_version=envd_version,
|
||||
finished_at=finished_at,
|
||||
)
|
||||
|
||||
template_build.additional_properties = d
|
||||
return template_build
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,70 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, Union
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="TemplateBuildFileUpload")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TemplateBuildFileUpload:
|
||||
"""
|
||||
Attributes:
|
||||
present (bool): Whether the file is already present in the cache
|
||||
url (Union[Unset, str]): Url where the file should be uploaded to
|
||||
"""
|
||||
|
||||
present: bool
|
||||
url: Union[Unset, str] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
present = self.present
|
||||
|
||||
url = self.url
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"present": present,
|
||||
}
|
||||
)
|
||||
if url is not UNSET:
|
||||
field_dict["url"] = url
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
present = d.pop("present")
|
||||
|
||||
url = d.pop("url", UNSET)
|
||||
|
||||
template_build_file_upload = cls(
|
||||
present=present,
|
||||
url=url,
|
||||
)
|
||||
|
||||
template_build_file_upload.additional_properties = d
|
||||
return template_build_file_upload
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,126 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..models.template_build_status import TemplateBuildStatus
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.build_log_entry import BuildLogEntry
|
||||
from ..models.build_status_reason import BuildStatusReason
|
||||
|
||||
|
||||
T = TypeVar("T", bound="TemplateBuildInfo")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TemplateBuildInfo:
|
||||
"""
|
||||
Attributes:
|
||||
build_id (str): Identifier of the build
|
||||
log_entries (list['BuildLogEntry']): Build logs structured
|
||||
logs (list[str]): Build logs
|
||||
status (TemplateBuildStatus): Status of the template build
|
||||
template_id (str): Identifier of the template
|
||||
reason (Union[Unset, BuildStatusReason]):
|
||||
"""
|
||||
|
||||
build_id: str
|
||||
log_entries: list["BuildLogEntry"]
|
||||
logs: list[str]
|
||||
status: TemplateBuildStatus
|
||||
template_id: str
|
||||
reason: Union[Unset, "BuildStatusReason"] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
build_id = self.build_id
|
||||
|
||||
log_entries = []
|
||||
for log_entries_item_data in self.log_entries:
|
||||
log_entries_item = log_entries_item_data.to_dict()
|
||||
log_entries.append(log_entries_item)
|
||||
|
||||
logs = self.logs
|
||||
|
||||
status = self.status.value
|
||||
|
||||
template_id = self.template_id
|
||||
|
||||
reason: Union[Unset, dict[str, Any]] = UNSET
|
||||
if not isinstance(self.reason, Unset):
|
||||
reason = self.reason.to_dict()
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"buildID": build_id,
|
||||
"logEntries": log_entries,
|
||||
"logs": logs,
|
||||
"status": status,
|
||||
"templateID": template_id,
|
||||
}
|
||||
)
|
||||
if reason is not UNSET:
|
||||
field_dict["reason"] = reason
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.build_log_entry import BuildLogEntry
|
||||
from ..models.build_status_reason import BuildStatusReason
|
||||
|
||||
d = dict(src_dict)
|
||||
build_id = d.pop("buildID")
|
||||
|
||||
log_entries = []
|
||||
_log_entries = d.pop("logEntries")
|
||||
for log_entries_item_data in _log_entries:
|
||||
log_entries_item = BuildLogEntry.from_dict(log_entries_item_data)
|
||||
|
||||
log_entries.append(log_entries_item)
|
||||
|
||||
logs = cast(list[str], d.pop("logs"))
|
||||
|
||||
status = TemplateBuildStatus(d.pop("status"))
|
||||
|
||||
template_id = d.pop("templateID")
|
||||
|
||||
_reason = d.pop("reason", UNSET)
|
||||
reason: Union[Unset, BuildStatusReason]
|
||||
if isinstance(_reason, Unset):
|
||||
reason = UNSET
|
||||
else:
|
||||
reason = BuildStatusReason.from_dict(_reason)
|
||||
|
||||
template_build_info = cls(
|
||||
build_id=build_id,
|
||||
log_entries=log_entries,
|
||||
logs=logs,
|
||||
status=status,
|
||||
template_id=template_id,
|
||||
reason=reason,
|
||||
)
|
||||
|
||||
template_build_info.additional_properties = d
|
||||
return template_build_info
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,73 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.build_log_entry import BuildLogEntry
|
||||
|
||||
|
||||
T = TypeVar("T", bound="TemplateBuildLogsResponse")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TemplateBuildLogsResponse:
|
||||
"""
|
||||
Attributes:
|
||||
logs (list['BuildLogEntry']): Build logs structured
|
||||
"""
|
||||
|
||||
logs: list["BuildLogEntry"]
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
logs = []
|
||||
for logs_item_data in self.logs:
|
||||
logs_item = logs_item_data.to_dict()
|
||||
logs.append(logs_item)
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"logs": logs,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.build_log_entry import BuildLogEntry
|
||||
|
||||
d = dict(src_dict)
|
||||
logs = []
|
||||
_logs = d.pop("logs")
|
||||
for logs_item_data in _logs:
|
||||
logs_item = BuildLogEntry.from_dict(logs_item_data)
|
||||
|
||||
logs.append(logs_item)
|
||||
|
||||
template_build_logs_response = cls(
|
||||
logs=logs,
|
||||
)
|
||||
|
||||
template_build_logs_response.additional_properties = d
|
||||
return template_build_logs_response
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,115 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, Union
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="TemplateBuildRequest")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TemplateBuildRequest:
|
||||
"""
|
||||
Attributes:
|
||||
dockerfile (str): Dockerfile for the template
|
||||
alias (Union[Unset, str]): Alias of the template
|
||||
cpu_count (Union[Unset, int]): CPU cores for the sandbox
|
||||
memory_mb (Union[Unset, int]): Memory for the sandbox in MiB
|
||||
ready_cmd (Union[Unset, str]): Ready check command to execute in the template after the build
|
||||
start_cmd (Union[Unset, str]): Start command to execute in the template after the build
|
||||
team_id (Union[Unset, str]): Identifier of the team
|
||||
"""
|
||||
|
||||
dockerfile: str
|
||||
alias: Union[Unset, str] = UNSET
|
||||
cpu_count: Union[Unset, int] = UNSET
|
||||
memory_mb: Union[Unset, int] = UNSET
|
||||
ready_cmd: Union[Unset, str] = UNSET
|
||||
start_cmd: Union[Unset, str] = UNSET
|
||||
team_id: Union[Unset, str] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
dockerfile = self.dockerfile
|
||||
|
||||
alias = self.alias
|
||||
|
||||
cpu_count = self.cpu_count
|
||||
|
||||
memory_mb = self.memory_mb
|
||||
|
||||
ready_cmd = self.ready_cmd
|
||||
|
||||
start_cmd = self.start_cmd
|
||||
|
||||
team_id = self.team_id
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"dockerfile": dockerfile,
|
||||
}
|
||||
)
|
||||
if alias is not UNSET:
|
||||
field_dict["alias"] = alias
|
||||
if cpu_count is not UNSET:
|
||||
field_dict["cpuCount"] = cpu_count
|
||||
if memory_mb is not UNSET:
|
||||
field_dict["memoryMB"] = memory_mb
|
||||
if ready_cmd is not UNSET:
|
||||
field_dict["readyCmd"] = ready_cmd
|
||||
if start_cmd is not UNSET:
|
||||
field_dict["startCmd"] = start_cmd
|
||||
if team_id is not UNSET:
|
||||
field_dict["teamID"] = team_id
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
dockerfile = d.pop("dockerfile")
|
||||
|
||||
alias = d.pop("alias", UNSET)
|
||||
|
||||
cpu_count = d.pop("cpuCount", UNSET)
|
||||
|
||||
memory_mb = d.pop("memoryMB", UNSET)
|
||||
|
||||
ready_cmd = d.pop("readyCmd", UNSET)
|
||||
|
||||
start_cmd = d.pop("startCmd", UNSET)
|
||||
|
||||
team_id = d.pop("teamID", UNSET)
|
||||
|
||||
template_build_request = cls(
|
||||
dockerfile=dockerfile,
|
||||
alias=alias,
|
||||
cpu_count=cpu_count,
|
||||
memory_mb=memory_mb,
|
||||
ready_cmd=ready_cmd,
|
||||
start_cmd=start_cmd,
|
||||
team_id=team_id,
|
||||
)
|
||||
|
||||
template_build_request.additional_properties = d
|
||||
return template_build_request
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,88 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, Union
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="TemplateBuildRequestV2")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TemplateBuildRequestV2:
|
||||
"""
|
||||
Attributes:
|
||||
alias (str): Alias of the template
|
||||
cpu_count (Union[Unset, int]): CPU cores for the sandbox
|
||||
memory_mb (Union[Unset, int]): Memory for the sandbox in MiB
|
||||
team_id (Union[Unset, str]): Identifier of the team
|
||||
"""
|
||||
|
||||
alias: str
|
||||
cpu_count: Union[Unset, int] = UNSET
|
||||
memory_mb: Union[Unset, int] = UNSET
|
||||
team_id: Union[Unset, str] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
alias = self.alias
|
||||
|
||||
cpu_count = self.cpu_count
|
||||
|
||||
memory_mb = self.memory_mb
|
||||
|
||||
team_id = self.team_id
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"alias": alias,
|
||||
}
|
||||
)
|
||||
if cpu_count is not UNSET:
|
||||
field_dict["cpuCount"] = cpu_count
|
||||
if memory_mb is not UNSET:
|
||||
field_dict["memoryMB"] = memory_mb
|
||||
if team_id is not UNSET:
|
||||
field_dict["teamID"] = team_id
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
alias = d.pop("alias")
|
||||
|
||||
cpu_count = d.pop("cpuCount", UNSET)
|
||||
|
||||
memory_mb = d.pop("memoryMB", UNSET)
|
||||
|
||||
team_id = d.pop("teamID", UNSET)
|
||||
|
||||
template_build_request_v2 = cls(
|
||||
alias=alias,
|
||||
cpu_count=cpu_count,
|
||||
memory_mb=memory_mb,
|
||||
team_id=team_id,
|
||||
)
|
||||
|
||||
template_build_request_v2.additional_properties = d
|
||||
return template_build_request_v2
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,107 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, Union, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="TemplateBuildRequestV3")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TemplateBuildRequestV3:
|
||||
"""
|
||||
Attributes:
|
||||
alias (Union[Unset, str]): Alias of the template. Deprecated, use name instead.
|
||||
cpu_count (Union[Unset, int]): CPU cores for the sandbox
|
||||
memory_mb (Union[Unset, int]): Memory for the sandbox in MiB
|
||||
name (Union[Unset, str]): Name of the template. Can include a tag with colon separator (e.g. "my-template" or
|
||||
"my-template:v1"). If tag is included, it will be treated as if the tag was provided in the tags array.
|
||||
tags (Union[Unset, list[str]]): Tags to assign to the template build
|
||||
team_id (Union[Unset, str]): Identifier of the team
|
||||
"""
|
||||
|
||||
alias: Union[Unset, str] = UNSET
|
||||
cpu_count: Union[Unset, int] = UNSET
|
||||
memory_mb: Union[Unset, int] = UNSET
|
||||
name: Union[Unset, str] = UNSET
|
||||
tags: Union[Unset, list[str]] = UNSET
|
||||
team_id: Union[Unset, str] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
alias = self.alias
|
||||
|
||||
cpu_count = self.cpu_count
|
||||
|
||||
memory_mb = self.memory_mb
|
||||
|
||||
name = self.name
|
||||
|
||||
tags: Union[Unset, list[str]] = UNSET
|
||||
if not isinstance(self.tags, Unset):
|
||||
tags = self.tags
|
||||
|
||||
team_id = self.team_id
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if alias is not UNSET:
|
||||
field_dict["alias"] = alias
|
||||
if cpu_count is not UNSET:
|
||||
field_dict["cpuCount"] = cpu_count
|
||||
if memory_mb is not UNSET:
|
||||
field_dict["memoryMB"] = memory_mb
|
||||
if name is not UNSET:
|
||||
field_dict["name"] = name
|
||||
if tags is not UNSET:
|
||||
field_dict["tags"] = tags
|
||||
if team_id is not UNSET:
|
||||
field_dict["teamID"] = team_id
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
alias = d.pop("alias", UNSET)
|
||||
|
||||
cpu_count = d.pop("cpuCount", UNSET)
|
||||
|
||||
memory_mb = d.pop("memoryMB", UNSET)
|
||||
|
||||
name = d.pop("name", UNSET)
|
||||
|
||||
tags = cast(list[str], d.pop("tags", UNSET))
|
||||
|
||||
team_id = d.pop("teamID", UNSET)
|
||||
|
||||
template_build_request_v3 = cls(
|
||||
alias=alias,
|
||||
cpu_count=cpu_count,
|
||||
memory_mb=memory_mb,
|
||||
name=name,
|
||||
tags=tags,
|
||||
team_id=team_id,
|
||||
)
|
||||
|
||||
template_build_request_v3.additional_properties = d
|
||||
return template_build_request_v3
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,184 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.aws_registry import AWSRegistry
|
||||
from ..models.gcp_registry import GCPRegistry
|
||||
from ..models.general_registry import GeneralRegistry
|
||||
from ..models.template_step import TemplateStep
|
||||
|
||||
|
||||
T = TypeVar("T", bound="TemplateBuildStartV2")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TemplateBuildStartV2:
|
||||
"""
|
||||
Attributes:
|
||||
force (Union[Unset, bool]): Whether the whole build should be forced to run regardless of the cache Default:
|
||||
False.
|
||||
from_image (Union[Unset, str]): Image to use as a base for the template build
|
||||
from_image_registry (Union['AWSRegistry', 'GCPRegistry', 'GeneralRegistry', Unset]):
|
||||
from_template (Union[Unset, str]): Template to use as a base for the template build
|
||||
ready_cmd (Union[Unset, str]): Ready check command to execute in the template after the build
|
||||
start_cmd (Union[Unset, str]): Start command to execute in the template after the build
|
||||
steps (Union[Unset, list['TemplateStep']]): List of steps to execute in the template build
|
||||
"""
|
||||
|
||||
force: Union[Unset, bool] = False
|
||||
from_image: Union[Unset, str] = UNSET
|
||||
from_image_registry: Union[
|
||||
"AWSRegistry", "GCPRegistry", "GeneralRegistry", Unset
|
||||
] = UNSET
|
||||
from_template: Union[Unset, str] = UNSET
|
||||
ready_cmd: Union[Unset, str] = UNSET
|
||||
start_cmd: Union[Unset, str] = UNSET
|
||||
steps: Union[Unset, list["TemplateStep"]] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.aws_registry import AWSRegistry
|
||||
from ..models.gcp_registry import GCPRegistry
|
||||
|
||||
force = self.force
|
||||
|
||||
from_image = self.from_image
|
||||
|
||||
from_image_registry: Union[Unset, dict[str, Any]]
|
||||
if isinstance(self.from_image_registry, Unset):
|
||||
from_image_registry = UNSET
|
||||
elif isinstance(self.from_image_registry, AWSRegistry):
|
||||
from_image_registry = self.from_image_registry.to_dict()
|
||||
elif isinstance(self.from_image_registry, GCPRegistry):
|
||||
from_image_registry = self.from_image_registry.to_dict()
|
||||
else:
|
||||
from_image_registry = self.from_image_registry.to_dict()
|
||||
|
||||
from_template = self.from_template
|
||||
|
||||
ready_cmd = self.ready_cmd
|
||||
|
||||
start_cmd = self.start_cmd
|
||||
|
||||
steps: Union[Unset, list[dict[str, Any]]] = UNSET
|
||||
if not isinstance(self.steps, Unset):
|
||||
steps = []
|
||||
for steps_item_data in self.steps:
|
||||
steps_item = steps_item_data.to_dict()
|
||||
steps.append(steps_item)
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if force is not UNSET:
|
||||
field_dict["force"] = force
|
||||
if from_image is not UNSET:
|
||||
field_dict["fromImage"] = from_image
|
||||
if from_image_registry is not UNSET:
|
||||
field_dict["fromImageRegistry"] = from_image_registry
|
||||
if from_template is not UNSET:
|
||||
field_dict["fromTemplate"] = from_template
|
||||
if ready_cmd is not UNSET:
|
||||
field_dict["readyCmd"] = ready_cmd
|
||||
if start_cmd is not UNSET:
|
||||
field_dict["startCmd"] = start_cmd
|
||||
if steps is not UNSET:
|
||||
field_dict["steps"] = steps
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.aws_registry import AWSRegistry
|
||||
from ..models.gcp_registry import GCPRegistry
|
||||
from ..models.general_registry import GeneralRegistry
|
||||
from ..models.template_step import TemplateStep
|
||||
|
||||
d = dict(src_dict)
|
||||
force = d.pop("force", UNSET)
|
||||
|
||||
from_image = d.pop("fromImage", UNSET)
|
||||
|
||||
def _parse_from_image_registry(
|
||||
data: object,
|
||||
) -> Union["AWSRegistry", "GCPRegistry", "GeneralRegistry", Unset]:
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
componentsschemas_from_image_registry_type_0 = AWSRegistry.from_dict(
|
||||
data
|
||||
)
|
||||
|
||||
return componentsschemas_from_image_registry_type_0
|
||||
except: # noqa: E722
|
||||
pass
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
componentsschemas_from_image_registry_type_1 = GCPRegistry.from_dict(
|
||||
data
|
||||
)
|
||||
|
||||
return componentsschemas_from_image_registry_type_1
|
||||
except: # noqa: E722
|
||||
pass
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
componentsschemas_from_image_registry_type_2 = GeneralRegistry.from_dict(
|
||||
data
|
||||
)
|
||||
|
||||
return componentsschemas_from_image_registry_type_2
|
||||
|
||||
from_image_registry = _parse_from_image_registry(
|
||||
d.pop("fromImageRegistry", UNSET)
|
||||
)
|
||||
|
||||
from_template = d.pop("fromTemplate", UNSET)
|
||||
|
||||
ready_cmd = d.pop("readyCmd", UNSET)
|
||||
|
||||
start_cmd = d.pop("startCmd", UNSET)
|
||||
|
||||
steps = []
|
||||
_steps = d.pop("steps", UNSET)
|
||||
for steps_item_data in _steps or []:
|
||||
steps_item = TemplateStep.from_dict(steps_item_data)
|
||||
|
||||
steps.append(steps_item)
|
||||
|
||||
template_build_start_v2 = cls(
|
||||
force=force,
|
||||
from_image=from_image,
|
||||
from_image_registry=from_image_registry,
|
||||
from_template=from_template,
|
||||
ready_cmd=ready_cmd,
|
||||
start_cmd=start_cmd,
|
||||
steps=steps,
|
||||
)
|
||||
|
||||
template_build_start_v2.additional_properties = d
|
||||
return template_build_start_v2
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,11 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class TemplateBuildStatus(str, Enum):
|
||||
BUILDING = "building"
|
||||
ERROR = "error"
|
||||
READY = "ready"
|
||||
WAITING = "waiting"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
||||
@@ -0,0 +1,207 @@
|
||||
import datetime
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.team_user import TeamUser
|
||||
|
||||
|
||||
T = TypeVar("T", bound="TemplateLegacy")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TemplateLegacy:
|
||||
"""
|
||||
Attributes:
|
||||
aliases (list[str]): Aliases of the template
|
||||
build_count (int): Number of times the template was built
|
||||
build_id (str): Identifier of the last successful build for given template
|
||||
cpu_count (int): CPU cores for the sandbox
|
||||
created_at (datetime.datetime): Time when the template was created
|
||||
created_by (Union['TeamUser', None]):
|
||||
disk_size_mb (int): Disk size for the sandbox in MiB
|
||||
envd_version (str): Version of the envd running in the sandbox
|
||||
last_spawned_at (Union[None, datetime.datetime]): Time when the template was last used
|
||||
memory_mb (int): Memory for the sandbox in MiB
|
||||
public (bool): Whether the template is public or only accessible by the team
|
||||
spawn_count (int): Number of times the template was used
|
||||
template_id (str): Identifier of the template
|
||||
updated_at (datetime.datetime): Time when the template was last updated
|
||||
"""
|
||||
|
||||
aliases: list[str]
|
||||
build_count: int
|
||||
build_id: str
|
||||
cpu_count: int
|
||||
created_at: datetime.datetime
|
||||
created_by: Union["TeamUser", None]
|
||||
disk_size_mb: int
|
||||
envd_version: str
|
||||
last_spawned_at: Union[None, datetime.datetime]
|
||||
memory_mb: int
|
||||
public: bool
|
||||
spawn_count: int
|
||||
template_id: str
|
||||
updated_at: datetime.datetime
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.team_user import TeamUser
|
||||
|
||||
aliases = self.aliases
|
||||
|
||||
build_count = self.build_count
|
||||
|
||||
build_id = self.build_id
|
||||
|
||||
cpu_count = self.cpu_count
|
||||
|
||||
created_at = self.created_at.isoformat()
|
||||
|
||||
created_by: Union[None, dict[str, Any]]
|
||||
if isinstance(self.created_by, TeamUser):
|
||||
created_by = self.created_by.to_dict()
|
||||
else:
|
||||
created_by = self.created_by
|
||||
|
||||
disk_size_mb = self.disk_size_mb
|
||||
|
||||
envd_version = self.envd_version
|
||||
|
||||
last_spawned_at: Union[None, str]
|
||||
if isinstance(self.last_spawned_at, datetime.datetime):
|
||||
last_spawned_at = self.last_spawned_at.isoformat()
|
||||
else:
|
||||
last_spawned_at = self.last_spawned_at
|
||||
|
||||
memory_mb = self.memory_mb
|
||||
|
||||
public = self.public
|
||||
|
||||
spawn_count = self.spawn_count
|
||||
|
||||
template_id = self.template_id
|
||||
|
||||
updated_at = self.updated_at.isoformat()
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"aliases": aliases,
|
||||
"buildCount": build_count,
|
||||
"buildID": build_id,
|
||||
"cpuCount": cpu_count,
|
||||
"createdAt": created_at,
|
||||
"createdBy": created_by,
|
||||
"diskSizeMB": disk_size_mb,
|
||||
"envdVersion": envd_version,
|
||||
"lastSpawnedAt": last_spawned_at,
|
||||
"memoryMB": memory_mb,
|
||||
"public": public,
|
||||
"spawnCount": spawn_count,
|
||||
"templateID": template_id,
|
||||
"updatedAt": updated_at,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.team_user import TeamUser
|
||||
|
||||
d = dict(src_dict)
|
||||
aliases = cast(list[str], d.pop("aliases"))
|
||||
|
||||
build_count = d.pop("buildCount")
|
||||
|
||||
build_id = d.pop("buildID")
|
||||
|
||||
cpu_count = d.pop("cpuCount")
|
||||
|
||||
created_at = isoparse(d.pop("createdAt"))
|
||||
|
||||
def _parse_created_by(data: object) -> Union["TeamUser", None]:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
created_by_type_1 = TeamUser.from_dict(data)
|
||||
|
||||
return created_by_type_1
|
||||
except: # noqa: E722
|
||||
pass
|
||||
return cast(Union["TeamUser", None], data)
|
||||
|
||||
created_by = _parse_created_by(d.pop("createdBy"))
|
||||
|
||||
disk_size_mb = d.pop("diskSizeMB")
|
||||
|
||||
envd_version = d.pop("envdVersion")
|
||||
|
||||
def _parse_last_spawned_at(data: object) -> Union[None, datetime.datetime]:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, str):
|
||||
raise TypeError()
|
||||
last_spawned_at_type_0 = isoparse(data)
|
||||
|
||||
return last_spawned_at_type_0
|
||||
except: # noqa: E722
|
||||
pass
|
||||
return cast(Union[None, datetime.datetime], data)
|
||||
|
||||
last_spawned_at = _parse_last_spawned_at(d.pop("lastSpawnedAt"))
|
||||
|
||||
memory_mb = d.pop("memoryMB")
|
||||
|
||||
public = d.pop("public")
|
||||
|
||||
spawn_count = d.pop("spawnCount")
|
||||
|
||||
template_id = d.pop("templateID")
|
||||
|
||||
updated_at = isoparse(d.pop("updatedAt"))
|
||||
|
||||
template_legacy = cls(
|
||||
aliases=aliases,
|
||||
build_count=build_count,
|
||||
build_id=build_id,
|
||||
cpu_count=cpu_count,
|
||||
created_at=created_at,
|
||||
created_by=created_by,
|
||||
disk_size_mb=disk_size_mb,
|
||||
envd_version=envd_version,
|
||||
last_spawned_at=last_spawned_at,
|
||||
memory_mb=memory_mb,
|
||||
public=public,
|
||||
spawn_count=spawn_count,
|
||||
template_id=template_id,
|
||||
updated_at=updated_at,
|
||||
)
|
||||
|
||||
template_legacy.additional_properties = d
|
||||
return template_legacy
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,99 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="TemplateRequestResponseV3")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TemplateRequestResponseV3:
|
||||
"""
|
||||
Attributes:
|
||||
aliases (list[str]): Aliases of the template
|
||||
build_id (str): Identifier of the last successful build for given template
|
||||
names (list[str]): Names of the template
|
||||
public (bool): Whether the template is public or only accessible by the team
|
||||
tags (list[str]): Tags assigned to the template build
|
||||
template_id (str): Identifier of the template
|
||||
"""
|
||||
|
||||
aliases: list[str]
|
||||
build_id: str
|
||||
names: list[str]
|
||||
public: bool
|
||||
tags: list[str]
|
||||
template_id: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
aliases = self.aliases
|
||||
|
||||
build_id = self.build_id
|
||||
|
||||
names = self.names
|
||||
|
||||
public = self.public
|
||||
|
||||
tags = self.tags
|
||||
|
||||
template_id = self.template_id
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"aliases": aliases,
|
||||
"buildID": build_id,
|
||||
"names": names,
|
||||
"public": public,
|
||||
"tags": tags,
|
||||
"templateID": template_id,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
aliases = cast(list[str], d.pop("aliases"))
|
||||
|
||||
build_id = d.pop("buildID")
|
||||
|
||||
names = cast(list[str], d.pop("names"))
|
||||
|
||||
public = d.pop("public")
|
||||
|
||||
tags = cast(list[str], d.pop("tags"))
|
||||
|
||||
template_id = d.pop("templateID")
|
||||
|
||||
template_request_response_v3 = cls(
|
||||
aliases=aliases,
|
||||
build_id=build_id,
|
||||
names=names,
|
||||
public=public,
|
||||
tags=tags,
|
||||
template_id=template_id,
|
||||
)
|
||||
|
||||
template_request_response_v3.additional_properties = d
|
||||
return template_request_response_v3
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,91 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, Union, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="TemplateStep")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TemplateStep:
|
||||
"""Step in the template build process
|
||||
|
||||
Attributes:
|
||||
type_ (str): Type of the step
|
||||
args (Union[Unset, list[str]]): Arguments for the step
|
||||
files_hash (Union[Unset, str]): Hash of the files used in the step
|
||||
force (Union[Unset, bool]): Whether the step should be forced to run regardless of the cache Default: False.
|
||||
"""
|
||||
|
||||
type_: str
|
||||
args: Union[Unset, list[str]] = UNSET
|
||||
files_hash: Union[Unset, str] = UNSET
|
||||
force: Union[Unset, bool] = False
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
type_ = self.type_
|
||||
|
||||
args: Union[Unset, list[str]] = UNSET
|
||||
if not isinstance(self.args, Unset):
|
||||
args = self.args
|
||||
|
||||
files_hash = self.files_hash
|
||||
|
||||
force = self.force
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"type": type_,
|
||||
}
|
||||
)
|
||||
if args is not UNSET:
|
||||
field_dict["args"] = args
|
||||
if files_hash is not UNSET:
|
||||
field_dict["filesHash"] = files_hash
|
||||
if force is not UNSET:
|
||||
field_dict["force"] = force
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
type_ = d.pop("type")
|
||||
|
||||
args = cast(list[str], d.pop("args", UNSET))
|
||||
|
||||
files_hash = d.pop("filesHash", UNSET)
|
||||
|
||||
force = d.pop("force", UNSET)
|
||||
|
||||
template_step = cls(
|
||||
type_=type_,
|
||||
args=args,
|
||||
files_hash=files_hash,
|
||||
force=force,
|
||||
)
|
||||
|
||||
template_step.additional_properties = d
|
||||
return template_step
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,78 @@
|
||||
import datetime
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
from uuid import UUID
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
T = TypeVar("T", bound="TemplateTag")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TemplateTag:
|
||||
"""
|
||||
Attributes:
|
||||
build_id (UUID): Identifier of the build associated with this tag
|
||||
created_at (datetime.datetime): Time when the tag was assigned
|
||||
tag (str): The tag name
|
||||
"""
|
||||
|
||||
build_id: UUID
|
||||
created_at: datetime.datetime
|
||||
tag: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
build_id = str(self.build_id)
|
||||
|
||||
created_at = self.created_at.isoformat()
|
||||
|
||||
tag = self.tag
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"buildID": build_id,
|
||||
"createdAt": created_at,
|
||||
"tag": tag,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
build_id = UUID(d.pop("buildID"))
|
||||
|
||||
created_at = isoparse(d.pop("createdAt"))
|
||||
|
||||
tag = d.pop("tag")
|
||||
|
||||
template_tag = cls(
|
||||
build_id=build_id,
|
||||
created_at=created_at,
|
||||
tag=tag,
|
||||
)
|
||||
|
||||
template_tag.additional_properties = d
|
||||
return template_tag
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,59 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, Union
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="TemplateUpdateRequest")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TemplateUpdateRequest:
|
||||
"""
|
||||
Attributes:
|
||||
public (Union[Unset, bool]): Whether the template is public or only accessible by the team
|
||||
"""
|
||||
|
||||
public: Union[Unset, bool] = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
public = self.public
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if public is not UNSET:
|
||||
field_dict["public"] = public
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
public = d.pop("public", UNSET)
|
||||
|
||||
template_update_request = cls(
|
||||
public=public,
|
||||
)
|
||||
|
||||
template_update_request.additional_properties = d
|
||||
return template_update_request
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,59 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="TemplateUpdateResponse")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TemplateUpdateResponse:
|
||||
"""
|
||||
Attributes:
|
||||
names (list[str]): Names of the template (namespace/alias format when namespaced)
|
||||
"""
|
||||
|
||||
names: list[str]
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
names = self.names
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"names": names,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
names = cast(list[str], d.pop("names"))
|
||||
|
||||
template_update_response = cls(
|
||||
names=names,
|
||||
)
|
||||
|
||||
template_update_response.additional_properties = d
|
||||
return template_update_response
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,156 @@
|
||||
import datetime
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.template_build import TemplateBuild
|
||||
|
||||
|
||||
T = TypeVar("T", bound="TemplateWithBuilds")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class TemplateWithBuilds:
|
||||
"""
|
||||
Attributes:
|
||||
aliases (list[str]): Aliases of the template
|
||||
builds (list['TemplateBuild']): List of builds for the template
|
||||
created_at (datetime.datetime): Time when the template was created
|
||||
last_spawned_at (Union[None, datetime.datetime]): Time when the template was last used
|
||||
names (list[str]): Names of the template (namespace/alias format when namespaced)
|
||||
public (bool): Whether the template is public or only accessible by the team
|
||||
spawn_count (int): Number of times the template was used
|
||||
template_id (str): Identifier of the template
|
||||
updated_at (datetime.datetime): Time when the template was last updated
|
||||
"""
|
||||
|
||||
aliases: list[str]
|
||||
builds: list["TemplateBuild"]
|
||||
created_at: datetime.datetime
|
||||
last_spawned_at: Union[None, datetime.datetime]
|
||||
names: list[str]
|
||||
public: bool
|
||||
spawn_count: int
|
||||
template_id: str
|
||||
updated_at: datetime.datetime
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
aliases = self.aliases
|
||||
|
||||
builds = []
|
||||
for builds_item_data in self.builds:
|
||||
builds_item = builds_item_data.to_dict()
|
||||
builds.append(builds_item)
|
||||
|
||||
created_at = self.created_at.isoformat()
|
||||
|
||||
last_spawned_at: Union[None, str]
|
||||
if isinstance(self.last_spawned_at, datetime.datetime):
|
||||
last_spawned_at = self.last_spawned_at.isoformat()
|
||||
else:
|
||||
last_spawned_at = self.last_spawned_at
|
||||
|
||||
names = self.names
|
||||
|
||||
public = self.public
|
||||
|
||||
spawn_count = self.spawn_count
|
||||
|
||||
template_id = self.template_id
|
||||
|
||||
updated_at = self.updated_at.isoformat()
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"aliases": aliases,
|
||||
"builds": builds,
|
||||
"createdAt": created_at,
|
||||
"lastSpawnedAt": last_spawned_at,
|
||||
"names": names,
|
||||
"public": public,
|
||||
"spawnCount": spawn_count,
|
||||
"templateID": template_id,
|
||||
"updatedAt": updated_at,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.template_build import TemplateBuild
|
||||
|
||||
d = dict(src_dict)
|
||||
aliases = cast(list[str], d.pop("aliases"))
|
||||
|
||||
builds = []
|
||||
_builds = d.pop("builds")
|
||||
for builds_item_data in _builds:
|
||||
builds_item = TemplateBuild.from_dict(builds_item_data)
|
||||
|
||||
builds.append(builds_item)
|
||||
|
||||
created_at = isoparse(d.pop("createdAt"))
|
||||
|
||||
def _parse_last_spawned_at(data: object) -> Union[None, datetime.datetime]:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, str):
|
||||
raise TypeError()
|
||||
last_spawned_at_type_0 = isoparse(data)
|
||||
|
||||
return last_spawned_at_type_0
|
||||
except: # noqa: E722
|
||||
pass
|
||||
return cast(Union[None, datetime.datetime], data)
|
||||
|
||||
last_spawned_at = _parse_last_spawned_at(d.pop("lastSpawnedAt"))
|
||||
|
||||
names = cast(list[str], d.pop("names"))
|
||||
|
||||
public = d.pop("public")
|
||||
|
||||
spawn_count = d.pop("spawnCount")
|
||||
|
||||
template_id = d.pop("templateID")
|
||||
|
||||
updated_at = isoparse(d.pop("updatedAt"))
|
||||
|
||||
template_with_builds = cls(
|
||||
aliases=aliases,
|
||||
builds=builds,
|
||||
created_at=created_at,
|
||||
last_spawned_at=last_spawned_at,
|
||||
names=names,
|
||||
public=public,
|
||||
spawn_count=spawn_count,
|
||||
template_id=template_id,
|
||||
updated_at=updated_at,
|
||||
)
|
||||
|
||||
template_with_builds.additional_properties = d
|
||||
return template_with_builds
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,59 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="UpdateTeamAPIKey")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class UpdateTeamAPIKey:
|
||||
"""
|
||||
Attributes:
|
||||
name (str): New name for the API key
|
||||
"""
|
||||
|
||||
name: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
name = self.name
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"name": name,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
name = d.pop("name")
|
||||
|
||||
update_team_api_key = cls(
|
||||
name=name,
|
||||
)
|
||||
|
||||
update_team_api_key.additional_properties = d
|
||||
return update_team_api_key
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="Volume")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class Volume:
|
||||
"""
|
||||
Attributes:
|
||||
name (str): Name of the volume
|
||||
volume_id (str): ID of the volume
|
||||
"""
|
||||
|
||||
name: str
|
||||
volume_id: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
name = self.name
|
||||
|
||||
volume_id = self.volume_id
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"name": name,
|
||||
"volumeID": volume_id,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
name = d.pop("name")
|
||||
|
||||
volume_id = d.pop("volumeID")
|
||||
|
||||
volume = cls(
|
||||
name=name,
|
||||
volume_id=volume_id,
|
||||
)
|
||||
|
||||
volume.additional_properties = d
|
||||
return volume
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,75 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="VolumeAndToken")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class VolumeAndToken:
|
||||
"""
|
||||
Attributes:
|
||||
name (str): Name of the volume
|
||||
token (str): Auth token to use for interacting with volume content
|
||||
volume_id (str): ID of the volume
|
||||
"""
|
||||
|
||||
name: str
|
||||
token: str
|
||||
volume_id: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
name = self.name
|
||||
|
||||
token = self.token
|
||||
|
||||
volume_id = self.volume_id
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"name": name,
|
||||
"token": token,
|
||||
"volumeID": volume_id,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
name = d.pop("name")
|
||||
|
||||
token = d.pop("token")
|
||||
|
||||
volume_id = d.pop("volumeID")
|
||||
|
||||
volume_and_token = cls(
|
||||
name=name,
|
||||
token=token,
|
||||
volume_id=volume_id,
|
||||
)
|
||||
|
||||
volume_and_token.additional_properties = d
|
||||
return volume_and_token
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,59 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="VolumeToken")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class VolumeToken:
|
||||
"""
|
||||
Attributes:
|
||||
token (str):
|
||||
"""
|
||||
|
||||
token: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
token = self.token
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"token": token,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
token = d.pop("token")
|
||||
|
||||
volume_token = cls(
|
||||
token=token,
|
||||
)
|
||||
|
||||
volume_token.additional_properties = d
|
||||
return volume_token
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
Reference in New Issue
Block a user