dnsimple 8.7.1 → 8.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/auto-merge.yml +1 -1
  3. data/.github/workflows/ci.yml +1 -13
  4. data/.github/workflows/release.yml +2 -2
  5. data/.rubocop_dnsimple.yml +19 -76
  6. data/CHANGELOG.md +4 -0
  7. data/Gemfile +5 -2
  8. data/lib/dnsimple/client/billing.rb +2 -0
  9. data/lib/dnsimple/client/clients.rb +45 -0
  10. data/lib/dnsimple/client/dns_analytics.rb +30 -0
  11. data/lib/dnsimple/client/domains.rb +1 -0
  12. data/lib/dnsimple/client/domains_dnssec.rb +1 -0
  13. data/lib/dnsimple/client/domains_pushes.rb +0 -1
  14. data/lib/dnsimple/client/identity.rb +2 -0
  15. data/lib/dnsimple/client/registrar.rb +1 -0
  16. data/lib/dnsimple/client/registrar_registrant_changes.rb +1 -0
  17. data/lib/dnsimple/client/services.rb +1 -0
  18. data/lib/dnsimple/client/templates_records.rb +1 -0
  19. data/lib/dnsimple/client/tlds.rb +2 -0
  20. data/lib/dnsimple/client.rb +0 -1
  21. data/lib/dnsimple/default.rb +1 -2
  22. data/lib/dnsimple/error.rb +8 -2
  23. data/lib/dnsimple/options.rb +10 -0
  24. data/lib/dnsimple/response.rb +12 -0
  25. data/lib/dnsimple/struct/account.rb +2 -2
  26. data/lib/dnsimple/struct/certificate.rb +2 -2
  27. data/lib/dnsimple/struct/certificate_bundle.rb +0 -2
  28. data/lib/dnsimple/struct/certificate_purchase.rb +2 -2
  29. data/lib/dnsimple/struct/certificate_renewal.rb +2 -2
  30. data/lib/dnsimple/struct/charge.rb +3 -1
  31. data/lib/dnsimple/struct/collaborator.rb +2 -2
  32. data/lib/dnsimple/struct/contact.rb +2 -2
  33. data/lib/dnsimple/struct/delegation_signer_record.rb +2 -2
  34. data/lib/dnsimple/struct/dns_analytics.rb +18 -0
  35. data/lib/dnsimple/struct/dnssec.rb +2 -2
  36. data/lib/dnsimple/struct/domain.rb +2 -1
  37. data/lib/dnsimple/struct/domain_check.rb +2 -2
  38. data/lib/dnsimple/struct/domain_premium_price.rb +2 -2
  39. data/lib/dnsimple/struct/domain_price.rb +2 -2
  40. data/lib/dnsimple/struct/domain_push.rb +2 -2
  41. data/lib/dnsimple/struct/domain_registration.rb +2 -2
  42. data/lib/dnsimple/struct/domain_renewal.rb +2 -2
  43. data/lib/dnsimple/struct/domain_transfer.rb +2 -2
  44. data/lib/dnsimple/struct/email_forward.rb +2 -1
  45. data/lib/dnsimple/struct/extended_attribute.rb +2 -2
  46. data/lib/dnsimple/struct/oauth_token.rb +2 -2
  47. data/lib/dnsimple/struct/registrant_change.rb +2 -1
  48. data/lib/dnsimple/struct/registrant_change_check.rb +2 -1
  49. data/lib/dnsimple/struct/service.rb +2 -2
  50. data/lib/dnsimple/struct/template.rb +2 -2
  51. data/lib/dnsimple/struct/template_record.rb +2 -2
  52. data/lib/dnsimple/struct/tld.rb +2 -2
  53. data/lib/dnsimple/struct/transfer_lock.rb +2 -2
  54. data/lib/dnsimple/struct/user.rb +2 -2
  55. data/lib/dnsimple/struct/vanity_name_server.rb +2 -2
  56. data/lib/dnsimple/struct/webhook.rb +2 -2
  57. data/lib/dnsimple/struct/whoami.rb +2 -2
  58. data/lib/dnsimple/struct/whois_privacy.rb +2 -2
  59. data/lib/dnsimple/struct/whois_privacy_renewal.rb +2 -2
  60. data/lib/dnsimple/struct/zone.rb +2 -2
  61. data/lib/dnsimple/struct/zone_distribution.rb +2 -2
  62. data/lib/dnsimple/struct/zone_file.rb +2 -2
  63. data/lib/dnsimple/struct/zone_record.rb +2 -2
  64. data/lib/dnsimple/struct.rb +4 -3
  65. data/lib/dnsimple/version.rb +3 -1
  66. data/spec/dnsimple/client/dns_analytics_spec.rb +84 -0
  67. data/spec/dnsimple/client/registrar_delegation_spec.rb +4 -4
  68. data/spec/dnsimple/client/vanity_name_servers_spec.rb +1 -1
  69. data/spec/dnsimple/client/zones_records_spec.rb +2 -2
  70. data/spec/dnsimple/client_spec.rb +2 -2
  71. data/spec/dnsimple/extra_spec.rb +1 -1
  72. data/spec/fixtures.http/dnsAnalytics/success.http +20 -0
  73. metadata +7 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cce6708be83ba43b6fdf2a1ce120b7b28fda094be88b6ef343d2abcb99ae1d3
