recurly 3.18.0 → 4.2.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 (62) hide show
  1. checksums.yaml +4 -4
  2. data/.bumpversion.cfg +1 -1
  3. data/.changelog_config.yaml +11 -0
  4. data/.github/workflows/docs.yml +1 -1
  5. data/.travis.yml +1 -0
  6. data/CHANGELOG.md +108 -362
  7. data/GETTING_STARTED.md +20 -17
  8. data/lib/recurly/client.rb +45 -20
  9. data/lib/recurly/client/operations.rb +666 -572
  10. data/lib/recurly/errors.rb +5 -22
  11. data/lib/recurly/errors/api_errors.rb +3 -0
  12. data/lib/recurly/errors/network_errors.rb +1 -4
  13. data/lib/recurly/pager.rb +5 -15
  14. data/lib/recurly/requests/{account_acquisition_updatable.rb → account_acquisition_update.rb} +1 -1
  15. data/lib/recurly/requests/account_create.rb +2 -2
  16. data/lib/recurly/requests/account_purchase.rb +2 -2
  17. data/lib/recurly/requests/add_on_create.rb +4 -4
  18. data/lib/recurly/requests/add_on_pricing.rb +5 -1
  19. data/lib/recurly/requests/add_on_update.rb +4 -4
  20. data/lib/recurly/requests/address.rb +0 -8
  21. data/lib/recurly/requests/billing_info_create.rb +5 -25
  22. data/lib/recurly/requests/coupon_create.rb +1 -1
  23. data/lib/recurly/requests/external_transaction.rb +1 -1
  24. data/lib/recurly/requests/{invoice_updatable.rb → invoice_update.rb} +1 -1
  25. data/lib/recurly/requests/line_item_create.rb +1 -1
  26. data/lib/recurly/requests/subscription_add_on_create.rb +6 -2
  27. data/lib/recurly/requests/subscription_add_on_tier.rb +9 -1
  28. data/lib/recurly/requests/subscription_add_on_update.rb +6 -2
  29. data/lib/recurly/requests/subscription_change_create.rb +1 -1
  30. data/lib/recurly/requests/subscription_create.rb +3 -3
  31. data/lib/recurly/requests/subscription_purchase.rb +1 -1
  32. data/lib/recurly/requests/tier.rb +7 -3
  33. data/lib/recurly/requests/tier_pricing.rb +22 -0
  34. data/lib/recurly/resources/add_on.rb +1 -1
  35. data/lib/recurly/resources/add_on_pricing.rb +5 -1
  36. data/lib/recurly/resources/address.rb +0 -8
  37. data/lib/recurly/resources/address_with_name.rb +46 -0
  38. data/lib/recurly/resources/billing_info.rb +4 -0
  39. data/lib/recurly/resources/coupon.rb +5 -17
  40. data/lib/recurly/resources/invoice.rb +6 -2
  41. data/lib/recurly/resources/line_item.rb +4 -0
  42. data/lib/recurly/resources/plan.rb +1 -1
  43. data/lib/recurly/resources/subscription_add_on.rb +6 -2
  44. data/lib/recurly/resources/subscription_add_on_tier.rb +9 -1
  45. data/lib/recurly/resources/subscription_change.rb +0 -4
  46. data/lib/recurly/resources/tier.rb +7 -3
  47. data/lib/recurly/resources/tier_pricing.rb +22 -0
  48. data/lib/recurly/resources/transaction.rb +6 -2
  49. data/lib/recurly/resources/unique_coupon_code_params.rb +26 -0
  50. data/lib/recurly/resources/usage.rb +5 -1
  51. data/lib/recurly/version.rb +1 -1
  52. data/openapi/api.yaml +1917 -1988
  53. data/scripts/build +2 -2
  54. data/scripts/format +2 -2
  55. data/scripts/prepare-release +43 -29
  56. data/scripts/release +5 -20
  57. metadata +13 -13
  58. data/.github_changelog_generator +0 -8
  59. data/lib/recurly/resources/line_item_list.rb +0 -26
  60. data/lib/recurly/resources/subscription_change_preview.rb +0 -78
  61. data/scripts/bump +0 -11
  62. data/scripts/changelog +0 -14
data/GETTING_STARTED.md CHANGED
@@ -5,7 +5,7 @@ This repository houses the official ruby client for Recurly's V3 API.
5
5
  In your Gemfile, add `recurly` as a dependency.
6
6
 
7
7
  ```ruby
8
- gem 'recurly', '~> 3.18'
8
+ gem 'recurly', '~> 4.2'
9
9
  ```
10
10
 
11
11
  > *Note*: We try to follow [semantic versioning](https://semver.org/) and will only apply breaking changes to major versions.
@@ -106,17 +106,19 @@ plans.each_page.each_with_index do |data, page_num|
106
106
  end
107
107
  ```
108
108
 
109
- Pagination endpoints take a number of options to sort and filter the results. They can be passed in as keyword arguments.
109
+ Pagination endpoints take a number of options to sort and filter the results. They can be passed in as a hash provided by the `:params` keyword argument.
110
110
  The names, types, and descriptions of these arguments are listed in the rubydocs for each method:
111
111
 
112
112
  ```ruby
113
113
  options = {
114
- limit: 200, # number of items per page
115
- state: :active, # only active plans
116
- sort: :updated_at,
117
- order: :asc,
118
- begin_time: DateTime.new(2017,1,1), # January 1st 2017,
119
- end_time: DateTime.now
114
+ params: {
115
+ limit: 200, # number of items per page
116
+ state: :active, # only active plans
117
+ sort: :updated_at,
118
+ order: :asc,
119
+ begin_time: DateTime.new(2017,1,1), # January 1st 2017,
120
+ end_time: DateTime.now
121
+ }
120
122
  }
121
123
 
122
124
  plans = client.list_plans(**options)
@@ -200,12 +202,11 @@ plan = client.create_plan(body: plan_data)
200
202
 
201
203
  # Error Handling
202
204
 
203
- This library currently throws 2 types of exceptions. {Recurly::Errors::APIError} and {Recurly::Errors::NetworkError}. See these 2 files for the types of exceptions you can catch:
205
+ All errors thrown by this library are based off of the `Recurly::Errors::APIError`. There
204
206
 
205
- 1. [API Errors](./lib/recurly/errors/api_errors.rb)
206
- 2. [Network Errors](./lib/recurly/errors/network_errors.rb)
207
+ This library throws one main type of exception, `Recurly::Errors::APIError`. There exists an additional hierarchy of errors to facilitate the process of rescuing various classes of errors. More detail can be found in the [Api Errors Module](./lib/recurly/errors/api_errors.rb).
207
208
 
208
- You will normally be working with {Recurly::Errors::APIError}. You can catch specific or generic versions of these exceptions. Example:
209
+ You can catch specific or generic versions of these exceptions. Example:
209
210
 
210
211
  ```ruby
211
212
  begin
@@ -233,15 +234,17 @@ rescue Recurly::Errors::ValidationError => ex
233
234
  #=> #<Recurly::Error:0x007fbbdf8a32c8 @attributes={:type=>"validation", :message=>"Code 'iexistalready' already exists", :params=>[{"param"=>"code", "message"=>"'iexistalready' already exists"}]}>
234
235
  puts ex.status_code
235
236
  #=> 422
237
+ rescue Recurly::Errors::TimeoutError => ex
238
+ # catch a specific server error
239
+ rescue Recurly::Errors::ServerError => ex
240
+ # catch a generic server error
236
241
  rescue Recurly::Errors::APIError => ex
237
242
  # catch a generic api error
238
- rescue Recurly::Errors::TimeoutError => ex
239
- # catch a specific network error
240
- rescue Recurly::Errors::NetworkError => ex
241
- # catch a generic network error
242
243
  end
243
244
  ```
244
245
 
246
+ `Recurly::Errors::APIError` instances provide access to the response via the `#get_response` method.
247
+
245
248
  # HTTP Metadata
246
249
 
247
250
  Sometimes you might want to get some additional information about the underlying HTTP request and response. Instead of
@@ -266,7 +269,7 @@ response = @client.remove_line_item(
266
269
  line_item_id: "a959576b2b10b012"
267
270
  ).get_response
268
271
  ```
269
- And it can be captured on exceptions through the {Recurly::ApiError} object:
272
+ And it can be captured on exceptions through the {Recurly::APIError} object:
270
273
 
271
274
  ```ruby
272
275
  begin
@@ -20,7 +20,14 @@ module Recurly
20
20
  MAX_RETRIES = 3
21
21
  LOG_LEVELS = %i(debug info warn error fatal).freeze
22
22
  BASE36_ALPHABET = (("0".."9").to_a + ("a".."z").to_a).freeze
23
- REQUEST_OPTIONS = [:headers].freeze
23
+ ALLOWED_OPTIONS = [
24
+ :site_id,
25
+ :open_timeout,
26
+ :read_timeout,
27
+ :body,
28
+ :params,
29
+ :headers,
30
+ ].freeze
24
31
 
25
32
  # Initialize a client. It requires an API key.
26
33
  #
@@ -47,8 +54,9 @@ module Recurly
47
54
  #
48
55
  # @param api_key [String] The private API key
49
56
  # @param logger [Logger] A logger to use. Defaults to creating a new STDOUT logger with level WARN.
50
- def initialize(api_key:, site_id: nil, subdomain: nil, logger: nil)
51
- set_site_id(site_id, subdomain)
57
+ def initialize(api_key:, logger: nil)
58
+ raise ArgumentError, "'api_key' must be set to a non-nil value" if api_key.nil?
59
+
52
60
  set_api_key(api_key)
53
61
 
54
62
  if logger.nil?
@@ -90,6 +98,7 @@ module Recurly
90
98
  end
91
99
 
92
100
  def head(path, **options)
101
+ validate_options!(**options)
93
102
  request = Net::HTTP::Head.new build_url(path, options)
94
103
  set_headers(request, options[:headers])
95
104
  http_response = run_request(request, options)
@@ -97,6 +106,7 @@ module Recurly
97
106
  end
98
107
 
99
108
  def get(path, **options)
109
+ validate_options!(**options)
100
110
  request = Net::HTTP::Get.new build_url(path, options)
101
111
  set_headers(request, options[:headers])
102
112
  http_response = run_request(request, options)
@@ -104,6 +114,7 @@ module Recurly
104
114
  end
105
115
 
106
116
  def post(path, request_data, request_class, **options)
117
+ validate_options!(**options)
107
118
  request_class.new(request_data).validate!
108
119
  request = Net::HTTP::Post.new build_url(path, options)
109
120
  request.set_content_type(JSON_CONTENT_TYPE)
@@ -114,6 +125,7 @@ module Recurly
114
125
  end
115
126
 
116
127
  def put(path, request_data = nil, request_class = nil, **options)
128
+ validate_options!(**options)
117
129
  request = Net::HTTP::Put.new build_url(path, options)
118
130
  request.set_content_type(JSON_CONTENT_TYPE)
119
131
  set_headers(request, options[:headers])
@@ -127,6 +139,7 @@ module Recurly
127
139
  end
128
140
 
129
141
  def delete(path, **options)
142
+ validate_options!(**options)
130
143
  request = Net::HTTP::Delete.new build_url(path, options)
131
144
  set_headers(request, options[:headers])
132
145
  http_response = run_request(request, options)
@@ -194,7 +207,7 @@ module Recurly
194
207
  end
195
208
 
196
209
  raise Recurly::Errors::ConnectionFailedError, "Failed to connect to Recurly: #{ex.message}"
197
- rescue Net::ReadTimeout, Timeout::Error
210
+ rescue Timeout::Error
198
211
  raise Recurly::Errors::TimeoutError, "Request timed out"
199
212
  rescue OpenSSL::SSL::SSLError => ex
200
213
  raise Recurly::Errors::SSLError, ex.message
@@ -240,7 +253,7 @@ module Recurly
240
253
  elsif BINARY_TYPES.include?(http_response.content_type)
241
254
  FileParser.parse(response.body)
242
255
  else
243
- raise Recurly::Errors::InvalidResponseError, "Unexpected content type: #{http_response.content_type}"
256
+ raise Recurly::Errors::InvalidContentTypeError, "Unexpected content type: #{http_response.content_type}"
244
257
  end
245
258
  else
246
259
  Resources::Empty.new
@@ -255,10 +268,10 @@ module Recurly
255
268
  error = JSONParser.parse(self, response.body)
256
269
  begin
257
270
  error_class = Errors::APIError.error_class(error.type)
258
- raise error_class.new(response, error)
271
+ raise error_class.new(error.message, response, error)
259
272
  rescue NameError
260
273
  error_class = Errors::APIError.from_response(http_response)
261
- raise error_class.new(response, error)
274
+ raise error_class.new("Unknown Error", response, error)
262
275
  end
263
276
  end
264
277
 
@@ -266,7 +279,7 @@ module Recurly
266
279
 
267
280
  if error_class <= Recurly::Errors::APIError
268
281
  error = Recurly::Resources::Error.new(message: "#{http_response.code}: #{http_response.message}")
269
- raise error_class.new(response, error)
282
+ raise error_class.new(error.message, response, error)
270
283
  else
271
284
  raise error_class, "#{http_response.code}: #{http_response.message}"
272
285
  end
@@ -279,6 +292,17 @@ module Recurly
279
292
  response
280
293
  end
281
294
 
295
+ def validate_options!(**options)
296
+ invalid_options = options.keys.reject do |k|
297
+ ALLOWED_OPTIONS.include?(k)
298
+ end
299
+ if invalid_options.any?
300
+ joinedKeys = invalid_options.join(", ")
301
+ joinedOptions = ALLOWED_OPTIONS.join(", ")
302
+ raise ArgumentError, "Invalid options: '#{joinedKeys}'. Allowed options: '#{joinedOptions}'"
303
+ end
304
+ end
305
+
282
306
  def validate_path_parameters!(**options)
283
307
  # Check to see that we are passing the correct data types
284
308
  # This prevents a confusing error if the user passes in a non-primitive by mistake
@@ -299,7 +323,7 @@ module Recurly
299
323
  end
300
324
 
301
325
  def interpolate_path(path, **options)
302
- validate_path_parameters!(options)
326
+ validate_path_parameters!(**options)
303
327
  options.each do |k, v|
304
328
  # We need to encode the values for the url
305
329
  options[k] = ERB::Util.url_encode(v.to_s)
@@ -308,21 +332,13 @@ module Recurly
308
332
  path % options
309
333
  end
310
334
 
311
- def set_site_id(site_id, subdomain)
312
- if site_id
313
- @site_id = site_id
314
- elsif subdomain
315
- @site_id = "subdomain-#{subdomain}"
316
- end
317
- end
318
-
319
335
  def set_api_key(api_key)
320
- @api_key = api_key
336
+ @api_key = api_key.to_s
321
337
  end
322
338
 
323
339
  def build_url(path, options)
324
340
  path = scope_by_site(path, options)
325
- query_params = options.reject { |k, _| REQUEST_OPTIONS.include?(k.to_sym) }
341
+ query_params = map_array_params(options.fetch(:params, {}))
326
342
  if query_params.any?
327
343
  "#{path}?#{URI.encode_www_form(query_params)}"
328
344
  else
@@ -330,7 +346,16 @@ module Recurly
330
346
  end
331
347
  end
332
348
 
333
- def scope_by_site(path, **options)
349
+ # Converts array parameters to CSV strings to maintain consistency with
350
+ # how the server expects the request to be formatted while providing the
351
+ # developer with an array type to maintain developer happiness!
352
+ def map_array_params(params)
353
+ params.map do |key, param|
354
+ [key, param.is_a?(Array) ? param.join(",") : param]
355
+ end.to_h
356
+ end
357
+
358
+ def scope_by_site(path, options)
334
359
  if site = site_id || options[:site_id]
335
360
  # Ensure that we are only including the site_id once because the Pager operations
336
361
  # will use the cursor returned from the API which may already have these components
@@ -5,14 +5,15 @@
5
5
  module Recurly
6
6
  class Client
7
7
  def api_version
8
- "v2019-10-10"
8
+ "v2021-02-25"
9
9
  end
10
10
 
11
11
  # List sites
12
12
  #
13
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_sites list_sites api documenation}
13
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_sites list_sites api documenation}
14
14
  #
15
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
15
+ # @param params [Hash] Optional query string parameters:
16
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
16
17
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
17
18
  #
18
19
  # *Important notes:*
@@ -24,17 +25,20 @@ module Recurly
24
25
  # * Records are returned in an arbitrary order. Since results are all
25
26
  # returned at once you can sort the records yourself.
26
27
  #
27
- # @param limit [Integer] Limit number of records 1-200.
28
- # @param order [String] Sort order.
29
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
28
+ # :limit [Integer] Limit number of records 1-200.
29
+ # :order [String] Sort order.
30
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
30
31
  # order. In descending order updated records will move behind the cursor and could
31
32
  # prevent some records from being returned.
32
33
  #
33
- # @param state [String] Filter by state.
34
+ # :state [String] Filter by state.
34
35
  #
35
36
  # @return [Pager<Resources::Site>] A list of sites.
36
37
  # @example
37
- # sites = @client.list_sites(limit: 200)
38
+ # params = {
39
+ # limit: 200
40
+ # }
41
+ # sites = @client.list_sites(params: params)
38
42
  # sites.each do |site|
39
43
  # puts "Site: #{site.subdomain}"
40
44
  # end
@@ -46,9 +50,10 @@ module Recurly
46
50
 
47
51
  # Fetch a site
48
52
  #
49
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_site get_site api documenation}
53
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_site get_site api documenation}
50
54
  #
51
55
  # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
56
+ # @param params [Hash] Optional query string parameters:
52
57
  #
53
58
  # @return [Resources::Site] A site.
54
59
  # @example
@@ -61,16 +66,17 @@ module Recurly
61
66
  # puts "Resource Not Found"
62
67
  # end
63
68
  #
64
- def get_site(site_id:)
69
+ def get_site(site_id:, **options)
65
70
  path = interpolate_path("/sites/{site_id}", site_id: site_id)
