Class: MethodRuby::Resources::Reports::Download
- Inherits:
-
Object
- Object
- MethodRuby::Resources::Reports::Download
- Defined in:
- lib/method_ruby/resources/reports/download.rb
Overview
Downloadable reports
Instance Method Summary collapse
-
#initialize(client:) ⇒ Download
constructor
private
A new instance of Download.
-
#retrieve(report_id, method_version:, request_options: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::Reports::DownloadRetrieveParams for more details.
Constructor Details
#initialize(client:) ⇒ Download
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Download.
39 40 41 |
# File 'lib/method_ruby/resources/reports/download.rb', line 39 def initialize(client:) @client = client end |
Instance Method Details
#retrieve(report_id, method_version:, request_options: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::Reports::DownloadRetrieveParams for more details.
Returns the completed report as a CSV file attachment.
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/method_ruby/resources/reports/download.rb', line 24 def retrieve(report_id, params) parsed, = MethodRuby::Reports::DownloadRetrieveParams.dump_request(params) @client.request( method: :get, path: ["reports/%1$s/download", report_id], headers: {"accept" => "text/csv", **parsed}.transform_keys(method_version: "method-version"), model: MethodRuby::Internal::Type::FileInput, security: {secret_key: true}, options: ) end |