o
    ©¼–is  ã                   @  sX   d dl mZ d dlZd dlmZ ddlmZ ddlmZm	Z	m
Z
 dZG dd	„ d	eƒZdS )
é    )ÚannotationsN)ÚABCé   )ÚTwirpClient)ÚAccessTokenÚVideoGrantsÚ	SIPGrantsÚauthorizationc                   @  s$   e Zd Zddd„Z		dddd„Zd	S )ÚServiceÚsessionúaiohttp.ClientSessionÚhostÚstrÚapi_keyÚ
api_secretc                 C  s   t ||dƒ| _|| _|| _d S )NÚlivekit)r   Ú_clientr   r   )Úselfr   r   r   r   © r   úV/var/www/html/livekit_bhavya/venv/lib/python3.10/site-packages/livekit/api/_service.pyÚ__init__   s   
zService.__init__NÚgrantsúVideoGrants | NoneÚsipúSIPGrants | NoneÚreturnúdict[str, str]c                 C  sL   t | j| jƒ}|r| |¡ |d ur| |¡ | ¡ }i }d |¡|t< |S )Nz	Bearer {})r   r   r   Úwith_grantsÚwith_sip_grantsÚto_jwtÚformatÚAUTHORIZATION)r   r   r   ÚtokÚtokenÚheadersr   r   r   Ú_auth_header   s   

zService._auth_header)r   r   r   r   r   r   r   r   )N)r   r   r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__r   r%   r   r   r   r   r
      s    
ÿr
   )Ú
__future__r   ÚaiohttpÚabcr   Útwirp_clientr   Úaccess_tokenr   r   r   r!   r
   r   r   r   r   Ú<module>   s    