4
- data.tar.gz: ea60f222bb97f0f3a6c699aea0ba46bb0cf5be9dec717cbf39b7cc8f2969dea7
3
+ metadata.gz: 874a1e978f9845bb7a50c9f596fb30b22186730498972ed4c538664939c9e3d6
4
+ data.tar.gz: 1a1ec6d73ca64499a9e9462529d18f9e8643a619a349310c5e3b4e6f0c3d8050
5
5
  SHA512:
6
- metadata.gz: 948abbbf7c8a1da2fa915228d1d21edeb11405956e1a281b607c5d1ba54c919bae996e287dc3ef3748c4a81478bdd4e3c408dc47e939f9b4e28396de5ea3a7fb
7
- data.tar.gz: 3ad4039b036f5e817ea4fdb15e4c7fc2908ac8935c01dd9130b3fefb6727aa020372f1fdd523a82181c07751415a91a2aee683b78193e754075f9b730ac6391d
6
+ metadata.gz: d28ef3ce63861291b5b95bb7d373685367c25bb33e3ddf42ee403e8d8c3963d8e0bf377280ca97560ac142855ee4b1d6de74cdad6241a534a3978c5aa6c17085
7
+ data.tar.gz: a0bef36ed74defb05757c8ed9e21d90198c5fee95530da0c77212f4fa303c5bb6ce4773989d5ed8ac2e8f78068e2d3d92044593fb53d2c14ea7a9f1c1a5fbe49
@@ -16,7 +16,7 @@ jobs:
16
16
  if: github.event.pull_request.user.login == 'dependabot[bot]' && contains(github.event.pull_request.labels.*.name, 'automerge')
17
17
  steps:
18
18
  - name: Wait for tests to succeed
19
- uses: lewagon/wait-on-check-action@v1.3.1
19
+ uses: lewagon/wait-on-check-action@v1.3.3
20
20
  timeout-minutes: 15
21
21
  with:
22
22
  ref: ${{ github.ref }}
@@ -34,6 +34,7 @@ jobs:
34
34
  - '3.0'
35
35
  - '3.1'
36
36
  - '3.2'
37
+ - '3.3'
37
38
  - 'ruby-head'
38
39
  - 'truffleruby-head'
39
40
  steps:
@@ -44,16 +45,3 @@ jobs:
44
45
  ruby-version: ${{ matrix.ruby-version }}
45
46
  bundler-cache: true
46
47
  - run: bundle exec rake
47
-
48
- slack-workflow-status:
49
- if: always()
50
- name: Post Workflow Status To Slack
51
- needs:
52
- - test
53
- runs-on: ubuntu-latest
54
- steps:
55
- - name: Slack Workflow Notification
56
- uses: Gamesight/slack-workflow-status@master
57
- with:
58
- repo_token: ${{secrets.GITHUB_TOKEN}}
59
- slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL_DEVELOPMENT}}
@@ -7,11 +7,11 @@ on:
7
7
  jobs:
8
8
  publish:
9
9
  name: Release to RubyGems
10
- runs-on: ubuntu-20.04
10
+ runs-on: ubuntu-latest
11
11
 
12
12
  steps:
