From 140203e35a3955361be01a191b31f85cf965ea2b Mon Sep 17 00:00:00 2001 From: Will Bryant Date: Mon, 19 Dec 2022 21:13:23 +1300 Subject: [PATCH] Add ReportRun#contents to get the actual report data --- lib/stripe/resources/reporting/report_run.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/stripe/resources/reporting/report_run.rb b/lib/stripe/resources/reporting/report_run.rb index 29cd6d566..edc0f8909 100644 --- a/lib/stripe/resources/reporting/report_run.rb +++ b/lib/stripe/resources/reporting/report_run.rb @@ -16,6 +16,24 @@ class ReportRun < APIResource extend Stripe::APIOperations::List OBJECT_NAME = "reporting.report_run" + + def contents(params = {}, opts = {}, &read_body_chunk_block) + unless block_given? + raise ArgumentError, "A read_body_chunk_block block parameter is required when calling the contents method." + end + + config = opts[:client]&.config || Stripe.config + + request_stream( + method: :get, + path: "/v1/files/#{result.id}/contents", + params: params, + opts: { + api_base: config.uploads_base, + }.merge(opts), + &read_body_chunk_block + ) + end end end end