Skip to content

Commit d000e4d

Browse files
authored
Merge pull request #131 from livechat/fix_agent_upload_file_methods
Fix agent upload file methods
2 parents ee811e1 + 271b5de commit d000e4d

File tree

10 files changed

+183
-162
lines changed

10 files changed

+183
-162
lines changed

Pipfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ name = "pypi"
66
[packages]
77
websocket-client= "1.7.0"
88
urllib3 = "2.1.0"
9-
httpx = {extras = ["http2"], version = "0.25.2"}
9+
httpx = {extras = ["http2"], version = "==0.25.2"}
1010
loguru = "==0.7.2"
11+
idna = ">=3.7"
1112

1213
[dev-packages]
1314
pre-commit = "3.5.0"

Pipfile.lock

Lines changed: 154 additions & 136 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file.
1616
- Enabled instantiation for `CustomerRtmV36` within the 3.6 version of the Customer RTM API.
1717
- Adjusted the return types in `get_client` method across RTM and WEB clients.
1818
- Fixed an issue where messages in the WebSocket client were incorrectly shared across all instances.
19+
- Fixed `upload_file` method in agent-api v3.4/v3.5/v3.6 classes.
1920

2021
## [0.3.8] - 2023-11-30
2122

docs/agent/web/api/v34.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ <h1 class="title">Module <code>livechat.agent.web.api.v34</code></h1>
478478
httpx.Response: The Response object from `httpx` library,
479479
which contains a server’s response to an HTTP request. &#39;&#39;&#39;
480480
return self.session.post(f&#39;{self.api_url}/upload_file&#39;,
481-
file=file,
481+
files=file,
482482
headers=headers)
483483

