o
    e\                     @   s  d Z ddlZddl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mZ G dd	 d	eZeG d
d deZeG dd deZeG dd deZeG dd deZeG dd deZeG dd deZeG dd deZeG dd deZdS )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
    N)__version__)TwilioException)obsolete_client)TwilioHttpClient)urlparse
urlunparsec                   @   s  e Zd ZdZ			d|ddZ		d}ddZdd	 Zed
d Zedd Z	edd Z
edd Zedd Zedd Zedd Zedd Zedd Zedd Zedd Zed d! Zed"d# Zed$d% Zed&d' Zed(d) Zed*d+ Zed,d- Zed.d/ Zed0d1 Zed2d3 Zed4d5 Zed6d7 Zed8d9 Zed:d; Z ed<d= Z!ed>d? Z"ed@dA Z#edBdC Z$edDdE Z%edFdG Z&edHdI Z'edJdK Z(edLdM Z)edNdO Z*edPdQ Z+edRdS Z,edTdU Z-edVdW Z.edXdY Z/edZd[ Z0ed\d] Z1ed^d_ Z2ed`da Z3edbdc Z4eddde Z5edfdg Z6edhdi Z7edjdk Z8edldm Z9edndo Z:edpdq Z;edrds Z<edtdu Z=edvdw Z>edxdy Z?dzd{ Z@dS )~Clientz( A client for accessing the Twilio API. Nc	           	      C   sb  |pt j}|p|d| _	 |p|d| _	 |p| j| _	 |p$|d| _	 |p-|d| _	 |p3g | _	 | jr<| js@t	d| j| jf| _
	 |pLt | _	 d| _d| _d| _d| _d| _d| _d| _d| _d| _d| _d| _d| _d| _d| _d| _d| _d| _d| _d| _d| _ d| _!d| _"d| _#d| _$d| _%d| _&d| _'d| _(d| _)d| _*d| _+d| _,dS )a  
        Initializes the Twilio Client

        :param str username: Username to authenticate with
        :param str password: Password to authenticate with
        :param str account_sid: Account SID, defaults to Username
        :param str region: Twilio Region to make requests to, defaults to 'us1' if an edge is provided
        :param HttpClient http_client: HttpClient, defaults to TwilioHttpClient
        :param dict environment: Environment to look for auth details, defaults to os.environ
        :param str edge: Twilio Edge to make requests to, defaults to None
        :param list[str] user_agent_extensions: Additions to the user agent string

        :returns: Twilio Client
        :rtype: twilio.rest.Client
        TWILIO_ACCOUNT_SIDTWILIO_AUTH_TOKENTWILIO_EDGETWILIO_REGIONz1Credentials are required to create a TwilioClientN)-osenvirongetusernamepasswordaccount_sidedgeregionuser_agent_extensionsr   authr   http_client	_accounts_api
_autopilot_chat_conversations_events_fax	_flex_api_frontline_api	_insights_ip_messaging_lookups_media
_messaging_monitor_notify_numbers_preview_pricing_proxy_serverless_studio_sync_taskrouter	_trunking	_trusthub_verify_video_voice	_wireless	_supersim_bulkexports)	selfr   r   r   r   r   environmentr   r    r:   G/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/__init__.py__init__   sf   


zClient.__init__Fc	              
   C   s   |p| j }|pi }t}	t }
t }t }d|	|
|||d< | jD ]}|d  d|7  < q$dt|d< d|d< |dkrId	|vrId
|d	< d|vrQd|d< | |}| j	j
||||||||dS )a  
        Makes a request to the Twilio API using the configured http client
        Authentication information is automatically added if none is provided

        :param str method: HTTP Method
        :param str uri: Fully qualified url
        :param dict[str, str] params: Query string parameters
        :param dict[str, str] data: POST body data
        :param dict[str, str] headers: HTTP Headers
        :param tuple(str, str) auth: Authentication
        :param int timeout: Timeout in seconds
        :param bool allow_redirects: Should the client follow redirects

        :returns: Response from the Twilio API
        :rtype: twilio.http.response.Response
        z"twilio-python/{} ({} {}) Python/{}z
User-Agentz {}z	python-{}zX-Twilio-Clientzutf-8zAccept-CharsetPOSTzContent-Typez!application/x-www-form-urlencodedAcceptzapplication/json)paramsdataheadersr   timeoutallow_redirects)r   r   platformsystemmachinepython_versionformatr   get_hostnamer   request)r8   methodurir?   r@   rA   r   rB   rC   pkg_versionos_nameos_archrG   	extensionr:   r:   r;   rJ   c   s>   


