recurly 3.11.0 → 3.16.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7c4b3b9b2cedb2d4a270b6389398aee741897f30a51cfd00eae35746a3a7aeb
4
- data.tar.gz: ce7e3f717867391e5fe8166e20b99e245860e49cc771776162b2907849e0782f
3
+ metadata.gz: a7b4df1917c4b15c1d01a13889c926f0c262c2ca1d5ccea2d74dabd19f9a8744
4
+ data.tar.gz: 33dbffde9c280aa495676f348a103a18d40c2627b7e98f7876cdca1704e49d45
5
5
  SHA512:
6
- metadata.gz: 536849cb9480c6aedee06f854acef1a3c7da72c24fddf80adefcd58e55cdbcc743b96fd20f8cda811813d946f5d77078801595903345ed58405b54f0884ba86a
7
- data.tar.gz: 926318d0ce21e23ecaadb98a9b6ad1e4403bce42bfcc7cbb09847643ba0080832612edbfe6df7edc1c98af71ca282cb7580abf00d20a32f05b1353b852cb85b1
6
+ metadata.gz: 549b263ed42946ab85c5efa475a66c11c35d4a0ea4098f814a8096ffb6cf4ad2bb413d1ee7ae5603fea4027cbe3fcc9c7d5bd4d358203f142fa47964a3a21b99
7
+ data.tar.gz: ec7d592254799f676bdc0ca6c95e4b173c35a3535200d5f76fbeb4609600ac6639d194b8705d942e6e184b6b68fce400ce697bc0398cbfbe40bfe2ea7b4a2b15
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 3.11.0
2
+ current_version = 3.16.0
3
3
  parse = (?P<major>\d+)
4
4
  \.(?P<minor>\d+)
5
5
  \.(?P<patch>\d+)
@@ -1,8 +1,75 @@
1
1
  # Changelog
2
2
 
3
- ## [3.11.0](https://github.com/recurly/recurly-client-ruby/tree/HEAD)
3
+ ## [3.16.0](https://github.com/recurly/recurly-client-ruby/tree/HEAD)
4
4
 
5
- [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.10.0...HEAD)
5
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.15.0...HEAD)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Latest Changes for 2019-10-10 \(tax\_identifier / tax\_identifier\_type\) [\#654](https://github.com/recurly/recurly-client-ruby/pull/654) ([douglasmiller](https://github.com/douglasmiller))
10
+ - Latest Changes for 2019-10-10 [\#651](https://github.com/recurly/recurly-client-ruby/pull/651) ([douglasmiller](https://github.com/douglasmiller))
11
+
12
+ **Fixed bugs:**
13
+
14
+ - Refund API V2 Error Details [\#652](https://github.com/recurly/recurly-client-ruby/issues/652)
15
+
16
+ **Merged pull requests:**
17
+
18
+ - Release 3.16.0 [\#656](https://github.com/recurly/recurly-client-ruby/pull/656) ([douglasmiller](https://github.com/douglasmiller))
19
+
20
+ ## [3.15.0](https://github.com/recurly/recurly-client-ruby/tree/3.15.0) (2020-11-06)
21
+
22
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.14.0...3.15.0)
23
+
24
+ **Implemented enhancements:**
25
+
26
+ - Latest Changes for 2019-10-10 \(Wallet, Item Coupons\) [\#645](https://github.com/recurly/recurly-client-ruby/pull/645) ([douglasmiller](https://github.com/douglasmiller))
27
+
28
+ **Merged pull requests:**
29
+
30
+ - Release 3.15.0 [\#647](https://github.com/recurly/recurly-client-ruby/pull/647) ([douglasmiller](https://github.com/douglasmiller))
31
+
32
+ ## [3.14.0](https://github.com/recurly/recurly-client-ruby/tree/3.14.0) (2020-10-20)
33
+
34
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.13.0...3.14.0)
35
+
36
+ **Implemented enhancements:**
37
+
38
+ - 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))
39
+
40
+ **Merged pull requests:**
41
+
42
+ - Release 3.14.0 [\#643](https://github.com/recurly/recurly-client-ruby/pull/643) ([douglasmiller](https://github.com/douglasmiller))
43
+ - Fixes uninitialized constant `Recurly::Errors::ServiceNotAvailableError` [\#641](https://github.com/recurly/recurly-client-ruby/pull/641) ([ruyrocha](https://github.com/ruyrocha))
44
+
45
+ ## [3.13.0](https://github.com/recurly/recurly-client-ruby/tree/3.13.0) (2020-09-22)
46
+
47
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.12.0...3.13.0)
48
+
49
+ **Implemented enhancements:**
50
+
51
+ - 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))
52
+
53
+ **Merged pull requests:**
54
+
55
+ - Release 3.13.0 [\#639](https://github.com/recurly/recurly-client-ruby/pull/639) ([douglasmiller](https://github.com/douglasmiller))
56
+
57
+ ## [3.12.0](https://github.com/recurly/recurly-client-ruby/tree/3.12.0) (2020-08-31)
58
+
59
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.11.0...3.12.0)
60
+
61
+ **Implemented enhancements:**
62
+
63
+ - 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))
64
+
65
+ **Merged pull requests:**
66
+
67
+ - Release 3.12.0 [\#633](https://github.com/recurly/recurly-client-ruby/pull/633) ([douglasmiller](https://github.com/douglasmiller))
68
+ - Code of Conduct [\#631](https://github.com/recurly/recurly-client-ruby/pull/631) ([bhelx](https://github.com/bhelx))
69
+
70
+ ## [3.11.0](https://github.com/recurly/recurly-client-ruby/tree/3.11.0) (2020-08-21)
71
+
72
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.10.0...3.11.0)
6
73
 
7
74
  **Implemented enhancements:**
8
75
 
@@ -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.11'
8
+ gem 'recurly', '~> 3.16'
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}
@@ -471,6 +568,7 @@ module Recurly
471
568
  # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
