dnsimple 4.6.0 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +12 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +9 -13
- data/.rubocop_dnsimple.yml +42 -40
- data/.rubocop_todo.yml +44 -5
- data/.travis.yml +14 -8
- data/CHANGELOG.md +56 -26
- data/CONTRIBUTING.md +43 -0
- data/Gemfile +6 -1
- data/LICENSE.txt +1 -1
- data/README.md +10 -7
- data/dnsimple.gemspec +3 -3
- data/lib/dnsimple.rb +2 -0
- data/lib/dnsimple/client.rb +23 -13
- data/lib/dnsimple/client/accounts.rb +2 -0
- data/lib/dnsimple/client/certificates.rb +2 -0
- data/lib/dnsimple/client/clients.rb +5 -2
- data/lib/dnsimple/client/contacts.rb +2 -0
- data/lib/dnsimple/client/domains.rb +3 -19
- data/lib/dnsimple/client/domains_collaborators.rb +2 -0
- data/lib/dnsimple/client/domains_delegation_signer_records.rb +2 -0
- data/lib/dnsimple/client/domains_dnssec.rb +2 -0
- data/lib/dnsimple/client/domains_email_forwards.rb +2 -0
- data/lib/dnsimple/client/domains_pushes.rb +2 -0
- data/lib/dnsimple/client/identity.rb +2 -0
- data/lib/dnsimple/client/oauth.rb +2 -0
- data/lib/dnsimple/client/registrar.rb +69 -0
- data/lib/dnsimple/client/registrar_auto_renewal.rb +2 -0
- data/lib/dnsimple/client/registrar_delegation.rb +2 -0
- data/lib/dnsimple/client/registrar_whois_privacy.rb +3 -1
- data/lib/dnsimple/client/services.rb +2 -0
- data/lib/dnsimple/client/services_domains.rb +2 -0
- data/lib/dnsimple/client/templates.rb +2 -0
- data/lib/dnsimple/client/templates_domains.rb +2 -0
- data/lib/dnsimple/client/templates_records.rb +2 -0
- data/lib/dnsimple/client/tlds.rb +2 -0
- data/lib/dnsimple/client/vanity_name_servers.rb +12 -10
- data/lib/dnsimple/client/webhooks.rb +2 -0
- data/lib/dnsimple/client/zones.rb +2 -0
- data/lib/dnsimple/client/zones_distributions.rb +2 -0
- data/lib/dnsimple/client/zones_records.rb +2 -0
- data/lib/dnsimple/default.rb +12 -10
- data/lib/dnsimple/error.rb +3 -1
- data/lib/dnsimple/extra.rb +4 -2
- data/lib/dnsimple/options.rb +2 -0
- data/lib/dnsimple/response.rb +7 -7
- data/lib/dnsimple/struct.rb +3 -0
- data/lib/dnsimple/struct/account.rb +2 -0
- data/lib/dnsimple/struct/certificate.rb +4 -2
- data/lib/dnsimple/struct/certificate_bundle.rb +5 -0
- data/lib/dnsimple/struct/certificate_purchase.rb +2 -0
- data/lib/dnsimple/struct/certificate_renewal.rb +2 -0
- data/lib/dnsimple/struct/collaborator.rb +2 -0
- data/lib/dnsimple/struct/contact.rb +2 -0
- data/lib/dnsimple/struct/delegation_signer_record.rb +2 -0
- data/lib/dnsimple/struct/dnssec.rb +2 -0
- data/lib/dnsimple/struct/domain.rb +4 -3
- data/lib/dnsimple/struct/domain_check.rb +2 -0
- data/lib/dnsimple/struct/domain_premium_price.rb +2 -0
- data/lib/dnsimple/struct/domain_price.rb +24 -0
- data/lib/dnsimple/struct/domain_push.rb +2 -0
- data/lib/dnsimple/struct/domain_registration.rb +2 -0
- data/lib/dnsimple/struct/domain_renewal.rb +2 -0
- data/lib/dnsimple/struct/domain_transfer.rb +5 -0
- data/lib/dnsimple/struct/email_forward.rb +2 -0
- data/lib/dnsimple/struct/extended_attribute.rb +2 -0
- data/lib/dnsimple/struct/oauth_token.rb +2 -0
- data/lib/dnsimple/struct/service.rb +2 -0
- data/lib/dnsimple/struct/template.rb +2 -0
- data/lib/dnsimple/struct/template_record.rb +2 -0
- data/lib/dnsimple/struct/tld.rb +2 -0
- data/lib/dnsimple/struct/user.rb +2 -0
- data/lib/dnsimple/struct/vanity_name_server.rb +2 -0
- data/lib/dnsimple/struct/webhook.rb +2 -0
- data/lib/dnsimple/struct/whoami.rb +2 -0
- data/lib/dnsimple/struct/whois_privacy.rb +2 -0
- data/lib/dnsimple/struct/whois_privacy_renewal.rb +2 -0
- data/lib/dnsimple/struct/zone.rb +2 -0
- data/lib/dnsimple/struct/zone_distribution.rb +2 -0
- data/lib/dnsimple/struct/zone_file.rb +2 -0
- data/lib/dnsimple/struct/zone_record.rb +2 -0
- data/lib/dnsimple/version.rb +3 -1
- data/spec/dnsimple/client/accounts_spec.rb +2 -0
- data/spec/dnsimple/client/certificates_spec.rb +35 -33
- data/spec/dnsimple/client/client_service_spec.rb +3 -1
- data/spec/dnsimple/client/contacts_spec.rb +4 -2
- data/spec/dnsimple/client/domains_collaborators_spec.rb +4 -2
- data/spec/dnsimple/client/domains_delegation_signer_records_spec.rb +3 -1
- data/spec/dnsimple/client/domains_dnssec_spec.rb +2 -0
- data/spec/dnsimple/client/domains_email_forwards_spec.rb +10 -8
- data/spec/dnsimple/client/domains_pushes_spec.rb +4 -2
- data/spec/dnsimple/client/domains_spec.rb +16 -41
- data/spec/dnsimple/client/identity_spec.rb +2 -0
- data/spec/dnsimple/client/oauth_spec.rb +2 -0
- data/spec/dnsimple/client/registrar_auto_renewal_spec.rb +2 -0
- data/spec/dnsimple/client/registrar_delegation_spec.rb +4 -2
- data/spec/dnsimple/client/registrar_spec.rb +116 -4
- data/spec/dnsimple/client/registrar_whois_privacy_spec.rb +2 -0
- data/spec/dnsimple/client/services_domains_spec.rb +4 -4
- data/spec/dnsimple/client/services_spec.rb +3 -3
- data/spec/dnsimple/client/templates_domains_spec.rb +2 -0
- data/spec/dnsimple/client/templates_records_spec.rb +3 -1
- data/spec/dnsimple/client/templates_spec.rb +4 -2
- data/spec/dnsimple/client/tlds_spec.rb +2 -0
- data/spec/dnsimple/client/vanity_name_servers_spec.rb +2 -0
- data/spec/dnsimple/client/webhooks_spec.rb +3 -1
- data/spec/dnsimple/client/zones_distributions_spec.rb +2 -0
- data/spec/dnsimple/client/zones_records_spec.rb +4 -2
- data/spec/dnsimple/client/zones_spec.rb +3 -1
- data/spec/dnsimple/client_spec.rb +18 -16
- data/spec/dnsimple/extra_spec.rb +2 -0
- data/spec/dnsimple/options/base_spec.rb +2 -0
- data/spec/dnsimple/options/list_options_spec.rb +6 -4
- data/spec/fixtures.http/accounts/success-account.http +0 -1
- data/spec/fixtures.http/accounts/success-user.http +0 -1
- data/spec/fixtures.http/addCollaborator/invite-success.http +0 -1
- data/spec/fixtures.http/addCollaborator/success.http +0 -1
- data/spec/fixtures.http/appliedServices/success.http +0 -1
- data/spec/fixtures.http/cancelDomainTransfer/success.http +18 -0
- data/spec/fixtures.http/changeDomainDelegation/success.http +0 -1
- data/spec/fixtures.http/changeDomainDelegationToVanity/success.http +0 -1
- data/spec/fixtures.http/checkDomain/success.http +0 -1
- data/spec/fixtures.http/checkDomainPremiumPrice/error_400_not_a_premium_domain.http +18 -0
- data/spec/fixtures.http/checkDomainPremiumPrice/error_400_tld_not_supported.http +18 -0
- data/spec/fixtures.http/checkDomainPremiumPrice/success.http +20 -0
- data/spec/fixtures.http/checkZoneDistribution/error.http +0 -1
- data/spec/fixtures.http/checkZoneDistribution/failure.http +0 -1
- data/spec/fixtures.http/checkZoneDistribution/success.http +0 -1
- data/spec/fixtures.http/checkZoneRecordDistribution/error.http +0 -1
- data/spec/fixtures.http/checkZoneRecordDistribution/failure.http +0 -1
- data/spec/fixtures.http/checkZoneRecordDistribution/success.http +0 -1
- data/spec/fixtures.http/createContact/created.http +0 -1
- data/spec/fixtures.http/createDelegationSignerRecord/created.http +0 -1
- data/spec/fixtures.http/createDelegationSignerRecord/validation-error.http +0 -1
- data/spec/fixtures.http/createDomain/created.http +20 -16
- data/spec/fixtures.http/createEmailForward/created.http +21 -17
- data/spec/fixtures.http/createPrimaryServer/created.http +21 -0
- data/spec/fixtures.http/createSecondaryZone/created.http +21 -0
- data/spec/fixtures.http/createTemplate/created.http +0 -1
- data/spec/fixtures.http/createTemplateRecord/created.http +0 -1
- data/spec/fixtures.http/createWebhook/created.http +0 -1
- data/spec/fixtures.http/createZoneRecord/created-apex.http +0 -1
- data/spec/fixtures.http/createZoneRecord/created.http +0 -1
- data/spec/fixtures.http/deleteContact/error-contact-in-use.http +18 -0
- data/spec/fixtures.http/deleteEmailForward/success.http +12 -7
- data/spec/fixtures.http/disableDnssec/not-enabled.http +0 -1
- data/spec/fixtures.http/disableWhoisPrivacy/success.http +0 -1
- data/spec/fixtures.http/downloadCertificate/success.http +0 -1
- data/spec/fixtures.http/enableDnssec/success.http +0 -1
- data/spec/fixtures.http/enableVanityNameServers/success.http +0 -1
- data/spec/fixtures.http/enableWhoisPrivacy/created.http +0 -1
- data/spec/fixtures.http/enableWhoisPrivacy/success.http +0 -1
- data/spec/fixtures.http/getCertificate/success.http +10 -11
- data/spec/fixtures.http/getCertificatePrivateKey/success.http +0 -1
- data/spec/fixtures.http/getContact/success.http +0 -1
- data/spec/fixtures.http/getDelegationSignerRecord/success.http +0 -1
- data/spec/fixtures.http/getDnssec/success.http +0 -1
- data/spec/fixtures.http/getDomain/success.http +13 -9
- data/spec/fixtures.http/getDomainDelegation/success-empty.http +0 -1
- data/spec/fixtures.http/getDomainDelegation/success.http +0 -1
- data/spec/fixtures.http/getDomainPremiumPrice/failure.http +0 -1
- data/spec/fixtures.http/getDomainPremiumPrice/success.http +0 -1
- data/spec/fixtures.http/getDomainPrices/failure.http +19 -0
- data/spec/fixtures.http/getDomainPrices/success.http +21 -0
- data/spec/fixtures.http/getDomainTransfer/success.http +20 -0
- data/spec/fixtures.http/getEmailForward/success.http +14 -10
- data/spec/fixtures.http/getPrimaryServer/success.http +21 -0
- data/spec/fixtures.http/getService/success.http +0 -1
- data/spec/fixtures.http/getTemplate/success.http +0 -1
- data/spec/fixtures.http/getTemplateRecord/success.http +0 -1
- data/spec/fixtures.http/getTld/success.http +0 -1
- data/spec/fixtures.http/getTldExtendedAttributes/success-attributes.http +0 -1
- data/spec/fixtures.http/getTldExtendedAttributes/success-noattributes.http +0 -1
- data/spec/fixtures.http/getTldExtendedAttributes/success.http +0 -1
- data/spec/fixtures.http/getWebhook/success.http +0 -1
- data/spec/fixtures.http/getWhoisPrivacy/success.http +0 -1
- data/spec/fixtures.http/getZone/success.http +0 -1
- data/spec/fixtures.http/getZoneFile/success.http +0 -1
- data/spec/fixtures.http/getZoneRecord/success.http +0 -1
- data/spec/fixtures.http/initiatePush/success.http +0 -1
- data/spec/fixtures.http/issueLetsencryptCertificate/success.http +18 -21
- data/spec/fixtures.http/issueRenewalLetsencryptCertificate/success.http +18 -21
- data/spec/fixtures.http/linkPrimaryServer/success.http +21 -0
- data/spec/fixtures.http/listAccounts/success-account.http +0 -1
- data/spec/fixtures.http/listAccounts/success-user.http +0 -1
- data/spec/fixtures.http/listCertificates/success.http +10 -11
- data/spec/fixtures.http/listCollaborators/success.http +0 -1
- data/spec/fixtures.http/listContacts/success.http +0 -1
- data/spec/fixtures.http/listDelegationSignerRecords/success.http +0 -1
- data/spec/fixtures.http/listDomains/success.http +20 -16
- data/spec/fixtures.http/listEmailForwards/success.http +0 -1
- data/spec/fixtures.http/listPrimaryServers/success.http +21 -0
- data/spec/fixtures.http/listPushes/success.http +0 -1
- data/spec/fixtures.http/listServices/success.http +0 -1
- data/spec/fixtures.http/listTemplateRecords/success.http +0 -1
- data/spec/fixtures.http/listTemplates/success.http +0 -1
- data/spec/fixtures.http/listTlds/success.http +0 -1
- data/spec/fixtures.http/listWebhooks/success.http +0 -1
- data/spec/fixtures.http/listZoneRecords/success.http +0 -1
- data/spec/fixtures.http/listZones/success.http +0 -1
- data/spec/fixtures.http/method-not-allowed.http +0 -1
- data/spec/fixtures.http/notfound-certificate.http +0 -1
- data/spec/fixtures.http/notfound-collaborator.http +0 -1
- data/spec/fixtures.http/notfound-contact.http +0 -1
- data/spec/fixtures.http/notfound-delegationsignerrecord.http +0 -1
- data/spec/fixtures.http/notfound-domain.http +0 -1
- data/spec/fixtures.http/notfound-domainpush.http +0 -1
- data/spec/fixtures.http/notfound-emailforward.http +0 -1
- data/spec/fixtures.http/notfound-record.http +0 -1
- data/spec/fixtures.http/notfound-template.http +0 -1
- data/spec/fixtures.http/notfound-webhook.http +0 -1
- data/spec/fixtures.http/notfound-whoisprivacy.http +0 -1
- data/spec/fixtures.http/notfound-zone.http +0 -1
- data/spec/fixtures.http/oauthAccessToken/error-invalid-request.http +0 -1
- data/spec/fixtures.http/oauthAccessToken/success.http +0 -1
- data/spec/fixtures.http/pages-1of3.http +0 -1
- data/spec/fixtures.http/pages-2of3.http +0 -1
- data/spec/fixtures.http/pages-3of3.http +0 -1
- data/spec/fixtures.http/purchaseLetsencryptCertificate/success.http +20 -21
- data/spec/fixtures.http/purchaseRenewalLetsencryptCertificate/success.http +20 -21
- data/spec/fixtures.http/registerDomain/success.http +1 -2
- data/spec/fixtures.http/renewDomain/error-tooearly.http +0 -1
- data/spec/fixtures.http/renewDomain/success.http +1 -2
- data/spec/fixtures.http/renewWhoisPrivacy/success.http +0 -1
- data/spec/fixtures.http/renewWhoisPrivacy/whois-privacy-duplicated-order.http +1 -2
- data/spec/fixtures.http/renewWhoisPrivacy/whois-privacy-not-found.http +1 -2
- data/spec/fixtures.http/response.http +0 -1
- data/spec/fixtures.http/transferDomain/error-indnsimple.http +0 -1
- data/spec/fixtures.http/transferDomain/error-missing-authcode.http +0 -1
- data/spec/fixtures.http/transferDomain/success.http +1 -2
- data/spec/fixtures.http/unlinkPrimaryServer/success.http +21 -0
- data/spec/fixtures.http/updateContact/success.http +0 -1
- data/spec/fixtures.http/updateTemplate/success.http +0 -1
- data/spec/fixtures.http/updateZoneRecord/success.http +0 -1
- data/spec/fixtures.http/validation-error.http +0 -1
- data/spec/fixtures.http/whoami/success-account.http +0 -1
- data/spec/fixtures.http/whoami/success-user.http +0 -1
- data/spec/fixtures.http/whoami/success.http +0 -1
- data/spec/spec_helper.rb +3 -1
- data/spec/support/helpers.rb +2 -0
- data/spec/support/webmock.rb +2 -0
- metadata +36 -15
- data/.ruby-gemset +0 -1
- data/spec/fixtures.http/resetDomainToken/success.http +0 -17
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
class Client
|
3
5
|
module RegistrarWhoisPrivacy
|
@@ -76,7 +78,7 @@ module Dnsimple
|
|
76
78
|
#
|
77
79
|
# @raise [RequestError] When the request fails.
|
78
80
|
def renew_whois_privacy(account_id, domain_name, options = {})
|
79
|
-
endpoint = whois_privacy_endpoint(account_id, domain_name)
|
81
|
+
endpoint = "#{whois_privacy_endpoint(account_id, domain_name)}/renewals"
|
80
82
|
response = client.post(endpoint, nil, options)
|
81
83
|
|
82
84
|
Dnsimple::Response.new(response, Struct::WhoisPrivacyRenewal.new(response["data"]))
|
data/lib/dnsimple/client/tlds.rb
CHANGED
@@ -1,17 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
class Client
|
3
5
|
module VanityNameServers
|
4
6
|
|
5
7
|
# Enable vanity name servers for the domain.
|
6
8
|
#
|
7
|
-
# @see https://developer.dnsimple.com/v2/vanity/#
|
9
|
+
# @see https://developer.dnsimple.com/v2/vanity/#enableVanityNameServers
|
8
10
|
#
|
9
11
|
# @example Enable vanity name servers for example.com:
|
10
|
-
# client.vanity_name_servers.
|
12
|
+
# client.vanity_name_servers.enable_vanity_name_servers(1010, "example.com")
|
11
13
|
#
|
12
|
-
# @param [Integer]
|
13
|
-
# @param [#to_s]
|
14
|
-
# @param [Hash]
|
14
|
+
# @param account_id [Integer] the account ID
|
15
|
+
# @param domain_name [#to_s] the domain name
|
16
|
+
# @param options [Hash]
|
15
17
|
# @return [Dnsimple::Response<Array>]
|
16
18
|
#
|
17
19
|
# @raise [RequestError] When the request fails.
|
@@ -24,14 +26,14 @@ module Dnsimple
|
|
24
26
|
|
25
27
|
# Disable vanity name servers for the domain.
|
26
28
|
#
|
27
|
-
# @see https://developer.dnsimple.com/v2/vanity/#
|
29
|
+
# @see https://developer.dnsimple.com/v2/vanity/#disableVanityNameServers
|
28
30
|
#
|
29
31
|
# @example Disable vanity name servers for example.com:
|
30
|
-
# client.vanity_name_servers.
|
32
|
+
# client.vanity_name_servers.disable_vanity_name_servers(1010, "example.com")
|
31
33
|
#
|
32
|
-
# @param [Integer]
|
33
|
-
# @param [#to_s]
|
34
|
-
# @param [Hash]
|
34
|
+
# @param account_id [Integer] the account ID
|
35
|
+
# @param domain_name [#to_s] the domain name
|
36
|
+
# @param options [Hash]
|
35
37
|
# @return [Dnsimple::Response<nil>]
|
36
38
|
#
|
37
39
|
# @raise [RequestError] When the request fails.
|
data/lib/dnsimple/default.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
|
3
5
|
# Default configuration options for {Client}
|
4
6
|
module Default
|
5
7
|
|
6
8
|
# Default API endpoint
|
7
|
-
BASE_URL = "https://api.dnsimple.com/"
|
9
|
+
BASE_URL = "https://api.dnsimple.com/"
|
8
10
|
|
9
11
|
# Default User Agent header
|
10
|
-
USER_AGENT = "dnsimple-ruby/#{VERSION}"
|
12
|
+
USER_AGENT = "dnsimple-ruby/#{VERSION}"
|
11
13
|
|
12
14
|
class << self
|
13
15
|
|
@@ -15,20 +17,20 @@ module Dnsimple
|
|
15
17
|
# @return [Array] of option keys
|
16
18
|
def keys
|
17
19
|
@keys ||= [
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
:base_url,
|
21
|
+
:username,
|
22
|
+
:password,
|
23
|
+
:access_token,
|
24
|
+
:domain_api_token,
|
25
|
+
:user_agent,
|
26
|
+
:proxy,
|
25
27
|
]
|
26
28
|
end
|
27
29
|
|
28
30
|
# Configuration options
|
29
31
|
# @return [Hash]
|
30
32
|
def options
|
31
|
-
|
33
|
+
keys.map { |key| [key, send(key)] }.to_h
|
32
34
|
end
|
33
35
|
|
34
36
|
# Default API endpoint from ENV or {BASE_URL}
|
data/lib/dnsimple/error.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
|
3
5
|
class Error < StandardError
|
@@ -16,7 +18,7 @@ module Dnsimple
|
|
16
18
|
|
17
19
|
def message_from(http_response)
|
18
20
|
content_type = http_response.headers["Content-Type"]
|
19
|
-
if content_type
|
21
|
+
if content_type&.start_with?("application/json")
|
20
22
|
http_response.parsed_response["message"]
|
21
23
|
else
|
22
24
|
net_http_response = http_response.response
|
data/lib/dnsimple/extra.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
module Extra
|
3
5
|
|
@@ -34,7 +36,7 @@ module Dnsimple
|
|
34
36
|
this[current_key] = if this_value.is_a?(Hash) && other_value.is_a?(Hash)
|
35
37
|
deep_merge(this_value, other_value, &block)
|
36
38
|
else
|
37
|
-
if
|
39
|
+
if block && key?(current_key)
|
38
40
|
block.call(current_key, this_value, other_value)
|
39
41
|
else
|
40
42
|
other_value
|
@@ -53,7 +55,7 @@ module Dnsimple
|
|
53
55
|
# @raise [ArgumentError]
|
54
56
|
def self.validate_mandatory_attributes(attributes, required)
|
55
57
|
required.each do |name|
|
56
|
-
attributes
|
58
|
+
attributes&.key?(name) or raise(ArgumentError, ":#{name} is required")
|
57
59
|
end
|
58
60
|
end
|
59
61
|
|
data/lib/dnsimple/options.rb
CHANGED
data/lib/dnsimple/response.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
|
3
5
|
# The Response represents a response returned by a client request.
|
@@ -39,9 +41,7 @@ module Dnsimple
|
|
39
41
|
|
40
42
|
# The CollectionResponse is a specific type of Response where the data is a collection of enumerable objects.
|
41
43
|
class CollectionResponse < Response
|
42
|
-
|
43
|
-
super
|
44
|
-
end
|
44
|
+
|
45
45
|
end
|
46
46
|
|
47
47
|
# The PaginatedResponse is a specific type of Response that also exposes pagination metadata.
|
@@ -69,10 +69,10 @@ module Dnsimple
|
|
69
69
|
super
|
70
70
|
|
71
71
|
pagination = http_response["pagination"]
|
72
|
-
@page
|
73
|
-
@per_page
|
74
|
-
@total_entries
|
75
|
-
@total_pages
|
72
|
+
@page = pagination["current_page"]
|
73
|
+
@per_page = pagination["per_page"]
|
74
|
+
@total_entries = pagination["total_entries"]
|
75
|
+
@total_pages = pagination["total_pages"]
|
76
76
|
end
|
77
77
|
|
78
78
|
end
|
data/lib/dnsimple/struct.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
module Struct
|
3
5
|
|
@@ -25,6 +27,7 @@ require_relative 'struct/dnssec'
|
|
25
27
|
require_relative 'struct/domain'
|
26
28
|
require_relative 'struct/domain_check'
|
27
29
|
require_relative 'struct/domain_premium_price'
|
30
|
+
require_relative 'struct/domain_price'
|
28
31
|
require_relative 'struct/domain_push'
|
29
32
|
require_relative 'struct/domain_registration'
|
30
33
|
require_relative 'struct/domain_transfer'
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
module Struct
|
3
5
|
|
@@ -38,8 +40,8 @@ module Dnsimple
|
|
38
40
|
# @return [String] When the certificate was last updated in DNSimple.
|
39
41
|
attr_accessor :updated_at
|
40
42
|
|
41
|
-
# @return [String]
|
42
|
-
attr_accessor :
|
43
|
+
# @return [String] The timestamp when the certificate will expire.
|
44
|
+
attr_accessor :expires_at
|
43
45
|
end
|
44
46
|
|
45
47
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
module Struct
|
3
5
|
|
@@ -8,14 +10,17 @@ module Dnsimple
|
|
8
10
|
|
9
11
|
# @return [String] The server certificate
|
10
12
|
attr_accessor :server
|
13
|
+
|
11
14
|
alias server_certificate server
|
12
15
|
|
13
16
|
# @return [String] The root certificate
|
14
17
|
attr_accessor :root
|
18
|
+
|
15
19
|
alias root_certificate root
|
16
20
|
|
17
21
|
# @return [Array<String>] Intermediate certificates
|
18
22
|
attr_accessor :chain
|
23
|
+
|
19
24
|
alias intermediate_certificates chain
|
20
25
|
|
21
26
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
module Struct
|
3
5
|
|
@@ -26,8 +28,8 @@ module Dnsimple
|
|
26
28
|
# @return [Bool] True if the domain WHOIS privacy is enabled, false otherwise.
|
27
29
|
attr_accessor :private_whois
|
28
30
|
|
29
|
-
# @return [String] The
|
30
|
-
attr_accessor :
|
31
|
+
# @return [String] The timestamp when domain will expire.
|
32
|
+
attr_accessor :expires_at
|
31
33
|
|
32
34
|
# @return [String] When the domain was created in DNSimple.
|
33
35
|
attr_accessor :created_at
|
@@ -35,6 +37,5 @@ module Dnsimple
|
|
35
37
|
# @return [String] When the domain was last updated in DNSimple.
|
36
38
|
attr_accessor :updated_at
|
37
39
|
end
|
38
|
-
|
39
40
|
end
|
40
41
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dnsimple
|
4
|
+
module Struct
|
5
|
+
|
6
|
+
class DomainPrice < Base
|
7
|
+
# @return [String] The domain name
|
8
|
+
attr_accessor :domain
|
9
|
+
|
10
|
+
# @return [Boolean] Whether the domain is premium.
|
11
|
+
attr_accessor :premium
|
12
|
+
|
13
|
+
# @return [Float] The price for registration
|
14
|
+
attr_accessor :registration_price
|
15
|
+
|
16
|
+
# @return [Float] The price for renewal
|
17
|
+
attr_accessor :renewal_price
|
18
|
+
|
19
|
+
# @return [Float] The price for transfer
|
20
|
+
attr_accessor :transfer_price
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|