Ë
    [üàgx%  ã                   ó’   — d dl Z d dlZd dl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 d dlmZ d dlmZ d dlmZ  G d	„ d
e«      Zy)é    N)ÚDictÚListÚMutableMappingÚOptionalÚTuple)ÚurlparseÚ
urlunparse)Ú__version__)Ú
HttpClient)ÚTwilioHttpClient)ÚResponse)ÚCredentialProviderc                   ó  — e Zd ZdZ	 	 	 	 	 	 	 	 	 ddee   dee   dee   dee   dee   deeeef      d	ee   d
eee      dee	   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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eeeef      deeef   fd„Zdedeeeef      deeef   fd„Zdedefd„Zdefd„Zy)Ú
ClientBasez&A client for accessing the Twilio API.NÚusernameÚpasswordÚaccount_sidÚregionÚhttp_clientÚenvironmentÚedgeÚuser_agent_extensionsÚcredential_providerc
                 óÂ  — |xs t         j                  }|xs |j                  d«      | _        	 |xs |j                  d«      | _        	 |xs |j                  d«      | _        	 |xs |j                  d«      | _        	 |xs g | _        	 |	xs d| _        	 |xs | j                  | _	        	 | j                  | j                  f| _
        	 |xs
 t        «       | _        y)aÕ  
        Initializes the Twilio Client

        :param username: Username to authenticate with
        :param password: Password to authenticate with
        :param account_sid: Account SID, defaults to Username
        :param region: Twilio Region to make requests to, defaults to 'us1' if an edge is provided
        :param http_client: HttpClient, defaults to TwilioHttpClient
        :param environment: Environment to look for auth details, defaults to os.environ
        :param edge: Twilio Edge to make requests to, defaults to None
        :param user_agent_extensions: Additions to the user agent string
        :param credential_provider: credential provider for authentication method that needs to be used
        ÚTWILIO_ACCOUNT_SIDÚTWILIO_AUTH_TOKENÚTWILIO_EDGEÚTWILIO_REGIONN)ÚosÚenvironÚgetr   r   r   r   r   r   r   Úauthr   r   )
Úselfr   r   r   r   r   r   r   r   r   s
             úU/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/twilio/base/client_base.pyÚ__init__zClientBase.__init__   sÓ   € ð4 "Ò/¤R§Z¡Zˆà ÒI K§O¡OÐ4HÓ$IˆŒØØ ÒH K§O¡OÐ4GÓ$HˆŒØØÒ:˜KŸO™O¨MÓ:ˆŒ	ØØÒ@ §¡°Ó @ˆŒØØ%:Ò%@¸bˆÔ"Ø!Ø#6Ò#>¸$ˆÔ Ø*à&Ò7¨$¯-©-ˆÔØØ—]‘] D§M¡MÐ2ˆŒ	Ø'Ø'2Ò'HÔ6FÓ6HˆÔØ"ó    ÚmethodÚuriÚparamsÚdataÚheadersr"   ÚtimeoutÚallow_redirectsÚreturnc	           
      óŒ  — | j                  ||«      }| j                  r.| j                  j                  «       }	|	j                  «       |d<   n,| j                  �| j
                  �| j                  |«      }nd}|dk(  r|d= | j                  |«      }| j                  |«      }
| j                  j                  ||||
||||¬«      S )a(  
        Makes a request to the Twilio API using the configured http client
        Authentication information is automatically added if none is provided

        :param method: HTTP Method
        :param uri: Fully qualified url
        :param params: Query string parameters
        :param data: POST body data
        :param headers: HTTP Headers
        :param auth: Authentication
        :param timeout: Timeout in seconds
        :param allow_redirects: Should the client follow redirects

        :returns: Response from the Twilio API
        ÚAuthorizationNÚDELETEÚAccept©r)   r*   r+   r"   r,   r-   )Úget_headersr   Úto_auth_strategyÚget_auth_stringr   r   Úget_authÚget_hostnameÚcopy_non_none_valuesr   Úrequest©r#   r'   r(   r)   r*   r+   r"   r,   r-   Úauth_strategyÚfiltered_datas              r$   r:   zClientBase.request@   sÒ   € ð4 ×"Ñ" 6¨7Ó3ˆà×#Ò#à ×4Ñ4×EÑEÓGˆMØ'4×'DÑ'DÓ'FˆG�OÒ$Ø�]‰]Ð&¨4¯=©=Ð+DØ—=‘= Ó&‰DàˆDà�XÒØ˜Ð!à×Ñ Ó$ˆØ×1Ñ1°$Ó7ˆØ×Ñ×'Ñ'ØØØØØØØØ+ð (ó 	
