Class: Courier::Resources::Inbox::Messages
- Inherits:
-
Object
- Object
- Courier::Resources::Inbox::Messages
- Defined in:
- lib/courier/resources/inbox/messages.rb,
sig/courier/resources/inbox/messages.rbs
Overview
Manage the messages in a user's in-app inbox.
Instance Method Summary collapse
-
#delete(message_id, request_options: {}) ⇒ nil
Delete a user's inbox message.
-
#initialize(client:) ⇒ Messages
constructor
private
A new instance of Messages.
-
#restore(message_id, request_options: {}) ⇒ nil
Restore a previously deleted inbox message.
Constructor Details
#initialize(client:) ⇒ Messages
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Messages.
52 53 54 |
# File 'lib/courier/resources/inbox/messages.rb', line 52 def initialize(client:) @client = client end |
Instance Method Details
#delete(message_id, request_options: {}) ⇒ nil
Delete a user's inbox message. The message is removed from every inbox read (it stops appearing in the recipient's Inbox); it can be restored.
20 21 22 23 24 25 26 27 |
# File 'lib/courier/resources/inbox/messages.rb', line 20 def delete(, params = {}) @client.request( method: :delete, path: ["inbox/messages/%1$s", ], model: NilClass, options: params[:request_options] ) end |
#restore(message_id, request_options: {}) ⇒ nil
Restore a previously deleted inbox message.
40 41 42 43 44 45 46 47 |
# File 'lib/courier/resources/inbox/messages.rb', line 40 def restore(, params = {}) @client.request( method: :put, path: ["inbox/messages/%1$s/restore", ], model: NilClass, options: params[:request_options] ) end |