recurly 3.10.0 → 3.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.bumpversion.cfg +1 -2
  3. data/CHANGELOG.md +64 -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 +173 -0
  10. data/lib/recurly/errors/api_errors.rb +2 -0
  11. data/lib/recurly/requests/add_on_create.rb +10 -2
  12. data/lib/recurly/requests/add_on_update.rb +8 -0
  13. data/lib/recurly/requests/billing_info_create.rb +4 -0
  14. data/lib/recurly/requests/coupon_create.rb +9 -1
  15. data/lib/recurly/requests/invoice_collect.rb +4 -0
  16. data/lib/recurly/requests/item_create.rb +8 -0
  17. data/lib/recurly/requests/item_update.rb +8 -0
  18. data/lib/recurly/requests/line_item_create.rb +9 -1
  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 +2 -2
  23. data/lib/recurly/requests/subscription_change_create.rb +5 -1
  24. data/lib/recurly/requests/subscription_update.rb +4 -0
  25. data/lib/recurly/resources/add_on.rb +8 -0
  26. data/lib/recurly/resources/billing_info.rb +4 -0
  27. data/lib/recurly/resources/coupon.rb +17 -1
  28. data/lib/recurly/resources/export_dates.rb +18 -0
  29. data/lib/recurly/resources/export_file.rb +22 -0
  30. data/lib/recurly/resources/export_files.rb +18 -0
  31. data/lib/recurly/resources/invoice.rb +4 -0
  32. data/lib/recurly/resources/item.rb +8 -0
  33. data/lib/recurly/resources/line_item.rb +8 -0
  34. data/lib/recurly/resources/plan.rb +8 -0
  35. data/lib/recurly/resources/subscription.rb +4 -0
  36. data/lib/recurly/resources/subscription_change.rb +4 -0
  37. data/lib/recurly/resources/subscription_change_preview.rb +4 -0
  38. data/lib/recurly/resources/unique_coupon_code.rb +8 -0
  39. data/lib/recurly/resources/usage.rb +8 -0
  40. data/lib/recurly/version.rb +1 -1
  41. data/openapi/api.yaml +924 -45
  42. metadata +10 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7d857cb4a3518eff0cb56f9518a8f93b2829ac45d65f4d6f429e10daa3eae5d
4
- data.tar.gz: cb9e846114ce261826384d9b31c07e3bea034b66c9b620f282881bf54da4bbdc
3
+ metadata.gz: ecaa5f1cc2110480aac4355c469c84d7a423badce1a4860cd494ab9e4966a118
4
+ data.tar.gz: b5c805224d670c22eed575410d51af2e801279f7f5dae0d274d84ecc60731363
5
5
  SHA512:
6
- metadata.gz: d7fd02b347d535184984466a90f912175ee66c2430d3be37b709bb5111f54ee431a69d92973f1c956e54b6fbfaf541e273c3de32e0314fecdb2cb9bf1f118a37
7
- data.tar.gz: 6b00f68f2b06058c1a6591cbee95b0f25cfb4cdfd269b627209464955dc3078fbbdedf66f3ca1df94e17382d0067345f6440cb0f00590e976d368654c5fd7a21
6
+ metadata.gz: 322cf51b9d06fb661860d02603896a370b92b0292eae793a1ec911bd5528f8452180e76a80199f0f938b9ff4f7c8458001941a18f899c3bdfdd6b49aaf6e0963
7
+ data.tar.gz: 2cace6d2929076220ae9f029865a9bc6ca73e66edd0bafb66bce496e5e70985bb1da9a72fa0265c659c725a187a1fdc42730b696524bc1a66bdd84495ccc6958
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 3.10.0
2
+ current_version = 3.15.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,70 @@
1
1
  # Changelog
2
2
 
3
- ## [3.10.0](https://github.com/recurly/recurly-client-ruby/tree/HEAD)
3
+ ## [3.15.0](https://github.com/recurly/recurly-client-ruby/tree/HEAD)
4
4
 
