Skip to content

Commit 8e7d031

Browse files
authored
release 0.4.0 (#145)
1 parent d71c683 commit 8e7d031

File tree

17 files changed

+972
-222
lines changed

17 files changed

+972
-222
lines changed

changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4-
## [0.4.0] - TBA
4+
## [0.4.0] - 2025-02-14
55

66
### Added
77
- New `get_company_details`, `list_customer_bans` and `unban_customer` methods in configuration-api v3.6.

docs/agent/rtm/api/v33.html

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v33</code></h1>
2929
</summary>
3030
<pre><code class="python">&#39;&#39;&#39; Module containing Agent RTM API client implementation for v3.3. &#39;&#39;&#39;
3131

32-
from typing import Any, Optional, Union
32+
from typing import Any, Callable, Optional, Union
3333

3434
from livechat.utils.helpers import prepare_payload
3535
from livechat.utils.structures import AccessToken, RtmResponse
@@ -40,15 +40,21 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v33</code></h1>
4040

4141
class AgentRtmV33:
4242
&#39;&#39;&#39; Agent RTM API Class containing methods in version 3.3. &#39;&#39;&#39;
43-
def __init__(self, url: str):
44-
self.ws = WebsocketClient(url=f&#39;wss://{url}/v3.3/agent/rtm/ws&#39;)
43+
def __init__(
44+
self,
45+
url: str,
46+
header: Union[list, dict, Callable, None],
47+
):
48+
self.ws = WebsocketClient(url=f&#39;wss://{url}/v3.3/agent/rtm/ws&#39;,
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) -&gt; 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) -&gt; None:
5258
&#39;&#39;&#39; 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
&#39;&#39;&#39;
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) -&gt; None:
6876
&#39;&#39;&#39; Closes WebSocket connection. &#39;&#39;&#39;
@@ -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
&#39;&#39;&#39; Agent RTM API Class containing methods in version 3.3. &#39;&#39;&#39;
1080-
def __init__(self, url: str):
1081-
self.ws = WebsocketClient(url=f&#39;wss://{url}/v3.3/agent/rtm/ws&#39;)
1088+
def __init__(
1089+
self,
1090+
url: str,
1091+
header: Union[list, dict, Callable, None],
1092+
):
1093+
self.ws = WebsocketClient(url=f&#39;wss://{url}/v3.3/agent/rtm/ws&#39;,
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) -&gt; 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) -&gt; None:
10891103
&#39;&#39;&#39; 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
&#39;&#39;&#39;
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) -&gt; None:
11051121
&#39;&#39;&#39; Closes WebSocket connection. &#39;&#39;&#39;
@@ -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> :&ensp;<code>int</code> or <code>float</code></dt>
33213337
<dd>timeout (in seconds) to wait for WebSocket connection,
33223338
by 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> :&ensp;<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) -&gt; 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) -&gt; None:
33353355
&#39;&#39;&#39; 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
&#39;&#39;&#39;
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">

docs/agent/rtm/api/v34.html

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v34</code></h1>
2929
</summary>
3030
<pre><code class="python">&#39;&#39;&#39; Module containing Agent RTM API client implementation for v3.4. &#39;&#39;&#39;
3131

32-
from typing import Any, Optional, Union
32+
from typing import Any, Callable, Optional, Union
3333

3434
from livechat.utils.helpers import prepare_payload
3535
from livechat.utils.structures import AccessToken, RtmResponse
@@ -40,15 +40,21 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v34</code></h1>
4040

4141
class AgentRtmV34:
4242
&#39;&#39;&#39; Agent RTM API Class containing methods in version 3.4. &#39;&#39;&#39;
43-
def __init__(self, url: str):
44-
self.ws = WebsocketClient(url=f&#39;wss://{url}/v3.4/agent/rtm/ws&#39;)
43+
def __init__(
44+
self,
45+
url: str,
46+
header: Union[list, dict, Callable, None],
47+
):
48+
self.ws = WebsocketClient(url=f&#39;wss://{url}/v3.4/agent/rtm/ws&#39;,
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) -&gt; 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) -&gt; None:
5258
&#39;&#39;&#39; Opens WebSocket connection.
5359

