Skip to content

Commit

Permalink
Merge pull request #1 from upwork/v3.0.3
Browse files Browse the repository at this point in the history
Changes v3.0.3
  • Loading branch information
mnovozhylov committed Sep 18, 2020
2 parents 2781b60 + 123b1ee commit 35d481e
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 5 deletions.
Empty file added .coveragerc
Empty file.
1 change: 1 addition & 0 deletions .docgen
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pipenv shell && pdoc3 --html upwork
1 change: 1 addition & 0 deletions .tests
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nox
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Release History

## 3.0.3
* Send Message to a Batch of Rooms API

## 3.0.0
* Release of Python 3 compatible library for OAuth2 workflow
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ All the dependencies will be automatically installed as well.
Follow instructions from the `Installation` section.

2.
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.
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.
***That's all. Run your app as `python myapp.py` and have fun.***'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
packages=find_packages(),
setup_requires=[],
url="https://github.com/upwork/python-upwork-oauth2",
version="3.0.2",
version="3.0.3",
zip_safe=False,
)
6 changes: 6 additions & 0 deletions tests/routers/test_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ def test_send_message_to_room(mocked_method):
mocked_method.assert_called_with("/messages/v3/company/rooms/room_id/stories", {})


@patch.object(upwork.Client, "post")
def test_send_message_to_rooms(mocked_method):
messages.Api(upwork.Client).send_message_to_rooms("company")
mocked_method.assert_called_with("/messages/v3/company/stories/batch", {})


@patch.object(upwork.Client, "put")
def test_get_update_room_settings(mocked_method):
messages.Api(upwork.Client).update_room_settings("company", "room_id", "username")
Expand Down
2 changes: 1 addition & 1 deletion upwork/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

__author__ = """Maksym Novozhylov"""
__email__ = "mnovozhilov@upwork.com"
__version__ = "3.0.2"
__version__ = "3.0.3"

__all__ = ("Config", "Client", "routers")
16 changes: 14 additions & 2 deletions upwork/routers/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ def create_room(self, company, params={}):

def send_message_to_room(self, company, room_id, params={}):
"""Send a message to a room
Parameters:
:param company:
:param company:
:param room_id:
:param params: (Default value = {})
Expand All @@ -119,6 +119,18 @@ def send_message_to_room(self, company, room_id, params={}):
"/messages/v3/{0}/rooms/{1}/stories".format(company, room_id), params
)

def send_message_to_rooms(self, company, params={}):
"""Send a message to a batch of rooms
Parameters:
:param company:
:param params: (Default value = {})
"""
return self.client.post(
"/messages/v3/{0}/stories/batch".format(company), params
)

def update_room_settings(self, company, room_id, username, params={}):
"""Update a room settings
Expand Down

0 comments on commit 35d481e

Please sign in to comment.