Class: AhoSdk::Account::DomainsResource Private
- Inherits:
-
Object
- Object
- AhoSdk::Account::DomainsResource
- Defined in:
- lib/aho_sdk/account.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Domains resource operations
Instance Method Summary collapse
-
#create(body: nil, idempotency_key: nil) ⇒ Hash
private
Register a domain.
-
#delete(id:) ⇒ Hash
private
Delete a domain.
-
#get(id:) ⇒ Hash
private
Get domain details.
-
#initialize(client) ⇒ DomainsResource
constructor
private
A new instance of DomainsResource.
-
#list(txt_status: nil, fully_verified: nil, primary: nil, page: nil, per_page: nil) ⇒ Hash
private
List domains.
-
#verify(id:, idempotency_key: nil) ⇒ Hash
private
Verify domain.
Constructor Details
#initialize(client) ⇒ DomainsResource
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 DomainsResource.
96 97 98 |
# File 'lib/aho_sdk/account.rb', line 96 def initialize(client) @client = client end |
Instance Method Details
#create(body: nil, idempotency_key: nil) ⇒ Hash
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.
Register a domain
103 104 105 |
# File 'lib/aho_sdk/account.rb', line 103 def create(body: nil, idempotency_key: nil) @client.post("/v1/account/domains", body: body, idempotency_key: idempotency_key) end |
#delete(id:) ⇒ Hash
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.
Delete a domain
128 129 130 |
# File 'lib/aho_sdk/account.rb', line 128 def delete(id:) @client.delete("/v1/account/domains/#{id}") end |
#get(id:) ⇒ Hash
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.
Get domain details
121 122 123 |
# File 'lib/aho_sdk/account.rb', line 121 def get(id:) @client.get("/v1/account/domains/#{id}") end |
#list(txt_status: nil, fully_verified: nil, primary: nil, page: nil, per_page: nil) ⇒ Hash
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.
List domains
110 111 112 113 114 115 116 |
# File 'lib/aho_sdk/account.rb', line 110 def list(txt_status: nil, fully_verified: nil, primary: nil, page: nil, per_page: nil) fetch_page = ->(p) { response = @client.get("/v1/account/domains", params: { txt_status: txt_status, fully_verified: fully_verified, primary: primary, page: p, per_page: per_page }) Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page) } fetch_page.call(page) end |
#verify(id:, idempotency_key: nil) ⇒ Hash
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.
Verify domain
135 136 137 |
# File 'lib/aho_sdk/account.rb', line 135 def verify(id:, idempotency_key: nil) @client.post("/v1/account/domains/#{id}/verify", idempotency_key: idempotency_key) end |