Skip to content

Commit

Permalink
Merge pull request #16 from upwork/v1.3.5
Browse files Browse the repository at this point in the history
Add send_message_to_rooms
  • Loading branch information
mnovozhylov committed Sep 18, 2020
2 parents bfa71cd + a02d935 commit faa360b
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release History

## 1.3.5
* Send Message to a Batch of Rooms API
* Bug fixes

## 1.3.4
* Add Room Messages API

Expand Down
2 changes: 1 addition & 1 deletion lib/upwork/api/routers/hr/freelancers/applications.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_list(params = {})
# reference: (String)
def get_specific(reference)
$LOG.i "running " + __method__.to_s
@client.get '/hr/v4/contractors/applications' + reference
@client.get '/hr/v4/contractors/applications/' + reference
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/upwork/api/routers/hr/freelancers/offers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_list(params = {})
# reference: (String)
def get_specific(reference)
$LOG.i "running " + __method__.to_s
@client.get '/offers/v1/clients/offers/' + reference
@client.get '/offers/v1/contractors/offers/' + reference
end

# Apply specific action
Expand All @@ -54,7 +54,7 @@ def get_specific(reference)
# params: (Hash)
def actions(reference, params)
$LOG.i "running " + __method__.to_s
@client.post '/offers/v1/clients/actions/' + reference, params
@client.post '/offers/v1/contractors/actions/' + reference, params
end
end
end
Expand Down
10 changes: 10 additions & 0 deletions lib/upwork/api/routers/messages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ def send_message_to_room(company, room_id, params = {})
@client.post '/messages/v3/' + company + '/rooms/' + room_id + '/stories', params
end

# Send a message to a batch of rooms
#
# Arguments:
# company: (String)
# params: (Hash)
def send_message_to_rooms(company, params = {})
$LOG.i "running " + __method__.to_s
@client.post '/messages/v3/' + company + '/stories/batch', params
end

# Update a room settings
#
# Arguments:
Expand Down
2 changes: 1 addition & 1 deletion lib/upwork/api/routers/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_skills
# Get skills V2
def get_skills_v2(params)
$LOG.i "running " + __method__.to_s
@client.get '/profiles/v2/metadata/skills'
@client.get '/profiles/v2/metadata/skills', params
end

# Get specialties
Expand Down
2 changes: 1 addition & 1 deletion lib/upwork/api/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

module Upwork # :nodoc:
module Api
VERSION = "1.3.4"
VERSION = "1.3.5"
end
end
5 changes: 5 additions & 0 deletions test/test_messages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ def test_send_message_to_room
api = Upwork::Api::Routers::Messages.new(get_client_mock)
assert api.send_message_to_room('company', 'room-id', {})
end

def test_send_message_to_rooms
api = Upwork::Api::Routers::Messages.new(get_client_mock)
assert api.send_message_to_rooms('company', {})
end

def test_update_room_settings
api = Upwork::Api::Routers::Messages.new(get_client_mock)
Expand Down

0 comments on commit faa360b

Please sign in to comment.