Skip to content

Commit

Permalink
Merge pull request #132 from livechat/release-0.3.9
Browse files Browse the repository at this point in the history
Release 0.3.9
  • Loading branch information
marcindebski authored Apr 22, 2024
2 parents d000e4d + 96196a6 commit 110100d
Show file tree
Hide file tree
Showing 51 changed files with 3,077 additions and 451 deletions.
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Change Log
All notable changes to this project will be documented in this file.

## [0.3.9] - XXX
## [0.3.9] - 2024-04-22

### Added
- New methods in configuration-api v3.5, v3.6 for bot management: `create_bot_template`, `delete_bot_template`, `update_bot_template`, `list_bot_templates`, `issue_bot_token`, `reset_bot_secret`, `reset_bot_template_secret`.
Expand Down
2 changes: 1 addition & 1 deletion docs/agent/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ <h1>Index</h1>
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
</footer>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion docs/agent/rtm/api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ <h1>Index</h1>
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
</footer>
</body>
</html>
</html>
126 changes: 105 additions & 21 deletions docs/agent/rtm/api/v33.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v33</code></h1>
</summary>
<pre><code class="python">&#39;&#39;&#39; Module containing Agent RTM API client implementation for v3.3. &#39;&#39;&#39;

from typing import Any, Optional
from typing import Any, Optional, Union

from livechat.utils.helpers import prepare_payload
from livechat.utils.structures import RtmResponse
from livechat.utils.structures import AccessToken, RtmResponse
from livechat.utils.ws_client import WebsocketClient

