dnsimple 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -2
  3. data/README.md +5 -4
  4. data/dnsimple.gemspec +3 -3
  5. data/lib/dnsimple.rb +1 -0
  6. data/lib/dnsimple/client.rb +37 -11
  7. data/lib/dnsimple/client/accounts.rb +26 -0
  8. data/lib/dnsimple/client/clients.rb +15 -1
  9. data/lib/dnsimple/client/contacts.rb +16 -7
  10. data/lib/dnsimple/client/domains.rb +20 -6
  11. data/lib/dnsimple/client/domains_email_forwards.rb +17 -8
  12. data/lib/dnsimple/client/identity.rb +2 -5
  13. data/lib/dnsimple/client/registrar.rb +1 -1
  14. data/lib/dnsimple/client/registrar_auto_renewal.rb +2 -2
  15. data/lib/dnsimple/client/services.rb +15 -3
  16. data/lib/dnsimple/client/templates.rb +16 -4
  17. data/lib/dnsimple/client/templates_records.rb +135 -0
  18. data/lib/dnsimple/client/tlds.rb +13 -4
  19. data/lib/dnsimple/client/webhooks.rb +11 -2
  20. data/lib/dnsimple/client/zones.rb +19 -5
  21. data/lib/dnsimple/client/zones_records.rb +48 -11
  22. data/lib/dnsimple/default.rb +2 -2
  23. data/lib/dnsimple/extra.rb +3 -3
  24. data/lib/dnsimple/options.rb +53 -0
  25. data/lib/dnsimple/struct.rb +2 -0
  26. data/lib/dnsimple/struct/account.rb +3 -0
  27. data/lib/dnsimple/struct/contact.rb +0 -3
  28. data/lib/dnsimple/struct/record.rb +2 -2
  29. data/lib/dnsimple/struct/template_record.rb +34 -0
  30. data/lib/dnsimple/struct/whoami.rb +30 -0
  31. data/lib/dnsimple/version.rb +1 -1
  32. data/spec/dnsimple/client/accounts_spec.rb +31 -0
  33. data/spec/dnsimple/client/contacts_spec.rb +19 -2
  34. data/spec/dnsimple/client/domains_email_forwards_spec.rb +18 -1
  35. data/spec/dnsimple/client/domains_spec.rb +30 -1
  36. data/spec/dnsimple/client/identity_spec.rb +6 -6
  37. data/spec/dnsimple/client/services_spec.rb +30 -1
  38. data/spec/dnsimple/client/templates_records_spec.rb +226 -0
  39. data/spec/dnsimple/client/templates_spec.rb +30 -1
  40. data/spec/dnsimple/client/tlds_spec.rb +18 -1
  41. data/spec/dnsimple/client/webhooks_spec.rb +6 -0
  42. data/spec/dnsimple/client/zones_records_spec.rb +30 -1
  43. data/spec/dnsimple/client/zones_spec.rb +30 -1
  44. data/spec/dnsimple/client_spec.rb +35 -14
  45. data/spec/dnsimple/options/base_spec.rb +22 -0
  46. data/spec/dnsimple/options/list_options_spec.rb +100 -0
  47. data/spec/fixtures.http/accounts/success-account.http +21 -0
  48. data/spec/fixtures.http/accounts/success-user.http +21 -0
  49. data/spec/fixtures.http/createContact/created.http +1 -1
  50. data/spec/fixtures.http/createTemplateRecord/created.http +17 -0
  51. data/spec/fixtures.http/deleteTemplateRecord/success.http +13 -0
  52. data/spec/fixtures.http/getContact/success.http +1 -1
  53. data/spec/fixtures.http/getTemplateRecord/success.http +17 -0
  54. data/spec/fixtures.http/listContacts/success.http +1 -1
  55. data/spec/fixtures.http/listTemplateRecords/success.http +17 -0
  56. data/spec/fixtures.http/notfound-template.http +12 -0
  57. data/spec/fixtures.http/updateContact/success.http +1 -1
  58. data/spec/spec_helper.rb +0 -11
  59. metadata +35 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8aca4eb6f6813b601531e5c5d82f9db0ec222dd5