484484
def send_rich_message_postback(self,
@@ -1555,7 +1555,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
15551555
httpx.Response: The Response object from `httpx` library,
15561556
which contains a server’s response to an HTTP request. &#39;&#39;&#39;
15571557
return self.session.post(f&#39;{self.api_url}/upload_file&#39;,
1558-
file=file,
1558+
files=file,
15591559
headers=headers)
15601560

15611561
def send_rich_message_postback(self,
@@ -4388,7 +4388,7 @@ <h2 id="returns">Returns</h2>
43884388
httpx.Response: The Response object from `httpx` library,
43894389
which contains a server’s response to an HTTP request. &#39;&#39;&#39;
43904390
return self.session.post(f&#39;{self.api_url}/upload_file&#39;,
4391-
file=file,
4391+
files=file,
43924392
headers=headers)</code></pre>
43934393
</details>
43944394
</dd>

docs/agent/web/api/v35.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ <h1 class="title">Module <code>livechat.agent.web.api.v35</code></h1>
478478
httpx.Response: The Response object from `httpx` library,
479479
which contains a server’s response to an HTTP request. &#39;&#39;&#39;
480480
return self.session.post(f&#39;{self.api_url}/upload_file&#39;,
481-
file=file,
481+
files=file,
482482
headers=headers)
483483

484484
def send_rich_message_postback(self,
@@ -1555,7 +1555,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
15551555
httpx.Response: The Response object from `httpx` library,
15561556
which contains a server’s response to an HTTP request. &#39;&#39;&#39;
15571557
return self.session.post(f&#39;{self.api_url}/upload_file&#39;,
1558-
file=file,
1558+
files=file,
15591559
headers=headers)
15601560

15611561
def send_rich_message_postback(self,
@@ -4388,7 +4388,7 @@ <h2 id="returns">Returns</h2>
43884388
httpx.Response: The Response object from `httpx` library,
43894389
which contains a server’s response to an HTTP request. &#39;&#39;&#39;
43904390
return self.session.post(f&#39;{self.api_url}/upload_file&#39;,
4391-
file=file,
4391+
files=file,
43924392
headers=headers)</code></pre>
43934393
</details>
43944394
</dd>

docs/agent/web/api/v36.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ <h1 class="title">Module <code>livechat.agent.web.api.v36</code></h1>
478478
httpx.Response: The Response object from `httpx` library,
479479
which contains a server’s response to an HTTP request. &#39;&#39;&#39;
480480
return self.session.post(f&#39;{self.api_url}/upload_file&#39;,
481-
file=file,
481+
files=file,
482482
headers=headers)
483483

484484
def send_rich_message_postback(self,
@@ -1543,7 +1543,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
15431543
httpx.Response: The Response object from `httpx` library,
15441544
which contains a server’s response to an HTTP request. &#39;&#39;&#39;
15451545
return self.session.post(f&#39;{self.api_url}/upload_file&#39;,
1546-
file=file,
1546+
files=file,
15471547
headers=headers)
15481548

15491549
def send_rich_message_postback(self,
@@ -4341,7 +4341,7 @@ <h2 id="returns">Returns</h2>
43414341
httpx.Response: The Response object from `httpx` library,
43424342
which contains a server’s response to an HTTP request. &#39;&#39;&#39;
43434343
return self.session.post(f&#39;{self.api_url}/upload_file&#39;,
4344-
file=file,
4344+
files=file,
43454345
headers=headers)</code></pre>
43464346
</details>
43474347
</dd>

livechat/agent/web/api/v34.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def upload_file(self,
451451
httpx.Response: The Response object from `httpx` library,
452452
which contains a server’s response to an HTTP request. '''
453453
return self.session.post(f'{self.api_url}/upload_file',
454-
file=file,
454+
files=file,
455455
headers=headers)
456456

457457
def send_rich_message_postback(self,

livechat/agent/web/api/v35.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def upload_file(self,
451451
httpx.Response: The Response object from `httpx` library,
452452
which contains a server’s response to an HTTP request. '''
453453
return self.session.post(f'{self.api_url}/upload_file',
454-
file=file,
454+
files=file,
455455
headers=headers)
456456

457457
def send_rich_message_postback(self,

livechat/agent/web/api/v36.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def upload_file(self,
451451
httpx.Response: The Response object from `httpx` library,
452452
which contains a server’s response to an HTTP request. '''
453453
return self.session.post(f'{self.api_url}/upload_file',
454-
file=file,
454+
files=file,
455455
headers=headers)
456456

457457
def send_rich_message_postback(self,

requirements.txt

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
-i https://pypi.org/simple
2-
anyio==4.1.0 ; python_version >= '3.8'
3-
certifi==2023.11.17 ; python_version >= '3.6'
4-
exceptiongroup==1.2.0 ; python_version < '3.11'
5-
h11==0.14.0 ; python_version >= '3.7'
2+
anyio==4.3.0; python_version >= '3.8'
3+
certifi==2024.2.2; python_version >= '3.6'
4+
exceptiongroup==1.2.0; python_version < '3.11'
5+
h11==0.14.0; python_version >= '3.7'
66
h2==4.1.0
7-
hpack==4.0.0 ; python_full_version >= '3.6.1'
8-
httpcore==1.0.2 ; python_version >= '3.8'
9-
httpx[http2]==0.25.2
10-
hyperframe==6.0.1 ; python_full_version >= '3.6.1'
11-
idna==3.6 ; python_version >= '3.5'
12-
loguru==0.7.2
13-
sniffio==1.3.0 ; python_version >= '3.7'
14-
urllib3==2.1.0
15-
websocket-client==1.7.0
7+
hpack==4.0.0; python_full_version >= '3.6.1'
8+
httpcore==1.0.5; python_version >= '3.8'
9+
httpx[http2]==0.25.2; python_version >= '3.8'
10+
hyperframe==6.0.1; python_full_version >= '3.6.1'
11+
idna==3.7; python_version >= '3.5'
12+
loguru==0.7.2; python_version >= '3.5'
13+
sniffio==1.3.1; python_version >= '3.7'
14+
typing-extensions==4.11.0; python_version < '3.11'
15+
urllib3==2.1.0; python_version >= '3.8'
16+
websocket-client==1.7.0; python_version >= '3.8'

0 commit comments

Comments
 (0)