66
- get(path)
71
+ get(path, **options)
67
72
  end
68
73
 
69
74
  # List a site's accounts
70
75
  #
71
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_accounts list_accounts api documenation}
76
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_accounts list_accounts api documenation}
72
77
  #
73
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
78
+ # @param params [Hash] Optional query string parameters:
79
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
74
80
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
75
81
  #
76
82
  # *Important notes:*
@@ -82,43 +88,45 @@ module Recurly
82
88
  # * Records are returned in an arbitrary order. Since results are all
83
89
  # returned at once you can sort the records yourself.
84
90
  #
85
- # @param limit [Integer] Limit number of records 1-200.
86
- # @param order [String] Sort order.
87
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
91
+ # :limit [Integer] Limit number of records 1-200.
92
+ # :order [String] Sort order.
93
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
88
94
  # order. In descending order updated records will move behind the cursor and could
89
95
  # prevent some records from being returned.
90
96
  #
91
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
97
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
92
98
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
93
99
  #
94
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
100
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
95
101
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
96
102
  #
97
- # @param email [String] Filter for accounts with this exact email address. A blank value will return accounts with both +null+ and +""+ email addresses. Note that multiple accounts can share one email address.
98
- # @param subscriber [Boolean] Filter for accounts with or without a subscription in the +active+,
103
+ # :email [String] Filter for accounts with this exact email address. A blank value will return accounts with both +null+ and +""+ email addresses. Note that multiple accounts can share one email address.
104
+ # :subscriber [Boolean] Filter for accounts with or without a subscription in the +active+,
99
105
  # +canceled+, or +future+ state.
100
106
  #
101
- # @param past_due [String] Filter for accounts with an invoice in the +past_due+ state.
102
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
107
+ # :past_due [String] Filter for accounts with an invoice in the +past_due+ state.
103
108
  #
104
109
  # @return [Pager<Resources::Account>] A list of the site's accounts.
105
110
  # @example
106
- # accounts = @client.list_accounts(limit: 200)
111
+ # params = {
112
+ # limit: 200
113
+ # }
114
+ # accounts = @client.list_accounts(params: params)
107
115
  # accounts.each do |account|
108
116
  # puts "Account: #{account.code}"
109
117
  # end
110
118
  #
111
119
  def list_accounts(**options)
112
- path = interpolate_path("/accounts")
120
+ path = "/accounts"
113
121
  pager(path, **options)
114
122
  end
115
123
 
116
124
  # Create an account
117
125
  #
118
- # {https://developers.recurly.com/api/v2019-10-10#operation/create_account create_account api documenation}
126
+ # {https://developers.recurly.com/api/v2021-02-25#operation/create_account create_account api documenation}
119
127
  #
120
128
  # @param body [Requests::AccountCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountCreate}
121
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
129
+ # @param params [Hash] Optional query string parameters:
122
130
  #
123
131
  # @return [Resources::Account] An account.
124
132
  # @example
@@ -158,16 +166,16 @@ module Recurly
158
166
  # end
159
167
  #
160
168
  def create_account(body:, **options)
161
- path = interpolate_path("/accounts")
169
+ path = "/accounts"
162
170
  post(path, body, Requests::AccountCreate, **options)
163
171
  end
164
172
 
165
173
  # Fetch an account
166
174
  #
167
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_account get_account api documenation}
175
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_account get_account api documenation}
168
176
  #
169
177
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
170
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
178
+ # @param params [Hash] Optional query string parameters:
171
179
  #
172
180
  # @return [Resources::Account] An account.
173
181
  # @example
@@ -185,13 +193,13 @@ module Recurly
185
193
  get(path, **options)
186
194
  end
187
195
 
188
- # Modify an account
196
+ # Update an account
189
197
  #
190
- # {https://developers.recurly.com/api/v2019-10-10#operation/update_account update_account api documenation}
198
+ # {https://developers.recurly.com/api/v2021-02-25#operation/update_account update_account api documenation}
191
199
  #
192
200
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
193
201
  # @param body [Requests::AccountUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountUpdate}
194
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
202
+ # @param params [Hash] Optional query string parameters:
195
203
  #
196
204
  # @return [Resources::Account] An account.
197
205
  # @example
@@ -218,10 +226,10 @@ module Recurly
218
226
 
219
227
  # Deactivate an account
220
228
  #
221
- # {https://developers.recurly.com/api/v2019-10-10#operation/deactivate_account deactivate_account api documenation}
229
+ # {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_account deactivate_account api documenation}
222
230
  #
223
231
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
224
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
232
+ # @param params [Hash] Optional query string parameters:
225
233
  #
226
234
  # @return [Resources::Account] An account.
227
235
  # @example
@@ -241,10 +249,10 @@ module Recurly
241
249
 
242
250
  # Fetch an account's acquisition data
243
251
  #
244
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_account_acquisition get_account_acquisition api documenation}
252
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_account_acquisition get_account_acquisition api documenation}
245
253
  #
246
254
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
247
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
255
+ # @param params [Hash] Optional query string parameters:
248
256
  #
249
257
  # @return [Resources::AccountAcquisition] An account's acquisition data.
250
258
  # @example
@@ -264,11 +272,11 @@ module Recurly
264
272
 
265
273
  # Update an account's acquisition data
266
274
  #
267
- # {https://developers.recurly.com/api/v2019-10-10#operation/update_account_acquisition update_account_acquisition api documenation}
275
+ # {https://developers.recurly.com/api/v2021-02-25#operation/update_account_acquisition update_account_acquisition api documenation}
268
276
  #
269
277
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
270
- # @param body [Requests::AccountAcquisitionUpdatable] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountAcquisitionUpdatable}
271
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
278
+ # @param body [Requests::AccountAcquisitionUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountAcquisitionUpdate}
279
+ # @param params [Hash] Optional query string parameters:
272
280
  #
273
281
  # @return [Resources::AccountAcquisition] An account's updated acquisition data.
274
282
  # @example
@@ -295,15 +303,15 @@ module Recurly
295
303
  #
296
304
  def update_account_acquisition(account_id:, body:, **options)
297
305
  path = interpolate_path("/accounts/{account_id}/acquisition", account_id: account_id)
298
- put(path, body, Requests::AccountAcquisitionUpdatable, **options)
306
+ put(path, body, Requests::AccountAcquisitionUpdate, **options)
299
307
  end
300
308
 
301
309
  # Remove an account's acquisition data
302
310
  #
303
- # {https://developers.recurly.com/api/v2019-10-10#operation/remove_account_acquisition remove_account_acquisition api documenation}
311
+ # {https://developers.recurly.com/api/v2021-02-25#operation/remove_account_acquisition remove_account_acquisition api documenation}
304
312
  #
305
313
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
306
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
314
+ # @param params [Hash] Optional query string parameters:
307
315
  #
308
316
  # @return [Resources::Empty] Acquisition data was succesfully deleted.
309
317
  # @example
@@ -323,10 +331,10 @@ module Recurly
323
331
 
324
332
  # Reactivate an inactive account
325
333
  #
326
- # {https://developers.recurly.com/api/v2019-10-10#operation/reactivate_account reactivate_account api documenation}
334
+ # {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_account reactivate_account api documenation}
327
335
  #
328
336
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
329
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
337
+ # @param params [Hash] Optional query string parameters:
330
338
  #
331
339
  # @return [Resources::Account] An account.
332
340
  # @example
@@ -346,10 +354,10 @@ module Recurly
346
354
 
347
355
  # Fetch an account's balance and past due status
348
356
  #
349
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_account_balance get_account_balance api documenation}
357
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_account_balance get_account_balance api documenation}
350
358
  #
351
359
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
352
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
360
+ # @param params [Hash] Optional query string parameters:
353
361
  #
354
362
  # @return [Resources::AccountBalance] An account's balance.
355
363
  # @example
@@ -369,10 +377,10 @@ module Recurly
369
377
 
370
378
  # Fetch an account's billing information
371
379
  #
372
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_billing_info get_billing_info api documenation}
380
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_billing_info get_billing_info api documenation}
373
381
  #
374
382
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
375
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
383
+ # @param params [Hash] Optional query string parameters:
376
384
  #
377
385
  # @return [Resources::BillingInfo] An account's billing information.
378
386
  # @example
@@ -392,11 +400,11 @@ module Recurly
392
400
 
393
401
  # Set an account's billing information
394
402
  #
395
- # {https://developers.recurly.com/api/v2019-10-10#operation/update_billing_info update_billing_info api documenation}
403
+ # {https://developers.recurly.com/api/v2021-02-25#operation/update_billing_info update_billing_info api documenation}
396
404
  #
397
405
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
398
406
  # @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
399
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
407
+ # @param params [Hash] Optional query string parameters:
400
408
  #
401
409
  # @return [Resources::BillingInfo] Updated billing information.
402
410
  # @example
@@ -423,10 +431,10 @@ module Recurly
423
431
 
424
432
  # Remove an account's billing information
425
433
  #
426
- # {https://developers.recurly.com/api/v2019-10-10#operation/remove_billing_info remove_billing_info api documenation}
434
+ # {https://developers.recurly.com/api/v2021-02-25#operation/remove_billing_info remove_billing_info api documenation}
427
435
  #
428
436
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
429
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
437
+ # @param params [Hash] Optional query string parameters:
430
438
  #
431
439
  # @return [Resources::Empty] Billing information deleted
432
440
  # @example
@@ -446,10 +454,11 @@ module Recurly
446
454
 
447
455
  # Get the list of billing information associated with an account
448
456
  #
449
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_billing_infos list_billing_infos api documenation}
457
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_billing_infos list_billing_infos api documenation}
450
458
  #
451
459
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
452
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
460
+ # @param params [Hash] Optional query string parameters:
461
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
453
462
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
454
463
  #
455
464
  # *Important notes:*
@@ -461,17 +470,16 @@ module Recurly
461
470
  # * Records are returned in an arbitrary order. Since results are all
462
471
  # returned at once you can sort the records yourself.
463
472
  #
464
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
473
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
465
474
  # order. In descending order updated records will move behind the cursor and could
466
475
  # prevent some records from being returned.
467
476
  #
468
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
477
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
469
478
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
470
479
  #
471
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
480
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
472
481
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
473
482
  #
474
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
475
483
  #
476
484
  # @return [Pager<Resources::BillingInfo>] A list of the the billing information for an account's
477
485
  #
@@ -482,11 +490,11 @@ module Recurly
482
490
 
483
491
  # Set an account's billing information when the wallet feature is enabled
484
492
  #
485
- # {https://developers.recurly.com/api/v2019-10-10#operation/create_billing_info create_billing_info api documenation}
493
+ # {https://developers.recurly.com/api/v2021-02-25#operation/create_billing_info create_billing_info api documenation}
486
494
  #
487
495
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
488
496
  # @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
489
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
497
+ # @param params [Hash] Optional query string parameters:
490
498
  #
491
499
  # @return [Resources::BillingInfo] Updated billing information.
492
500
  #
@@ -497,11 +505,11 @@ module Recurly
497
505
 
498
506
  # Fetch a billing info
499
507
  #
500
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_a_billing_info get_a_billing_info api documenation}
508
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_a_billing_info get_a_billing_info api documenation}
501
509
  #
502
510
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
503
511
  # @param billing_info_id [String] Billing Info ID.
504
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
512
+ # @param params [Hash] Optional query string parameters:
505
513
  #
506
514
  # @return [Resources::BillingInfo] A billing info.
507
515
  #
@@ -512,12 +520,12 @@ module Recurly
512
520
 
513
521
  # Update an account's billing information
514
522
  #
515
- # {https://developers.recurly.com/api/v2019-10-10#operation/update_a_billing_info update_a_billing_info api documenation}
523
+ # {https://developers.recurly.com/api/v2021-02-25#operation/update_a_billing_info update_a_billing_info api documenation}
516
524
  #
517
525
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
518
526
  # @param billing_info_id [String] Billing Info ID.
519
527
  # @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
520
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
528
+ # @param params [Hash] Optional query string parameters:
521
529
  #
522
530
  # @return [Resources::BillingInfo] Updated billing information.
523
531
  #
@@ -528,11 +536,11 @@ module Recurly
528
536
 
529
537
  # Remove an account's billing information
530
538
  #
531
- # {https://developers.recurly.com/api/v2019-10-10#operation/remove_a_billing_info remove_a_billing_info api documenation}
539
+ # {https://developers.recurly.com/api/v2021-02-25#operation/remove_a_billing_info remove_a_billing_info api documenation}
532
540
  #
533
541
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
534
542
  # @param billing_info_id [String] Billing Info ID.
535
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
543
+ # @param params [Hash] Optional query string parameters:
536
544
  #
537
545
  # @return [Resources::Empty] Billing information deleted
538
546
  #
@@ -543,10 +551,11 @@ module Recurly
543
551
 
544
552
  # Show the coupon redemptions for an account
545
553
  #
546
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_account_coupon_redemptions list_account_coupon_redemptions api documenation}
554
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_account_coupon_redemptions list_account_coupon_redemptions api documenation}
547
555
  #
548
556
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
549
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
557
+ # @param params [Hash] Optional query string parameters:
558
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
550
559
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
551
560
  #
552
561
  # *Important notes:*
@@ -558,24 +567,26 @@ module Recurly
558
567
  # * Records are returned in an arbitrary order. Since results are all
559
568
  # returned at once you can sort the records yourself.
560
569
  #
561
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
570
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
562
571
  # order. In descending order updated records will move behind the cursor and could
563
572
  # prevent some records from being returned.
564
573
  #
565
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
574
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
566
575
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
567
576
  #
568
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
577
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
569
578
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
570
579
  #
571
- # @param state [String] Filter by state.
572
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
580
+ # :state [String] Filter by state.
573
581
  #
574
582
  # @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions on an account.
575
583
  # @example
584
+ # params = {
585
+ # limit: 200
586
+ # }
576
587
  # redemptions = @client.list_account_coupon_redemptions(
577
588
  # account_id: account_id,
578
- # limit: 200
589
+ # params: params
579
590
  # )
580
591
  # redemptions.each do |redemption|
581
592
  # puts "CouponRedemption: #{redemption.id}"
@@ -586,36 +597,35 @@ module Recurly
586
597
  pager(path, **options)
587
598
  end
588
599
 
589
- # Show the coupon redemption that is active on an account
600
+ # Show the coupon redemptions that are active on an account
590
601
  #
591
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_active_coupon_redemption get_active_coupon_redemption api documenation}
602
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_active_coupon_redemptions list_active_coupon_redemptions api documenation}
592
603
  #
593
604
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
594
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
605
+ # @param params [Hash] Optional query string parameters:
595
606
  #
596
- # @return [Resources::CouponRedemption] An active coupon redemption on an account.
607
+ # @return [Pager<Resources::CouponRedemption>] Active coupon redemptions on an account.
597
608
  # @example
598
- # begin
599
- # redemption = @client.get_active_coupon_redemption(account_id: account_id)
600
- # puts "Got CouponRedemption #{redemption}"
601
- # rescue Recurly::Errors::NotFoundError
602
- # # If the resource was not found, you may want to alert the user or
603
- # # just return nil
604
- # puts "Resource Not Found"
609
+ # params = {
610
+ # limit: 200
611
+ # }
612
+ # redemptions = @client.list_active_coupon_redemptions(account_id: account_id, params: params)
613
+ # redemptions.each do |redemption|
614
+ # puts "Redemption: #{redemption.id}"
605
615
  # end
606
616
  #
607
- def get_active_coupon_redemption(account_id:, **options)
617
+ def list_active_coupon_redemptions(account_id:, **options)
608
618
  path = interpolate_path("/accounts/{account_id}/coupon_redemptions/active", account_id: account_id)
609
- get(path, **options)
619
+ pager(path, **options)
610
620
  end
611
621
 
612
622
  # Generate an active coupon redemption on an account or subscription
613
623
  #
614
- # {https://developers.recurly.com/api/v2019-10-10#operation/create_coupon_redemption create_coupon_redemption api documenation}
624
+ # {https://developers.recurly.com/api/v2021-02-25#operation/create_coupon_redemption create_coupon_redemption api documenation}
615
625
  #
616
626
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
617
627
  # @param body [Requests::CouponRedemptionCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponRedemptionCreate}
618
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
628
+ # @param params [Hash] Optional query string parameters:
619
629
  #
620
630
  # @return [Resources::CouponRedemption] Returns the new coupon redemption.
621
631
  # @example
@@ -642,10 +652,10 @@ module Recurly
642
652
 
643
653
  # Delete the active coupon redemption from an account
644
654
  #
645
- # {https://developers.recurly.com/api/v2019-10-10#operation/remove_coupon_redemption remove_coupon_redemption api documenation}
655
+ # {https://developers.recurly.com/api/v2021-02-25#operation/remove_coupon_redemption remove_coupon_redemption api documenation}
646
656
  #
647
657
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
648
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
658
+ # @param params [Hash] Optional query string parameters:
649
659
  #
650
660
  # @return [Resources::CouponRedemption] Coupon redemption deleted.
651
661
  # @example
@@ -665,28 +675,31 @@ module Recurly
665
675
 
666
676
  # List an account's credit payments
667
677
  #
668
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_account_credit_payments list_account_credit_payments api documenation}
678
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_account_credit_payments list_account_credit_payments api documenation}
669
679
  #
670
680
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
671
- # @param limit [Integer] Limit number of records 1-200.
672
- # @param order [String] Sort order.
673
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
681
+ # @param params [Hash] Optional query string parameters:
682
+ # :limit [Integer] Limit number of records 1-200.
683
+ # :order [String] Sort order.
684
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
674
685
  # order. In descending order updated records will move behind the cursor and could
675
686
  # prevent some records from being returned.
676
687
  #
677
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
688
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
678
689
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
679
690
  #
680
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
691
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
681
692
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
682
693
  #
683
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
684
694
  #
685
695
  # @return [Pager<Resources::CreditPayment>] A list of the account's credit payments.
686
696
  # @example
697
+ # params = {
698
+ # limit: 200
699
+ # }
687
700
  # payments = @client.list_account_credit_payments(
