Module: Dnsimple::Client::ServicesDomains
- Included in:
- ServicesService
- Defined in:
- lib/dnsimple/client/services_domains.rb
Instance Method Summary collapse
-
#applied_services(account_id, domain_id, options = {}) ⇒ Dnsimple::PaginatedResponse<Dnsimple::Struct::Service>
Lists the one-click services applied to the domain.
-
#apply_service(account_id, service_id, domain_id, settings = {}, options = {}) ⇒ Dnsimple::Response<nil>
Apply a given one-click service to the domain.
-
#unapply_service(account_id, service_id, domain_id, options = {}) ⇒ Dnsimple::Response<nil>
Unapply a given one-click service from the domain.
Instance Method Details
#applied_services(account_id, domain_id, options = {}) ⇒ Dnsimple::PaginatedResponse<Dnsimple::Struct::Service>
Lists the one-click services applied to the domain.
29 30 31 32 33 34 |
# File 'lib/dnsimple/client/services_domains.rb', line 29 def applied_services(account_id, domain_id, = {}) endpoint = Client.versioned("/%s/domains/%s/services" % [account_id, domain_id]) response = client.get(endpoint, Options::ListOptions.new()) Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Service.new(r) }) end |
#apply_service(account_id, service_id, domain_id, settings = {}, options = {}) ⇒ Dnsimple::Response<nil>
Apply a given one-click service to the domain.
54 55 56 57 58 59 |
# File 'lib/dnsimple/client/services_domains.rb', line 54 def apply_service(account_id, service_id, domain_id, settings = {}, = {}) endpoint = Client.versioned("/%s/domains/%s/services/%s" % [account_id, domain_id, service_id]) response = client.post(endpoint, settings, ) Dnsimple::Response.new(response, nil) end |
#unapply_service(account_id, service_id, domain_id, options = {}) ⇒ Dnsimple::Response<nil>
Unapply a given one-click service from the domain.
75 76 77 78 79 80 |
# File 'lib/dnsimple/client/services_domains.rb', line 75 def unapply_service(account_id, service_id, domain_id, = {}) endpoint = Client.versioned("/%s/domains/%s/services/%s" % [account_id, domain_id, service_id]) response = client.delete(endpoint, ) Dnsimple::Response.new(response, nil) end |