recurly 3.9.0 → 3.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.bumpversion.cfg +1 -2
  3. data/CHANGELOG.md +65 -2
  4. data/CODE_OF_CONDUCT.md +130 -0
  5. data/CONTRIBUTING.md +4 -0
  6. data/GETTING_STARTED.md +1 -1
  7. data/README.md +3 -0
  8. data/lib/recurly/client.rb +7 -2
  9. data/lib/recurly/client/operations.rb +436 -56
  10. data/lib/recurly/errors/api_errors.rb +59 -17
  11. data/lib/recurly/requests/add_on_create.rb +29 -1
  12. data/lib/recurly/requests/add_on_update.rb +20 -0
  13. data/lib/recurly/requests/coupon_create.rb +1 -1
  14. data/lib/recurly/requests/item_create.rb +8 -0
  15. data/lib/recurly/requests/item_update.rb +8 -0
  16. data/lib/recurly/requests/line_item_create.rb +9 -1
  17. data/lib/recurly/requests/measured_unit_create.rb +22 -0
  18. data/lib/recurly/requests/measured_unit_update.rb +22 -0
  19. data/lib/recurly/requests/plan_create.rb +8 -0
  20. data/lib/recurly/requests/plan_update.rb +8 -0
  21. data/lib/recurly/requests/shipping_purchase.rb +1 -1
  22. data/lib/recurly/requests/subscription_add_on_create.rb +5 -1
  23. data/lib/recurly/requests/subscription_add_on_update.rb +4 -0
  24. data/lib/recurly/requests/subscription_change_create.rb +5 -1
  25. data/lib/recurly/requests/subscription_purchase.rb +4 -0
  26. data/lib/recurly/requests/usage_create.rb +26 -0
  27. data/lib/recurly/resources/add_on.rb +24 -0
  28. data/lib/recurly/resources/add_on_mini.rb +16 -0
  29. data/lib/recurly/resources/coupon.rb +9 -1
  30. data/lib/recurly/resources/export_dates.rb +18 -0
  31. data/lib/recurly/resources/export_file.rb +22 -0
  32. data/lib/recurly/resources/export_files.rb +18 -0
  33. data/lib/recurly/resources/item.rb +8 -0
  34. data/lib/recurly/resources/line_item.rb +8 -0
  35. data/lib/recurly/resources/measured_unit.rb +46 -0
  36. data/lib/recurly/resources/plan.rb +8 -0
  37. data/lib/recurly/resources/subscription_add_on.rb +5 -1
  38. data/lib/recurly/resources/subscription_change.rb +8 -0
  39. data/lib/recurly/resources/subscription_change_preview.rb +5 -1
  40. data/lib/recurly/resources/unique_coupon_code.rb +8 -0
  41. data/lib/recurly/resources/usage.rb +70 -0
  42. data/lib/recurly/version.rb +1 -1
  43. data/openapi/api.yaml +1559 -106
  44. metadata +15 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c78adbb9e018c19c91b8e026154020e76d7fff8e7ebc9baf607fadec225fb098
4
- data.tar.gz: d7b030ca1ac7685f7e64cc0dfebd004e2d8d80e5a09d302a4c5c19eeff5ccc5e
3
+ metadata.gz: 2bb35c82f1aea79ead43c5b2158031d946b71f6b21ce9118467d0f391fd000d6
4
+ data.tar.gz: 204672929d178c8bd4485d0386767469f27fed7965c1f8c64313424ecadb73c7
5
5
  SHA512:
6
- metadata.gz: e1e5228bcb2376263a5c295bb848742961f36859f5b4f473bbbcada42b3ade93ef92630087cf9cedf008e1abd92a89bfcc937cd780ef5ecefb23603ad2c87c28
7
- data.tar.gz: 915f88d6ef1e03e955d3e45d46920993c4f08a04539fde04d879d6d7a39c9cf6049d36e3a1c0fe570269e999006dc03e94546b708ce6474a5e935108e2aa5017
6
+ metadata.gz: fa8dfba5a7d51261f92dfdfe1fe232ac580a00180c1c304592834b60f22afe0d8ddc9256652b5be40d2c3fd35fa72442e99260dd9e6be922e31c57069e088b59
7
+ data.tar.gz: 8d0a7738e9f8d97d1a9f2129e984d033e22ae72de0913ffca507de8c30fb19961e02d828c6530fa75e43274179c3ff6c15288c96c57f8cf5e0f7b60ec9daae5a
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 3.9.0
2
+ current_version = 3.14.0
3
3
  parse = (?P<major>\d+)
4
4
  \.(?P<minor>\d+)
5
5
  \.(?P<patch>\d+)
@@ -13,4 +13,3 @@ serialize =
13
13
  [bumpversion:file:GETTING_STARTED.md]
14
14
  parse = (?P<major>\d+)\.(?P<minor>\d+)
15
15
  serialize = {major}.{minor}
16
-
@@ -1,8 +1,71 @@
1
1
  # Changelog
2
2
 
3
- ## [3.9.0](https://github.com/recurly/recurly-client-ruby/tree/HEAD)
3
+ ## [3.14.0](https://github.com/recurly/recurly-client-ruby/tree/HEAD)
4
4
 
