o
    ùT·j\m  ã                   @  s8  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mZ ddl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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& 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ÚNoneTypeÚNotGivenÚomitÚ	not_given)Úpath_templateÚmaybe_transformÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)ÚStreamedBinaryAPIResponseÚAsyncStreamedBinaryAPIResponseÚto_streamed_response_wrapperÚ"async_to_streamed_response_wrapperÚ#to_custom_streamed_response_wrapperÚ)async_to_custom_streamed_response_wrapper)Úsession_fork_paramsÚsession_refer_paramsÚsession_accept_paramsÚsession_reject_params)Úmake_request_options)ÚSessionForkResponse)ÚMediaSessionForkConfigParamÚSessionsÚAsyncSessionsc                   @  ó®   e 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e	dddedœd0d!d"„Z
ddded	œd1d#d$„Zddded	œd2d&d'„Zddded	œd3d*d+„ZdS )4r    ÚreturnÚSessionsWithRawResponsec                 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)   úa/home/dinkstrade/pdmp-scanner/venv/lib/python3.10/site-packages/openai/resources/live/sessions.pyÚwith_raw_response"   ó   zSessions.with_raw_responseÚSessionsWithStreamingResponsec                 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 Sessions.with_streaming_responseN©Úextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚ
session_idÚstrÚsessionúsession_accept_params.Sessionr2   úHeaders | Noner3   úQuery | Noner4   úBody | Noner5   ú(float | httpx2.Timeout | None | NotGivenÚNonec             
   C  óZ   |s	t d|›�ƒ‚ddi|pi ¥}| jtd|d�td|itjƒt||||ddid	�td