4
- data.tar.gz: 6076520c66e7ac64e23e1e006a9342f96cefabc5
3
+ metadata.gz: eb3f3b1fc8b0c99b792b0c1a1d6b27830ff2331f
4
+ data.tar.gz: 1c79d167d1d71d3af51981a326494c1a3b02fb53
5
5
  SHA512:
6
- metadata.gz: 3b56cb8d598eec60f48cf0eb63594e323b3a16d2d02a73a003e4fd7c64030f6a2d488fc77b8e4abab8c33598a28411aa15fdb946db4c0db2dc4faeafb1507303
7
- data.tar.gz: d9cc0e1e056166b2cc5952ecd3d317bb524341ea92aaaac581a9e414bbc4e6164837f40b65566420281633a17ecb6c707430db2d0ee56e3053e439c9d96d9a65
6
+ metadata.gz: 2f56e2bf1ca4267264aa5730b146de169430497389827745a8ce6bf80bd34dc5f8721454d9c330a83c6684e43f2fbb8ff0d0ec22ad30f70f9892ce64fb952872
7
+ data.tar.gz: 2574f383a0a03086b280ded7535153f563364e51d015a5499ea18ca93187f4eaa4c14e76109baab246f2837699426683159ece814c37f930edf8c19f5cc86a31
data/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  This project uses [Semantic Versioning 2.0.0](http://semver.org/).
4
4
 
5
5
 
6
+ #### 3.1.0
7
+
8
+ - NEW: Added accounts support (GH-113).
9
+
10
+ - NEW: Added sorting and filtering support (GH-112).
11
+
12
+ - NEW: Added template record support (GH-104).
13
+
14
+ - CHANGED: Pagination params must be passed as top level options. Previously they were passed inside `:query` options (GH-116).
15
+
16
+ - CHANGED: Authentication credentials presence is no longer validated on the client as it was causing an error getting the access token (GH-74 and GH-102).
17
+
18
+ - CHANGED: Setting a custom user-agent no longer overrides the origina user-agent (GH-105).
19
+
20
+ - CHANGED: Updated client to use Contact#email (GH-108).
21
+
22
+ - REMOVED: Removed support for wildcard accounts (GH-107).
23
+
24
+
6
25
  #### 3.0.0
7
26
 
8
27
  ##### stable
@@ -19,7 +38,6 @@ This project uses [Semantic Versioning 2.0.0](http://semver.org/).
19
38
 
20
39
  - CHANGED: Error detection is now smarter. If the error is deserializable and contains a message, the message is attached to the exception (GH-94, GH-95, GH-100).
21
40
 
22
-
23
41
  ##### beta2
24
42
 
25
43
  - FIXED: `state` and `redirect_uri` are not properly passed in the request to exchang the code for an access token (GH-89, GH-90).
@@ -42,7 +60,7 @@ Internal changes were made to match conventions adopted in other clients, such a
42
60
 
43
61
  #### 2.1.0
44
62
 
45
- - NEW: Add the ability to set headers and pass extra connection params in each API method (GH-64)
63
+ - NEW: Add the ability to set headers and pass extra connection params in each API method (GH-64)
46
64
 
47
65
  #### 2.0.0
48
66
 
data/README.md CHANGED
@@ -18,16 +18,16 @@ This library is currently in beta version, the methods and the implementation sh
18
18
 
19
19
  ## Installation
20
20
 
21
- During the initial beta period, releases of this gem are flagged as [prerelease](http://guides.rubygems.org/patterns/#prerelease-gems). You will need to append `--pre` in order to install the beta client.
21
+ You can install the gem manually:
22
22
 
23
23
  ```
24
- $ gem install dnsimple --pre
24
+ $ gem install dnsimple
25
25
  ```
26
26
 
27
- Also note that Bundler ignores pre-releases by default. To use a pre-release gem, make sure to explicitly add the release version.
27
+ Or use Bundler and define it as a dependency in your Gemfile:
28
28
 
29
29
  ```
30
- gem 'dnsimple', '~> 3.0', '>= 3.0.0.pre.beta1'
30
+ gem 'dnsimple', '~> 3.0'
31
31
  ```
32
32
 
33
33
  ## Usage
@@ -48,6 +48,7 @@ client.identity.whoami.data # execute the call and get the data in one l
48
48
  account_id = 1010
49
49
 
50
50
  # You can also fetch it from the whoami response
51
+ # as long as you authenticate with an Account access token
51
52
  whoami = client.identity.whoami.data
52
53
  account_id = whoami.account.id
53
54
 
data/dnsimple.gemspec CHANGED
@@ -5,8 +5,8 @@ require 'dnsimple/version'
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'dnsimple'
7
7
  s.version = Dnsimple::VERSION
8
- s.authors = ['Anthony Eden', 'Simone Carletti']
9
- s.email = ['anthony.eden@dnsimple.com', 'simone.carletti@dnsimple.com']
8
+ s.authors = ['Anthony Eden', 'Simone Carletti', 'Javier Acero', 'Joseph Caudle', 'Luca Guidi']
9
+ s.email = ['anthony.eden@dnsimple.com', 'simone.carletti@dnsimple.com', 'javier.acero@dnsimple.com', 'joseph.caudle@dnsimple.com', 'luca.guidi@dnsimple.com']
10
10
  s.homepage = 'https://github.com/aetrion/dnsimple-ruby'
11
11
  s.summary = 'The DNSimple API client for Ruby'
12
12
  s.description = 'The DNSimple API client for Ruby.'
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
19
  s.extra_rdoc_files = %w( LICENSE.txt )
20
20
 
21
- s.add_dependency 'httparty'
21
+ s.add_dependency 'httparty'
22
22
 
23
23
  s.add_development_dependency 'rake'
24
24
  s.add_development_dependency 'rspec'
data/lib/dnsimple.rb CHANGED
@@ -18,3 +18,4 @@ require 'dnsimple/version'
18
18
  require 'dnsimple/default'
19
19
  require 'dnsimple/client'
20
20
  require 'dnsimple/error'
21
+ require 'dnsimple/options'
@@ -12,8 +12,6 @@ module Dnsimple
12
12
  class Client
13
13
 
14
14
  HEADER_AUTHORIZATION = "Authorization".freeze
15
- WILDCARD_ACCOUNT = "_".freeze
16
-
17
15
 
18
16
  # @return [String] The current API version.
19
17
  API_VERSION = "v2".freeze
@@ -73,7 +71,7 @@ module Dnsimple
73
71
  # @param [Hash] options The query and header params for the request
74
72
  # @return [HTTParty::Response]
75
73
  def get(path, options = {})
76
- execute :get, path, nil, options
74
+ execute :get, path, nil, options.to_h
77
75
  end
78
76
 
79
77
  # Make a HTTP POST request.
@@ -155,7 +153,7 @@ module Dnsimple
155
153
  # @param [Hash] options The query and header params for the request
156
154
  # @return [HTTParty::Response]
157
155
  def request(method, path, data = nil, options = {})
158
- request_options = Extra.deep_merge!(base_options, options)
156
+ request_options = request_options(options)
159
157
 
160
158
  if data
161
159
  request_options[:headers]["Content-Type"] = content_type(request_options[:headers])
@@ -168,29 +166,57 @@ module Dnsimple
168
166
 
169
167
  private
170
168
 
169
+ def request_options(custom_options = {})
170
+ base_options.tap do |options|
171
+ Extra.deep_merge!(options, custom_options)
172
+ Extra.deep_merge!(options, headers: { "User-Agent" => format_user_agent })
173
+ add_auth_options!(options)
174
+ add_proxy_options!(options)
175
+ end
176
+ end
177
+
171
178
  def base_options
172
- options = {
179
+ {
173
180
  format: :json,
174
181
  headers: {
175
- 'Accept' => 'application/json',
176
- 'User-Agent' => user_agent,
182
+ "Accept" => "application/json",
177
183
  },
178
184
  }
185
+ end
179
186
 
187
+ def add_proxy_options!(options)
180
188
  if proxy
181
189
  address, port = proxy.split(":")
182
- options.merge!(http_proxyaddr: address, http_proxyport: port)
190
+ options[:http_proxyaddr] = address
191
+ options[:http_proxyport] = port
183
192
  end
193
+ end
184
194
 
195
+ def add_auth_options!(options)
185
196
  if password
186
197
  options[:basic_auth] = { username: username, password: password }
187
198
  elsif access_token
188
199
  options[:headers][HEADER_AUTHORIZATION] = "Bearer #{access_token}"
189
- else
190
- raise Error, 'A password, domain API token or access token is required for all API requests.'
191
200
  end
201
+ end
192
202
 
193
- options
203
+ # Builds the final user agent to use for HTTP requests.
204
+ #
205
+ # If no custom user agent is provided, the default user agent is used.
206
+ #
207
+ # dnsimple-ruby/1.0
208
+ #
209
+ # If a custom user agent is provided, the final user agent is the combination
210
+ # of the custom user agent prepended by the default user agent.
211
+ #
212
+ # dnsimple-ruby/1.0 customAgentFlag
213
+ #
214
+ def format_user_agent
215
+ if user_agent.to_s.empty?
216
+ Dnsimple::Default::USER_AGENT
217
+ else
218
+ "#{Dnsimple::Default::USER_AGENT} #{user_agent}"
219
+ end
194
220
  end
195
221
 
196
222
  def content_type(headers)
@@ -0,0 +1,26 @@
1
+ module Dnsimple
2
+ class Client
3
+ module Accounts
4
+
5
+ # Lists the accounts the authenticated entity has access to.
6
+ #
7
+ # @see https://developer.dnsimple.com/v2/accounts
8
+ #
9
+ # @example List the accounts:
10
+ # client.accounts.list
11
+ #
12
+ # @param [Hash] options
13
+ # @return [Dnsimple::Response<Dnsimple::Struct::Account>]
14
+ #
15
+ # @raise [Dnsimple::RequestError]
16
+ def accounts(options = {})
17
+ response = client.get(Client.versioned("/accounts"), options)
18
+
19
+ Dnsimple::Response.new(response, response["data"].map { |r| Struct::Account.new(r) })
20
+ end
21
+ alias list accounts
22
+ alias list_accounts accounts
23
+
24
+ end
25
+ end
26
+ end
@@ -1,6 +1,11 @@
1
1
  module Dnsimple
2
2
  class Client
3
3
 
4
+ # @return [Dnsimple::Client::AccountsService] The account-related API proxy.
5
+ def accounts
6
+ @services[:accounts] ||= Client::AccountsService.new(self)
7
+ end
8
+
4
9
  # @return [Dnsimple::Client::ContactsService] The contact-related API proxy.
5
10
  def contacts
6
11
  @services[:contacts] ||= Client::ContactsService.new(self)
@@ -52,7 +57,7 @@ module Dnsimple
52
57
  end
53
58
 
54
59
 
55
- # @!class Struct
60
+ # Struct
56
61
  class ClientService
57
62
 
58
63
  # @return [Dnsimple::Client]
@@ -91,6 +96,13 @@ module Dnsimple
91
96
  end
92
97
 
93
98
 
99
+ require_relative 'accounts'
100
+
101
+ class AccountsService < ClientService
102
+ include Client::Accounts
103
+ end
104
+
105
+
94
106
  require_relative 'contacts'
95
107
 
96
108
  class ContactsService < ClientService
@@ -142,9 +154,11 @@ module Dnsimple
142
154
 
143
155
 
144
156
  require_relative 'templates'
157
+ require_relative 'templates_records'
145
158
 
146
159
  class TemplatesService < ClientService
147
160
  include Client::Templates
161
+ include Client::TemplatesRecords
148
162
  end
149
163
 
150
164
 
@@ -11,15 +11,21 @@ module Dnsimple
11
11
  # client.contacts.list(1010)
12
12
  #
13
13
  # @example List contacts, provide a specific page
14
- # client.contacts.list(1010, query: { page: 2 })
14
+ # client.contacts.list(1010, page: 2)
15
+ #
16
+ # @example List contacts, provide a sorting policy
17
+ # client.contacts.list(1010, sort: "email:asc")
15
18
  #
16
19
  # @param [Fixnum] account_id the account ID
17
- # @param [Hash] options the filtering and sorting option
20
+ # @param [Hash] options the filtering and sorting options
21
+ # @option options [Integer] :page current page (pagination)
22
+ # @option options [Integer] :per_page number of entries to return (pagination)
23
+ # @option options [String] :sort sorting policy
18
24
  # @return [Dnsimple::PaginatedResponse<Dnsimple::Struct::Contact>]
19
25
  #
20
26
  # @raise [Dnsimple::RequestError]
21
27
  def contacts(account_id, options = {})
22
- response = client.get(Client.versioned("/%s/contacts" % [account_id]), options)
28
+ response = client.get(Client.versioned("/%s/contacts" % [account_id]), Options::ListOptions.new(options))
23
29
 
24
30
  Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Contact.new(r) })
25
31
  end
@@ -38,7 +44,10 @@ module Dnsimple
38
44
  # @see #contacts
39
45
  #
40
46
  # @param [Fixnum] account_id the account ID
41
- # @param [Hash] options the filtering and sorting option
47
+ # @param [Hash] options the filtering and sorting options
48
+ # @option options [Integer] :page current page (pagination)
49
+ # @option options [Integer] :per_page number of entries to return (pagination)
50
+ # @option options [String] :sort sorting policy
42
51
  # @return [Dnsimple::CollectionResponse<Dnsimple::Struct::Contact>]
43
52
  #
44
53
  # @raise [Dnsimple::RequestError]
@@ -58,7 +67,7 @@ module Dnsimple
58
67
  #
59
68
  # @raise [Dnsimple::RequestError]
60
69
  def create_contact(account_id, attributes, options = {})
61
- Extra.validate_mandatory_attributes(attributes, [:first_name, :last_name, :address1, :city, :state_province, :postal_code, :country, :phone, :email_address])
70
+ Extra.validate_mandatory_attributes(attributes, [:first_name, :last_name, :address1, :city, :state_province, :postal_code, :country, :phone, :email])
62
71
  response = client.post(Client.versioned("/%s/contacts" % [account_id]), attributes, options)
63
72
 
64
73
  Dnsimple::Response.new(response, Struct::Contact.new(response["data"]))
@@ -69,7 +78,7 @@ module Dnsimple
69
78
  #
70
79
  # @see https://developer.dnsimple.com/v2/contacts/#get
71
80
  #
72
- # @param [Fixnum, Dnsimple::Client::WILDCARD_ACCOUNT] account_id the account ID or wildcard
81
+ # @param [Fixnum] account_id the account ID
73
82
  # @param [#to_s] contact_id the contact ID
74
83
  # @param [Hash] options
75
84
  # @return [Dnsimple::Response<Dnsimple::Struct::Contact>]
@@ -106,7 +115,7 @@ module Dnsimple
106
115
  #
107
116
  # @see https://developer.dnsimple.com/v2/contacts/#delete
108
117
  #
109
- # @param [Fixnum, Dnsimple::Client::WILDCARD_ACCOUNT] account_id the account ID or wildcard
118
+ # @param [Fixnum] account_id the account ID
110
119
  # @param [#to_s] contact_id the contact ID
111
120
  # @param [Hash] options
112
121
  # @return [Dnsimple::Response<nil>]
@@ -11,15 +11,25 @@ module Dnsimple
11
11
  # client.domains.list(1010)
12
12
  #
13
13
  # @example List domains, provide a specific page
14
- # client.domains.list(1010, query: { page: 2 })
14
+ # client.domains.list(1010, page: 2)
15
+ #
16
+ # @example List domains, provide a sorting policy
17
+ # client.domains.list(1010, sort: "expires_on:asc")
18
+ #
19
+ # @example List domains, provide a filtering policy
20
+ # client.domains.list(1010, filter: { name_like: "example" })
15
21
  #
16
22
  # @param [Fixnum] account_id the account ID
17
- # @param [Hash] options the filtering and sorting option
23
+ # @param [Hash] options the filtering and sorting options
24
+ # @option options [Integer] :page current page (pagination)
25
+ # @option options [Integer] :per_page number of entries to return (pagination)
26
+ # @option options [String] :sort sorting policy
27
+ # @option options [Hash] :filter filtering policy
18
28
  # @return [Dnsimple::PaginatedResponse<Dnsimple::Struct::Domain>]
19
29
  #
20
30
  # @raise [Dnsimple::RequestError]
21
31
  def domains(account_id, options = {})
22
- response = client.get(Client.versioned("/%s/domains" % [account_id]), options)
32
+ response = client.get(Client.versioned("/%s/domains" % [account_id]), Options::ListOptions.new(options))
23
33
 
24
34
  Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Domain.new(r) })
