Skip to content

Commit 67392de

Browse files
committed
ME-620: Add v3.7
1 parent 056dea3 commit 67392de

File tree

16 files changed

+6862
-8
lines changed

16 files changed

+6862
-8
lines changed

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ All notable changes to this project will be documented in this file.
44
## [0.4.2] - TBA
55

66
### Added
7+
- Support for new version 3.7.
78
- New method `delete_event` in customer-api v3.6.
89
- New methods in configuration-api v3.6 for greetings: `create_greeting`, `delete_greeting`, `get_greeting`, `update_greeting`, `list_greetings`.
910
- New methods in agent-api v3.6: `send_thinking_indicator`, `send_message_preview`.
1011

1112
### Changed
13+
- Config now points to v3.6 as stable and 3.7 as dev-preview version.
1214
- Improved websocket response collection + extended logging in the websocket client.
1315

1416
### Bugfixes

livechat/agent/rtm/api/v37.py

Lines changed: 1048 additions & 0 deletions
Large diffs are not rendered by default.

livechat/agent/rtm/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from livechat.agent.rtm.api.v34 import AgentRtmV34
1010
from livechat.agent.rtm.api.v35 import AgentRtmV35
1111
from livechat.agent.rtm.api.v36 import AgentRtmV36
12+
from livechat.agent.rtm.api.v37 import AgentRtmV37
1213
from livechat.config import CONFIG
1314

1415
stable_version = CONFIG.get('stable')
@@ -22,7 +23,8 @@ def get_client(
2223
version: str = stable_version,
2324
base_url: str = api_url,
2425
header: Union[list, dict, Callable, None] = None,
25-
) -> Union[AgentRtmV33, AgentRtmV34, AgentRtmV35, AgentRtmV36]:
26+
) -> Union[AgentRtmV33, AgentRtmV34, AgentRtmV35, AgentRtmV36,
27+
AgentRtmV37]:
2628
''' Returns client for specific Agent RTM version.
2729
2830
Args:
@@ -42,6 +44,7 @@ def get_client(
4244
'3.4': AgentRtmV34,
4345
'3.5': AgentRtmV35,
4446
'3.6': AgentRtmV36,
47+
'3.7': AgentRtmV37,
4548
}.get(version)
4649
if not client:
4750
raise ValueError('Provided version does not exist.')

livechat/agent/web/api/v37.py

Lines changed: 1117 additions & 0 deletions
Large diffs are not rendered by default.

livechat/agent/web/base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from livechat.agent.web.api.v34 import AgentWebV34
1212
from livechat.agent.web.api.v35 import AgentWebV35
1313
from livechat.agent.web.api.v36 import AgentWebV36
14+
from livechat.agent.web.api.v37 import AgentWebV37
1415
from livechat.config import CONFIG
1516
from livechat.utils.structures import AccessToken
1617

@@ -31,7 +32,8 @@ def get_client(
3132
verify: bool = True,
3233
disable_logging: bool = False,
3334
timeout: float = httpx.Timeout(15)
34-
) -> Union[AgentWebV33, AgentWebV34, AgentWebV35, AgentWebV36]:
35+
) -> Union[AgentWebV33, AgentWebV34, AgentWebV35, AgentWebV36,
36+
AgentWebV37]:
3537
''' Returns client for specific API version.
3638
3739
Args:
@@ -69,6 +71,9 @@ def get_client(
6971
'3.6':
7072
AgentWebV36(access_token, base_url, http2, proxies, verify,
7173
disable_logging, timeout),
74+
'3.7':
75+
AgentWebV37(access_token, base_url, http2, proxies, verify,
76+
disable_logging, timeout),
7277
}.get(version)
7378
if not client:
7479
raise ValueError('Provided version does not exist.')

livechat/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
CONFIG = {
44
'url': 'api.livechatinc.com',
5-
'stable': '3.5',
6-
'dev': '3.6',
5+
'stable': '3.6',
6+
'dev': '3.7',
77
}

livechat/configuration/api/v37.py

Lines changed: 2031 additions & 0 deletions
Large diffs are not rendered by default.

livechat/configuration/base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from livechat.configuration.api.v34 import ConfigurationApiV34
1414
from livechat.configuration.api.v35 import ConfigurationApiV35
1515
from livechat.configuration.api.v36 import ConfigurationApiV36
16+
from livechat.configuration.api.v37 import ConfigurationApiV37
1617
from livechat.utils.structures import AccessToken
1718

1819
stable_version = CONFIG.get('stable')
@@ -33,7 +34,7 @@ def get_client(
3334
disable_logging: bool = False,
3435
timeout: float = httpx.Timeout(15)
3536
) -> Union[ConfigurationApiV33, ConfigurationApiV34, ConfigurationApiV35,
36-
ConfigurationApiV36]:
37+
ConfigurationApiV36, ConfigurationApiV37]:
3738
''' Returns client for specific Configuration API version.
3839
3940
Args:
@@ -71,6 +72,9 @@ def get_client(
7172
'3.6':
7273
ConfigurationApiV36(token, base_url, http2, proxies, verify,
7374
disable_logging, timeout),
75+
'3.7':
76+
ConfigurationApiV37(token, base_url, http2, proxies, verify,
77+
disable_logging, timeout),
7478
}.get(version)
7579
if not client:
7680
raise ValueError('Provided version does not exist.')

0 commit comments

Comments
 (0)