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


class CloudapiBserviceGroupGetResultModel(
    _base.BaseAPIResultModel,
):
    account_id: int
    account_name: str
    bservice_id: int
    consistency: bool
    cpu_count: int
    created_by: str
    created_timestamp: int
    deleted_by: str
    deleted_timestamp: int
    boot_disk_size_gb: int
    driver: _nested.Driver
    extnet_ids: list[int]
    grid_id: int
    guid: int
    id: int
    image_id: int
    milestones: int
    name: str
    parent_ids: list[int]
    ram_size_mb: int
    rg_id: int
    rg_name: str
    role: str
    sep_id: int
    sep_pool_name: str
    seq_no: int
    status: _nested.BServiceGroupStatus
    tech_status: _nested.BServiceGroupTechStatus
    start_timeout: int
    updated_by: str
    updated_timestamp: int
    vins_ids: list[int]
    vms: list[_nested.BServiceGroupVMAPIResultNM]

    @_base.computed_field
    def created_datetime(self) -> _base.datetime | None:
        return self._get_datetime_from_timestamp(self.created_timestamp)

    @_base.computed_field
    def deleted_datetime(self) -> _base.datetime | None:
        return self._get_datetime_from_timestamp(self.deleted_timestamp)

    @_base.computed_field
    def updated_datetime(self) -> _base.datetime | None:
        return self._get_datetime_from_timestamp(self.updated_timestamp)


class CloudapiBserviceGroupGetProtocol(_base.BasePostAPIFunctionProtocol):
    def group_get(
        self, *,
        bservice_id: int,
        bsgroup_id: int
    ) -> CloudapiBserviceGroupGetResultModel:
        ...