25
35
  end
@@ -39,6 +49,10 @@ module Dnsimple
39
49
  #
40
50
  # @param [Fixnum] account_id the account ID
41
51
  # @param [Hash] options the filtering and sorting option
52
+ # @option options [Integer] :page current page (pagination)
53
+ # @option options [Integer] :per_page number of entries to return (pagination)
54
+ # @option options [String] :sort sorting policy
55
+ # @option options [Hash] :filter filtering policy
42
56
  # @return [Dnsimple::CollectionResponse<Dnsimple::Struct::Domain>]
43
57
  #
44
58
  # @raise [Dnsimple::RequestError]
@@ -70,7 +84,7 @@ module Dnsimple
70
84
  #
71
85
  # @see https://developer.dnsimple.com/v2/domains/#get
72
86
  #
73
- # @param [Fixnum, Dnsimple::Client::WILDCARD_ACCOUNT] account_id the account ID or wildcard
87
+ # @param [Fixnum] account_id the account ID
74
88
  # @param [#to_s] domain_id The domain ID or domain name
75
89
  # @param [Hash] options
76
90
  # @return [Dnsimple::Response<Dnsimple::Struct::Domain>]
@@ -89,7 +103,7 @@ module Dnsimple
89
103
  #
90
104
  # @see https://developer.dnsimple.com/v2/domains/#delete
