@@ -29,7 +29,7 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v33</code></h1>
2929</ summary >
3030< pre > < code class ="python "> ''' Module containing Agent RTM API client implementation for v3.3. '''
3131
32- from typing import Any, Optional, Union
32+ from typing import Any, Callable, Optional, Union
3333
3434from livechat.utils.helpers import prepare_payload
3535from livechat.utils.structures import AccessToken, RtmResponse
@@ -40,15 +40,21 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v33</code></h1>
4040
4141class AgentRtmV33:
4242 ''' Agent RTM API Class containing methods in version 3.3. '''
43- def __init__(self, url: str):
44- self.ws = WebsocketClient(url=f'wss://{url}/v3.3/agent/rtm/ws')
43+ def __init__(
44+ self,
45+ url: str,
46+ header: Union[list, dict, Callable, None],
47+ ):
48+ self.ws = WebsocketClient(url=f'wss://{url}/v3.3/agent/rtm/ws',
49+ header=header)
4550
4651 def open_connection(self,
4752 origin: dict = None,
48- ping_timeout: float = 3,
49- ping_interval: float = 5,
50- ws_conn_timeout: float = 10,
51- keep_alive: bool = True) -> None:
53+ ping_timeout: Union[float, int] = 3,
54+ ping_interval: Union[float, int] = 5,
55+ ws_conn_timeout: Union[float, int] = 10,
56+ keep_alive: bool = True,
57+ response_timeout: Union[float, int] = 3) -> None:
5258 ''' Opens WebSocket connection.
5359
5460 Args:
@@ -60,9 +66,11 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v33</code></h1>
6066 ws_conn_timeout (int or float): timeout (in seconds) to wait for WebSocket connection,
6167 by default sets to 10 seconds.
6268 keep_alive(bool): Bool which states if connection should be kept, by default sets to `True`.
69+ response_timeout (int or float): timeout (in seconds) to wait for the response,
70+ by default sets to 3 seconds.
6371 '''
6472 self.ws.open(origin, ping_timeout, ping_interval, ws_conn_timeout,
65- keep_alive)
73+ keep_alive, response_timeout )
6674
6775 def close_connection(self) -> None:
6876 ''' Closes WebSocket connection. '''
@@ -1067,7 +1075,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
10671075< dl >
10681076< dt id ="livechat.agent.rtm.api.v33.AgentRtmV33 "> < code class ="flex name class ">
10691077< span > class < span class ="ident "> AgentRtmV33</ span > </ span >
1070- < span > (</ span > < span > url: str)</ span >
1078+ < span > (</ span > < span > url: str, header: Union[list, dict, Callable, None] )</ span >
10711079</ code > </ dt >
10721080< dd >
10731081< div class ="desc "> < p > Agent RTM API Class containing methods in version 3.3.</ p > </ div >
@@ -1077,15 +1085,21 @@ <h2 class="section-title" id="header-classes">Classes</h2>
10771085</ summary >
10781086< pre > < code class ="python "> class AgentRtmV33:
10791087 ''' Agent RTM API Class containing methods in version 3.3. '''
1080- def __init__(self, url: str):
1081- self.ws = WebsocketClient(url=f'wss://{url}/v3.3/agent/rtm/ws')
1088+ def __init__(
1089+ self,
1090+ url: str,
1091+ header: Union[list, dict, Callable, None],
1092+ ):
1093+ self.ws = WebsocketClient(url=f'wss://{url}/v3.3/agent/rtm/ws',
1094+ header=header)
10821095
10831096 def open_connection(self,
10841097 origin: dict = None,
1085- ping_timeout: float = 3,
1086- ping_interval: float = 5,
1087- ws_conn_timeout: float = 10,
1088- keep_alive: bool = True) -> None:
1098+ ping_timeout: Union[float, int] = 3,
1099+ ping_interval: Union[float, int] = 5,
1100+ ws_conn_timeout: Union[float, int] = 10,
1101+ keep_alive: bool = True,
1102+ response_timeout: Union[float, int] = 3) -> None:
10891103 ''' Opens WebSocket connection.
10901104
10911105 Args:
@@ -1097,9 +1111,11 @@ <h2 class="section-title" id="header-classes">Classes</h2>
10971111 ws_conn_timeout (int or float): timeout (in seconds) to wait for WebSocket connection,
10981112 by default sets to 10 seconds.
10991113 keep_alive(bool): Bool which states if connection should be kept, by default sets to `True`.
1114+ response_timeout (int or float): timeout (in seconds) to wait for the response,
1115+ by default sets to 3 seconds.
11001116 '''
11011117 self.ws.open(origin, ping_timeout, ping_interval, ws_conn_timeout,
1102- keep_alive)
1118+ keep_alive, response_timeout )
11031119
11041120 def close_connection(self) -> None:
11051121 ''' Closes WebSocket connection. '''
@@ -3303,7 +3319,7 @@ <h2 id="returns">Returns</h2>
33033319</ details >
33043320</ dd >
33053321< dt id ="livechat.agent.rtm.api.v33.AgentRtmV33.open_connection "> < code class ="name flex ">
3306- < span > def < span class ="ident "> open_connection</ span > </ span > (< span > self, origin: dict = None, ping_timeout: float = 3, ping_interval: float = 5, ws_conn_timeout: float = 10, keep_alive: bool = True) ‑> None</ span >
3322+ < span > def < span class ="ident "> open_connection</ span > </ span > (< span > self, origin: dict = None, ping_timeout: Union[ float, int] = 3, ping_interval: Union[ float, int] = 5, ws_conn_timeout: Union[ float, int] = 10, keep_alive: bool = True, response_timeout: Union[float, int] = 3 ) ‑> None</ span >
33073323</ code > </ dt >
33083324< dd >
33093325< div class ="desc "> < p > Opens WebSocket connection.</ p >
@@ -3320,18 +3336,22 @@ <h2 id="args">Args</h2>
33203336< dt > < strong > < code > ws_conn_timeout</ code > </ strong > : < code > int</ code > or < code > float</ code > </ dt >
33213337< dd > timeout (in seconds) to wait for WebSocket connection,
33223338by default sets to 10 seconds.</ dd >
3323- </ dl >
3324- < p > keep_alive(bool): Bool which states if connection should be kept, by default sets to < code > True</ code > .</ p > </ div >
3339+ < dt > keep_alive(bool): Bool which states if connection should be kept, by default sets to < code > True</ code > .</ dt >
3340+ < dt > < strong > < code > response_timeout</ code > </ strong > : < code > int</ code > or < code > float</ code > </ dt >
3341+ < dd > timeout (in seconds) to wait for the response,
3342+ by default sets to 3 seconds.</ dd >
3343+ </ dl > </ div >
33253344< details class ="source ">
33263345< summary >
33273346< span > Expand source code</ span >
33283347</ summary >
33293348< pre > < code class ="python "> def open_connection(self,
33303349 origin: dict = None,
3331- ping_timeout: float = 3,
3332- ping_interval: float = 5,
3333- ws_conn_timeout: float = 10,
3334- keep_alive: bool = True) -> None:
3350+ ping_timeout: Union[float, int] = 3,
3351+ ping_interval: Union[float, int] = 5,
3352+ ws_conn_timeout: Union[float, int] = 10,
3353+ keep_alive: bool = True,
3354+ response_timeout: Union[float, int] = 3) -> None:
33353355 ''' Opens WebSocket connection.
33363356
33373357 Args:
@@ -3343,9 +3363,11 @@ <h2 id="args">Args</h2>
33433363 ws_conn_timeout (int or float): timeout (in seconds) to wait for WebSocket connection,
33443364 by default sets to 10 seconds.
33453365 keep_alive(bool): Bool which states if connection should be kept, by default sets to `True`.
3366+ response_timeout (int or float): timeout (in seconds) to wait for the response,
3367+ by default sets to 3 seconds.
33463368 '''
33473369 self.ws.open(origin, ping_timeout, ping_interval, ws_conn_timeout,
3348- keep_alive)</ code > </ pre >
3370+ keep_alive, response_timeout )</ code > </ pre >
33493371</ details >
33503372</ dd >
33513373< dt id ="livechat.agent.rtm.api.v33.AgentRtmV33.remove_user_from_chat "> < code class ="name flex ">
0 commit comments