Class: Mailtrap::InboxesAPI
- Inherits:
-
Object
- Object
- Mailtrap::InboxesAPI
- Includes:
- BaseAPI
- Defined in:
- lib/mailtrap/inboxes_api.rb
Instance Attribute Summary
Attributes included from BaseAPI
Instance Method Summary collapse
-
#clean(inbox_id) ⇒ Inbox
Delete all messages (emails) from Inbox.
-
#create(options) ⇒ Inbox
Creates a new inbox.
-
#delete(inbox_id) ⇒ Object
Deletes an inbox.
-
#get(inbox_id) ⇒ Inbox
Retrieves a specific inbox.
-
#list ⇒ Array<Inbox>
Lists all Inboxes for the account.
-
#mark_as_read(inbox_id) ⇒ Inbox
Mark all messages in the inbox as read.
-
#reset_credentials(inbox_id) ⇒ Inbox
Reset SMTP credentials of the inbox.
-
#update(inbox_id, options) ⇒ Inbox
Updates an existing Inbox.
Methods included from BaseAPI
Instance Method Details
#clean(inbox_id) ⇒ Inbox
Delete all messages (emails) from Inbox
65 66 67 68 |
# File 'lib/mailtrap/inboxes_api.rb', line 65 def clean(inbox_id) response = client.patch("#{base_path}/#{inbox_id}/clean") handle_response(response) end |
#create(options) ⇒ Inbox
Creates a new inbox
34 35 36 37 38 39 |
# File 'lib/mailtrap/inboxes_api.rb', line 34 def create() (, + [:project_id]) response = client.post("/api/accounts/#{account_id}/projects/#{options[:project_id]}/inboxes", wrap_request()) handle_response(response) end |
#delete(inbox_id) ⇒ Object
Deletes an inbox
45 46 47 |
# File 'lib/mailtrap/inboxes_api.rb', line 45 def delete(inbox_id) base_delete(inbox_id) end |
#get(inbox_id) ⇒ Inbox
Retrieves a specific inbox
24 25 26 |
# File 'lib/mailtrap/inboxes_api.rb', line 24 def get(inbox_id) base_get(inbox_id) end |
#list ⇒ Array<Inbox>
Lists all Inboxes for the account
16 17 18 |
# File 'lib/mailtrap/inboxes_api.rb', line 16 def list base_list end |
#mark_as_read(inbox_id) ⇒ Inbox
Mark all messages in the inbox as read
74 75 76 77 |
# File 'lib/mailtrap/inboxes_api.rb', line 74 def mark_as_read(inbox_id) response = client.patch("#{base_path}/#{inbox_id}/all_read") handle_response(response) end |
#reset_credentials(inbox_id) ⇒ Inbox
Reset SMTP credentials of the inbox
83 84 85 86 |
# File 'lib/mailtrap/inboxes_api.rb', line 83 def reset_credentials(inbox_id) response = client.patch("#{base_path}/#{inbox_id}/reset_credentials") handle_response(response) end |
#update(inbox_id, options) ⇒ Inbox
Updates an existing Inbox
57 58 59 |
# File 'lib/mailtrap/inboxes_api.rb', line 57 def update(inbox_id, ) base_update(inbox_id, , + [:email_username]) end |