Debian Codegraph @

hass_nabucasa/accounts_api.py

raw
1 """Manage accounts API."""
2
3 from __future__ import annotations
4
5 from .api import ApiBase, CloudApiError, api_exception_handler
6
7
8 class AccountsApiError(CloudApiError):
9 """Exception raised when handling account API."""
10
11
12 class AccountsApi(ApiBase):
13 """Class to help communicate with the accounts API."""
14
15 @api_exception_handler(AccountsApiError)
16 async def instance_resolve_dns_cname(self, *, hostname: str) -> list[str]:
17 """Resolve DNS CNAME."""
18 details: list[str] = await self._call_cloud_api(
19 method="POST",
20 action="remote_access_resolve_dns_cname",
21 jsondata={"hostname": hostname},
22 )
23 return details