
    g                     H    S SK Jr  S SKJr   " S S\5      r " S S\5      rg)    )Jwt)	urlencodec                   f   ^  \ rS rSrSrSr\R                  SS4U 4S jjrS r	S r
S	 rS
 rSrU =r$ )ClientCapabilityToken   z1A token to control permissions with Twilio ClientHS256i  Nc           	        > [         [        U ]  U R                  UUUUSS9  Xl        X l        SU l        0 U l        SU;   a  U R                  " S0 US   D6  SU;   a  U R                  " S0 US   D6  SU;   a  U R                  " S0 US   D6  gg)a  
:param str account_sid: The account sid to which this token is granted access.
:param str auth_token: The secret key used to sign the token. Note, this auth token is not
                       visible to the user of the token.
:param int nbf: Time in secs from epic before which this token is considered invalid.
:param int ttl: the amount of time in seconds from generation that this token is valid for.
:param kwargs:


:returns: A new CapabilityToken with zero permissions
N)	algorithm
secret_keyissuernbfttlvalid_untilallow_client_outgoingallow_client_incomingallow_event_stream )superr   __init__	ALGORITHMaccount_sid
auth_tokenclient_namecapabilitiesr   r   r   )selfr   r   r   r   r   kwargs	__class__s          b/Users/Alptekin/Desktop/izin_takip/venv/lib/python3.13/site-packages/twilio/jwt/client/__init__.pyr   ClientCapabilityToken.__init__   s    ( 	#T3nn! 	4 	
 '$"f,&&I0G)HI"f,&&I0G)HI6)##Cf-A&BC *    c                     [        SSSU05      nU(       a  UR                  S[        USS95        X0R                  S'   g)z
Allow the user of this token to make outgoing connections. Keyword arguments are passed
to the application.

:param str application_sid: Application to contact
clientoutgoingappSid	appParamsTdoseqNScopeURI	add_paramr   r   )r   application_sidr   scopes       r   r   +ClientCapabilityToken.allow_client_outgoing4   s=     ://JKOOK6)FG(-*%r    c                 H    Xl         [        SSSU05      U R                  S'   g)zx
Allow the user of this token to accept incoming connections.

:param str client_name: Client name to accept calls from
r"   incoming
clientNameN)r   r)   r   )r   r   s     r   r   +ClientCapabilityToken.allow_client_incomingA   s+     '(0j<"=)
*%r    c                     [        SSSS05      nU(       a  UR                  S[        USS95        X R                  S'   g	)
z<
Allow the user of this token to access their event stream.
stream	subscribepathz/2010-04-01/EventsparamsTr&   eventsNr(   )r   r   r,   s      r   r   (ClientCapabilityToken.allow_event_streamL   s>     ;9M0NOOOHid&CD&+(#r    c                 ,   SU R                   ;   a6  U R                  b)  U R                   S   R                  SU R                  5        U R                   R                  5        Vs/ s H  oR	                  5       PM     nnSSR                  U5      0$ s  snf )Nr#   r0   r,    )r   r   r*   values
to_payloadjoin)r   	scope_uri
scope_uriss      r   _generate_payload'ClientCapabilityToken._generate_payloadV   s    ***t/?/?/Kj)33L$BRBRS 594E4E4L4L4N
4Ny  "4N 	 
 *-..
s   #B)r   r   r   r   )__name__
__module____qualname____firstlineno____doc__r   r   GENERATEr   r   r   r   r@   __static_attributes____classcell__)r   s   @r   r   r      s:    ;I LL'DR.	
,/ /r    r   c                   4    \ rS rSrSrS	S jrS rS rS rSr	g)
r)   `   zDA single capability granted to Twilio Client and scoped to a serviceNc                 <    Xl         X l        U=(       d    0 U l        g N)service	privileger6   )r   rN   rO   r6   s       r   r   ScopeURI.__init__c   s    "lr    c                      X R                   U'   g rM   )r6   )r   keyvalues      r   r*   ScopeURI.add_paramh   s     Cr    c                 .   U R                   (       aV  [        U R                   R                  5        VVs/ s H  u  pX4PM
     snn5      n[        U5      nSR	                  U5      nOSnSR	                  U R
                  U R                  U5      $ s  snnf )Nz?{} zscope:{}:{}{})r6   sorteditemsr   formatrN   rO   )r   kvsorted_paramsencoded_paramsparam_strings         r   r<   ScopeURI.to_payloadk   su    ;;"t{{7H7H7J#K7JtqQF7J#KLM&}5N <<7LL%%dllDNNLQQ $Ls   B
c                 @    SR                  U R                  5       5      $ )Nz<ScopeURI {}>)rY   r<   )r   s    r   __str__ScopeURI.__str__t   s    %%doo&788r    )r6   rO   rN   rM   )
rB   rC   rD   rE   rF   r   r*   r<   ra   rH   r   r    r   r)   r)   `   s    N#
!R9r    r)   N)
twilio.jwtr   urllib.parser   r   objectr)   r   r    r   <module>rf      s&     "W/C W/t9v 9r    