Skip to content

Commit 8a047ba

Browse files
authored
Merge pull request #92 from livechat/API-11633-lc-sdk-py-add-bot-batch-actions
API-11633 Added Bot batch actions
2 parents eb0b9d6 + 7c1a96c commit 8a047ba

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed

changelog.md

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

4+
## [0.3.5] - TBA
5+
6+
### Added
7+
- Support for new batch methods in configuration-api v3.5: `batch_create_bots`, `batch_delete_bots`, `batch_update_bots`.
8+
49
## [0.3.4] - 2022-10-26
510

611
### Added
@@ -24,7 +29,7 @@ All notable changes to this project will be documented in this file.
2429
## [0.3.3] - 2022-07-20
2530

2631
### Added
27-
- Support fo new batch methods in configuration-api v3.5: `batch_create_agents`, `batch_delete_agents`, `batch_update_agents`, `batch_approve_agents`, `batch_suspend_agents`, `batch_unsuspend_agents`.
32+
- Support for new batch methods in configuration-api v3.5: `batch_create_agents`, `batch_delete_agents`, `batch_update_agents`, `batch_approve_agents`, `batch_suspend_agents`, `batch_unsuspend_agents`.
2833

2934
### Changed
3035
- Updated requirements.txt.

livechat/configuration/api/v35.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,3 +1426,60 @@ def batch_unsuspend_agents(self,
14261426
return self.session.post(f'{self.api_url}/batch_unsuspend_agents',
14271427
json=payload,
14281428
headers=headers)
1429+
1430+
def batch_create_bots(self,
1431+
requests: list = None,
1432+
payload: dict = None,
1433+
headers: dict = None) -> httpx.Response:
1434+
''' Batch method for `create_bot`.
1435+
1436+
Args:
1437+
requests (list): Array of Request objects of corresponding non-batch method.
1438+
1439+
Returns:
1440+
httpx.Response: The Response object from `httpx` library,
1441+
which contains a server's response to an HTTP request.
1442+
'''
1443+
if payload is None:
1444+
payload = prepare_payload(locals())
1445+
return self.session.post(f'{self.api_url}/batch_create_bots',
1446+
json=payload,
1447+
headers=headers)
1448+
1449+
def batch_delete_bots(self,
1450+
requests: list = None,
1451+
payload: dict = None,
1452+
headers: dict = None) -> httpx.Response:
1453+
''' Batch method for `delete_bot`.
1454+
1455+
Args:
1456+
requests (list): Array of Request objects of corresponding non-batch method.
1457+
1458+
Returns:
1459+
httpx.Response: The Response object from `httpx` library,
1460+
which contains a server's response to an HTTP request.
1461+
'''
1462+
if payload is None:
1463+
payload = prepare_payload(locals())
1464+
return self.session.post(f'{self.api_url}/batch_delete_bots',
1465+
json=payload,
1466+
headers=headers)
1467+
1468+
def batch_update_bots(self,
1469+
requests: list = None,
1470+
payload: dict = None,
1471+
headers: dict = None) -> httpx.Response:
1472+
''' Batch method for `update_bot`.
1473+
1474+
Args:
1475+
requests (list): Array of Request objects of corresponding non-batch method.
1476+
1477+
Returns:
1478+
httpx.Response: The Response object from `httpx` library,
1479+
which contains a server's response to an HTTP request.
1480+
'''
1481+
if payload is None:
1482+
payload = prepare_payload(locals())
1483+
return self.session.post(f'{self.api_url}/batch_update_bots',
1484+
json=payload,
1485+
headers=headers)

0 commit comments

Comments
 (0)