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,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.
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
class Client
|
3
5
|
module Webhooks
|
@@ -28,7 +30,6 @@ module Dnsimple
|
|
28
30
|
|
29
31
|
Dnsimple::CollectionResponse.new(response, response["data"].map { |r| Struct::Webhook.new(r) })
|
30
32
|
end
|
31
|
-
alias list webhooks
|
32
33
|
alias list_webhooks webhooks
|
33
34
|
|
34
35
|
# Creates a webhook in the account.
|
@@ -47,7 +48,6 @@ module Dnsimple
|
|
47
48
|
|
48
49
|
Dnsimple::Response.new(response, Struct::Webhook.new(response["data"]))
|
49
50
|
end
|
50
|
-
alias create create_webhook
|
51
51
|
|
52
52
|
# Gets a webhook from the account.
|
53
53
|
#
|
@@ -84,7 +84,6 @@ module Dnsimple
|
|
84
84
|
|
85
85
|
Dnsimple::Response.new(response, nil)
|
86
86
|
end
|
87
|
-
alias delete delete_webhook
|
88
87
|
|
89
88
|
end
|
90
89
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
class Client
|
3
5
|
module Zones
|
@@ -33,7 +35,6 @@ module Dnsimple
|
|
33
35
|
|
34
36
|
Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Zone.new(r) })
|
35
37
|
end
|
36
|
-
alias list zones
|
37
38
|
alias list_zones zones
|
38
39
|
|
39
40
|
# Lists ALL the zones in the account.
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dnsimple
|
4
|
+
class Client
|
5
|
+
module ZonesDistributions
|
6
|
+
|
7
|
+
# Checks if a zone change is fully distributed to all DNSimple name
|
8
|
+
# servers across the globe.
|
9
|
+
#
|
10
|
+
# @see https://developer.dnsimple.com/v2/zones/#checkZoneDistribution
|
11
|
+
#
|
12
|
+
# @param account_id [Integer] the account ID
|
13
|
+
# @param zone_id [#to_s] the zone name
|
14
|
+
# @param options [Hash]
|
15
|
+
# @return [Dnsimple::Response<Dnsimple::Struct::ZoneDistribution>]
|
16
|
+
#
|
17
|
+
# @raise [Dnsimple::NotFoundError]
|
18
|
+
# @raise [Dnsimple::RequestError]
|
19
|
+
def zone_distribution(account_id, zone_id, options = {})
|
20
|
+
response = client.get(Client.versioned("/%s/zones/%s/distribution" % [account_id, zone_id]), options)
|
21
|
+
|
22
|
+
Dnsimple::Response.new(response, Struct::ZoneDistribution.new(response["data"]))
|
23
|
+
end
|
24
|
+
|
25
|
+
# Checks if a zone record is fully distributed to all DNSimple name
|
26
|
+
# servers across the globe.
|
27
|
+
#
|
28
|
+
# @see https://developer.dnsimple.com/v2/zones/records/#checkZoneRecordDistribution
|
29
|
+
#
|
30
|
+
# @example Get record 123 in zone "example.com"
|
31
|
+
# client.zones.zone_record_distribution(1010, "example.com", 123)
|
32
|
+
#
|
33
|
+
# @param [Integer] account_id the account ID
|
34
|
+
# @param [String] zone_id the zone name
|
35
|
+
# @param [Integer] record_id the record ID
|
36
|
+
# @param [Hash] options
|
37
|
+
# @return [Dnsimple::Response<Dnsimple::Struct::ZoneDistribution>]
|
38
|
+
#
|
39
|
+
# @raise [Dnsimple::NotFoundError]
|
40
|
+
# @raise [Dnsimple::RequestError]
|
41
|
+
def zone_record_distribution(account_id, zone_id, record_id, options = {})
|
42
|
+
response = client.get(Client.versioned("/%s/zones/%s/records/%s/distribution" % [account_id, zone_id, record_id]), options)
|
43
|
+
|
44
|
+
Dnsimple::Response.new(response, Struct::ZoneDistribution.new(response["data"]))
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -1,23 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
class Client
|
3
5
|
module ZonesRecords
|
4
6
|
|
5
7
|
# Lists the zone records in the account.
|
6
8
|
#
|
7
|
-
# @see https://developer.dnsimple.com/v2/zones/records/#
|
9
|
+
# @see https://developer.dnsimple.com/v2/zones/records/#listZoneRecords
|
8
10
|
# @see #all_records
|
9
11
|
#
|
10
12
|
# @example List records for the zone "example.com" in the first page
|
11
|
-
# client.zones.
|
13
|
+
# client.zones.list_zone_records(1010, "example.com")
|
12
14
|
#
|
13
15
|
# @example List records for the zone "example.com", provide a specific page
|
14
|
-
# client.zones.
|
16
|
+
# client.zones.list_zone_records(1010, "example.com", page: 2)
|
15
17
|
#
|
16
18
|
# @example List records for the zone "example.com", sorting in ascending order
|
17
|
-
# client.zones.
|
19
|
+
# client.zones.list_zone_records(1010, "example.com", sort: "type:asc")
|
18
20
|
#
|
19
21
|
# @example List records for the zone "example.com", filtering by 'A' record type
|
20
|
-
# client.zones.
|
22
|
+
# client.zones.list_zone_records(1010, "example.com", filter: { type: 'A' })
|
21
23
|
#
|
22
24
|
# @param [Integer] account_id the account ID
|
23
25
|
# @param [String] zone_id the zone name
|
@@ -30,13 +32,12 @@ module Dnsimple
|
|
30
32
|
#
|
31
33
|
# @raise [Dnsimple::NotFoundError]
|
32
34
|
# @raise [Dnsimple::RequestError]
|
33
|
-
def
|
35
|
+
def zone_records(account_id, zone_id, options = {})
|
34
36
|
response = client.get(Client.versioned("/%s/zones/%s/records" % [account_id, zone_id]), Options::ListOptions.new(options))
|
35
37
|
|
36
38
|
Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::ZoneRecord.new(r) })
|
37
39
|
end
|
38
|
-
alias
|
39
|
-
alias list_records records
|
40
|
+
alias list_zone_records zone_records
|
40
41
|
|
41
42
|
# Lists ALL the zone records in the account.
|
42
43
|
#
|
@@ -46,11 +47,11 @@ module Dnsimple
|
|
46
47
|
# Please use this method carefully, as fetching the entire collection will increase the number of requests
|
47
48
|
# you send to the API server and you may eventually risk to hit the throttle limit.
|
48
49
|
#
|
49
|
-
# @see https://developer.dnsimple.com/v2/zones/records/#
|
50
|
+
# @see https://developer.dnsimple.com/v2/zones/records/#listZoneRecords
|
50
51
|
# @see #records
|
51
52
|
#
|
52
53
|
# @example List all records for the zone "example.com"
|
53
|
-
# client.zones.
|
54
|
+
# client.zones.all_zone_records(1010, "example.com")
|
54
55
|
#
|
55
56
|
# @param [Integer] account_id the account ID
|
56
57
|
# @param [String] zone_id the zone name
|
@@ -63,17 +64,16 @@ module Dnsimple
|
|
63
64
|
#
|
64
65
|
# @raise [Dnsimple::NotFoundError]
|
65
66
|
# @raise [Dnsimple::RequestError]
|
66
|
-
def
|
67
|
-
paginate(:
|
67
|
+
def all_zone_records(account_id, zone_id, options = {})
|
68
|
+
paginate(:list_zone_records, account_id, zone_id, options)
|
68
69
|
end
|
69
|
-
alias all all_records
|
70
70
|
|
71
71
|
# Creates a zone record in the account.
|
72
72
|
#
|
73
|
-
# @see https://developer.dnsimple.com/v2/zones/records/#
|
73
|
+
# @see https://developer.dnsimple.com/v2/zones/records/#createZoneRecord
|
74
74
|
#
|
75
75
|
# @example Create a URL record in zone "example.com"
|
76
|
-
# client.zones.
|
76
|
+
# client.zones.create_zone_record(1010, "example.com", name: "www", type: "url", content: "example.com")
|
77
77
|
#
|
78
78
|
# @param [Integer] account_id the account ID
|
79
79
|
# @param [String] zone_id the zone name
|
@@ -83,20 +83,19 @@ module Dnsimple
|
|
83
83
|
#
|
84
84
|
# @raise [Dnsimple::NotFoundError]
|
85
85
|
# @raise [Dnsimple::RequestError]
|
86
|
-
def
|
86
|
+
def create_zone_record(account_id, zone_id, attributes, options = {})
|
87
87
|
Extra.validate_mandatory_attributes(attributes, [:type, :name, :content])
|
88
88
|
response = client.post(Client.versioned("/%s/zones/%s/records" % [account_id, zone_id]), attributes, options)
|
89
89
|
|
90
90
|
Dnsimple::Response.new(response, Struct::ZoneRecord.new(response["data"]))
|
91
91
|
end
|
92
|
-
alias create create_record
|
93
92
|
|
94
93
|
# Gets a zone record from the account.
|
95
94
|
#
|
96
|
-
# @see https://developer.dnsimple.com/v2/zones/records/#
|
95
|
+
# @see https://developer.dnsimple.com/v2/zones/records/#getZoneRecord
|
97
96
|
#
|
98
97
|
# @example Get record 123 in zone "example.com"
|
99
|
-
# client.zones.
|
98
|
+
# client.zones.zone_record(1010, "example.com", 123)
|
100
99
|
#
|
101
100
|
# @param [Integer] account_id the account ID
|
102
101
|
# @param [String] zone_id the zone name
|
@@ -106,7 +105,7 @@ module Dnsimple
|
|
106
105
|
#
|
107
106
|
# @raise [Dnsimple::NotFoundError]
|
108
107
|
# @raise [Dnsimple::RequestError]
|
109
|
-
def
|
108
|
+
def zone_record(account_id, zone_id, record_id, options = {})
|
110
109
|
response = client.get(Client.versioned("/%s/zones/%s/records/%s" % [account_id, zone_id, record_id]), options)
|
111
110
|
|
112
111
|
Dnsimple::Response.new(response, Struct::ZoneRecord.new(response["data"]))
|
@@ -114,10 +113,10 @@ module Dnsimple
|
|
114
113
|
|
115
114
|
# Updates a zone record in the account.
|
116
115
|
#
|
117
|
-
# @see https://developer.dnsimple.com/v2/zones/records/#
|
116
|
+
# @see https://developer.dnsimple.com/v2/zones/records/#updateZoneRecord
|
118
117
|
#
|
119
118
|
# @example Update the TTL to 600 of record 123 in zone "example.com"
|
120
|
-
# client.zones.
|
119
|
+
# client.zones.update_zone_record(1010, "example.com", 123, ttl: 600)
|
121
120
|
#
|
122
121
|
# @param [Integer] account_id the account ID
|
123
122
|
# @param [String] zone_id the zone name
|
@@ -128,21 +127,20 @@ module Dnsimple
|
|
128
127
|
#
|
129
128
|
# @raise [Dnsimple::NotFoundError]
|
130
129
|
# @raise [Dnsimple::RequestError]
|
131
|
-
def
|
130
|
+
def update_zone_record(account_id, zone_id, record_id, attributes, options = {})
|
132
131
|
response = client.patch(Client.versioned("/%s/zones/%s/records/%s" % [account_id, zone_id, record_id]), attributes, options)
|
133
132
|
|
134
133
|
Dnsimple::Response.new(response, Struct::ZoneRecord.new(response["data"]))
|
135
134
|
end
|
136
|
-
alias update update_record
|
137
135
|
|
138
136
|
# Deletes a zone record from the account.
|
139
137
|
#
|
140
138
|
# WARNING: this cannot be undone.
|
141
139
|
#
|
142
|
-
# @see https://developer.dnsimple.com/v2/zones/records/#
|
140
|
+
# @see https://developer.dnsimple.com/v2/zones/records/#deleteZoneRecord
|
143
141
|
#
|
144
142
|
# @example Delete record 123 in zone "example.com"
|
145
|
-
# client.zones.
|
143
|
+
# client.zones.delete_zone_record(1010, "example.com", 123)
|
146
144
|
#
|
147
145
|
# @param [Integer] account_id the account ID
|
148
146
|
# @param [String] zone_id the zone name
|
@@ -152,12 +150,11 @@ module Dnsimple
|
|
152
150
|
#
|
153
151
|
# @raise [Dnsimple::NotFoundError]
|
154
152
|
# @raise [Dnsimple::RequestError]
|
155
|
-
def
|
153
|
+
def delete_zone_record(account_id, zone_id, record_id, options = {})
|
156
154
|
response = client.delete(Client.versioned("/%s/zones/%s/records/%s" % [account_id, zone_id, record_id]), nil, options)
|
157
155
|
|
158
156
|
Dnsimple::Response.new(response, nil)
|
159
157
|
end
|
160
|
-
alias delete delete_record
|
161
158
|
|
162
159
|
end
|
163
160
|
end
|
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,13 +17,13 @@ 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
|
|
data/lib/dnsimple/error.rb
CHANGED
data/lib/dnsimple/extra.rb
CHANGED
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.
|
@@ -69,10 +71,10 @@ module Dnsimple
|
|
69
71
|
super
|
70
72
|
|
71
73
|
pagination = http_response["pagination"]
|
72
|
-
@page
|
73
|
-
@per_page
|
74
|
-
@total_entries
|
75
|
-
@total_pages
|
74
|
+
@page = pagination["current_page"]
|
75
|
+
@per_page = pagination["per_page"]
|
76
|
+
@total_entries = pagination["total_entries"]
|
77
|
+
@total_pages = pagination["total_pages"]
|
76
78
|
end
|
77
79
|
|
78
80
|
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
|
|
@@ -18,6 +20,8 @@ require_relative 'struct/collaborator'
|
|
18
20
|
require_relative 'struct/contact'
|
19
21
|
require_relative 'struct/certificate'
|
20
22
|
require_relative 'struct/certificate_bundle'
|
23
|
+
require_relative 'struct/certificate_purchase'
|
24
|
+
require_relative 'struct/certificate_renewal'
|
21
25
|
require_relative 'struct/delegation_signer_record'
|
22
26
|
require_relative 'struct/dnssec'
|
23
27
|
require_relative 'struct/domain'
|
@@ -36,8 +40,11 @@ require_relative 'struct/template'
|
|
36
40
|
require_relative 'struct/template_record'
|
37
41
|
require_relative 'struct/tld'
|
38
42
|
require_relative 'struct/user'
|
43
|
+
require_relative 'struct/vanity_name_server'
|
39
44
|
require_relative 'struct/whois_privacy'
|
45
|
+
require_relative 'struct/whois_privacy_renewal'
|
40
46
|
require_relative 'struct/zone'
|
41
47
|
require_relative 'struct/zone_file'
|
48
|
+
require_relative 'struct/zone_distribution'
|
42
49
|
require_relative 'struct/webhook'
|
43
50
|
require_relative 'struct/whoami'
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
module Struct
|
3
5
|
|
@@ -8,9 +10,15 @@ module Dnsimple
|
|
8
10
|
# @return [Integer] The associated domain ID.
|
9
11
|
attr_accessor :domain_id
|
10
12
|
|
13
|
+
# @return [Integer] The associated contact ID.
|
14
|
+
attr_accessor :contact_id
|
15
|
+
|
11
16
|
# @return [String] The certificate common name.
|
12
17
|
attr_accessor :common_name
|
13
18
|
|
19
|
+
# @return [Array<String>] The certificate alternate names.
|
20
|
+
attr_accessor :alternate_names
|
21
|
+
|
14
22
|
# @return [Integer] The years the certificate will last.
|
15
23
|
attr_accessor :years
|
16
24
|
|
@@ -23,6 +31,9 @@ module Dnsimple
|
|
23
31
|
# @return [String] The Certificate Authority (CA) that issued the certificate.
|
24
32
|
attr_accessor :authority_identifier
|
25
33
|
|
34
|
+
# @return [Boolean] True if the certificate is set to auto-renew on expiration.
|
35
|
+
attr_accessor :auto_renew
|
36
|
+
|
26
37
|
# @return [String] When the certificate was created in DNSimple.
|
27
38
|
attr_accessor :created_at
|
28
39
|
|