13
13
  - name: Wait for tests to succeed
14
- uses: lewagon/wait-on-check-action@v1.3.1
14
+ uses: lewagon/wait-on-check-action@v1.3.3
15
15
  with:
16
16
  ref: 'refs/heads/main'
17
17
  running-workflow-name: 'Release to RubyGems'
@@ -1,4 +1,3 @@
1
- ---
2
1
  # Defaults https://github.com/bbatsov/rubocop/blob/master/config/default.yml
3
2
  #
4
3
  # References:
@@ -25,8 +24,8 @@ Layout/AccessModifierIndentation:
25
24
  Layout/BlockEndNewline:
26
25
  Enabled: false
27
26
 
28
- # Generally, the keyword style uses a lot of space. This is particularly true
29
- # when you use case/if statements, in combination with a long-name variable.
27
+ # Generally, the keyword style uses a lot of space. This is particularly true when
28
+ # you use case/if statements, in combination with a long-name variable.
30
29
  #
31
30
  # invoice_error_message = case error
32
31
  # when 1 == 1
@@ -123,10 +122,9 @@ Naming/RescuedExceptionsVariableName:
123
122
  Naming/MethodParameterName:
124
123
  Enabled: false
125
124
 
126
- # This cop returns false positive violations (as of rubocop 0.57.0)
127
- # https://github.com/rubocop-hq/rubocop/issues/5953
128
- Style/AccessModifierDeclarations:
129
- Enabled: false
125
+ Style/AccessorGrouping:
126
+ Enabled: true
127
+ EnforcedStyle: separated
130
128
 
131
129
  # Do not use "and" or "or" in conditionals, but for readability we can use it
132
130
  # to chain executions. Just beware of operator order.
@@ -137,7 +135,7 @@ Style/AndOr:
137
135
  Style/BarePercentLiterals:
138
136
  EnforcedStyle: percent_q
139
137
 
140
- # braces_for_chaining seems a good fit of what we've been doing so far.
138
+ # Pick one option for consistency.
141
139
  Style/BlockDelimiters:
142
140
  EnforcedStyle: braces_for_chaining
143
141
  AllowedMethods:
@@ -147,11 +145,9 @@ Style/BlockDelimiters:
147
145
  Style/EmptyElse:
148
146
  EnforcedStyle: empty
149
147
 
150
- # There is no specific preference for empty methods.
151
- # One-line methods are not exceptionally nice in Ruby.
152
- # Just ignore this cop for now.
148
+ # Pick one option for consistency.
153
149
  Style/EmptyMethod:
154
- Enabled: false
150
+ EnforcedStyle: expanded
155
151
 
156
152
  # We don't care about the format style.
157
153
  # In most cases we use %, but not at the point we want to enforce it
@@ -159,10 +155,8 @@ Style/EmptyMethod:
159
155
  Style/FormatString:
160
156
  Enabled: false
161
157
 
162
- # Annotated tokens (like %<foo>s) are a good thing,
163
- # but in most cases we don't need them.
164
- # %s is a simpler and straightforward version that works in almost all cases.
165
- # So don't complain.
158
+ # Annotated tokens (like %<foo>s) are a good thing, but in most cases we don't need them.
159
+ # %s is a simpler and straightforward version that works in almost all cases. So don't complain.
166
160
  Style/FormatStringToken:
167
161
  Enabled: false
168
162
 
@@ -174,21 +168,6 @@ Style/HashSyntax:
174
168
  # that looks nicer with the old rocket syntax.
175
169
  - 'Rakefile'
176
170
 
177
- # Enforces usage of Hash#each_key and Hash#each_value (vs. Hash#keys.each
178
- # and Hash#values.each).
179
- Style/HashEachMethods:
180
- Enabled: true
181
-
182
- # Enforce the use of Hash#TransformKeys introduced in Ruby 2.5 to transform
183
- # Hash keys.
184
- Style/HashTransformKeys:
185
- Enabled: true
186
-
187
- # Enforce the use of Hash#TransformValues introduced in Ruby 2.5 to transform
188
- # Hash values.
189
- Style/HashTransformValues:
190
- Enabled: true
191
-
192
171
  # We want to be able to decide when to use one-line if/unless modifiers.
193
172
  Style/IfUnlessModifier:
