o
    ¨ÝjP$  ã                   @  s   d dl mZ d dlZddlmZ ddlmZmZmZm	Z	m
Z
mZmZ ddlmZmZ ddlmZ ddlmZmZ dd	lmZmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlm Z  ddgZ!G dd„ deƒZ"G dd„ deƒZ#G dd„ dƒZ$G dd„ dƒZ%G dd„ dƒZ&G dd„ dƒZ'dS )é    )ÚannotationsNé   )Ú_legacy_response)ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚomitÚ	not_given)Úmaybe_transformÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)Úmake_request_options)Ú,RealtimeTranslationSessionCreateRequestParam)Úclient_secret_create_params)Ú-RealtimeTranslationClientSecretCreateResponseÚClientSecretsÚAsyncClientSecretsc                   @  ó@   e Zd Zeddd„ƒZeddd„ƒZeddded	œddd„ZdS )r   ÚreturnÚClientSecretsWithRawResponsec                 C  ó   t | ƒS ©a  
        This property can be used as a prefix for any HTTP method call to return
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
        )r   ©Úself© r    úp/var/www/html/chatgpt/venv/lib/python3.10/site-packages/openai/resources/realtime/translations/client_secrets.pyÚwith_raw_response   ó   zClientSecrets.with_raw_responseÚ"ClientSecretsWithStreamingResponsec                 C  r   ©zÌ
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/openai/openai-python#with_streaming_response
        )r$   r   r    r    r!   Úwith_streaming_response%   ó   z%ClientSecrets.with_streaming_responseN©Úexpires_afterÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚsessionr   r)   ú/client_secret_create_params.ExpiresAfter | Omitr*   úHeaders | Noner+   úQuery | Noner,   úBody | Noner-   ú(float | httpx2.Timeout | None | NotGivenr   c             
   C  s2   | j dt||dœtjƒt||||ddid�td�S )áo  
        Create a Realtime translation client secret with an associated translation
        session configuration.

        Client secrets are short-lived tokens that can be passed to a client app,
        such as a web frontend or mobile client, which grants access to the Realtime
        Translation API without leaking your main API key. You can configure a custom
        TTL for each client secret.

        Returns the created client secret and the effective translation session object.
        The client secret is a string that looks like `ek_1234`.

        Args:
          session: Realtime translation session configuration. Translation sessions stream source
              audio in and translated audio plus transcript deltas out continuously.

          expires_after: Configuration for the client secret expiration. Expiration refers to the time
              after which a client secret will no longer be valid for creating sessions. The
              session itself may continue after that time once started. A secret can be used
              to create multiple sessions until it expires.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        ú%/realtime/translations/client_secrets©r.   r)   Úbearer_authT©r*   r+   r,   r-   Úsecurity©ÚbodyÚoptionsZcast_to)Ú_postr   r   ÚClientSecretCreateParamsr   r   ©r   r.   r)   r*   r+   r,   r-   r    r    r!   Úcreate.   s"   )þûûðzClientSecrets.create)r   r   )r   r$   ©r.   r   r)   r/   r*   r0   r+   r1   r,   r2   r-   r3   r   r   ©	Ú__name__Ú
__module__Ú__qualname__r   r"   r&   r
   r   r@   r    r    r    r!   r      ó    	öc                   @  r   )r   r   Ú!AsyncClientSecretsWithRawResponsec                 C  r   r   )rG   r   r    r    r!   r"   l   r#   z$AsyncClientSecrets.with_raw_responseÚ'AsyncClientSecretsWithStreamingResponsec                 C  r   r%   )rH   r   r    r    r!   r&   v   r'   z*AsyncClientSecrets.with_streaming_responseNr(   r.   r   r)   r/   r*   r0   r+   r1   r,   r2   r-   r3   r   c             
   Ã  s@   �| j dt||dœtjƒI dH t||||ddid�td�I dH S )r4   r5   r6   Nr7   Tr8   r:   )r=   r   r   r>   r   r   r?   r    r    r!   r@      s$   €)þûûðzAsyncClientSecrets.create)r   rG   )r   rH   rA   rB   r    r    r    r!   r   k   rF   c                   @  ó   e Zd Zddd„ZdS )	r   Úclient_secretsr   r   ÚNonec                 C  ó   || _ t |j¡| _d S ©N)Ú_client_secretsr   Zto_raw_response_wrapperr@   ©r   rJ   r    r    r!   Ú__init__½   ó   
ÿz%ClientSecretsWithRawResponse.__init__N©rJ   r   r   rK   ©rC   rD   rE   rP   r    r    r    r!   r   ¼   ó    r   c                   @  rI   )	rG   rJ   r   r   rK   c                 C  rL   rM   )rN   r   Zasync_to_raw_response_wrapperr@   rO   r    r    r!   rP   Æ   rQ   z*AsyncClientSecretsWithRawResponse.__init__N©rJ   r   r   rK   rS   r    r    r    r!   rG   Å   rT   rG   c                   @  rI   )	r$   rJ   r   r   rK   c                 C  ó   || _ t|jƒ| _d S rM   )rN   r   r@   rO   r    r    r!   rP   Ï   ó   
ÿz+ClientSecretsWithStreamingResponse.__init__NrR   rS   r    r    r    r!   r$   Î   rT   r$   c                   @  rI   )	rH   rJ   r   r   rK   c                 C  rV   rM   )rN   r   r@   rO   r    r    r!   rP   Ø   rW   z0AsyncClientSecretsWithStreamingResponse.__init__NrU   rS   r    r    r    r!   rH   ×   rT   rH   )(Ú
__future__r   Zhttpx2Ú r   Ú_typesr   r   r   r   r	   r
   r   Z_utilsr   r   Z_compatr   Z	_resourcer   r   Ú	_responser   r   Z_base_clientr   Ztypes.realtimer   Ztypes.realtime.translationsr   Z@types.realtime.realtime_translation_session_create_request_paramZAtypes.realtime.realtime_translation_client_secret_create_responser   Ú__all__r   r   r   rG   r$   rH   r    r    r    r!   Ú<module>   s(   $QQ			