# pylint: disable=unused-argument, too-many-arguments, invalid-name, redefined-builtin
Expand All @@ -43,9 +43,26 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v33</code></h1>
def __init__(self, url: str):
self.ws = WebsocketClient(url=f&#39;wss://{url}/v3.3/agent/rtm/ws&#39;)

def open_connection(self) -&gt; None:
&#39;&#39;&#39; Opens WebSocket connection. &#39;&#39;&#39;
self.ws.open()
def open_connection(self,
origin: dict = None,
ping_timeout: float = 3,
ping_interval: float = 5,
ws_conn_timeout: float = 10,
keep_alive: bool = True) -&gt; None:
&#39;&#39;&#39; Opens WebSocket connection.

Args:
origin (dict): Specifies origin while creating websocket connection.
ping_timeout (int or float): timeout (in seconds) if the pong message is not received,
by default sets to 3 seconds.
ping_interval (int or float): automatically sends &#34;ping&#34; command every specified period (in seconds).
If set to 0, no ping is sent periodically, by default sets to 5 seconds.
ws_conn_timeout (int or float): timeout (in seconds) to wait for WebSocket connection,
by default sets to 10 seconds.
keep_alive(bool): Bool which states if connection should be kept, by default sets to `True`.
&#39;&#39;&#39;
self.ws.open(origin, ping_timeout, ping_interval, ws_conn_timeout,
keep_alive)

def close_connection(self) -&gt; None:
&#39;&#39;&#39; Closes WebSocket connection. &#39;&#39;&#39;
Expand Down Expand Up @@ -407,7 +424,11 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v33</code></h1>
opts[&#39;author_id&#39;] = author_id
if payload is None:
payload = prepare_payload(locals())
return self.ws.send({&#39;action&#39;: &#39;send_event&#39;, &#39;payload&#39;: payload, **opts})
return self.ws.send({
&#39;action&#39;: &#39;send_event&#39;,
&#39;payload&#39;: payload,
**opts
})

def send_rich_message_postback(self,
chat_id: str = None,
Expand Down Expand Up @@ -797,7 +818,7 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v33</code></h1>
# Status

def login(self,
token: str = None,
token: Union[AccessToken, str] = None,
timezone: str = None,
reconnect: bool = None,
push_notifications: dict = None,
Expand Down Expand Up @@ -830,6 +851,8 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v33</code></h1>
RtmResponse: RTM response structure (`request_id`, `action`,
`type`, `success` and `payload` properties)
&#39;&#39;&#39;
if token:
token = str(token)
if payload is None:
payload = prepare_payload(locals())
return self.ws.send({&#39;action&#39;: &#39;login&#39;, &#39;payload&#39;: payload})
Expand Down Expand Up @@ -1057,9 +1080,26 @@ <h2 class="section-title" id="header-classes">Classes</h2>
def __init__(self, url: str):
self.ws = WebsocketClient(url=f&#39;wss://{url}/v3.3/agent/rtm/ws&#39;)

def open_connection(self) -&gt; None:
&#39;&#39;&#39; Opens WebSocket connection. &#39;&#39;&#39;
self.ws.open()
def open_connection(self,
origin: dict = None,
ping_timeout: float = 3,
ping_interval: float = 5,
ws_conn_timeout: float = 10,
keep_alive: bool = True) -&gt; None:
&#39;&#39;&#39; Opens WebSocket connection.

Args:
origin (dict): Specifies origin while creating websocket connection.
ping_timeout (int or float): timeout (in seconds) if the pong message is not received,
by default sets to 3 seconds.
ping_interval (int or float): automatically sends &#34;ping&#34; command every specified period (in seconds).
If set to 0, no ping is sent periodically, by default sets to 5 seconds.
ws_conn_timeout (int or float): timeout (in seconds) to wait for WebSocket connection,
by default sets to 10 seconds.
keep_alive(bool): Bool which states if connection should be kept, by default sets to `True`.
&#39;&#39;&#39;
self.ws.open(origin, ping_timeout, ping_interval, ws_conn_timeout,
keep_alive)

def close_connection(self) -&gt; None:
&#39;&#39;&#39; Closes WebSocket connection. &#39;&#39;&#39;
Expand Down Expand Up @@ -1421,7 +1461,11 @@ <h2 class="section-title" id="header-classes">Classes</h2>
opts[&#39;author_id&#39;] = author_id
if payload is None:
payload = prepare_payload(locals())
return self.ws.send({&#39;action&#39;: &#39;send_event&#39;, &#39;payload&#39;: payload, **opts})
return self.ws.send({
&#39;action&#39;: &#39;send_event&#39;,
&#39;payload&#39;: payload,
**opts
})

def send_rich_message_postback(self,
chat_id: str = None,
Expand Down Expand Up @@ -1811,7 +1855,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
# Status

def login(self,
token: str = None,
token: Union[AccessToken, str] = None,
timezone: str = None,
reconnect: bool = None,
push_notifications: dict = None,
Expand Down Expand Up @@ -1844,6 +1888,8 @@ <h2 class="section-title" id="header-classes">Classes</h2>
RtmResponse: RTM response structure (`request_id`, `action`,
`type`, `success` and `payload` properties)
&#39;&#39;&#39;
if token:
token = str(token)
if payload is None:
payload = prepare_payload(locals())
return self.ws.send({&#39;action&#39;: &#39;login&#39;, &#39;payload&#39;: payload})
Expand Down Expand Up @@ -3036,7 +3082,7 @@ <h2 id="returns">Returns</h2>
</details>
</dd>
<dt id="livechat.agent.rtm.api.v33.AgentRtmV33.login"><code class="name flex">
<span>def <span class="ident">login</span></span>(<span>self, token: str = None, timezone: str = None, reconnect: bool = None, push_notifications: dict = None, application: dict = None, away: bool = None, customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) ‑> livechat.utils.structures.RtmResponse</span>
<span>def <span class="ident">login</span></span>(<span>self, token: Union[livechat.utils.structures.AccessToken, str] = None, timezone: str = None, reconnect: bool = None, push_notifications: dict = None, application: dict = None, away: bool = None, customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) ‑> livechat.utils.structures.RtmResponse</span>
</code></dt>
<dd>
<div class="desc"><p>Logs in agent.</p>
Expand Down Expand Up @@ -3079,7 +3125,7 @@ <h2 id="returns">Returns</h2>
<span>Expand source code</span>
</summary>
<pre><code class="python">def login(self,
token: str = None,
token: Union[AccessToken, str] = None,
timezone: str = None,
reconnect: bool = None,
push_notifications: dict = None,
Expand Down Expand Up @@ -3112,6 +3158,8 @@ <h2 id="returns">Returns</h2>
RtmResponse: RTM response structure (`request_id`, `action`,
`type`, `success` and `payload` properties)
&#39;&#39;&#39;
if token:
token = str(token)
if payload is None:
payload = prepare_payload(locals())
return self.ws.send({&#39;action&#39;: &#39;login&#39;, &#39;payload&#39;: payload})</code></pre>
Expand Down Expand Up @@ -3255,17 +3303,49 @@ <h2 id="returns">Returns</h2>
</details>
</dd>
<dt id="livechat.agent.rtm.api.v33.AgentRtmV33.open_connection"><code class="name flex">
<span>def <span class="ident">open_connection</span></span>(<span>self) ‑> None</span>
<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>
</code></dt>
<dd>
<div class="desc"><p>Opens WebSocket connection.</p></div>
<div class="desc"><p>Opens WebSocket connection.</p>
<h2 id="args">Args</h2>
<dl>
<dt><strong><code>origin</code></strong> :&ensp;<code>dict</code></dt>
<dd>Specifies origin while creating websocket connection.</dd>
<dt><strong><code>ping_timeout</code></strong> :&ensp;<code>int</code> or <code>float</code></dt>
<dd>timeout (in seconds) if the pong message is not received,
by default sets to 3 seconds.</dd>
<dt><strong><code>ping_interval</code></strong> :&ensp;<code>int</code> or <code>float</code></dt>
<dd>automatically sends "ping" command every specified period (in seconds).
If set to 0, no ping is sent periodically, by default sets to 5 seconds.</dd>
<dt><strong><code>ws_conn_timeout</code></strong> :&ensp;<code>int</code> or <code>float</code></dt>
<dd>timeout (in seconds) to wait for WebSocket connection,
by default sets to 10 seconds.</dd>
</dl>
<p>keep_alive(bool): Bool which states if connection should be kept, by default sets to <code>True</code>.</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def open_connection(self) -&gt; None:
&#39;&#39;&#39; Opens WebSocket connection. &#39;&#39;&#39;
self.ws.open()</code></pre>
<pre><code class="python">def open_connection(self,
origin: dict = None,
ping_timeout: float = 3,
ping_interval: float = 5,
ws_conn_timeout: float = 10,
keep_alive: bool = True) -&gt; None:
&#39;&#39;&#39; Opens WebSocket connection.

Args:
origin (dict): Specifies origin while creating websocket connection.
ping_timeout (int or float): timeout (in seconds) if the pong message is not received,
by default sets to 3 seconds.
ping_interval (int or float): automatically sends &#34;ping&#34; command every specified period (in seconds).
If set to 0, no ping is sent periodically, by default sets to 5 seconds.
ws_conn_timeout (int or float): timeout (in seconds) to wait for WebSocket connection,
by default sets to 10 seconds.
keep_alive(bool): Bool which states if connection should be kept, by default sets to `True`.
&#39;&#39;&#39;
self.ws.open(origin, ping_timeout, ping_interval, ws_conn_timeout,
keep_alive)</code></pre>
</details>
</dd>
<dt id="livechat.agent.rtm.api.v33.AgentRtmV33.remove_user_from_chat"><code class="name flex">
Expand Down Expand Up @@ -3476,7 +3556,11 @@ <h2 id="returns">Returns</h2>
opts[&#39;author_id&#39;] = author_id
if payload is None:
payload = prepare_payload(locals())
return self.ws.send({&#39;action&#39;: &#39;send_event&#39;, &#39;payload&#39;: payload, **opts})</code></pre>
return self.ws.send({
&#39;action&#39;: &#39;send_event&#39;,
&#39;payload&#39;: payload,
**opts
})</code></pre>
</details>
</dd>
<dt id="livechat.agent.rtm.api.v33.AgentRtmV33.send_rich_message_postback"><code class="name flex">
Expand Down Expand Up @@ -4269,4 +4353,4 @@ <h4><code><a title="livechat.agent.rtm.api.v33.AgentRtmV33" href="#livechat.agen
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
</footer>
</body>
</html>
</html>
Loading

0 comments on commit 110100d

Please sign in to comment.