o
    ¨ÝjÂ\  ã                   @  sX  d dl mZ d dlmZmZ d dlZddlmZ ddlm	Z	 ddl
mZmZmZmZmZmZmZmZ ddlmZmZ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!m"Z" ddl#m$Z$m%Z%m&Z& ddl'm(Z(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ƒZ0G dd„ dƒZ1G dd„ dƒZ2G dd„ dƒZ3G dd„ dƒZ4dS )é    )Úannotations)ÚMappingÚcastNé   )Ú_legacy_response)Údeepcopy_with_paths)ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚ	FileTypesÚomitÚ	not_given)Úextract_filesÚpath_templateÚmaybe_transformÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)ÚSyncCursorPageÚAsyncCursorPage)Úvoice_consent_list_paramsÚvoice_consent_create_paramsÚvoice_consent_update_params)ÚAsyncPaginatorÚmake_request_options)ÚVoiceConsent)ÚVoiceConsentDeletedÚVoiceConsentsÚAsyncVoiceConsentsc                   @  óž   e Zd ZdZed+dd„ƒZed,dd„ƒZd	d	d	ed
œd-dd„Zd	d	d	ed
œd.dd„Z	d	d	d	ed
œd/dd„Z
eed	d	d	ed œd0d&d'„Zd	d	d	ed
œd1d)d*„Zd	S )2r"   ú(Turn audio into text or text into audio.ÚreturnÚVoiceConsentsWithRawResponsec                 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,   ú`/var/www/html/chatgpt/venv/lib/python3.10/site-packages/openai/resources/audio/voice_consents.pyÚwith_raw_response   ó   zVoiceConsents.with_raw_responseÚ"VoiceConsentsWithStreamingResponsec                 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
        )r0   r*   r,   r,   r-   Úwith_streaming_response&   ó   z%VoiceConsents.with_streaming_responseN©Úextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚlanguageÚstrÚnameÚ	recordingr   r5   úHeaders | Noner6   úQuery | Noner7   úBody | Noner8   ú(float | httpx2.Timeout | None | NotGivenr    c          
      C  sr   t |||dœdggƒ}tttttf |ƒdggd�}	ddi|p i ¥}| jdt|tj	ƒ|	t
||||ddid	�td
�S )áß  
        Upload a voice consent recording.

        Args:
          language: The BCP 47 language tag for the consent phrase (for example, `en-US`).

          name: The label to use for this consent recording.

          recording: The consent audio recording file. Maximum size is 10 MiB.

              Supported MIME types: `audio/mpeg`, `audio/wav`, `audio/x-wav`, `audio/ogg`,
              `audio/aac`, `audio/flac`, `audio/webm`, `audio/mp4`.

          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
        ©r9   r;   r<   r<   ©ÚpathsúContent-Typeúmultipart/form-dataú/audio/voice_consentsÚbearer_authT©r5   r6   r7   r8   Úsecurity©ÚbodyÚfilesÚoptionsÚcast_to)r   r   r   r   r:   ÚobjectÚ_postr   r   ÚVoiceConsentCreateParamsr   r    ©
r+   r9   r;   r<   r5   r6   r7   r8   rL   rM   r,   r,   r-   Úcreate/   s,   "ýú
ûõzVoiceConsents.createÚ
consent_idc             	   C  ó<   |s	t d|›�ƒ‚| jtd|d�t||||ddid�td�S )áX  
        Retrieves a voice consent recording.

        Args:
          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
        ú9Expected a non-empty value for `consent_id` but received ú"/audio/voice_consents/{consent_id}©rU   rH   TrI   ©rN   rO   ©Ú
ValueErrorÚ_getr   r   r    ©r+   rU   r5   r6   r7   r8   r,   r,   r-   Úretrievel   ó   
û÷zVoiceConsents.retrievec             
   C  sJ   |s	t d|›�ƒ‚| jtd|d�td|itjƒt||||ddid�td�S )	á¥  
        Updates a voice consent recording (metadata only).

        Args:
          name: The updated label for this consent recording.

          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
        rX   rY   rZ   r;   rH   TrI   ©rL   rN   rO   )r]   rQ   r   r   r   ÚVoiceConsentUpdateParamsr   r    ©r+   rU   r;   r5   r6   r7   r8   r,   r,   r-   Úupdate‘   s   