194
173
  Enabled: false
@@ -220,11 +199,6 @@ Style/NumericLiterals:
220
199
  - 'spec/**/*_spec.rb'
221
200
  - 'test/**/*_test.rb'
222
201
 
223
- # For years, %w() has been the de-facto standard.
224
- # A lot of libraries are using (). Switching to [] would be a nightmare.
225
- Style/PercentLiteralDelimiters:
226
- Enabled: false
227
-
228
202
  # Enable but only for multiple returns value.
229
203
  #
230
204
  # return foo, bar
@@ -236,17 +210,7 @@ Style/PercentLiteralDelimiters:
236
210
  Style/RedundantReturn:
237
211
  AllowMultipleReturnValues: true
238
212
 
239
- # Do we care?
240
- Style/RegexpLiteral:
241
- Enabled: false
242
-
243
- # There are cases were the inline rescue is ok. We can either downgrade
244
- # the severity, or rely on the developer judgement on a case-by-case basis.
245
- Style/RescueModifier:
246
- Enabled: false
247
-
248
- # This is quite annoying, especially in cases where we don't control it
249
- # (e.g. schema.rb).
213
+ # This is quite annoying, especially in cases where we don't control it (e.g. schema.rb).
250
214
  Style/SymbolArray:
251
215
  Enabled: false
252
216
 
@@ -261,9 +225,8 @@ Style/StringLiterals:
261
225
  Enabled: false
262
226
  EnforcedStyle: double_quotes
263
227
 
264
- # As before.
228
+ # Pick one option for consistency.
265
229
  Style/StringLiteralsInInterpolation:
266
- Enabled: false
267
230
  EnforcedStyle: double_quotes
268
231
 
269
232
  # It's nice to be consistent. The trailing comma also allows easy reordering,
@@ -290,20 +253,8 @@ Style/WordArray:
290
253
  EnforcedStyle: percent
291
254
  MinSize: 3
292
255
 
293
- # Forces the order of comparison arguments.
294
- #
295
- # According to this cop, the following statement is bad:
296
- #
297
- # "https" == uri.scheme
298
- #
299
- # Whereas the following is considered good:
300
- #
301
- # uri.scheme == "https"
302
- Style/YodaCondition:
303
- Enabled: false
304
-
305
- # For the same reason of EndAlignment, aligning with the case may have
306
- # a bad impact on a case after a very long variable.
256
+ # For the same reason of EndAlignment, aligning with the case may have a bad impact
257
+ # on a case after a very long variable.
307
258
  #
308
259
  # invoice_error_message = case error
309
260
  # when 1 == 1
@@ -325,32 +276,24 @@ Layout/DotPosition:
325
276
  Layout/EmptyLines:
326
277
  Enabled: false
327
278
 
328
- # This is buggy. It detects as a style violation a few `class`
329
- # and `module` definitions
330
- Layout/EmptyLinesAroundArguments:
331
- Enabled: false
332
-
333
279
  Layout/EmptyLinesAroundBlockBody:
334
280
  Exclude:
335
281
  # RSpec is all made of blocks. Disable this config in RSpec
336
- # to be consistent with EmptyLinesAroundClassBody
337
- # and EmptyLinesAroundModuleBody
282
+ # to be consistent with EmptyLinesAroundClassBody and EmptyLinesAroundModuleBody
338
283
  - 'spec/**/*_spec.rb'
339
284
  - 'test/**/*_test.rb'
340
285
 
341
- # In most cases, a space is nice. Sometimes, it's not.
342
- # Just be consistent with the rest of the surrounding code.
286
+ # Pick one option for consistency. beginning+ending is the most used approach.
343
287
  Layout/EmptyLinesAroundClassBody:
344
- Enabled: false
288
+ EnforcedStyle: empty_lines_except_namespace
345
289
 
346
290
  # We're ok with it. We use it quite often for method-level rescue statements.
347
291
  Layout/EmptyLinesAroundExceptionHandlingKeywords:
348
292
  Enabled: false
349
293
 
350
- # In most cases, a space is nice. Sometimes, it's not.
351
- # Just be consistent with the rest of the surrounding code.
294
+ # Pick one option for consistency. beginning+ending is the most used approach.
352
295
  Layout/EmptyLinesAroundModuleBody:
