
    g-                         S SK r S SKrS SKJrJrJr  S SKJrJrJ	r	  S SK
Jr  S SKJr  S SKJr  S SKJr  \R$                  " S5      r " S	 S
\5      rg)    N)DictOptionalTuple)RequestSessionhooks)HTTPAdapter)
HttpClient)r   )Responseztwilio.http_clientc                     ^  \ rS rSrSrSSS\SS4S\S\\\	\
4      S\\   S\R                  S	\\\	\	4      S
\\   4U 4S jjjr      SS\	S\	S\\\	\
4      S\\\	\
4      S\\\	\	4      S\\\	\	4      S\\   S\S\4S jjrSrU =r$ )TwilioHttpClient   zA
General purpose HTTP Client for interacting with the Twilio API
TNpool_connectionsrequest_hookstimeoutloggerproxymax_retriesc           
        > [         TU ]  USU5        U(       a
  [        5       OSU l        U R                  (       a'  Ub$  U R                  R	                  S[        US95        OPU R                  bC  U R                  R	                  S[        [        S[        R                  " 5       S-   5      S95        U=(       d    [        R                  " 5       U l        U(       a  XPl        g0 U l        g)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          _/Users/Alptekin/Desktop/izin_takip/venv/lib/python3.13/site-packages/twilio/http/http_client.pyr   TwilioHttpClient.__init__   s    & 	0$4wy$<<K3LLz;;+OP\\%LLKSR\\^a=O5PQ +Ce.A.A.C#U

    methodurlparamsdataheadersauthallow_redirectsreturnc	                    Uc  U R                   nOUS::  a  [        U5      eUR                  5       UUUUU R                  S.n	U(       a  UR	                  S5      S:X  a  XIS'   O%U(       a  UR	                  S5      S:X  a  XIS'   OXIS'   U R                  U	5        SU l        U R                  =(       d
    [        5       n
[        S
0 U	D6n[        S
0 U	D6U l        U
R                  U5      nU
R                  UR                  U R                  SSS5      nU
R                   " U4UUS	.UD6nU R#                  UR$                  U5        ['        [)        UR$                  5      UR*                  UR,                  5      U l        U R                  $ )a
  
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@   TwilioHttpClient.request2   sy   4 ?llG\W%% lln''
 w{{>26HH!6N^48OO!6N!6N (,%,,+')#F#'4'>v'>$!11':55T4
 <<
+
 	
 	(..9(0$$%x}}h6F6F)
% ,,,r%   )r7   r5   r   r   r   )NNNNNF)__name__
__module____qualname____firstlineno____doc___loggerboolr   r   strobjectfloatloggingLoggerr=   r   r   r   r@   __static_attributes____classcell__)r"   s   @r#   r   r      sC    "&59#'!(*.%),,  S&[ 12, %	,
 , S#X', c], ,D /3,0,0*.#' %E-E- E- c6k*+	E-
 tCK()E- $sCx.)E- uS#X'E- %E- E- 
E- E-r%   r   )r   rO   typingr   r   r   requestsr   r   r   requests.adaptersr	   twilio.httpr
   twilio.http.requestr6   twilio.http.responser   	getLoggerrJ   r   r0   r%   r#   <module>rZ      sB    	  ( ( , , ) " 8 )


0
1h-z h-r%   