Method: Dnsimple::Client::Certificates#certificates

Defined in:
lib/dnsimple/client/certificates.rb

#certificates(account_id, domain_name, options = {}) ⇒ Dnsimple::PaginatedResponse<Dnsimple::Struct::Certificate> Also known as: list_certificates

List the certificates for the domain in the account.

Examples:

List certificates in the first page

client.certificates.list(1010, "example.com")

List certificates, provide a specific page

client.certificates.list(1010, "example.com", page: 2)

List certificates, provide a sorting policy

client.certificates.list(1010, "example.com", sort: "email:asc")

Parameters:

  • account_id (Integer)

    the account ID

  • domain_name (#to_s)

    The domain ID or domain name

  • options (Hash) (defaults to: {})

    the filtering and sorting options

Options Hash (options):

  • :page (Integer)

    current page (pagination)

  • :per_page (Integer)

    number of entries to return (pagination)

Returns:

Raises:

See Also:



27
28
29
30
31
# File 'lib/dnsimple/client/certificates.rb', line 27

def certificates(, domain_name, options = {})
  response = client.get(Client.versioned("/%s/domains/%s/certificates" % [, domain_name]), Options::ListOptions.new(options))

  Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Certificate.new(r) })
end