Method: Camper::Client::MessagesAPI#update_message

Defined in:
lib/camper/api/messages.rb

#update_message(message, options = {}) ⇒ Resource

Update a message

Examples:

client.update_message(message, subject: 'New Infrastructure')
client.update_message(message, content: 'This launch will be awesome')
client.update_message(message, category_id: '6918641') # message type id

Parameters:

  • message (Resource)

    message to update

  • options (Hash) (defaults to: {})

    subject of the new message

  • options (Hash) (defaults to: {})

    hash containing subject, content and/or category_id to update

Returns:

Raises:

See Also:



87
88
89
90
91
# File 'lib/camper/api/messages.rb', line 87

def update_message(message, options = {})
  raise Error::InvalidParameter, 'options cannot be empty' if options.empty?

  update("/buckets/#{message.bucket.id}/messages/#{message.id}", body: options)
end