lib/muffin_man/reports/v20210630.rb in muffin_man-1.4.0 vs lib/muffin_man/reports/v20210630.rb in muffin_man-1.4.1
- old
+ new
@@ -71,8 +71,19 @@
report_document_id = sandbox ? SANDBOX_REPORT_DOCUMENT_ID : report_document_id
@local_var_path = "/reports/2021-06-30/documents/#{report_document_id}"
@request_type = "GET"
call_api
end
+
+ def get_report_document_body(report_document_id)
+ response = get_report_document(report_document_id)
+ parsed_response=JSON.parse(response.body)
+ report=Net::HTTP.get(URI.parse(parsed_response['url']))
+ unless (parsed_response['compressionAlgorithm']).nil?
+ input = StringIO.new(report)
+ report = Zlib::GzipReader.new(input).read
+ end
+ report
+ end
end
end
end