dnsimple 11.0.0 → 12.0.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.
Files changed (272) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +10 -5
  3. data/.github/workflows/release.yml +44 -13
  4. data/.github/workflows/sync-test-fixtures.yml +1 -1
  5. data/.rubocop.yml +4 -1
  6. data/.rubocop_dnsimple.yml +14 -42
  7. data/.rubocop_todo.yml +4 -9
  8. data/CHANGELOG.md +287 -181
  9. data/CONTRIBUTING.md +6 -40
  10. data/Gemfile +1 -1
  11. data/LICENSE.txt +1 -1
  12. data/README.md +49 -40
  13. data/RELEASING.md +67 -0
  14. data/dnsimple.gemspec +1 -1
  15. data/lib/dnsimple/client/accounts.rb +1 -3
  16. data/lib/dnsimple/client/billing.rb +2 -4
  17. data/lib/dnsimple/client/certificates.rb +0 -2
  18. data/lib/dnsimple/client/clients.rb +2 -40
  19. data/lib/dnsimple/client/contacts.rb +17 -19
  20. data/lib/dnsimple/client/dns_analytics.rb +2 -4
  21. data/lib/dnsimple/client/domains.rb +13 -15
  22. data/lib/dnsimple/client/domains_delegation_signer_records.rb +18 -20
  23. data/lib/dnsimple/client/domains_dnssec.rb +9 -11
  24. data/lib/dnsimple/client/domains_email_forwards.rb +18 -20
  25. data/lib/dnsimple/client/domains_pushes.rb +13 -15
  26. data/lib/dnsimple/client/identity.rb +4 -9
  27. data/lib/dnsimple/client/oauth.rb +1 -3
  28. data/lib/dnsimple/client/registrar.rb +45 -47
  29. data/lib/dnsimple/client/registrar_auto_renewal.rb +6 -8
  30. data/lib/dnsimple/client/registrar_delegation.rb +14 -16
  31. data/lib/dnsimple/client/registrar_registrant_changes.rb +14 -16
  32. data/lib/dnsimple/client/registrar_transfer_lock.rb +9 -11
  33. data/lib/dnsimple/client/registrar_whois_privacy.rb +6 -48
  34. data/lib/dnsimple/client/services.rb +4 -6
  35. data/lib/dnsimple/client/services_domains.rb +12 -14
  36. data/lib/dnsimple/client/templates.rb +17 -19
  37. data/lib/dnsimple/client/templates_domains.rb +4 -6
  38. data/lib/dnsimple/client/templates_records.rb +18 -20
  39. data/lib/dnsimple/client/tlds.rb +6 -8
  40. data/lib/dnsimple/client/vanity_name_servers.rb +0 -2
  41. data/lib/dnsimple/client/webhooks.rb +11 -13
  42. data/lib/dnsimple/client/zones.rb +16 -18
  43. data/lib/dnsimple/client/zones_distributions.rb +4 -6
  44. data/lib/dnsimple/client/zones_records.rb +57 -26
  45. data/lib/dnsimple/client.rb +22 -24
  46. data/lib/dnsimple/default.rb +0 -4
  47. data/lib/dnsimple/error.rb +0 -6
  48. data/lib/dnsimple/extra.rb +4 -6
  49. data/lib/dnsimple/options.rb +1 -7
  50. data/lib/dnsimple/response.rb +4 -13
  51. data/lib/dnsimple/struct/account.rb +0 -2
  52. data/lib/dnsimple/struct/certificate.rb +0 -2
  53. data/lib/dnsimple/struct/certificate_bundle.rb +0 -2
  54. data/lib/dnsimple/struct/certificate_purchase.rb +0 -2
  55. data/lib/dnsimple/struct/certificate_renewal.rb +0 -2
  56. data/lib/dnsimple/struct/charge.rb +4 -8
  57. data/lib/dnsimple/struct/collaborator.rb +0 -2
  58. data/lib/dnsimple/struct/contact.rb +0 -2
  59. data/lib/dnsimple/struct/delegation_signer_record.rb +0 -2
  60. data/lib/dnsimple/struct/dns_analytics.rb +0 -2
  61. data/lib/dnsimple/struct/dnssec.rb +0 -2
  62. data/lib/dnsimple/struct/domain.rb +0 -2
  63. data/lib/dnsimple/struct/domain_check.rb +0 -2
  64. data/lib/dnsimple/struct/domain_premium_price.rb +0 -2
  65. data/lib/dnsimple/struct/domain_price.rb +0 -2
  66. data/lib/dnsimple/struct/domain_push.rb +0 -2
  67. data/lib/dnsimple/struct/domain_registration.rb +0 -2
  68. data/lib/dnsimple/struct/domain_renewal.rb +0 -2
  69. data/lib/dnsimple/struct/domain_restore.rb +0 -2
  70. data/lib/dnsimple/struct/domain_transfer.rb +0 -2
  71. data/lib/dnsimple/struct/email_forward.rb +0 -2
  72. data/lib/dnsimple/struct/extended_attribute.rb +0 -4
  73. data/lib/dnsimple/struct/oauth_token.rb +0 -2
  74. data/lib/dnsimple/struct/registrant_change.rb +0 -2
  75. data/lib/dnsimple/struct/registrant_change_check.rb +0 -2
  76. data/lib/dnsimple/struct/service.rb +0 -4
  77. data/lib/dnsimple/struct/template.rb +0 -2
  78. data/lib/dnsimple/struct/template_record.rb +0 -2
  79. data/lib/dnsimple/struct/tld.rb +0 -2
  80. data/lib/dnsimple/struct/transfer_lock.rb +0 -2
  81. data/lib/dnsimple/struct/user.rb +0 -2
  82. data/lib/dnsimple/struct/vanity_name_server.rb +0 -2
  83. data/lib/dnsimple/struct/webhook.rb +0 -2
  84. data/lib/dnsimple/struct/whoami.rb +2 -4
  85. data/lib/dnsimple/struct/whois_privacy.rb +0 -2
  86. data/lib/dnsimple/struct/zone.rb +0 -2
  87. data/lib/dnsimple/struct/zone_distribution.rb +0 -2
  88. data/lib/dnsimple/struct/zone_file.rb +0 -2
  89. data/lib/dnsimple/struct/zone_record.rb +0 -2
  90. data/lib/dnsimple/struct/zone_record_id.rb +10 -0
  91. data/lib/dnsimple/struct/zone_records_batch_change.rb +16 -0
  92. data/lib/dnsimple/struct.rb +2 -3
  93. data/lib/dnsimple/version.rb +1 -3
  94. data/lib/dnsimple.rb +1 -3
  95. data/spec/dnsimple/client/client_service_spec.rb +12 -10
  96. data/spec/dnsimple/client/domains_delegation_signer_records_spec.rb +2 -2
  97. data/spec/dnsimple/client/oauth_spec.rb +6 -6
  98. data/spec/dnsimple/client/registrar_whois_privacy_spec.rb +0 -82
  99. data/spec/dnsimple/client/zones_records_spec.rb +95 -0
  100. data/spec/fixtures.http/acceptPush/success.http +15 -15
  101. data/spec/fixtures.http/accounts/success-account.http +20 -20
  102. data/spec/fixtures.http/accounts/success-user.http +21 -21
  103. data/spec/fixtures.http/activateZoneService/success.http +16 -16
  104. data/spec/fixtures.http/appliedServices/success.http +19 -19
  105. data/spec/fixtures.http/applyService/success.http +15 -15
  106. data/spec/fixtures.http/applyTemplate/success.http +13 -13
  107. data/spec/fixtures.http/authorizeDomainTransferOut/success.http +13 -13
  108. data/spec/fixtures.http/badgateway.http +5 -5
  109. data/spec/fixtures.http/batchChangeZoneRecords/error_400_create_validation_failed.http +16 -0
  110. data/spec/fixtures.http/batchChangeZoneRecords/error_400_delete_validation_failed.http +15 -0
  111. data/spec/fixtures.http/batchChangeZoneRecords/error_400_update_validation_failed.http +15 -0
  112. data/spec/fixtures.http/batchChangeZoneRecords/success.http +16 -0
  113. data/spec/fixtures.http/cancelDomainTransfer/success.http +17 -17
  114. data/spec/fixtures.http/changeDomainDelegation/success.http +15 -15
  115. data/spec/fixtures.http/changeDomainDelegationFromVanity/success.http +15 -15
  116. data/spec/fixtures.http/changeDomainDelegationToVanity/success.http +17 -17
  117. data/spec/fixtures.http/checkDomain/success.http +15 -15
  118. data/spec/fixtures.http/checkRegistrantChange/error-contactnotfound.http +3 -3
  119. data/spec/fixtures.http/checkRegistrantChange/error-domainnotfound.http +3 -3
  120. data/spec/fixtures.http/checkRegistrantChange/success.http +15 -15
  121. data/spec/fixtures.http/checkZoneDistribution/error.http +17 -17
  122. data/spec/fixtures.http/checkZoneDistribution/failure.http +17 -17
  123. data/spec/fixtures.http/checkZoneDistribution/success.http +17 -17
  124. data/spec/fixtures.http/checkZoneRecordDistribution/error.http +17 -17
  125. data/spec/fixtures.http/checkZoneRecordDistribution/failure.http +17 -17
  126. data/spec/fixtures.http/checkZoneRecordDistribution/success.http +17 -17
  127. data/spec/fixtures.http/createContact/created.http +16 -16
  128. data/spec/fixtures.http/createContact/error-validation-errors.http +15 -15
  129. data/spec/fixtures.http/createDelegationSignerRecord/created.http +17 -17
  130. data/spec/fixtures.http/createDelegationSignerRecord/validation-error.http +15 -15
  131. data/spec/fixtures.http/createDomain/created.http +19 -19
  132. data/spec/fixtures.http/createEmailForward/created.http +21 -21
  133. data/spec/fixtures.http/createPrimaryServer/created.http +20 -20
  134. data/spec/fixtures.http/createRegistrantChange/success.http +14 -14
  135. data/spec/fixtures.http/createSecondaryZone/created.http +20 -20
  136. data/spec/fixtures.http/createTemplate/created.http +15 -15
  137. data/spec/fixtures.http/createTemplateRecord/created.http +16 -16
  138. data/spec/fixtures.http/createWebhook/created.http +13 -13
  139. data/spec/fixtures.http/createZoneRecord/created-apex.http +13 -13
  140. data/spec/fixtures.http/createZoneRecord/created.http +13 -13
  141. data/spec/fixtures.http/deactivateZoneService/success.http +16 -16
  142. data/spec/fixtures.http/deleteContact/error-contact-in-use.http +15 -15
  143. data/spec/fixtures.http/deleteContact/success.http +13 -13
  144. data/spec/fixtures.http/deleteDelegationSignerRecord/success.http +15 -15
  145. data/spec/fixtures.http/deleteDomain/success.http +11 -11
  146. data/spec/fixtures.http/deleteEmailForward/success.http +18 -18
  147. data/spec/fixtures.http/deleteRegistrantChange/success.http +13 -13
  148. data/spec/fixtures.http/deleteRegistrantChange/success_async.http +3 -3
  149. data/spec/fixtures.http/deleteTemplate/success.http +13 -13
  150. data/spec/fixtures.http/deleteTemplateRecord/success.http +13 -13
  151. data/spec/fixtures.http/deleteWebhook/success.http +13 -13
  152. data/spec/fixtures.http/deleteZoneRecord/success.http +11 -11
  153. data/spec/fixtures.http/disableDnssec/not-enabled.http +15 -15
  154. data/spec/fixtures.http/disableDnssec/success.http +15 -15
  155. data/spec/fixtures.http/disableDomainAutoRenewal/success.http +13 -13
  156. data/spec/fixtures.http/disableDomainTransferLock/success.http +17 -17
  157. data/spec/fixtures.http/disableVanityNameServers/success.http +15 -15
  158. data/spec/fixtures.http/disableWhoisPrivacy/success.http +16 -16
  159. data/spec/fixtures.http/dnsAnalytics/success.http +17 -17
  160. data/spec/fixtures.http/downloadCertificate/success.http +19 -19
  161. data/spec/fixtures.http/enableDnssec/success.http +17 -17
  162. data/spec/fixtures.http/enableDomainAutoRenewal/success.http +13 -13
  163. data/spec/fixtures.http/enableDomainTransferLock/success.http +17 -17
  164. data/spec/fixtures.http/enableVanityNameServers/success.http +17 -17
  165. data/spec/fixtures.http/enableWhoisPrivacy/created.http +16 -16
  166. data/spec/fixtures.http/enableWhoisPrivacy/success.http +16 -16
  167. data/spec/fixtures.http/getCertificate/success.http +19 -19
  168. data/spec/fixtures.http/getCertificatePrivateKey/success.http +20 -20
  169. data/spec/fixtures.http/getContact/success.http +16 -16
  170. data/spec/fixtures.http/getDelegationSignerRecord/success.http +17 -17
  171. data/spec/fixtures.http/getDnssec/success.http +17 -17
  172. data/spec/fixtures.http/getDomain/success.http +19 -19
  173. data/spec/fixtures.http/getDomainDelegation/success-empty.http +15 -15
  174. data/spec/fixtures.http/getDomainDelegation/success.http +15 -15
  175. data/spec/fixtures.http/getDomainPrices/failure.http +18 -18
  176. data/spec/fixtures.http/getDomainPrices/success.http +21 -21
  177. data/spec/fixtures.http/getDomainRegistration/success.http +20 -20
  178. data/spec/fixtures.http/getDomainRenewal/success.http +20 -20
  179. data/spec/fixtures.http/getDomainRestore/success.http +22 -19
  180. data/spec/fixtures.http/getDomainTransfer/success.http +19 -19
  181. data/spec/fixtures.http/getDomainTransferLock/success.http +17 -17
  182. data/spec/fixtures.http/getEmailForward/success.http +21 -21
  183. data/spec/fixtures.http/getPrimaryServer/success.http +20 -20
  184. data/spec/fixtures.http/getRegistrantChange/success.http +15 -15
  185. data/spec/fixtures.http/getService/success.http +16 -16
  186. data/spec/fixtures.http/getTemplate/success.http +15 -15
  187. data/spec/fixtures.http/getTemplateRecord/success.http +16 -16
  188. data/spec/fixtures.http/getTld/success.http +20 -20
  189. data/spec/fixtures.http/getTldExtendedAttributes/success-attributes.http +15 -15
  190. data/spec/fixtures.http/getTldExtendedAttributes/success-noattributes.http +15 -15
  191. data/spec/fixtures.http/getTldExtendedAttributes/success.http +15 -15
  192. data/spec/fixtures.http/getWebhook/success.http +13 -13
  193. data/spec/fixtures.http/getZone/success.http +16 -16
  194. data/spec/fixtures.http/getZoneFile/success.http +17 -17
  195. data/spec/fixtures.http/getZoneRecord/success.http +17 -17
  196. data/spec/fixtures.http/initiatePush/success.http +17 -17
  197. data/spec/fixtures.http/issueLetsencryptCertificate/success.http +17 -17
  198. data/spec/fixtures.http/issueRenewalLetsencryptCertificate/success.http +17 -17
  199. data/spec/fixtures.http/linkPrimaryServer/success.http +20 -20
  200. data/spec/fixtures.http/listAccounts/success-account.http +20 -20
  201. data/spec/fixtures.http/listAccounts/success-user.http +20 -20
  202. data/spec/fixtures.http/listCertificates/success.http +19 -19
  203. data/spec/fixtures.http/listCharges/fail-400-bad-filter.http +9 -9
  204. data/spec/fixtures.http/listCharges/fail-403.http +9 -9
  205. data/spec/fixtures.http/listCharges/success.http +9 -9
  206. data/spec/fixtures.http/listContacts/success.http +16 -16
  207. data/spec/fixtures.http/listDelegationSignerRecords/success.http +17 -17
  208. data/spec/fixtures.http/listDomains/success.http +19 -19
  209. data/spec/fixtures.http/listEmailForwards/success.http +13 -13
  210. data/spec/fixtures.http/listPrimaryServers/success.http +20 -20
  211. data/spec/fixtures.http/listPushes/success.http +17 -17
  212. data/spec/fixtures.http/listRegistrantChanges/success.http +15 -15
  213. data/spec/fixtures.http/listServices/success.http +17 -17
  214. data/spec/fixtures.http/listTemplateRecords/success.http +16 -16
  215. data/spec/fixtures.http/listTemplates/success.http +15 -15
  216. data/spec/fixtures.http/listTlds/success.http +20 -20
  217. data/spec/fixtures.http/listWebhooks/success.http +13 -13
  218. data/spec/fixtures.http/listZoneRecords/success.http +17 -17
  219. data/spec/fixtures.http/listZones/success.http +16 -16
  220. data/spec/fixtures.http/method-not-allowed.http +8 -8
  221. data/spec/fixtures.http/notfound-certificate.http +12 -12
  222. data/spec/fixtures.http/notfound-contact.http +10 -10
  223. data/spec/fixtures.http/notfound-delegationSignerRecord.http +11 -0
  224. data/spec/fixtures.http/notfound-domain.http +8 -8
  225. data/spec/fixtures.http/notfound-domainpush.http +8 -8
  226. data/spec/fixtures.http/notfound-emailforward.http +8 -8
  227. data/spec/fixtures.http/notfound-record.http +10 -10
  228. data/spec/fixtures.http/notfound-template.http +10 -10
  229. data/spec/fixtures.http/notfound-webhook.http +8 -8
  230. data/spec/fixtures.http/notfound-whoisprivacy.http +10 -10
  231. data/spec/fixtures.http/notfound-zone.http +10 -10
  232. data/spec/fixtures.http/oauthAccessToken/error-invalid-request.http +12 -12
  233. data/spec/fixtures.http/oauthAccessToken/success.http +16 -16
  234. data/spec/fixtures.http/pages-1of3.http +12 -12
  235. data/spec/fixtures.http/pages-2of3.http +12 -12
  236. data/spec/fixtures.http/pages-3of3.http +12 -12
  237. data/spec/fixtures.http/purchaseLetsencryptCertificate/success.http +19 -19
  238. data/spec/fixtures.http/purchaseRenewalLetsencryptCertificate/success.http +19 -19
  239. data/spec/fixtures.http/registerDomain/error-extended-attributes.http +15 -15
  240. data/spec/fixtures.http/registerDomain/success.http +20 -20
  241. data/spec/fixtures.http/rejectPush/success.http +15 -15
  242. data/spec/fixtures.http/renewDomain/error-tooearly.http +14 -14
  243. data/spec/fixtures.http/renewDomain/success.http +20 -20
  244. data/spec/fixtures.http/response.http +12 -12
  245. data/spec/fixtures.http/restoreDomain/success.http +22 -19
  246. data/spec/fixtures.http/success-with-malformed-json.http +4 -4
  247. data/spec/fixtures.http/transferDomain/error-indnsimple.http +13 -13
  248. data/spec/fixtures.http/transferDomain/error-missing-authcode.http +13 -13
  249. data/spec/fixtures.http/transferDomain/success.http +20 -20
  250. data/spec/fixtures.http/unapplyService/success.http +15 -15
  251. data/spec/fixtures.http/unlinkPrimaryServer/success.http +20 -20
  252. data/spec/fixtures.http/updateContact/success.http +16 -16
  253. data/spec/fixtures.http/updateTemplate/success.http +15 -15
  254. data/spec/fixtures.http/updateZoneNsRecords/success.http +16 -16
  255. data/spec/fixtures.http/updateZoneRecord/success.http +17 -17
  256. data/spec/fixtures.http/validation-error.http +15 -15
  257. data/spec/fixtures.http/whoami/success-account.http +15 -15
  258. data/spec/fixtures.http/whoami/success-user.http +15 -15
  259. data/spec/fixtures.http/whoami/success.http +15 -15
  260. data/spec/support/helpers.rb +0 -2
  261. metadata +14 -14
  262. data/lib/dnsimple/struct/whois_privacy_renewal.rb +0 -30
  263. data/spec/fixtures.http/checkDomainPremiumPrice/error_400_not_a_premium_domain.http +0 -18
  264. data/spec/fixtures.http/checkDomainPremiumPrice/error_400_tld_not_supported.http +0 -18
  265. data/spec/fixtures.http/checkDomainPremiumPrice/success.http +0 -20
  266. data/spec/fixtures.http/getDomainPremiumPrice/failure.http +0 -15
  267. data/spec/fixtures.http/getDomainPremiumPrice/success.http +0 -20
  268. data/spec/fixtures.http/getWhoisPrivacy/success.http +0 -16
  269. data/spec/fixtures.http/notfound-delegationsignerrecord.http +0 -11
  270. data/spec/fixtures.http/renewWhoisPrivacy/success.http +0 -20
  271. data/spec/fixtures.http/renewWhoisPrivacy/whois-privacy-duplicated-order.http +0 -18
  272. data/spec/fixtures.http/renewWhoisPrivacy/whois-privacy-not-found.http +0 -18
