Skip to content

Commit

Permalink
Merge pull request #131 from livechat/fix_agent_upload_file_methods
Browse files Browse the repository at this point in the history
Fix agent upload file methods
  • Loading branch information
marcindebski authored Apr 22, 2024
2 parents ee811e1 + 271b5de commit d000e4d
Show file tree
Hide file tree
Showing 10 changed files with 183 additions and 162 deletions.
3 changes: 2 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ name = "pypi"
[packages]
websocket-client= "1.7.0"
urllib3 = "2.1.0"
httpx = {extras = ["http2"], version = "0.25.2"}
httpx = {extras = ["http2"], version = "==0.25.2"}
loguru = "==0.7.2"
idna = ">=3.7"

[dev-packages]
pre-commit = "3.5.0"
Expand Down
290 changes: 154 additions & 136 deletions Pipfile.lock

Large diffs are not rendered by default.

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

## [0.3.8] - 2023-11-30

Expand Down
6 changes: 3 additions & 3 deletions docs/agent/web/api/v34.html
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ <h1 class="title">Module <code>livechat.agent.web.api.v34</code></h1>
httpx.Response: The Response object from `httpx` library,
which contains a server’s response to an HTTP request. &#39;&#39;&#39;
return self.session.post(f&#39;{self.api_url}/upload_file&#39;,
file=file,
files=file,
headers=headers)

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

def send_rich_message_postback(self,
Expand Down Expand Up @@ -4388,7 +4388,7 @@ <h2 id="returns">Returns</h2>
httpx.Response: The Response object from `httpx` library,
which contains a server’s response to an HTTP request. &#39;&#39;&#39;
return self.session.post(f&#39;{self.api_url}/upload_file&#39;,
file=file,
files=file,
headers=headers)</code></pre>
</details>
</dd>
Expand Down
6 changes: 3 additions & 3 deletions docs/agent/web/api/v35.html
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ <h1 class="title">Module <code>livechat.agent.web.api.v35</code></h1>
httpx.Response: The Response object from `httpx` library,
which contains a server’s response to an HTTP request. &#39;&#39;&#39;
return self.session.post(f&#39;{self.api_url}/upload_file&#39;,
file=file,
files=file,
headers=headers)

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

def send_rich_message_postback(self,
Expand Down Expand Up @@ -4388,7 +4388,7 @@ <h2 id="returns">Returns</h2>
httpx.Response: The Response object from `httpx` library,
which contains a server’s response to an HTTP request. &#39;&#39;&#39;
return self.session.post(f&#39;{self.api_url}/upload_file&#39;,
file=file,
files=file,
headers=headers)</code></pre>
</details>
</dd>
Expand Down
6 changes: 3 additions & 3 deletions docs/agent/web/api/v36.html
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ <h1 class="title">Module <code>livechat.agent.web.api.v36</code></h1>
httpx.Response: The Response object from `httpx` library,
which contains a server’s response to an HTTP request. &#39;&#39;&#39;
return self.session.post(f&#39;{self.api_url}/upload_file&#39;,
file=file,
files=file,
headers=headers)

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

def send_rich_message_postback(self,
Expand Down Expand Up @@ -4341,7 +4341,7 @@ <h2 id="returns">Returns</h2>
httpx.Response: The Response object from `httpx` library,
which contains a server’s response to an HTTP request. &#39;&#39;&#39;
return self.session.post(f&#39;{self.api_url}/upload_file&#39;,
file=file,
files=file,
headers=headers)</code></pre>
</details>
</dd>
Expand Down
2 changes: 1 addition & 1 deletion livechat/agent/web/api/v34.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def upload_file(self,
httpx.Response: The Response object from `httpx` library,
which contains a server’s response to an HTTP request. '''
return self.session.post(f'{self.api_url}/upload_file',
file=file,
files=file,
headers=headers)

def send_rich_message_postback(self,
Expand Down
2 changes: 1 addition & 1 deletion livechat/agent/web/api/v35.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def upload_file(self,
httpx.Response: The Response object from `httpx` library,
which contains a server’s response to an HTTP request. '''
return self.session.post(f'{self.api_url}/upload_file',
file=file,
files=file,
headers=headers)

def send_rich_message_postback(self,
Expand Down
2 changes: 1 addition & 1 deletion livechat/agent/web/api/v36.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def upload_file(self,
httpx.Response: The Response object from `httpx` library,
which contains a server’s response to an HTTP request. '''
return self.session.post(f'{self.api_url}/upload_file',
file=file,
files=file,
headers=headers)

def send_rich_message_postback(self,
Expand Down
27 changes: 14 additions & 13 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
-i https://pypi.org/simple
anyio==4.1.0 ; python_version >= '3.8'
certifi==2023.11.17 ; python_version >= '3.6'
exceptiongroup==1.2.0 ; python_version < '3.11'
h11==0.14.0 ; python_version >= '3.7'
anyio==4.3.0; python_version >= '3.8'
certifi==2024.2.2; python_version >= '3.6'
exceptiongroup==1.2.0; python_version < '3.11'
h11==0.14.0; python_version >= '3.7'
h2==4.1.0
hpack==4.0.0 ; python_full_version >= '3.6.1'
httpcore==1.0.2 ; python_version >= '3.8'
httpx[http2]==0.25.2
hyperframe==6.0.1 ; python_full_version >= '3.6.1'
idna==3.6 ; python_version >= '3.5'
loguru==0.7.2
sniffio==1.3.0 ; python_version >= '3.7'
urllib3==2.1.0
websocket-client==1.7.0
hpack==4.0.0; python_full_version >= '3.6.1'
httpcore==1.0.5; python_version >= '3.8'
httpx[http2]==0.25.2; python_version >= '3.8'
hyperframe==6.0.1; python_full_version >= '3.6.1'
idna==3.7; python_version >= '3.5'
loguru==0.7.2; python_version >= '3.5'
sniffio==1.3.1; python_version >= '3.7'
typing-extensions==4.11.0; python_version < '3.11'
urllib3==2.1.0; python_version >= '3.8'
websocket-client==1.7.0; python_version >= '3.8'

0 comments on commit d000e4d

Please sign in to comment.