Skip to content

Tokens

Implementations for the tokens endpoint.

Tokens

Bases: HTTPAwareEndpoint

A class with implementations for the tokens endpoint.

Source code in ravyapi/api/endpoints/tokens.py
class Tokens(HTTPAwareEndpoint):
    """A class with implementations for the `tokens` endpoint."""

    __slots__: tuple[str, ...] = ()

    async def get_token(self: HTTPAwareEndpoint) -> GetTokenResponse:
        """Get current token information.

        Returns
        -------
        GetTokenResponse
            A model response from `ravyapi.api.endpoints.tokens.Tokens.get_token`.
            Located as `ravyapi.api.models.tokens.GetTokenResponse`.
        """
        return GetTokenResponse(await self._http.get(self._http.paths.tokens.route))

get_token() async

Get current token information.

Returns

GetTokenResponse A model response from ravyapi.api.endpoints.tokens.Tokens.get_token. Located as ravyapi.api.models.tokens.GetTokenResponse.

Source code in ravyapi/api/endpoints/tokens.py
async def get_token(self: HTTPAwareEndpoint) -> GetTokenResponse:
    """Get current token information.

    Returns
    -------
    GetTokenResponse
        A model response from `ravyapi.api.endpoints.tokens.Tokens.get_token`.
        Located as `ravyapi.api.models.tokens.GetTokenResponse`.
    """
    return GetTokenResponse(await self._http.get(self._http.paths.tokens.route))