5
- [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.9.0...HEAD)
5
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.14.0...HEAD)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Latest Changes for 2019-10-10 \(Wallet, Item Coupons\) [\#645](https://github.com/recurly/recurly-client-ruby/pull/645) ([douglasmiller](https://github.com/douglasmiller))
10
+
11
+ **Merged pull requests:**
12
+
13
+ - Release 3.15.0 [\#647](https://github.com/recurly/recurly-client-ruby/pull/647) ([douglasmiller](https://github.com/douglasmiller))
14
+
15
+ ## [3.14.0](https://github.com/recurly/recurly-client-ruby/tree/3.14.0) (2020-10-20)
16
+
17
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.13.0...3.14.0)
18
+
19
+ **Implemented enhancements:**
20
+
21
+ - 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))
22
+
23
+ **Merged pull requests:**
24
+
25
+ - Release 3.14.0 [\#643](https://github.com/recurly/recurly-client-ruby/pull/643) ([douglasmiller](https://github.com/douglasmiller))
26
+ - Fixes uninitialized constant `Recurly::Errors::ServiceNotAvailableError` [\#641](https://github.com/recurly/recurly-client-ruby/pull/641) ([ruyrocha](https://github.com/ruyrocha))
27
+
28
+ ## [3.13.0](https://github.com/recurly/recurly-client-ruby/tree/3.13.0) (2020-09-22)
29
+
30
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.12.0...3.13.0)
31
+
32
+ **Implemented enhancements:**
33
+
34
+ - 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))
35
+
36
+ **Merged pull requests:**
37
+
38
+ - Release 3.13.0 [\#639](https://github.com/recurly/recurly-client-ruby/pull/639) ([douglasmiller](https://github.com/douglasmiller))
39
+
40
+ ## [3.12.0](https://github.com/recurly/recurly-client-ruby/tree/3.12.0) (2020-08-31)
41
+
42
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.11.0...3.12.0)
43
+
44
+ **Implemented enhancements:**
45
+
46
+ - 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))
47
+
48
+ **Merged pull requests:**
49
+
50
+ - Release 3.12.0 [\#633](https://github.com/recurly/recurly-client-ruby/pull/633) ([douglasmiller](https://github.com/douglasmiller))
51
+ - Code of Conduct [\#631](https://github.com/recurly/recurly-client-ruby/pull/631) ([bhelx](https://github.com/bhelx))
52
+
53
+ ## [3.11.0](https://github.com/recurly/recurly-client-ruby/tree/3.11.0) (2020-08-21)
54
+
55
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.10.0...3.11.0)
56
+
57
+ **Implemented enhancements:**
58
+
59
+ - 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))
60
+
61
+ **Merged pull requests:**
62
+
63
+ - Release 3.11.0 [\#630](https://github.com/recurly/recurly-client-ruby/pull/630) ([douglasmiller](https://github.com/douglasmiller))
64
+
65
+ ## [3.10.0](https://github.com/recurly/recurly-client-ruby/tree/3.10.0) (2020-07-31)
66
+
67
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.9.0...3.10.0)
6
68
 
7
69
  **Implemented enhancements:**
8
70
 
@@ -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.10'
8
+ gem 'recurly', '~> 3.15'
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)
@@ -444,6 +444,103 @@ module Recurly
444
444
  delete(path, **options)
445
445
  end
446
446
 
