Class: Mailtrap::DomainsAPI
- Inherits:
-
Object
- Object
- Mailtrap::DomainsAPI
- Includes:
- BaseAPI
- Defined in:
- lib/mailtrap/domains_api.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes included from BaseAPI
Instance Method Summary collapse
-
#create(options) ⇒ Domain
Creates a new domain.
-
#delete(domain_id) ⇒ Object
Deletes a domain.
-
#get(domain_id) ⇒ Domain
Retrieves a specific domain.
-
#list ⇒ Array<Domain>
Lists all domains for the account.
-
#send_setup_instructions(domain_id, email:) ⇒ Object
Email DNS configuration instructions for the domain.
-
#update(domain_id, options) ⇒ Domain
Updates configuration settings for a domain.
Methods included from BaseAPI
Instance Method Details
#create(options) ⇒ Domain
Creates a new domain
42 43 44 |
# File 'lib/mailtrap/domains_api.rb', line 42 def create() base_create(, %i[domain_name]) end |
#delete(domain_id) ⇒ Object
Deletes a domain
50 51 52 |
# File 'lib/mailtrap/domains_api.rb', line 50 def delete(domain_id) base_delete(domain_id) end |
#get(domain_id) ⇒ Domain
Retrieves a specific domain
32 33 34 |
# File 'lib/mailtrap/domains_api.rb', line 32 def get(domain_id) base_get(domain_id) end |
#list ⇒ Array<Domain>
Lists all domains for the account
23 24 25 26 |
# File 'lib/mailtrap/domains_api.rb', line 23 def list response = client.get(base_path) response[:data].map { |item| handle_response(item) } end |
#send_setup_instructions(domain_id, email:) ⇒ Object
Email DNS configuration instructions for the domain
74 75 76 |
# File 'lib/mailtrap/domains_api.rb', line 74 def send_setup_instructions(domain_id, email:) client.post("#{base_path}/#{domain_id}/send_setup_instructions", email:) end |
#update(domain_id, options) ⇒ Domain
Updates configuration settings for a domain
65 66 67 |
# File 'lib/mailtrap/domains_api.rb', line 65 def update(domain_id, ) base_update(domain_id, ) end |