Class: Zavudev::Resources::EmailDomains
- Inherits:
-
Object
- Object
- Zavudev::Resources::EmailDomains
- Defined in:
- lib/zavudev/resources/email_domains.rb,
sig/zavudev/resources/email_domains.rbs
Instance Method Summary collapse
-
#create(domain:, request_options: {}) ⇒ Zavudev::Models::EmailDomainCreateResponse
Add a domain to send email from.
-
#delete(domain_id, request_options: {}) ⇒ nil
Remove an email domain.
-
#initialize(client:) ⇒ EmailDomains
constructor
private
A new instance of EmailDomains.
-
#list(request_options: {}) ⇒ Zavudev::Models::EmailDomainListResponse
List email domains.
-
#retrieve(domain_id, request_options: {}) ⇒ Zavudev::Models::EmailDomainRetrieveResponse
Fetch a domain with its DNS records and current status.
-
#verify(domain_id, request_options: {}) ⇒ Zavudev::Models::EmailDomainVerifyResponse
Re-check the domain's published DNS records and refresh its status.
Constructor Details
#initialize(client:) ⇒ EmailDomains
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 EmailDomains.
108 109 110 |
# File 'lib/zavudev/resources/email_domains.rb', line 108 def initialize(client:) @client = client end |
Instance Method Details
#create(domain:, request_options: {}) ⇒ Zavudev::Models::EmailDomainCreateResponse
Add a domain to send email from. Returns the DNS records to publish (DKIM CNAMEs are required; SPF, DMARC, and MAIL FROM are recommended). Publish them at your DNS provider, then verify.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/zavudev/resources/email_domains.rb', line 19 def create(params) parsed, = Zavudev::EmailDomainCreateParams.dump_request(params) @client.request( method: :post, path: "v1/email-domains", body: parsed, model: Zavudev::Models::EmailDomainCreateResponse, options: ) end |
#delete(domain_id, request_options: {}) ⇒ nil
Remove an email domain
77 78 79 80 81 82 83 84 |
# File 'lib/zavudev/resources/email_domains.rb', line 77 def delete(domain_id, params = {}) @client.request( method: :delete, path: ["v1/email-domains/%1$s", domain_id], model: NilClass, options: params[:request_options] ) end |
#list(request_options: {}) ⇒ Zavudev::Models::EmailDomainListResponse
List email domains
58 59 60 61 62 63 64 65 |
# File 'lib/zavudev/resources/email_domains.rb', line 58 def list(params = {}) @client.request( method: :get, path: "v1/email-domains", model: Zavudev::Models::EmailDomainListResponse, options: params[:request_options] ) end |
#retrieve(domain_id, request_options: {}) ⇒ Zavudev::Models::EmailDomainRetrieveResponse
Fetch a domain with its DNS records and current status.
40 41 42 43 44 45 46 47 |
# File 'lib/zavudev/resources/email_domains.rb', line 40 def retrieve(domain_id, params = {}) @client.request( method: :get, path: ["v1/email-domains/%1$s", domain_id], model: Zavudev::Models::EmailDomainRetrieveResponse, options: params[:request_options] ) end |
#verify(domain_id, request_options: {}) ⇒ Zavudev::Models::EmailDomainVerifyResponse
Re-check the domain's published DNS records and refresh its status.
96 97 98 99 100 101 102 103 |
# File 'lib/zavudev/resources/email_domains.rb', line 96 def verify(domain_id, params = {}) @client.request( method: :post, path: ["v1/email-domains/%1$s/verify", domain_id], model: Zavudev::Models::EmailDomainVerifyResponse, options: params[:request_options] ) end |