353
- Enabled: false
296
+ EnforcedStyle: empty_lines_except_namespace
354
297
 
355
298
  # This is quite buggy, as it doesn't recognize double lines.
356
299
  Layout/EmptyLineBetweenDefs:
data/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ This project uses [Semantic Versioning 2.0.0](http://semver.org/).
4
4
 
5
5
  ## main
6
6
 
7
+ ## 8.8.0
8
+
9
+ - NEW: Added `Dnsimple::Client::DnsAnalytics#query` to query and pull data from the DNS Analytics API endpoint(dnsimple/dnsimple-ruby#375)
10
+
7
11
  ## 8.7.1
8
12
 
9
13
  ENHANCEMENTS:
data/Gemfile CHANGED
@@ -5,7 +5,10 @@ source 'https://rubygems.org'
5
5
  gemspec
6
6
 
7
7
  gem 'coveralls', require: false
8
- gem 'rubocop', '1.57.2', require: false
9
- gem 'rubocop-performance', '1.19.1', require: false
8
+ gem 'rubocop', '1.59.0', require: false
9
+ gem 'rubocop-performance', '1.20.1', require: false
10
10
  gem 'rubocop-rake', '0.6.0', require: false
11
11
  gem 'rubocop-rspec', '2.25.0', require: false
12
+ gem "base64", "~> 0.2.0"
13
+ gem "bigdecimal", "~> 3.1"
14
+ gem "csv", "~> 3.2"
@@ -3,6 +3,7 @@
3
3
  module Dnsimple
4
4
  class Client
5
5
  module Billing
6
+
6
7
  # List the billing charges for the account.
7
8
  #
8
9
  # @see https://developer.dnsimple.com/v2/billing/#listCharges
@@ -30,6 +31,7 @@ module Dnsimple
30
31
  Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Charge.new(r) })
31
32
  end
32
33
  alias list_charges charges
34
+
33
35
  end
34
36
  end
35
37
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dnsimple
4
+
4
5
  class Client
5
6
 
6
7
  # @return [Dnsimple::Client::AccountsService] The account-related API proxy.
@@ -28,6 +29,11 @@ module Dnsimple
28
29
  @services[:domains] ||= Client::DomainsService.new(self)
29
30
  end
30
31
 
32
+ # @return [Dnsimple::Client::DnsAnalyticsService] The DNS Analytics API proxy.
33
+ def dns_analytics
34
+ @services[:dns_analytics] ||= Client::DnsAnalyticsService.new(self)
35
+ end
36
+
31
37
  # @return [Dnsimple::Client::IdentityService] The identity-related API proxy.
32
38
  def identity
33
39
  @services[:auth] ||= Client::IdentityService.new(self)
@@ -117,26 +123,34 @@ module Dnsimple
117
123
  require_relative 'accounts'
118
124
 
119
125
  class AccountsService < ClientService
126
+
120
127
  include Client::Accounts
128
+
121
129
  end
122
130
 
123
131
  require_relative 'billing'
124
132
 
125
133
  class BillingService < ClientService
134
+
126
135
  include Client::Billing
136
+
127
137
  end
128
138
 
129
139
  require_relative 'certificates'
130
140
 
131
141
  class CertificatesService < ClientService
142
+
132
143
  include Client::Certificates
144
+
133
145
  end
134
146
 
135
147
 
136
148
  require_relative 'contacts'
137
149
 
138
150
  class ContactsService < ClientService
151
+
139
152
  include Client::Contacts
153
+
140
154
  end
141
155
 
142
156
 
@@ -148,26 +162,40 @@ module Dnsimple
148
162
  require_relative 'domains_collaborators'
149
163
 
150
164
  class DomainsService < ClientService
165
+
151
166
  include Client::Domains
152
167
  include Client::DomainsDelegationSignerRecords
153
168
  include Client::DomainsDnssec
154
169
  include Client::DomainsEmailForwards
155
170
  include Client::DomainsPushes
156
171
  include Client::DomainsCollaborators
172
+
173
+ end
174
+
175
+ require_relative 'dns_analytics'
176
+
177
+ class DnsAnalyticsService < ClientService
178
+
179
+ include Client::DnsAnalytics
180
+
157
181
  end
158
182
 
159
183
 
