Skip to content

Commit c81ba92

Browse files
authored
Merge pull request #56 from livechat/API-9880-Organization-license-id-lookup
API-9880: Add organization/license ID lookup methods in configuration v3.4
2 parents 64d6cd5 + 9091824 commit c81ba92

File tree

4 files changed

+281
-16
lines changed

4 files changed

+281
-16
lines changed

changelog.md

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

4-
## [pending] - TBA
4+
## [0.1.9] - 2021-11-03
5+
6+
### Added
7+
8+
- Added new methods for organization/license ID lookup in configuration v3.4.
59

610
### Changed
711

docs/configuration_api.html

Lines changed: 225 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,10 @@ <h1 class="title">Module <code>client</code></h1>
459459
headers=headers)
460460

461461
def update_auto_access(self,
462-
id: str = None,
463-
next_id: str = None,
464-
payload: dict = None,
465-
headers: dict = None) -&gt; httpx.Response:
462+
id: str = None,
463+
next_id: str = None,
464+
payload: dict = None,
465+
headers: dict = None) -&gt; httpx.Response:
466466
&#39;&#39;&#39; Moves an existing auto access data structure, specified by id,
467467
before another one, specified by next_id.
468468

@@ -1240,7 +1240,57 @@ <h1 class="title">Module <code>client</code></h1>
12401240

12411241

