Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ReportRun#contents to get the actual report data #1157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions lib/stripe/resources/reporting/report_run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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