import typing as _typing

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


class CloudapiLbGetResultModel(_base.BaseAPIResultModel):
    account_id: int
    acl: list[_typing.Any]
    backend_ha_ip_addr: str
    backends: list[_nested.LBBackendAPIResultNM]
    created_by: str
    created_timestamp: int
    deleted_by: str
    deleted_timestamp: int
    description: str
    dp_api_user: str
    ext_net_id: int
    frontend_ha_ip_addr: str
    frontends: list[_nested.LBFrontendAPIResultNM]
    grid_id: int
    guid: int
    ha_mode: bool
    id: int
    manager_id: int
    manager_type: str
    milestones: int
    name: str
    part_of_k8s: bool
    primary_node: _nested.LBNodeAPIResultNM
    rg_id: int
    rg_name: str
    secondary_node: _nested.LBNodeAPIResultNM
    status: _nested.LBStatus
    sysctl_params: dict[str, str]
    tech_status: _nested.LBTechStatus
    updated_by: str
    updated_timestamp: int
    user_managed: bool
    vins_id: int
    zone_id: int

    @_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 CloudapiLbGetProtocol(_base.BasePostAPIFunctionProtocol):
    def get(
        self,
        *,
        lb_id: int,
    ) -> CloudapiLbGetResultModel:
        ...
