Ë
    [üàg-  ã                   ó¦   — d dl Z d dlZd dl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 d dlmZ d dlmZ  ej$                  d«      Z G d	„ d
e«      Zy)é    N)ÚDictÚOptionalÚTuple)ÚRequestÚSessionÚhooks)ÚHTTPAdapter)Ú
HttpClient)r   )ÚResponseztwilio.http_clientc                   ó
  ‡ — e Zd ZdZdddeddfdedeeee	f      dee
   dej                  deeeef      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ˆ xZS )ÚTwilioHttpClientzI
    General purpose HTTP Client for interacting with the Twilio API
    TNÚpool_connectionsÚrequest_hooksÚtimeoutÚloggerÚproxyÚmax_retriesc           
      ó¶  •— t         ‰| �  |d|«       |r
t        «       nd| _        | j                  r)|�'| j                  j	                  dt        |¬«      «       nQ| j                  �E| j                  j	                  dt        t        dt        j                  «       dz   «      ¬«      «       |xs t        j                  «       | _        |r|| _        yi | _        y)a„  
        Constructor for the TwilioHttpClient
        :param pool_connections
        :param request_hooks
        :param timeout: Timeout for the requests.
                    Timeout should never be zero (0) or less
        :param logger
        :param proxy: Http proxy for the requests session
        :param max_retries: Maximum number of retries each request should attempt
        FNzhttps://)r   é    é   )Úpool_maxsize)ÚsuperÚ__init__r   ÚsessionÚmountr	   ÚminÚosÚ	cpu_countr   Údefault_hooksr   r   )Úselfr   r   r   r   r   r   Ú	__class__s          €úU/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/twilio/http/http_client.pyr   zTwilioHttpClient.__init__   s§   ø€ ô& 	‰Ñ˜ ¨Ô0Ù$4”w”y¸$ˆŒØ�<Š<˜KÐ3Ø�L‰L×Ñ˜z¬;À;Ô+OÕPØ�\‰\Ð%Ø�L‰L×ÑØœK´S¸¼R¿\¹\»^ÈaÑ=OÓ5PÔQôð +ÒC¬e×.AÑ.AÓ.CˆÔÙ#�Uˆ�
¨ˆ�
ó    ÚmethodÚurlÚparamsÚdataÚheadersÚauthÚallow_redirectsÚreturnc	                 óô  — |€| j                   }n|dk  rt        |«      ‚|j                  «       ||||| j                  dœ}	|r|j	                  d«      dk(  r||	d<   n!|r|j	                  d«      dk(  r||	d<   n||	d<   | j                  |	«       d| _        | j                  xs
 t        «       }
t        d
i |	¤Ž}t        d
i |	¤Ž| _        |
j                  |«      }|
j                  |j                  | j                  ddd«      } |
j                   |f||d	œ|¤Ž}| j#                  |j$                  |«       t'        t)        |j$                  «      |j*                  |j,                  «      | _        | j                  S )aj  
        Make an 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
        :param timeout: Socket/Read timeout for the request
        :param allow_redirects: Whether to allow redirects
        See the requests documentation for explanation of all these parameters

        :return: An HTTP response
        Nr   )r$   r%   r&   r(   r)   r   zContent-Typezapplication/jsonÚjsonzapplication/scim+jsonr'   )r*   r   © )r   Ú
ValueErrorÚupperr   ÚgetÚlog_requestÚ_test_only_last_responser   r   r   ÚTwilioRequestÚ_test_only_last_requestÚprepare_requestÚmerge_environment_settingsr%   r   ÚsendÚlog_responseÚstatus_coder   ÚintÚtextr(   )r    r$   r%   r&   r'   r(   r)   r   r*   Úkwargsr   ÚrequestÚprepped_requestÚsettingsÚresponses                  r"   r>   zTwilioHttpClient.request2   s�  € ð4 ˆ?Ø—l‘l‰GØ˜Š\Ü˜WÓ%Ð%ð —l‘l“nØØØØØ×'Ñ'ñ
ˆñ �w—{‘{ >Ó2Ð6HÒHØ!ˆF�6ŠNÙ˜Ÿ™ ^Ó4Ð8OÒOØ!ˆF�6ŠNà!ˆF�6‰NØ×Ñ˜Ô Ø(,ˆÔ%Ø—,‘,Ò+¤'£)ˆÜÑ#˜FÑ#ˆÜ'4Ñ'>°vÑ'>ˆÔ$à!×1Ñ1°'Ó:ˆà×5Ñ5Ø×Ñ §¡¨T°4¸ó
ˆð  �7—<‘<Øð
à+Øñ
ð ñ	
ˆð 	×Ñ˜(×.Ñ.°Ô9ä(0Ü�×$Ñ$Ó% x§}¡}°h×6FÑ6Fó)
ˆÔ%ð ×,Ñ,Ð,r#   )NNNNNF)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú_loggerÚboolr   r   ÚstrÚobjectÚfloatÚloggingÚLoggerr;   r   r   r   r>   Ú__classcell__)r!   s   @r"   r   r      s8  ø„ ñð "&Ø59Ø#'Ø!(Ø*.Ø%)ñ,àð,ð    S¨& [Ñ 1Ñ2ð,ð ˜%‘ð	,ð
 —‘ð,ð ˜˜S #˜X™Ñ'ð,ð ˜c‘]õ,ðD /3Ø,0Ø,0Ø*.Ø#'Ø %ñE-àðE-ð ðE-ð ˜˜c 6˜kÑ*Ñ+ð	E-ð
 �t˜C ˜KÑ(Ñ)ðE-ð ˜$˜s C˜x™.Ñ)ðE-ð �u˜S #˜X‘Ñ'ðE-ð ˜%‘ðE-ð ðE-ð 
÷E-r#   r   )r   rK   Útypingr   r   r   Úrequestsr   r   r   Úrequests.adaptersr	   Útwilio.httpr
   Útwilio.http.requestr4   Útwilio.http.responser   Ú	getLoggerrF   r   r.   r#   r"   ú<module>rU      sD   ðÛ 	Û ß (Ñ (ç ,Ñ ,Ý )å "Ý 8Ý )à
ˆ'×
Ñ
Ð0Ó
1€ôh-�zõ h-r#   