160
184
  require_relative 'identity'
161
185
 
162
186
  class IdentityService < ClientService
187
+
163
188
  include Client::Identity
189
+
164
190
  end
165
191
 
166
192
 
167
193
  require_relative 'oauth'
168
194
 
169
195
  class OauthService < ClientService
196
+
170
197
  include Client::Oauth
198
+
171
199
  end
172
200
 
173
201
  require_relative 'registrar'
@@ -178,12 +206,14 @@ module Dnsimple
178
206
  require_relative 'registrar_delegation'
179
207
 
180
208
  class RegistrarService < ClientService
209
+
181
210
  include Client::Registrar
182
211
  include Client::RegistrarAutoRenewal
183
212
  include Client::RegistrarDelegation
184
213
  include Client::RegistrarRegistrantChanges
185
214
  include Client::RegistrarTransferLock
186
215
  include Client::RegistrarWhoisPrivacy
216
+
187
217
  end
188
218
 
189
219
 
@@ -191,8 +221,10 @@ module Dnsimple
191
221
  require_relative 'services_domains'
192
222
 
193
223
  class ServicesService < ClientService
224
+
194
225
  include Client::Services
195
226
  include Client::ServicesDomains
227
+
196
228
  end
197
229
 
198
230
 
@@ -201,23 +233,29 @@ module Dnsimple
201
233
  require_relative 'templates_records'
202
234
 
203
235
  class TemplatesService < ClientService
236
+
204
237
  include Client::Templates
205
238
  include Client::TemplatesDomains
206
239
  include Client::TemplatesRecords
240
+
207
241
  end
208
242
 
209
243
 
210
244
  require_relative 'tlds'
211
245
 
212
246
  class TldsService < ClientService
247
+
213
248
  include Client::Tlds
249
+
214
250
  end
215
251
 
216
252
 
217
253
  require_relative 'vanity_name_servers'
218
254
 
219
255
  class VanityNameServersService < ClientService
256
+
220
257
  include Client::VanityNameServers
258
+
221
259
  end
222
260
 
223
261
 
@@ -226,16 +264,20 @@ module Dnsimple
226
264
  require_relative 'zones_distributions'
227
265
 
228
266
  class ZonesService < ClientService
267
+
229
268
  include Client::Zones
230
269
  include Client::ZonesRecords
231
270
  include Client::ZonesDistributions
271
+
232
272
  end
233
273
 
234
274
 
235
275
  require_relative 'webhooks'
236
276
 
237
277
  class WebhooksService < ClientService
278
+
238
279
  include Client::Webhooks
280
+
239
281
  end
240
282
 
241
283
  end
@@ -246,6 +288,9 @@ module Dnsimple
246
288
  # these static methods return directly the underlying data objects.
247
289
  # Therefore, it's not possible to access response metadata such as throttling or pagination info.
248
290
  module V2
291
+
249
292
  extend Client::Identity::StaticHelpers
293
+
250
294
  end
295
+
251
296
  end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dnsimple
4
+ class Client
5
+ module DnsAnalytics
6
+
7
+ # Queries DNS Analytics data for the provided account
8
+ #
9
+ # @see https://developer.dnsimple.com/v2/dns-analytics#query
10
+ #
11
+ # @param [Integer] account_id the account ID
12
+ # @param [Hash] options the filtering, sorting, and grouping options
13
+ # @option options [Integer] :page current page (pagination)
14
+ # @option options [Integer] :per_page number of entries to return (pagination)
15
+ # @option options [String] :sort sorting policy
16
+ # @option options [Hash] :filter filtering policy
17
+ # @option options [String] :groupings groupings policy
18
+ # @return [Dnsimple::PaginatedResponseWithQuery<Dnsimple::Struct::DnsAnalytics>]
19
+ #
20
+ # @raise [Dnsimple::RequestError]
21
+ def query(account_id, options = {})
22
+ list_options = Options::ListOptions.new(options)
23
+ response = client.get(Client.versioned("/%s/dns_analytics" % [account_id]), list_options)
24
+
25
+ Dnsimple::PaginatedResponseWithQuery.new(response, response["data"]["rows"].map { |row| Struct::DnsAnalytics.new(response["data"]["headers"].zip(row)) })
26
+ end
27
+
28
+ end
29
+ end
30
+ end
@@ -128,6 +128,7 @@ module Dnsimple
128
128
 
