o
    Ãª¢i"
  ã                   @   s*   d Z ddlmZmZmZ G dd„ dƒZdS )z2WebSocket-level options for WebSocket connections.é    )ÚAnyÚDictÚOptionalc                
   @   s\   e Zd ZdZdddddœdee dee dee dee fdd	„Zd
ee	e
f fdd„ZdS )ÚWebSocketOptionsa–  
    Options for configuring WebSocket connections.

    These options are passed directly to httpx_ws's connect_ws/aconnect_ws functions.
    For complete documentation, see https://frankie567.github.io/httpx-ws/reference/httpx_ws/

    Attributes:
        keepalive_ping_timeout_seconds: Maximum delay the client will wait for an answer
            to its Ping event. If the delay is exceeded, WebSocketNetworkError will be
            raised and the connection closed. Default: 20 seconds.
        keepalive_ping_interval_seconds: Interval at which the client will automatically
            send a Ping event to keep the connection alive. Set to None to disable this
            mechanism. Default: 20 seconds.
        max_message_size_bytes: Message size in bytes to receive from the server.
            Default: 65536 bytes (64 KiB).
        queue_size: Size of the queue where received messages will be held until they
            are consumed. If the queue is full, the client will stop receiving messages
            from the server until the queue has room available. Default: 512.

    Note:
        Parameter descriptions adapted from httpx_ws documentation.
    N©Úkeepalive_ping_timeout_secondsÚkeepalive_ping_interval_secondsÚmax_message_size_bytesÚ
queue_sizer   r   r	   r
   c                C   s   || _ || _|| _|| _d S )Nr   )Úselfr   r   r	   r
   © r   úT/home/ubuntu/.local/lib/python3.10/site-packages/fishaudio/core/websocket_options.pyÚ__init__   s   
zWebSocketOptions.__init__Úreturnc                 C   sX   i }| j dur| j |d< | jdur| j|d< | jdur | j|d< | jdur*| j|d< |S )z;Convert to kwargs dict for httpx_ws aconnect_ws/connect_ws.Nr   r   r	   r
   r   )r   Úkwargsr   r   r   Úto_httpx_ws_kwargs+   s   
ÿ
ÿ



z#WebSocketOptions.to_httpx_ws_kwargs)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚfloatÚintr   r   Ústrr   r   r   r   r   r   r      s     úýüû
úr   N)r   Útypingr   r   r   r   r   r   r   r   Ú<module>   s    