
    =h[{                    P   d dl mZ d dlmZ d dlmZ d dlZddlmZ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 dd	lmZ dd
l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e      Z& G d de      Z' G d d      Z( G d d      Z) G d d      Z* G d d      Z+y)    )annotations)Optional)LiteralN   )phone_number_create_paramsphone_number_import_paramsphone_number_update_params)	NOT_GIVENBodyQueryHeadersNoneTypeNotGiven)maybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_raw_response_wrapperto_streamed_response_wrapperasync_to_raw_response_wrapper"async_to_streamed_response_wrapper)make_request_options)PhoneNumberResponse)PhoneNumberListResponsePhoneNumberResourceAsyncPhoneNumberResourcec                     e Zd Zedd       Zedd       Zeeeeeeddded
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 ddZeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	Z	ddded	 	 	 	 	 	 	 	 	 dd
Z
ddded	 	 	 	 	 	 	 	 	 	 	 ddZeeeeeeddded
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r   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/RetellAI/retell-python-sdk#accessing-raw-response-data-eg-headers
        )"PhoneNumberResourceWithRawResponseselfs    m/var/www/html/phonemate/phone_mate_backend/venv/lib/python3.12/site-packages/retell/resources/phone_number.pywith_raw_responsez%PhoneNumberResource.with_raw_response    s     2$77    c                    t        |       S z
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/RetellAI/retell-python-sdk#with_streaming_response
        )(PhoneNumberResourceWithStreamingResponser"   s    r$   with_streaming_responsez+PhoneNumberResource.with_streaming_response*   s     8==r&   N
	area_codeinbound_agent_idinbound_webhook_urlnicknamenumber_provideroutbound_agent_idextra_headersextra_query
extra_bodytimeoutc       
            | j                  dt        ||||||dt        j                        t	        |||	|
      t
              S );  
        Buy a new phone number & Bind agents

        Args:
          area_code: Area code of the number to obtain. Format is a 3 digit integer. Currently only
              supports US area code.

          inbound_agent_id: Unique id of agent to bind to the number. The number will automatically use the
              agent when receiving inbound calls. If null, this number would not accept
              inbound call.

          inbound_webhook_url: If set, will send a webhook for inbound calls, where you can to override agent
              id, set dynamic variables and other fields specific to that call.

          nickname: Nickname of the number. This is for your reference only.

          number_provider: The provider to purchase the phone number from. Default to twilio.

          outbound_agent_id: Unique id of agent to bind to the number. The number will automatically use the
              agent when conducting outbound calls. If null, this number would not be able to
              initiate outbound call without agent id override.

          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
        /create-phone-numberr,   r-   r.   r/   r0   r1   r2   r3   r4   r5   bodyoptionscast_to)_postr   r   PhoneNumberCreateParamsr   r   r#   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   s              r$   createzPhoneNumberResource.create3   sb    \ zz" !*(8+> ('6): +BB
 )+Q[el (!  
 	
r&   r:   c          	     r    |st        d|      | j                  d| t        ||||      t              S )_  
        Retrieve details of a specific phone number

        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
        ;Expected a non-empty value for `phone_number` but received /get-phone-number/r:   r=   r>   
ValueError_getr   r   r#   phone_numberr2   r3   r4   r5   s         r$   retrievezPhoneNumberResource.retrievet   sT    . Z[gZjkllyy /(+Q[el (  
 	
r&   r-   r.   r/   r1   r2   r3   r4   r5   c          
         |st        d|      | j                  d| t        ||||dt        j                        t        ||||	      t              S )j  
        Update agent bound to a purchased phone number

        Args:
          inbound_agent_id: Unique id of agent to bind to the number. The number will automatically use the
              agent when receiving inbound calls. If set to null, this number would not accept
              inbound call.

          inbound_webhook_url: If set, will send a webhook for inbound calls, where you can to override agent
              id, set dynamic variables and other fields specific to that call.

          nickname: Nickname of the number. This is for your reference only.

          outbound_agent_id: Unique id of agent to bind to the number. The number will automatically use the
              agent when conducting outbound calls. If set to null, this number would not be
              able to initiate outbound call without agent id override.

          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
        rE   /update-phone-number/r-   r.   r/   r1   r:   r;   )rI   _patchr   r	   PhoneNumberUpdateParamsr   r   