ð 		
r&   c	           
   ƒ   óê  K  — | j                   j                  st        d«      ‚| j                  ||«      }|dk(  r|d= | j                  r.| j                  j                  «       }	|	j                  «       |d<   n,| j                  �| j                  �| j                  |«      }nd}| j                  |«      }| j                  |«      }
| j                   j                  ||||
||||¬«      ƒ d{  –—† S 7 Œ­w)a  
        Asynchronously makes a request to the Twilio API  using the configured http client
        The configured http client must be an asynchronous http client
        Authentication information is automatically added if none is provided

        :param method: HTTP Method
        :param uri: Fully qualified url
        :param params: Query string parameters
        :param data: POST body data
        :param headers: HTTP Headers
        :param auth: Authentication
        :param timeout: Timeout in seconds
        :param allow_redirects: Should the client follow redirects

        :returns: Response from the Twilio API
        z>http_client must be asynchronous to support async API requestsr1   r2   r0   Nr3   )r   Úis_asyncÚRuntimeErrorr4   r   r5   r6   r   r   r7   r8   r9   r:   r;   s              r$   Úrequest_asynczClientBase.request_asyncu   s  è ø€ ð6 ×Ñ×(Ò(ÜØPóð ð ×"Ñ" 6¨7Ó3ˆØ�XÒØ˜Ð!à×#Ò#Ø ×4Ñ4×EÑEÓGˆMØ'4×'DÑ'DÓ'FˆG�OÒ$Ø�]‰]Ð&¨4¯=©=Ð+DØ—=‘= Ó&‰DàˆDà×Ñ Ó$ˆØ×1Ñ1°$Ó7ˆØ×%Ñ%×-Ñ-ØØØØØØØØ+ð .ó 	
÷ 	
ð 		
ð 	
ús   ‚C*C3Ã,C1Ã-C3c                 ó
  — t        |t        «      r5|j                  «       D ��ci c]  \  }}|�|| j                  |«      “Œ c}}S t        |t        «      r"|D �cg c]  }|€Œ| j                  |«      ‘Œ c}S |S c c}}w c c}w )N)Ú
isinstanceÚdictÚitemsr9   Úlist)r#   r*   ÚkÚvÚitems        r$   r9   zClientBase.copy_non_none_values®   s�   € Ü�dœDÔ!ð !ŸJ™J›L÷á�A�qØ�=ð �4×,Ñ,¨QÓ/Ñ/óð ô
 ˜œdÔ#à<@öØ48ÀDÑDT�×)Ñ)¨$Õ/òð ð ˆùóùòs   ¤A:ÁB Á"B c                 ó"   — |xs | j                   S )zœ
        Get the request authentication object
        :param auth: Authentication (username, password)
        :returns: The authentication object
        )r"   )r#   r"   s     r$   r7   zClientBase.get_auth»   s   € ð Ò �t—y‘yÐ r&   c                 ó�  — |xs i }t         }t        j                  «       }t        j                  «       }t        j                  «       }dj                  ||||«      |d<   | j                  D ]  }|dxx   dj                  |«      z  cc<   Œ  dj                  t         «      |d<   d|d<   |dk(  s|d	k(  r	d
|vrd|d
<   d|vrd|d<   |S )zÔ
        Get the request headers including user-agent, extensions, encoding, content-type, MIME type
        :param method: HTTP method
        :param headers: HTTP headers
        :returns: HTTP headers
        z"twilio-python/{} ({} {}) Python/{}z
User-Agentz {}z	python-{}zX-Twilio-Clientzutf-8zAccept-CharsetÚPOSTÚPUTzContent-Typez!application/x-www-form-urlencodedr2   zapplication/json)r
   ÚplatformÚsystemÚmachineÚpython_versionÚformatr   )r#   r'   r+   Úpkg_versionÚos_nameÚos_archrQ   Ú	extensions           r$   r4   zClientBase.get_headersÃ   sæ   € ð ’-˜Rˆô "ˆÜ—/‘/Ó#ˆÜ×"Ñ"Ó$ˆÜ!×0Ñ0Ó2ˆØ D× KÑ KØØØØó	!