688
701
  # account_id: account_id,
689
- # limit: 200
702
+ # params: params
690
703
  # )
691
704
  # payments.each do |payment|
692
705
  # puts "CreditPayment: #{payment.id}"
@@ -699,10 +712,11 @@ module Recurly
699
712
 
700
713
  # List an account's invoices
701
714
  #
702
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_account_invoices list_account_invoices api documenation}
715
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_account_invoices list_account_invoices api documenation}
703
716
  #
704
717
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
705
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
718
+ # @param params [Hash] Optional query string parameters:
719
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
706
720
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
707
721
  #
708
722
  # *Important notes:*
@@ -714,31 +728,33 @@ module Recurly
714
728
  # * Records are returned in an arbitrary order. Since results are all
715
729
  # returned at once you can sort the records yourself.
716
730
  #
717
- # @param limit [Integer] Limit number of records 1-200.
718
- # @param order [String] Sort order.
719
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
731
+ # :limit [Integer] Limit number of records 1-200.
732
+ # :order [String] Sort order.
733
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
720
734
  # order. In descending order updated records will move behind the cursor and could
721
735
  # prevent some records from being returned.
722
736
  #
723
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
737
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
724
738
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
725
739
  #
726
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
740
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
727
741
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
728
742
  #
729
- # @param type [String] Filter by type when:
743
+ # :type [String] Filter by type when:
730
744
  # - +type=charge+, only charge invoices will be returned.
731
745
  # - +type=credit+, only credit invoices will be returned.
732
746
  # - +type=non-legacy+, only charge and credit invoices will be returned.
733
747
  # - +type=legacy+, only legacy invoices will be returned.
734
748
  #
735
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
736
749
  #
737
750
  # @return [Pager<Resources::Invoice>] A list of the account's invoices.
738
751
  # @example
752
+ # params = {
753
+ # limit: 200
754
+ # }
739
755
  # invoices = @client.list_account_invoices(
740
756
  # account_id: account_id,
741
- # limit: 200
757
+ # params: params
742
758
  # )
743
759
  # invoices.each do |invoice|
744
760
  # puts "Invoice: #{invoice.number}"
@@ -751,11 +767,11 @@ module Recurly
751
767
 
752
768
  # Create an invoice for pending line items
753
769
  #
754
- # {https://developers.recurly.com/api/v2019-10-10#operation/create_invoice create_invoice api documenation}
770
+ # {https://developers.recurly.com/api/v2021-02-25#operation/create_invoice create_invoice api documenation}
755
771
  #
756
772
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
757
773
  # @param body [Requests::InvoiceCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCreate}
758
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
774
+ # @param params [Hash] Optional query string parameters:
759
775
  #
760
776
  # @return [Resources::InvoiceCollection] Returns the new invoices.
761
777
  # @example
@@ -782,11 +798,11 @@ module Recurly
782
798
 
783
799
  # Preview new invoice for pending line items
784
800
  #
785
- # {https://developers.recurly.com/api/v2019-10-10#operation/preview_invoice preview_invoice api documenation}
801
+ # {https://developers.recurly.com/api/v2021-02-25#operation/preview_invoice preview_invoice api documenation}
786
802
  #
787
803
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
788
804
  # @param body [Requests::InvoiceCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCreate}
789
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
805
+ # @param params [Hash] Optional query string parameters:
790
806
  #
791
807
  # @return [Resources::InvoiceCollection] Returns the invoice previews.
792
808
  # @example
@@ -813,10 +829,11 @@ module Recurly
813
829
 
814
830
  # List an account's line items
815
831
  #
816
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_account_line_items list_account_line_items api documenation}
832
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_account_line_items list_account_line_items api documenation}
817
833
  #
818
834
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
819
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
835
+ # @param params [Hash] Optional query string parameters:
836
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
820
837
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
821
838
  #
822
839
  # *Important notes:*
@@ -828,28 +845,30 @@ module Recurly
828
845
  # * Records are returned in an arbitrary order. Since results are all
829
846
  # returned at once you can sort the records yourself.
830
847
  #
831
- # @param limit [Integer] Limit number of records 1-200.
832
- # @param order [String] Sort order.
833
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
848
+ # :limit [Integer] Limit number of records 1-200.
849
+ # :order [String] Sort order.
850
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
834
851
  # order. In descending order updated records will move behind the cursor and could
835
852
  # prevent some records from being returned.
836
853
  #
837
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
854
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
838
855
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
839
856
  #
840
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
857
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
841
858
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
842
859
  #
843
- # @param original [String] Filter by original field.
844
- # @param state [String] Filter by state field.
845
- # @param type [String] Filter by type field.
846
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
860
+ # :original [String] Filter by original field.
861
+ # :state [String] Filter by state field.
862
+ # :type [String] Filter by type field.
847
863
  #
848
864
  # @return [Pager<Resources::LineItem>] A list of the account's line items.
849
865
  # @example
866
+ # params = {
867
+ # limit: 200
868
+ # }
850
869
  # line_items = @client.list_account_line_items(
851
870
  # account_id: account_id,
852
- # limit: 200
871
+ # params: params
853
872
  # )
854
873
  # line_items.each do |line_item|
855
874
  # puts "LineItem: #{line_item.id}"
@@ -862,11 +881,11 @@ module Recurly
862
881
 
863
882
  # Create a new line item for the account
864
883
  #
865
- # {https://developers.recurly.com/api/v2019-10-10#operation/create_line_item create_line_item api documenation}
884
+ # {https://developers.recurly.com/api/v2021-02-25#operation/create_line_item create_line_item api documenation}
866
885
  #
867
886
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
868
887
  # @param body [Requests::LineItemCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::LineItemCreate}
869
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
888
+ # @param params [Hash] Optional query string parameters:
870
889
  #
871
890
  # @return [Resources::LineItem] Returns the new line item.
872
891
  # @example
@@ -894,10 +913,11 @@ module Recurly
894
913
 
895
914
  # Fetch a list of an account's notes
896
915
  #
897
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_account_notes list_account_notes api documenation}
916
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_account_notes list_account_notes api documenation}
898
917
  #
899
918
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
900
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
919
+ # @param params [Hash] Optional query string parameters:
920
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
901
921
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
902
922
  #
903
923
  # *Important notes:*
@@ -909,11 +929,13 @@ module Recurly
909
929
  # * Records are returned in an arbitrary order. Since results are all
910
930
  # returned at once you can sort the records yourself.
911
931
  #
912
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
913
932
  #
914
933
  # @return [Pager<Resources::AccountNote>] A list of an account's notes.
915
934
  # @example
916
- # account_notes = @client.list_account_notes(account_id: account_id, limit: 200)
935
+ # params = {
936
+ # limit: 200
937
+ # }
938
+ # account_notes = @client.list_account_notes(account_id: account_id, params: params)
917
939
  # account_notes.each do |note|
918
940
  # puts "AccountNote: #{note.message}"
919
941
  # end
@@ -925,11 +947,11 @@ module Recurly
925
947
 
926
948
  # Fetch an account note
927
949
  #
928
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_account_note get_account_note api documenation}
950
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_account_note get_account_note api documenation}
929
951
  #
930
952
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
931
953
  # @param account_note_id [String] Account Note ID.
932
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
954
+ # @param params [Hash] Optional query string parameters:
933
955
  #
934
956
  # @return [Resources::AccountNote] An account note.
935
957
  # @example
@@ -952,10 +974,11 @@ module Recurly
952
974
 
953
975
  # Fetch a list of an account's shipping addresses
954
976
  #
955
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_shipping_addresses list_shipping_addresses api documenation}
977
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_shipping_addresses list_shipping_addresses api documenation}
956
978
  #
957
979
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
958
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
980
+ # @param params [Hash] Optional query string parameters:
981
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
959
982
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
960
983
  #
961
984
  # *Important notes:*
@@ -967,25 +990,27 @@ module Recurly
967
990
  # * Records are returned in an arbitrary order. Since results are all
968
991
  # returned at once you can sort the records yourself.
969
992
  #
970
- # @param limit [Integer] Limit number of records 1-200.
971
- # @param order [String] Sort order.
972
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
993
+ # :limit [Integer] Limit number of records 1-200.
994
+ # :order [String] Sort order.
995
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
973
996
  # order. In descending order updated records will move behind the cursor and could
974
997
  # prevent some records from being returned.
975
998
  #
976
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
999
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
977
1000
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
978
1001
  #
979
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1002
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
980
1003
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
981
1004
  #
982
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
983
1005
  #
984
1006
  # @return [Pager<Resources::ShippingAddress>] A list of an account's shipping addresses.
985
1007
  # @example
1008
+ # params = {
1009
+ # limit: 200
1010
+ # }
986
1011
  # shipping_addresses = @client.list_shipping_addresses(
987
1012
  # account_id: account_id,
988
- # limit: 200
1013
+ # params: params
989
1014
  # )
990
1015
  # shipping_addresses.each do |addr|
991
1016
  # puts "ShippingAddress: #{addr.nickname} - #{addr.street1}"
@@ -998,11 +1023,11 @@ module Recurly
998
1023
 
999
1024
  # Create a new shipping address for the account
1000
1025
  #
1001
- # {https://developers.recurly.com/api/v2019-10-10#operation/create_shipping_address create_shipping_address api documenation}
1026
+ # {https://developers.recurly.com/api/v2021-02-25#operation/create_shipping_address create_shipping_address api documenation}
1002
1027
  #
1003
1028
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
1004
1029
  # @param body [Requests::ShippingAddressCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingAddressCreate}
1005
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1030
+ # @param params [Hash] Optional query string parameters:
1006
1031
  #
1007
1032
  # @return [Resources::ShippingAddress] Returns the new shipping address.
1008
1033
  # @example
@@ -1032,11 +1057,11 @@ module Recurly
1032
1057
 
1033
1058
  # Fetch an account's shipping address
1034
1059
  #
1035
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_shipping_address get_shipping_address api documenation}
1060
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_shipping_address get_shipping_address api documenation}
1036
1061
  #
1037
1062
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
1038
1063
  # @param shipping_address_id [String] Shipping Address ID.
1039
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1064
+ # @param params [Hash] Optional query string parameters:
1040
1065
  #
1041
1066
  # @return [Resources::ShippingAddress] A shipping address.
1042
1067
  # @example
@@ -1059,12 +1084,12 @@ module Recurly
1059
1084
 
1060
1085
  # Update an account's shipping address
1061
1086
  #
1062
- # {https://developers.recurly.com/api/v2019-10-10#operation/update_shipping_address update_shipping_address api documenation}
1087
+ # {https://developers.recurly.com/api/v2021-02-25#operation/update_shipping_address update_shipping_address api documenation}
1063
1088
  #
1064
1089
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
1065
1090
  # @param shipping_address_id [String] Shipping Address ID.
1066
1091
  # @param body [Requests::ShippingAddressUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingAddressUpdate}
1067
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1092
+ # @param params [Hash] Optional query string parameters:
1068
1093
  #
1069
1094
  # @return [Resources::ShippingAddress] The updated shipping address.
1070
1095
  # @example
@@ -1093,11 +1118,11 @@ module Recurly
1093
1118
 
1094
1119
  # Remove an account's shipping address
1095
1120
  #
1096
- # {https://developers.recurly.com/api/v2019-10-10#operation/remove_shipping_address remove_shipping_address api documenation}
1121
+ # {https://developers.recurly.com/api/v2021-02-25#operation/remove_shipping_address remove_shipping_address api documenation}
1097
1122
  #
1098
1123
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
1099
1124
  # @param shipping_address_id [String] Shipping Address ID.
1100
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1125
+ # @param params [Hash] Optional query string parameters:
1101
1126
  #
1102
1127
  # @return [Resources::Empty] Shipping address deleted.
1103
1128
  # @example
@@ -1120,10 +1145,11 @@ module Recurly
1120
1145
 
1121
1146
  # List an account's subscriptions
1122
1147
  #
1123
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_account_subscriptions list_account_subscriptions api documenation}
1148
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_account_subscriptions list_account_subscriptions api documenation}
1124
1149
  #
1125
1150
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
1126
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1151
+ # @param params [Hash] Optional query string parameters:
1152
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1127
1153
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
1128
1154
  #
1129
1155
  # *Important notes:*
@@ -1135,31 +1161,33 @@ module Recurly
1135
1161
  # * Records are returned in an arbitrary order. Since results are all
1136
1162
  # returned at once you can sort the records yourself.
1137
1163
  #
1138
- # @param limit [Integer] Limit number of records 1-200.
1139
- # @param order [String] Sort order.
1140
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1164
+ # :limit [Integer] Limit number of records 1-200.
1165
+ # :order [String] Sort order.
1166
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1141
1167
  # order. In descending order updated records will move behind the cursor and could
1142
1168
  # prevent some records from being returned.
1143
1169
  #
1144
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1170
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1145
1171
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1146
1172
  #
1147
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1173
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1148
1174
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1149
1175
  #
1150
- # @param state [String] Filter by state.
1176
+ # :state [String] Filter by state.
1151
1177
  #
1152
1178
  # - When +state=active+, +state=canceled+, +state=expired+, or +state=future+, subscriptions with states that match the query and only those subscriptions will be returned.
1153
1179
  # - When +state=in_trial+, only subscriptions that have a trial_started_at date earlier than now and a trial_ends_at date later than now will be returned.
1154
1180
  # - When +state=live+, only subscriptions that are in an active, canceled, or future state or are in trial will be returned.
1155
1181
  #
1156
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1157
1182
  #
1158
1183
  # @return [Pager<Resources::Subscription>] A list of the account's subscriptions.
1159
1184
  # @example
1185
+ # params = {
1186
+ # limit: 200
1187
+ # }
1160
1188
  # subscriptions = @client.list_account_subscriptions(
1161
1189
  # account_id: account_id,
1162
- # limit: 200
1190
+ # params: params
1163
1191
  # )
1164
1192
  # subscriptions.each do |subscription|
1165
1193
  # puts "Subscription: #{subscription.uuid}"
@@ -1172,10 +1200,11 @@ module Recurly
1172
1200
 
1173
1201
  # List an account's transactions
1174
1202
  #
1175
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_account_transactions list_account_transactions api documenation}
1203
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_account_transactions list_account_transactions api documenation}
1176
1204
  #
1177
1205
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
1178
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1206
+ # @param params [Hash] Optional query string parameters:
1207
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1179
1208
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
1180
1209
  #
1181
1210
  # *Important notes:*
@@ -1187,27 +1216,29 @@ module Recurly
1187
1216
  # * Records are returned in an arbitrary order. Since results are all
1188
1217
  # returned at once you can sort the records yourself.
1189
1218
  #
1190
- # @param limit [Integer] Limit number of records 1-200.
1191
- # @param order [String] Sort order.
1192
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1219
+ # :limit [Integer] Limit number of records 1-200.
1220
+ # :order [String] Sort order.
1221
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1193
1222
  # order. In descending order updated records will move behind the cursor and could
1194
1223
  # prevent some records from being returned.
1195
1224
  #
1196
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1225
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1197
1226
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1198
1227
  #
1199
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1228
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1200
1229
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1201
1230
  #
1202
- # @param type [String] Filter by type field. The value +payment+ will return both +purchase+ and +capture+ transactions.
1203
- # @param success [String] Filter by success field.
1204
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1231
+ # :type [String] Filter by type field. The value +payment+ will return both +purchase+ and +capture+ transactions.
1232
+ # :success [String] Filter by success field.
1205
1233
  #
1206
1234
  # @return [Pager<Resources::Transaction>] A list of the account's transactions.
1207
1235
  # @example
1236
+ # params = {
1237
+ # limit: 200
1238
+ # }
1208
1239
  # transactions = @client.list_account_transactions(
1209
1240
  # account_id: account_id,
1210
- # limit: 200
1241
+ # params: params
1211
1242
  # )
1212
1243
  # transactions.each do |transaction|
1213
1244
  # puts "Transaction: #{transaction.uuid}"
@@ -1220,10 +1251,11 @@ module Recurly
1220
1251
 
1221
1252
  # List an account's child accounts
1222
1253
  #
1223
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_child_accounts list_child_accounts api documenation}
1254
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_child_accounts list_child_accounts api documenation}
1224
1255
  #
1225
1256
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
1226
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1257
+ # @param params [Hash] Optional query string parameters:
1258
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1227
1259
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
1228
1260
  #
1229
1261
  # *Important notes:*
@@ -1235,30 +1267,32 @@ module Recurly
1235
1267
  # * Records are returned in an arbitrary order. Since results are all
1236
1268
  # returned at once you can sort the records yourself.
1237
1269
  #
1238
- # @param limit [Integer] Limit number of records 1-200.
1239
- # @param order [String] Sort order.
1240
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1270
+ # :limit [Integer] Limit number of records 1-200.
1271
+ # :order [String] Sort order.
1272
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1241
1273
  # order. In descending order updated records will move behind the cursor and could
1242
1274
  # prevent some records from being returned.
1243
1275
  #
1244
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1276
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1245
1277
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1246
1278
  #
1247
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1279
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1248
1280
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1249
1281
  #
1250
- # @param email [String] Filter for accounts with this exact email address. A blank value will return accounts with both +null+ and +""+ email addresses. Note that multiple accounts can share one email address.
1251
- # @param subscriber [Boolean] Filter for accounts with or without a subscription in the +active+,
1282
+ # :email [String] Filter for accounts with this exact email address. A blank value will return accounts with both +null+ and +""+ email addresses. Note that multiple accounts can share one email address.
1283
+ # :subscriber [Boolean] Filter for accounts with or without a subscription in the +active+,
1252
1284
  # +canceled+, or +future+ state.
1253
1285
  #
1254
- # @param past_due [String] Filter for accounts with an invoice in the +past_due+ state.
1255
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1286
+ # :past_due [String] Filter for accounts with an invoice in the +past_due+ state.
1256
1287
  #
1257
1288
  # @return [Pager<Resources::Account>] A list of an account's child accounts.
1258
1289
  # @example