447
+ # Get the list of billing information associated with an account
448
+ #
449
+ # {https://developers.recurly.com/api/v2019-10-10#operation/list_billing_infos list_billing_infos api documenation}
450
+ #
451
+ # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
452
+ # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
453
+ # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
454
+ #
455
+ # *Important notes:*
456
+ #
457
+ # * The +ids+ parameter cannot be used with any other ordering or filtering
458
+ # parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
459
+ # * Invalid or unknown IDs will be ignored, so you should check that the
460
+ # results correspond to your request.
461
+ # * Records are returned in an arbitrary order. Since results are all
462
+ # returned at once you can sort the records yourself.
463
+ #
464
+ # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
465
+ # order. In descending order updated records will move behind the cursor and could
466
+ # prevent some records from being returned.
467
+ #
468
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
469
+ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
470
+ #
471
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
472
+ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
473
+ #
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
+ #
476
+ # @return [Pager<Resources::BillingInfo>] A list of the the billing information for an account's
477
+ #
478
+ def list_billing_infos(account_id:, **options)
479
+ path = interpolate_path("/accounts/{account_id}/billing_infos", account_id: account_id)
480
+ pager(path, **options)
481
+ end
482
+
483
+ # Set an account's billing information when the wallet feature is enabled
484
+ #
485
+ # {https://developers.recurly.com/api/v2019-10-10#operation/create_billing_info create_billing_info api documenation}
486
+ #
487
+ # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
488
+ # @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
489
+ # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
490
+ #
491
+ # @return [Resources::BillingInfo] Updated billing information.
492
+ #
493
+ def create_billing_info(account_id:, body:, **options)
494
+ path = interpolate_path("/accounts/{account_id}/billing_infos", account_id: account_id)
495
+ post(path, body, Requests::BillingInfoCreate, **options)
496
+ end
497
+
498
+ # Fetch a billing info
499
+ #
500
+ # {https://developers.recurly.com/api/v2019-10-10#operation/get_a_billing_info get_a_billing_info api documenation}
501
+ #
502
+ # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
503
+ # @param billing_info_id [String] Billing Info ID.
504
+ # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
505
+ #
506
+ # @return [Resources::BillingInfo] A billing info.
507
+ #
508
+ def get_a_billing_info(account_id:, billing_info_id:, **options)
509
+ path = interpolate_path("/accounts/{account_id}/billing_infos/{billing_info_id}", account_id: account_id, billing_info_id: billing_info_id)
510
+ get(path, **options)
511
+ end
512
+
513
+ # Update an account's billing information
514
+ #
515
+ # {https://developers.recurly.com/api/v2019-10-10#operation/update_a_billing_info update_a_billing_info api documenation}
516
+ #
517
+ # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
518
+ # @param billing_info_id [String] Billing Info ID.
519
+ # @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
520
+ # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
521
+ #
522
+ # @return [Resources::BillingInfo] Updated billing information.
523
+ #
524
+ def update_a_billing_info(account_id:, billing_info_id:, body:, **options)
525
+ path = interpolate_path("/accounts/{account_id}/billing_infos/{billing_info_id}", account_id: account_id, billing_info_id: billing_info_id)
526
+ put(path, body, Requests::BillingInfoCreate, **options)
527
+ end
528
+
529
+ # Remove an account's billing information
530
+ #
531
+ # {https://developers.recurly.com/api/v2019-10-10#operation/remove_a_billing_info remove_a_billing_info api documenation}
532
+ #
533
+ # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
534
+ # @param billing_info_id [String] Billing Info ID.
535
+ # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
536
+ #
537
+ # @return [Resources::Empty] Billing information deleted
538
+ #
539
+ def remove_a_billing_info(account_id:, billing_info_id:, **options)
540
+ path = interpolate_path("/accounts/{account_id}/billing_infos/{billing_info_id}", account_id: account_id, billing_info_id: billing_info_id)
541
+ delete(path, **options)
542
+ end
543
+
447
544
  # Show the coupon redemptions for an account
448
545
  #
449
546
  # {https://developers.recurly.com/api/v2019-10-10#operation/list_account_coupon_redemptions list_account_coupon_redemptions api documenation}
@@ -1364,6 +1461,21 @@ module Recurly
1364
1461
  delete(path, **options)
1365
1462
  end
1366
1463
 