zClient.requestc                 C   s   | j s| js|S t|}|jd}|d }d|dd }d}d}t|dkr.|d }nt|dkr<|d }|d }| j p@|}| jpI|pI|oId	}|jdd
d ||||fD d}t|S )z
        Determines the proper hostname given edge and region preferences
        via client configuration or uri.

        :param str uri: Fully qualified url

        :returns: The final uri used to make the request
        :rtype: str
        .r   N            us1c                 S   s   g | ]}|r|qS r:   r:   ).0partr:   r:   r;   
<listcomp>   s    z'Client.get_hostname.<locals>.<listcomp>)netloc)	r   r   r   r[   splitjoinlen_replacer   )r8   rL   
parsed_urlpiecesprefixsuffixr   r   r:   r:   r;   rI      s&   


zClient.get_hostnamec                 C   &   | j du rddlm} || | _ | j S )z
        Access the Accounts Twilio Domain

        :returns: Accounts Twilio Domain
        :rtype: twilio.rest.accounts.Accounts
        Nr   )Accounts)r   twilio.rest.accountsre   )r8   re   r:   r:   r;   accounts      

zClient.accountsc                 C   rd   )zw
        Access the Api Twilio Domain

        :returns: Api Twilio Domain
        :rtype: twilio.rest.api.Api
        Nr   )Api)r   twilio.rest.apiri   )r8   ri   r:   r:   r;   api   rh   z
Client.apic                 C   rd   )z
        Access the Autopilot Twilio Domain

        :returns: Autopilot Twilio Domain
        :rtype: twilio.rest.autopilot.Autopilot
        Nr   )	Autopilot)r   twilio.rest.autopilotrl   )r8   rl   r:   r:   r;   	autopilot   rh   zClient.autopilotc                 C   rd   )z{
        Access the Chat Twilio Domain

        :returns: Chat Twilio Domain
        :rtype: twilio.rest.chat.Chat
        Nr   )Chat)r   twilio.rest.chatro   )r8   ro   r:   r:   r;   chat   rh   zClient.chatc                 C   rd   )z
        Access the Conversations Twilio Domain

        :returns: Conversations Twilio Domain
        :rtype: twilio.rest.conversations.Conversations
        Nr   )Conversations)r   twilio.rest.conversationsrr   )r8   rr   r:   r:   r;   conversations   rh   zClient.conversationsc                 C   rd   )z
        Access the Events Twilio Domain

        :returns: Events Twilio Domain
        :rtype: twilio.rest.events.Events
        Nr   )Events)r   twilio.rest.eventsru   )r8   ru   r:   r:   r;   events   rh   zClient.eventsc                 C   rd   )zw
        Access the Fax Twilio Domain

        :returns: Fax Twilio Domain
        :rtype: twilio.rest.fax.Fax
        Nr   )Fax)r   twilio.rest.faxrx   )r8   rx   r:   r:   r;   fax  rh   z
