dnsimple 5.2.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.rubocop.yml +4 -1
  4. data/.rubocop_dnsimple.yml +1 -38
  5. data/.rubocop_todo.yml +63 -5
  6. data/.travis.yml +7 -3
  7. data/CHANGELOG.md +10 -0
  8. data/CONTRIBUTING.md +2 -2
  9. data/Gemfile +3 -1
  10. data/LICENSE.txt +1 -1
  11. data/README.md +4 -4
  12. data/lib/dnsimple/client.rb +11 -3
  13. data/lib/dnsimple/client/domains.rb +0 -18
  14. data/lib/dnsimple/client/registrar.rb +20 -0
  15. data/lib/dnsimple/client/registrar_whois_privacy.rb +1 -1
  16. data/lib/dnsimple/default.rb +1 -1
  17. data/lib/dnsimple/extra.rb +1 -1
  18. data/lib/dnsimple/response.rb +1 -3
  19. data/lib/dnsimple/struct.rb +1 -0
  20. data/lib/dnsimple/struct/certificate.rb +0 -19
  21. data/lib/dnsimple/struct/domain.rb +0 -20
  22. data/lib/dnsimple/struct/domain_price.rb +24 -0
  23. data/lib/dnsimple/version.rb +1 -1
  24. data/spec/dnsimple/client/certificates_spec.rb +0 -1
  25. data/spec/dnsimple/client/client_service_spec.rb +1 -1
  26. data/spec/dnsimple/client/contacts_spec.rb +2 -2
  27. data/spec/dnsimple/client/domains_delegation_signer_records_spec.rb +1 -1
  28. data/spec/dnsimple/client/domains_email_forwards_spec.rb +8 -8
  29. data/spec/dnsimple/client/domains_pushes_spec.rb +2 -2
  30. data/spec/dnsimple/client/domains_spec.rb +1 -29
  31. data/spec/dnsimple/client/registrar_delegation_spec.rb +2 -2
  32. data/spec/dnsimple/client/registrar_spec.rb +46 -3
  33. data/spec/dnsimple/client/services_domains_spec.rb +2 -4
  34. data/spec/dnsimple/client/services_spec.rb +1 -3
  35. data/spec/dnsimple/client/templates_records_spec.rb +1 -1
  36. data/spec/dnsimple/client/templates_spec.rb +2 -2
  37. data/spec/dnsimple/client/webhooks_spec.rb +1 -1
  38. data/spec/dnsimple/client/zones_records_spec.rb +2 -2
  39. data/spec/dnsimple/client/zones_spec.rb +1 -1
  40. data/spec/fixtures.http/accounts/success-account.http +0 -1
  41. data/spec/fixtures.http/accounts/success-user.http +0 -1
  42. data/spec/fixtures.http/addCollaborator/invite-success.http +0 -1
  43. data/spec/fixtures.http/addCollaborator/success.http +0 -1
  44. data/spec/fixtures.http/appliedServices/success.http +0 -1
  45. data/spec/fixtures.http/cancelDomainTransfer/success.http +0 -1
  46. data/spec/fixtures.http/changeDomainDelegation/success.http +0 -1
  47. data/spec/fixtures.http/changeDomainDelegationToVanity/success.http +0 -1
  48. data/spec/fixtures.http/checkDomain/success.http +0 -1
  49. data/spec/fixtures.http/checkDomainPremiumPrice/error_400_not_a_premium_domain.http +18 -0
  50. data/spec/fixtures.http/checkDomainPremiumPrice/error_400_tld_not_supported.http +18 -0
  51. data/spec/fixtures.http/checkDomainPremiumPrice/success.http +20 -0
  52. data/spec/fixtures.http/checkZoneDistribution/error.http +0 -1
  53. data/spec/fixtures.http/checkZoneDistribution/failure.http +0 -1
  54. data/spec/fixtures.http/checkZoneDistribution/success.http +0 -1
  55. data/spec/fixtures.http/checkZoneRecordDistribution/error.http +0 -1
  56. data/spec/fixtures.http/checkZoneRecordDistribution/failure.http +0 -1
  57. data/spec/fixtures.http/checkZoneRecordDistribution/success.http +0 -1
  58. data/spec/fixtures.http/createContact/created.http +0 -1
  59. data/spec/fixtures.http/createDelegationSignerRecord/created.http +0 -1
  60. data/spec/fixtures.http/createDelegationSignerRecord/validation-error.http +0 -1
  61. data/spec/fixtures.http/createDomain/created.http +0 -1
  62. data/spec/fixtures.http/createEmailForward/created.http +21 -17
  63. data/spec/fixtures.http/createPrimaryServer/created.http +21 -0
  64. data/spec/fixtures.http/createSecondaryZone/created.http +21 -0
  65. data/spec/fixtures.http/createTemplate/created.http +0 -1
  66. data/spec/fixtures.http/createTemplateRecord/created.http +0 -1
  67. data/spec/fixtures.http/createWebhook/created.http +0 -1
  68. data/spec/fixtures.http/createZoneRecord/created-apex.http +0 -1
  69. data/spec/fixtures.http/createZoneRecord/created.http +0 -1
  70. data/spec/fixtures.http/deleteContact/error-contact-in-use.http +18 -0
  71. data/spec/fixtures.http/deleteEmailForward/success.http +12 -7
  72. data/spec/fixtures.http/disableDnssec/not-enabled.http +0 -1
  73. data/spec/fixtures.http/disableWhoisPrivacy/success.http +0 -1
  74. data/spec/fixtures.http/downloadCertificate/success.http +0 -1
  75. data/spec/fixtures.http/enableDnssec/success.http +0 -1
  76. data/spec/fixtures.http/enableVanityNameServers/success.http +0 -1
  77. data/spec/fixtures.http/enableWhoisPrivacy/created.http +0 -1
  78. data/spec/fixtures.http/enableWhoisPrivacy/success.http +0 -1
  79. data/spec/fixtures.http/getCertificate/success.http +0 -1
  80. data/spec/fixtures.http/getCertificatePrivateKey/success.http +0 -1
  81. data/spec/fixtures.http/getContact/success.http +0 -1
  82. data/spec/fixtures.http/getDelegationSignerRecord/success.http +0 -1
  83. data/spec/fixtures.http/getDnssec/success.http +0 -1
  84. data/spec/fixtures.http/getDomain/success.http +0 -1
  85. data/spec/fixtures.http/getDomainDelegation/success-empty.http +0 -1
  86. data/spec/fixtures.http/getDomainDelegation/success.http +0 -1
  87. data/spec/fixtures.http/getDomainPremiumPrice/failure.http +0 -1
  88. data/spec/fixtures.http/getDomainPremiumPrice/success.http +0 -1
  89. data/spec/fixtures.http/getDomainPrices/failure.http +19 -0
  90. data/spec/fixtures.http/getDomainPrices/success.http +21 -0
  91. data/spec/fixtures.http/getDomainTransfer/success.http +0 -1
  92. data/spec/fixtures.http/getEmailForward/success.http +14 -10
  93. data/spec/fixtures.http/getPrimaryServer/success.http +21 -0
  94. data/spec/fixtures.http/getService/success.http +0 -1
  95. data/spec/fixtures.http/getTemplate/success.http +0 -1
  96. data/spec/fixtures.http/getTemplateRecord/success.http +0 -1
  97. data/spec/fixtures.http/getTld/success.http +0 -1
  98. data/spec/fixtures.http/getTldExtendedAttributes/success-attributes.http +0 -1
  99. data/spec/fixtures.http/getTldExtendedAttributes/success-noattributes.http +0 -1
  100. data/spec/fixtures.http/getTldExtendedAttributes/success.http +0 -1
  101. data/spec/fixtures.http/getWebhook/success.http +0 -1
  102. data/spec/fixtures.http/getWhoisPrivacy/success.http +0 -1
  103. data/spec/fixtures.http/getZone/success.http +0 -1
  104. data/spec/fixtures.http/getZoneFile/success.http +0 -1
  105. data/spec/fixtures.http/getZoneRecord/success.http +0 -1
  106. data/spec/fixtures.http/initiatePush/success.http +0 -1
  107. data/spec/fixtures.http/issueLetsencryptCertificate/success.http +0 -1
  108. data/spec/fixtures.http/issueRenewalLetsencryptCertificate/success.http +0 -1
  109. data/spec/fixtures.http/linkPrimaryServer/success.http +21 -0
  110. data/spec/fixtures.http/listAccounts/success-account.http +0 -1
  111. data/spec/fixtures.http/listAccounts/success-user.http +0 -1
  112. data/spec/fixtures.http/listCertificates/success.http +0 -1
  113. data/spec/fixtures.http/listCollaborators/success.http +0 -1
  114. data/spec/fixtures.http/listContacts/success.http +0 -1
  115. data/spec/fixtures.http/listDelegationSignerRecords/success.http +0 -1
  116. data/spec/fixtures.http/listDomains/success.http +0 -1
  117. data/spec/fixtures.http/listEmailForwards/success.http +0 -1
  118. data/spec/fixtures.http/listPrimaryServers/success.http +21 -0
  119. data/spec/fixtures.http/listPushes/success.http +0 -1
  120. data/spec/fixtures.http/listServices/success.http +0 -1
  121. data/spec/fixtures.http/listTemplateRecords/success.http +0 -1
  122. data/spec/fixtures.http/listTemplates/success.http +0 -1
  123. data/spec/fixtures.http/listTlds/success.http +0 -1
  124. data/spec/fixtures.http/listWebhooks/success.http +0 -1
  125. data/spec/fixtures.http/listZoneRecords/success.http +0 -1
  126. data/spec/fixtures.http/listZones/success.http +0 -1
  127. data/spec/fixtures.http/method-not-allowed.http +0 -1
  128. data/spec/fixtures.http/notfound-certificate.http +0 -1
  129. data/spec/fixtures.http/notfound-collaborator.http +0 -1
  130. data/spec/fixtures.http/notfound-contact.http +0 -1
  131. data/spec/fixtures.http/notfound-delegationsignerrecord.http +0 -1
  132. data/spec/fixtures.http/notfound-domain.http +0 -1
  133. data/spec/fixtures.http/notfound-domainpush.http +0 -1
  134. data/spec/fixtures.http/notfound-emailforward.http +0 -1
  135. data/spec/fixtures.http/notfound-record.http +0 -1
  136. data/spec/fixtures.http/notfound-template.http +0 -1
  137. data/spec/fixtures.http/notfound-webhook.http +0 -1
  138. data/spec/fixtures.http/notfound-whoisprivacy.http +0 -1
  139. data/spec/fixtures.http/notfound-zone.http +0 -1
  140. data/spec/fixtures.http/oauthAccessToken/error-invalid-request.http +0 -1
  141. data/spec/fixtures.http/oauthAccessToken/success.http +0 -1
  142. data/spec/fixtures.http/pages-1of3.http +0 -1
  143. data/spec/fixtures.http/pages-2of3.http +0 -1
  144. data/spec/fixtures.http/pages-3of3.http +0 -1
  145. data/spec/fixtures.http/purchaseLetsencryptCertificate/success.http +0 -1
  146. data/spec/fixtures.http/purchaseRenewalLetsencryptCertificate/success.http +0 -1
  147. data/spec/fixtures.http/registerDomain/success.http +0 -1
  148. data/spec/fixtures.http/renewDomain/error-tooearly.http +0 -1
  149. data/spec/fixtures.http/renewDomain/success.http +0 -1
  150. data/spec/fixtures.http/renewWhoisPrivacy/success.http +0 -1
  151. data/spec/fixtures.http/renewWhoisPrivacy/whois-privacy-duplicated-order.http +0 -1
  152. data/spec/fixtures.http/renewWhoisPrivacy/whois-privacy-not-found.http +0 -1
  153. data/spec/fixtures.http/response.http +0 -1
  154. data/spec/fixtures.http/transferDomain/error-indnsimple.http +0 -1
  155. data/spec/fixtures.http/transferDomain/error-missing-authcode.http +0 -1
  156. data/spec/fixtures.http/transferDomain/success.http +0 -1
  157. data/spec/fixtures.http/unlinkPrimaryServer/success.http +21 -0
  158. data/spec/fixtures.http/updateContact/success.http +0 -1
  159. data/spec/fixtures.http/updateTemplate/success.http +0 -1
  160. data/spec/fixtures.http/updateZoneRecord/success.http +0 -1
  161. data/spec/fixtures.http/validation-error.http +0 -1
  162. data/spec/fixtures.http/whoami/success-account.http +0 -1
  163. data/spec/fixtures.http/whoami/success-user.http +0 -1
  164. data/spec/fixtures.http/whoami/success.http +0 -1
  165. data/spec/spec_helper.rb +1 -1
  166. metadata +31 -8
  167. data/spec/fixtures.http/resetDomainToken/success.http +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb65512fa0b18965225026494660cee2722a79b2bfd0f54e514c66ab4671d4c6