1290
+ # params = {
1291
+ # limit: 200
1292
+ # }
1259
1293
  # child_accounts = @client.list_child_accounts(
1260
1294
  # account_id: account_id,
1261
- # limit: 200
1295
+ # params: params
1262
1296
  # )
1263
1297
  # child_accounts.each do |child|
1264
1298
  # puts "Account: #{child.code}"
@@ -1271,9 +1305,10 @@ module Recurly
1271
1305
 
1272
1306
  # List a site's account acquisition data
1273
1307
  #
1274
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_account_acquisition list_account_acquisition api documenation}
1308
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_account_acquisition list_account_acquisition api documenation}
1275
1309
  #
1276
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1310
+ # @param params [Hash] Optional query string parameters:
1311
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1277
1312
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
1278
1313
  #
1279
1314
  # *Important notes:*
@@ -1285,37 +1320,40 @@ module Recurly
1285
1320
  # * Records are returned in an arbitrary order. Since results are all
1286
1321
  # returned at once you can sort the records yourself.
1287
1322
  #
1288
- # @param limit [Integer] Limit number of records 1-200.
1289
- # @param order [String] Sort order.
1290
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1323
+ # :limit [Integer] Limit number of records 1-200.
1324
+ # :order [String] Sort order.
1325
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1291
1326
  # order. In descending order updated records will move behind the cursor and could
1292
1327
  # prevent some records from being returned.
1293
1328
  #
1294
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1329
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1295
1330
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1296
1331
  #
1297
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1332
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1298
1333
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1299
1334
  #
1300
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1301
1335
  #
1302
1336
  # @return [Pager<Resources::AccountAcquisition>] A list of the site's account acquisition data.
1303
1337
  # @example
1304
- # acquisitions = @client.list_account_acquisition(limit: 200)
1338
+ # params = {
1339
+ # limit: 200
1340
+ # }
1341
+ # acquisitions = @client.list_account_acquisition(params: params)
1305
1342
  # acquisitions.each do |acquisition|
1306
1343
  # puts "AccountAcquisition: #{acquisition.cost}"
1307
1344
  # end
1308
1345
  #
1309
1346
  def list_account_acquisition(**options)
1310
- path = interpolate_path("/acquisitions")
1347
+ path = "/acquisitions"
1311
1348
  pager(path, **options)
1312
1349
  end
1313
1350
 
1314
1351
  # List a site's coupons
1315
1352
  #
1316
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_coupons list_coupons api documenation}
1353
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_coupons list_coupons api documenation}
1317
1354
  #
1318
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1355
+ # @param params [Hash] Optional query string parameters:
1356
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1319
1357
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
1320
1358
  #
1321
1359
  # *Important notes:*
@@ -1327,38 +1365,40 @@ module Recurly
1327
1365
  # * Records are returned in an arbitrary order. Since results are all
1328
1366
  # returned at once you can sort the records yourself.
1329
1367
  #
1330
- # @param limit [Integer] Limit number of records 1-200.
1331
- # @param order [String] Sort order.
1332
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1368
+ # :limit [Integer] Limit number of records 1-200.
1369
+ # :order [String] Sort order.
1370
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1333
1371
  # order. In descending order updated records will move behind the cursor and could
1334
1372
  # prevent some records from being returned.
1335
1373
  #
1336
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1374
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1337
1375
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1338
1376
  #
1339
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1377
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1340
1378
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1341
1379
  #
1342
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1343
1380
  #
1344
1381
  # @return [Pager<Resources::Coupon>] A list of the site's coupons.
1345
1382
  # @example
1346
- # coupons = @client.list_coupons(limit: 200)
1383
+ # params = {
1384
+ # limit: 200
1385
+ # }
1386
+ # coupons = @client.list_coupons(params: params)
1347
1387
  # coupons.each do |coupon|
1348
1388
  # puts "coupon: #{coupon.code}"
1349
1389
  # end
1350
1390
  #
1351
1391
  def list_coupons(**options)
1352
- path = interpolate_path("/coupons")
1392
+ path = "/coupons"
1353
1393
  pager(path, **options)
1354
1394
  end
1355
1395
 
1356
1396
  # Create a new coupon
1357
1397
  #
1358
- # {https://developers.recurly.com/api/v2019-10-10#operation/create_coupon create_coupon api documenation}
1398
+ # {https://developers.recurly.com/api/v2021-02-25#operation/create_coupon create_coupon api documenation}
1359
1399
  #
1360
1400
  # @param body [Requests::CouponCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponCreate}
1361
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1401
+ # @param params [Hash] Optional query string parameters:
1362
1402
  #
1363
1403
  # @return [Resources::Coupon] A new coupon.
1364
1404
  # @example
@@ -1385,16 +1425,16 @@ module Recurly
1385
1425
  # end
1386
1426
  #
1387
1427
  def create_coupon(body:, **options)
1388
- path = interpolate_path("/coupons")
1428
+ path = "/coupons"
1389
1429
  post(path, body, Requests::CouponCreate, **options)
1390
1430
  end
1391
1431
 
1392
1432
  # Fetch a coupon
1393
1433
  #
1394
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_coupon get_coupon api documenation}
1434
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_coupon get_coupon api documenation}
1395
1435
  #
1396
1436
  # @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
1397
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1437
+ # @param params [Hash] Optional query string parameters:
1398
1438
  #
1399
1439
  # @return [Resources::Coupon] A coupon.
1400
1440
  # @example
@@ -1414,11 +1454,11 @@ module Recurly
1414
1454
 
1415
1455
  # Update an active coupon
1416
1456
  #
1417
- # {https://developers.recurly.com/api/v2019-10-10#operation/update_coupon update_coupon api documenation}
1457
+ # {https://developers.recurly.com/api/v2021-02-25#operation/update_coupon update_coupon api documenation}
1418
1458
  #
1419
1459
  # @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
1420
1460
  # @param body [Requests::CouponUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponUpdate}
1421
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1461
+ # @param params [Hash] Optional query string parameters:
1422
1462
  #
1423
1463
  # @return [Resources::Coupon] The updated coupon.
1424
1464
  # @example
@@ -1441,10 +1481,10 @@ module Recurly
1441
1481
 
1442
1482
  # Expire a coupon
1443
1483
  #
1444
- # {https://developers.recurly.com/api/v2019-10-10#operation/deactivate_coupon deactivate_coupon api documenation}
1484
+ # {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_coupon deactivate_coupon api documenation}
1445
1485
  #
1446
1486
  # @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
1447
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1487
+ # @param params [Hash] Optional query string parameters:
1448
1488
  #
1449
1489
  # @return [Resources::Coupon] The expired Coupon
1450
1490
  # @example
@@ -1462,26 +1502,30 @@ module Recurly
1462
1502
  delete(path, **options)
1463
1503
  end
1464
1504
 
1505
+ # Generate unique coupon codes
1506
+ #
1507
+ # {https://developers.recurly.com/api/v2021-02-25#operation/generate_unique_coupon_codes generate_unique_coupon_codes api documenation}
1508
+ #
1509
+ # @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
1510
+ # @param body [Requests::CouponBulkCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponBulkCreate}
1511
+ # @param params [Hash] Optional query string parameters:
1512
+ #
1513
+ # @return [Resources::UniqueCouponCodeParams] A set of parameters that can be passed to the `list_unique_coupon_codes` endpoint to obtain only the newly generated `UniqueCouponCodes`.
1514
+ #
1515
+ def generate_unique_coupon_codes(coupon_id:, body:, **options)
1516
+ path = interpolate_path("/coupons/{coupon_id}/generate", coupon_id: coupon_id)
1517
+ post(path, body, Requests::CouponBulkCreate, **options)
1518
+ end
1519
+
1465
1520
  # Restore an inactive coupon
1466
1521
  #
1467
- # {https://developers.recurly.com/api/v2019-10-10#operation/restore_coupon restore_coupon api documenation}
1522
+ # {https://developers.recurly.com/api/v2021-02-25#operation/restore_coupon restore_coupon api documenation}
1468
1523
  #
1469
1524
  # @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
1470
1525
  # @param body [Requests::CouponUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponUpdate}
1471
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1526
+ # @param params [Hash] Optional query string parameters:
1472
1527
  #
1473
1528
  # @return [Resources::Coupon] The restored coupon.
1474
- # @example
1475
- # begin
1476
- # coupon = @client.restore_coupon(coupon_id: coupon_id, body: {
1477
- # name: "New Coupon Name"
1478
- # })
1479
- # puts "Restored coupon #{coupon}"
1480
- # rescue Recurly::Errors::NotFoundError
1481
- # # If the resource was not found, you may want to alert the user or
1482
- # # just return nil
1483
- # puts "Resource Not Found"
1484
- # end
1485
1529
  #
1486
1530
  def restore_coupon(coupon_id:, body:, **options)
1487
1531
  path = interpolate_path("/coupons/{coupon_id}/restore", coupon_id: coupon_id)
@@ -1490,10 +1534,11 @@ module Recurly
1490
1534
 
1491
1535
  # List unique coupon codes associated with a bulk coupon
1492
1536
  #
1493
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_unique_coupon_codes list_unique_coupon_codes api documenation}
1537
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_unique_coupon_codes list_unique_coupon_codes api documenation}
1494
1538
  #
1495
1539
  # @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
1496
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1540
+ # @param params [Hash] Optional query string parameters:
1541
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1497
1542
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
1498
1543
  #
1499
1544
  # *Important notes:*
@@ -1505,19 +1550,18 @@ module Recurly
1505
1550
  # * Records are returned in an arbitrary order. Since results are all
1506
1551
  # returned at once you can sort the records yourself.
1507
1552
  #
1508
- # @param limit [Integer] Limit number of records 1-200.
1509
- # @param order [String] Sort order.
1510
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1553
+ # :limit [Integer] Limit number of records 1-200.
1554
+ # :order [String] Sort order.
1555
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1511
1556
  # order. In descending order updated records will move behind the cursor and could
1512
1557
  # prevent some records from being returned.
1513
1558
  #
1514
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1559
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1515
1560
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1516
1561
  #
1517
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1562
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1518
1563
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1519
1564
  #
1520
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1521
1565
  #
1522
1566
  # @return [Pager<Resources::UniqueCouponCode>] A list of unique coupon codes that were generated
1523
1567
  #
@@ -1528,40 +1572,43 @@ module Recurly
1528
1572
 
1529
1573
  # List a site's credit payments
1530
1574
  #
1531
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_credit_payments list_credit_payments api documenation}
1575
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_credit_payments list_credit_payments api documenation}
1532
1576
  #
1533
- # @param limit [Integer] Limit number of records 1-200.
1534
- # @param order [String] Sort order.
1535
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1577
+ # @param params [Hash] Optional query string parameters:
1578
+ # :limit [Integer] Limit number of records 1-200.
1579
+ # :order [String] Sort order.
1580
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1536
1581
  # order. In descending order updated records will move behind the cursor and could
1537
1582
  # prevent some records from being returned.
1538
1583
  #
1539
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1584
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1540
1585
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1541
1586
  #
1542
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1587
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1543
1588
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1544
1589
  #
1545
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1546
1590
  #
1547
1591
  # @return [Pager<Resources::CreditPayment>] A list of the site's credit payments.
1548
1592
  # @example
1549
- # payments = @client.list_credit_payments(limit: 200)
1593
+ # params = {
1594
+ # limit: 200
1595
+ # }
1596
+ # payments = @client.list_credit_payments(params: params)
1550
1597
  # payments.each do |payment|
1551
1598
  # puts "CreditPayment: #{payment.id}"
1552
1599
  # end
1553
1600
  #
1554
1601
  def list_credit_payments(**options)
1555
- path = interpolate_path("/credit_payments")
1602
+ path = "/credit_payments"
1556
1603
  pager(path, **options)
1557
1604
  end
1558
1605
 
1559
1606
  # Fetch a credit payment
1560
1607
  #
1561
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_credit_payment get_credit_payment api documenation}
1608
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_credit_payment get_credit_payment api documenation}
1562
1609
  #
1563
1610
  # @param credit_payment_id [String] Credit Payment ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
1564
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1611
+ # @param params [Hash] Optional query string parameters:
1565
1612
  #
1566
1613
  # @return [Resources::CreditPayment] A credit payment.
1567
1614
  #
@@ -1572,9 +1619,10 @@ module Recurly
1572
1619
 
1573
1620
  # List a site's custom field definitions
1574
1621
  #
1575
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_custom_field_definitions list_custom_field_definitions api documenation}
1622
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_custom_field_definitions list_custom_field_definitions api documenation}
1576
1623
  #
1577
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1624
+ # @param params [Hash] Optional query string parameters:
1625
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1578
1626
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
1579
1627
  #
1580
1628
  # *Important notes:*
@@ -1586,39 +1634,41 @@ module Recurly
1586
1634
  # * Records are returned in an arbitrary order. Since results are all
1587
1635
  # returned at once you can sort the records yourself.
1588
1636
  #
1589
- # @param limit [Integer] Limit number of records 1-200.
1590
- # @param order [String] Sort order.
1591
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1637
+ # :limit [Integer] Limit number of records 1-200.
1638
+ # :order [String] Sort order.
1639
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1592
1640
  # order. In descending order updated records will move behind the cursor and could
1593
1641
  # prevent some records from being returned.
1594
1642
  #
1595
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1643
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1596
1644
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1597
1645
  #
1598
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1646
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1599
1647
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1600
1648
  #
1601
- # @param related_type [String] Filter by related type.
1602
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1649
+ # :related_type [String] Filter by related type.
1603
1650
  #
1604
1651
  # @return [Pager<Resources::CustomFieldDefinition>] A list of the site's custom field definitions.
1605
1652
  # @example
1606
- # custom_fields = @client.list_custom_field_definitions(limit: 200)
1653
+ # params = {
1654
+ # limit: 200
1655
+ # }
1656
+ # custom_fields = @client.list_custom_field_definitions(params: params)
1607
1657
  # custom_fields.each do |field|
1608
1658
  # puts "CustomFieldDefinition: #{field.name}"
1609
1659
  # end
1610
1660
  #
1611
1661
  def list_custom_field_definitions(**options)
1612
- path = interpolate_path("/custom_field_definitions")
1662
+ path = "/custom_field_definitions"
1613
1663
  pager(path, **options)
1614
1664
  end
1615
1665
 
1616
1666
  # Fetch an custom field definition
1617
1667
  #
1618
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_custom_field_definition get_custom_field_definition api documenation}
1668
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_custom_field_definition get_custom_field_definition api documenation}
1619
1669
  #
1620
1670
  # @param custom_field_definition_id [String] Custom Field Definition ID
1621
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1671
+ # @param params [Hash] Optional query string parameters:
1622
1672
  #
1623
1673
  # @return [Resources::CustomFieldDefinition] An custom field definition.
1624
1674
  # @example
@@ -1640,9 +1690,10 @@ module Recurly
1640
1690
 
1641
1691
  # List a site's items
1642
1692
  #
1643
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_items list_items api documenation}
1693
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_items list_items api documenation}
1644
1694
  #
1645
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1695
+ # @param params [Hash] Optional query string parameters:
1696
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1646
1697
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
1647
1698
  #
1648
1699
  # *Important notes:*
@@ -1654,39 +1705,41 @@ module Recurly
1654
1705
  # * Records are returned in an arbitrary order. Since results are all
1655
1706
  # returned at once you can sort the records yourself.
1656
1707
  #
1657
- # @param limit [Integer] Limit number of records 1-200.
1658
- # @param order [String] Sort order.
1659
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1708
+ # :limit [Integer] Limit number of records 1-200.
1709
+ # :order [String] Sort order.
1710
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1660
1711
  # order. In descending order updated records will move behind the cursor and could
1661
1712
  # prevent some records from being returned.
1662
1713
  #
1663
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1714
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1664
1715
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1665
1716
  #
1666
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1717
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1667
1718
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1668
1719
  #
1669
- # @param state [String] Filter by state.
1670
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1720
+ # :state [String] Filter by state.
1671
1721
  #
1672
1722
  # @return [Pager<Resources::Item>] A list of the site's items.
1673
1723
  # @example
1674
- # items = @client.list_items(limit: 200)
1724
+ # params = {
1725
+ # limit: 200
1726
+ # }
1727
+ # items = @client.list_items(params: params)
1675
1728
  # items.each do |item|
1676
1729
  # puts "Item: #{item.code}"
1677
1730
  # end
1678
1731
  #
1679
1732
  def list_items(**options)
1680
- path = interpolate_path("/items")
1733
+ path = "/items"
1681
1734
  pager(path, **options)
1682
1735
  end
1683
1736
 
1684
1737
  # Create a new item
1685
1738
  #
1686
- # {https://developers.recurly.com/api/v2019-10-10#operation/create_item create_item api documenation}
1739
+ # {https://developers.recurly.com/api/v2021-02-25#operation/create_item create_item api documenation}
1687
1740
  #
1688
1741
  # @param body [Requests::ItemCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ItemCreate}
1689
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1742
+ # @param params [Hash] Optional query string parameters:
1690
1743
  #
1691
1744
  # @return [Resources::Item] A new item.
1692
1745
  # @example
@@ -1712,16 +1765,16 @@ module Recurly
1712
1765
  # end
1713
1766
  #
1714
1767
  def create_item(body:, **options)
1715
- path = interpolate_path("/items")
1768
+ path = "/items"
1716
1769
  post(path, body, Requests::ItemCreate, **options)
1717
1770
  end
1718
1771
 
1719
1772
  # Fetch an item
1720
1773
  #
1721
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_item get_item api documenation}
1774
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_item get_item api documenation}
1722
1775
  #
1723
1776
  # @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+.
1724
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1777
+ # @param params [Hash] Optional query string parameters:
1725
1778
  #
1726
1779
  # @return [Resources::Item] An item.
1727
1780
  # @example
@@ -1741,11 +1794,11 @@ module Recurly
1741
1794
 
1742
1795
  # Update an active item
1743
1796
  #
1744
- # {https://developers.recurly.com/api/v2019-10-10#operation/update_item update_item api documenation}
1797
+ # {https://developers.recurly.com/api/v2021-02-25#operation/update_item update_item api documenation}
1745
1798
  #
