Skip to content

Commit 35d481e

Browse files
authored
Merge pull request #1 from upwork/v3.0.3
Changes v3.0.3
2 parents 2781b60 + 123b1ee commit 35d481e

File tree

9 files changed

+28
-5
lines changed

9 files changed

+28
-5
lines changed

.coveragerc

Whitespace-only changes.

.docgen

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pipenv shell && pdoc3 --html upwork

.tests

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nox

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Release History
22

3+
## 3.0.3
4+
* Send Message to a Batch of Rooms API
5+
36
## 3.0.0
47
* Release of Python 3 compatible library for OAuth2 workflow

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ All the dependencies will be automatically installed as well.
6767
Follow instructions from the `Installation` section.
6868

6969
2.
70-
Run `myapp.py` and follow the instructions, or open `myapp.py` and type the `consumer_key` and `consumer_secret` that you previously got from the API Center.
70+
Run `myapp.py` and follow the instructions, or open `myapp.py` and type the `client_id` and `client_secret` that you previously got from the API Center.
7171
***That's all. Run your app as `python myapp.py` and have fun.***'

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
packages=find_packages(),
3232
setup_requires=[],
3333
url="https://github.com/upwork/python-upwork-oauth2",
34-
version="3.0.2",
34+
version="3.0.3",
3535
zip_safe=False,
3636
)

tests/routers/test_messages.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ def test_send_message_to_room(mocked_method):
5555
mocked_method.assert_called_with("/messages/v3/company/rooms/room_id/stories", {})
5656

5757

58+
@patch.object(upwork.Client, "post")
59+
def test_send_message_to_rooms(mocked_method):
60+
messages.Api(upwork.Client).send_message_to_rooms("company")
61+
mocked_method.assert_called_with("/messages/v3/company/stories/batch", {})
62+
63+
5864
@patch.object(upwork.Client, "put")
5965
def test_get_update_room_settings(mocked_method):
6066
messages.Api(upwork.Client).update_room_settings("company", "room_id", "username")

upwork/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
__author__ = """Maksym Novozhylov"""
88
__email__ = "[email protected]"
9-
__version__ = "3.0.2"
9+
__version__ = "3.0.3"
1010

1111
__all__ = ("Config", "Client", "routers")

upwork/routers/messages.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ def create_room(self, company, params={}):
108108

109109
def send_message_to_room(self, company, room_id, params={}):
110110
"""Send a message to a room
111-
111+
112112
Parameters:
113-
:param company:
113+
:param company:
114114
:param room_id:
115115
:param params: (Default value = {})
116116
@@ -119,6 +119,18 @@ def send_message_to_room(self, company, room_id, params={}):
119119
"/messages/v3/{0}/rooms/{1}/stories".format(company, room_id), params
120120
)
121121

122+
def send_message_to_rooms(self, company, params={}):
123+
"""Send a message to a batch of rooms
124+
125+
Parameters:
126+
:param company:
127+
:param params: (Default value = {})
128+
129+
"""
130+
return self.client.post(
131+
"/messages/v3/{0}/stories/batch".format(company), params
132+
)
133+
122134
def update_room_settings(self, company, room_id, username, params={}):
123135
"""Update a room settings
124136

0 commit comments

Comments
 (0)