Class: Helo::Domains
Instance Method Summary collapse
- #create(request_data) ⇒ Object
- #delete(id) ⇒ Object
- #list(request_data = {}) ⇒ Object
- #retrieve(id) ⇒ Object
- #rotate_key(id) ⇒ Object
- #update(id, request_data) ⇒ Object
- #verify(id) ⇒ Object
Instance Method Details
#create(request_data) ⇒ Object
11 12 13 14 15 |
# File 'lib/helo/apis/domains.rb', line 11 def create(request_data) request = CreateDomainRequest.new(request_data) response = @client.request(:post, "/domains", body: request.to_params) DomainWithDnsResponse.from_hash(response.body) end |
#delete(id) ⇒ Object
28 29 30 31 |
# File 'lib/helo/apis/domains.rb', line 28 def delete(id) response = @client.request(:delete, "/domains/#{id}") nil end |
#list(request_data = {}) ⇒ Object
5 6 7 8 9 |
# File 'lib/helo/apis/domains.rb', line 5 def list(request_data = {}) request = DomainsListRequest.new(request_data) response = @client.request(:get, "/domains", params: request.to_params) PaginatedResponseOfDomainResponse.from_hash(response.body) end |
#retrieve(id) ⇒ Object
17 18 19 20 |
# File 'lib/helo/apis/domains.rb', line 17 def retrieve(id) response = @client.request(:get, "/domains/#{id}") DomainWithDnsResponse.from_hash(response.body) end |
#rotate_key(id) ⇒ Object
38 39 40 41 |
# File 'lib/helo/apis/domains.rb', line 38 def rotate_key(id) response = @client.request(:post, "/domains/#{id}/rotate-key") DnsRecordResponse.from_hash(response.body) end |
#update(id, request_data) ⇒ Object
22 23 24 25 26 |
# File 'lib/helo/apis/domains.rb', line 22 def update(id, request_data) request = UpdateDomainRequest.new(request_data) response = @client.request(:patch, "/domains/#{id}", body: request.to_params) DomainResponse.from_hash(response.body) end |
#verify(id) ⇒ Object
33 34 35 36 |
# File 'lib/helo/apis/domains.rb', line 33 def verify(id) response = @client.request(:post, "/domains/#{id}/verify") DnsRecordsResponse.from_hash(response.body) end |