Module: Dnsimple::Client::DomainsPushes
- Included in:
- DomainsService
- Defined in:
- lib/dnsimple/client/domains_pushes.rb
Instance Method Summary collapse
-
#accept_push(account_id, push_id, attributes, options = {}) ⇒ Dnsimple::Response<nil>
Accept a domain push.
-
#initiate_push(account_id, domain_id, attributes, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::DomainPush>
Initiate a push for the domain.
-
#pushes(account_id, options = {}) ⇒ Dnsimple::PaginatedResponse<Dnsimple::Struct::DomainPush>
Lists the pushes for the domain.
-
#reject_push(account_id, push_id, options = {}) ⇒ Dnsimple::Response<nil>
Reject a domain push.
Instance Method Details
#accept_push(account_id, push_id, attributes, options = {}) ⇒ Dnsimple::Response<nil>
Accept a domain push.
69 70 71 72 73 74 |
# File 'lib/dnsimple/client/domains_pushes.rb', line 69 def accept_push(account_id, push_id, attributes, = {}) Extra.validate_mandatory_attributes(attributes, [:contact_id]) response = client.post(Client.versioned("/%s/pushes/%s" % [account_id, push_id]), attributes, ) Dnsimple::Response.new(response, nil) end |
#initiate_push(account_id, domain_id, attributes, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::DomainPush>
Initiate a push for the domain.
22 23 24 25 26 27 |
# File 'lib/dnsimple/client/domains_pushes.rb', line 22 def initiate_push(account_id, domain_id, attributes, = {}) Extra.validate_mandatory_attributes(attributes, [:new_account_email]) response = client.post(Client.versioned("/%s/domains/%s/pushes" % [account_id, domain_id]), attributes, ) Dnsimple::Response.new(response, Struct::DomainPush.new(response["data"])) end |
#pushes(account_id, options = {}) ⇒ Dnsimple::PaginatedResponse<Dnsimple::Struct::DomainPush>
Lists the pushes for the domain.
47 48 49 50 51 |
# File 'lib/dnsimple/client/domains_pushes.rb', line 47 def pushes(account_id, = {}) response = client.get(Client.versioned("/%s/pushes" % [account_id]), Options::ListOptions.new()) Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::DomainPush.new(r) }) end |
#reject_push(account_id, push_id, options = {}) ⇒ Dnsimple::Response<nil>
Reject a domain push.
90 91 92 93 94 |
# File 'lib/dnsimple/client/domains_pushes.rb', line 90 def reject_push(account_id, push_id, = {}) response = client.delete(Client.versioned("/%s/pushes/%s" % [account_id, push_id]), ) Dnsimple::Response.new(response, nil) end |