12421242
class ConfigurationApi34(ConfigurationApiInterface):
1243-
&#39;&#39;&#39; Configuration API client in version 3.4 class. &#39;&#39;&#39;</code></pre>
1243+
&#39;&#39;&#39; Configuration API client in version 3.4 class. &#39;&#39;&#39;
1244+
1245+
# license/organization ID lookup
1246+
1247+
def get_organization_id(self,
1248+
license_id: int = None,
1249+
params: dict = None,
1250+
headers: dict = None) -&gt; httpx.Response:
1251+
&#39;&#39;&#39; Returns organization ID by given license ID.
1252+
1253+
Args:
1254+
license_id (int): License ID to get organization ID for.
1255+
params (dict): Custom params to be used in request&#39;s query string.
1256+
It overrides all other parameters provided for the method.
1257+
headers (dict): Custom headers to be used with session headers.
1258+
They will be merged with session-level values that are set,
1259+
however, these method-level parameters will not be persisted across requests.
1260+
1261+
Returns:
1262+
httpx.Response: The Response object from `httpx` library,
1263+
which contains a server’s response to an HTTP request.
1264+
&#39;&#39;&#39;
1265+
if params is None:
1266+
params = prepare_payload(locals())
1267+
return self.session.get(f&#39;{self.api_url}/get_organization_id&#39;,
1268+
params=params,
1269+
headers=headers)
1270+
1271+
def get_license_id(self,
1272+
organization_id: str = None,
1273+
params: dict = None,
1274+
headers: dict = None) -&gt; httpx.Response:
1275+
&#39;&#39;&#39; Returns license ID by given organization ID.
1276+
1277+
Args:
1278+
organization_id (str): Organization ID to get license ID for.
1279+
params (dict): Custom params to be used in request&#39;s query string.
1280+
It overrides all other parameters provided for the method.
1281+
headers (dict): Custom headers to be used with session headers.
1282+
They will be merged with session-level values that are set,
1283+
however, these method-level parameters will not be persisted across requests.
1284+
1285+
Returns:
1286+
httpx.Response: The Response object from `httpx` library,
1287+
which contains a server’s response to an HTTP request.
1288+
&#39;&#39;&#39;
1289+
if params is None:
1290+
params = prepare_payload(locals())
1291+
return self.session.get(f&#39;{self.api_url}/get_license_id&#39;,
1292+
params=params,
1293+
headers=headers)</code></pre>
12441294
</details>
12451295
</section>
12461296
<section>
@@ -1439,12 +1489,169 @@ <h3>Inherited members</h3>
14391489
<span>Expand source code</span>
14401490
</summary>
14411491
<pre><code class="python">class ConfigurationApi34(ConfigurationApiInterface):
1442-
&#39;&#39;&#39; Configuration API client in version 3.4 class. &#39;&#39;&#39;</code></pre>
1492+
&#39;&#39;&#39; Configuration API client in version 3.4 class. &#39;&#39;&#39;
1493+
1494+
# license/organization ID lookup
1495+
1496+
def get_organization_id(self,
1497+
license_id: int = None,
1498+
params: dict = None,
1499+
headers: dict = None) -&gt; httpx.Response:
1500+
&#39;&#39;&#39; Returns organization ID by given license ID.
1501+
1502+
Args:
1503+
license_id (int): License ID to get organization ID for.
1504+
params (dict): Custom params to be used in request&#39;s query string.
1505+
It overrides all other parameters provided for the method.
1506+
headers (dict): Custom headers to be used with session headers.
1507+
They will be merged with session-level values that are set,
1508+
however, these method-level parameters will not be persisted across requests.
1509+
1510+
Returns:
1511+
httpx.Response: The Response object from `httpx` library,
1512+
which contains a server’s response to an HTTP request.
1513+
&#39;&#39;&#39;
1514+
if params is None:
1515+
params = prepare_payload(locals())
1516+
return self.session.get(f&#39;{self.api_url}/get_organization_id&#39;,
1517+
params=params,
1518+
headers=headers)
1519+
1520+
def get_license_id(self,
1521+
organization_id: str = None,
1522+
params: dict = None,
1523+
headers: dict = None) -&gt; httpx.Response:
1524+
&#39;&#39;&#39; Returns license ID by given organization ID.
1525+
1526+
Args:
1527+
organization_id (str): Organization ID to get license ID for.
1528+
params (dict): Custom params to be used in request&#39;s query string.
1529+
It overrides all other parameters provided for the method.
1530+
headers (dict): Custom headers to be used with session headers.
1531+
They will be merged with session-level values that are set,
1532+
however, these method-level parameters will not be persisted across requests.
1533+
1534+
Returns:
1535+
httpx.Response: The Response object from `httpx` library,
1536+
which contains a server’s response to an HTTP request.
1537+
&#39;&#39;&#39;
1538+
if params is None:
1539+
params = prepare_payload(locals())
1540+
return self.session.get(f&#39;{self.api_url}/get_license_id&#39;,
1541+
params=params,
1542+
headers=headers)</code></pre>
14431543
</details>
14441544
<h3>Ancestors</h3>
14451545
<ul class="hlist">
14461546
<li><a title="client.ConfigurationApiInterface" href="#client.ConfigurationApiInterface">ConfigurationApiInterface</a></li>
14471547
</ul>
1548+
<h3>Methods</h3>
1549+
<dl>
1550+
<dt id="client.ConfigurationApi34.get_license_id"><code class="name flex">
1551+
<span>def <span class="ident">get_license_id</span></span>(<span>self, organization_id: str = None, params: dict = None, headers: dict = None) ‑> httpx.Response</span>
1552+
</code></dt>
1553+
<dd>
1554+
<div class="desc"><p>Returns license ID by given organization ID.</p>
1555+
<h2 id="args">Args</h2>
1556+
<dl>
1557+
<dt><strong><code>organization_id</code></strong> :&ensp;<code>str</code></dt>
1558+
<dd>Organization ID to get license ID for.</dd>
1559+
<dt><strong><code>params</code></strong> :&ensp;<code>dict</code></dt>
1560+
<dd>Custom params to be used in request's query string.
1561+
It overrides all other parameters provided for the method.</dd>
1562+
<dt><strong><code>headers</code></strong> :&ensp;<code>dict</code></dt>
1563+
<dd>Custom headers to be used with session headers.
1564+
They will be merged with session-level values that are set,
1565+
however, these method-level parameters will not be persisted across requests.</dd>
1566+
</dl>
1567+
<h2 id="returns">Returns</h2>
1568+
<dl>
1569+
<dt><code>httpx.Response</code></dt>
1570+
<dd>The Response object from <code>httpx</code> library,
1571+
which contains a server’s response to an HTTP request.</dd>
1572+
</dl></div>
1573+
<details class="source">
1574+
<summary>
1575+
<span>Expand source code</span>
1576+
</summary>
1577+
<pre><code class="python">def get_license_id(self,
1578+
organization_id: str = None,
1579+
params: dict = None,
1580+
headers: dict = None) -&gt; httpx.Response:
1581+
&#39;&#39;&#39; Returns license ID by given organization ID.
1582+
1583+
Args:
1584+
organization_id (str): Organization ID to get license ID for.
1585+
params (dict): Custom params to be used in request&#39;s query string.
1586+
It overrides all other parameters provided for the method.
1587+
headers (dict): Custom headers to be used with session headers.
1588+
They will be merged with session-level values that are set,
1589+
however, these method-level parameters will not be persisted across requests.
1590+
1591+
Returns:
1592+
httpx.Response: The Response object from `httpx` library,
1593+
which contains a server’s response to an HTTP request.
1594+
&#39;&#39;&#39;
1595+
if params is None:
1596+
params = prepare_payload(locals())
1597+
return self.session.get(f&#39;{self.api_url}/get_license_id&#39;,
1598+
params=params,
1599+
headers=headers)</code></pre>
1600+
</details>
1601+
</dd>
1602+
<dt id="client.ConfigurationApi34.get_organization_id"><code class="name flex">
1603+
<span>def <span class="ident">get_organization_id</span></span>(<span>self, license_id: int = None, params: dict = None, headers: dict = None) ‑> httpx.Response</span>
1604+
</code></dt>
1605+
<dd>
1606+
<div class="desc"><p>Returns organization ID by given license ID.</p>
1607+
<h2 id="args">Args</h2>
1608+
<dl>
1609+
<dt><strong><code>license_id</code></strong> :&ensp;<code>int</code></dt>
1610+
<dd>License ID to get organization ID for.</dd>
1611+
<dt><strong><code>params</code></strong> :&ensp;<code>dict</code></dt>
1612+
<dd>Custom params to be used in request's query string.
1613+
It overrides all other parameters provided for the method.</dd>
1614+
<dt><strong><code>headers</code></strong> :&ensp;<code>dict</code></dt>
1615+
<dd>Custom headers to be used with session headers.
1616+
They will be merged with session-level values that are set,
1617+
however, these method-level parameters will not be persisted across requests.</dd>
1618+
</dl>
1619+
<h2 id="returns">Returns</h2>
1620+
<dl>
1621+
<dt><code>httpx.Response</code></dt>
1622+
<dd>The Response object from <code>httpx</code> library,
1623+
which contains a server’s response to an HTTP request.</dd>
1624+
</dl></div>
1625+
<details class="source">
1626+
<summary>
1627+
<span>Expand source code</span>
1628+
</summary>
1629+
<pre><code class="python">def get_organization_id(self,
1630+
license_id: int = None,
1631+
params: dict = None,
1632+
headers: dict = None) -&gt; httpx.Response:
1633+
&#39;&#39;&#39; Returns organization ID by given license ID.
1634+
1635+
Args:
1636+
license_id (int): License ID to get organization ID for.
1637+
params (dict): Custom params to be used in request&#39;s query string.
1638+
It overrides all other parameters provided for the method.
1639+
headers (dict): Custom headers to be used with session headers.
1640+
They will be merged with session-level values that are set,
1641+
however, these method-level parameters will not be persisted across requests.
1642+
1643+
Returns:
1644+
httpx.Response: The Response object from `httpx` library,
1645+
which contains a server’s response to an HTTP request.
1646+
&#39;&#39;&#39;
1647+
if params is None:
1648+
params = prepare_payload(locals())
1649+
return self.session.get(f&#39;{self.api_url}/get_organization_id&#39;,
1650+
params=params,
1651+
headers=headers)</code></pre>
1652+
</details>
1653+
</dd>
1654+
</dl>
14481655
<h3>Inherited members</h3>
14491656
<ul class="hlist">
14501657
<li><code><b><a title="client.ConfigurationApiInterface" href="#client.ConfigurationApiInterface">ConfigurationApiInterface</a></b></code>:
@@ -1892,10 +2099,10 @@ <h3>Inherited members</h3>
18922099
headers=headers)
18932100

