ó
    ·âhE  ã                   óp   • S SK r S SKrSSKJr  SSKJr  SSKJr  SSKJ	r	  SSK
Jr  S SKJr   " S	 S
5      rg)é    Né   )ÚRoomService)ÚEgressService)ÚIngressService)Ú
SipService)ÚAgentDispatchService)ÚOptionalc                   ó  • \ rS rSrSr   SSSS.S\\   S\\   S\\   S\\R                     S	\\R                     4
S
 jjjr
\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\4S j5       rS rS rS rSrg)Ú
LiveKitAPIé   züLiveKit Server API Client

This class is the main entrypoint, which exposes all services.

Usage:

```python
from livekit import api
lkapi = api.LiveKitAPI()
rooms = await lkapi.room.list_rooms(api.proto_room.ListRoomsRequest(names=['test-room']))
```
N)ÚtimeoutÚsessionÚurlÚapi_keyÚ
api_secretr   r   c                óÞ  • U=(       d    [         R                  " S5      nU=(       d    [         R                  " S5      nU=(       d    [         R                  " S5      nU(       d  [        S5      eU(       a  U(       d  [        S5      eSU l        XPl        U R                  (       d;  SU l        U(       d  [
        R                  " SS	9n[
        R                  " US
9U l        [        U R                  XU5      U l	        [        U R                  XU5      U l        [        U R                  XU5      U l        [        U R                  XU5      U l        [!        U R                  XU5      U l        g)aÜ  Create a new LiveKitAPI instance.

Args:
    url: LiveKit server URL (read from `LIVEKIT_URL` environment variable if not provided)
    api_key: API key (read from `LIVEKIT_API_KEY` environment variable if not provided)
    api_secret: API secret (read from `LIVEKIT_API_SECRET` environment variable if not provided)
    timeout: Request timeout (default: 60 seconds)
    session: aiohttp.ClientSession instance to use for requests, if not provided, a new one will be created
ÚLIVEKIT_URLÚLIVEKIT_API_KEYÚLIVEKIT_API_SECRETzurl must be setz"api_key and api_secret must be setTFé<   )Útotal)r   N)ÚosÚgetenvÚ
ValueErrorÚ_custom_sessionÚ_sessionÚaiohttpÚClientTimeoutÚClientSessionr   Ú_roomr   Ú_ingressr   Ú_egressr   Ú_sipr   Ú_agent_dispatch)Úselfr   r   r   r   r   s         ÚI/var/www/html/env/lib/python3.13/site-packages/livekit/api/livekit_api.pyÚ__init__ÚLiveKitAPI.__init__   s  € ð$ ×-”R—Y’Y˜}Ó-ˆØ×9œRŸYšYÐ'8Ó9ˆØ×B¤2§9¢9Ð-AÓ#Bˆ
æÜÐ.Ó/Ð/æžjÜÐAÓBÐBà#ˆÔØŒØ}}Ø#(ˆDÔ ÞÜ!×/Ò/°bÑ9Ü#×1Ò1¸'ÑBˆDŒMä  §¡°¸jÓIˆŒ
Ü& t§}¡}°cÀJÓOˆŒÜ$ T§]¡]°CÀ*ÓMˆŒÜ˜tŸ}™}¨c¸JÓGˆŒ	Ü3°D·M±MÀ3ÐQ[Ó\ˆÕó    Úreturnc                 ó   • U R                   $ )z$Instance of the AgentDispatchService)r$   ©r%   s    r&   Úagent_dispatchÚLiveKitAPI.agent_dispatchC   s   € ð ×#Ñ#Ð#r)   c                 ó   • U R                   $ )zInstance of the RoomService)r    r,   s    r&   ÚroomÚLiveKitAPI.roomH   s   € ð z‰zÐr)   c                 ó   • U R                   $ )zInstance of the IngressService)r!   r,   s    r&   ÚingressÚLiveKitAPI.ingressM   s   € ð }‰}Ðr)   c                 ó   • U R                   $ )zInstance of the EgressService)r"   r,   s    r&   ÚegressÚLiveKitAPI.egressR   s   € ð |‰|Ðr)   c                 ó   • U R                   $ )zInstance of the SipService)r#   r,   s    r&   ÚsipÚLiveKitAPI.sipW   s   € ð y‰yÐr)   c              ƒ   óx   #   • U R                   (       d#  U R                  R                  5       I Sh  v•N   gg N7f)ziClose the API client

Call this before your application exits or when the API client is no longer needed.N)r   r   Úcloser,   s    r&   ÚacloseÚLiveKitAPI.aclose\   s.   é € ð
 ×#×#Ø—-‘-×%Ñ%Ó'×'Ñ'ð $Ù'ùs   ‚/:±8²:c              ƒ   ó   #   • U $ 7f)ú"@private

Support for `async with`© r,   s    r&   Ú
__aenter__ÚLiveKitAPI.__aenter__d   s   é € ð ˆùs   ‚c              ƒ   ó@   #   • U R                  5       I Sh  v•N   g N7f)r@   N)r=   )r%   Úexc_typeÚexc_valÚexc_tbs       r&   Ú	__aexit__ÚLiveKitAPI.__aexit__j   s   é € ð k‰k‹m×Óùs   ‚–—)r$   r   r"   r!   r    r   r#   )NNN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r	   Ústrr   r   r   r'   Úpropertyr   r-   r   r0   r   r3   r   r6   r   r9   r=   rB   rH   Ú__static_attributes__rA   r)   r&   r   r      s  † ñð "Ø!%Ø$(ð	(]ð 48Ø37ò(]àc‰]ð(]ð ˜#‘ð(]ð ˜S‘Mð	(]ð ˜'×/Ñ/Ñ0ð(]ð ˜'×/Ñ/Ñ0ö(]ðT ð$Ð 4ó $ó ð$ð ðkó ó ðð ð˜ó ó ðð ð˜ó ó ðð ðZó ó ðò(òõr)   r   )r   r   Úroom_servicer   Úegress_servicer   Úingress_servicer   Úsip_servicer   Úagent_dispatch_servicer   Útypingr	   r   rA   r)   r&   Ú<module>rX      s)   ðÛ Û 	Ý %Ý )Ý +Ý #Ý 8Ý ÷cò cr)   