Client.faxc                 C   rd   )z
        Access the FlexApi Twilio Domain

        :returns: FlexApi Twilio Domain
        :rtype: twilio.rest.flex_api.FlexApi
        Nr   )FlexApi)r   twilio.rest.flex_apir{   )r8   r{   r:   r:   r;   flex_api  rh   zClient.flex_apic                 C   rd   )z
        Access the FrontlineApi Twilio Domain

        :returns: FrontlineApi Twilio Domain
        :rtype: twilio.rest.frontline_api.FrontlineApi
        Nr   )FrontlineApi)r    twilio.rest.frontline_apir~   )r8   r~   r:   r:   r;   frontline_api%  rh   zClient.frontline_apic                 C   rd   )z
        Access the Insights Twilio Domain

        :returns: Insights Twilio Domain
        :rtype: twilio.rest.insights.Insights
        Nr   )Insights)r!   twilio.rest.insightsr   )r8   r   r:   r:   r;   insights2  rh   zClient.insightsc                 C   rd   )z
        Access the IpMessaging Twilio Domain

        :returns: IpMessaging Twilio Domain
        :rtype: twilio.rest.ip_messaging.IpMessaging
        Nr   )IpMessaging)r"   twilio.rest.ip_messagingr   )r8   r   r:   r:   r;   ip_messaging?  rh   zClient.ip_messagingc                 C   rd   )z
        Access the Lookups Twilio Domain

        :returns: Lookups Twilio Domain
        :rtype: twilio.rest.lookups.Lookups
        Nr   )Lookups)r#   twilio.rest.lookupsr   )r8   r   r:   r:   r;   lookupsL  rh   zClient.lookupsc                 C   rd   )z
        Access the Media Twilio Domain

        :returns: Media Twilio Domain
        :rtype: twilio.rest.media.Media
        Nr   )Media)r$   twilio.rest.mediar   )r8   r   r:   r:   r;   mediaY  rh   zClient.mediac                 C   rd   )z
        Access the Messaging Twilio Domain

        :returns: Messaging Twilio Domain
        :rtype: twilio.rest.messaging.Messaging
        Nr   )	Messaging)r%   twilio.rest.messagingr   )r8   r   r:   r:   r;   	messagingf  rh   zClient.messagingc                 C   rd   )z
        Access the Monitor Twilio Domain

        :returns: Monitor Twilio Domain
        :rtype: twilio.rest.monitor.Monitor
        Nr   )Monitor)r&   twilio.rest.monitorr   )r8   r   r:   r:   r;   monitors  rh   zClient.monitorc                 C   rd   )z
        Access the Notify Twilio Domain

        :returns: Notify Twilio Domain
        :rtype: twilio.rest.notify.Notify
        Nr   )Notify)r'   twilio.rest.notifyr   )r8   r   r:   r:   r;   notify  rh   zClient.notifyc                 C   rd   )z
        Access the Numbers Twilio Domain

        :returns: Numbers Twilio Domain
        :rtype: twilio.rest.numbers.Numbers
        Nr   )Numbers)r(   twilio.rest.numbersr   )r8   r   r:   r:   r;   numbers  rh   zClient.numbersc                 C   rd   )z
        Access the Preview Twilio Domain

        :returns: Preview Twilio Domain
        :rtype: twilio.rest.preview.Preview
        Nr   )Preview)r)   twilio.rest.previewr   )r8   r   r:   r:   r;   preview  rh   zClient.previewc                 C   rd   )z
        Access the Pricing Twilio Domain

        :returns: Pricing Twilio Domain
        :rtype: twilio.rest.pricing.Pricing
        Nr   )Pricing)r*   twilio.rest.pricingr   )r8   r   r:   r:   r;   pricing  rh   zClient.pricingc                 C   rd   )z
        Access the Proxy Twilio Domain

        :returns: Proxy Twilio Domain
        :rtype: twilio.rest.proxy.Proxy
        Nr   )Proxy)r+   twilio.rest.proxyr   )r8   r   r:   r:   r;   proxy  rh   zClient.proxyc                 C   rd   )z
        Access the Serverless Twilio Domain

        :returns: Serverless Twilio Domain
        :rtype: twilio.rest.serverless.Serverless
        Nr   )
Serverless)r,   twilio.rest.serverlessr   )r8   r   r:   r:   r;   
serverless  rh   zClient.serverlessc                 C   rd   )z
        Access the Studio Twilio Domain

        :returns: Studio Twilio Domain
        :rtype: twilio.rest.studio.Studio
        Nr   )Studio)r-   twilio.rest.studior   )r8   r   r:   r:   r;   studio  rh   zClient.studioc                 C   rd   )z{
        Access the Sync Twilio Domain

        :returns: Sync Twilio Domain
        :rtype: twilio.rest.sync.Sync
        Nr   )Sync)r.   twilio.rest.syncr   )r8   r   r:   r:   r;   sync  rh   zClient.syncc                 C   rd   )z
        Access the Taskrouter Twilio Domain

        :returns: Taskrouter Twilio Domain
        :rtype: twilio.rest.taskrouter.Taskrouter
        Nr   )