4
- data.tar.gz: af619ac80882ec17cea64ba6ea7d3552688cb08a2b0306aaf2b909e8d23a5555
3
+ metadata.gz: a4f667eba7dc3bc3e7718657059de2cc752f966d748b0698326feefad1f93111
4
+ data.tar.gz: 82eabdcd7a27df808db076d4d65bfb196343c3aa607e42d61ba1ff8f7b328349
5
5
  SHA512:
6
- metadata.gz: 32f3d80ebbf898ed8dcd8ecd30b32f1e27caf5883f05c8a86874227a739eedd8b81cb30dbb31651797de927257d025b54bc57d9d324c5eb4fb196483ecf22e60
7
- data.tar.gz: 5f793cf92e6b11a46eca6eaaee769580cb1b168b94d3b9e10c0605eda6865c954dacee9daf213575b950b5c7557475947c0e578d3267208b5098d96073989653
6
+ metadata.gz: 8ee87e28d8fd2fef38a9282905146831321e9a443c08216e2399fc577ba957da835df45d8a31052a4c8a12c7db2373ad8b96ed0b7a86072de20b6c2772b3e56c
7
+ data.tar.gz: dae840d8c7d5f3c86af8f959ba07b5310f6e852e351b84c42166621e181de41604fb1d43be6ffe1c651002840f37dcc3b16eebadf6c9beed90d1c46e9f693aa5
data/.gitignore CHANGED
@@ -7,3 +7,6 @@ Gemfile.lock
7
7
  .yardoc