1746
1799
  # @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+.
1747
1800
  # @param body [Requests::ItemUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ItemUpdate}
1748
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1801
+ # @param params [Hash] Optional query string parameters:
1749
1802
  #
1750
1803
  # @return [Resources::Item] The updated item.
1751
1804
  # @example
@@ -1772,10 +1825,10 @@ module Recurly
1772
1825
 
1773
1826
  # Deactivate an item
1774
1827
  #
1775
- # {https://developers.recurly.com/api/v2019-10-10#operation/deactivate_item deactivate_item api documenation}
1828
+ # {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_item deactivate_item api documenation}
1776
1829
  #
1777
1830
  # @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+.
1778
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1831
+ # @param params [Hash] Optional query string parameters:
1779
1832
  #
1780
1833
  # @return [Resources::Item] An item.
1781
1834
  # @example
@@ -1795,10 +1848,10 @@ module Recurly
1795
1848
 
1796
1849
  # Reactivate an inactive item
1797
1850
  #
1798
- # {https://developers.recurly.com/api/v2019-10-10#operation/reactivate_item reactivate_item api documenation}
1851
+ # {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_item reactivate_item api documenation}
1799
1852
  #
1800
1853
  # @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+.
1801
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1854
+ # @param params [Hash] Optional query string parameters:
1802
1855
  #
1803
1856
  # @return [Resources::Item] An item.
1804
1857
  # @example
@@ -1818,9 +1871,10 @@ module Recurly
1818
1871
 
1819
1872
  # List a site's measured units
1820
1873
  #
1821
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_measured_unit list_measured_unit api documenation}
1874
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_measured_unit list_measured_unit api documenation}
1822
1875
  #
1823
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1876
+ # @param params [Hash] Optional query string parameters:
1877
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1824
1878
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
1825
1879
  #
1826
1880
  # *Important notes:*
@@ -1832,48 +1886,47 @@ module Recurly
1832
1886
  # * Records are returned in an arbitrary order. Since results are all
1833
1887
  # returned at once you can sort the records yourself.
1834
1888
  #
1835
- # @param limit [Integer] Limit number of records 1-200.
1836
- # @param order [String] Sort order.
1837
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1889
+ # :limit [Integer] Limit number of records 1-200.
1890
+ # :order [String] Sort order.
1891
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1838
1892
  # order. In descending order updated records will move behind the cursor and could
1839
1893
  # prevent some records from being returned.
1840
1894
  #
1841
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1895
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1842
1896
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1843
1897
  #
1844
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1898
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1845
1899
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1846
1900
  #
1847
- # @param state [String] Filter by state.
1848
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1901
+ # :state [String] Filter by state.
1849
1902
  #
1850
1903
  # @return [Pager<Resources::MeasuredUnit>] A list of the site's measured units.
1851
1904
  #
1852
1905
  def list_measured_unit(**options)
1853
- path = interpolate_path("/measured_units")
1906
+ path = "/measured_units"
1854
1907
  pager(path, **options)
1855
1908
  end
1856
1909
 
1857
1910
  # Create a new measured unit
1858
1911
  #
1859
- # {https://developers.recurly.com/api/v2019-10-10#operation/create_measured_unit create_measured_unit api documenation}
1912
+ # {https://developers.recurly.com/api/v2021-02-25#operation/create_measured_unit create_measured_unit api documenation}
1860
1913
  #
1861
1914
  # @param body [Requests::MeasuredUnitCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::MeasuredUnitCreate}
1862
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1915
+ # @param params [Hash] Optional query string parameters:
1863
1916
  #
1864
1917
  # @return [Resources::MeasuredUnit] A new measured unit.
1865
1918
  #
1866
1919
  def create_measured_unit(body:, **options)
1867
- path = interpolate_path("/measured_units")
1920
+ path = "/measured_units"
1868
1921
  post(path, body, Requests::MeasuredUnitCreate, **options)
1869
1922
  end
1870
1923
 
1871
1924
  # Fetch a measured unit
1872
1925
  #
1873
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_measured_unit get_measured_unit api documenation}
1926
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_measured_unit get_measured_unit api documenation}
1874
1927
  #
1875
1928
  # @param measured_unit_id [String] Measured unit ID or name. For ID no prefix is used e.g. +e28zov4fw0v2+. For name use prefix +name-+, e.g. +name-Storage+.
1876
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1929
+ # @param params [Hash] Optional query string parameters:
1877
1930
  #
1878
1931
  # @return [Resources::MeasuredUnit] An item.
1879
1932
  #
@@ -1884,11 +1937,11 @@ module Recurly
1884
1937
 
1885
1938
  # Update a measured unit
1886
1939
  #
1887
- # {https://developers.recurly.com/api/v2019-10-10#operation/update_measured_unit update_measured_unit api documenation}
1940
+ # {https://developers.recurly.com/api/v2021-02-25#operation/update_measured_unit update_measured_unit api documenation}
1888
1941
  #
1889
1942
  # @param measured_unit_id [String] Measured unit ID or name. For ID no prefix is used e.g. +e28zov4fw0v2+. For name use prefix +name-+, e.g. +name-Storage+.
1890
1943
  # @param body [Requests::MeasuredUnitUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::MeasuredUnitUpdate}
1891
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1944
+ # @param params [Hash] Optional query string parameters:
1892
1945
  #
1893
1946
  # @return [Resources::MeasuredUnit] The updated measured_unit.
1894
1947
  #
@@ -1899,10 +1952,10 @@ module Recurly
1899
1952
 
1900
1953
  # Remove a measured unit
1901
1954
  #
1902
- # {https://developers.recurly.com/api/v2019-10-10#operation/remove_measured_unit remove_measured_unit api documenation}
1955
+ # {https://developers.recurly.com/api/v2021-02-25#operation/remove_measured_unit remove_measured_unit api documenation}
1903
1956
  #
1904
1957
  # @param measured_unit_id [String] Measured unit ID or name. For ID no prefix is used e.g. +e28zov4fw0v2+. For name use prefix +name-+, e.g. +name-Storage+.
1905
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1958
+ # @param params [Hash] Optional query string parameters:
1906
1959
  #
1907
1960
  # @return [Resources::MeasuredUnit] A measured unit.
1908
1961
  #
@@ -1913,9 +1966,10 @@ module Recurly
1913
1966
 
1914
1967
  # List a site's invoices
1915
1968
  #
1916
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_invoices list_invoices api documenation}
1969
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_invoices list_invoices api documenation}
1917
1970
  #
1918
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1971
+ # @param params [Hash] Optional query string parameters:
1972
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1919
1973
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
1920
1974
  #
1921
1975
  # *Important notes:*
@@ -1927,44 +1981,46 @@ module Recurly
1927
1981
  # * Records are returned in an arbitrary order. Since results are all
1928
1982
  # returned at once you can sort the records yourself.
1929
1983
  #
1930
- # @param limit [Integer] Limit number of records 1-200.
1931
- # @param order [String] Sort order.
1932
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1984
+ # :limit [Integer] Limit number of records 1-200.
1985
+ # :order [String] Sort order.
1986
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1933
1987
  # order. In descending order updated records will move behind the cursor and could
1934
1988
  # prevent some records from being returned.
1935
1989
  #
1936
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1990
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1937
1991
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1938
1992
  #
1939
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1993
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1940
1994
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1941
1995
  #
1942
- # @param type [String] Filter by type when:
1996
+ # :type [String] Filter by type when:
1943
1997
  # - +type=charge+, only charge invoices will be returned.
1944
1998
  # - +type=credit+, only credit invoices will be returned.
1945
1999
  # - +type=non-legacy+, only charge and credit invoices will be returned.
1946
2000
  # - +type=legacy+, only legacy invoices will be returned.
1947
2001
  #
1948
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1949
2002
  #
1950
2003
  # @return [Pager<Resources::Invoice>] A list of the site's invoices.
1951
2004
  # @example
1952
- # invoices = @client.list_invoices(limit: 200)
2005
+ # params = {
2006
+ # limit: 200
2007
+ # }
2008
+ # invoices = @client.list_invoices(params: params)
1953
2009
  # invoices.each do |invoice|
1954
2010
  # puts "Invoice: #{invoice.number}"
1955
2011
  # end
1956
2012
  #
1957
2013
  def list_invoices(**options)
1958
- path = interpolate_path("/invoices")
2014
+ path = "/invoices"
1959
2015
  pager(path, **options)
1960
2016
  end
1961
2017
 
1962
2018
  # Fetch an invoice
1963
2019
  #
1964
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_invoice get_invoice api documenation}
2020
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_invoice get_invoice api documenation}
1965
2021
  #
1966
2022
  # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
1967
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2023
+ # @param params [Hash] Optional query string parameters:
1968
2024
  #
1969
2025
  # @return [Resources::Invoice] An invoice.
1970
2026
  # @example
@@ -1984,11 +2040,11 @@ module Recurly
1984
2040
 
1985
2041
  # Update an invoice
1986
2042
  #
1987
- # {https://developers.recurly.com/api/v2019-10-10#operation/put_invoice put_invoice api documenation}
2043
+ # {https://developers.recurly.com/api/v2021-02-25#operation/update_invoice update_invoice api documenation}
1988
2044
  #
1989
2045
  # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
1990
- # @param body [Requests::InvoiceUpdatable] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceUpdatable}
1991
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2046
+ # @param body [Requests::InvoiceUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceUpdate}
2047
+ # @param params [Hash] Optional query string parameters:
1992
2048
  #
1993
2049
  # @return [Resources::Invoice] An invoice.
1994
2050
  # @example
@@ -1997,7 +2053,7 @@ module Recurly
1997
2053
  # customer_notes: "New Notes",
1998
2054
  # terms_and_conditions: "New Terms and Conditions"
1999
2055
  # }
2000
- # invoice = @client.put_invoice(invoice_id: invoice_id, body: invoice_update)
2056
+ # invoice = @client.update_invoice(invoice_id: invoice_id, body: invoice_update)
2001
2057
  # puts "Updated invoice #{invoice}"
2002
2058
  # rescue Recurly::Errors::NotFoundError
2003
2059
  # # If the resource was not found, you may want to alert the user or
@@ -2005,17 +2061,17 @@ module Recurly
2005
2061
  # puts "Resource Not Found"
2006
2062
  # end
2007
2063
  #
2008
- def put_invoice(invoice_id:, body:, **options)
2064
+ def update_invoice(invoice_id:, body:, **options)
2009
2065
  path = interpolate_path("/invoices/{invoice_id}", invoice_id: invoice_id)
2010
- put(path, body, Requests::InvoiceUpdatable, **options)
2066
+ put(path, body, Requests::InvoiceUpdate, **options)
2011
2067
  end
2012
2068
 
2013
2069
  # Fetch an invoice as a PDF
2014
2070
  #
2015
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_invoice_pdf get_invoice_pdf api documenation}
2071
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_invoice_pdf get_invoice_pdf api documenation}
2016
2072
  #
2017
2073
  # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
2018
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2074
+ # @param params [Hash] Optional query string parameters:
2019
2075
  #
2020
2076
  # @return [Resources::BinaryFile] An invoice as a PDF.
2021
2077
  # @example
@@ -2038,11 +2094,11 @@ module Recurly
2038
2094
 
2039
2095
  # Collect a pending or past due, automatic invoice
2040
2096
  #
2041
- # {https://developers.recurly.com/api/v2019-10-10#operation/collect_invoice collect_invoice api documenation}
2097
+ # {https://developers.recurly.com/api/v2021-02-25#operation/collect_invoice collect_invoice api documenation}
2042
2098
  #
2043
2099
  # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
2044
- # @param body [Requests::InvoiceCollect] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCollect}
2045
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2100
+ # @param params [Hash] Optional query string parameters:
2101
+ # :body [Requests::InvoiceCollect] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCollect}
2046
2102
  #
2047
2103
  # @return [Resources::Invoice] The updated invoice.
2048
2104
  # @example
@@ -2062,15 +2118,15 @@ module Recurly
2062
2118
 
2063
2119
  # Mark an open invoice as failed
2064
2120
  #
2065
- # {https://developers.recurly.com/api/v2019-10-10#operation/fail_invoice fail_invoice api documenation}
2121
+ # {https://developers.recurly.com/api/v2021-02-25#operation/mark_invoice_failed mark_invoice_failed api documenation}
2066
2122
  #
2067
2123
  # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
2068
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2124
+ # @param params [Hash] Optional query string parameters:
2069
2125
  #
2070
2126
  # @return [Resources::Invoice] The updated invoice.
2071
2127
  # @example
2072
2128
  # begin
2073
- # invoice = @client.fail_invoice(invoice_id: invoice_id)
2129
+ # invoice = @client.mark_invoice_failed(invoice_id: invoice_id)
2074
2130
  # puts "Failed invoice #{invoice}"
2075
2131
  # rescue Recurly::Errors::NotFoundError
2076
2132
  # # If the resource was not found, you may want to alert the user or
@@ -2078,17 +2134,17 @@ module Recurly
2078
2134
  # puts "Resource Not Found"
2079
2135
  # end
2080
2136
  #
2081
- def fail_invoice(invoice_id:, **options)
2137
+ def mark_invoice_failed(invoice_id:, **options)
2082
2138
  path = interpolate_path("/invoices/{invoice_id}/mark_failed", invoice_id: invoice_id)
2083
2139
  put(path, **options)
2084
2140
  end
2085
2141
 
2086
2142
  # Mark an open invoice as successful
2087
2143
  #
2088
- # {https://developers.recurly.com/api/v2019-10-10#operation/mark_invoice_successful mark_invoice_successful api documenation}
2144
+ # {https://developers.recurly.com/api/v2021-02-25#operation/mark_invoice_successful mark_invoice_successful api documenation}
2089
2145
  #
2090
2146
  # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
2091
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2147
+ # @param params [Hash] Optional query string parameters:
2092
2148
  #
2093
2149
  # @return [Resources::Invoice] The updated invoice.
2094
2150
  # @example
@@ -2108,10 +2164,10 @@ module Recurly
2108
2164
 
2109
2165
  # Reopen a closed, manual invoice
2110
2166
  #
2111
- # {https://developers.recurly.com/api/v2019-10-10#operation/reopen_invoice reopen_invoice api documenation}
2167
+ # {https://developers.recurly.com/api/v2021-02-25#operation/reopen_invoice reopen_invoice api documenation}
2112
2168
  #
2113
2169
  # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
2114
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2170
+ # @param params [Hash] Optional query string parameters:
2115
2171
  #
2116
2172
  # @return [Resources::Invoice] The updated invoice.
2117
2173
  # @example
@@ -2131,10 +2187,10 @@ module Recurly
2131
2187
 
2132
2188
  # Void a credit invoice.
2133
2189
  #
2134
- # {https://developers.recurly.com/api/v2019-10-10#operation/void_invoice void_invoice api documenation}
2190
+ # {https://developers.recurly.com/api/v2021-02-25#operation/void_invoice void_invoice api documenation}
2135
2191
  #
2136
2192
  # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
2137
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2193
+ # @param params [Hash] Optional query string parameters:
2138
2194
  #
2139
2195
  # @return [Resources::Invoice] The updated invoice.
2140
2196
  # @example
@@ -2154,11 +2210,11 @@ module Recurly
2154
2210
 
2155
2211
  # Record an external payment for a manual invoices.
2156
2212
  #
2157
- # {https://developers.recurly.com/api/v2019-10-10#operation/record_external_transaction record_external_transaction api documenation}
2213
+ # {https://developers.recurly.com/api/v2021-02-25#operation/record_external_transaction record_external_transaction api documenation}
2158
2214
  #
2159
2215
  # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
2160
2216
  # @param body [Requests::ExternalTransaction] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ExternalTransaction}
2161
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2217
+ # @param params [Hash] Optional query string parameters:
2162
2218
  #
2163
2219
  # @return [Resources::Transaction] The recorded transaction.
2164
2220
  #
@@ -2169,10 +2225,11 @@ module Recurly
2169
2225
 
2170
2226
  # List an invoice's line items
2171
2227
  #
2172
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_invoice_line_items list_invoice_line_items api documenation}
2228
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_invoice_line_items list_invoice_line_items api documenation}
2173
2229
  #
2174
2230
  # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
2175
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
2231
+ # @param params [Hash] Optional query string parameters:
2232
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
2176
2233
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
2177
2234
  #
2178
2235
  # *Important notes:*
@@ -2184,28 +2241,30 @@ module Recurly
2184
2241
  # * Records are returned in an arbitrary order. Since results are all
2185
2242
  # returned at once you can sort the records yourself.
2186
2243
  #
2187
- # @param limit [Integer] Limit number of records 1-200.
2188
- # @param order [String] Sort order.
2189
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
2244
+ # :limit [Integer] Limit number of records 1-200.
2245
+ # :order [String] Sort order.
2246
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
2190
2247
  # order. In descending order updated records will move behind the cursor and could
2191
2248
  # prevent some records from being returned.
2192
2249
  #
2193
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2250
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2194
2251
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2195
2252
  #
2196
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2253
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2197
2254
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2198
2255
  #
2199
- # @param original [String] Filter by original field.
2200
- # @param state [String] Filter by state field.
2201
- # @param type [String] Filter by type field.
2202
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2256
+ # :original [String] Filter by original field.
2257
+ # :state [String] Filter by state field.
2258
+ # :type [String] Filter by type field.
2203
2259
  #
2204
2260
  # @return [Pager<Resources::LineItem>] A list of the invoice's line items.
2205
2261
  # @example
2262
+ # params = {
2263
+ # limit: 200
2264
+ # }
2206
2265
  # line_items = @client.list_invoice_line_items(
2207
2266
  # invoice_id: invoice_id,
2208
- # limit: 200
2267
+ # params: params
2209
2268
  # )
2210
2269
  # line_items.each do |line_item|
2211
2270
  # puts "Line Item: #{line_item.id}"
@@ -2218,10 +2277,11 @@ module Recurly
2218
2277
 