18942101
def update_auto_access(self,
1895-
id: str = None,
1896-
next_id: str = None,
1897-
payload: dict = None,
1898-
headers: dict = None) -&gt; httpx.Response:
2102+
id: str = None,
2103+
next_id: str = None,
2104+
payload: dict = None,
2105+
headers: dict = None) -&gt; httpx.Response:
18992106
&#39;&#39;&#39; Moves an existing auto access data structure, specified by id,
19002107
before another one, specified by next_id.
19012108

@@ -4840,10 +5047,10 @@ <h2 id="returns">Returns</h2>
48405047
<span>Expand source code</span>
48415048
</summary>
48425049
<pre><code class="python">def update_auto_access(self,
4843-
id: str = None,
4844-
next_id: str = None,
4845-
payload: dict = None,
4846-
headers: dict = None) -&gt; httpx.Response:
5050+
id: str = None,
5051+
next_id: str = None,
5052+
payload: dict = None,
5053+
headers: dict = None) -&gt; httpx.Response:
48475054
&#39;&#39;&#39; Moves an existing auto access data structure, specified by id,
48485055
before another one, specified by next_id.
48495056

@@ -5147,6 +5354,10 @@ <h4><code><a title="client.ConfigurationApi33" href="#client.ConfigurationApi33"
51475354
</li>
51485355
<li>
51495356
<h4><code><a title="client.ConfigurationApi34" href="#client.ConfigurationApi34">ConfigurationApi34</a></code></h4>
5357+
<ul class="">
5358+
<li><code><a title="client.ConfigurationApi34.get_license_id" href="#client.ConfigurationApi34.get_license_id">get_license_id</a></code></li>
5359+
<li><code><a title="client.ConfigurationApi34.get_organization_id" href="#client.ConfigurationApi34.get_organization_id">get_organization_id</a></code></li>
5360+
</ul>
51505361
</li>
51515362
<li>
51525363
<h4><code><a title="client.ConfigurationApiInterface" href="#client.ConfigurationApiInterface">ConfigurationApiInterface</a></code></h4>