Taskrouter)r/   twilio.rest.taskrouterr   )r8   r   r:   r:   r;   
taskrouter  rh   zClient.taskrouterc                 C   rd   )z
        Access the Trunking Twilio Domain

        :returns: Trunking Twilio Domain
        :rtype: twilio.rest.trunking.Trunking
        Nr   )Trunking)r0   twilio.rest.trunkingr   )r8   r   r:   r:   r;   trunking  rh   zClient.trunkingc                 C   rd   )z
        Access the Trusthub Twilio Domain

        :returns: Trusthub Twilio Domain
        :rtype: twilio.rest.trusthub.Trusthub
        Nr   )Trusthub)r1   twilio.rest.trusthubr   )r8   r   r:   r:   r;   trusthub  rh   zClient.trusthubc                 C   rd   )z
        Access the Verify Twilio Domain

        :returns: Verify Twilio Domain
        :rtype: twilio.rest.verify.Verify
        Nr   )Verify)r2   twilio.rest.verifyr   )r8   r   r:   r:   r;   verify  rh   zClient.verifyc                 C   rd   )z
        Access the Video Twilio Domain

        :returns: Video Twilio Domain
        :rtype: twilio.rest.video.Video
        Nr   )Video)r3   twilio.rest.videor   )r8   r   r:   r:   r;   video  rh   zClient.videoc                 C   rd   )z
        Access the Voice Twilio Domain

        :returns: Voice Twilio Domain
        :rtype: twilio.rest.voice.Voice
        Nr   )Voice)r4   twilio.rest.voicer   )r8   r   r:   r:   r;   voice)  rh   zClient.voicec                 C   rd   )z
        Access the Wireless Twilio Domain

        :returns: Wireless Twilio Domain
        :rtype: twilio.rest.wireless.Wireless
        Nr   )Wireless)r5   twilio.rest.wirelessr   )r8   r   r:   r:   r;   wireless6  rh   zClient.wirelessc                 C   rd   )z
        Access the Supersim Twilio Domain

        :returns: Supersim Twilio Domain
        :rtype: twilio.rest.supersim.Supersim
        Nr   )Supersim)r6   twilio.rest.supersimr   )r8   r   r:   r:   r;   supersimC  rh   zClient.supersimc                 C   rd   )z
        Access the Bulkexports Twilio Domain

        :returns: Bulkexports Twilio Domain
        :rtype: twilio.rest.bulkexports.Bulkexports
        Nr   )Bulkexports)r7   twilio.rest.bulkexportsr   )r8   r   r:   r:   r;   bulkexportsP  rh   zClient.bulkexportsc                 C   
   | j jjS )zK
        :rtype: twilio.rest.api.v2010.account.address.AddressList
        )rk   account	addressesr8   r:   r:   r;   r   ]     
zClient.addressesc                 C   r   )zS
        :rtype: twilio.rest.api.v2010.account.application.ApplicationList
        )rk   r   applicationsr   r:   r:   r;   r   d  r   zClient.applicationsc                 C   r   )zg
        :rtype: twilio.rest.api.v2010.account.authorized_connect_app.AuthorizedConnectAppList
        )rk   r   authorized_connect_appsr   r:   r:   r;   r   k  r   zClient.authorized_connect_appsc                 C   r   )zn
        :rtype: twilio.rest.api.v2010.account.available_phone_number.AvailablePhoneNumberCountryList
        )rk   r   available_phone_numbersr   r:   r:   r;   r   r  r   zClient.available_phone_numbersc                 C   r   )zK
        :rtype: twilio.rest.api.v2010.account.balance.BalanceList
        )rk   r   balancer   r:   r:   r;   r   y  r   zClient.balancec                 C   r   )zE
        :rtype: twilio.rest.api.v2010.account.call.CallList
        )rk   r   callsr   r:   r:   r;   r     r   zClient.callsc                 C   r   )zQ
        :rtype: twilio.rest.api.v2010.account.conference.ConferenceList
        )rk   r   conferencesr   r:   r:   r;   r     r   zClient.conferencesc                 C   r   )zR
        :rtype: twilio.rest.api.v2010.account.connect_app.ConnectAppList
        )rk   r   connect_appsr   r:   r:   r;   r     r   zClient.connect_appsc                 C   r   )ze
        :rtype: twilio.rest.api.v2010.account.incoming_phone_number.IncomingPhoneNumberList
        )rk   r   incoming_phone_numbersr   r:   r:   r;   r     r   zClient.incoming_phone_numbersc                 C   r   )zC
        :rtype: twilio.rest.api.v2010.account.key.KeyList
        )rk   r   keysr   r:   r:   r;   r     r   zClient.keysc                 C   r   )zK
        :rtype: twilio.rest.api.v2010.account.message.MessageList
        )rk   r   messagesr   r:   r:   r;   r     r   zClient.messagesc                 C   r   )zJ
        :rtype: twilio.rest.api.v2010.account.new_key.NewKeyList
        )rk   r   new_keysr   r:   r:   r;   r     r   zClient.new_keysc                 C   r   )zY
        :rtype: twilio.rest.api.v2010.account.new_signing_key.NewSigningKeyList
        )rk   r   new_signing_keysr   r:   r:   r;   r     r   zClient.new_signing_keysc                 C   r   )zU
        :rtype: twilio.rest.api.v2010.account.notification.NotificationList
        )rk   r   notificationsr   r:   r:   r;   r     r   zClient.notificationsc                 C   r   )z_
        :rtype: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdList
        )rk   r   outgoing_caller_idsr   r:   r:   r;   r     r   zClient.outgoing_caller_idsc                 C   r   )zG
        :rtype: twilio.rest.api.v2010.account.queue.QueueList
        )rk   r   queuesr   r:   r:   r;   r     r   zClient.queuesc                 C   r   )zO
        :rtype: twilio.rest.api.v2010.account.recording.RecordingList
        )rk   r   