data/CONTRIBUTING.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  ## Getting started
4
4
 
5
- ### 1. Clone the repository
6
-
7
5
  Clone the repository and move into it:
8
6
 
9
7
  ```shell
@@ -11,47 +9,13 @@ git clone git@github.com:dnsimple/dnsimple-ruby.git
11
9
  cd dnsimple-ruby
12
10
  ```
13
11
 
14
- ### 2. Install the dependencies
15
-
16
12
  Install the dependencies using [Bundler](http://bundler.io/):
17
13
 
18
14
  ```shell
19
15
  bundle
20
16
  ```
21
17
 
22
- ### 3. Build and test
23
-
24
- [Run the test suite](#testing) to check everything works as expected.
25
-
26
- ## Releasing
27
-
28
- The following instructions uses `$VERSION` as a placeholder, where `$VERSION` is a `MAJOR.MINOR.BUGFIX` release such as `1.2.0`.
29
-
30
- 1. Set the version in `version.rb`:
31
-
32
- ```ruby
33
- VERSION = "$VERSION"
34
- ```
35
-
36
- 1. Run the test suite and ensure all the tests pass.
37
-
38
- 1. Finalize the `## main` section in `CHANGELOG.md` assigning the version.
39
-
40
- 1. Commit and push the changes
41
-
42
- ```shell
43
- git commit -a -m "Release $VERSION"
44
- git push origin main
45
- ```
46
-
47
- 1. Wait for CI to complete.
48
-
49
- 1. Create a signed tag.
50
-
51
- ```shell
52
- git tag -a v$VERSION -s -m "Release $VERSION"
53
- git push origin --tags
54
- ```
18
+ Run the test suite to check everything works as expected.
55
19
 
56
20
  ## Testing
57
21
 
@@ -61,8 +25,10 @@ To run the test suite:
61
25
  rake
62
26
  ```
63
27
 
64
- ## Tests
65
-
66
- Submit unit tests for your changes. You can test your changes on your machine by [running the test suite](#testing).
28
+ Submit unit tests for your changes. You can test your changes on your machine by running the test suite.
67
29
 
68
30
  When you submit a PR, tests will also be run on the [continuous integration environment via GitHub Actions](https://github.com/dnsimple/dnsimple-ruby/actions).
31
+
32
+ ## Changelog
33
+
34
+ We follow the [Common Changelog](https://common-changelog.org/) format for changelog entries.
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ source "https://rubygems.org"
5
5
  gemspec
6
6
 
7
7
  gem "base64", "~> 0.3.0"
8
- gem "bigdecimal", "~> 3.1"
8
+ gem "bigdecimal", "~> 4.0"
9
9
  gem "coveralls", "~> 0.8", require: false
10
10
  gem "csv", "~> 3.2"
11
11
  gem "rubocop", "~> 1.75", require: false
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2010-2025 DNSimple Corporation
3
+ Copyright (c) 2010-2026 DNSimple Corporation
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -11,6 +11,7 @@ We provide a full API and an easy-to-use web interface so you can get your domai
11
11
  ## Requirements
12
12
 
13
13
  - Ruby: MRI > 3.2+
14
+ - An activated DNSimple account
14
15
 
15
16
  ## Installation
16
17
 
@@ -23,31 +24,10 @@ gem install dnsimple
23
24
  Or use Bundler and define it as a dependency in your Gemfile:
24
25
 
25
26
  ```ruby
26
- gem 'dnsimple', '~> 10.0'
27
+ gem 'dnsimple', '~> 11.0'
27
28
  ```
28
29
 
29
- ## Documentation
30
-
31
- ### Relevant links
32
-
33
- - [`dnsimple-ruby` RDocs](https://www.rubydoc.info/gems/dnsimple/).
34
- - [DNSimple API documentation](https://developer.dnsimple.com).
35
- - [DNSimple API examples repository](https://github.com/dnsimple/dnsimple-api-examples).
36
- - [DNSimple support documentation](https://support.dnsimple.com).
37
-
38
- ### Sandbox Environment
39
-
40
- We highly recommend testing against our [sandbox environment](https://developer.dnsimple.com/sandbox/) before using our production environment. This will allow you to avoid real purchases, live charges on your credit card, and reduce the chance of your running up against rate limits.
41
-
42
- The client supports both the production and sandbox environment. To switch to sandbox pass the sandbox API host using the `base_url` option when you construct the client:
43
-
44
- ```ruby
45
- client = Dnsimple::Client.new(base_url: "https://api.sandbox.dnsimple.com", access_token: "a1b2c3")
46
- ```
47
-
48
- You will need to ensure that you are using an access token created in the sandbox environment. Production tokens will *not* work in the sandbox environment.
49
-
50
- ### Examples
30
+ ## Usage
51
31
 
52
32
  Be sure to require the gem before trying any of the examples:
53
33
 
@@ -55,19 +35,7 @@ Be sure to require the gem before trying any of the examples:
55
35
  require 'dnsimple'
56
36
  ```
57
37
 
58
- #### Setting a custom `User-Agent` header
59
-
60
- You can customize the `User-Agent` header for the calls made to the DNSimple API:
61
-
62
- ```ruby
63
- client = Dnsimple::Client.new(user_agent: "my-app/1.0")
64
- ```
65
-
66
- The value you provide will be prepended to the default `User-Agent` the client uses. For example, if you use `my-app/1.0`, the final header value will be `my-app/1.0 dnsimple-ruby/0.14.0` (note that it will vary depending on the client version).
67
-
68
- We recommend to customize the user agent. If you are building a library or integration on top of the official client, customizing the client will help us to understand what is this client used for, and allow to contribute back or get in touch.
69
-
70
- #### Authentication
38
+ ### Authentication
71
39
 
72
40
  ```ruby
73
41
  client = Dnsimple::Client.new(access_token: "a1b2c3")
@@ -86,7 +54,7 @@ whoami = client.identity.whoami.data
86
54
  account_id = whoami.account.id
87
55
  ```
88
56
 
89
- #### Listing your domains
57
+ ### Listing your domains
90
58
 
91
59
  ```ruby
92
60
  puts client.domains.list_domains(account_id).data # => domains from the account 1234, first page
@@ -94,20 +62,61 @@ puts client.domains.list_domains(account_id, query: { page: 3 }).data # => doma
94
62
  puts client.domains.all_domains(account_id).data # => all domains from the account 1234 (use carefully)
95
63
  ```
96
64
 
97
- #### Create a domain
65
+ ### Create a domain
98
66
 
99
67
  ```ruby
100
68
  response = client.domains.create_domain(account_id, name: "example.com")
101
69
  puts response.data
102
70
  ```
103
71
 
104
- #### Get a domain
72
+ ### Get a domain
105
73
 
106
74
  ```ruby
107
75
  response = client.domains.domain(account_id, "example.com")
108
76
  puts response.data
109
77
  ```
110
78
 
79
+ ## Configuration
80
+
81
+ ### Sandbox Environment
82
+
83
+ We highly recommend testing against our [sandbox environment](https://developer.dnsimple.com/sandbox/) before using our production environment. This will allow you to avoid real purchases, live charges on your credit card, and reduce the chance of your running up against rate limits.
84
+
85
+ The client supports both the production and sandbox environment. To switch to sandbox pass the sandbox API host using the `base_url` option when you construct the client:
86
+
87
+ ```ruby
88
+ client = Dnsimple::Client.new(base_url: "https://api.sandbox.dnsimple.com", access_token: "a1b2c3")
89
+ ```
90
+
91
+ You will need to ensure that you are using an access token created in the sandbox environment. Production tokens will *not* work in the sandbox environment.
92
+
93
+ ### Setting a custom `User-Agent` header
94
+
95
+ You can customize the `User-Agent` header for the calls made to the DNSimple API:
96
+
97
+ ```ruby
98
+ client = Dnsimple::Client.new(user_agent: "my-app/1.0")
99
+ ```
100
+
101
+ The value you provide will be prepended to the default `User-Agent` the client uses. For example, if you use `my-app/1.0`, the final header value will be `my-app/1.0 dnsimple-ruby/0.14.0` (note that it will vary depending on the client version).
102
+
103
+ We recommend to customize the user agent. If you are building a library or integration on top of the official client, customizing the client will help us to understand what is this client used for, and allow to contribute back or get in touch.
104
+
105
+ ## Documentation
106
+
107
+ - [dnsimple-ruby RDocs](https://www.rubydoc.info/gems/dnsimple/).
108
+ - [DNSimple API documentation](https://developer.dnsimple.com).
109
+ - [DNSimple API examples repository](https://github.com/dnsimple/dnsimple-api-examples).
110
+ - [DNSimple support documentation](https://support.dnsimple.com).
111
+
112
+ ## Contributing
113
+
114
+ Contributions are welcome! Please feel free to submit issues and pull requests. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
115
+
116
+ ## Changelog
117
+
118
+ See [CHANGELOG.md](CHANGELOG.md) for details.
119
+
111
120
  ## License
112
121
 
113
- Copyright (c) 2010-2025 DNSimple Corporation. This is Free Software distributed under the MIT license.
122
+ Copyright (c) 2010-2026 DNSimple Corporation. This is Free Software distributed under the [MIT License](LICENSE.txt).
data/RELEASING.md ADDED
@@ -0,0 +1,67 @@
1
+ # Releasing
2
+
3
+ This document describes the steps to release a new version of DNSimple/Ruby.
4
+
5
+ ## Prerequisites
6
+
7
+ - You have commit access to the repository
8
+ - You have push access to the repository
9
+ - You have a GPG key configured for signing tags
10
+ - You have permission to publish to RubyGems
11
+
12
+ ## Release process
13
+
14
+ 1. **Determine the new version** using [Semantic Versioning](https://semver.org/)
15
+
16
+ ```shell
17
+ VERSION=X.Y.Z
18
+ ```
19
+
20
+ - **MAJOR** version for incompatible API changes
21
+ - **MINOR** version for backwards-compatible functionality additions
22
+ - **PATCH** version for backwards-compatible bug fixes
23
+
24
+ 2. **Update the version file** with the new version
25
+
26
+ Edit `version.rb` and update the `VERSION` constant:
27
+
28
+ ```ruby
29
+ VERSION = "$VERSION"
30
+ ```
31
+
32
+ 3. **Run tests** and confirm they pass
33
+
34
+ ```shell
35
+ rake
36
+ ```
37
+
38
+ 4. **Update the changelog** with the new version
39
+
40
+ Finalize the `## main` section in `CHANGELOG.md` assigning the version.
41
+
42
+ 5. **Commit the new version**
43
+
44
+ ```shell
45
+ git commit -a -m "Release $VERSION"
46
+ ```
47
+
48
+ 6. **Push the changes**
49
+
50
+ ```shell
51
+ git push origin main
52
+ ```
53
+
54
+ 7. **Wait for CI to complete**
55
+
56
+ 8. **Create a signed tag**
57
+
58
+ ```shell
59
+ git tag -a v$VERSION -s -m "Release $VERSION"
60
+ git push origin --tags
61
+ ```
62
+
63
+ ## Post-release
64
+
65
+ - Verify the new version appears on [RubyGems](https://rubygems.org/gems/dnsimple)
66
+ - Verify the GitHub release was created
67
+ - Announce the release if necessary
data/dnsimple.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.summary = 'The DNSimple API client for Ruby'
12
12
  s.description = 'The DNSimple API client for Ruby.'
13
13
 
14
- s.required_ruby_version = ">= 2.7"
14
+ s.required_ruby_version = ['>= 3.2', '< 5']
15
15
 
16
16
  s.require_paths = ['lib']
17
17
  s.files = `git ls-files`.split("\n")
@@ -3,7 +3,6 @@
3
3
  module Dnsimple
4
4
  class Client
5
5
  module Accounts
6
-
7
6
  # Lists the accounts the authenticated entity has access to.
8
7
  #
9
8
  # @see https://developer.dnsimple.com/v2/accounts
@@ -11,7 +10,7 @@ module Dnsimple
11
10
  # @example List the accounts:
12
11
  # client.accounts.list
13
12
  #
14
- # @param [Hash] options
13
+ # @param options [Hash]
15
14
  # @return [Dnsimple::Response<Dnsimple::Struct::Account>]
16
15
  #
17
16
  # @raise [Dnsimple::RequestError]
@@ -21,7 +20,6 @@ module Dnsimple
21
20
  Dnsimple::Response.new(response, response["data"].map { |r| Struct::Account.new(r) })
22
21
  end
23
22
  alias list_accounts accounts
24
-
25
23
  end
26
24
  end
27
25
  end
@@ -3,7 +3,6 @@
3
3
  module Dnsimple
4
4
  class Client
5
5
  module Billing
6
-
7
6
  # List the billing charges for the account.
8
7
  #
9
8
  # @see https://developer.dnsimple.com/v2/billing/#listCharges
@@ -17,8 +16,8 @@ module Dnsimple
17
16
  # @example List charges, provide a sorting policy
18
17
  # client.charges.list(1010, sort: "invoiced:asc")
19
18
  #
20
- # @param [Integer] account_id the account ID
21
- # @param [Hash] options the filtering and sorting options
19
+ # @param account_id [Integer] the account ID
20
+ # @param options [Hash] the filtering and sorting options
22
21
  # @option options [Integer] :page current page (pagination)
23
22
  # @option options [Integer] :per_page number of entries to return (pagination)
24
23
  # @option options [String] :sort sorting policy
@@ -31,7 +30,6 @@ module Dnsimple
31
30
  Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Charge.new(r) })
32
31
  end
33
32
  alias list_charges charges
34
-
35
33
  end
36
34
  end
37
35
  end
@@ -3,7 +3,6 @@
3
3
  module Dnsimple
4
4
  class Client
5
5
  module Certificates
6
-
7
6
  # List the certificates for the domain in the account.
8
7
  #
9
8
  # @see https://developer.dnsimple.com/v2/certificates/#listCertificates
@@ -284,7 +283,6 @@ module Dnsimple
284
283
 
285
284
  Dnsimple::Response.new(response, Struct::Certificate.new(response["data"]))
286
285
  end
287
-
288
286
  end
289
287
  end
290
288
  end
@@ -1,9 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dnsimple
4
-
5
4
  class Client
6
-
7
5
  # @return [Dnsimple::Client::AccountsService] The account-related API proxy.
8
6
  def accounts
9
7
  @services[:accounts] ||= Client::AccountsService.new(self)
@@ -82,7 +80,6 @@ module Dnsimple
82
80
 
83
81
  # Struct
84
82
  class ClientService
85
-
86
83
  # @return [Dnsimple::Client]
87
84
  attr_reader :client
88
85
 
@@ -94,8 +91,8 @@ module Dnsimple
94
91
  #
95
92
  # @api private
96
93
  #
97
- # @param [Symbol] method The client method to execute
98
- # @param [Array] args The args to call the method with
94
+ # @param method [Symbol] The client method to execute
95
+ # @param args [Array] The args to call the method with
99
96
  # @return [Dnsimple::CollectionResponse]
100
97
  def paginate(method, *args)
101
98
  current_page = 0
@@ -116,41 +113,32 @@ module Dnsimple
116
113
 
117
114
  CollectionResponse.new(response.http_response, collection)
118
115
  end
119
-
120
116
  end
121
117
 
122
118
 
123
119
  require_relative "accounts"
124
120
 
125
121
  class AccountsService < ClientService
126
-
127
122
  include Client::Accounts
128
-
129
123
  end
130
124
 
131
125
  require_relative "billing"
132
126
 
133
127
  class BillingService < ClientService
134
-
135
128
  include Client::Billing
136
-
137
129
  end
138
130
 
139
131
  require_relative "certificates"
140
132
 
141
133
  class CertificatesService < ClientService
142
-
143
134
  include Client::Certificates
144
-
145
135
  end
146
136
 
147
137
 
148
138
  require_relative "contacts"
149
139
 
150
140
  class ContactsService < ClientService
151
-
152
141
  include Client::Contacts
153
-
154
142
  end
155
143
 
156
144
 
@@ -161,39 +149,31 @@ module Dnsimple
161
149
  require_relative "domains_pushes"
162
150
 
163
151
  class DomainsService < ClientService
164
-
165
152
  include Client::Domains
166
153
  include Client::DomainsDelegationSignerRecords
167
154
  include Client::DomainsDnssec
168
155
  include Client::DomainsEmailForwards
169
156
  include Client::DomainsPushes
170
-
171
157
  end
172
158
 
173
159
  require_relative "dns_analytics"
174
160
 
175
161
  class DnsAnalyticsService < ClientService
176
-
177
162
  include Client::DnsAnalytics
178
-
179
163
  end
180
164
 
181
165
 
182
166
  require_relative "identity"
183
167
 
184
168
  class IdentityService < ClientService
185
-
186
169
  include Client::Identity
187
-
188
170
  end
189
171
 
190
172
 
191
173
  require_relative "oauth"
192
174
 
193
175
  class OauthService < ClientService
194
-
195
176
  include Client::Oauth
196
-
197
177
  end
198
178
 
199
179
  require_relative "registrar"
@@ -204,14 +184,12 @@ module Dnsimple
204
184
  require_relative "registrar_delegation"
205
185
 
206
186
  class RegistrarService < ClientService
207
-
208
187
  include Client::Registrar
209
188
  include Client::RegistrarAutoRenewal
210
189
  include Client::RegistrarDelegation
211
190
  include Client::RegistrarRegistrantChanges
212
191
  include Client::RegistrarTransferLock
213
192
  include Client::RegistrarWhoisPrivacy
214
-
215
193
  end
216
194
 
217
195
 
@@ -219,10 +197,8 @@ module Dnsimple
219
197
  require_relative "services_domains"
220
198
 
221
199
  class ServicesService < ClientService
222
-
223
200
  include Client::Services
224
201
  include Client::ServicesDomains
225
-
226
202
  end
227
203
 
228
204
 
@@ -231,29 +207,23 @@ module Dnsimple
231
207
  require_relative "templates_records"
232
208
 
233
209
  class TemplatesService < ClientService
234
-
235
210
  include Client::Templates
236
211
  include Client::TemplatesDomains
237
212
  include Client::TemplatesRecords
238
-
239
213
  end
240
214
 
241
215
 
242
216
  require_relative "tlds"
243
217
 
244
218
  class TldsService < ClientService
245
-
246
219
  include Client::Tlds
247
-
248
220
  end
249
221
 
250
222
 
251
223
  require_relative "vanity_name_servers"
252
224
 
253
225
  class VanityNameServersService < ClientService
254
-
255
226
  include Client::VanityNameServers
256
-
257
227
  end
258
228
 
259
229
 
@@ -262,22 +232,17 @@ module Dnsimple
262
232
  require_relative "zones_distributions"
263
233
 
264
234
  class ZonesService < ClientService
265
-
266
235
  include Client::Zones
267
236
  include Client::ZonesRecords
268
237
  include Client::ZonesDistributions
269
-
270
238
  end
271
239
 
272
240
 
273
241
  require_relative "webhooks"
274
242
 
275
243
  class WebhooksService < ClientService
276
-
277
244
  include Client::Webhooks
278
-
279
245
  end
280
-
281
246
  end
282
247
 
283
248
  # This module exposes static helpers for the API v2.
@@ -286,9 +251,6 @@ module Dnsimple
286
251
  # these static methods return directly the underlying data objects.
287
252
  # Therefore, it's not possible to access response metadata such as throttling or pagination info.
288
253
  module V2
289
-
290
254
  extend Client::Identity::StaticHelpers
291
-
292
255
  end
293
-
294
256
  end
@@ -3,7 +3,6 @@
3
3
  module Dnsimple
4
4
  class Client
5
5
  module Contacts
6
-
7
6
  # Lists the contacts in the account.
8
7
  #
9
8
  # @see https://developer.dnsimple.com/v2/contacts/#list
@@ -18,8 +17,8 @@ module Dnsimple
18
17
  # @example List contacts, provide a sorting policy
19
18
  # client.contacts.list(1010, sort: "email:asc")
20
19
  #
21
- # @param [Integer] account_id the account ID
22
- # @param [Hash] options the filtering and sorting options
20
+ # @param account_id [Integer] the account ID
21
+ # @param options [Hash] the filtering and sorting options
23
22
  # @option options [Integer] :page current page (pagination)
24
23
  # @option options [Integer] :per_page number of entries to return (pagination)
25
24
  # @option options [String] :sort sorting policy
@@ -44,8 +43,8 @@ module Dnsimple
44
43
  # @see https://developer.dnsimple.com/v2/contacts/#list
45
44
  # @see #contacts
46
45
  #
47
- # @param [Integer] account_id the account ID
48
- # @param [Hash] options the filtering and sorting options
46
+ # @param account_id [Integer] the account ID
47
+ # @param options [Hash] the filtering and sorting options
49
48
  # @option options [Integer] :page current page (pagination)
50
49
  # @option options [Integer] :per_page number of entries to return (pagination)
51
50
  # @option options [String] :sort sorting policy
@@ -60,9 +59,9 @@ module Dnsimple
60
59
  #
61
60
  # @see https://developer.dnsimple.com/v2/contacts/#create
62
61
  #
63
- # @param [Integer] account_id the account ID
64
- # @param [Hash] attributes
65
- # @param [Hash] options
62
+ # @param account_id [Integer] the account ID
63
+ # @param attributes [Hash]
64
+ # @param options [Hash]
66
65
  # @return [Dnsimple::Response<Dnsimple::Struct::Contact>]
67
66
  #
68
67
  # @raise [Dnsimple::RequestError]
@@ -77,9 +76,9 @@ module Dnsimple
77
76
  #
78
77
  # @see https://developer.dnsimple.com/v2/contacts/#get
79
78
  #
80
- # @param [Integer] account_id the account ID
81
- # @param [#to_s] contact_id the contact ID
82
- # @param [Hash] options
79
+ # @param account_id [Integer] the account ID
80
+ # @param contact_id [#to_s] the contact ID
81
+ # @param options [Hash]
83
82
  # @return [Dnsimple::Response<Dnsimple::Struct::Contact>]
84
83
  #
85
84
  # @raise [Dnsimple::NotFoundError]
@@ -94,10 +93,10 @@ module Dnsimple
94
93
  #
95
94
  # @see https://developer.dnsimple.com/v2/contacts/#update
96
95
  #
97
- # @param [Integer] account_id the account ID
98
- # @param [#to_s] contact_id the contact ID
99
- # @param [Hash] attributes
100
- # @param [Hash] options
96
+ # @param account_id [Integer] the account ID
97
+ # @param contact_id [#to_s] the contact ID
98
+ # @param attributes [Hash]
99
+ # @param options [Hash]
101
100
  # @return [Dnsimple::Response<Dnsimple::Struct::Contact>]
102
101
  #
103
102
  # @raise [Dnsimple::RequestError]
@@ -113,9 +112,9 @@ module Dnsimple
113
112
  #
114
113
  # @see https://developer.dnsimple.com/v2/contacts/#delete
115
114
  #
116
- # @param [Integer] account_id the account ID
117
- # @param [#to_s] contact_id the contact ID
118
- # @param [Hash] options
115
+ # @param account_id [Integer] the account ID
116
+ # @param contact_id [#to_s] the contact ID
117
+ # @param options [Hash]
119
118
  # @return [Dnsimple::Response<nil>]
120
119
  #
121
120
  # @raise [Dnsimple::NotFoundError]
@@ -125,7 +124,6 @@ module Dnsimple
125
124
 
126
125
  Dnsimple::Response.new(response, nil)
127
126
  end
128
-
129
127
  end
130
128
  end
131
129
  end
@@ -3,13 +3,12 @@
3
3
  module Dnsimple
4
4
  class Client
5
5
  module DnsAnalytics
6
-
7
6
  # Queries DNS Analytics data for the provided account
8
7
  #
9
8
  # @see https://developer.dnsimple.com/v2/dns-analytics#queryDnsAnalytics
10
9
  #
11
- # @param [Integer] account_id the account ID
12
- # @param [Hash] options the filtering, sorting, and grouping options
10
+ # @param account_id [Integer] the account ID
11
+ # @param options [Hash] the filtering, sorting, and grouping options
13
12
  # @option options [Integer] :page current page (pagination)
14
13
  # @option options [Integer] :per_page number of entries to return (pagination)
15
14
  # @option options [String] :sort sorting policy
@@ -24,7 +23,6 @@ module Dnsimple
24
23
 
25
24
  Dnsimple::PaginatedResponseWithQuery.new(response, response["data"]["rows"].map { |row| Struct::DnsAnalytics.new(response["data"]["headers"].zip(row)) })
26
25
  end
27
-
28
26
  end
29
27
  end
30
28
  end