ˆ�Ñð ×3Ñ3ò 	=ˆIØ�LÓ! U§\¡\°)Ó%<Ñ<Ô!ð	=à%0×%7Ñ%7¼Ó%DˆÐ!Ñ"ð %,ˆÐ Ñ!Ø�fÒ ¨%¢°nÈGÑ6SØ&IˆG�NÑ#Ø˜7Ñ"Ø 2ˆG�HÑàˆr&   c                 ó  — | j                   s| j                  s|S t        |«      }|j                  j	                  d«      }|d   }dj                  |dd «      }d}d}t        |«      dk(  r|d   }nt        |«      dk(  r
|d   }|d   }| j                   xs |}| j                  xs
 |xs |xr d	}|j                  dj                  ||||fD �cg c]  }|sŒ|‘Œ	 c}«      ¬
«      }t        t        |«      «      S c c}w )zÞ
        Determines the proper hostname given edge and region preferences
        via client configuration or uri.

        :param uri: Fully qualified url

        :returns: The final uri used to make the request
        ú.r   éþÿÿÿNé   é   é   é   Úus1)Únetloc)
r   r   r   r_   ÚsplitÚjoinÚlenÚ_replaceÚstrr	   )	r#   r(   Ú
parsed_urlÚpiecesÚprefixÚsuffixr   r   Úparts	            r$   r8   zClientBase.get_hostnameç   s  € ð �yŠy §¢ØˆJä˜c“]ˆ
Ø×"Ñ"×(Ñ(¨Ó-ˆØ˜‘ˆØ—‘˜&  ˜+Ó&ˆØˆØˆÜˆv‹;˜!Òà˜A‘Y‰FÜ�‹[˜AÒà˜!‘9ˆDØ˜A‘YˆFà�y‰yÒ ˜DˆØ—‘Ò: Ò:¨4ª>°Eˆà×(Ñ(Ø—8‘8¨v°t¸VÀVÐ.LÖU dÒPTšTÒUÓVð )ó 
ˆ
ô ”:˜jÓ)Ó*Ð*ùò Vs   ÃC<ÃC<c                 ó8   — dj                  | j                  «      S )zf
        Provide a friendly representation

        :returns: Machine friendly representation
        z<Twilio {}>)rR   r   )r#   s    r$   Ú__repr__zClientBase.__repr__	  s   € ð ×#Ñ# D×$4Ñ$4Ó5Ð5r&   )	NNNNNNNNN)NNNNNF)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   rd   r   r   r   r   r%   r   Úobjectr   ÚfloatÚboolr   r:   rA   r9   r7   r4   r8   rk   © r&   r$   r   r      sŽ  „ Ù0ð #'Ø"&Ø%)Ø $Ø,0Ø:>Ø"Ø59Ø<@ñ.#à˜3‘-ð.#ð ˜3‘-ð.#ð ˜c‘]ð	.#ð
 ˜‘ð.#ð ˜jÑ)ð.#ð ˜n¨S°#¨XÑ6Ñ7ð.#ð �s‰mð.#ð  (¨¨S©	Ñ2ð.#ð &Ð&8Ñ9ó.#ðh /3Ø,0Ø,0Ø*.Ø#'Ø %ñ3
àð3
ð ð3
ð ˜˜c 6˜kÑ*Ñ+ð	3
ð
 �t˜C ˜KÑ(Ñ)ð3
ð ˜$˜s C˜x™.Ñ)ð3
ð �u˜S #˜X‘Ñ'ð3
ð ˜%‘ð3
ð ð3
ð 
ó3
ðr /3Ø,0Ø,0Ø*.Ø#'Ø %ñ7
àð7
ð ð7
ð ˜˜c 6˜kÑ*Ñ+ð	7
ð
 �t˜C ˜KÑ(Ñ)ð7
ð ˜$˜s C˜x™.Ñ)ð7
ð �u˜S #˜X‘Ñ'ð7
ð ˜%‘ð7
ð ð7
ð 
ó7
òrð!˜X e¨C°¨H¡oÑ6ð !¸5ÀÀcÀ¹?ó !ð"Øð"Ø$,¨T°#°s°(©^Ñ$<ð"à	ˆc�3ˆh‰ó"ðH + ð  +¨ó  +ðD6˜#ô 6r&   r   )r   rN   Útypingr   r   r   r   r   Úurllib.parser   r	   Útwilior
   Útwilio.httpr   Útwilio.http.http_clientr   Útwilio.http.responser   Ú%twilio.credential.credential_providerr   rp   r   rs   r&   r$   ú<module>r{      s1   ðÛ 	Û ß >Õ >ß -å Ý "Ý 4Ý )Ý DôB6�õ B6r&   