91
105
  #
92
- # @param [Fixnum, Dnsimple::Client::WILDCARD_ACCOUNT] account_id the account ID or wildcard
106
+ # @param [Fixnum] account_id the account ID
93
107
  # @param [#to_s] domain_id The domain ID or domain name
94
108
  # @param [Hash] options
95
109
  # @return [Dnsimple::Response<nil>]
@@ -107,7 +121,7 @@ module Dnsimple
107
121
  #
108
122
  # @see https://developer.dnsimple.com/v2/domains/#reset-token
109
123
  #
110
- # @param [Fixnum, Dnsimple::Client::WILDCARD_ACCOUNT] account_id the account ID or wildcard
124
+ # @param [Fixnum] account_id the account ID
111
125
  # @param [#to_s] domain_id The domain ID or domain name
112
126
  # @param [Hash] options
113
127
  # @return [Dnsimple::Response<nil>]
@@ -10,17 +10,23 @@ module Dnsimple
10
10
  # client.domains.email_forwards(1010, "example.com")
11
11
  #
12
12
  # @example List email forwards, provide a specific page
13
- # client.domains.email_forwards(1010, "example.com", query: { page: 2 })
13
+ # client.domains.email_forwards(1010, "example.com", page: 2)
14
14
  #
15
- # @param [Fixnum, Dnsimple::Client::WILDCARD_ACCOUNT] account_id the account ID or wildcard
15
+ # @example List email forwards, provide a sorting policy
16
+ # client.domains.email_forwards(1010, "example.com", sort: "from:asc")
17
+ #
18
+ # @param [Fixnum] account_id the account ID
16
19
  # @param [#to_s] domain_id The domain ID or domain name