8
8
  yardoc/
9
9
  doc/
10
+
11
+ #ASDF
12
+ .tool-versions
data/.rubocop.yml CHANGED
@@ -2,7 +2,10 @@ inherit_from:
2
2
  - .rubocop_todo.yml
3
3
  - .rubocop_dnsimple.yml
4
4
 
5
- require: rubocop-performance
5
+ require:
6
+ - rubocop-performance
7
+ - rubocop-rake
8
+ - rubocop-rspec
6
9
 
7
10
  AllCops:
8
11
  Exclude:
@@ -8,6 +8,7 @@ AllCops:
8
8
  Exclude:
9
9
  # Exclude .gemspec files because they are generally auto-generated
10
10
  - '*.gemspec'
11
+ NewCops: enable
11
12
 
12
13
  # In most cases, Gems are sorted alphabetically.
13
14
  # However, in some few cases the order is relevant due to dependencies.
@@ -377,41 +378,3 @@ Layout/MultilineOperationIndentation:
377
378
  #
378
379
  Layout/SpaceInsidePercentLiteralDelimiters:
379
380
  Enabled: false
380
-
381
-
382
- # New cops
383
- # We'll remove them once they become defaults.
384
- # See https://docs.rubocop.org/en/latest/versioning/
385
-
386
-
387
- Layout/SpaceAroundMethodCallOperator:
388
- Enabled: true
389
-
390
- Lint/RaiseException:
391
- Enabled: true
392
-
393
- Lint/StructNewOverride:
394
- Enabled: true
395
-
396
- Style/ExponentialNotation:
397
- Enabled: true
398
-
399
- Layout/EmptyLinesAroundAttributeAccessor:
400
- Enabled: true
401
-
402
- Style/SlicingWithRange:
403
- Enabled: true
404
-
405
- # Introduced in rubocop 0.84.0
406
- Lint/DeprecatedOpenSSLConstant:
407
- Enabled: true
408
-
409
- # Introduced in rubocop 0.85.0
410
- Lint/MixedRegexpCaptureTypes:
411
- Enabled: true
412
-
413
- Style/RedundantRegexpCharacterClass:
414
- Enabled: true
415
-
416
- Style/RedundantRegexpEscape:
417
- Enabled: true
data/.rubocop_todo.yml CHANGED
@@ -1,14 +1,72 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2016-03-27 01:01:12 +0100 using RuboCop version 0.38.0.
3
+ # on 2021-04-05 15:23:33 UTC using RuboCop version 1.12.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- Style/Documentation:
10
- # Silence this check for now until we fix it.
9
+ # Offense count: 6
10
+ # Configuration parameters: Prefixes.
11
+ # Prefixes: when, with, without
12
+ RSpec/ContextWording:
13
+ Exclude:
14
+ - 'spec/dnsimple/client/domains_collaborators_spec.rb'
15
+ - 'spec/dnsimple/options/list_options_spec.rb'
16
+
17
+ # Offense count: 70
18
+ # Configuration parameters: Max.
19
+ RSpec/ExampleLength:
11
20
  Enabled: false