472
569
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
473
570
  #
571
+ # @param state [String] Filter by state.
474
572
  # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
475
573
  #
476
574
  # @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions on an account.
@@ -1364,6 +1462,32 @@ module Recurly
1364
1462
  delete(path, **options)
1365
1463
  end
1366
1464
 
1465
+ # Restore an inactive coupon
1466
+ #
1467
+ # {https://developers.recurly.com/api/v2019-10-10#operation/restore_coupon restore_coupon api documenation}
1468
+ #
1469
+ # @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
1470
+ # @param body [Requests::CouponUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponUpdate}
1471
+ # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1472
+ #
1473
+ # @return [Resources::Coupon] The restored coupon.
1474
+ # @example
1475
+ # begin
1476
+ # coupon = @client.restore_coupon(coupon_id: coupon_id, body: {
1477
+ # name: "New Coupon Name"
1478
+ # })
1479
+ # puts "Restored coupon #{coupon}"
1480
+ # rescue Recurly::Errors::NotFoundError
1481
+ # # If the resource was not found, you may want to alert the user or
1482
+ # # just return nil
1483
+ # puts "Resource Not Found"
1484
+ # end
1485
+ #
1486
+ def restore_coupon(coupon_id:, body:, **options)
1487
+ path = interpolate_path("/coupons/{coupon_id}/restore", coupon_id: coupon_id)
1488
+ put(path, body, Requests::CouponUpdate, **options)
1489
+ end
1490
+
1367
1491
  # List unique coupon codes associated with a bulk coupon
1368
1492
  #
1369
1493
  # {https://developers.recurly.com/api/v2019-10-10#operation/list_unique_coupon_codes list_unique_coupon_codes api documenation}
@@ -2929,6 +3053,7 @@ module Recurly
2929
3053
  #
2930
3054
  # You may also terminate a subscription with no refund and then manually refund specific invoices.
2931
3055
  #
3056
+ # @param charge [Boolean] Applicable only if the subscription has usage based add-ons and unbilled usage logged for the current billing cycle. If true, current billing cycle unbilled usage is billed on the final invoice. If false, Recurly will create a negative usage record for current billing cycle usage that will zero out the final invoice line items.
2932
3057
  # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
2933
3058
  #
2934
3059
  # @return [Resources::Subscription] An expired subscription.
@@ -3597,5 +3722,54 @@ module Recurly
3597
3722
  path = interpolate_path("/purchases/preview")
3598
3723
  post(path, body, Requests::PurchaseCreate, **options)
3599
3724
  end
3725
+
3726
+ # List the dates that have an available export to download.
3727
+ #
3728
+ # {https://developers.recurly.com/api/v2019-10-10#operation/get_export_dates get_export_dates api documenation}
3729
+ #
3730
+ # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3731
+ #
3732
+ # @return [Resources::ExportDates] Returns a list of dates.
3733
+ # @example
3734
+ # begin
3735
+ # export_dates = @client.get_export_dates()
3736
+ # export_dates.dates.each do |date|
3737
+ # puts "Exports are available for: #{date}"
3738
+ # end
3739
+ # rescue Recurly::Errors::NotFoundError
3740
+ # # If the resource was not found, you may want to alert the user or
3741
+ # # just return nil
3742
+ # puts "Resource Not Found"
3743
+ # end
3744
+ #
3745
+ def get_export_dates(**options)
3746
+ path = interpolate_path("/export_dates")
3747
+ get(path, **options)
3748
+ end
3749
+
3750
+ # List of the export files that are available to download.
3751
+ #
3752
+ # {https://developers.recurly.com/api/v2019-10-10#operation/get_export_files get_export_files api documenation}
3753
+ #
3754
+ # @param export_date [String] Date for which to get a list of available automated export files. Date must be in YYYY-MM-DD format.
3755
+ # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3756
+ #
3757
+ # @return [Resources::ExportFiles] Returns a list of export files to download.
3758
+ # @example
3759
+ # begin
3760
+ # export_files = @client.get_export_files(export_date: export_date)
3761
+ # export_files.files.each do |file|
3762
+ # puts "Export file download URL: #{file.href}"
3763
+ # end
3764
+ # rescue Recurly::Errors::NotFoundError
3765
+ # # If the resource was not found, you may want to alert the user or
3766
+ # # just return nil
3767
+ # puts "Resource Not Found"
3768
+ # end
3769
+ #
3770
+ def get_export_files(export_date:, **options)
3771
+ path = interpolate_path("/export_dates/{export_date}/export_files", export_date: export_date)
3772
+ get(path, **options)
3773
+ end
3600
3774
  end
3601
3775
  end