import dynamix_sdk.base as _base
import dynamix_sdk.api._nested as _nested


class CloudapiDisksGetResultModel(_base.BaseAPIResultModel):
    account_id: int
    account_name: str
    acl: dict
    created_by: str
    created_timestamp: int
    deleted_by: str
    deleted_timestamp: int
    description: str
    destruction_timestamp: int
    device_name: str | None = None
    grid_id: int
    id: int
    image_id: int
    image_ids: list[int]
    io_tune: _nested.IOTuneAPIResultNM
    milestones: int
    name: str
    params: str
    parent_id: int
    present_to: dict[str, int]
    purge_timestamp: int
    replication: _nested.ReplicationAPIResultNM | dict
    res_id: str
    res_name: str
    role: str
    sep_id: int
    sep_pool_name: str
    sep_type: _nested.SEPType
    shared: bool
    size_available: float
    size_max_gb: int
    size_used: float
    snapshots: list[_nested.SnapshotAPIResultNM]
    status: _nested.DiskStatus
    storage_policy_id: int
    tech_status: _nested.DiskTechStatus
    to_clean: bool
    type: _nested.DiskType
    updated_by: str
    vm_id: int | None
    vm_name: str | None
    vms: dict[str, str]
    updated_timestamp: int = 0

    @property
    def created_datetime(self):
        return self._get_datetime_from_timestamp(self.created_timestamp)

    @property
    def deleted_datetime(self):
        return self._get_datetime_from_timestamp(self.deleted_timestamp)

    @property
    def destruction_datetime(self):
        return self._get_datetime_from_timestamp(self.destruction_timestamp)

    @property
    def purge_datetime(self):
        return self._get_datetime_from_timestamp(self.purge_timestamp)

    @property
    def updated_datetime(self):
        return self._get_datetime_from_timestamp(self.updated_timestamp)


class CloudapiDisksGetProtocol(_base.BasePostAPIFunctionProtocol):
    def get(
        self,
        *,
        disk_id: int,
    ) -> CloudapiDisksGetResultModel: ...
