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.
27 28 29 30 31 32 |
# File 'lib/dnsimple/client/services_domains.rb', line 27 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.
52 53 54 55 56 57 |
# File 'lib/dnsimple/client/services_domains.rb', line 52 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.
73 74 75 76 77 78 |
# File 'lib/dnsimple/client/services_domains.rb', line 73 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 |