21
+
22
+ # Offense count: 1
23
+ RSpec/LeakyConstantDeclaration:
12
24
  Exclude:
13
- - 'spec/**/*'
14
- - 'test/**/*'
25
+ - 'spec/dnsimple/client/client_service_spec.rb'
26
+
27
+ # Offense count: 21
28
+ # Configuration parameters: .
29
+ # SupportedStyles: have_received, receive
30
+ RSpec/MessageSpies:
31
+ EnforcedStyle: receive
32
+
33
+ # Offense count: 117
34
+ RSpec/MultipleExpectations:
35
+ Max: 16
36
+
37
+ # Offense count: 374
38
+ # Configuration parameters: IgnoreSharedExamples.
39
+ RSpec/NamedSubject:
40
+ Enabled: false
41
+
42
+ # Offense count: 10
43
+ RSpec/StubbedMock:
44
+ Exclude:
45
+ - 'spec/dnsimple/client_spec.rb'
46
+
47
+ # Offense count: 16
48
+ RSpec/SubjectStub:
49
+ Exclude:
50
+ - 'spec/dnsimple/client/certificates_spec.rb'
51
+ - 'spec/dnsimple/client/contacts_spec.rb'
52
+ - 'spec/dnsimple/client/domains_delegation_signer_records_spec.rb'
53
+ - 'spec/dnsimple/client/domains_email_forwards_spec.rb'
54
+ - 'spec/dnsimple/client/domains_spec.rb'
55
+ - 'spec/dnsimple/client/services_spec.rb'
56
+ - 'spec/dnsimple/client/templates_records_spec.rb'
57
+ - 'spec/dnsimple/client/templates_spec.rb'
58
+ - 'spec/dnsimple/client/tlds_spec.rb'
59
+ - 'spec/dnsimple/client/zones_records_spec.rb'
60
+ - 'spec/dnsimple/client/zones_spec.rb'
61
+ - 'spec/dnsimple/client_spec.rb'
62
+
63
+ # Offense count: 5
64
+ # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
65
+ RSpec/VerifiedDoubles:
66
+ Exclude:
67
+ - 'spec/dnsimple/client_spec.rb'
68
+
69
+ # Offense count: 39
70
+ # Configuration parameters: AllowedConstants.
71
+ Style/Documentation:
72
+ Enabled: false
data/.travis.yml CHANGED
@@ -5,13 +5,17 @@ rvm:
5
5
  - 2.5