1464
+ # Restore an inactive coupon
1465
+ #
1466
+ # {https://developers.recurly.com/api/v2019-10-10#operation/restore_coupon restore_coupon api documenation}
1467
+ #
1468
+ # @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+.
1469
+ # @param body [Requests::CouponUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponUpdate}
1470
+ # @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+.
1471
+ #
1472
+ # @return [Resources::Coupon] The restored coupon.
1473
+ #
1474
+ def restore_coupon(coupon_id:, body:, **options)
1475
+ path = interpolate_path("/coupons/{coupon_id}/restore", coupon_id: coupon_id)
1476
+ put(path, body, Requests::CouponUpdate, **options)
1477
+ end
1478
+
1367
1479
  # List unique coupon codes associated with a bulk coupon
1368
1480
  #
1369
1481
  # {https://developers.recurly.com/api/v2019-10-10#operation/list_unique_coupon_codes list_unique_coupon_codes api documenation}
@@ -3316,6 +3428,18 @@ module Recurly
3316
3428
  #
3317
3429
  # @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+.
3318
3430
  # @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+.
3431
+ # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
3432
+ # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
3433
+ #
3434
+ # *Important notes:*
3435
+ #
3436
+ # * The +ids+ parameter cannot be used with any other ordering or filtering
3437
+ # parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
3438
+ # * Invalid or unknown IDs will be ignored, so you should check that the
3439
+ # results correspond to your request.
3440
+ # * Records are returned in an arbitrary order. Since results are all
3441
+ # returned at once you can sort the records yourself.
3442
+ #
3319
3443
  # @param limit [Integer] Limit number of records 1-200.
3320
3444
  # @param order [String] Sort order.
3321
3445
  # @param sort [String] Sort field. You *really* only want to sort by +usage_timestamp+ in ascending
@@ -3585,5 +3709,54 @@ module Recurly
3585
3709
  path = interpolate_path("/purchases/preview")
3586
3710
  post(path, body, Requests::PurchaseCreate, **options)
3587
3711
  end
3712
+
3713
+ # List the dates that have an available export to download.
3714
+ #
3715
+ # {https://developers.recurly.com/api/v2019-10-10#operation/get_export_dates get_export_dates api documenation}
3716
+ #
3717
+ # @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+.
3718
+ #
3719
+ # @return [Resources::ExportDates] Returns a list of dates.
3720
+ # @example
3721
+ # begin
3722
+ # export_dates = @client.get_export_dates()
3723
+ # export_dates.dates.each do |date|
3724
+ # puts "Exports are available for: #{date}"
3725
+ # end
3726
+ # rescue Recurly::Errors::NotFoundError
3727
+ # # If the resource was not found, you may want to alert the user or
3728
+ # # just return nil
3729
+ # puts "Resource Not Found"
3730
+ # end
3731
+ #
3732
+ def get_export_dates(**options)
3733
+ path = interpolate_path("/export_dates")
3734
+ get(path, **options)
3735
+ end
3736
+
3737
+ # List of the export files that are available to download.
3738
+ #
3739
+ # {https://developers.recurly.com/api/v2019-10-10#operation/get_export_files get_export_files api documenation}
3740
+ #
3741
+ # @param export_date [String] Date for which to get a list of available automated export files. Date must be in YYYY-MM-DD format.
3742
+ # @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+.
3743
+ #
3744
+ # @return [Resources::ExportFiles] Returns a list of export files to download.
3745
+ # @example
3746
+ # begin
3747
+ # export_files = @client.get_export_files(export_date: export_date)
3748
+ # export_files.files.each do |file|
3749
+ # puts "Export file download URL: #{file.href}"
3750
+ # end
3751
+ # rescue Recurly::Errors::NotFoundError
3752
+ # # If the resource was not found, you may want to alert the user or
3753
+ # # just return nil
3754
+ # puts "Resource Not Found"
3755
+ # end
3756
+ #
3757
+ def get_export_files(export_date:, **options)
3758
+ path = interpolate_path("/export_dates/{export_date}/export_files", export_date: export_date)
3759
+ get(path, **options)
3760
+ end
3588
3761
  end
3589
3762
  end