ûözVoiceConsents.update©ÚafterÚlimitr5   r6   r7   r8   rh   ú
str | Omitri   ú
int | OmitúSyncCursorPage[VoiceConsent]c                C  ó8   | j dtt t||||t||dœtjƒddid�td�S ©a6  Returns a list of voice consent recordings.

        Args:
          after: A cursor for use in pagination.

        `after` is an object ID that defines your place
              in the list. For instance, if you make a list request and receive 100 objects,
              ending with obj_foo, your subsequent call can include after=obj_foo in order to
              fetch the next page of the list.

          limit: A limit on the number of objects to be returned. Limit can range between 1 and
              100, and the default is 20.

          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
        rG   )rh   ri   rH   T)r5   r6   r7   r8   ÚqueryrJ   )ÚpagerN   Úmodel)Ú_get_api_listr   r    r   r   r   ÚVoiceConsentListParams©r+   rh   ri   r5   r6   r7   r8   r,   r,   r-   Úlistº   ó$   !þûôïzVoiceConsents.listr!   c             	   C  rV   )áV  
        Deletes a voice consent recording.

        Args:
          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
        rX   rY   rZ   rH   TrI   r[   ©r]   Ú_deleter   r   r!   r_   r,   r,   r-   Údeleteï   ra   zVoiceConsents.delete)r&   r'   )r&   r0   ©r9   r:   r;   r:   r<   r   r5   r=   r6   r>   r7   r?   r8   r@   r&   r    ©rU   r:   r5   r=   r6   r>   r7   r?   r8   r@   r&   r    ©rU   r:   r;   r:   r5   r=   r6   r>   r7   r?   r8   r@   r&   r    )rh   rj   ri   rk   r5   r=   r6   r>   r7   r?   r8   r@   r&   rl   ©rU   r:   r5   r=   r6   r>   r7   r?   r8   r@   r&   r!   ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r.   r2   r   rT   r`   rf   r   ru   rz   r,   r,   r,   r-   r"      óB    	õC÷,ö,ö;÷c                   @  r$   )2r#   r%   r&   Ú!AsyncVoiceConsentsWithRawResponsec                 C  r(   r)   )r…   r*   r,   r,   r-   r.     r/   z$AsyncVoiceConsents.with_raw_responseÚ'AsyncVoiceConsentsWithStreamingResponsec                 C  r(   r1   )r†   r*   r,   r,   r-   r2   "  r3   z*AsyncVoiceConsents.with_streaming_responseNr4   r9   r:   r;   r<   r   r5   r=   r6   r>   r7   r?   r8   r@   r    c          
      Ã  s€   �t |||dœdggƒ}tttttf |ƒdggd�}	ddi|p!i ¥}| jdt|tj	ƒI dH |	t
||||dd	id
�td�I dH S )rA   rB   r<   rC   rE   rF   rG   NrH   TrI   rK   )r   r   r   r   r:   rP   rQ   r   r   rR   r   r    rS   r,   r,   r-   rT   +  s.   €"ýúûõzAsyncVoiceConsents.createrU   c             	   Ã  óD   �|s
t d|›�ƒ‚| jtd|d�t||||ddid�td�I dH S )	rW   rX   rY   rZ   rH   TrI   r[   Nr\   r_   r,   r,   r-   r`   h  ó   €
û÷zAsyncVoiceConsents.retrievec             
   Ã  sX   �|s
t d|›�ƒ‚| jtd|d�td|itjƒI dH t||||ddid�td	�I dH S )
rb   rX   rY   rZ   r;   NrH   TrI   rc   )r]   rQ   r   r   r   rd   r   r    re   r,   r,   r-   rf   �  s   €
ûözAsyncVoiceConsents.updaterg   rh   rj   ri   rk   ú;AsyncPaginator[VoiceConsent, AsyncCursorPage[VoiceConsent]]c                C  rm   rn   )rr   r   r    r   r   r   rs   rt   r,   r,   r-   ru   ¶  rv   zAsyncVoiceConsents.listr!   c             	   Ã  r‡   )	rw   rX   rY   rZ   rH   TrI   r[   Nrx   r_   r,   r,   r-   rz   ë  rˆ   zAsyncVoiceConsents.delete)r&   r…   )r&   r†   r{   r|   r}   )rh   rj   ri   rk   r5   r=   r6   r>   r7   r?   r8   r@   r&   r‰   r~   r   r,   r,   r,   r-   r#     r„   c                   @  ó   e Zd Zddd„ZdS )	r'   Úvoice_consentsr"   r&   ÚNonec                 C  óP   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S ©N)Ú_voice_consentsr   Zto_raw_response_wrapperrT   r`   rf   ru   rz   ©r+   r‹   r,   r,   r-   Ú__init__  ó    ÿÿÿÿ
ÿz%VoiceConsentsWithRawResponse.__init__N©r‹   r"   r&   rŒ   ©r€   r�   r‚   r‘   r,   r,   r,   r-   r'     ó    r'   c                   @  rŠ   )	r…   r‹   r#   r&   rŒ   c                 C  r�   rŽ   )r�   r   Zasync_to_raw_response_wrapperrT   r`   rf   ru   rz   r�   r,   r,   r-   r‘   '  r’   z*AsyncVoiceConsentsWithRawResponse.__init__N©r‹   r#   r&   rŒ   r”   r,   r,   r,   r-   r…   &  r•   r…   c                   @  rŠ   )	r0   r‹   r"   r&   rŒ   c                 C  óF   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _d S rŽ   )r�   r   rT   r`   rf   ru   rz   r�   r,   r,   r-   r‘   <  ó    ÿÿÿÿ
ÿz+VoiceConsentsWithStreamingResponse.__init__Nr“   r”   r,   r,   r,   r-   r0   ;  r•   r0   c                   @  rŠ   )	r†   r‹   r#   r&   rŒ   c                 C  r—   rŽ   )r�   r   rT   r`   rf   ru   rz   r�   r,   r,   r-   r‘   Q  r˜   z0AsyncVoiceConsentsWithStreamingResponse.__init__Nr–   r”   r,   r,   r,   r-   r†   P  r•   r†   )5Ú
__future__r   Útypingr   r   Zhttpx2Ú r   Ú_filesr   Ú_typesr   r	   r
   r   r   r   r   r   Z_utilsr   r   r   r   Z_compatr   Z	_resourcer   r   Ú	_responser   r   Z
paginationr   r   Ztypes.audior   r   r   Z_base_clientr   r   Ztypes.audio.voice_consentr    Z!types.audio.voice_consent_deletedr!   Ú__all__r"   r#   r'   r…   r0   r†   r,   r,   r,   r-   Ú<module>   s0   ( } }