recordingsr   r:   r:   r;   r     r   zClient.recordingsc                 C   r   )zR
        :rtype: twilio.rest.api.v2010.account.signing_key.SigningKeyList
        )rk   r   signing_keysr   r:   r:   r;   r     r   zClient.signing_keysc                 C   r   )zC
        :rtype: twilio.rest.api.v2010.account.sip.SipList
        )rk   r   sipr   r:   r:   r;   r     r   z
Client.sipc                 C   r   )zP
        :rtype: twilio.rest.api.v2010.account.short_code.ShortCodeList
        )rk   r   short_codesr   r:   r:   r;   r     r   zClient.short_codesc                 C   r   )zG
        :rtype: twilio.rest.api.v2010.account.token.TokenList
        )rk   r   tokensr   r:   r:   r;   r     r   zClient.tokensc                 C   r   )zW
        :rtype: twilio.rest.api.v2010.account.transcription.TranscriptionList
        )rk   r   transcriptionsr   r:   r:   r;   r     r   zClient.transcriptionsc                 C   r   )zG
        :rtype: twilio.rest.api.v2010.account.usage.UsageList
        )rk   r   usager   r:   r:   r;   r     r   zClient.usagec                 C   r   )z`
        :rtype: twilio.rest.api.v2010.account.validation_request.ValidationRequestList
        )rk   r   validation_requestsr   r:   r:   r;   r     r   zClient.validation_requestsc                 C   s   d | jS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio {}>)rH   r   r   r:   r:   r;   __repr__  s   zClient.__repr__)NNNNNNNN)NNNNNF)A__name__
__module____qualname____doc__r<   rJ   rI   propertyrg   rk   rn   rq   rt   rw   rz   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r:   r:   r:   r;   r      s    
K
7#























































r   c                   @      e Zd ZdZdd ZdS )TwilioClientZ Dummy client which provides no functionality. Please use
    twilio.rest.Client instead. c                 G      d S Nr:   r8   argsr:   r:   r;   r<        zTwilioClient.__init__Nr   r   r   r   r<   r:   r:   r:   r;   r         r   c                   @   r   )TwilioRestClientr   c                 G   r   r   r:   r   r:   r:   r;   r<     r   zTwilioRestClient.__init__Nr   r:   r:   r:   r;   r     r   r   c                   @   r   )TwilioIpMessagingClientr   c                 G   r   r   r:   r   r:   r:   r;   r<   &  r   z TwilioIpMessagingClient.__init__Nr   r:   r:   r:   r;   r   !  r   r   c                   @   r   )TwilioLookupsClientr   c                 G   r   r   r:   r   r:   r:   r;   r<   /  r   zTwilioLookupsClient.__init__Nr   r:   r:   r:   r;   r   *  r   r   c                   @   r   )TwilioMonitorClientr   c                 G   r   r   r:   r   r:   r:   r;   r<   8  r   zTwilioMonitorClient.__init__Nr   r:   r:   r:   r;   r   3  r   r   c                   @   r   )TwilioPricingClientr   c                 G   r   r   r:   r   r:   r:   r;   r<   A  r   zTwilioPricingClient.__init__Nr   r:   r:   r:   r;   r   <  r   r   c                   @   r   )TwilioTaskRouterClientr   c                 G   r   r   r:   r   r:   r:   r;   r<   J  r   zTwilioTaskRouterClient.__init__Nr   r:   r:   r:   r;   r   E  r   r   c                   @   r   )TwilioTrunkingClientr   c                 G   r   r   r:   r   r:   r:   r;   r<   S  r   zTwilioTrunkingClient.__init__Nr   r:   r:   r:   r;   r   N  r   r   )r   r   rD   twilior   twilio.base.exceptionsr   twilio.base.obsoleter   twilio.http.http_clientr   urllib.parser   r   objectr   r   r   r   r   r   r   r   r   r:   r:   r:   r;   <module>   s<        