6
6
  - 2.6
7
7
  - 2.7
8
+ - 3.0
9
+ - ruby-head
10
+
11
+ matrix:
12
+ allow_failures:
13
+ - rvm: ruby-head
8
14
 
9
15
  env:
10
16
  - COVERALL=1
11
17
 
12
- before_install:
13
- - gem install bundler -v 1.17.3
14
-
15
18
  notifications:
19
+ email: false
16
20
  slack:
17
21
  secure: "N9zPR5jnF1TBiqvb3mCV6Wem3TIvqu4tXiob2P66vBMwmj1ewWvyUzNLwAEOCDc3mRfsI50IYXHewckAUpCWW7XEJlT/pv8llMsoiHqArb7SGJyDdy3ZRr35L7glixs/ikod+xhRKXMM3jML/2MgSa+Culzhl42tMUFDk+bBBQU="
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  This project uses [Semantic Versioning 2.0.0](http://semver.org/).
4
4
 
5
+ ## main
6
+
7
+ ## 6.0.0
8
+
9
+ - NEW: Added `registrar.get_domain_prices` to retrieve whether a domain is premium and the prices to register, transfer, and renew. (dnsimple/dnsimple-ruby#230)
10
+ - REMOVED: `domain.reset_domain_token` endpoint no longer exists and the client method is removed.
11
+ (dnsimple/dnsimple-ruby#231)
12
+ - REMOVED: The deprecated `Domain.expires_on` is removed. (dnsimple/dnsimple-ruby#232)
13
+ - REMOVED: The deprecated `Certificate.expires_on` is removed. (dnsimple/dnsimple-ruby#232)
14
+
5
15
  ## 5.2.0
6
16
 
7
17
  - CHANGED: `Certificate#expires_on` (date only) is deprecated in favor of `Certificate#expires_at` (timestamp). (dnsimple/dnsimple-ruby#190)
data/CONTRIBUTING.md CHANGED
@@ -36,13 +36,13 @@ The following instructions uses `$VERSION` as a placeholder, where `$VERSION` is
36
36
 
37
37
  1. Run the test suite and ensure all the tests pass.
38
38
 
39
- 1. Finalize the `## master` section in `CHANGELOG.md` assigning the version.
39
+ 1. Finalize the `## main` section in `CHANGELOG.md` assigning the version.
40
40
 
41
41
  1. Commit and push the changes
42
42
 
43
43
  ```shell
44
44
  git commit -a -m "Release $VERSION"
45
- git push origin master
45
+ git push origin main
46
46
  ```
47
47
 
48
48
  1. Wait for CI to complete.
data/Gemfile CHANGED
@@ -5,5 +5,7 @@ source 'https://rubygems.org'
5
5
  gemspec
6
6
 
7
7
  gem 'coveralls', require: false
8
- gem 'rubocop', '0.85.1', require: false
8
+ gem 'rubocop', '1.12.1', require: false
9
9
  gem 'rubocop-performance', require: false
10
+ gem 'rubocop-rake', require: false
11
+ gem 'rubocop-rspec', require: false
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2010-2020 DNSimple Corporation
3
+ Copyright (c) 2010-2021 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
@@ -2,8 +2,8 @@
2
2
 
3
3
  A Ruby client for the [DNSimple API v2](https://developer.dnsimple.com/v2/).
4
4
 
5
- [![Build Status](https://travis-ci.com/dnsimple/dnsimple-ruby.svg?branch=master)](https://travis-ci.com/dnsimple/dnsimple-ruby)
6
- [![Coverage Status](https://img.shields.io/coveralls/dnsimple/dnsimple-ruby.svg)](https://coveralls.io/r/dnsimple/dnsimple-ruby?branch=master)
5
+ [![Build Status](https://travis-ci.com/dnsimple/dnsimple-ruby.svg?branch=main)](https://travis-ci.com/dnsimple/dnsimple-ruby)
6
+ [![Coverage Status](https://img.shields.io/coveralls/dnsimple/dnsimple-ruby.svg)](https://coveralls.io/r/dnsimple/dnsimple-ruby?branch=main)
7
7
 
8
8
  [DNSimple](https://dnsimple.com/) provides DNS hosting and domain registration that is simple and friendly.
9
9
  We provide a full API and an easy-to-use web interface so you can get your domain registered and set up with a minimal amount of effort.
@@ -20,7 +20,7 @@ gem install dnsimple
20
20
  Or use Bundler and define it as a dependency in your Gemfile:
21
21
 
22
22
  ```
23
- gem 'dnsimple', '~> 4.0'
23
+ gem 'dnsimple', '~> 6.0'
24
24
  ```
25
25
 
26
26
  ## Usage
@@ -90,4 +90,4 @@ We recommend to customize the user agent. If you are building a library or integ
90
90
 
91
91
  ## License
92
92
 
93
- Copyright (c) 2010-2020 DNSimple Corporation. This is Free Software distributed under the MIT license.
93
+ Copyright (c) 2010-2021 DNSimple Corporation. This is Free Software distributed under the MIT license.
@@ -42,22 +42,30 @@ module Dnsimple
42
42
  # @!attribute username
43
43
  # @see https://developer.dnsimple.com/v2/#authentication
44
44
  # @return [String] DNSimple username for Basic Authentication
45
+ attr_accessor :username
46
+
45
47
  # @!attribute password
46
48
  # @see https://developer.dnsimple.com/v2/#authentication
47
49
  # @return [String] DNSimple password for Basic Authentication
50
+ attr_accessor :password
51
+
48
52
  # @!attribute domain_api_token
49
53
  # @see https://developer.dnsimple.com/v2/#authentication
50
54
  # @return [String] Domain API access token for authentication
55
+ attr_accessor :domain_api_token
56
+
51
57
  # @!attribute access_token
52
58
  # @see https://developer.dnsimple.com/v2/#authentication
53
59
  # @return [String] Domain API access token for authentication
60
+ attr_accessor :access_token
61
+
54
62
  # @!attribute user_agent
55
63
  # @return [String] Configure User-Agent header for requests.
64
+ attr_accessor :user_agent
65
+
56
66
  # @!attribute proxy
57
67
  # @return [String,nil] Configure address:port values for proxy server
58
-
59
- attr_accessor :username, :password, :domain_api_token, :access_token,
60
- :user_agent, :proxy
68
+ attr_accessor :proxy
61
69
 
62
70
 
63
71
  def initialize(options = {})
@@ -114,24 +114,6 @@ module Dnsimple
114
114
 
115
115
  Dnsimple::Response.new(response, nil)
116
116
  end
117
-
118
- # Resets the domain token.
119
- #
120
- # @see https://developer.dnsimple.com/v2/domains/#reset-token
121
- #
122
- # @param [Integer] account_id the account ID
123
- # @param [#to_s] domain_id The domain ID or domain name
124
- # @param [Hash] options
125
- # @return [Dnsimple::Response<nil>]
126
- #
127
- # @raise [Dnsimple::NotFoundError]
128
- # @raise [Dnsimple::RequestError]
129
- def reset_domain_token(account_id, domain_id, options = {})
130
- response = client.post(Client.versioned("/%s/domains/%s/token" % [account_id, domain_id]), nil, options)
131
-
132
- Dnsimple::Response.new(response, Struct::Domain.new(response["data"]))
133
- end
134
-
135
117
  end
136
118
  end
137
119
  end
@@ -50,6 +50,26 @@ module Dnsimple
50
50
  Dnsimple::Response.new(response, Struct::DomainPremiumPrice.new(response["data"]))
51
51
  end
52
52
 
53
+ # Get prices for a domain.
54
+ # @see https://developer.dnsimple.com/v2/registrar/#getDomainPrices
55
+ #
56
+ # @example Check prices for example.com:
57
+ # client.registrar.get_domain_prices(1010, "example.com")
58
+ #
59
+ # @param [Integer] account_id the Account id
60
+ # @param [String] domain_name the domain name to find the prices
61
+ # @param [Hash] options
62
+ #
63
+ # @return [Struct::DomainPrice]
64
+ #
65
+ # @raise [RequestError] When the request fails.
66
+ def get_domain_prices(account_id, domain_name, options = {})
67
+ endpoint = Client.versioned("/%s/registrar/domains/%s/prices" % [account_id, domain_name])
68
+ response = client.get(endpoint, options)
69
+
70
+ Dnsimple::Response.new(response, Struct::DomainPrice.new(response["data"]))
71
+ end
72
+
53
73
  # Registers a domain.
54
74
  #
55
75
  # @see https://developer.dnsimple.com/v2/registrar/#register
@@ -78,7 +78,7 @@ module Dnsimple
78
78
  #
79
79
  # @raise [RequestError] When the request fails.
80
80
  def renew_whois_privacy(account_id, domain_name, options = {})
81
- endpoint = whois_privacy_endpoint(account_id, domain_name) + "/renewals"
81
+ endpoint = "#{whois_privacy_endpoint(account_id, domain_name)}/renewals"
82
82
  response = client.post(endpoint, nil, options)
83
83
 
84
84
  Dnsimple::Response.new(response, Struct::WhoisPrivacyRenewal.new(response["data"]))
@@ -30,7 +30,7 @@ module Dnsimple
30
30
  # Configuration options
31
31
  # @return [Hash]
32
32
  def options
33
- Hash[keys.map { |key| [key, send(key)] }]
33
+ keys.map { |key| [key, send(key)] }.to_h
34
34
  end
35
35
 
36
36
  # Default API endpoint from ENV or {BASE_URL}
@@ -36,7 +36,7 @@ module Dnsimple
36
36
  this[current_key] = if this_value.is_a?(Hash) && other_value.is_a?(Hash)
37
37
  deep_merge(this_value, other_value, &block)
38
38
  else
39
- if block_given? && key?(current_key)
39
+ if block && key?(current_key)
40
40
  block.call(current_key, this_value, other_value)
41
41
  else
42
42
  other_value
@@ -41,9 +41,7 @@ module Dnsimple
41
41
 
42
42
  # The CollectionResponse is a specific type of Response where the data is a collection of enumerable objects.
43
43
  class CollectionResponse < Response
44
- def initialize(http_response, collection)
45
- super
46
- end
44
+
47
45
  end
48
46
 
49
47
  # The PaginatedResponse is a specific type of Response that also exposes pagination metadata.
@@ -27,6 +27,7 @@ require_relative 'struct/dnssec'
27
27
  require_relative 'struct/domain'
28
28
  require_relative 'struct/domain_check'
29
29
  require_relative 'struct/domain_premium_price'
30
+ require_relative 'struct/domain_price'
30
31
  require_relative 'struct/domain_push'
31
32
  require_relative 'struct/domain_registration'
32
33
  require_relative 'struct/domain_transfer'
@@ -4,13 +4,6 @@ module Dnsimple
4
4
  module Struct
5
5
 
6
6
  class Certificate < Base
7
-
8
- def initialize(attributes = {})
9
- attributes.delete("expires_on")
10
- super
11
- @expires_on = Date.parse(expires_at).to_s if expires_at
12
- end
13
-
14
7
  # @return [Integer] The certificate ID in DNSimple.
15
8
  attr_accessor :id
16
9
 
@@ -49,18 +42,6 @@ module Dnsimple
49
42
 
50
43
  # @return [String] The timestamp when the certificate will expire.
51
44
  attr_accessor :expires_at
52
-
53
- # @deprecated Please use #expires_at instead.
54
- # @return [String] The date when the certificate will expire.
55
- def expires_on
56
- warn "[DEPRECATION] Certificate#expires_on is deprecated. Please use `expires_at` instead."
57
- @expires_on
58
- end
59
-
60
- def expires_on=(expiration_date)
61
- warn "[DEPRECATION] Certificate#expires_on= is deprecated. Please use `expires_at=` instead."
62
- @expires_on = expiration_date
63
- end
64
45
  end
65
46
 
66
47
  end
@@ -4,13 +4,6 @@ module Dnsimple
4
4
  module Struct
5
5
 
6
6
  class Domain < Base
7
-
8
- def initialize(attributes = {})
9
- attributes.delete("expires_on")
10
- super
11
- @expires_on = Date.parse(expires_at).to_s if expires_at
12
- end
13
-
14
7
  # @return [Integer] The domain ID in DNSimple.
15
8
  attr_accessor :id
16
9
 
@@ -43,19 +36,6 @@ module Dnsimple
43
36
 
44
37
  # @return [String] When the domain was last updated in DNSimple.
45
38
  attr_accessor :updated_at
46
-
47
- # @deprecated Please use #expires_at instead.
48
- # @return [String] The date the domain will expire.
49
- def expires_on
50
- warn "[DEPRECATION] Domain#expires_on is deprecated. Please use `expires_at` instead."
51
- @expires_on
52
- end
53
-
54
- def expires_on=(expiration_date)
55
- warn "[DEPRECATION] Domain#expires_on= is deprecated. Please use `expires_at=` instead."
56
- @expires_on = expiration_date
57
- end
58
-
59
39
  end
60
40
  end
61
41
  end