o
    i9                     @   sn   d dl Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	m
Z
 e e jdZG d	d
 d
ZG dd dZdS )    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)GrantV1Response   )AsyncRawTokensClientRawTokensClient.c                   @   V   e Zd ZdefddZedefddZeddd	e	j
e d
e	j
e defddZdS )TokensClientclient_wrapperc                C      t |d| _d S N)r   )r	   _raw_clientselfr    r   R/home/ubuntu/.local/lib/python3.10/site-packages/deepgram/auth/v1/tokens/client.py__init__      zTokensClient.__init__returnc                 C      | j S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawTokensClient
        r   r   r   r   r   with_raw_response      	zTokensClient.with_raw_responseNttl_secondsrequest_optionsr   r   c                C   s   | j j||d}|jS )a.  
        Generates a temporary JSON Web Token (JWT) with a 30-second (by default) TTL and usage::write permission for core voice APIs, requiring an API key with Member or higher authorization. Tokens created with this endpoint will not work with the Manage APIs.

        Parameters
        ----------
        ttl_seconds : typing.Optional[float]
            Time to live in seconds for the token. Defaults to 30 seconds.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GrantV1Response
            Grant response

        Examples
        --------
        from deepgram import DeepgramClient

        client = DeepgramClient(
            api_key="YOUR_API_KEY",
        )
        client.auth.v1.tokens.grant()
        r   r   grantdatar   r   r   	_responser   r   r   r       s   zTokensClient.grant)__name__
__module____qualname__r   r   propertyr	   r   OMITtypingOptionalfloatr   r   r    r   r   r   r   r          r   c                   @   r
   )AsyncTokensClientr   c                C   r   r   )r   r   r   r   r   r   r   >   r   zAsyncTokensClient.__init__r   c                 C   r   )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawTokensClient
        r   r   r   r   r   r   A   r   z#AsyncTokensClient.with_raw_responseNr   r   r   c                   s   | j j||dI dH }|jS )a  
        Generates a temporary JSON Web Token (JWT) with a 30-second (by default) TTL and usage::write permission for core voice APIs, requiring an API key with Member or higher authorization. Tokens created with this endpoint will not work with the Manage APIs.

        Parameters
        ----------
        ttl_seconds : typing.Optional[float]
            Time to live in seconds for the token. Defaults to 30 seconds.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GrantV1Response
            Grant response

        Examples
        --------
        import asyncio

        from deepgram import AsyncDeepgramClient

        client = AsyncDeepgramClient(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.auth.v1.tokens.grant()


        asyncio.run(main())
        r   Nr   r"   r   r   r   r    L   s   $zAsyncTokensClient.grant)r$   r%   r&   r   r   r'   r   r   r(   r)   r*   r+   r   r   r    r   r   r   r   r-   =   r,   r-   )r)   core.client_wrapperr   r   core.request_optionsr   types.grant_v1responser   
raw_clientr   r	   castAnyr(   r   r-   r   r   r   r   <module>   s   /