r#   rL   r-   r.   r/   r1   r2   r3   r4   r5   s
             r$   updatezPhoneNumberResource.update   s{    P Z[gZjkll{{#L>2 (8+> ():	 +BB )+Q[el (  
 	
r&   c          	     L    | j                  dt        ||||      t              S )List all phone numbers/list-phone-numbersr:   rG   rJ   r   r   r#   r2   r3   r4   r5   s        r$   listzPhoneNumberResource.list   s5     yy!(+Q[el ,  
 	
r&   c          	         |st        d|      ddi|xs i }| j                  d| t        ||||      t              S )S  
        Delete an existing phone number

        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
        rE   Accept*/*/delete-phone-number/r:   rG   rI   _deleter   r   rK   s         r$   deletezPhoneNumberResource.delete   sh    . Z[gZjkll!5B]-@bB||#L>2(+Q[el   
 	
r&   
r-   r.   r/   r1   sip_trunk_auth_passwordsip_trunk_auth_usernamer2   r3   r4   r5   c                   | j                  dt        ||||||||dt        j                        t	        |	|
||      t
              S )  
        Import a phone number from custom telephony & Bind agents

        Args:
          phone_number: The number you are trying to import in E.164 format of the number (+country
              code, then number with no space, no special characters), used as the unique
              identifier for phone number APIs.

          termination_uri: The termination uri to uniquely identify your elastic SIP trunk. This is used
              for outbound calls. For Twilio elastic SIP trunks it always end with
              ".pstn.twilio.com".

          inbound_agent_id: Unique id of agent to bind to the number. The number will automatically use the
              agent when receiving inbound calls. If null, this number would not accept
              inbound call.

          inbound_webhook_url: If set, will send a webhook for inbound calls, where you can to override agent
              id, set dynamic variables and other fields specific to that call.

          nickname: Nickname of the number. This is for your reference only.

          outbound_agent_id: Unique id of agent to bind to the number. The number will automatically use the
              agent when conducting outbound calls. If null, this number would not be able to
              initiate outbound call without agent id override.

          sip_trunk_auth_password: The password used for authentication for the SIP trunk.

          sip_trunk_auth_username: The username used for authentication for the SIP trunk.

          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
        /import-phone-numberrL   termination_urir-   r.   r/   r1   rf   rg   r:   r;   )r?   r   r   PhoneNumberImportParamsr   r   r#   rL   rl   r-   r.   r/   r1   rf   rg   r2   r3   r4   r5   s                r$   import_zPhoneNumberResource.import_  sh    n zz" $0'6(8+> ():/F/F	 +BB )+Q[el (%  
 	
r&   )returnr!   )rp   r)   r,   zint | NotGivenr-   Optional[str] | NotGivenr.   rr   r/   str | NotGivenr0   z&Literal['twilio', 'telnyx'] | NotGivenr1   rr   r2   Headers | Noner3   Query | Noner4   Body | Noner5   'float | httpx.Timeout | None | NotGivenrp   r   rL   strr2   rt   r3   ru   r4   rv   r5   rw   rp   r   rL   ry   r-   rr   r.   rr   r/   rr   r1   rr   r2   rt   r3   ru   r4   rv   r5   rw   rp   r   
r2   rt   r3   ru   r4   rv   r5   rw   rp   r   rL   ry   r2   rt   r3   ru   r4   rv   r5   rw   rp   NonerL   ry   rl   ry   r-   rr   r.   rr   r/   rs   r1   rr   rf   rs   rg   rs   r2   rt   r3   ru   r4   rv   r5   rw   rp   r   __name__
__module____qualname__r   r%   r*   r
   rB   rM   rV   r\   rd   ro    r&   r$   r   r      s   8 8 > > %.5>8A#,BK6? )-$("&;D?
 "?
 3	?

 6?
 !?
 @?
 4?
 &?
 "?
  ?
 9?
 
?
N )-$("&;D

 &
 "
  
 9
 

J 6?8A-66? )-$("&;D9
9
 3	9

 69
 +9
 49
 &9
 "9
  9
 99
 
9
@ )-$("&;D

 &
 "
  
 9
 
!
2 )-$("&;D 
 
 & 
 " 
   
 9 
 
 
N 6?8A#,6?2;2; )-$("&;D!J
 J
 	J

 3J
 6J
 !J
 4J
 "0J
 "0J
 &J
 "J
  J
  9!J
" 
#J
r&   c                     e Zd Zedd       Zedd       Zeeeeeeddded
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 ddZeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	Z	ddded	 	 	 	 	 	 	 	 	 dd
Z
ddded	 	 	 	 	 	 	 	 	 	 	 ddZeeeeeeddded
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r   c                    t        |       S r    )'AsyncPhoneNumberResourceWithRawResponser"   s    r$   r%   z*AsyncPhoneNumberResource.with_raw_responseS  s     7t<<r&   c                    t        |       S r(   )-AsyncPhoneNumberResourceWithStreamingResponser"   s    r$   r*   z0AsyncPhoneNumberResource.with_streaming_response]  s     =TBBr&   Nr+   c       
           K   | j                  dt        ||||||dt        j                         d{   t	        |||	|
      t
               d{   S 7 $7 w)r7   r8   r9   Nr:   r;   )r?   r   r   r@   r   r   rA   s              r$   rB   zAsyncPhoneNumberResource.createf  s{     \ ZZ",!*(8+> ('6): +BB
 
 )+Q[el (!   
 
 	


s!   1AA
AAAAr:   c          	        K   |st        d|      | j                  d| t        ||||      t               d{   S 7 w)rD   rE   rF   r:   rG   NrH   rK   s         r$   rM   z!AsyncPhoneNumberResource.retrieve  sb     . Z[gZjkllYY /(+Q[el (  
 
 	
 
s   <AAArN   c          
        K   |st        d|      | j                  d| t        ||||dt        j                         d{   t        ||||	      t               d{   S 7 $7 w)rP   rE   rQ   rR   Nr:   r;   )rI   rS   r   r	   rT   r   r   rU   s
             r$   rV   zAsyncPhoneNumberResource.update  s     P Z[gZjkll[[#L>2,(8+> ():	 +BB  )+Q[el ( ! 
 
 	

s$   AA-A)
A-$A+%A-+A-c          	     h   K   | j                  dt        ||||      t               d{   S 7 w)rX   rY   r:   rG   NrZ   r[   s        r$   r\   zAsyncPhoneNumberResource.list  sC      YY!(+Q[el ,  
 
 	
 
s   )202c          	        K   |st        d|      ddi|xs i }| j                  d| t        ||||      t               d{   S 7 w)r^   rE   r_   r`   ra   r:   rG   Nrb   rK   s         r$   rd   zAsyncPhoneNumberResource.delete  sv     . Z[gZjkll!5B]-@bB\\#L>2(+Q[el  " 
 
 	
 
s   AAA	Are   c                  K   | j                  dt        ||||||||dt        j                         d{   t	        |	|
||      t
               d{   S 7 $7 w)ri   rj   rk   Nr:   r;   )r?   r   r   rm   r   r   rn   s                r$   ro   z AsyncPhoneNumberResource.import_8  s     n ZZ",$0'6(8+> ():/F/F	 +BB  )+Q[el (%   
 
 	

s!   3AA
AAAA)rp   r   )rp   r   rq   rx   rz   r{   r|   r~   r   r   r&   r$   r   r   R  s   = = C C %.5>8A#,BK6? )-$("&;D?
 "?
 3	?

 6?
 !?
 @?
 4?
 &?
 "?
  ?
 9?
 
?
N )-$("&;D

 &
 "
  
 9
 

J 6?8A-66? )-$("&;D9
9
 3	9

 69
 +9
 49
 &9
 "9
  9
 99
 
9
@ )-$("&;D

 &
 "
  
 9
 
!
2 )-$("&;D 
 
 & 
 " 
   
 9 
 
 
N 6?8A#,6?2;2; )-$("&;D!J
 J
 	J

 3J
 6J
 !J
 4J
 "0J
 "0J
 &J
 "J
  J
  9!J
" 
#J
r&   c                      e Zd ZddZy)r!   c                J   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        t        |j                        | _        y N)_phone_numberr   rB   rM   rV   r\   rd   ro   r#   rL   s     r$   __init__z+PhoneNumberResourceWithRawResponse.__init__  s    )-
 0!!
 .
 ,
	 .
 /  
r&   NrL   r   rp   r}   r   r   r   r   r   r&   r$   r!   r!         
r&   r!   c                      e Zd ZddZy)r   c                J   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        t        |j                        | _        y r   )r   r   rB   rM   rV   r\   rd   ro   r   s     r$   r   z0AsyncPhoneNumberResourceWithRawResponse.__init__  s    )3
 6!!
 4
 2
	 4
 5  
r&   NrL   r   rp   r}   r   r   r&   r$   r   r     r   r&   r   c                      e Zd ZddZy)r)   c                J   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        t        |j                        | _        y r   )r   r   rB   rM   rV   r\   rd   ro   r   s     r$   r   z1PhoneNumberResourceWithStreamingResponse.__init__  s    )2
 5!!
 3
 1
	 3
 4  
r&   Nr   r   r   r&   r$   r)   r)     r   r&   r)   c                      e Zd ZddZy)r   c                J   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        t        |j                        | _        y r   )r   r   rB   rM   rV   r\   rd   ro   r   s     r$   r   z6AsyncPhoneNumberResourceWithStreamingResponse.__init__  s    )8
 ;!!
 9
 7
	 9
 :  
r&   Nr   r   r   r&   r$   r   r     r   r&   r   ),
__future__r   typingr   typing_extensionsr   httpxtypesr   r   r	   _typesr
   r   r   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   r   r   _base_clientr   types.phone_number_responser    types.phone_number_list_responser   __all__r   r   r!   r   r)   r   r   r&   r$   <module>r      s    #  %  f f H H & 9  0 = F "<
=p
/ p
f	p
/ p
f	
 
0
 
0
 
0
 
r&   