2219
2278
  # Show the coupon redemptions applied to an invoice
2220
2279
  #
2221
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_invoice_coupon_redemptions list_invoice_coupon_redemptions api documenation}
2280
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_invoice_coupon_redemptions list_invoice_coupon_redemptions api documenation}
2222
2281
  #
2223
2282
  # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
2224
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
2283
+ # @param params [Hash] Optional query string parameters:
2284
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
2225
2285
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
2226
2286
  #
2227
2287
  # *Important notes:*
@@ -2233,23 +2293,25 @@ module Recurly
2233
2293
  # * Records are returned in an arbitrary order. Since results are all
2234
2294
  # returned at once you can sort the records yourself.
2235
2295
  #
2236
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
2296
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
2237
2297
  # order. In descending order updated records will move behind the cursor and could
2238
2298
  # prevent some records from being returned.
2239
2299
  #
2240
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2300
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2241
2301
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2242
2302
  #
2243
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2303
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2244
2304
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2245
2305
  #
2246
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2247
2306
  #
2248
2307
  # @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions associated with the invoice.
2249
2308
  # @example
2309
+ # params = {
2310
+ # limit: 200
2311
+ # }
2250
2312
  # coupon_redemptions = @client.list_invoice_coupon_redemptions(
2251
2313
  # invoice_id: invoice_id,
2252
- # limit: 200
2314
+ # params: params
2253
2315
  # )
2254
2316
  # coupon_redemptions.each do |redemption|
2255
2317
  # puts "CouponRedemption: #{redemption.id}"
@@ -2262,16 +2324,19 @@ module Recurly
2262
2324
 
2263
2325
  # List an invoice's related credit or charge invoices
2264
2326
  #
2265
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_related_invoices list_related_invoices api documenation}
2327
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_related_invoices list_related_invoices api documenation}
2266
2328
  #
2267
2329
  # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
2268
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2330
+ # @param params [Hash] Optional query string parameters:
2269
2331
  #
2270
2332
  # @return [Pager<Resources::Invoice>] A list of the credit or charge invoices associated with the invoice.
2271
2333
  # @example
2334
+ # params = {
2335
+ # limit: 200
2336
+ # }
2272
2337
  # invoices = @client.list_related_invoices(
2273
2338
  # invoice_id: invoice_id,
2274
- # limit: 200
2339
+ # params: params
2275
2340
  # )
2276
2341
  # invoices.each do |invoice|
2277
2342
  # puts "Invoice: #{invoice.number}"
@@ -2284,11 +2349,11 @@ module Recurly
2284
2349
 
2285
2350
  # Refund an invoice
2286
2351
  #
2287
- # {https://developers.recurly.com/api/v2019-10-10#operation/refund_invoice refund_invoice api documenation}
2352
+ # {https://developers.recurly.com/api/v2021-02-25#operation/refund_invoice refund_invoice api documenation}
2288
2353
  #
2289
2354
  # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
2290
2355
  # @param body [Requests::InvoiceRefund] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceRefund}
2291
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2356
+ # @param params [Hash] Optional query string parameters:
2292
2357
  #
2293
2358
  # @return [Resources::Invoice] Returns the new credit invoice.
2294
2359
  # @example
@@ -2315,9 +2380,10 @@ module Recurly
2315
2380
 
2316
2381
  # List a site's line items
2317
2382
  #
2318
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_line_items list_line_items api documenation}
2383
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_line_items list_line_items api documenation}
2319
2384
  #
2320
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
2385
+ # @param params [Hash] Optional query string parameters:
2386
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
2321
2387
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
2322
2388
  #
2323
2389
  # *Important notes:*
@@ -2329,43 +2395,45 @@ module Recurly
2329
2395
  # * Records are returned in an arbitrary order. Since results are all
2330
2396
  # returned at once you can sort the records yourself.
2331
2397
  #
2332
- # @param limit [Integer] Limit number of records 1-200.
2333
- # @param order [String] Sort order.
2334
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
2398
+ # :limit [Integer] Limit number of records 1-200.
2399
+ # :order [String] Sort order.
2400
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
2335
2401
  # order. In descending order updated records will move behind the cursor and could
2336
2402
  # prevent some records from being returned.
2337
2403
  #
2338
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2404
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2339
2405
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2340
2406
  #
2341
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2407
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2342
2408
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2343
2409
  #
2344
- # @param original [String] Filter by original field.
2345
- # @param state [String] Filter by state field.
2346
- # @param type [String] Filter by type field.
2347
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2410
+ # :original [String] Filter by original field.
2411
+ # :state [String] Filter by state field.
2412
+ # :type [String] Filter by type field.
2348
2413
  #
2349
2414
  # @return [Pager<Resources::LineItem>] A list of the site's line items.
2350
2415
  # @example
2351
- # line_items = @client.list_line_items(
2416
+ # params = {
2352
2417
  # limit: 200
2418
+ # }
2419
+ # line_items = @client.list_line_items(
2420
+ # params: params
2353
2421
  # )
2354
2422
  # line_items.each do |line_item|
2355
2423
  # puts "LineItem: #{line_item.id}"
2356
2424
  # end
2357
2425
  #
2358
2426
  def list_line_items(**options)
2359
- path = interpolate_path("/line_items")
2427
+ path = "/line_items"
2360
2428
  pager(path, **options)
2361
2429
  end
2362
2430
 
2363
2431
  # Fetch a line item
2364
2432
  #
2365
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_line_item get_line_item api documenation}
2433
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_line_item get_line_item api documenation}
2366
2434
  #
2367
2435
  # @param line_item_id [String] Line Item ID.
2368
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2436
+ # @param params [Hash] Optional query string parameters:
2369
2437
  #
2370
2438
  # @return [Resources::LineItem] A line item.
2371
2439
  # @example
@@ -2385,10 +2453,10 @@ module Recurly
2385
2453
 
2386
2454
  # Delete an uninvoiced line item
2387
2455
  #
2388
- # {https://developers.recurly.com/api/v2019-10-10#operation/remove_line_item remove_line_item api documenation}
2456
+ # {https://developers.recurly.com/api/v2021-02-25#operation/remove_line_item remove_line_item api documenation}
2389
2457
  #
2390
2458
  # @param line_item_id [String] Line Item ID.
2391
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2459
+ # @param params [Hash] Optional query string parameters:
2392
2460
  #
2393
2461
  # @return [Resources::Empty] Line item deleted.
2394
2462
  # @example
@@ -2410,9 +2478,10 @@ module Recurly
2410
2478
 
2411
2479
  # List a site's plans
2412
2480
  #
2413
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_plans list_plans api documenation}
2481
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_plans list_plans api documenation}
2414
2482
  #
2415
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
2483
+ # @param params [Hash] Optional query string parameters:
2484
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
2416
2485
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
2417
2486
  #
2418
2487
  # *Important notes:*
@@ -2424,39 +2493,41 @@ module Recurly
2424
2493
  # * Records are returned in an arbitrary order. Since results are all
2425
2494
  # returned at once you can sort the records yourself.
2426
2495
  #
2427
- # @param limit [Integer] Limit number of records 1-200.
2428
- # @param order [String] Sort order.
2429
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
2496
+ # :limit [Integer] Limit number of records 1-200.
2497
+ # :order [String] Sort order.
2498
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
2430
2499
  # order. In descending order updated records will move behind the cursor and could
2431
2500
  # prevent some records from being returned.
2432
2501
  #
2433
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2502
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2434
2503
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2435
2504
  #
2436
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2505
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2437
2506
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2438
2507
  #
2439
- # @param state [String] Filter by state.
2440
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2508
+ # :state [String] Filter by state.
2441
2509
  #
2442
2510
  # @return [Pager<Resources::Plan>] A list of plans.
2443
2511
  # @example
2444
- # plans = @client.list_plans(limit: 200)
2512
+ # params = {
2513
+ # limit: 200
2514
+ # }
2515
+ # plans = @client.list_plans(params: params)
2445
2516
  # plans.each do |plan|
2446
2517
  # puts "Plan: #{plan.code}"
2447
2518
  # end
2448
2519
  #
2449
2520
  def list_plans(**options)
2450
- path = interpolate_path("/plans")
2521
+ path = "/plans"
2451
2522
  pager(path, **options)
2452
2523
  end
2453
2524
 
2454
2525
  # Create a plan
2455
2526
  #
2456
- # {https://developers.recurly.com/api/v2019-10-10#operation/create_plan create_plan api documenation}
2527
+ # {https://developers.recurly.com/api/v2021-02-25#operation/create_plan create_plan api documenation}
2457
2528
  #
2458
2529
  # @param body [Requests::PlanCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PlanCreate}
2459
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2530
+ # @param params [Hash] Optional query string parameters:
2460
2531
  #
2461
2532
  # @return [Resources::Plan] A plan.
2462
2533
  # @example
@@ -2487,16 +2558,16 @@ module Recurly
2487
2558
  # end
2488
2559
  #
2489
2560
  def create_plan(body:, **options)
2490
- path = interpolate_path("/plans")
2561
+ path = "/plans"
2491
2562
  post(path, body, Requests::PlanCreate, **options)
2492
2563
  end
2493
2564
 
2494
2565
  # Fetch a plan
2495
2566
  #
2496
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_plan get_plan api documenation}
2567
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_plan get_plan api documenation}
2497
2568
  #
2498
2569
  # @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
2499
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2570
+ # @param params [Hash] Optional query string parameters:
2500
2571
  #
2501
2572
  # @return [Resources::Plan] A plan.
2502
2573
  # @example
@@ -2516,11 +2587,11 @@ module Recurly
2516
2587
 
2517
2588
  # Update a plan
2518
2589
  #
2519
- # {https://developers.recurly.com/api/v2019-10-10#operation/update_plan update_plan api documenation}
2590
+ # {https://developers.recurly.com/api/v2021-02-25#operation/update_plan update_plan api documenation}
2520
2591
  #
2521
2592
  # @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
2522
2593
  # @param body [Requests::PlanUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PlanUpdate}
2523
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2594
+ # @param params [Hash] Optional query string parameters:
2524
2595
  #
2525
2596
  # @return [Resources::Plan] A plan.
2526
2597
  # @example
@@ -2543,10 +2614,10 @@ module Recurly
2543
2614
 
2544
2615
  # Remove a plan
2545
2616
  #
2546
- # {https://developers.recurly.com/api/v2019-10-10#operation/remove_plan remove_plan api documenation}
2617
+ # {https://developers.recurly.com/api/v2021-02-25#operation/remove_plan remove_plan api documenation}
2547
2618
  #
2548
2619
  # @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
2549
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2620
+ # @param params [Hash] Optional query string parameters:
2550
2621
  #
2551
2622
  # @return [Resources::Plan] Plan deleted
2552
2623
  # @example
@@ -2566,10 +2637,11 @@ module Recurly
2566
2637
 
2567
2638
  # List a plan's add-ons
2568
2639
  #
2569
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_plan_add_ons list_plan_add_ons api documenation}
2640
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_plan_add_ons list_plan_add_ons api documenation}
2570
2641
  #
2571
2642
  # @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
2572
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
2643
+ # @param params [Hash] Optional query string parameters:
2644
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
2573
2645
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
2574
2646
  #
2575
2647
  # *Important notes:*
@@ -2581,26 +2653,28 @@ module Recurly
2581
2653
  # * Records are returned in an arbitrary order. Since results are all
2582
2654
  # returned at once you can sort the records yourself.
2583
2655
  #
2584
- # @param limit [Integer] Limit number of records 1-200.
2585
- # @param order [String] Sort order.
2586
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
2656
+ # :limit [Integer] Limit number of records 1-200.
2657
+ # :order [String] Sort order.
2658
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
2587
2659
  # order. In descending order updated records will move behind the cursor and could
2588
2660
  # prevent some records from being returned.
2589
2661
  #
2590
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2662
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2591
2663
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2592
2664
  #
2593
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2665
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2594
2666
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2595
2667
  #
2596
- # @param state [String] Filter by state.
2597
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2668
+ # :state [String] Filter by state.
2598
2669
  #
2599
2670
  # @return [Pager<Resources::AddOn>] A list of add-ons.
2600
2671
  # @example
2672
+ # params = {
2673
+ # limit: 200
2674
+ # }
2601
2675
  # add_ons = @client.list_plan_add_ons(
2602
2676
  # plan_id: plan_id,
2603
- # limit: 200
2677
+ # params: params
2604
2678
  # )
2605
2679
  # add_ons.each do |add_on|
2606
2680
  # puts "AddOn: #{add_on.code}"
@@ -2613,11 +2687,11 @@ module Recurly
2613
2687
 
2614
2688
  # Create an add-on
2615
2689
  #
2616
- # {https://developers.recurly.com/api/v2019-10-10#operation/create_plan_add_on create_plan_add_on api documenation}
2690
+ # {https://developers.recurly.com/api/v2021-02-25#operation/create_plan_add_on create_plan_add_on api documenation}
2617
2691
  #
2618
2692
  # @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
2619
2693
  # @param body [Requests::AddOnCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AddOnCreate}
2620
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2694
+ # @param params [Hash] Optional query string parameters:
2621
2695
  #
2622
2696
  # @return [Resources::AddOn] An add-on.
2623
2697
  # @example
@@ -2648,11 +2722,11 @@ module Recurly
2648
2722
 
2649
2723
  # Fetch a plan's add-on
2650
2724
  #
2651
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_plan_add_on get_plan_add_on api documenation}
2725
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_plan_add_on get_plan_add_on api documenation}
2652
2726
  #
2653
2727
  # @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
2654
2728
  # @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
2655
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2729
+ # @param params [Hash] Optional query string parameters:
2656
2730
  #
2657
2731
  # @return [Resources::AddOn] An add-on.
2658
2732
  # @example
@@ -2674,12 +2748,12 @@ module Recurly
2674
2748
 
2675
2749
  # Update an add-on
2676
2750
  #
2677
- # {https://developers.recurly.com/api/v2019-10-10#operation/update_plan_add_on update_plan_add_on api documenation}
2751
+ # {https://developers.recurly.com/api/v2021-02-25#operation/update_plan_add_on update_plan_add_on api documenation}
2678
2752
  #
2679
2753
  # @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
2680
2754
  # @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
2681
2755
  # @param body [Requests::AddOnUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AddOnUpdate}
2682
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2756
+ # @param params [Hash] Optional query string parameters:
2683
2757
  #
2684
2758
  # @return [Resources::AddOn] An add-on.
2685
2759
  # @example
@@ -2706,11 +2780,11 @@ module Recurly
2706
2780
 
2707
2781
  # Remove an add-on
2708
2782
  #
2709
- # {https://developers.recurly.com/api/v2019-10-10#operation/remove_plan_add_on remove_plan_add_on api documenation}
2783
+ # {https://developers.recurly.com/api/v2021-02-25#operation/remove_plan_add_on remove_plan_add_on api documenation}
2710
2784
  #
2711
2785
  # @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
2712
2786
  # @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
2713
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2787
+ # @param params [Hash] Optional query string parameters:
2714
2788
  #
2715
2789
  # @return [Resources::AddOn] Add-on deleted
2716
2790
  # @example
@@ -2733,9 +2807,10 @@ module Recurly
2733
2807
 
2734
2808
  # List a site's add-ons
2735
2809
  #
2736
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_add_ons list_add_ons api documenation}
2810
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_add_ons list_add_ons api documenation}
2737
2811
  #
2738
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
2812
+ # @param params [Hash] Optional query string parameters:
2813
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
2739
2814
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
2740
2815
  #
2741
2816
  # *Important notes:*
@@ -2747,41 +2822,43 @@ module Recurly
2747
2822
  # * Records are returned in an arbitrary order. Since results are all
2748
2823
  # returned at once you can sort the records yourself.
2749
2824
  #
2750
- # @param limit [Integer] Limit number of records 1-200.
2751
- # @param order [String] Sort order.
2752
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
2825
+ # :limit [Integer] Limit number of records 1-200.
2826
+ # :order [String] Sort order.
2827
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
2753
2828
  # order. In descending order updated records will move behind the cursor and could
2754
2829
  # prevent some records from being returned.
2755
2830
  #
2756
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2831
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2757
2832
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2758
2833
  #
2759
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2834
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2760
2835
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2761
2836
  #
2762
- # @param state [String] Filter by state.
2763
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2837
+ # :state [String] Filter by state.
2764
2838
  #
2765
2839
  # @return [Pager<Resources::AddOn>] A list of add-ons.
2766
2840
  # @example
2767
- # add_ons = @client.list_add_ons(
2841
+ # params = {
2768
2842
  # limit: 200
2843
+ # }
2844
+ # add_ons = @client.list_add_ons(
2845
+ # params: params
2769
2846
  # )
2770
2847
  # add_ons.each do |add_on|
2771
2848
  # puts "AddOn: #{add_on.code}"
2772
2849
  # end
2773
2850
  #
2774
2851
  def list_add_ons(**options)
2775
- path = interpolate_path("/add_ons")
2852
+ path = "/add_ons"
2776
2853
  pager(path, **options)
2777
2854
  end
2778
2855
 
2779
2856
  # Fetch an add-on
2780
2857
  #
2781
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_add_on get_add_on api documenation}
2858
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_add_on get_add_on api documenation}
2782
2859
  #
2783
2860
  # @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
2784
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2861
+ # @param params [Hash] Optional query string parameters:
2785
2862
  #
2786
2863
  # @return [Resources::AddOn] An add-on.
2787
2864
  # @example
@@ -2801,9 +2878,10 @@ module Recurly
2801
2878
 
2802
2879
  # List a site's shipping methods
2803
2880
  #
2804
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_shipping_methods list_shipping_methods api documenation}
2881
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_shipping_methods list_shipping_methods api documenation}
2805
2882
  #
2806
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
2883
+ # @param params [Hash] Optional query string parameters:
2884
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
2807
2885
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
2808
2886
  #
2809
2887
  # *Important notes:*
@@ -2815,69 +2893,71 @@ module Recurly
2815
2893
  # * Records are returned in an arbitrary order. Since results are all
2816
2894
  # returned at once you can sort the records yourself.