5
- [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.8.0...HEAD)
5
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.13.0...HEAD)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Mon Oct 19 20:38:03 UTC 2020 Upgrade API version v2019-10-10 [\#642](https://github.com/recurly/recurly-client-ruby/pull/642) ([douglasmiller](https://github.com/douglasmiller))
10
+
11
+ **Merged pull requests:**
12
+
13
+ - Release 3.14.0 [\#643](https://github.com/recurly/recurly-client-ruby/pull/643) ([douglasmiller](https://github.com/douglasmiller))
14
+ - Fixes uninitialized constant `Recurly::Errors::ServiceNotAvailableError` [\#641](https://github.com/recurly/recurly-client-ruby/pull/641) ([ruyrocha](https://github.com/ruyrocha))
15
+
16
+ ## [3.13.0](https://github.com/recurly/recurly-client-ruby/tree/3.13.0) (2020-09-22)
17
+
18
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.12.0...3.13.0)
19
+
20
+ **Implemented enhancements:**
21
+
22
+ - Latest Changes for 2019-10-10 \(Automated Exports, additional resource data attributes\) [\#638](https://github.com/recurly/recurly-client-ruby/pull/638) ([douglasmiller](https://github.com/douglasmiller))
23
+
24
+ **Merged pull requests:**
25
+
26
+ - Release 3.13.0 [\#639](https://github.com/recurly/recurly-client-ruby/pull/639) ([douglasmiller](https://github.com/douglasmiller))
27
+
28
+ ## [3.12.0](https://github.com/recurly/recurly-client-ruby/tree/3.12.0) (2020-08-31)
29
+
30
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.11.0...3.12.0)
31
+
32
+ **Implemented enhancements:**
33
+
34
+ - Mon Aug 31 19:44:58 UTC 2020 Upgrade API version v2019-10-10 [\#632](https://github.com/recurly/recurly-client-ruby/pull/632) ([douglasmiller](https://github.com/douglasmiller))
35
+
36
+ **Merged pull requests:**
37
+
38
+ - Release 3.12.0 [\#633](https://github.com/recurly/recurly-client-ruby/pull/633) ([douglasmiller](https://github.com/douglasmiller))
39
+ - Code of Conduct [\#631](https://github.com/recurly/recurly-client-ruby/pull/631) ([bhelx](https://github.com/bhelx))
40
+
41
+ ## [3.11.0](https://github.com/recurly/recurly-client-ruby/tree/3.11.0) (2020-08-21)
42
+
43
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.10.0...3.11.0)
44
+
45
+ **Implemented enhancements:**
46
+
47
+ - Fri Aug 21 16:17:28 UTC 2020 Upgrade API version v2019-10-10 [\#629](https://github.com/recurly/recurly-client-ruby/pull/629) ([douglasmiller](https://github.com/douglasmiller))
48
+
49
+ **Merged pull requests:**
50
+
51
+ - Release 3.11.0 [\#630](https://github.com/recurly/recurly-client-ruby/pull/630) ([douglasmiller](https://github.com/douglasmiller))
52
+
53
+ ## [3.10.0](https://github.com/recurly/recurly-client-ruby/tree/3.10.0) (2020-07-31)
54
+
55
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.9.0...3.10.0)
56
+
57
+ **Implemented enhancements:**
58
+
59
+ - Latest Changes for 2019-10-10 \(usage, measured units, etc\) [\#621](https://github.com/recurly/recurly-client-ruby/pull/621) ([bhelx](https://github.com/bhelx))
60
+ - Adding hierarchical errors [\#610](https://github.com/recurly/recurly-client-ruby/pull/610) ([douglasmiller](https://github.com/douglasmiller))
61
+
62
+ **Merged pull requests:**
63
+
64
+ - Release 3.10.0 [\#623](https://github.com/recurly/recurly-client-ruby/pull/623) ([douglasmiller](https://github.com/douglasmiller))
65
+
66
+ ## [3.9.0](https://github.com/recurly/recurly-client-ruby/tree/3.9.0) (2020-07-06)
67
+
68
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.8.0...3.9.0)
6
69
 
7
70
  **Implemented enhancements:**
8
71
 
@@ -0,0 +1,130 @@
1
+
2
+ # Contributor Covenant Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ We as members, contributors, and leaders pledge to make participation in our
7
+ community a harassment-free experience for everyone, regardless of age, body
8
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
9
+ identity and expression, level of experience, education, socio-economic status,
10
+ nationality, personal appearance, race, religion, or sexual identity
11
+ and orientation.
12
+
13
+ We pledge to act and interact in ways that contribute to an open, welcoming,
14
+ diverse, inclusive, and healthy community.
15
+
16
+ ## Our Standards
17
+
18
+ Examples of behavior that contributes to a positive environment for our
19
+ community include:
20
+
21
+ * Demonstrating empathy and kindness toward other people
22
+ * Being respectful of differing opinions, viewpoints, and experiences
23
+ * Giving and gracefully accepting constructive feedback
24
+ * Accepting responsibility and apologizing to those affected by our mistakes,
25
+ and learning from the experience
26
+ * Focusing on what is best not just for us as individuals, but for the
27
+ overall community
28
+
29
+ Examples of unacceptable behavior include:
30
+
31
+ * The use of sexualized language or imagery, and sexual attention or
32
+ advances of any kind
33
+ * Trolling, insulting or derogatory comments, and personal or political attacks
34
+ * Public or private harassment
35
+ * Publishing others' private information, such as a physical or email
36
+ address, without their explicit permission
37
+ * Other conduct which could reasonably be considered inappropriate in a
38
+ professional setting
39
+
40
+ ## Enforcement Responsibilities
41
+
42
+ Community leaders are responsible for clarifying and enforcing our standards of
43
+ acceptable behavior and will take appropriate and fair corrective action in
44
+ response to any behavior that they deem inappropriate, threatening, offensive,
45
+ or harmful.
46
+
47
+ Community leaders have the right and responsibility to remove, edit, or reject
48
+ comments, commits, code, wiki edits, issues, and other contributions that are
49
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
50
+ decisions when appropriate.
51
+
52
+ ## Scope
53
+
54
+ This Code of Conduct applies within all community spaces, and also applies when
55
+ an individual is officially representing the community in public spaces.
56
+ Examples of representing our community include using an official e-mail address,
57
+ posting via an official social media account, or acting as an appointed
58
+ representative at an online or offline event.
59
+
60
+ ## Enforcement
61
+
62
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
63
+ reported to the community leaders responsible for enforcement at
64
+ dx@recurly.com.
65
+ All complaints will be reviewed and investigated promptly and fairly.
66
+
67
+ All community leaders are obligated to respect the privacy and security of the
68
+ reporter of any incident.
69
+
70
+ ## Enforcement Guidelines
71
+
72
+ Community leaders will follow these Community Impact Guidelines in determining
73
+ the consequences for any action they deem in violation of this Code of Conduct:
74
+
75
+ ### 1. Correction
76
+
77
+ **Community Impact**: Use of inappropriate language or other behavior deemed
78
+ unprofessional or unwelcome in the community.
79
+
80
+ **Consequence**: A private, written warning from community leaders, providing
81
+ clarity around the nature of the violation and an explanation of why the
82
+ behavior was inappropriate. A public apology may be requested.
83
+
84
+ ### 2. Warning
85
+
86
+ **Community Impact**: A violation through a single incident or series
87
+ of actions.
88
+
89
+ **Consequence**: A warning with consequences for continued behavior. No
90
+ interaction with the people involved, including unsolicited interaction with
91
+ those enforcing the Code of Conduct, for a specified period of time. This
92
+ includes avoiding interactions in community spaces as well as external channels
93
+ like social media. Violating these terms may lead to a temporary or
94
+ permanent ban.
95
+
96
+ ### 3. Temporary Ban
97
+
98
+ **Community Impact**: A serious violation of community standards, including
99
+ sustained inappropriate behavior.
100
+
101
+ **Consequence**: A temporary ban from any sort of interaction or public
102
+ communication with the community for a specified period of time. No public or
103
+ private interaction with the people involved, including unsolicited interaction
104
+ with those enforcing the Code of Conduct, is allowed during this period.
105
+ Violating these terms may lead to a permanent ban.
106
+
107
+ ### 4. Permanent Ban
108
+
109
+ **Community Impact**: Demonstrating a pattern of violation of community
110
+ standards, including sustained inappropriate behavior, harassment of an
111
+ individual, or aggression toward or disparagement of classes of individuals.
112
+
113
+ **Consequence**: A permanent ban from any sort of public interaction within
114
+ the community.
115
+
116
+ ## Attribution
117
+
118
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119
+ version 2.0, available at
120
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
121
+
122
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
123
+ enforcement ladder](https://github.com/mozilla/diversity).
124
+
125
+ [homepage]: https://www.contributor-covenant.org
126
+
127
+ For answers to common questions about this code of conduct, see the FAQ at
128
+ https://www.contributor-covenant.org/faq. Translations are available at
129
+ https://www.contributor-covenant.org/translations.
130
+
@@ -7,6 +7,10 @@ however, we may not get to these right away. Although we try to be quick, our pr
7
7
  writing code. If you want a timely response (especially if you have an emergency), we recommend
8
8
  you contact our [official support team](https://support.recurly.com/).
9
9
 
10
+ ## Code of Conduct
11
+
12
+ Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
13
+
10
14
  #### Table Of Contents
11
15
 
12
16
  * [I don't want to read this whole thing, I just have a question!!!](#i-dont-want-to-read-this-whole-thing-i-just-have-a-question)
@@ -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.9'
8
+ gem 'recurly', '~> 3.14'
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.
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Recurly
2
2
 
3
+ [![Rubygems](https://img.shields.io/static/v1?label=rubygems&message=recurly&color=purple)](https://rubygems.org/gems/recurly)
4
+ [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
5
+
3
6
  This repository houses the official ruby client for Recurly's V3 API.
4
7
 
5
8
  > *Note*:
@@ -253,8 +253,13 @@ module Recurly
253
253
  def raise_api_error!(http_response, response)
254
254
  if response.content_type.include?(JSON_CONTENT_TYPE)
255
255
  error = JSONParser.parse(self, response.body)
256
- error_class = Errors::APIError.error_class(error.type)
257
- raise error_class.new(response, error)
256
+ begin
257
+ error_class = Errors::APIError.error_class(error.type)
258
+ raise error_class.new(response, error)
259
+ rescue NameError
260
+ error_class = Errors::APIError.from_response(http_response)
261
+ raise error_class.new(response, error)
262
+ end
258
263
  end
259
264
 
260
265
  error_class = Errors::APIError.from_response(http_response)
@@ -31,6 +31,7 @@ module Recurly
31
31
  # prevent some records from being returned.
32
32
  #
33
33
  # @param state [String] Filter by state.
34
+ #
34
35
  # @return [Pager<Resources::Site>] A list of sites.
35
36
  # @example
36
37
  # sites = @client.list_sites(limit: 200)
@@ -48,6 +49,7 @@ module Recurly
48
49
  # {https://developers.recurly.com/api/v2019-10-10#operation/get_site get_site api documenation}
49
50
  #
50
51
  # @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+.
52
+ #
51
53
  # @return [Resources::Site] A site.
52
54
  # @example
53
55
  # begin
@@ -86,10 +88,10 @@ module Recurly
86
88
  # order. In descending order updated records will move behind the cursor and could
87
89
  # prevent some records from being returned.
88
90
  #
89
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
91
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
90
92
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
91
93
  #
92
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
94
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
93
95
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
94
96
  #
95
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,6 +100,7 @@ module Recurly
98
100
  #
99
101
  # @param past_due [String] Filter for accounts with an invoice in the +past_due+ state.
100
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+.
103
+ #
101
104
  # @return [Pager<Resources::Account>] A list of the site's accounts.
102
105
  # @example
103
106
  # accounts = @client.list_accounts(limit: 200)
@@ -116,6 +119,7 @@ module Recurly
116
119
  #
117
120
  # @param body [Requests::AccountCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountCreate}
118
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+.
122
+ #
119
123
  # @return [Resources::Account] An account.
120
124
  # @example
121
125
  # begin
@@ -164,6 +168,7 @@ module Recurly
164
168
  #
165
169
  # @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+.
166
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+.
171
+ #
167
172
  # @return [Resources::Account] An account.
168
173
  # @example
169
174
  # begin
@@ -187,6 +192,7 @@ module Recurly
187
192
  # @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+.
188
193
  # @param body [Requests::AccountUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountUpdate}
189
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+.
195
+ #
190
196
  # @return [Resources::Account] An account.
191
197
  # @example
192
198
  # begin
@@ -216,6 +222,7 @@ module Recurly
216
222
  #
217
223
  # @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+.
218
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+.
225
+ #
219
226
  # @return [Resources::Account] An account.
220
227
  # @example
221
228
  # begin
@@ -238,6 +245,7 @@ module Recurly
238
245
  #
239
246
  # @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+.
240
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+.
248
+ #
241
249
  # @return [Resources::AccountAcquisition] An account's acquisition data.
242
250
  # @example
243
251
  # begin
@@ -261,6 +269,7 @@ module Recurly
261
269
  # @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+.
262
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}
263
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+.
272
+ #
264
273
  # @return [Resources::AccountAcquisition] An account's updated acquisition data.
265
274
  # @example
266
275
  # begin
@@ -295,6 +304,7 @@ module Recurly
295
304
  #
296
305
  # @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+.
297
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+.
307
+ #
298
308
  # @return [Resources::Empty] Acquisition data was succesfully deleted.
299
309
  # @example
300
310
  # begin
@@ -317,6 +327,7 @@ module Recurly
317
327
  #
318
328
  # @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+.
319
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+.
330
+ #
320
331
  # @return [Resources::Account] An account.
321
332
  # @example
322
333
  # begin
@@ -339,6 +350,7 @@ module Recurly
339
350
  #
340
351
  # @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+.
341
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+.
353
+ #
342
354
  # @return [Resources::AccountBalance] An account's balance.
343
355
  # @example
344
356
  # begin
@@ -361,6 +373,7 @@ module Recurly
361
373
  #
362
374
  # @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+.
363
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+.
376
+ #
364
377
  # @return [Resources::BillingInfo] An account's billing information.
365
378
  # @example
366
379
  # begin
@@ -384,6 +397,7 @@ module Recurly
384
397
  # @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+.
385
398
  # @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
386
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+.
400
+ #
387
401
  # @return [Resources::BillingInfo] Updated billing information.
388
402
  # @example
389
403
  # begin
@@ -413,6 +427,7 @@ module Recurly
413
427
  #
414
428
  # @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+.
415
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+.
430
+ #
416
431
  # @return [Resources::Empty] Billing information deleted
417
432
  # @example
418
433
  # begin
@@ -450,13 +465,14 @@ module Recurly
450
465
  # order. In descending order updated records will move behind the cursor and could
451
466
  # prevent some records from being returned.
452
467
  #
453
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
468
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
454
469
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
455
470
  #
456
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
471
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
457
472
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
458
473
  #
459
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
+ #
460
476
  # @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions on an account.
461
477
  # @example
462
478
  # redemptions = @client.list_account_coupon_redemptions(
@@ -478,6 +494,7 @@ module Recurly
478
494
  #
479
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+.
480
496
  # @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
+ #
481
498
  # @return [Resources::CouponRedemption] An active coupon redemption on an account.
482
499
  # @example
483
500
  # begin
@@ -501,6 +518,7 @@ module Recurly
501
518
  # @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+.
502
519
  # @param body [Requests::CouponRedemptionCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponRedemptionCreate}
503
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+.
521
+ #
504
522
  # @return [Resources::CouponRedemption] Returns the new coupon redemption.
505
523
  # @example
506
524
  # begin
@@ -530,6 +548,7 @@ module Recurly
530
548
  #
531
549
  # @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+.
532
550
  # @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+.
551
+ #
533
552
  # @return [Resources::CouponRedemption] Coupon redemption deleted.
534
553
  # @example
535
554
  # begin
@@ -557,13 +576,14 @@ module Recurly
557
576
  # order. In descending order updated records will move behind the cursor and could
558
577
  # prevent some records from being returned.
559
578
  #
560
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
579
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
561
580
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
562
581
  #
563
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
582
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
564
583
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
565
584
  #
566
585
  # @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+.
586
+ #
567
587
  # @return [Pager<Resources::CreditPayment>] A list of the account's credit payments.
568
588
  # @example
569
589
  # payments = @client.list_account_credit_payments(
@@ -602,10 +622,10 @@ module Recurly
602
622
  # order. In descending order updated records will move behind the cursor and could
603
623
  # prevent some records from being returned.
604
624
  #
605
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
625
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
606
626
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
607
627
  #
608
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
628
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
609
629
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
610
630
  #
611
631
  # @param type [String] Filter by type when:
@@ -615,6 +635,7 @@ module Recurly
615
635
  # - +type=legacy+, only legacy invoices will be returned.
616
636
  #
617
637
  # @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+.
638
+ #
618
639
  # @return [Pager<Resources::Invoice>] A list of the account's invoices.
619
640
  # @example
620
641
  # invoices = @client.list_account_invoices(
@@ -637,6 +658,7 @@ module Recurly
637
658
  # @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+.
638
659
  # @param body [Requests::InvoiceCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCreate}
639
660
  # @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+.
661
+ #
640
662
  # @return [Resources::InvoiceCollection] Returns the new invoices.
641
663
  # @example
642
664
  # begin
@@ -667,6 +689,7 @@ module Recurly
667
689
  # @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+.
668
690
  # @param body [Requests::InvoiceCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCreate}
669
691
  # @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+.
692
+ #
670
693
  # @return [Resources::InvoiceCollection] Returns the invoice previews.
671
694
  # @example
672
695
  # begin
@@ -713,16 +736,17 @@ module Recurly
713
736
  # order. In descending order updated records will move behind the cursor and could
714
737
  # prevent some records from being returned.
715
738
  #
716
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
739
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
717
740
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
718
741
  #
719
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
742
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
720
743
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
721
744
  #
722
745
  # @param original [String] Filter by original field.
723
746
  # @param state [String] Filter by state field.
724
747
  # @param type [String] Filter by type field.
725
748
  # @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+.
749
+ #
726
750
  # @return [Pager<Resources::LineItem>] A list of the account's line items.
727
751
  # @example
728
752
  # line_items = @client.list_account_line_items(
@@ -745,6 +769,7 @@ module Recurly
745
769
  # @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+.
746
770
  # @param body [Requests::LineItemCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::LineItemCreate}
747
771
  # @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+.
772
+ #
748
773
  # @return [Resources::LineItem] Returns the new line item.
749
774
  # @example
750
775
  # begin
@@ -787,6 +812,7 @@ module Recurly
787
812
  # returned at once you can sort the records yourself.
788
813
  #
789
814
  # @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+.
815
+ #
790
816
  # @return [Pager<Resources::AccountNote>] A list of an account's notes.
791
817
  # @example
792
818
  # account_notes = @client.list_account_notes(account_id: account_id, limit: 200)
@@ -806,6 +832,7 @@ module Recurly
806
832
  # @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+.
807
833
  # @param account_note_id [String] Account Note ID.
808
834
  # @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+.
835
+ #
809
836
  # @return [Resources::AccountNote] An account note.
810
837
  # @example
811
838
  # begin
@@ -848,13 +875,14 @@ module Recurly
848
875
  # order. In descending order updated records will move behind the cursor and could
849
876
  # prevent some records from being returned.
850
877
  #
851
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
878
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
852
879
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
853
880
  #
854
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
881
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
855
882
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
856
883
  #
857
884
  # @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+.
885
+ #
858
886
  # @return [Pager<Resources::ShippingAddress>] A list of an account's shipping addresses.
859
887
  # @example
860
888
  # shipping_addresses = @client.list_shipping_addresses(
@@ -877,6 +905,7 @@ module Recurly
877
905
  # @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+.
878
906
  # @param body [Requests::ShippingAddressCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingAddressCreate}
879
907
  # @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+.
908
+ #
880
909
  # @return [Resources::ShippingAddress] Returns the new shipping address.
881
910
  # @example
882
911
  # begin
@@ -910,6 +939,7 @@ module Recurly
910
939
  # @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+.
911
940
  # @param shipping_address_id [String] Shipping Address ID.
912
941
  # @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+.
942
+ #
913
943
  # @return [Resources::ShippingAddress] A shipping address.
914
944
  # @example
915
945
  # begin
@@ -937,6 +967,7 @@ module Recurly
937
967
  # @param shipping_address_id [String] Shipping Address ID.
938
968
  # @param body [Requests::ShippingAddressUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingAddressUpdate}
939
969
  # @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+.
970
+ #
940
971
  # @return [Resources::ShippingAddress] The updated shipping address.
941
972
  # @example
942
973
  # begin
@@ -969,6 +1000,7 @@ module Recurly
969
1000
  # @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+.
970
1001
  # @param shipping_address_id [String] Shipping Address ID.
971
1002
  # @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+.
1003
+ #
972
1004
  # @return [Resources::Empty] Shipping address deleted.
973
1005
  # @example
974
1006
  # begin
@@ -1011,10 +1043,10 @@ module Recurly
1011
1043
  # order. In descending order updated records will move behind the cursor and could
1012
1044
  # prevent some records from being returned.
1013
1045
  #
1014
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1046
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1015
1047
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1016
1048
  #
1017
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
1049
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1018
1050
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1019
1051
  #
1020
1052
  # @param state [String] Filter by state.
@@ -1024,6 +1056,7 @@ module Recurly
1024
1056
  # - When +state=live+, only subscriptions that are in an active, canceled, or future state or are in trial will be returned.
1025
1057
  #
1026
1058
  # @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+.
1059
+ #
1027
1060
  # @return [Pager<Resources::Subscription>] A list of the account's subscriptions.
1028
1061
  # @example
1029
1062
  # subscriptions = @client.list_account_subscriptions(
@@ -1062,15 +1095,16 @@ module Recurly
1062
1095
  # order. In descending order updated records will move behind the cursor and could
1063
1096
  # prevent some records from being returned.
1064
1097
  #
1065
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1098
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1066
1099
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1067
1100
  #
1068
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
1101
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1069
1102
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1070
1103
  #
1071
1104
  # @param type [String] Filter by type field. The value +payment+ will return both +purchase+ and +capture+ transactions.
1072
1105
  # @param success [String] Filter by success field.
1073
1106
  # @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+.
1107
+ #
1074
1108
  # @return [Pager<Resources::Transaction>] A list of the account's transactions.
1075
1109
  # @example
1076
1110
  # transactions = @client.list_account_transactions(
@@ -1109,10 +1143,10 @@ module Recurly
1109
1143
  # order. In descending order updated records will move behind the cursor and could
1110
1144
  # prevent some records from being returned.
1111
1145
  #
1112
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1146
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1113
1147
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1114
1148
  #
1115
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
1149
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1116
1150
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1117
1151
  #
1118
1152
  # @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.
@@ -1121,6 +1155,7 @@ module Recurly
1121
1155
  #
1122
1156
  # @param past_due [String] Filter for accounts with an invoice in the +past_due+ state.
1123
1157
  # @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+.
1158
+ #
1124
1159
  # @return [Pager<Resources::Account>] A list of an account's child accounts.
1125
1160
  # @example
1126
1161
  # child_accounts = @client.list_child_accounts(
@@ -1158,13 +1193,14 @@ module Recurly
1158
1193
  # order. In descending order updated records will move behind the cursor and could
1159
1194
  # prevent some records from being returned.
1160
1195
  #
1161
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1196
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1162
1197
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1163
1198
  #
1164
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
1199
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1165
1200
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1166
1201
  #
1167
1202
  # @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+.
1203
+ #
1168
1204
  # @return [Pager<Resources::AccountAcquisition>] A list of the site's account acquisition data.
1169
1205
  # @example
1170
1206
  # acquisitions = @client.list_account_acquisition(limit: 200)
@@ -1199,13 +1235,14 @@ module Recurly
1199
1235
  # order. In descending order updated records will move behind the cursor and could
1200
1236
  # prevent some records from being returned.
1201
1237
  #
1202
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1238
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1203
1239
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1204
1240
  #
1205
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
1241
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1206
1242
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1207
1243
  #
1208
1244
  # @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+.
1245
+ #
1209
1246
  # @return [Pager<Resources::Coupon>] A list of the site's coupons.
1210
1247
  # @example
1211
1248
  # coupons = @client.list_coupons(limit: 200)
@@ -1224,6 +1261,7 @@ module Recurly
1224
1261
  #
1225
1262
  # @param body [Requests::CouponCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponCreate}
1226
1263
  # @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+.
1264
+ #
1227
1265
  # @return [Resources::Coupon] A new coupon.
1228
1266
  # @example
1229
1267
  # begin
@@ -1259,6 +1297,7 @@ module Recurly
1259
1297
  #
1260
1298
  # @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+.
1261
1299
  # @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+.
1300
+ #
1262
1301
  # @return [Resources::Coupon] A coupon.
1263
1302
  # @example
1264
1303
  # begin
@@ -1282,6 +1321,7 @@ module Recurly
1282
1321
  # @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+.
1283
1322
  # @param body [Requests::CouponUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponUpdate}
1284
1323
  # @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+.
1324
+ #
1285
1325
  # @return [Resources::Coupon] The updated coupon.
1286
1326
  # @example
1287
1327
  # begin
@@ -1307,6 +1347,7 @@ module Recurly
1307
1347
  #
1308
1348
  # @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+.
1309
1349
  # @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+.
1350
+ #
1310
1351
  # @return [Resources::Coupon] The expired Coupon
1311
1352
  # @example
1312
1353
  # begin
@@ -1323,6 +1364,21 @@ module Recurly
1323
1364
  delete(path, **options)
1324
1365
  end
1325
1366
 
1367
+ # Restore an inactive coupon
1368
+ #
1369
+ # {https://developers.recurly.com/api/v2019-10-10#operation/restore_coupon restore_coupon api documenation}
1370
+ #
1371
+ # @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+.
1372
+ # @param body [Requests::CouponUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponUpdate}
1373
+ # @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+.
1374
+ #
1375
+ # @return [Resources::Coupon] The restored coupon.
1376
+ #
1377
+ def restore_coupon(coupon_id:, body:, **options)
1378
+ path = interpolate_path("/coupons/{coupon_id}/restore", coupon_id: coupon_id)
1379
+ put(path, body, Requests::CouponUpdate, **options)
1380
+ end
1381
+
1326
1382
  # List unique coupon codes associated with a bulk coupon
1327
1383
  #
1328
1384
  # {https://developers.recurly.com/api/v2019-10-10#operation/list_unique_coupon_codes list_unique_coupon_codes api documenation}
@@ -1346,14 +1402,16 @@ module Recurly
1346
1402
  # order. In descending order updated records will move behind the cursor and could
1347
1403
  # prevent some records from being returned.
1348
1404
  #
1349
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1405
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1350
1406
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1351
1407
  #
1352
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
1408
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1353
1409
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1354
1410
  #
1355
1411
  # @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+.
1412
+ #
1356
1413
  # @return [Pager<Resources::UniqueCouponCode>] A list of unique coupon codes that were generated
1414
+ #
1357
1415
  def list_unique_coupon_codes(coupon_id:, **options)
1358
1416
  path = interpolate_path("/coupons/{coupon_id}/unique_coupon_codes", coupon_id: coupon_id)
1359
1417
  pager(path, **options)
@@ -1369,13 +1427,14 @@ module Recurly
1369
1427
  # order. In descending order updated records will move behind the cursor and could
1370
1428
  # prevent some records from being returned.
1371
1429
  #
1372
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1430
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1373
1431
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1374
1432
  #
1375
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
1433
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1376
1434
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1377
1435
  #
1378
1436
  # @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
+ #
1379
1438
  # @return [Pager<Resources::CreditPayment>] A list of the site's credit payments.
1380
1439
  # @example
1381
1440
  # payments = @client.list_credit_payments(limit: 200)
@@ -1394,7 +1453,9 @@ module Recurly
1394
1453
  #
1395
1454
  # @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+.
1396
1455
  # @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+.
1456
+ #
1397
1457
  # @return [Resources::CreditPayment] A credit payment.
1458
+ #
1398
1459
  def get_credit_payment(credit_payment_id:, **options)
1399
1460
  path = interpolate_path("/credit_payments/{credit_payment_id}", credit_payment_id: credit_payment_id)
1400
1461
  get(path, **options)
@@ -1422,14 +1483,15 @@ module Recurly
1422
1483
  # order. In descending order updated records will move behind the cursor and could
1423
1484
  # prevent some records from being returned.
1424
1485
  #
1425
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1486
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1426
1487
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1427
1488
  #
1428
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
1489
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1429
1490
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1430
1491
  #
1431
1492
  # @param related_type [String] Filter by related type.
1432
1493
  # @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+.
1494
+ #
1433
1495
  # @return [Pager<Resources::CustomFieldDefinition>] A list of the site's custom field definitions.
1434
1496
  # @example
1435
1497
  # custom_fields = @client.list_custom_field_definitions(limit: 200)
@@ -1448,6 +1510,7 @@ module Recurly
1448
1510
  #
1449
1511
  # @param custom_field_definition_id [String] Custom Field Definition ID
1450
1512
  # @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+.
1513
+ #
1451
1514
  # @return [Resources::CustomFieldDefinition] An custom field definition.
1452
1515
  # @example
1453
1516
  # begin
@@ -1488,14 +1551,15 @@ module Recurly
1488
1551
  # order. In descending order updated records will move behind the cursor and could
1489
1552
  # prevent some records from being returned.
1490
1553
  #
1491
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1554
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1492
1555
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1493
1556
  #
1494
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
1557
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1495
1558
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1496
1559
  #
1497
1560
  # @param state [String] Filter by state.
1498
1561
  # @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+.
1562
+ #
1499
1563
  # @return [Pager<Resources::Item>] A list of the site's items.
1500
1564
  # @example
1501
1565
  # items = @client.list_items(limit: 200)
@@ -1514,6 +1578,7 @@ module Recurly
1514
1578
  #
1515
1579
  # @param body [Requests::ItemCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ItemCreate}
1516
1580
  # @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+.
1581
+ #
1517
1582
  # @return [Resources::Item] A new item.
1518
1583
  # @example
1519
1584
  # begin
@@ -1548,6 +1613,7 @@ module Recurly
1548
1613
  #
1549
1614
  # @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+.
1550
1615
  # @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+.
1616
+ #
1551
1617
  # @return [Resources::Item] An item.
1552
1618
  # @example
1553
1619
  # begin
@@ -1571,6 +1637,7 @@ module Recurly
1571
1637
  # @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+.
1572
1638
  # @param body [Requests::ItemUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ItemUpdate}
1573
1639
  # @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+.
1640
+ #
1574
1641
  # @return [Resources::Item] The updated item.
1575
1642
  # @example
1576
1643
  # begin
@@ -1600,6 +1667,7 @@ module Recurly
1600
1667
  #
1601
1668
  # @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+.
1602
1669
  # @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+.
1670
+ #
1603
1671
  # @return [Resources::Item] An item.
1604
1672
  # @example
1605
1673
  # begin
@@ -1622,6 +1690,7 @@ module Recurly
1622
1690
  #
1623
1691
  # @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+.
1624
1692
  # @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+.
1693
+ #
1625
1694
  # @return [Resources::Item] An item.
1626
1695
  # @example
1627
1696
  # begin
@@ -1638,6 +1707,101 @@ module Recurly
1638
1707
  put(path, **options)
1639
1708
  end
1640
1709
 
1710
+ # List a site's measured units
1711
+ #
1712
+ # {https://developers.recurly.com/api/v2019-10-10#operation/list_measured_unit list_measured_unit api documenation}
1713
+ #
1714
+ # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1715
+ # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
1716
+ #
1717
+ # *Important notes:*
1718
+ #
1719
+ # * The +ids+ parameter cannot be used with any other ordering or filtering
1720
+ # parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
1721
+ # * Invalid or unknown IDs will be ignored, so you should check that the
1722
+ # results correspond to your request.
1723
+ # * Records are returned in an arbitrary order. Since results are all
1724
+ # returned at once you can sort the records yourself.
1725
+ #
1726
+ # @param limit [Integer] Limit number of records 1-200.
1727
+ # @param order [String] Sort order.
1728
+ # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1729
+ # order. In descending order updated records will move behind the cursor and could
1730
+ # prevent some records from being returned.
1731
+ #
1732
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1733
+ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1734
+ #
1735
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1736
+ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1737
+ #
1738
+ # @param state [String] Filter by state.
1739
+ # @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+.
1740
+ #
1741
+ # @return [Pager<Resources::MeasuredUnit>] A list of the site's measured units.
1742
+ #
1743
+ def list_measured_unit(**options)
1744
+ path = interpolate_path("/measured_units")
1745
+ pager(path, **options)
1746
+ end
1747
+
1748
+ # Create a new measured unit
1749
+ #
1750
+ # {https://developers.recurly.com/api/v2019-10-10#operation/create_measured_unit create_measured_unit api documenation}
1751
+ #
1752
+ # @param body [Requests::MeasuredUnitCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::MeasuredUnitCreate}
1753
+ # @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+.
1754
+ #
1755
+ # @return [Resources::MeasuredUnit] A new measured unit.
1756
+ #
1757
+ def create_measured_unit(body:, **options)
1758
+ path = interpolate_path("/measured_units")
1759
+ post(path, body, Requests::MeasuredUnitCreate, **options)
1760
+ end
1761
+
1762
+ # Fetch a measured unit
1763
+ #
1764
+ # {https://developers.recurly.com/api/v2019-10-10#operation/get_measured_unit get_measured_unit api documenation}
1765
+ #
1766
+ # @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+.
1767
+ # @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+.
1768
+ #
1769
+ # @return [Resources::MeasuredUnit] An item.
1770
+ #
1771
+ def get_measured_unit(measured_unit_id:, **options)
1772
+ path = interpolate_path("/measured_units/{measured_unit_id}", measured_unit_id: measured_unit_id)
1773
+ get(path, **options)
1774
+ end
1775
+
1776
+ # Update a measured unit
1777
+ #
1778
+ # {https://developers.recurly.com/api/v2019-10-10#operation/update_measured_unit update_measured_unit api documenation}
1779
+ #
1780
+ # @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+.
1781
+ # @param body [Requests::MeasuredUnitUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::MeasuredUnitUpdate}
1782
+ # @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+.
1783
+ #
1784
+ # @return [Resources::MeasuredUnit] The updated measured_unit.
1785
+ #
1786
+ def update_measured_unit(measured_unit_id:, body:, **options)
1787
+ path = interpolate_path("/measured_units/{measured_unit_id}", measured_unit_id: measured_unit_id)
1788
+ put(path, body, Requests::MeasuredUnitUpdate, **options)
1789
+ end
1790
+
1791
+ # Remove a measured unit
1792
+ #
1793
+ # {https://developers.recurly.com/api/v2019-10-10#operation/remove_measured_unit remove_measured_unit api documenation}
1794
+ #
1795
+ # @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+.
1796
+ # @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+.
1797
+ #
1798
+ # @return [Resources::MeasuredUnit] A measured unit.
1799
+ #
1800
+ def remove_measured_unit(measured_unit_id:, **options)
1801
+ path = interpolate_path("/measured_units/{measured_unit_id}", measured_unit_id: measured_unit_id)
1802
+ delete(path, **options)
1803
+ end
1804
+
1641
1805
  # List a site's invoices
1642
1806
  #
1643
1807
  # {https://developers.recurly.com/api/v2019-10-10#operation/list_invoices list_invoices api documenation}
@@ -1660,10 +1824,10 @@ module Recurly
1660
1824
  # order. In descending order updated records will move behind the cursor and could
1661
1825
  # prevent some records from being returned.
1662
1826
  #
1663
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1827
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1664
1828
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1665
1829
  #
1666
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
1830
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1667
1831
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1668
1832
  #
1669
1833
  # @param type [String] Filter by type when:
@@ -1673,6 +1837,7 @@ module Recurly
1673
1837
  # - +type=legacy+, only legacy invoices will be returned.
1674
1838
  #
1675
1839
  # @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+.
1840
+ #
1676
1841
  # @return [Pager<Resources::Invoice>] A list of the site's invoices.
1677
1842
  # @example
1678
1843
  # invoices = @client.list_invoices(limit: 200)
@@ -1691,6 +1856,7 @@ module Recurly
1691
1856
  #
1692
1857
  # @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+.
1693
1858
  # @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+.
1859
+ #
1694
1860
  # @return [Resources::Invoice] An invoice.
1695
1861
  # @example
1696
1862
  # begin
@@ -1714,6 +1880,7 @@ module Recurly
1714
1880
  # @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+.
1715
1881
  # @param body [Requests::InvoiceUpdatable] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceUpdatable}
1716
1882
  # @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+.
1883
+ #
1717
1884
  # @return [Resources::Invoice] An invoice.
1718
1885
  # @example
1719
1886
  # begin
@@ -1740,6 +1907,7 @@ module Recurly
1740
1907
  #
1741
1908
  # @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+.
1742
1909
  # @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+.
1910
+ #
1743
1911
  # @return [Resources::BinaryFile] An invoice as a PDF.
1744
1912
  # @example
1745
1913
  # begin
@@ -1766,6 +1934,7 @@ module Recurly
1766
1934
  # @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+.
1767
1935
  # @param body [Requests::InvoiceCollect] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCollect}
1768
1936
  # @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+.
1937
+ #
1769
1938
  # @return [Resources::Invoice] The updated invoice.
1770
1939
  # @example
1771
1940
  # begin
@@ -1788,6 +1957,7 @@ module Recurly
1788
1957
  #
1789
1958
  # @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+.
1790
1959
  # @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+.
1960
+ #
1791
1961
  # @return [Resources::Invoice] The updated invoice.
1792
1962
  # @example
1793
1963
  # begin
@@ -1810,6 +1980,7 @@ module Recurly
1810
1980
  #
1811
1981
  # @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+.
1812
1982
  # @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+.
1983
+ #
1813
1984
  # @return [Resources::Invoice] The updated invoice.
1814
1985
  # @example
1815
1986
  # begin
@@ -1832,6 +2003,7 @@ module Recurly
1832
2003
  #
1833
2004
  # @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+.
1834
2005
  # @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+.
2006
+ #
1835
2007
  # @return [Resources::Invoice] The updated invoice.
1836
2008
  # @example
1837
2009
  # begin
@@ -1854,6 +2026,7 @@ module Recurly
1854
2026
  #
1855
2027
  # @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+.
1856
2028
  # @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+.
2029
+ #
1857
2030
  # @return [Resources::Invoice] The updated invoice.
1858
2031
  # @example
1859
2032
  # begin
@@ -1877,7 +2050,9 @@ module Recurly
1877
2050
  # @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+.
1878
2051
  # @param body [Requests::ExternalTransaction] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ExternalTransaction}
1879
2052
  # @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+.
2053
+ #
1880
2054
  # @return [Resources::Transaction] The recorded transaction.
2055
+ #
1881
2056
  def record_external_transaction(invoice_id:, body:, **options)
1882
2057
  path = interpolate_path("/invoices/{invoice_id}/transactions", invoice_id: invoice_id)
1883
2058
  post(path, body, Requests::ExternalTransaction, **options)
@@ -1906,16 +2081,17 @@ module Recurly
1906
2081
  # order. In descending order updated records will move behind the cursor and could
1907
2082
  # prevent some records from being returned.
1908
2083
  #
1909
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2084
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1910
2085
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1911
2086
  #
1912
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
2087
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1913
2088
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1914
2089
  #
1915
2090
  # @param original [String] Filter by original field.
1916
2091
  # @param state [String] Filter by state field.
1917
2092
  # @param type [String] Filter by type field.
1918
2093
  # @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+.
2094
+ #
1919
2095
  # @return [Pager<Resources::LineItem>] A list of the invoice's line items.
1920
2096
  # @example
1921
2097
  # line_items = @client.list_invoice_line_items(
@@ -1952,13 +2128,14 @@ module Recurly
1952
2128
  # order. In descending order updated records will move behind the cursor and could
1953
2129
  # prevent some records from being returned.
1954
2130
  #
1955
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2131
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1956
2132
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1957
2133
  #
1958
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
2134
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1959
2135
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1960
2136
  #
1961
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+.
2138
+ #
1962
2139
  # @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions associated with the invoice.
1963
2140
  # @example
1964
2141
  # coupon_redemptions = @client.list_invoice_coupon_redemptions(
@@ -1980,6 +2157,7 @@ module Recurly
1980
2157
  #
1981
2158
  # @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+.
1982
2159
  # @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+.
2160
+ #
1983
2161
  # @return [Pager<Resources::Invoice>] A list of the credit or charge invoices associated with the invoice.
1984
2162
  # @example
1985
2163
  # invoices = @client.list_related_invoices(
@@ -2002,6 +2180,7 @@ module Recurly
2002
2180
  # @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+.
2003
2181
  # @param body [Requests::InvoiceRefund] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceRefund}
2004
2182
  # @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+.
2183
+ #
2005
2184
  # @return [Resources::Invoice] Returns the new credit invoice.
2006
2185
  # @example
2007
2186
  # begin
@@ -2047,16 +2226,17 @@ module Recurly
2047
2226
  # order. In descending order updated records will move behind the cursor and could
2048
2227
  # prevent some records from being returned.
2049
2228
  #
2050
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2229
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2051
2230
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2052
2231
  #
2053
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
2232
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2054
2233
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2055
2234
  #
2056
2235
  # @param original [String] Filter by original field.
2057
2236
  # @param state [String] Filter by state field.
2058
2237
  # @param type [String] Filter by type field.
2059
2238
  # @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+.
2239
+ #
2060
2240
  # @return [Pager<Resources::LineItem>] A list of the site's line items.
2061
2241
  # @example
2062
2242
  # line_items = @client.list_line_items(
@@ -2077,6 +2257,7 @@ module Recurly
2077
2257
  #
2078
2258
  # @param line_item_id [String] Line Item ID.
2079
2259
  # @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+.
2260
+ #
2080
2261
  # @return [Resources::LineItem] A line item.
2081
2262
  # @example
2082
2263
  # begin
@@ -2099,6 +2280,7 @@ module Recurly
2099
2280
  #
2100
2281
  # @param line_item_id [String] Line Item ID.
2101
2282
  # @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+.
2283
+ #
2102
2284
  # @return [Resources::Empty] Line item deleted.
2103
2285
  # @example
2104
2286
  # begin
@@ -2139,14 +2321,15 @@ module Recurly
2139
2321
  # order. In descending order updated records will move behind the cursor and could
2140
2322
  # prevent some records from being returned.
2141
2323
  #
2142
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2324
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2143
2325
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2144
2326
  #
2145
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
2327
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2146
2328
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2147
2329
  #
2148
2330
  # @param state [String] Filter by state.
2149
2331
  # @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+.
2332
+ #
2150
2333
  # @return [Pager<Resources::Plan>] A list of plans.
2151
2334
  # @example
2152
2335
  # plans = @client.list_plans(limit: 200)
@@ -2165,6 +2348,7 @@ module Recurly
2165
2348
  #
2166
2349
  # @param body [Requests::PlanCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PlanCreate}
2167
2350
  # @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+.
2351
+ #
2168
2352
  # @return [Resources::Plan] A plan.
2169
2353
  # @example
2170
2354
  # begin
@@ -2204,6 +2388,7 @@ module Recurly
2204
2388
  #
2205
2389
  # @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+.
2206
2390
  # @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+.
2391
+ #
2207
2392
  # @return [Resources::Plan] A plan.
2208
2393
  # @example
2209
2394
  # begin
@@ -2227,6 +2412,7 @@ module Recurly
2227
2412
  # @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+.
2228
2413
  # @param body [Requests::PlanUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PlanUpdate}
2229
2414
  # @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+.
2415
+ #
2230
2416
  # @return [Resources::Plan] A plan.
2231
2417
  # @example
2232
2418
  # begin
@@ -2252,6 +2438,7 @@ module Recurly
2252
2438
  #
2253
2439
  # @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+.
2254
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+.
2441
+ #
2255
2442
  # @return [Resources::Plan] Plan deleted
2256
2443
  # @example
2257
2444
  # begin
@@ -2291,14 +2478,15 @@ module Recurly
2291
2478
  # order. In descending order updated records will move behind the cursor and could
2292
2479
  # prevent some records from being returned.
2293
2480
  #
2294
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2481
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2295
2482
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2296
2483
  #
2297
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
2484
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2298
2485
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2299
2486
  #
2300
2487
  # @param state [String] Filter by state.
2301
2488
  # @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+.
2489
+ #
2302
2490
  # @return [Pager<Resources::AddOn>] A list of add-ons.
2303
2491
  # @example
2304
2492
  # add_ons = @client.list_plan_add_ons(
@@ -2321,6 +2509,7 @@ module Recurly
2321
2509
  # @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+.
2322
2510
  # @param body [Requests::AddOnCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AddOnCreate}
2323
2511
  # @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+.
2512
+ #
2324
2513
  # @return [Resources::AddOn] An add-on.
2325
2514
  # @example
2326
2515
  # begin
@@ -2355,6 +2544,7 @@ module Recurly
2355
2544
  # @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+.
2356
2545
  # @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+.
2357
2546
  # @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+.
2547
+ #
2358
2548
  # @return [Resources::AddOn] An add-on.
2359
2549
  # @example
2360
2550
  # begin
@@ -2381,6 +2571,7 @@ module Recurly
2381
2571
  # @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+.
2382
2572
  # @param body [Requests::AddOnUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AddOnUpdate}
2383
2573
  # @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+.
2574
+ #
2384
2575
  # @return [Resources::AddOn] An add-on.
2385
2576
  # @example
2386
2577
  # begin
@@ -2411,6 +2602,7 @@ module Recurly
2411
2602
  # @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+.
2412
2603
  # @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+.
2413
2604
  # @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+.
2605
+ #
2414
2606
  # @return [Resources::AddOn] Add-on deleted
2415
2607
  # @example
2416
2608
  # begin
@@ -2452,14 +2644,15 @@ module Recurly
2452
2644
  # order. In descending order updated records will move behind the cursor and could
2453
2645
  # prevent some records from being returned.
2454
2646
  #
2455
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2647
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2456
2648
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2457
2649
  #
2458
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
2650
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2459
2651
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2460
2652
  #
2461
2653
  # @param state [String] Filter by state.
2462
2654
  # @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+.
2655
+ #
2463
2656
  # @return [Pager<Resources::AddOn>] A list of add-ons.
2464
2657
  # @example
2465
2658
  # add_ons = @client.list_add_ons(
@@ -2480,6 +2673,7 @@ module Recurly
2480
2673
  #
2481
2674
  # @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+.
2482
2675
  # @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+.
2676
+ #
2483
2677
  # @return [Resources::AddOn] An add-on.
2484
2678
  # @example
2485
2679
  # begin
@@ -2518,13 +2712,14 @@ module Recurly
2518
2712
  # order. In descending order updated records will move behind the cursor and could
2519
2713
  # prevent some records from being returned.
2520
2714
  #
2521
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2715
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2522
2716
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2523
2717
  #
2524
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
2718
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2525
2719
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2526
2720
  #
2527
2721
  # @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+.
2722
+ #
2528
2723
  # @return [Pager<Resources::ShippingMethod>] A list of the site's shipping methods.
2529
2724
  # @example
2530
2725
  # shipping_methods = @client.list_shipping_methods(
@@ -2545,7 +2740,9 @@ module Recurly
2545
2740
  #
2546
2741
  # @param body [Requests::ShippingMethodCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingMethodCreate}
2547
2742
  # @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+.
2743
+ #
2548
2744
  # @return [Resources::ShippingMethod] A new shipping method.
2745
+ #
2549
2746
  def create_shipping_method(body:, **options)
2550
2747
  path = interpolate_path("/shipping_methods")
2551
2748
  post(path, body, Requests::ShippingMethodCreate, **options)
@@ -2557,7 +2754,9 @@ module Recurly
2557
2754
  #
2558
2755
  # @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+.
2559
2756
  # @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+.
2757
+ #
2560
2758
  # @return [Resources::ShippingMethod] A shipping method.
2759
+ #
2561
2760
  def get_shipping_method(id:, **options)
2562
2761
  path = interpolate_path("/shipping_methods/{id}", id: id)
2563
2762
  get(path, **options)
@@ -2570,7 +2769,9 @@ module Recurly
2570
2769
  # @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+.
2571
2770
  # @param body [Requests::ShippingMethodUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingMethodUpdate}
2572
2771
  # @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+.
2772
+ #
2573
2773
  # @return [Resources::ShippingMethod] The updated shipping method.
2774
+ #
2574
2775
  def update_shipping_method(shipping_method_id:, body:, **options)
2575
2776
  path = interpolate_path("/shipping_methods/{shipping_method_id}", shipping_method_id: shipping_method_id)
2576
2777
  put(path, body, Requests::ShippingMethodUpdate, **options)
@@ -2582,7 +2783,9 @@ module Recurly
2582
2783
  #
2583
2784
  # @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+.
2584
2785
  # @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+.
2786
+ #
2585
2787
  # @return [Resources::ShippingMethod] A shipping method.
2788
+ #
2586
2789
  def deactivate_shipping_method(shipping_method_id:, **options)
2587
2790
  path = interpolate_path("/shipping_methods/{shipping_method_id}", shipping_method_id: shipping_method_id)
2588
2791
  delete(path, **options)
@@ -2610,10 +2813,10 @@ module Recurly
2610
2813
  # order. In descending order updated records will move behind the cursor and could
2611
2814
  # prevent some records from being returned.
2612
2815
  #
2613
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2816
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2614
2817
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2615
2818
  #
2616
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
2819
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2617
2820
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2618
2821
  #
2619
2822
  # @param state [String] Filter by state.
@@ -2623,6 +2826,7 @@ module Recurly
2623
2826
  # - When +state=live+, only subscriptions that are in an active, canceled, or future state or are in trial will be returned.
2624
2827
  #
2625
2828
  # @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+.
2829
+ #
2626
2830
  # @return [Pager<Resources::Subscription>] A list of the site's subscriptions.
2627
2831
  # @example
2628
2832
  # subscriptions = @client.list_subscriptions(limit: 200)
@@ -2641,6 +2845,7 @@ module Recurly
2641
2845
  #
2642
2846
  # @param body [Requests::SubscriptionCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionCreate}
2643
2847
  # @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+.
2848
+ #
2644
2849
  # @return [Resources::Subscription] A subscription.
2645
2850
  # @example
2646
2851
  # begin
@@ -2674,6 +2879,7 @@ module Recurly
2674
2879
  #
2675
2880
  # @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+.
2676
2881
  # @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+.
2882
+ #
2677
2883
  # @return [Resources::Subscription] A subscription.
2678
2884
  # @example
2679
2885
  # begin
@@ -2699,6 +2905,7 @@ module Recurly
2699
2905
  # @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+.
2700
2906
  # @param body [Requests::SubscriptionUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionUpdate}
2701
2907
  # @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+.
2908
+ #
2702
2909
  # @return [Resources::Subscription] A subscription.
2703
2910
  # @example
2704
2911
  # begin
@@ -2738,6 +2945,7 @@ module Recurly
2738
2945
  # You may also terminate a subscription with no refund and then manually refund specific invoices.
2739
2946
  #
2740
2947
  # @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+.
2948
+ #
2741
2949
  # @return [Resources::Subscription] An expired subscription.
2742
2950
  # @example
2743
2951
  # begin
@@ -2763,6 +2971,7 @@ module Recurly
2763
2971
  # @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+.
2764
2972
  # @param body [Requests::SubscriptionCancel] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionCancel}
2765
2973
  # @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
+ #
2766
2975
  # @return [Resources::Subscription] A canceled or failed subscription.
2767
2976
  # @example
2768
2977
  # begin
@@ -2787,6 +2996,7 @@ module Recurly
2787
2996
  #
2788
2997
  # @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+.
2789
2998
  # @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+.
2999
+ #
2790
3000
  # @return [Resources::Subscription] An active subscription.
2791
3001
  # @example
2792
3002
  # begin
@@ -2812,6 +3022,7 @@ module Recurly
2812
3022
  # @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+.
2813
3023
  # @param body [Requests::SubscriptionPause] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionPause}
2814
3024
  # @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+.
3025
+ #
2815
3026
  # @return [Resources::Subscription] A subscription.
2816
3027
  # @example
2817
3028
  # begin
@@ -2840,6 +3051,7 @@ module Recurly
2840
3051
  #
2841
3052
  # @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+.
2842
3053
  # @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+.
3054
+ #
2843
3055
  # @return [Resources::Subscription] A subscription.
2844
3056
  # @example
2845
3057
  # begin
@@ -2864,7 +3076,9 @@ module Recurly
2864
3076
  #
2865
3077
  # @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+.
2866
3078
  # @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+.
3079
+ #
2867
3080
  # @return [Resources::Subscription] A subscription.
3081
+ #
2868
3082
  def convert_trial(subscription_id:, **options)
2869
3083
  path = interpolate_path("/subscriptions/{subscription_id}/convert_trial", subscription_id: subscription_id)
2870
3084
  put(path, **options)
@@ -2876,6 +3090,7 @@ module Recurly
2876
3090
  #
2877
3091
  # @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+.
2878
3092
  # @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+.
3093
+ #
2879
3094
  # @return [Resources::SubscriptionChange] A subscription's pending change.
2880
3095
  # @example
2881
3096
  # begin
@@ -2901,6 +3116,7 @@ module Recurly
2901
3116
  # @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+.
2902
3117
  # @param body [Requests::SubscriptionChangeCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionChangeCreate}
2903
3118
  # @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+.
3119
+ #
2904
3120
  # @return [Resources::SubscriptionChange] A subscription change.
2905
3121
  # @example
2906
3122
  # begin
@@ -2930,6 +3146,7 @@ module Recurly
2930
3146
  #
2931
3147
  # @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+.
2932
3148
  # @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+.
3149
+ #
2933
3150
  # @return [Resources::Empty] Subscription change was deleted.
2934
3151
  # @example
2935
3152
  # begin
@@ -2955,7 +3172,9 @@ module Recurly
2955
3172
  # @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+.
2956
3173
  # @param body [Requests::SubscriptionChangeCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionChangeCreate}
2957
3174
  # @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+.
3175
+ #
2958
3176
  # @return [Resources::SubscriptionChangePreview] A subscription change.
3177
+ #
2959
3178
  def preview_subscription_change(subscription_id:, body:, **options)
2960
3179
  path = interpolate_path("/subscriptions/{subscription_id}/change/preview", subscription_id: subscription_id)
2961
3180
  post(path, body, Requests::SubscriptionChangeCreate, **options)
@@ -2984,10 +3203,10 @@ module Recurly
2984
3203
  # order. In descending order updated records will move behind the cursor and could
2985
3204
  # prevent some records from being returned.
2986
3205
  #
2987
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
3206
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
2988
3207
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2989
3208
  #
2990
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
3209
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
2991
3210
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
2992
3211
  #
2993
3212
  # @param type [String] Filter by type when:
@@ -2997,6 +3216,7 @@ module Recurly
2997
3216
  # - +type=legacy+, only legacy invoices will be returned.
2998
3217
  #
2999
3218
  # @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+.
3219
+ #
3000
3220
  # @return [Pager<Resources::Invoice>] A list of the subscription's invoices.
3001
3221
  # @example
3002
3222
  # invoices = @client.list_subscription_invoices(
@@ -3035,16 +3255,17 @@ module Recurly
3035
3255
  # order. In descending order updated records will move behind the cursor and could
3036
3256
  # prevent some records from being returned.
3037
3257
  #
3038
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
3258
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
3039
3259
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3040
3260
  #
3041
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
3261
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
3042
3262
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3043
3263
  #
3044
3264
  # @param original [String] Filter by original field.
3045
3265
  # @param state [String] Filter by state field.
3046
3266
  # @param type [String] Filter by type field.
3047
3267
  # @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+.
3268
+ #
3048
3269
  # @return [Pager<Resources::LineItem>] A list of the subscription's line items.
3049
3270
  # @example
3050
3271
  # line_items = @client.list_subscription_line_items(
@@ -3081,13 +3302,14 @@ module Recurly
3081
3302
  # order. In descending order updated records will move behind the cursor and could
3082
3303
  # prevent some records from being returned.
3083
3304
  #
3084
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
3305
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
3085
3306
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3086
3307
  #
3087
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
3308
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
3088
3309
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3089
3310
  #
3090
3311
  # @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+.
3312
+ #
3091
3313
  # @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions on a subscription.
3092
3314
  # @example
3093
3315
  # coupon_redemptions = @client.list_subscription_coupon_redemptions(
@@ -3103,6 +3325,105 @@ module Recurly
3103
3325
  pager(path, **options)
3104
3326
  end
3105
3327
 
3328
+ # List a subscription add-on's usage records
3329
+ #
3330
+ # {https://developers.recurly.com/api/v2019-10-10#operation/list_usage list_usage api documenation}
3331
+ #
3332
+ # @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+.
3333
+ # @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+.
3334
+ # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
3335
+ # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
3336
+ #
3337
+ # *Important notes:*
3338
+ #
3339
+ # * The +ids+ parameter cannot be used with any other ordering or filtering
3340
+ # parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
3341
+ # * Invalid or unknown IDs will be ignored, so you should check that the
3342
+ # results correspond to your request.
3343
+ # * Records are returned in an arbitrary order. Since results are all
3344
+ # returned at once you can sort the records yourself.
3345
+ #
3346
+ # @param limit [Integer] Limit number of records 1-200.
3347
+ # @param order [String] Sort order.
3348
+ # @param sort [String] Sort field. You *really* only want to sort by +usage_timestamp+ in ascending
3349
+ # order. In descending order updated records will move behind the cursor and could
3350
+ # prevent some records from being returned.
3351
+ #
3352
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=usage_timestamp+ or +sort=recorded_timestamp+.
3353
+ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3354
+ #
3355
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=usage_timestamp+ or +sort=recorded_timestamp+.
3356
+ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3357
+ #
3358
+ # @param billing_status [String] Filter by usage record's billing status
3359
+ # @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+.
3360
+ #
3361
+ # @return [Pager<Resources::Usage>] A list of the subscription add-on's usage records.
3362
+ #
3363
+ def list_usage(subscription_id:, add_on_id:, **options)
3364
+ path = interpolate_path("/subscriptions/{subscription_id}/add_ons/{add_on_id}/usage", subscription_id: subscription_id, add_on_id: add_on_id)
3365
+ pager(path, **options)
3366
+ end
3367
+
3368
+ # Log a usage record on this subscription add-on
3369
+ #
3370
+ # {https://developers.recurly.com/api/v2019-10-10#operation/create_usage create_usage api documenation}
3371
+ #
3372
+ # @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+.
3373
+ # @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+.
3374
+ # @param body [Requests::UsageCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::UsageCreate}
3375
+ # @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+.
3376
+ #
3377
+ # @return [Resources::Usage] The created usage record.
3378
+ #
3379
+ def create_usage(subscription_id:, add_on_id:, body:, **options)
3380
+ path = interpolate_path("/subscriptions/{subscription_id}/add_ons/{add_on_id}/usage", subscription_id: subscription_id, add_on_id: add_on_id)
3381
+ post(path, body, Requests::UsageCreate, **options)
3382
+ end
3383
+
3384
+ # Get a usage record
3385
+ #
3386
+ # {https://developers.recurly.com/api/v2019-10-10#operation/get_usage get_usage api documenation}
3387
+ #
3388
+ # @param usage_id [String] Usage Record ID.
3389
+ # @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+.
3390
+ #
3391
+ # @return [Resources::Usage] The usage record.
3392
+ #
3393
+ def get_usage(usage_id:, **options)
3394
+ path = interpolate_path("/usage/{usage_id}", usage_id: usage_id)
3395
+ get(path, **options)
3396
+ end
3397
+
3398
+ # Update a usage record
3399
+ #
3400
+ # {https://developers.recurly.com/api/v2019-10-10#operation/update_usage update_usage api documenation}
3401
+ #
3402
+ # @param usage_id [String] Usage Record ID.
3403
+ # @param body [Requests::UsageCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::UsageCreate}
3404
+ # @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+.
3405
+ #
3406
+ # @return [Resources::Usage] The updated usage record.
3407
+ #
3408
+ def update_usage(usage_id:, body:, **options)
3409
+ path = interpolate_path("/usage/{usage_id}", usage_id: usage_id)
3410
+ put(path, body, Requests::UsageCreate, **options)
3411
+ end
3412
+
3413
+ # Delete a usage record.
3414
+ #
3415
+ # {https://developers.recurly.com/api/v2019-10-10#operation/remove_usage remove_usage api documenation}
3416
+ #
3417
+ # @param usage_id [String] Usage Record ID.
3418
+ # @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+.
3419
+ #
3420
+ # @return [Resources::Empty] Usage was successfully deleted.
3421
+ #
3422
+ def remove_usage(usage_id:, **options)
3423
+ path = interpolate_path("/usage/{usage_id}", usage_id: usage_id)
3424
+ delete(path, **options)
3425
+ end
3426
+
3106
3427
  # List a site's transactions
3107
3428
  #
3108
3429
  # {https://developers.recurly.com/api/v2019-10-10#operation/list_transactions list_transactions api documenation}
@@ -3125,15 +3446,16 @@ module Recurly
3125
3446
  # order. In descending order updated records will move behind the cursor and could
3126
3447
  # prevent some records from being returned.
3127
3448
  #
3128
- # @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
3449
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
3129
3450
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3130
3451
  #
3131
- # @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
3452
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
3132
3453
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
3133
3454
  #
3134
3455
  # @param type [String] Filter by type field. The value +payment+ will return both +purchase+ and +capture+ transactions.
3135
3456
  # @param success [String] Filter by success field.
3136
3457
  # @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+.
3458
+ #
3137
3459
  # @return [Pager<Resources::Transaction>] A list of the site's transactions.
3138
3460
  # @example
3139
3461
  # transactions = @client.list_transactions(limit: 200)
@@ -3152,6 +3474,7 @@ module Recurly
3152
3474
  #
3153
3475
  # @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+.
3154
3476
  # @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+.
3477
+ #
3155
3478
  # @return [Resources::Transaction] A transaction.
3156
3479
  # @example
3157
3480
  # begin
@@ -3174,7 +3497,9 @@ module Recurly
3174
3497
  #
3175
3498
  # @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+.
3176
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+.
3500
+ #
3177
3501
  # @return [Resources::UniqueCouponCode] A unique coupon code.
3502
+ #
3178
3503
  def get_unique_coupon_code(unique_coupon_code_id:, **options)
3179
3504
  path = interpolate_path("/unique_coupon_codes/{unique_coupon_code_id}", unique_coupon_code_id: unique_coupon_code_id)
3180
3505
  get(path, **options)
@@ -3186,7 +3511,9 @@ module Recurly
3186
3511
  #
3187
3512
  # @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+.
3188
3513
  # @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+.
3514
+ #
3189
3515
  # @return [Resources::UniqueCouponCode] A unique coupon code.
3516
+ #
3190
3517
  def deactivate_unique_coupon_code(unique_coupon_code_id:, **options)
3191
3518
  path = interpolate_path("/unique_coupon_codes/{unique_coupon_code_id}", unique_coupon_code_id: unique_coupon_code_id)
3192
3519
  delete(path, **options)
@@ -3198,7 +3525,9 @@ module Recurly
3198
3525
  #
3199
3526
  # @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+.
3200
3527
  # @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+.
3528
+ #
3201
3529
  # @return [Resources::UniqueCouponCode] A unique coupon code.
3530
+ #
3202
3531
  def reactivate_unique_coupon_code(unique_coupon_code_id:, **options)
3203
3532
  path = interpolate_path("/unique_coupon_codes/{unique_coupon_code_id}/restore", unique_coupon_code_id: unique_coupon_code_id)
3204
3533
  put(path, **options)
@@ -3210,6 +3539,7 @@ module Recurly
3210
3539
  #
3211
3540
  # @param body [Requests::PurchaseCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PurchaseCreate}
3212
3541
  # @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+.
3542
+ #
3213
3543
  # @return [Resources::InvoiceCollection] Returns the new invoices
3214
3544
  # @example
3215
3545
  # begin
@@ -3249,6 +3579,7 @@ module Recurly
3249
3579
  #
3250
3580
  # @param body [Requests::PurchaseCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PurchaseCreate}
3251
3581
  # @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+.
3582
+ #
3252
3583
  # @return [Resources::InvoiceCollection] Returns preview of the new invoices
3253
3584
  # @example
3254
3585
  # begin
@@ -3281,5 +3612,54 @@ module Recurly
3281
3612
  path = interpolate_path("/purchases/preview")
3282
3613
  post(path, body, Requests::PurchaseCreate, **options)
3283
3614
  end
3615
+
3616
+ # List the dates that have an available export to download.
3617
+ #
3618
+ # {https://developers.recurly.com/api/v2019-10-10#operation/get_export_dates get_export_dates api documenation}
3619
+ #
3620
+ # @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+.
3621
+ #
3622
+ # @return [Resources::ExportDates] Returns a list of dates.
3623
+ # @example
3624
+ # begin
3625
+ # export_dates = @client.get_export_dates()
3626
+ # export_dates.dates.each do |date|
3627
+ # puts "Exports are available for: #{date}"
3628
+ # end
3629
+ # rescue Recurly::Errors::NotFoundError
3630
+ # # If the resource was not found, you may want to alert the user or
3631
+ # # just return nil
3632
+ # puts "Resource Not Found"
3633
+ # end
3634
+ #
3635
+ def get_export_dates(**options)
3636
+ path = interpolate_path("/export_dates")
3637
+ get(path, **options)
3638
+ end
3639
+
3640
+ # List of the export files that are available to download.
3641
+ #
3642
+ # {https://developers.recurly.com/api/v2019-10-10#operation/get_export_files get_export_files api documenation}
3643
+ #
3644
+ # @param export_date [String] Date for which to get a list of available automated export files. Date must be in YYYY-MM-DD format.
3645
+ # @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+.
3646
+ #
3647
+ # @return [Resources::ExportFiles] Returns a list of export files to download.
3648
+ # @example
3649
+ # begin
3650
+ # export_files = @client.get_export_files(export_date: export_date)
3651
+ # export_files.files.each do |file|
3652
+ # puts "Export file download URL: #{file.href}"
3653
+ # end
3654
+ # rescue Recurly::Errors::NotFoundError
3655
+ # # If the resource was not found, you may want to alert the user or
3656
+ # # just return nil
3657
+ # puts "Resource Not Found"
3658
+ # end
3659
+ #
3660
+ def get_export_files(export_date:, **options)
3661
+ path = interpolate_path("/export_dates/{export_date}/export_files", export_date: export_date)
3662
+ get(path, **options)
3663
+ end
3284
3664
  end
3285
3665
  end