livechat/configuration/client.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,3 +1212,53 @@ class ConfigurationApi33(ConfigurationApiInterface):
12121212

12131213
class ConfigurationApi34(ConfigurationApiInterface):
12141214
''' Configuration API client in version 3.4 class. '''
1215+
1216+
# license/organization ID lookup
1217+
1218+
def get_organization_id(self,
1219+
license_id: int = None,
1220+
params: dict = None,
1221+
headers: dict = None) -> httpx.Response:
1222+
''' Returns organization ID by given license ID.
1223+
1224+
Args:
1225+
license_id (int): License ID to get organization ID for.
1226+
params (dict): Custom params to be used in request's query string.
1227+
It overrides all other parameters provided for the method.
1228+
headers (dict): Custom headers to be used with session headers.
1229+
They will be merged with session-level values that are set,
1230+
however, these method-level parameters will not be persisted across requests.
1231+
1232+
Returns:
1233+
httpx.Response: The Response object from `httpx` library,
1234+
which contains a server’s response to an HTTP request.
1235+
'''
1236+
if params is None:
1237+
params = prepare_payload(locals())
1238+
return self.session.get(f'{self.api_url}/get_organization_id',
1239+
params=params,
1240+
headers=headers)
1241+
1242+
def get_license_id(self,
1243+
organization_id: str = None,
1244+
params: dict = None,
1245+
headers: dict = None) -> httpx.Response:
1246+
''' Returns license ID by given organization ID.
1247+
1248+
Args:
1249+
organization_id (str): Organization ID to get license ID for.
1250+
params (dict): Custom params to be used in request's query string.
1251+
It overrides all other parameters provided for the method.
1252+
headers (dict): Custom headers to be used with session headers.
1253+
They will be merged with session-level values that are set,
1254+
however, these method-level parameters will not be persisted across requests.
1255+
1256+
Returns:
1257+
httpx.Response: The Response object from `httpx` library,
1258+
which contains a server’s response to an HTTP request.
1259+
'''
1260+
if params is None:
1261+
params = prepare_payload(locals())
1262+
return self.session.get(f'{self.api_url}/get_license_id',
1263+
params=params,
1264+
headers=headers)

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = lc-sdk-python
3-
version = 0.1.8
3+
version = 0.1.9
44
description = Package which lets to work with LiveChat API.
55
long_description = file: README.md
66
long_description_content_type = text/markdown

0 commit comments

Comments
 (0)