Class: Upwork::Api::Routers::Messages
- Inherits:
-
Object
- Object
- Upwork::Api::Routers::Messages
- Defined in:
- lib/upwork/api/routers/messages.rb
Constant Summary collapse
- ENTRY_POINT =
'api'
Instance Method Summary collapse
-
#create_room(company, params = {}) ⇒ Object
Create a new room.
-
#get_room_by_application(company, application_id, params = {}) ⇒ Object
params: (Hash).
-
#get_room_by_contract(company, contract_id, params = {}) ⇒ Object
params: (Hash).
-
#get_room_by_offer(company, offer_id, params = {}) ⇒ Object
params: (Hash).
-
#get_room_details(company, room_id, params = {}) ⇒ Object
params: (Hash).
-
#get_room_messages(company, room_id, params = {}) ⇒ Object
params: (Hash).
-
#get_rooms(company, params = {}) ⇒ Object
Retrieve rooms information.
-
#initialize(client) ⇒ Messages
constructor
Init.
-
#send_message_to_room(company, room_id, params = {}) ⇒ Object
params: (Hash).
-
#send_message_to_rooms(company, params = {}) ⇒ Object
Send a message to a batch of rooms.
-
#update_room_metadata(company, room_id, params = {}) ⇒ Object
params: (Hash).
-
#update_room_settings(company, room_id, username, params = {}) ⇒ Object
params: (Hash).
Constructor Details
#initialize(client) ⇒ Messages
Init
Arguments:
client: (Client)
24 25 26 27 |
# File 'lib/upwork/api/routers/messages.rb', line 24 def initialize(client) @client = client @client.epoint = ENTRY_POINT end |
Instance Method Details
#create_room(company, params = {}) ⇒ Object
Create a new room
Arguments:
company: (String)
params: (Hash)
99 100 101 102 |
# File 'lib/upwork/api/routers/messages.rb', line 99 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 = {}) ⇒ Object
params: (Hash)
78 79 80 81 |
# File 'lib/upwork/api/routers/messages.rb', line 78 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 = {}) ⇒ Object
params: (Hash)
89 90 91 92 |
# File 'lib/upwork/api/routers/messages.rb', line 89 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 = {}) ⇒ Object
params: (Hash)
67 68 69 70 |
# File 'lib/upwork/api/routers/messages.rb', line 67 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 = {}) ⇒ Object
params: (Hash)
45 46 47 48 |
# 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_room_messages(company, room_id, params = {}) ⇒ Object
params: (Hash)
56 57 58 59 |
# File 'lib/upwork/api/routers/messages.rb', line 56 def (company, room_id, params = {}) $LOG.i "running " + __method__.to_s @client.get '/messages/v3/' + company + '/rooms/' + room_id + '/stories', params end |
#get_rooms(company, params = {}) ⇒ Object
Retrieve rooms information
Arguments:
company: (String)
params: (Hash)
34 35 36 37 |
# 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 = {}) ⇒ Object
params: (Hash)
110 111 112 113 |
# File 'lib/upwork/api/routers/messages.rb', line 110 def (company, room_id, params = {}) $LOG.i "running " + __method__.to_s @client.post '/messages/v3/' + company + '/rooms/' + room_id + '/stories', params end |
#send_message_to_rooms(company, params = {}) ⇒ Object
Send a message to a batch of rooms
Arguments:
company: (String)
params: (Hash)
120 121 122 123 |
# File 'lib/upwork/api/routers/messages.rb', line 120 def (company, params = {}) $LOG.i "running " + __method__.to_s @client.post '/messages/v3/' + company + '/stories/batch', params end |
#update_room_metadata(company, room_id, params = {}) ⇒ Object
params: (Hash)
143 144 145 146 |
# File 'lib/upwork/api/routers/messages.rb', line 143 def (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 = {}) ⇒ Object
params: (Hash)
132 133 134 135 |
# File 'lib/upwork/api/routers/messages.rb', line 132 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 |