17
- # @param [Hash] options the filtering and sorting option
20
+ # @param [Hash] options the filtering and sorting options
21
+ # @option options [Integer] :page current page (pagination)
22
+ # @option options [Integer] :per_page number of entries to return (pagination)
23
+ # @option options [String] :sort sorting policy
18
24
  # @return [Dnsimple::PaginatedResponse<Dnsimple::Struct::EmailForward>]
19
25
  #
20
26
  # @raise [Dnsimple::NotFoundError]
21
27
  # @raise [Dnsimple::RequestError]
22
28
  def email_forwards(account_id, domain_id, options = {})
23
- response = client.get(Client.versioned("/%s/domains/%s/email_forwards" % [account_id, domain_id]), options)
29
+ response = client.get(Client.versioned("/%s/domains/%s/email_forwards" % [account_id, domain_id]), Options::ListOptions.new(options))
24
30
 
25
31
  Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::EmailForward.new(r) })
26
32
  end
@@ -36,9 +42,12 @@ module Dnsimple
36
42
  # @see https://developer.dnsimple.com/v2/domains/email-forwards/#list
37
43
  # @see #email_forwards
38
44
  #
39
- # @param [Fixnum, Dnsimple::Client::WILDCARD_ACCOUNT] account_id the account ID or wildcard
45
+ # @param [Fixnum] account_id the account ID
40
46
  # @param [#to_s] domain_id The domain ID or domain name
