Ë
    [üàg—  ã                   óž   — d dl Z d dlmZmZ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  e j$                  d«      Z G d	„ d
e«      Zy)é    N)ÚDictÚOptionalÚTuple)Ú	BasicAuthÚClientSession)ÚExponentialRetryÚRetryClient)ÚAsyncHttpClient)ÚRequest)ÚResponseztwilio.async_http_clientc                   óþ   ‡ — e Zd ZdZdddeddfdedee   dej                  dee
   dee   f
ˆ fd	„Z	 	 	 	 	 	 dd
e
de
deee
ef      deee
ef      deee
e
f      deee
e
f      dee   dedefd„Zd„ Zd„ Zd„ Zˆ xZS )ÚAsyncTwilioHttpClientzV
    General purpose asynchronous HTTP Client for interacting with the Twilio API
    TNÚpool_connectionsÚtimeoutÚloggerÚ	proxy_urlÚmax_retriesc                 óØ   •— t         ‰| �  |d|«       || _        || _        |rt	        | j                  ¬«      nd| _        |�)t        |¬«      }t        | j
                  |¬«      | _        yy)a  
        Constructor for the AsyncTwilioHttpClient

        :param pool_connections: Creates a client session for making requests from.
        :param trace_configs: Configuration used to trace request lifecycle events. See aiohttp library TraceConfig
                              documentation for more info.
        :param timeout: Timeout for the requests (seconds)
        :param logger
        :param proxy_url: Proxy URL
        :param max_retries: Maximum number of retries each request should attempt
        T)Útrace_configsN)Úattempts)Úclient_sessionÚretry_options)ÚsuperÚ__init__r   r   r   Úsessionr   r	   )	Úselfr   r   r   r   r   r   r   Ú	__class__s	           €ú[/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/twilio/http/async_http_client.pyr   zAsyncTwilioHttpClient.__init__   sp   ø€ ô( 	‰Ñ˜  wÔ/Ø"ˆŒØ*ˆÔñ  ô ¨×(:Ñ(:Õ;àð 	Œð
 Ð"Ü,°kÔBˆMÜ&Ø#Ÿ|™|¸=ôˆD�Lð #ó    ÚmethodÚurlÚparamsÚdataÚheadersÚauthÚallow_redirectsÚreturnc	           	   ƒ   ól  K  — |�|dk  rt        |«      ‚d}	|�t        |d   |d   ¬«      }	|j                  «       |||||	||dœ}
| j                  |
«       d| _        d}d}| j
                  r| j
                  }nt        «       }d}t        di |
¤Ž| _         |j                  di |
¤Žƒ d{  –—† }| j                  |j                  |«       t        |j                  |j                  «       ƒ d{  –—† |j                  «      | _        |r|j                  «       ƒ d{  –—†  | j                  S 7 Œ‚7 Œ@7 Œ­w)	aÈ  
        Make an asynchronous HTTP Request with parameters provided.

        :param method: The HTTP method to use
        :param url: The URL to request
        :param params: Query parameters to append to the URL
        :param data: Parameters to go in the body of the HTTP request
        :param headers: HTTP Headers to send with the request
        :param auth: Basic Auth arguments (username, password entries)
        :param timeout: Socket/Read timeout for the request. Overrides the timeout if set on the client.
        :param allow_redirects: Whether or not to allow redirects
        See the requests documentation for explanation of all these parameters

        :return: An http response
        Nr   é   )ÚloginÚpassword)r    r!   r"   r#   r$   r%   r   r&   FT© )Ú
ValueErrorr   ÚupperÚlog_requestÚ_test_only_last_responser   r   ÚTwilioRequestÚ_test_only_last_requestÚrequestÚlog_responseÚstatusr   Útextr$   Úclose)r   r    r!   r"   r#   r$   r%   r   r&   Ú
basic_authÚkwargsÚtempr   Úresponses                 r   r3   zAsyncTwilioHttpClient.request5   s5  è ø€ ð4 Ð 7¨a¢<Ü˜WÓ%Ð%àˆ
ØÐÜ"¨¨a©¸4À¹7ÔCˆJð —l‘l“nØØØØØØØ.ñ	
ˆð 	×Ñ˜Ô Ø(,ˆÔ%àˆØˆØ�<Š<Ø—l‘l‰Gä#“oˆGØˆDÜ'4Ñ'>°vÑ'>ˆÔ$Ø(˜Ÿ™Ñ2¨6Ñ2×2ˆØ×Ñ˜(Ÿ/™/¨8Ô4Ü(0Ø�O‰O 8§=¡=£?×2°H×4DÑ4Dó)
ˆÔ%ñ Ø—-‘-“/×!Ð!Ø×,Ñ,Ð,ð 3øð 3øð "ús7   ‚B)D4Â+D.Â,AD4Ã/D0
Ã0-D4ÄD2ÄD4Ä0D4Ä2D4c              ƒ   ón   K  — | j                   r#| j                   j                  «       ƒ d{  –—†  yy7 Œ­w)z0
        Closes the HTTP client session
        N©r   r7   ©r   s    r   r7   zAsyncTwilioHttpClient.closeu   ó-   è ø€ ð �<Š<Ø—,‘,×$Ñ$Ó&×&Ñ&ð Ø&úó   ‚*5¬3­5c              ƒ   ó   K  — | S ­w)z-
        Async context manager setup
        r,   r>   s    r   Ú
__aenter__z AsyncTwilioHttpClient.__aenter__|   s   è ø€ ð ˆùs   ‚c              ‡   ón   K  — | j                   r#| j                   j                  «       ƒ d{  –—†  yy7 Œ­w)z,
        Async context manager exit
        Nr=   )r   Úexcinfos     r   Ú	__aexit__zAsyncTwilioHttpClient.__aexit__‚   r?   r@   )NNNNNF)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú_loggerÚboolr   ÚfloatÚloggingÚLoggerÚstrÚintr   r   Úobjectr   r   r3   r7   rB   rE   Ú__classcell__)r   s   @r   r   r      s  ø„ ñð "&ØØ#'Ø!(Ø#'Ø%)ñ àð ð ˜%‘ð	 ð
 —‘ð ð ˜C‘=ð ð ˜c‘]õ ðL /3Ø,0Ø,0Ø*.Ø#'Ø %ñ>-àð>-ð ð>-ð ˜˜c 6˜kÑ*Ñ+ð	>-ð
 �t˜C ˜KÑ(Ñ)ð>-ð ˜$˜s C˜x™.Ñ)ð>-ð �u˜S #˜X‘Ñ'ð>-ð ˜%‘ð>-ð ð>-ð 
ó>-ò@'òö'r   r   )rM   Útypingr   r   r   Úaiohttpr   r   Úaiohttp_retryr   r	   Útwilio.httpr
   Útwilio.http.requestr   r1   Útwilio.http.responser   Ú	getLoggerrJ   r   r,   r   r   ú<module>rZ      s>   ðÛ ß (Ñ (ç ,ß 7å 'Ý 8Ý )à
ˆ'×
Ñ
Ð6Ó
7€ôy'˜Oõ y'r   