�S )á&  Accept an incoming SIP call.

        Supply session with type live, the model, and
        startup configuration. Before accepting calls, follow the
        [Live prompting guide](https://developers.openai.com/api/docs/guides/live-prompting)
        to write frontend conversation instructions and a separate backend prompt. SIP
        media format is negotiated; omit audio.format.

        Args:
          session: Model and startup configuration for the Live session that answers the incoming
              SIP call.

          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 `session_id` but received ÚAcceptú*/*ú"/live/sessions/{session_id}/accept©r6   r8   Úbearer_authT©r2   r3   r4   r5   Úsecurity©ÚbodyÚoptionsÚcast_to)Ú
ValueErrorÚ_postr   r   r   ÚSessionAcceptParamsr   r	   ©r(   r6   r8   r2   r3   r4   r5   r)   r)   r*   Úaccept5   s    
ûözSessions.acceptú+_legacy_response.HttpxBinaryResponseContentc             	   C  sN   |s	t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||ddid�tjd	�S )
áë  
        Get Live session content

        Args:
          session_id: The ID of the stored Live session to download. Use the session ID returned when
              the session started with storage enabled.

          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
        rA   rB   úapplication/binaryú#/live/sessions/{session_id}/contentrE   rF   TrG   ©rK   rL   ©rM   Ú_getr   r   r   ÚHttpxBinaryResponseContent©r(   r6   r2   r3   r4   r5   r)   r)   r*   Údownload_recordinge   s   
û÷zSessions.download_recording©r8   r2   r3   r4   r5   Ú	transportúsession_fork_params.Transportú"MediaSessionForkConfigParam | Omitr   c             
   C  sL   |s	t d|›�ƒ‚| jtd|d�t||dœtjƒt||||ddid�td�S )	áƒ  
        Fork a stored Live session onto a new WebRTC connection.

        Args:
          transport: WebRTC transport with an SDP offer for the new connection to the forked session.

          session: Optional configuration overrides for the new Live session. Omit this object or
              send an empty object to inherit the stored session's settings.

          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
        rA   ú /live/sessions/{session_id}/forkrE   ©r]   r8   rF   TrG   rI   )rM   rN   r   r   r   ÚSessionForkParamsr   r   ©r(   r6   r]   r8   r2   r3   r4   r5   r)   r)   r*   ÚforkŽ   s&   
þûûðzSessions.forkc             	   C  sL   |s	t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||ddid�td	�S )
á\  
        End a SIP call identified by session_id.

        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
        rA   rB   rC   ú"/live/sessions/{session_id}/hanguprE   rF   TrG   rV   ©rM   rN   r   r   r	   rZ   r)   r)   r*   ÚhangupÁ   s   
û÷zSessions.hangupÚ
target_uric             
   C  r?   )á#  Transfer a SIP call to another destination.

        Supply a nonblank target_uri for the
        SIP Refer-To header.

        Args:
          target_uri: Nonblank URI for the SIP Refer-To header, such as tel:+14155550123 or
              sip:agent@example.com.

          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
        rA   rB   rC   ú!/live/sessions/{session_id}/referrE   rj   rF   TrG   rI   )rM   rN   r   r   r   ÚSessionReferParamsr   r	   ©r(   r6   rj   r2   r3   r4   r5   r)   r)   r*   Úreferç   s   
ûözSessions.referÚstatus_codeÚintc             
   C  r?   )áð  Reject an incoming SIP call.

        Send a required SIP rejection status_code between
        300 and 699.

        Args:
          status_code: SIP rejection status sent to the caller. This field is required.

          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
        rA   rB   rC   ú"/live/sessions/{session_id}/rejectrE   rp   rF   TrG   rI   )rM   rN   r   r   r   ÚSessionRejectParamsr   r	   ©r(   r6   rp   r2   r3   r4   r5   r)   r)   r*   Úreject  s   
ûözSessions.reject)r#   r$   )r#   r-   ©r6   r7   r8   r9   r2   r:   r3   r;   r4   r<   r5   r=   r#   r>   ©r6   r7   r2   r:   r3   r;   r4   r<   r5   r=   r#   rR   ©r6   r7   r]   r^   r8   r_   r2   r:   r3   r;   r4   r<   r5   r=   r#   r   ©r6   r7   r2   r:   r3   r;   r4   r<   r5   r=   r#   r>   ©r6   r7   rj   r7   r2   r:   r3   r;   r4   r<   r5   r=   r#   r>   ©r6   r7   rp   rq   r2   r:   r3   r;   r4   r<   r5   r=   r#   r>   ©Ú__name__Ú
__module__Ú__qualname__r   r+   r/   r   rQ   r[   r   re   ri   ro   rv   r)   r)   r)   r*   r    !   óH    	ö6÷.õ9÷-ö4öc                   @  r"   )4r!   r#   ÚAsyncSessionsWithRawResponsec                 C  r%   r&   )r‚   r'   r)   r)   r*   r+   B  r,   zAsyncSessions.with_raw_responseÚ"AsyncSessionsWithStreamingResponsec                 C  r%   r.   )rƒ   r'   r)   r)   r*   r/   L  r0   z%AsyncSessions.with_streaming_responseNr1   r6   r7   r8   r9   r2   r:   r3   r;   r4   r<   r5   r=   r>   c             
   Ã  óh   �|s
t d|›�ƒ‚ddi|pi ¥}| jtd|d�td|itjƒI dH t||||dd	id
�td�I dH S )r@   rA   rB   rC   rD   rE   r8   NrF   TrG   rI   )rM   rN   r   r   r   rO   r   r	   rP   r)   r)   r*   rQ   U  s    € 
ûözAsyncSessions.acceptrR   c             	   Ã  sV   �|s
t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||ddid�tjd	�I d
H S )rS   rA   rB   rT   rU   rE   rF   TrG   rV   NrW   rZ   r)   r)   r*   r[   …  s   €
û÷z AsyncSessions.download_recordingr\   r]   r^   r_   r   c             
   Ã  sZ   �|s
t d|›�ƒ‚| jtd|d�t||dœtjƒI dH t||||ddid�td	�I dH S )
r`   rA   ra   rE   rb   NrF   TrG   rI   )rM   rN   r   r   r   rc   r   r   rd   r)   r)   r*   re   ®  s(   €
þûûðzAsyncSessions.forkc             	   Ã  sT   �|s
t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||ddid�td	�I d
H S )rf   rA   rB   rC   rg   rE   rF   TrG   rV   Nrh   rZ   r)   r)   r*   ri   á  s   €
û÷zAsyncSessions.hanguprj   c             
   Ã  r„   )rk   rA   rB   rC   rl   rE   rj   NrF   TrG   rI   )rM   rN   r   r   r   rm   r   r	   rn   r)   r)   r*   ro     s    €
ûözAsyncSessions.referrp   rq   c             
   Ã  r„   )rr   rA   rB   rC   rs   rE   rp   NrF   TrG   rI   )rM   rN   r   r   r   rt   r   r	   ru   r)   r)   r*   rv   4  s    €
ûözAsyncSessions.reject)r#   r‚   )r#   rƒ   rw   rx   ry   rz   r{   r|   r}   r)   r)   r)   r*   r!   A  r�   c                   @  ó   e Zd Zddd„ZdS )	r$   Úsessionsr    r#   r>   c                 C  ó^   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S ©N)	Ú	_sessionsr   Úto_raw_response_wrapperrQ   r[   re   ri   ro   rv   ©r(   r†   r)   r)   r*   Ú__init__b  ó&   ÿÿÿÿÿ
ÿz SessionsWithRawResponse.__init__N©r†   r    r#   r>   ©r~   r   r€   rŒ   r)   r)   r)   r*   r$   a  ó    r$   c                   @  r…   )	r‚   r†   r!   r#   r>   c                 C  r‡   rˆ   )	r‰   r   Úasync_to_raw_response_wrapperrQ   r[   re   ri   ro   rv   r‹   r)   r)   r*   rŒ   z  r�   z%AsyncSessionsWithRawResponse.__init__N©r†   r!   r#   r>   r�   r)   r)   r)   r*   r‚   y  r�   r‚   c                   @  r…   )	r-   r†   r    r#   r>   c                 C  óT   || _ t|jƒ| _t|jtƒ| _t|jƒ| _t|jƒ| _t|jƒ| _t|j	ƒ| _	d S rˆ   )
r‰   r   rQ   r   r[   r   re   ri   ro   rv   r‹   r)   r)   r*   rŒ   ’  ó(   ÿþÿÿÿ
ÿz&SessionsWithStreamingResponse.__init__NrŽ   r�   r)   r)   r)   r*   r-   ‘  r�   r-   c                   @  r…   )	rƒ   r†   r!   r#   r>   c                 C  r“   rˆ   )
r‰   r   rQ   r   r[   r   re   ri   ro   rv   r‹   r)   r)   r*   rŒ   «  r”   z+AsyncSessionsWithStreamingResponse.__init__Nr’   r�   r)   r)   r)   r*   rƒ   ª  r�   rƒ   )0Ú
__future__r   Úhttpx2Ú r   Ú_typesr   r   r   r   r	   r
   r   r   Ú_utilsr   r   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   r   r   r   r   Ú
types.liver   r   r   r   Ú_base_clientr   Ú types.live.session_fork_responser   Ú*types.live.media_session_fork_config_paramr   Ú__all__r    r!   r$   r‚   r-   rƒ   r)   r)   r)   r*   Ú<module>   s.   (   "  "