129
129
  Dnsimple::Response.new(response, nil)
130
130
  end
131
+
131
132
  end
132
133
  end
133
134
  end
@@ -54,6 +54,7 @@ module Dnsimple
54
54
 
55
55
  Dnsimple::Response.new(response, Struct::Dnssec.new(response["data"]))
56
56
  end
57
+
57
58
  end
58
59
  end
59
60
  end
@@ -94,6 +94,5 @@ module Dnsimple
94
94
  end
95
95
 
96
96
  end
97
-
98
97
  end
99
98
  end
@@ -19,6 +19,7 @@ module Dnsimple
19
19
 
20
20
 
21
21
  module StaticHelpers
22
+
22
23
  # Calls {Identity#whoami} and directly returns the response data.
23
24
  #
24
25
  # @see https://developer.dnsimple.com/v2/identity/#whoami
@@ -30,6 +31,7 @@ module Dnsimple
30
31
  def whoami(client, *args)
31
32
  client.identity.whoami(*args).data
32
33
  end
34
+
33
35
  end
34
36
 
35
37
  end
@@ -217,6 +217,7 @@ module Dnsimple
217
217
 
218
218
  Dnsimple::Response.new(response, nil)
219
219
  end
220
+
220
221
  end
221
222
  end
222
223
  end
@@ -104,6 +104,7 @@ module Dnsimple
104
104
 
105
105
  Dnsimple::Response.new(response, nil)
106
106
  end
107
+
107
108
  end
108
109
  end
109
110
  end
@@ -75,6 +75,7 @@ module Dnsimple
75
75
 
76
76
  Dnsimple::Response.new(response, Struct::Service.new(response["data"]))
77
77
  end
78
+
78
79
  end
79
80
  end
80
81
  end
@@ -132,6 +132,7 @@ module Dnsimple
132
132
 
133
133
  Dnsimple::Response.new(response, nil)
134
134
  end
135
+
135
136
  end
136
137
  end
137
138
  end
@@ -3,6 +3,7 @@
3
3
  module Dnsimple
4
4
  class Client
5
5
  module Tlds
6
+
6
7
  # Lists the TLDs available for registration
7
8
  #
8
9
  # @see https://developer.dnsimple.com/v2/tlds/#listTlds
@@ -91,6 +92,7 @@ module Dnsimple
91
92
 
92
93
  Dnsimple::CollectionResponse.new(response, response["data"].map { |r| Struct::ExtendedAttribute.new(r) })
93
94
  end
95
+
94
96
  end
95
97
  end
96
98
  end
@@ -7,7 +7,6 @@ require 'dnsimple/response'
7
7
  require 'dnsimple/client/clients'
8
8
 
9
9
  module Dnsimple
10
-
11
10
  # Client for the DNSimple API
12
11
  #
13
12
  # @see https://developer.dnsimple.com/
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dnsimple
4
-
5
4
  # Default configuration options for {Client}
6
5
  module Default
7
6
 
@@ -76,6 +75,6 @@ module Dnsimple
76
75
  end
77
76
 
78
77
  end
79
- end
80
78
 
79
+ end
81
80
  end
@@ -7,7 +7,9 @@ module Dnsimple
7
7
 
8
8
  # RequestError is raised when an API request fails for an client, a server error or invalid request information.
9
9
  class RequestError < Error
10
- attr_reader :http_response, :attribute_errors
10
+
11
+ attr_reader :http_response
12
+ attr_reader :attribute_errors
11
13
 
12
14
  def initialize(http_response)
13
15
  @http_response = http_response
@@ -49,7 +51,10 @@ module Dnsimple
49
51
  end
50
52
 
51
53
  class OAuthInvalidRequestError < Error
52
- attr_reader :http_response, :error, :error_description
54
+
55
+ attr_reader :http_response
56
+ attr_reader :error
57
+ attr_reader :error_description
53
58
 
54
59
  def initialize(http_response)
55
60
  @http_response = http_response
@@ -63,6 +68,7 @@ module Dnsimple
63
68
  def message
64
69
  "#{error}: #{error_description}"
65
70
  end
71
+
66
72
  end
67
73
 
68
74
  end