5460
Args:
@@ -60,9 +66,11 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v34</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
&#39;&#39;&#39;
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) -&gt; None:
6876
&#39;&#39;&#39; Closes WebSocket connection. &#39;&#39;&#39;
@@ -1033,7 +1041,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
10331041
<dl>
10341042
<dt id="livechat.agent.rtm.api.v34.AgentRtmV34"><code class="flex name class">
10351043
<span>class <span class="ident">AgentRtmV34</span></span>
1036-
<span>(</span><span>url: str)</span>
1044+
<span>(</span><span>url: str, header: Union[list, dict, Callable, None])</span>
10371045
</code></dt>
10381046
<dd>
10391047
<div class="desc"><p>Agent RTM API Class containing methods in version 3.4.</p></div>
@@ -1043,15 +1051,21 @@ <h2 class="section-title" id="header-classes">Classes</h2>
10431051
</summary>
10441052
<pre><code class="python">class AgentRtmV34:
10451053
&#39;&#39;&#39; Agent RTM API Class containing methods in version 3.4. &#39;&#39;&#39;
1046-
def __init__(self, url: str):
1047-
self.ws = WebsocketClient(url=f&#39;wss://{url}/v3.4/agent/rtm/ws&#39;)
1054+
def __init__(
1055+
self,
1056+
url: str,
1057+
header: Union[list, dict, Callable, None],
1058+
):
1059+
self.ws = WebsocketClient(url=f&#39;wss://{url}/v3.4/agent/rtm/ws&#39;,
1060+
header=header)
10481061

10491062
def open_connection(self,
10501063
origin: dict = None,
1051-
ping_timeout: float = 3,
1052-
ping_interval: float = 5,
1053-
ws_conn_timeout: float = 10,
1054-
keep_alive: bool = True) -&gt; None:
1064+
ping_timeout: Union[float, int] = 3,
1065+
ping_interval: Union[float, int] = 5,
1066+
ws_conn_timeout: Union[float, int] = 10,
1067+
keep_alive: bool = True,
1068+
response_timeout: Union[float, int] = 3) -&gt; None:
10551069
&#39;&#39;&#39; Opens WebSocket connection.
10561070

10571071
Args:
@@ -1063,9 +1077,11 @@ <h2 class="section-title" id="header-classes">Classes</h2>
10631077
ws_conn_timeout (int or float): timeout (in seconds) to wait for WebSocket connection,
10641078
by default sets to 10 seconds.
10651079
keep_alive(bool): Bool which states if connection should be kept, by default sets to `True`.
1080+
response_timeout (int or float): timeout (in seconds) to wait for the response,
1081+
by default sets to 3 seconds.
10661082
&#39;&#39;&#39;
10671083
self.ws.open(origin, ping_timeout, ping_interval, ws_conn_timeout,
1068-
keep_alive)
1084+
keep_alive, response_timeout)
10691085

10701086
def close_connection(self) -&gt; None:
10711087
&#39;&#39;&#39; Closes WebSocket connection. &#39;&#39;&#39;
@@ -3200,7 +3216,7 @@ <h2 id="returns">Returns</h2>
32003216
</details>
32013217
</dd>
32023218
<dt id="livechat.agent.rtm.api.v34.AgentRtmV34.open_connection"><code class="name flex">
3203-
<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>
3219+
<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>
32043220
</code></dt>
32053221
<dd>
32063222
<div class="desc"><p>Opens WebSocket connection.</p>
@@ -3217,18 +3233,22 @@ <h2 id="args">Args</h2>
32173233
<dt><strong><code>ws_conn_timeout</code></strong> :&ensp;<code>int</code> or <code>float</code></dt>
32183234
<dd>timeout (in seconds) to wait for WebSocket connection,
32193235
by default sets to 10 seconds.</dd>
3220-
</dl>
3221-
<p>keep_alive(bool): Bool which states if connection should be kept, by default sets to <code>True</code>.</p></div>
3236+
<dt>keep_alive(bool): Bool which states if connection should be kept, by default sets to <code>True</code>.</dt>
3237+
<dt><strong><code>response_timeout</code></strong> :&ensp;<code>int</code> or <code>float</code></dt>
3238+
<dd>timeout (in seconds) to wait for the response,
3239+
by default sets to 3 seconds.</dd>
3240+
</dl></div>
32223241
<details class="source">
32233242
<summary>
32243243
<span>Expand source code</span>
32253244
</summary>
32263245
<pre><code class="python">def open_connection(self,
32273246
origin: dict = None,
3228-
ping_timeout: float = 3,
3229-
ping_interval: float = 5,
3230-
ws_conn_timeout: float = 10,
3231-
keep_alive: bool = True) -&gt; None:
3247+
ping_timeout: Union[float, int] = 3,
3248+
ping_interval: Union[float, int] = 5,
3249+
ws_conn_timeout: Union[float, int] = 10,
3250+
keep_alive: bool = True,
3251+
response_timeout: Union[float, int] = 3) -&gt; None:
32323252
&#39;&#39;&#39; Opens WebSocket connection.
32333253

32343254
Args:
@@ -3240,9 +3260,11 @@ <h2 id="args">Args</h2>
32403260
ws_conn_timeout (int or float): timeout (in seconds) to wait for WebSocket connection,
32413261
by default sets to 10 seconds.
32423262
keep_alive(bool): Bool which states if connection should be kept, by default sets to `True`.
3263+
response_timeout (int or float): timeout (in seconds) to wait for the response,
3264+
by default sets to 3 seconds.
32433265
&#39;&#39;&#39;
32443266
self.ws.open(origin, ping_timeout, ping_interval, ws_conn_timeout,
3245-
keep_alive)</code></pre>
3267+
keep_alive, response_timeout)</code></pre>
32463268
</details>
32473269
</dd>
32483270
<dt id="livechat.agent.rtm.api.v34.AgentRtmV34.remove_user_from_chat"><code class="name flex">

0 commit comments

Comments
 (0)