2817
2895
  #
2818
- # @param limit [Integer] Limit number of records 1-200.
2819
- # @param order [String] Sort order.
2820
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
2896
+ # :limit [Integer] Limit number of records 1-200.
2897
+ # :order [String] Sort order.
2898
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
2821
2899
  # order. In descending order updated records will move behind the cursor and could
2822
2900
  # prevent some records from being returned.
2823
2901
  #
2824
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2902
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2825
2903
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2826
2904
  #
2827
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2905
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2828
2906
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2829
2907
  #
2830
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2831
2908
  #
2832
2909
  # @return [Pager<Resources::ShippingMethod>] A list of the site's shipping methods.
2833
2910
  # @example
2834
- # shipping_methods = @client.list_shipping_methods(
2911
+ # params = {
2835
2912
  # limit: 200
2913
+ # }
2914
+ # shipping_methods = @client.list_shipping_methods(
2915
+ # params: params
2836
2916
  # )
2837
2917
  # shipping_methods.each do |shipping_method|
2838
2918
  # puts "Shipping Method: #{shipping_method.code}"
2839
2919
  # end
2840
2920
  #
2841
2921
  def list_shipping_methods(**options)
2842
- path = interpolate_path("/shipping_methods")
2922
+ path = "/shipping_methods"
2843
2923
  pager(path, **options)
2844
2924
  end
2845
2925
 
2846
2926
  # Create a new shipping method
2847
2927
  #
2848
- # {https://developers.recurly.com/api/v2019-10-10#operation/create_shipping_method create_shipping_method api documenation}
2928
+ # {https://developers.recurly.com/api/v2021-02-25#operation/create_shipping_method create_shipping_method api documenation}
2849
2929
  #
2850
2930
  # @param body [Requests::ShippingMethodCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingMethodCreate}
2851
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2931
+ # @param params [Hash] Optional query string parameters:
2852
2932
  #
2853
2933
  # @return [Resources::ShippingMethod] A new shipping method.
2854
2934
  #
2855
2935
  def create_shipping_method(body:, **options)
2856
- path = interpolate_path("/shipping_methods")
2936
+ path = "/shipping_methods"
2857
2937
  post(path, body, Requests::ShippingMethodCreate, **options)
2858
2938
  end
2859
2939
 
2860
2940
  # Fetch a shipping method
2861
2941
  #
2862
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_shipping_method get_shipping_method api documenation}
2942
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_shipping_method get_shipping_method api documenation}
2863
2943
  #
2864
- # @param id [String] Shipping Method ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-usps_2-day+.
2865
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2944
+ # @param shipping_method_id [String] Shipping Method ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-usps_2-day+.
2945
+ # @param params [Hash] Optional query string parameters:
2866
2946
  #
2867
2947
  # @return [Resources::ShippingMethod] A shipping method.
2868
2948
  #
2869
- def get_shipping_method(id:, **options)
2870
- path = interpolate_path("/shipping_methods/{id}", id: id)
2949
+ def get_shipping_method(shipping_method_id:, **options)
2950
+ path = interpolate_path("/shipping_methods/{shipping_method_id}", shipping_method_id: shipping_method_id)
2871
2951
  get(path, **options)
2872
2952
  end
2873
2953
 
2874
2954
  # Update an active Shipping Method
2875
2955
  #
2876
- # {https://developers.recurly.com/api/v2019-10-10#operation/update_shipping_method update_shipping_method api documenation}
2956
+ # {https://developers.recurly.com/api/v2021-02-25#operation/update_shipping_method update_shipping_method api documenation}
2877
2957
  #
2878
2958
  # @param shipping_method_id [String] Shipping Method ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-usps_2-day+.
2879
2959
  # @param body [Requests::ShippingMethodUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingMethodUpdate}
2880
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2960
+ # @param params [Hash] Optional query string parameters:
2881
2961
  #
2882
2962
  # @return [Resources::ShippingMethod] The updated shipping method.
2883
2963
  #
@@ -2888,10 +2968,10 @@ module Recurly
2888
2968
 
2889
2969
  # Deactivate a shipping method
2890
2970
  #
2891
- # {https://developers.recurly.com/api/v2019-10-10#operation/deactivate_shipping_method deactivate_shipping_method api documenation}
2971
+ # {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_shipping_method deactivate_shipping_method api documenation}
2892
2972
  #
2893
2973
  # @param shipping_method_id [String] Shipping Method ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-usps_2-day+.
2894
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2974
+ # @param params [Hash] Optional query string parameters:
2895
2975
  #
2896
2976
  # @return [Resources::ShippingMethod] A shipping method.
2897
2977
  #
@@ -2902,9 +2982,10 @@ module Recurly
2902
2982
 
2903
2983
  # List a site's subscriptions
2904
2984
  #
2905
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_subscriptions list_subscriptions api documenation}
2985
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_subscriptions list_subscriptions api documenation}
2906
2986
  #
2907
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
2987
+ # @param params [Hash] Optional query string parameters:
2988
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
2908
2989
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
2909
2990
  #
2910
2991
  # *Important notes:*
@@ -2916,44 +2997,46 @@ module Recurly
2916
2997
  # * Records are returned in an arbitrary order. Since results are all
2917
2998
  # returned at once you can sort the records yourself.
2918
2999
  #
2919
- # @param limit [Integer] Limit number of records 1-200.
2920
- # @param order [String] Sort order.
2921
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
3000
+ # :limit [Integer] Limit number of records 1-200.
3001
+ # :order [String] Sort order.
3002
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
2922
3003
  # order. In descending order updated records will move behind the cursor and could
2923
3004
  # prevent some records from being returned.
2924
3005
  #
2925
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
3006
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2926
3007
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2927
3008
  #
2928
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
3009
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2929
3010
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2930
3011
  #
2931
- # @param state [String] Filter by state.
3012
+ # :state [String] Filter by state.
2932
3013
  #
2933
3014
  # - When +state=active+, +state=canceled+, +state=expired+, or +state=future+, subscriptions with states that match the query and only those subscriptions will be returned.
2934
3015
  # - When +state=in_trial+, only subscriptions that have a trial_started_at date earlier than now and a trial_ends_at date later than now will be returned.
2935
3016
  # - When +state=live+, only subscriptions that are in an active, canceled, or future state or are in trial will be returned.
2936
3017
  #
2937
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2938
3018
  #
2939
3019
  # @return [Pager<Resources::Subscription>] A list of the site's subscriptions.
2940
3020
  # @example
2941
- # subscriptions = @client.list_subscriptions(limit: 200)
3021
+ # params = {
3022
+ # limit: 200
3023
+ # }
3024
+ # subscriptions = @client.list_subscriptions(params: params)
2942
3025
  # subscriptions.each do |subscription|
2943
3026
  # puts "Subscription: #{subscription.uuid}"
2944
3027
  # end
2945
3028
  #
2946
3029
  def list_subscriptions(**options)
2947
- path = interpolate_path("/subscriptions")
3030
+ path = "/subscriptions"
2948
3031
  pager(path, **options)
2949
3032
  end
2950
3033
 
2951
3034
  # Create a new subscription
2952
3035
  #
2953
- # {https://developers.recurly.com/api/v2019-10-10#operation/create_subscription create_subscription api documenation}
3036
+ # {https://developers.recurly.com/api/v2021-02-25#operation/create_subscription create_subscription api documenation}
2954
3037
  #
2955
3038
  # @param body [Requests::SubscriptionCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionCreate}
2956
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3039
+ # @param params [Hash] Optional query string parameters:
2957
3040
  #
2958
3041
  # @return [Resources::Subscription] A subscription.
2959
3042
  # @example
@@ -2961,8 +3044,7 @@ module Recurly
2961
3044
  # subscription_create = {
2962
3045
  # plan_code: plan_code,
2963
3046
  # currency: "USD",
2964
- # # This can be an existing account or
2965
- # # a new acocunt
3047
+ # # This can be an existing account or a new account
2966
3048
  # account: {
2967
3049
  # code: account_code,
2968
3050
  # }
@@ -2978,16 +3060,16 @@ module Recurly
2978
3060
  # end
2979
3061
  #
2980
3062
  def create_subscription(body:, **options)
2981
- path = interpolate_path("/subscriptions")
3063
+ path = "/subscriptions"
2982
3064
  post(path, body, Requests::SubscriptionCreate, **options)
2983
3065
  end
2984
3066
 
2985
3067
  # Fetch a subscription
2986
3068
  #
2987
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_subscription get_subscription api documenation}
3069
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_subscription get_subscription api documenation}
2988
3070
  #
2989
3071
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
2990
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3072
+ # @param params [Hash] Optional query string parameters:
2991
3073
  #
2992
3074
  # @return [Resources::Subscription] A subscription.
2993
3075
  # @example
@@ -3007,13 +3089,13 @@ module Recurly
3007
3089
  get(path, **options)
3008
3090
  end
3009
3091
 
3010
- # Modify a subscription
3092
+ # Update a subscription
3011
3093
  #
3012
- # {https://developers.recurly.com/api/v2019-10-10#operation/modify_subscription modify_subscription api documenation}
3094
+ # {https://developers.recurly.com/api/v2021-02-25#operation/update_subscription update_subscription api documenation}
3013
3095
  #
3014
3096
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3015
3097
  # @param body [Requests::SubscriptionUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionUpdate}
3016
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3098
+ # @param params [Hash] Optional query string parameters:
3017
3099
  #
3018
3100
  # @return [Resources::Subscription] A subscription.
3019
3101
  # @example
@@ -3022,7 +3104,7 @@ module Recurly
3022
3104
  # customer_notes: "New Notes",
3023
3105
  # terms_and_conditions: "New ToC"
3024
3106
  # }
3025
- # subscription = @client.modify_subscription(
3107
+ # subscription = @client.update_subscription(
3026
3108
  # subscription_id: subscription_id,
3027
3109
  # body: subscription_update
3028
3110
  # )
@@ -3033,17 +3115,18 @@ module Recurly
3033
3115
  # puts "ValidationError: #{e.recurly_error.params}"
3034
3116
  # end
3035
3117
  #
3036
- def modify_subscription(subscription_id:, body:, **options)
3118
+ def update_subscription(subscription_id:, body:, **options)
3037
3119
  path = interpolate_path("/subscriptions/{subscription_id}", subscription_id: subscription_id)
3038
3120
  put(path, body, Requests::SubscriptionUpdate, **options)
3039
3121
  end
3040
3122
 
3041
3123
  # Terminate a subscription
3042
3124
  #
3043
- # {https://developers.recurly.com/api/v2019-10-10#operation/terminate_subscription terminate_subscription api documenation}
3125
+ # {https://developers.recurly.com/api/v2021-02-25#operation/terminate_subscription terminate_subscription api documenation}
3044
3126
  #
3045
3127
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3046
- # @param refund [String] The type of refund to perform:
3128
+ # @param params [Hash] Optional query string parameters:
3129
+ # :refund [String] The type of refund to perform:
3047
3130
  #
3048
3131
  # * +full+ - Performs a full refund of the last invoice for the current subscription term.
3049
3132
  # * +partial+ - Prorates a refund based on the amount of time remaining in the current bill cycle.
@@ -3053,8 +3136,7 @@ module Recurly
3053
3136
  #
3054
3137
  # You may also terminate a subscription with no refund and then manually refund specific invoices.
3055
3138
  #
3056
- # @param charge [Boolean] Applicable only if the subscription has usage based add-ons and unbilled usage logged for the current billing cycle. If true, current billing cycle unbilled usage is billed on the final invoice. If false, Recurly will create a negative usage record for current billing cycle usage that will zero out the final invoice line items.
3057
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3139
+ # :charge [Boolean] Applicable only if the subscription has usage based add-ons and unbilled usage logged for the current billing cycle. If true, current billing cycle unbilled usage is billed on the final invoice. If false, Recurly will create a negative usage record for current billing cycle usage that will zero out the final invoice line items.
3058
3140
  #
3059
3141
  # @return [Resources::Subscription] An expired subscription.
3060
3142
  # @example
@@ -3076,11 +3158,11 @@ module Recurly
3076
3158
 
3077
3159
  # Cancel a subscription
3078
3160
  #
3079
- # {https://developers.recurly.com/api/v2019-10-10#operation/cancel_subscription cancel_subscription api documenation}
3161
+ # {https://developers.recurly.com/api/v2021-02-25#operation/cancel_subscription cancel_subscription api documenation}
3080
3162
  #
3081
3163
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3082
- # @param body [Requests::SubscriptionCancel] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionCancel}
3083
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3164
+ # @param params [Hash] Optional query string parameters:
3165
+ # :body [Requests::SubscriptionCancel] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionCancel}
3084
3166
  #
3085
3167
  # @return [Resources::Subscription] A canceled or failed subscription.
3086
3168
  # @example
@@ -3102,10 +3184,10 @@ module Recurly
3102
3184
 
3103
3185
  # Reactivate a canceled subscription
3104
3186
  #
3105
- # {https://developers.recurly.com/api/v2019-10-10#operation/reactivate_subscription reactivate_subscription api documenation}
3187
+ # {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_subscription reactivate_subscription api documenation}
3106
3188
  #
3107
3189
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3108
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3190
+ # @param params [Hash] Optional query string parameters:
3109
3191
  #
3110
3192
  # @return [Resources::Subscription] An active subscription.
3111
3193
  # @example
@@ -3127,11 +3209,11 @@ module Recurly
3127
3209
 
3128
3210
  # Pause subscription
3129
3211
  #
3130
- # {https://developers.recurly.com/api/v2019-10-10#operation/pause_subscription pause_subscription api documenation}
3212
+ # {https://developers.recurly.com/api/v2021-02-25#operation/pause_subscription pause_subscription api documenation}
3131
3213
  #
3132
3214
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3133
3215
  # @param body [Requests::SubscriptionPause] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionPause}
3134
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3216
+ # @param params [Hash] Optional query string parameters:
3135
3217
  #
3136
3218
  # @return [Resources::Subscription] A subscription.
3137
3219
  # @example
@@ -3157,10 +3239,10 @@ module Recurly
3157
3239
 
3158
3240
  # Resume subscription
3159
3241
  #
3160
- # {https://developers.recurly.com/api/v2019-10-10#operation/resume_subscription resume_subscription api documenation}
3242
+ # {https://developers.recurly.com/api/v2021-02-25#operation/resume_subscription resume_subscription api documenation}
3161
3243
  #
3162
3244
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3163
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3245
+ # @param params [Hash] Optional query string parameters:
3164
3246
  #
3165
3247
  # @return [Resources::Subscription] A subscription.
3166
3248
  # @example
@@ -3182,10 +3264,10 @@ module Recurly
3182
3264
 
3183
3265
  # Convert trial subscription
3184
3266
  #
3185
- # {https://developers.recurly.com/api/v2019-10-10#operation/convert_trial convert_trial api documenation}
3267
+ # {https://developers.recurly.com/api/v2021-02-25#operation/convert_trial convert_trial api documenation}
3186
3268
  #
3187
3269
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3188
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3270
+ # @param params [Hash] Optional query string parameters:
3189
3271
  #
3190
3272
  # @return [Resources::Subscription] A subscription.
3191
3273
  #
@@ -3196,10 +3278,10 @@ module Recurly
3196
3278
 
3197
3279
  # Fetch a subscription's pending change
3198
3280
  #
3199
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_subscription_change get_subscription_change api documenation}
3281
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_subscription_change get_subscription_change api documenation}
3200
3282
  #
3201
3283
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3202
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3284
+ # @param params [Hash] Optional query string parameters:
3203
3285
  #
3204
3286
  # @return [Resources::SubscriptionChange] A subscription's pending change.
3205
3287
  # @example
@@ -3221,11 +3303,11 @@ module Recurly
3221
3303
 
3222
3304
  # Create a new subscription change
3223
3305
  #
3224
- # {https://developers.recurly.com/api/v2019-10-10#operation/create_subscription_change create_subscription_change api documenation}
3306
+ # {https://developers.recurly.com/api/v2021-02-25#operation/create_subscription_change create_subscription_change api documenation}
3225
3307
  #
3226
3308
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3227
3309
  # @param body [Requests::SubscriptionChangeCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionChangeCreate}
3228
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3310
+ # @param params [Hash] Optional query string parameters:
3229
3311
  #
3230
3312
  # @return [Resources::SubscriptionChange] A subscription change.
3231
3313
  # @example
@@ -3252,10 +3334,10 @@ module Recurly
3252
3334
 
3253
3335
  # Delete the pending subscription change
3254
3336
  #
3255
- # {https://developers.recurly.com/api/v2019-10-10#operation/remove_subscription_change remove_subscription_change api documenation}
3337
+ # {https://developers.recurly.com/api/v2021-02-25#operation/remove_subscription_change remove_subscription_change api documenation}
3256
3338
  #
3257
3339
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3258
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3340
+ # @param params [Hash] Optional query string parameters:
3259
3341
  #
3260
3342
  # @return [Resources::Empty] Subscription change was deleted.
3261
3343
  # @example
@@ -3277,13 +3359,13 @@ module Recurly
3277
3359
 
3278
3360
  # Preview a new subscription change
3279
3361
  #
3280
- # {https://developers.recurly.com/api/v2019-10-10#operation/preview_subscription_change preview_subscription_change api documenation}
3362
+ # {https://developers.recurly.com/api/v2021-02-25#operation/preview_subscription_change preview_subscription_change api documenation}
3281
3363
  #
3282
3364
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3283
3365
  # @param body [Requests::SubscriptionChangeCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionChangeCreate}
3284
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3366
+ # @param params [Hash] Optional query string parameters:
3285
3367
  #
3286
- # @return [Resources::SubscriptionChangePreview] A subscription change.
3368
+ # @return [Resources::SubscriptionChange] A subscription change.
3287
3369
  #
3288
3370
  def preview_subscription_change(subscription_id:, body:, **options)
3289
3371
  path = interpolate_path("/subscriptions/{subscription_id}/change/preview", subscription_id: subscription_id)
