class Upwork::Api::Routers::Messages

Constants

ENTRY_POINT

Public Class Methods

new(client) click to toggle source

Init

Arguments:

client: (Client)
# File lib/upwork/api/routers/messages.rb, line 24
def initialize(client)
  @client = client
  @client.epoint = ENTRY_POINT 
end

Public Instance Methods

create_room(company, params = {}) click to toggle source

Create a new room

Arguments:

company: (String)
params: (Hash)
# File lib/upwork/api/routers/messages.rb, line 88
def create_room(company, params = {})
  $LOG.i "running " + __method__.to_s
  @client.post '/messages/v3/' + company + '/rooms', params
end
get_room_by_application(company, application_id, params = {}) click to toggle source

Get a specific room by application ID

Arguments:

company: (String)
application_id: (String)
params: (Hash)
# File lib/upwork/api/routers/messages.rb, line 67
def get_room_by_application(company, application_id, params = {})
  $LOG.i "running " + __method__.to_s
  @client.get '/messages/v3/' + company + '/rooms/applications/' + application_id, params
end
get_room_by_contract(company, contract_id, params = {}) click to toggle source

Get a specific room by contract ID

Arguments:

company: (String)
contract_id: (String)
params: (Hash)
# File lib/upwork/api/routers/messages.rb, line 78
def get_room_by_contract(company, contract_id, params = {})
  $LOG.i "running " + __method__.to_s
  @client.get '/messages/v3/' + company + '/rooms/contracts/' + contract_id, params
end
get_room_by_offer(company, offer_id, params = {}) click to toggle source

Get a specific room by offer ID

Arguments:

company: (String)
offer_id: (String)
params: (Hash)
# File lib/upwork/api/routers/messages.rb, line 56
def get_room_by_offer(company, offer_id, params = {})
  $LOG.i "running " + __method__.to_s
  @client.get '/messages/v3/' + company + '/rooms/offers/' + offer_id, params
end
get_room_details(company, room_id, params = {}) click to toggle source

Get a specific room information

Arguments:

company: (String)
room_id: (String)
params: (Hash)
# File lib/upwork/api/routers/messages.rb, line 45
def get_room_details(company, room_id, params = {})
  $LOG.i "running " + __method__.to_s
  @client.get '/messages/v3/' + company + '/rooms/' + room_id, params
end
get_rooms(company, params = {}) click to toggle source

Retrieve rooms information

Arguments:

company: (String)
params: (Hash)
# File lib/upwork/api/routers/messages.rb, line 34
def get_rooms(company, params = {})
  $LOG.i "running " + __method__.to_s
  @client.get '/messages/v3/' + company + '/rooms', params
end
send_message_to_room(company, room_id, params = {}) click to toggle source

Send a message to a room

Arguments:

company: (String)
room_id: (String)
params: (Hash)
# File lib/upwork/api/routers/messages.rb, line 99
def send_message_to_room(company, room_id, params = {})
  $LOG.i "running " + __method__.to_s
  @client.post '/messages/v3/' + company + '/rooms/' + room_id + '/stories', params
end
update_room_metadata(company, room_id, params = {}) click to toggle source

Update the metadata of a room

Arguments:

company: (String)
room_id: (String)
params: (Hash)
# File lib/upwork/api/routers/messages.rb, line 122
def update_room_metadata(company, room_id, params = {})
  $LOG.i "running " + __method__.to_s
  @client.put '/messages/v3/' + company + '/rooms/' + room_id, params
end
update_room_settings(company, room_id, username, params = {}) click to toggle source

Update a room settings

Arguments:

company: (String)
room_id: (String)
username: (String)
params: (Hash)
# File lib/upwork/api/routers/messages.rb, line 111
def update_room_settings(company, room_id, username, params = {})
  $LOG.i "running " + __method__.to_s
  @client.put '/messages/v3/' + company + '/rooms/' + room_id + '/users/' + username, params
end