Module: Dnsimple::Client::Certificates
- Included in:
- CertificatesService
- Defined in:
- lib/dnsimple/client/certificates.rb
Instance Method Summary collapse
-
#certificate(account_id, domain_id, certificate_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::Certificate>
Gets a certificate associated to the domain.
-
#certificate_private_key(account_id, domain_id, certificate_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::CertificateBundle>
Get certificate private key associated to the domain.
-
#certificates(account_id, domain_name, options = {}) ⇒ Dnsimple::PaginatedResponse<Dnsimple::Struct::Certificate>
Lists the certificates associated to the domain.
-
#download_certificate(account_id, domain_id, certificate_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::CertificateBundle>
Downloads a certificate associated to the domain.
Instance Method Details
#certificate(account_id, domain_id, certificate_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::Certificate>
Gets a certificate associated to the domain.
45 46 47 48 49 |
# File 'lib/dnsimple/client/certificates.rb', line 45 def certificate(account_id, domain_id, certificate_id, = {}) response = client.get(Client.versioned("/%s/domains/%s/certificates/%s" % [account_id, domain_id, certificate_id]), ) Dnsimple::Response.new(response, Struct::Certificate.new(response["data"])) end |
#certificate_private_key(account_id, domain_id, certificate_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::CertificateBundle>
Get certificate private key associated to the domain.
81 82 83 84 85 |
# File 'lib/dnsimple/client/certificates.rb', line 81 def certificate_private_key(account_id, domain_id, certificate_id, = {}) response = client.get(Client.versioned("/%s/domains/%s/certificates/%s/private_key" % [account_id, domain_id, certificate_id]), ) Dnsimple::Response.new(response, Struct::CertificateBundle.new(response["data"])) end |
#certificates(account_id, domain_name, options = {}) ⇒ Dnsimple::PaginatedResponse<Dnsimple::Struct::Certificate>
Lists the certificates associated to the domain.
27 28 29 30 31 |
# File 'lib/dnsimple/client/certificates.rb', line 27 def certificates(account_id, domain_name, = {}) response = client.get(Client.versioned("/%s/domains/%s/certificates" % [account_id, domain_name]), Options::ListOptions.new()) Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Certificate.new(r) }) end |
#download_certificate(account_id, domain_id, certificate_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::CertificateBundle>
Downloads a certificate associated to the domain.
63 64 65 66 67 |
# File 'lib/dnsimple/client/certificates.rb', line 63 def download_certificate(account_id, domain_id, certificate_id, = {}) response = client.get(Client.versioned("/%s/domains/%s/certificates/%s/download" % [account_id, domain_id, certificate_id]), ) Dnsimple::Response.new(response, Struct::CertificateBundle.new(response["data"])) end |