@@ -3292,10 +3374,11 @@ module Recurly
3292
3374
 
3293
3375
  # List a subscription's invoices
3294
3376
  #
3295
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_subscription_invoices list_subscription_invoices api documenation}
3377
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_subscription_invoices list_subscription_invoices api documenation}
3296
3378
  #
3297
3379
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3298
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
3380
+ # @param params [Hash] Optional query string parameters:
3381
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
3299
3382
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
3300
3383
  #
3301
3384
  # *Important notes:*
@@ -3307,31 +3390,33 @@ module Recurly
3307
3390
  # * Records are returned in an arbitrary order. Since results are all
3308
3391
  # returned at once you can sort the records yourself.
3309
3392
  #
3310
- # @param limit [Integer] Limit number of records 1-200.
3311
- # @param order [String] Sort order.
3312
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
3393
+ # :limit [Integer] Limit number of records 1-200.
3394
+ # :order [String] Sort order.
3395
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
3313
3396
  # order. In descending order updated records will move behind the cursor and could
3314
3397
  # prevent some records from being returned.
3315
3398
  #
3316
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
3399
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
3317
3400
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3318
3401
  #
3319
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
3402
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
3320
3403
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3321
3404
  #
3322
- # @param type [String] Filter by type when:
3405
+ # :type [String] Filter by type when:
3323
3406
  # - +type=charge+, only charge invoices will be returned.
3324
3407
  # - +type=credit+, only credit invoices will be returned.
3325
3408
  # - +type=non-legacy+, only charge and credit invoices will be returned.
3326
3409
  # - +type=legacy+, only legacy invoices will be returned.
3327
3410
  #
3328
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3329
3411
  #
3330
3412
  # @return [Pager<Resources::Invoice>] A list of the subscription's invoices.
3331
3413
  # @example
3414
+ # params = {
3415
+ # limit: 200
3416
+ # }
3332
3417
  # invoices = @client.list_subscription_invoices(
3333
3418
  # subscription_id: subscription_id,
3334
- # limit: 200
3419
+ # params: params
3335
3420
  # )
3336
3421
  # invoices.each do |invoice|
3337
3422
  # puts "Invoice: #{invoice.number}"
@@ -3344,10 +3429,11 @@ module Recurly
3344
3429
 
3345
3430
  # List a subscription's line items
3346
3431
  #
3347
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_subscription_line_items list_subscription_line_items api documenation}
3432
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_subscription_line_items list_subscription_line_items api documenation}
3348
3433
  #
3349
3434
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3350
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
3435
+ # @param params [Hash] Optional query string parameters:
3436
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
3351
3437
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
3352
3438
  #
3353
3439
  # *Important notes:*
@@ -3359,28 +3445,30 @@ module Recurly
3359
3445
  # * Records are returned in an arbitrary order. Since results are all
3360
3446
  # returned at once you can sort the records yourself.
3361
3447
  #
3362
- # @param limit [Integer] Limit number of records 1-200.
3363
- # @param order [String] Sort order.
3364
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
3448
+ # :limit [Integer] Limit number of records 1-200.
3449
+ # :order [String] Sort order.
3450
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
3365
3451
  # order. In descending order updated records will move behind the cursor and could
3366
3452
  # prevent some records from being returned.
3367
3453
  #
3368
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
3454
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
3369
3455
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3370
3456
  #
3371
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
3457
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
3372
3458
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3373
3459
  #
3374
- # @param original [String] Filter by original field.
3375
- # @param state [String] Filter by state field.
3376
- # @param type [String] Filter by type field.
3377
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3460
+ # :original [String] Filter by original field.
3461
+ # :state [String] Filter by state field.
3462
+ # :type [String] Filter by type field.
3378
3463
  #
3379
3464
  # @return [Pager<Resources::LineItem>] A list of the subscription's line items.
3380
3465
  # @example
3466
+ # params = {
3467
+ # limit: 200
3468
+ # }
3381
3469
  # line_items = @client.list_subscription_line_items(
3382
3470
  # subscription_id: subscription_id,
3383
- # limit: 200
3471
+ # params: params
3384
3472
  # )
3385
3473
  # line_items.each do |line_item|
3386
3474
  # puts "LineItem: #{line_item.id}"
@@ -3393,10 +3481,11 @@ module Recurly
3393
3481
 
3394
3482
  # Show the coupon redemptions for a subscription
3395
3483
  #
3396
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_subscription_coupon_redemptions list_subscription_coupon_redemptions api documenation}
3484
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_subscription_coupon_redemptions list_subscription_coupon_redemptions api documenation}
3397
3485
  #
3398
3486
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3399
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
3487
+ # @param params [Hash] Optional query string parameters:
3488
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
3400
3489
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
3401
3490
  #
3402
3491
  # *Important notes:*
@@ -3408,23 +3497,25 @@ module Recurly
3408
3497
  # * Records are returned in an arbitrary order. Since results are all
3409
3498
  # returned at once you can sort the records yourself.
3410
3499
  #
3411
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
3500
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
3412
3501
  # order. In descending order updated records will move behind the cursor and could
3413
3502
  # prevent some records from being returned.
3414
3503
  #
3415
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
3504
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
3416
3505
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3417
3506
  #
3418
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
3507
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
3419
3508
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3420
3509
  #
3421
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3422
3510
  #
3423
3511
  # @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions on a subscription.
3424
3512
  # @example
3513
+ # params = {
3514
+ # limit: 200
3515
+ # }
3425
3516
  # coupon_redemptions = @client.list_subscription_coupon_redemptions(
3426
3517
  # subscription_id: subscription_id,
3427
- # limit: 200
3518
+ # params: params
3428
3519
  # )
3429
3520
  # coupon_redemptions.each do |redemption|
3430
3521
  # puts "CouponRedemption: #{redemption.id}"
@@ -3437,11 +3528,12 @@ module Recurly
3437
3528
 
3438
3529
  # List a subscription add-on's usage records
3439
3530
  #
3440
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_usage list_usage api documenation}
3531
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_usage list_usage api documenation}
3441
3532
  #
3442
3533
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3443
3534
  # @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
3444
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
3535
+ # @param params [Hash] Optional query string parameters:
3536
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
3445
3537
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
3446
3538
  #
3447
3539
  # *Important notes:*
@@ -3453,20 +3545,19 @@ module Recurly
3453
3545
  # * Records are returned in an arbitrary order. Since results are all
3454
3546
  # returned at once you can sort the records yourself.
3455
3547
  #
3456
- # @param limit [Integer] Limit number of records 1-200.
3457
- # @param order [String] Sort order.
3458
- # @param sort [String] Sort field. You *really* only want to sort by +usage_timestamp+ in ascending
3548
+ # :limit [Integer] Limit number of records 1-200.
3549
+ # :order [String] Sort order.
3550
+ # :sort [String] Sort field. You *really* only want to sort by +usage_timestamp+ in ascending
3459
3551
  # order. In descending order updated records will move behind the cursor and could
3460
3552
  # prevent some records from being returned.
3461
3553
  #
3462
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=usage_timestamp+ or +sort=recorded_timestamp+.
3554
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=usage_timestamp+ or +sort=recorded_timestamp+.
3463
3555
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3464
3556
  #
3465
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=usage_timestamp+ or +sort=recorded_timestamp+.
3557
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=usage_timestamp+ or +sort=recorded_timestamp+.
3466
3558
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3467
3559
  #
3468
- # @param billing_status [String] Filter by usage record's billing status
3469
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3560
+ # :billing_status [String] Filter by usage record's billing status
3470
3561
  #
3471
3562
  # @return [Pager<Resources::Usage>] A list of the subscription add-on's usage records.
3472
3563
  #
@@ -3477,12 +3568,12 @@ module Recurly
3477
3568
 
3478
3569
  # Log a usage record on this subscription add-on
3479
3570
  #
3480
- # {https://developers.recurly.com/api/v2019-10-10#operation/create_usage create_usage api documenation}
3571
+ # {https://developers.recurly.com/api/v2021-02-25#operation/create_usage create_usage api documenation}
3481
3572
  #
3482
3573
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3483
3574
  # @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
3484
3575
  # @param body [Requests::UsageCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::UsageCreate}
3485
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3576
+ # @param params [Hash] Optional query string parameters:
3486
3577
  #
3487
3578
  # @return [Resources::Usage] The created usage record.
3488
3579
  #
@@ -3493,10 +3584,10 @@ module Recurly
3493
3584
 
3494
3585
  # Get a usage record
3495
3586
  #
3496
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_usage get_usage api documenation}
3587
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_usage get_usage api documenation}
3497
3588
  #
3498
3589
  # @param usage_id [String] Usage Record ID.
3499
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3590
+ # @param params [Hash] Optional query string parameters:
3500
3591
  #
3501
3592
  # @return [Resources::Usage] The usage record.
3502
3593
  #
@@ -3507,11 +3598,11 @@ module Recurly
3507
3598
 
3508
3599
  # Update a usage record
3509
3600
  #
3510
- # {https://developers.recurly.com/api/v2019-10-10#operation/update_usage update_usage api documenation}
3601
+ # {https://developers.recurly.com/api/v2021-02-25#operation/update_usage update_usage api documenation}
3511
3602
  #
3512
3603
  # @param usage_id [String] Usage Record ID.
3513
3604
  # @param body [Requests::UsageCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::UsageCreate}
3514
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3605
+ # @param params [Hash] Optional query string parameters:
3515
3606
  #
3516
3607
  # @return [Resources::Usage] The updated usage record.
3517
3608
  #
@@ -3522,10 +3613,10 @@ module Recurly
3522
3613
 
3523
3614
  # Delete a usage record.
3524
3615
  #
3525
- # {https://developers.recurly.com/api/v2019-10-10#operation/remove_usage remove_usage api documenation}
3616
+ # {https://developers.recurly.com/api/v2021-02-25#operation/remove_usage remove_usage api documenation}
3526
3617
  #
3527
3618
  # @param usage_id [String] Usage Record ID.
3528
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3619
+ # @param params [Hash] Optional query string parameters:
3529
3620
  #
3530
3621
  # @return [Resources::Empty] Usage was successfully deleted.
3531
3622
  #
@@ -3536,9 +3627,10 @@ module Recurly
3536
3627
 
3537
3628
  # List a site's transactions
3538
3629
  #
3539
- # {https://developers.recurly.com/api/v2019-10-10#operation/list_transactions list_transactions api documenation}
3630
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_transactions list_transactions api documenation}
3540
3631
  #
3541
- # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
3632
+ # @param params [Hash] Optional query string parameters:
3633
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
3542
3634
  # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
3543
3635
  #
3544
3636
  # *Important notes:*
@@ -3550,40 +3642,42 @@ module Recurly
3550
3642
  # * Records are returned in an arbitrary order. Since results are all
3551
3643
  # returned at once you can sort the records yourself.
3552
3644
  #
3553
- # @param limit [Integer] Limit number of records 1-200.
3554
- # @param order [String] Sort order.
3555
- # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
3645
+ # :limit [Integer] Limit number of records 1-200.
3646
+ # :order [String] Sort order.
3647
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
3556
3648
  # order. In descending order updated records will move behind the cursor and could
3557
3649
  # prevent some records from being returned.
3558
3650
  #
3559
- # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
3651
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
3560
3652
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3561
3653
  #
3562
- # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
3654
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
3563
3655
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3564
3656
  #
3565
- # @param type [String] Filter by type field. The value +payment+ will return both +purchase+ and +capture+ transactions.
3566
- # @param success [String] Filter by success field.
3567
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3657
+ # :type [String] Filter by type field. The value +payment+ will return both +purchase+ and +capture+ transactions.
3658
+ # :success [String] Filter by success field.
3568
3659
  #
3569
3660
  # @return [Pager<Resources::Transaction>] A list of the site's transactions.
3570
3661
  # @example
3571
- # transactions = @client.list_transactions(limit: 200)
3662
+ # params = {
3663
+ # limit: 200
3664
+ # }
3665
+ # transactions = @client.list_transactions(params: params)
3572
3666
  # transactions.each do |transaction|
3573
3667
  # puts "Transaction: #{transaction.uuid}"
3574
3668
  # end
3575
3669
  #
3576
3670
  def list_transactions(**options)
3577
- path = interpolate_path("/transactions")
3671
+ path = "/transactions"
3578
3672
  pager(path, **options)
3579
3673
  end
3580
3674
 
3581
3675
  # Fetch a transaction
3582
3676
  #
3583
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_transaction get_transaction api documenation}
3677
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_transaction get_transaction api documenation}
3584
3678
  #
3585
3679
  # @param transaction_id [String] Transaction ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3586
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3680
+ # @param params [Hash] Optional query string parameters:
3587
3681
  #
3588
3682
  # @return [Resources::Transaction] A transaction.
3589
3683
  # @example
@@ -3603,10 +3697,10 @@ module Recurly
3603
3697
 
3604
3698
  # Fetch a unique coupon code
3605
3699
  #
3606
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_unique_coupon_code get_unique_coupon_code api documenation}
3700
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_unique_coupon_code get_unique_coupon_code api documenation}
3607
3701
  #
3608
3702
  # @param unique_coupon_code_id [String] Unique Coupon Code ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-abc-8dh2-def+.
3609
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3703
+ # @param params [Hash] Optional query string parameters:
3610
3704
  #
3611
3705
  # @return [Resources::UniqueCouponCode] A unique coupon code.
3612
3706
  #
@@ -3617,10 +3711,10 @@ module Recurly
3617
3711
 
3618
3712
  # Deactivate a unique coupon code
3619
3713
  #
3620
- # {https://developers.recurly.com/api/v2019-10-10#operation/deactivate_unique_coupon_code deactivate_unique_coupon_code api documenation}
3714
+ # {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_unique_coupon_code deactivate_unique_coupon_code api documenation}
3621
3715
  #
3622
3716
  # @param unique_coupon_code_id [String] Unique Coupon Code ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-abc-8dh2-def+.
3623
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3717
+ # @param params [Hash] Optional query string parameters:
3624
3718
  #
3625
3719
  # @return [Resources::UniqueCouponCode] A unique coupon code.
3626
3720
  #
@@ -3631,10 +3725,10 @@ module Recurly
3631
3725
 
3632
3726
  # Restore a unique coupon code
3633
3727
  #
3634
- # {https://developers.recurly.com/api/v2019-10-10#operation/reactivate_unique_coupon_code reactivate_unique_coupon_code api documenation}
3728
+ # {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_unique_coupon_code reactivate_unique_coupon_code api documenation}
3635
3729
  #
3636
3730
  # @param unique_coupon_code_id [String] Unique Coupon Code ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-abc-8dh2-def+.
3637
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3731
+ # @param params [Hash] Optional query string parameters:
3638
3732
  #
3639
3733
  # @return [Resources::UniqueCouponCode] A unique coupon code.
3640
3734
  #
@@ -3645,10 +3739,10 @@ module Recurly
3645
3739
 
3646
3740
  # Create a new purchase
3647
3741
  #
3648
- # {https://developers.recurly.com/api/v2019-10-10#operation/create_purchase create_purchase api documenation}
3742
+ # {https://developers.recurly.com/api/v2021-02-25#operation/create_purchase create_purchase api documenation}
3649
3743
  #
3650
3744
  # @param body [Requests::PurchaseCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PurchaseCreate}
3651
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3745
+ # @param params [Hash] Optional query string parameters:
3652
3746
  #
3653
3747
  # @return [Resources::InvoiceCollection] Returns the new invoices
3654
3748
  # @example
@@ -3679,16 +3773,16 @@ module Recurly
3679
3773
  # end
3680
3774
  #
3681
3775
  def create_purchase(body:, **options)
3682
- path = interpolate_path("/purchases")
3776
+ path = "/purchases"
3683
3777
  post(path, body, Requests::PurchaseCreate, **options)
3684
3778
  end
3685
3779
 
3686
3780
  # Preview a new purchase
3687
3781
  #
3688
- # {https://developers.recurly.com/api/v2019-10-10#operation/preview_purchase preview_purchase api documenation}
3782
+ # {https://developers.recurly.com/api/v2021-02-25#operation/preview_purchase preview_purchase api documenation}
3689
3783
  #
3690
3784
  # @param body [Requests::PurchaseCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PurchaseCreate}
3691
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3785
+ # @param params [Hash] Optional query string parameters:
3692
3786
  #
3693
3787
  # @return [Resources::InvoiceCollection] Returns preview of the new invoices
3694
3788
  # @example
@@ -3719,15 +3813,15 @@ module Recurly
3719
3813
  # end
3720
3814
  #
3721
3815
  def preview_purchase(body:, **options)
3722
- path = interpolate_path("/purchases/preview")
3816
+ path = "/purchases/preview"
3723
3817
  post(path, body, Requests::PurchaseCreate, **options)
3724
3818
  end
3725
3819
 
3726
3820
  # List the dates that have an available export to download.
3727
3821
  #
3728
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_export_dates get_export_dates api documenation}
3822
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_export_dates get_export_dates api documenation}
3729
3823
  #
3730
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3824
+ # @param params [Hash] Optional query string parameters:
3731
3825
  #
3732
3826
  # @return [Resources::ExportDates] Returns a list of dates.
3733
3827
  # @example
@@ -3743,16 +3837,16 @@ module Recurly
3743
3837
  # end
3744
3838
  #
3745
3839
  def get_export_dates(**options)
3746
- path = interpolate_path("/export_dates")
3840
+ path = "/export_dates"
3747
3841
  get(path, **options)
3748
3842
  end
3749
3843
 
3750
3844
  # List of the export files that are available to download.
3751
3845
  #
3752
- # {https://developers.recurly.com/api/v2019-10-10#operation/get_export_files get_export_files api documenation}
3846
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_export_files get_export_files api documenation}
3753
3847
  #
3754
3848
  # @param export_date [String] Date for which to get a list of available automated export files. Date must be in YYYY-MM-DD format.
3755
- # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3849
+ # @param params [Hash] Optional query string parameters:
3756
3850
  #
3757
3851
  # @return [Resources::ExportFiles] Returns a list of export files to download.
3758
3852
  # @example