41
47
  # @param [Hash] options the filtering and sorting option
48
+ # @option options [Integer] :page current page (pagination)
49
+ # @option options [Integer] :per_page number of entries to return (pagination)
50
+ # @option options [String] :sort sorting policy
42
51
  # @return [Dnsimple::CollectionResponse<Dnsimple::Struct::EmailForward>]
43
52
  #
44
53
  # @raise [Dnsimple::RequestError]
@@ -50,7 +59,7 @@ module Dnsimple
50
59
  #
51
60
  # @see https://developer.dnsimple.com/v2/domains/email-forwards/#create
52
61
  #
53
- # @param [Fixnum, Dnsimple::Client::WILDCARD_ACCOUNT] account_id the account ID or wildcard
62
+ # @param [Fixnum] account_id the account ID
54
63
  # @param [#to_s] domain_id The domain ID or domain name
55
64
  # @param [Hash] attributes
56
65
  # @param [Hash] options
@@ -68,7 +77,7 @@ module Dnsimple
68
77
  #
69
78
  # @see https://developer.dnsimple.com/v2/domains/email-forwards/#get
70
79
  #
71
- # @param [Fixnum, Dnsimple::Client::WILDCARD_ACCOUNT] account_id the account ID or wildcard
80
+ # @param [Fixnum] account_id the account ID
72
81
  # @param [#to_s] domain_id The domain ID or domain name
73
82
  # @param [#to_s] email_forward_id The email forward ID
74
83
  # @param [Hash] options
@@ -88,7 +97,7 @@ module Dnsimple
88
97
  #
89
98
  # @see https://developer.dnsimple.com/v2/domains/email-forwards/#delete
90
99
  #
91
- # @param [Fixnum, Dnsimple::Client::WILDCARD_ACCOUNT] account_id the account ID or wildcard
100
+ # @param [Fixnum] account_id the account ID
92
101
  # @param [#to_s] domain_id The domain ID or domain name
93
102
  # @param [#to_s] email_forward_id The email forward ID
94
103
  # @param [Hash] options