dnsimple 4.3.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.dependabot/config.yml +9 -0
- data/.rubocop.yml +7 -0
- data/.rubocop_dnsimple.yml +136 -45
- data/.travis.yml +13 -9
- data/CHANGELOG.md +57 -23
- data/CONTRIBUTING.md +55 -7
- data/Gemfile +4 -1
- data/LICENSE.txt +1 -1
- data/README.md +8 -6
- data/dnsimple.gemspec +3 -3
- data/lib/dnsimple.rb +2 -0
- data/lib/dnsimple/client.rb +12 -10
- data/lib/dnsimple/client/accounts.rb +2 -1
- data/lib/dnsimple/client/certificates.rb +188 -28
- data/lib/dnsimple/client/clients.rb +6 -2
- data/lib/dnsimple/client/contacts.rb +2 -5
- data/lib/dnsimple/client/domains.rb +3 -5
- data/lib/dnsimple/client/{collaborators.rb → domains_collaborators.rb} +3 -1
- 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 +51 -5
- data/lib/dnsimple/client/registrar_auto_renewal.rb +2 -0
- data/lib/dnsimple/client/registrar_delegation.rb +6 -4
- data/lib/dnsimple/client/registrar_whois_privacy.rb +23 -1
- data/lib/dnsimple/client/services.rb +2 -2
- 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 +16 -17
- data/lib/dnsimple/client/vanity_name_servers.rb +12 -10
- data/lib/dnsimple/client/webhooks.rb +2 -3
- data/lib/dnsimple/client/zones.rb +2 -1
- data/lib/dnsimple/client/zones_distributions.rb +49 -0
- data/lib/dnsimple/client/zones_records.rb +25 -28
- data/lib/dnsimple/default.rb +11 -9
- data/lib/dnsimple/error.rb +2 -0
- data/lib/dnsimple/extra.rb +2 -0
- data/lib/dnsimple/options.rb +2 -0
- data/lib/dnsimple/response.rb +6 -4
- data/lib/dnsimple/struct.rb +7 -0
- data/lib/dnsimple/struct/account.rb +2 -0
- data/lib/dnsimple/struct/certificate.rb +11 -0
- data/lib/dnsimple/struct/certificate_bundle.rb +5 -0
- data/lib/dnsimple/struct/certificate_purchase.rb +27 -0
- data/lib/dnsimple/struct/certificate_renewal.rb +30 -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 +24 -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_push.rb +2 -0
- data/lib/dnsimple/struct/domain_registration.rb +2 -3
- data/lib/dnsimple/struct/domain_renewal.rb +2 -3
- data/lib/dnsimple/struct/domain_transfer.rb +4 -2
- data/lib/dnsimple/struct/email_forward.rb +2 -0
- data/lib/dnsimple/struct/extended_attribute.rb +3 -1
- data/lib/dnsimple/struct/oauth_token.rb +2 -0
- data/lib/dnsimple/struct/service.rb +3 -1
- 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 +27 -0
- data/lib/dnsimple/struct/webhook.rb +2 -0
- data/lib/dnsimple/struct/whoami.rb +4 -2
- data/lib/dnsimple/struct/whois_privacy.rb +2 -0
- data/lib/dnsimple/struct/whois_privacy_renewal.rb +30 -0
- data/lib/dnsimple/struct/zone.rb +2 -0
- data/lib/dnsimple/struct/zone_distribution.rb +13 -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 +227 -1
- data/spec/dnsimple/client/client_service_spec.rb +2 -0
- data/spec/dnsimple/client/contacts_spec.rb +3 -1
- data/spec/dnsimple/client/{collaborators_spec.rb → domains_collaborators_spec.rb} +3 -1
- data/spec/dnsimple/client/domains_delegation_signer_records_spec.rb +3 -1
- data/spec/dnsimple/client/domains_dnssec_spec.rb +4 -2
- data/spec/dnsimple/client/domains_email_forwards_spec.rb +3 -1
- data/spec/dnsimple/client/domains_pushes_spec.rb +3 -1
- data/spec/dnsimple/client/domains_spec.rb +19 -16
- 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 +5 -2
- data/spec/dnsimple/client/registrar_spec.rb +73 -4
- data/spec/dnsimple/client/registrar_whois_privacy_spec.rb +60 -3
- data/spec/dnsimple/client/services_domains_spec.rb +2 -0
- data/spec/dnsimple/client/services_spec.rb +3 -1
- data/spec/dnsimple/client/templates_domains_spec.rb +2 -0
- data/spec/dnsimple/client/templates_records_spec.rb +2 -0
- data/spec/dnsimple/client/templates_spec.rb +2 -0
- data/spec/dnsimple/client/tlds_spec.rb +22 -19
- data/spec/dnsimple/client/vanity_name_servers_spec.rb +2 -0
- data/spec/dnsimple/client/webhooks_spec.rb +2 -0
- data/spec/dnsimple/client/zones_distributions_spec.rb +137 -0
- data/spec/dnsimple/client/zones_records_spec.rb +37 -35
- data/spec/dnsimple/client/zones_spec.rb +4 -2
- data/spec/dnsimple/client_spec.rb +8 -6
- 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 +2 -0
- data/spec/fixtures.http/{transferDomainOut → authorizeDomainTransferOut}/success.http +0 -0
- data/spec/fixtures.http/cancelDomainTransfer/success.http +19 -0
- data/spec/fixtures.http/checkZoneDistribution/error.http +21 -0
- data/spec/fixtures.http/checkZoneDistribution/failure.http +21 -0
- data/spec/fixtures.http/checkZoneDistribution/success.http +21 -0
- data/spec/fixtures.http/checkZoneRecordDistribution/error.http +21 -0
- data/spec/fixtures.http/checkZoneRecordDistribution/failure.http +21 -0
- data/spec/fixtures.http/checkZoneRecordDistribution/success.http +21 -0
- data/spec/fixtures.http/createDomain/created.http +21 -16
- data/spec/fixtures.http/getCertificate/success.http +1 -1
- data/spec/fixtures.http/getDomain/success.http +14 -9
- data/spec/fixtures.http/getDomainTransfer/success.http +21 -0
- data/spec/fixtures.http/issueLetsencryptCertificate/success.http +21 -0
- data/spec/fixtures.http/issueRenewalLetsencryptCertificate/success.http +21 -0
- data/spec/fixtures.http/listCertificates/success.http +1 -1
- data/spec/fixtures.http/listDomains/success.http +21 -16
- data/spec/fixtures.http/purchaseLetsencryptCertificate/success.http +21 -0
- data/spec/fixtures.http/purchaseRenewalLetsencryptCertificate/success.http +21 -0
- data/spec/fixtures.http/registerDomain/success.http +2 -2
- data/spec/fixtures.http/renewDomain/success.http +2 -2
- data/spec/fixtures.http/renewWhoisPrivacy/success.http +21 -0
- data/spec/fixtures.http/renewWhoisPrivacy/whois-privacy-duplicated-order.http +19 -0
- data/spec/fixtures.http/renewWhoisPrivacy/whois-privacy-not-found.http +19 -0
- data/spec/fixtures.http/transferDomain/success.http +2 -2
- data/spec/fixtures.http/whoami/success-account.http +1 -1
- data/spec/fixtures.http/whoami/success-user.http +1 -1
- data/spec/fixtures.http/whoami/success.http +1 -1
- data/spec/spec_helper.rb +4 -2
- data/spec/support/helpers.rb +2 -0
- data/spec/support/webmock.rb +2 -0
- metadata +50 -19
- data/.ruby-gemset +0 -1
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
class Client
|
3
5
|
|
@@ -137,7 +139,7 @@ module Dnsimple
|
|
137
139
|
require_relative 'domains_dnssec'
|
138
140
|
require_relative 'domains_email_forwards'
|
139
141
|
require_relative 'domains_pushes'
|
140
|
-
require_relative '
|
142
|
+
require_relative 'domains_collaborators'
|
141
143
|
|
142
144
|
class DomainsService < ClientService
|
143
145
|
include Client::Domains
|
@@ -145,7 +147,7 @@ module Dnsimple
|
|
145
147
|
include Client::DomainsDnssec
|
146
148
|
include Client::DomainsEmailForwards
|
147
149
|
include Client::DomainsPushes
|
148
|
-
include Client::
|
150
|
+
include Client::DomainsCollaborators
|
149
151
|
end
|
150
152
|
|
151
153
|
|
@@ -212,10 +214,12 @@ module Dnsimple
|
|
212
214
|
|
213
215
|
require_relative 'zones'
|
214
216
|
require_relative 'zones_records'
|
217
|
+
require_relative 'zones_distributions'
|
215
218
|
|
216
219
|
class ZonesService < ClientService
|
217
220
|
include Client::Zones
|
218
221
|
include Client::ZonesRecords
|
222
|
+
include Client::ZonesDistributions
|
219
223
|
end
|
220
224
|
|
221
225
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
class Client
|
3
5
|
module Contacts
|
@@ -29,7 +31,6 @@ module Dnsimple
|
|
29
31
|
|
30
32
|
Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Contact.new(r) })
|
31
33
|
end
|
32
|
-
alias list contacts
|
33
34
|
alias list_contacts contacts
|
34
35
|
|
35
36
|
# Lists ALL the contacts in the account.
|
@@ -54,7 +55,6 @@ module Dnsimple
|
|
54
55
|
def all_contacts(account_id, options = {})
|
55
56
|
paginate(:contacts, account_id, options)
|
56
57
|
end
|
57
|
-
alias all all_contacts
|
58
58
|
|
59
59
|
# Creates a contact in the account.
|
60
60
|
#
|
@@ -72,7 +72,6 @@ module Dnsimple
|
|
72
72
|
|
73
73
|
Dnsimple::Response.new(response, Struct::Contact.new(response["data"]))
|
74
74
|
end
|
75
|
-
alias create create_contact
|
76
75
|
|
77
76
|
# Gets a contact from the account.
|
78
77
|
#
|
@@ -107,7 +106,6 @@ module Dnsimple
|
|
107
106
|
|
108
107
|
Dnsimple::Response.new(response, Struct::Contact.new(response["data"]))
|
109
108
|
end
|
110
|
-
alias update update_contact
|
111
109
|
|
112
110
|
# Deletes a contact from the account.
|
113
111
|
#
|
@@ -127,7 +125,6 @@ module Dnsimple
|
|
127
125
|
|
128
126
|
Dnsimple::Response.new(response, nil)
|
129
127
|
end
|
130
|
-
alias delete delete_contact
|
131
128
|
|
132
129
|
end
|
133
130
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
class Client
|
3
5
|
module Domains
|
@@ -14,7 +16,7 @@ module Dnsimple
|
|
14
16
|
# client.domains.list(1010, page: 2)
|
15
17
|
#
|
16
18
|
# @example List domains, provide a sorting policy
|
17
|
-
# client.domains.list(1010, sort: "
|
19
|
+
# client.domains.list(1010, sort: "expiration:asc")
|
18
20
|
#
|
19
21
|
# @example List domains, provide a filtering policy
|
20
22
|
# client.domains.list(1010, filter: { name_like: "example" })
|
@@ -33,7 +35,6 @@ module Dnsimple
|
|
33
35
|
|
34
36
|
Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Domain.new(r) })
|
35
37
|
end
|
36
|
-
alias list domains
|
37
38
|
alias list_domains domains
|
38
39
|
|
39
40
|
# Lists ALL the domains in the account.
|
@@ -59,7 +60,6 @@ module Dnsimple
|
|
59
60
|
def all_domains(account_id, options = {})
|
60
61
|
paginate(:domains, account_id, options)
|
61
62
|
end
|
62
|
-
alias all all_domains
|
63
63
|
|
64
64
|
# Creates a domain in the account.
|
65
65
|
#
|
@@ -78,7 +78,6 @@ module Dnsimple
|
|
78
78
|
|
79
79
|
Dnsimple::Response.new(response, Struct::Domain.new(response["data"]))
|
80
80
|
end
|
81
|
-
alias create create_domain
|
82
81
|
|
83
82
|
# Gets a domain from the account.
|
84
83
|
#
|
@@ -115,7 +114,6 @@ module Dnsimple
|
|
115
114
|
|
116
115
|
Dnsimple::Response.new(response, nil)
|
117
116
|
end
|
118
|
-
alias delete delete_domain
|
119
117
|
|
120
118
|
# Resets the domain token.
|
121
119
|
#
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
class Client
|
3
5
|
module Registrar
|
@@ -7,7 +9,7 @@ module Dnsimple
|
|
7
9
|
# @see https://developer.dnsimple.com/v2/registrar/#check
|
8
10
|
#
|
9
11
|
# @example Check whether example.com is available:
|
10
|
-
# client.registrar.
|
12
|
+
# client.registrar.check_domain(1010, "example.com")
|
11
13
|
#
|
12
14
|
# @param [Integer] account_id the account ID
|
13
15
|
# @param [#to_s] domain_name the domain name to check
|
@@ -54,7 +56,7 @@ module Dnsimple
|
|
54
56
|
#
|
55
57
|
# @example Initiate the registration of example.com using the contact 1234 as registrant
|
56
58
|
# including WHOIS privacy for the domain and enabling auto renewal:
|
57
|
-
# client.registrar.
|
59
|
+
# client.registrar.register_domain(1010, "example.com", registrant_id: 1234, private_whois: true, auto_renew: true)
|
58
60
|
#
|
59
61
|
# @param [Integer] account_id the account ID
|
60
62
|
# @param [#to_s] domain_name the domain name to register
|
@@ -76,7 +78,7 @@ module Dnsimple
|
|
76
78
|
# @see https://developer.dnsimple.com/v2/registrar/#renew
|
77
79
|
#
|
78
80
|
# @example Renew example.com for 3 years:
|
79
|
-
# client.registrar.
|
81
|
+
# client.registrar.renew_domain(1010, "example.com", period: 3)
|
80
82
|
#
|
81
83
|
# @param [Integer] account_id the account ID
|
82
84
|
# @param [#to_s] domain_name the domain name to renew
|
@@ -97,7 +99,7 @@ module Dnsimple
|
|
97
99
|
# @see https://developer.dnsimple.com/v2/registrar/#transfer
|
98
100
|
#
|
99
101
|
# @example Initiate the transfer for example.com using the contact 1234 as registrant:
|
100
|
-
# client.registrar.
|
102
|
+
# client.registrar.transfer_domain(1010, "example.com", registrant_id: 1234, auth_code: "x1y2z3")
|
101
103
|
#
|
102
104
|
# @param [Integer] account_id the account ID
|
103
105
|
# @param [#to_s] domain_name the domain name to transfer
|
@@ -114,12 +116,56 @@ module Dnsimple
|
|
114
116
|
Dnsimple::Response.new(response, Struct::DomainTransfer.new(response["data"]))
|
115
117
|
end
|
116
118
|
|
119
|
+
# Retrieves the details of an existing domain transfer.
|
120
|
+
#
|
121
|
+
# @see https://developer.dnsimple.com/v2/registrar/#getDomainTransfer
|
122
|
+
#
|
123
|
+
# @example Retrieve the transfer 42 for example.com:
|
124
|
+
# client.registrar.get_domain_transfer(1010, "example.com", 42)
|
125
|
+
#
|
126
|
+
# @param [Integer] account_id the account ID
|
127
|
+
# @param [#to_s] domain_name the domain name
|
128
|
+
# @param [Integer] domain_transfer_id the domain transfer ID
|
129
|
+
# @param [Hash] options
|
130
|
+
# @return [Struct::DomainTransfer]
|
131
|
+
#
|
132
|
+
# @raise [NotFoundError] When record is not found.
|
133
|
+
# @raise [RequestError] When the request fails.
|
134
|
+
def get_domain_transfer(account_id, domain_name, domain_transfer_id, options = {})
|
135
|
+
endpoint = Client.versioned("/%s/registrar/domains/%s/transfers/%s" % [account_id, domain_name, domain_transfer_id])
|
136
|
+
response = client.get(endpoint, options)
|
137
|
+
|
138
|
+
Dnsimple::Response.new(response, Struct::DomainTransfer.new(response["data"]))
|
139
|
+
end
|
140
|
+
|
141
|
+
# Cancels an in progress domain transfer.
|
142
|
+
#
|
143
|
+
# @see https://developer.dnsimple.com/v2/registrar/#cancelDomainTransfer
|
144
|
+
#
|
145
|
+
# @example Cancel the transfer 42 for example.com:
|
146
|
+
# client.registrar.cancel_domain_transfer(1010, "example.com", 42)
|
147
|
+
#
|
148
|
+
# @param [Integer] account_id the account ID
|
149
|
+
# @param [#to_s] domain_name the domain name
|
150
|
+
# @param [Integer] domain_transfer_id the domain transfer ID
|
151
|
+
# @param [Hash] options
|
152
|
+
# @return [Struct::DomainTransfer]
|
153
|
+
#
|
154
|
+
# @raise [NotFoundError] When record is not found.
|
155
|
+
# @raise [RequestError] When the request fails.
|
156
|
+
def cancel_domain_transfer(account_id, domain_name, domain_transfer_id, options = {})
|
157
|
+
endpoint = Client.versioned("/%s/registrar/domains/%s/transfers/%s" % [account_id, domain_name, domain_transfer_id])
|
158
|
+
response = client.delete(endpoint, options)
|
159
|
+
|
160
|
+
Dnsimple::Response.new(response, Struct::DomainTransfer.new(response["data"]))
|
161
|
+
end
|
162
|
+
|
117
163
|
# Requests the transfer of a domain out of DNSimple.
|
118
164
|
#
|
119
165
|
# @see https://developer.dnsimple.com/v2/registrar/#transfer-out
|
120
166
|
#
|
121
167
|
# @example Request to transfer of example.com out of DNSimple:
|
122
|
-
# client.registrar.
|
168
|
+
# client.registrar.transfer_domain_out(1010, "example.com")
|
123
169
|
#
|
124
170
|
# @param [Integer] account_id the account ID
|
125
171
|
# @param [#to_s] domain_name the domain name to transfer out
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
class Client
|
3
5
|
module RegistrarDelegation
|
@@ -56,19 +58,19 @@ module Dnsimple
|
|
56
58
|
# @param [#to_s] domain_name the domain name to check
|
57
59
|
# @param [Array] attributes
|
58
60
|
# @param [Hash] options
|
59
|
-
# @return [Dnsimple::Response<Array
|
61
|
+
# @return [Dnsimple::Response<Array<Dnsimple::Struct::VanityNameServer>>]
|
60
62
|
#
|
61
63
|
# @raise [RequestError] When the request fails.
|
62
64
|
def change_domain_delegation_to_vanity(account_id, domain_name, attributes, options = {})
|
63
65
|
endpoint = Client.versioned("/%s/registrar/domains/%s/delegation/vanity" % [account_id, domain_name])
|
64
66
|
response = client.put(endpoint, attributes, options)
|
65
67
|
|
66
|
-
Dnsimple::Response.new(response, response["data"])
|
68
|
+
Dnsimple::Response.new(response, response["data"].map { |r| Struct::VanityNameServer.new(r) })
|
67
69
|
end
|
68
70
|
|
69
71
|
# Disable vanity name servers for the domain.
|
70
72
|
#
|
71
|
-
# @see https://developer.dnsimple.com/v2/registrar/delegation/#
|
73
|
+
# @see https://developer.dnsimple.com/v2/registrar/delegation/#dedelegateFromVanity
|
72
74
|
#
|
73
75
|
# @example Disable vanity name servers for example.com:
|
74
76
|
# client.registrar.change_domain_delegation_from_vanity(1010, "example.com")
|
@@ -83,7 +85,7 @@ module Dnsimple
|
|
83
85
|
endpoint = Client.versioned("/%s/registrar/domains/%s/delegation/vanity" % [account_id, domain_name])
|
84
86
|
response = client.delete(endpoint, options)
|
85
87
|
|
86
|
-
Dnsimple::Response.new(response,
|
88
|
+
Dnsimple::Response.new(response, nil)
|
87
89
|
end
|
88
90
|
|
89
91
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
class Client
|
3
5
|
module RegistrarWhoisPrivacy
|
@@ -50,7 +52,7 @@ module Dnsimple
|
|
50
52
|
# client.registrar.disable_whois_privacy(1010, "example.com")
|
51
53
|
#
|
52
54
|
# @param [Integer] account_id the account ID
|
53
|
-
# @param [#to_s] domain_name The domain name
|
55
|
+
# @param [#to_s] domain_name The domain name
|
54
56
|
# @param [Hash] options
|
55
57
|
# @return [Struct::WhoisPrivacy]
|
56
58
|
#
|
@@ -62,6 +64,26 @@ module Dnsimple
|
|
62
64
|
Dnsimple::Response.new(response, Struct::WhoisPrivacy.new(response["data"]))
|
63
65
|
end
|
64
66
|
|
67
|
+
# Renews whois privacy for the domain.
|
68
|
+
#
|
69
|
+
# @see https://developer.dnsimple.com/v2/registrar/whois-privacy/#renew
|
70
|
+
#
|
71
|
+
# @example Renew whois privacy for "example.com":
|
72
|
+
# client.registrar.renew_whois_privacy(1010, "example.com")
|
73
|
+
#
|
74
|
+
# @param account_id [Integer] the account ID
|
75
|
+
# @param domain_name [#to_s] The domain name
|
76
|
+
# @param options [Hash]
|
77
|
+
# @return [Struct::WhoisPrivacy]
|
78
|
+
#
|
79
|
+
# @raise [RequestError] When the request fails.
|
80
|
+
def renew_whois_privacy(account_id, domain_name, options = {})
|
81
|
+
endpoint = whois_privacy_endpoint(account_id, domain_name) + "/renewals"
|
82
|
+
response = client.post(endpoint, nil, options)
|
83
|
+
|
84
|
+
Dnsimple::Response.new(response, Struct::WhoisPrivacyRenewal.new(response["data"]))
|
85
|
+
end
|
86
|
+
|
65
87
|
|
66
88
|
private
|
67
89
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
class Client
|
3
5
|
module Services
|
@@ -28,7 +30,6 @@ module Dnsimple
|
|
28
30
|
|
29
31
|
Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Service.new(r) })
|
30
32
|
end
|
31
|
-
alias list services
|
32
33
|
alias list_services services
|
33
34
|
|
34
35
|
# Lists ALL the available one-click services.
|
@@ -55,7 +56,6 @@ module Dnsimple
|
|
55
56
|
def all_services(options = {})
|
56
57
|
paginate(:services, options)
|
57
58
|
end
|
58
|
-
alias all all_services
|
59
59
|
|
60
60
|
# Gets the service with specified ID.
|
61
61
|
#
|
data/lib/dnsimple/client/tlds.rb
CHANGED
@@ -1,18 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
class Client
|
3
5
|
module Tlds
|
4
|
-
# Lists the
|
6
|
+
# Lists the TLDs available for registration
|
5
7
|
#
|
6
|
-
# @see https://developer.dnsimple.com/v2/tlds/#
|
8
|
+
# @see https://developer.dnsimple.com/v2/tlds/#listTlds
|
7
9
|
#
|
8
10
|
# @example List TLDs in the first page
|
9
|
-
# client.tlds.
|
11
|
+
# client.tlds.list_tlds
|
10
12
|
#
|
11
13
|
# @example List TLDs, providing a specific page
|
12
|
-
# client.tlds.
|
14
|
+
# client.tlds.list_tlds(page: 2)
|
13
15
|
#
|
14
16
|
# @example List TLDs, providing sorting policy
|
15
|
-
# client.tlds.
|
17
|
+
# client.tlds.list_tlds(sort: "tld:asc")
|
16
18
|
#
|
17
19
|
# @param [Hash] options the filtering and sorting options
|
18
20
|
# @option options [Integer] :page current page (pagination)
|
@@ -21,13 +23,11 @@ module Dnsimple
|
|
21
23
|
# @return [Dnsimple::PaginatedResponse<Dnsimple::Struct::Tld>]
|
22
24
|
#
|
23
25
|
# @raise [Dnsimple::RequestError]
|
24
|
-
def
|
26
|
+
def list_tlds(options = {})
|
25
27
|
response = client.get(Client.versioned("/tlds"), Options::ListOptions.new(options))
|
26
28
|
|
27
29
|
Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Tld.new(r) })
|
28
30
|
end
|
29
|
-
alias list tlds
|
30
|
-
alias list_tlds tlds
|
31
31
|
|
32
32
|
# Lists ALL the TLDs in DNSimple.
|
33
33
|
#
|
@@ -37,8 +37,8 @@ module Dnsimple
|
|
37
37
|
# Please use this method carefully, as fetching the entire collection will increase the number of requests
|
38
38
|
# you send to the API server and you may eventually risk to hit the throttle limit.
|
39
39
|
#
|
40
|
-
# @see https://developer.dnsimple.com/v2/tlds/#
|
41
|
-
# @see #
|
40
|
+
# @see https://developer.dnsimple.com/v2/tlds/#listTlds
|
41
|
+
# @see #list_tlds
|
42
42
|
#
|
43
43
|
# @example List all TLDs in DNSimple
|
44
44
|
# client.tlds.all
|
@@ -51,13 +51,12 @@ module Dnsimple
|
|
51
51
|
#
|
52
52
|
# @raise [Dnsimple::RequestError]
|
53
53
|
def all_tlds(options = {})
|
54
|
-
paginate(:
|
54
|
+
paginate(:list_tlds, options)
|
55
55
|
end
|
56
|
-
alias all all_tlds
|
57
56
|
|
58
|
-
# Gets a TLD
|
57
|
+
# Gets a TLD details
|
59
58
|
#
|
60
|
-
# @see https://developer.dnsimple.com/v2/tlds/#
|
59
|
+
# @see https://developer.dnsimple.com/v2/tlds/#getTld
|
61
60
|
#
|
62
61
|
# @example Get information on a specific TLD
|
63
62
|
# client.tlds.tld('com')
|
@@ -76,10 +75,10 @@ module Dnsimple
|
|
76
75
|
|
77
76
|
# Gets the extended attributes for a TLD.
|
78
77
|
#
|
79
|
-
# @see https://developer.dnsimple.com/v2/tlds/#
|
78
|
+
# @see https://developer.dnsimple.com/v2/tlds/#getTldExtendedAttributes
|
80
79
|
#
|
81
80
|
# @example Get extended attributes for a specific TLD
|
82
|
-
# client.tlds.
|
81
|
+
# client.tlds.tld_extended_attributes('uk')
|
83
82
|
#
|
84
83
|
# @param [#to_s] tld The TLD name.
|
85
84
|
# @param [Hash] options
|
@@ -87,7 +86,7 @@ module Dnsimple
|
|
87
86
|
#
|
88
87
|
# @raise [Dnsimple::NotFoundError]
|
89
88
|
# @raise [Dnsimple::RequestError]
|
90
|
-
def
|
89
|
+
def tld_extended_attributes(tld, options = {})
|
91
90
|
response = client.get(Client.versioned("/tlds/%s/extended_attributes" % tld), options)
|
92
91
|
|
93
92
|
Dnsimple::CollectionResponse.new(response, response["data"].map { |r| Struct::ExtendedAttribute.new(r) })
|