Class: CyberSourceMergedSpec::ReportDownloadsController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/controllers/report_downloads_controller.rb

Overview

ReportDownloadsController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters

Constructor Details

This class inherits a constructor from CyberSourceMergedSpec::BaseController

Instance Method Details

#download_report(report_date, report_name, organization_id: nil) ⇒ ApiResponse

Download a report using the unique report name and date. download the report in ISO 8601 format Please refer the following link to know more about ISO 8601 format.[Rfc Date Format](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor 14) Example date format: yyyy-mm-dd For reports that span multiple days, this value would be the end date of the report in the time zone of the report subscription. Example 1: If your report start date is 2020-03-06 and the end date is 2020-03-09, the reportDate passed in the query is 2020-03-09. Example 2: If your report runs from midnight to midnight on 2020-03-09, the reportDate passed in the query is 2020-03-10 download Id

Parameters:

  • report_date (Date)

    Required parameter: Valid date on which to

  • report_name (String)

    Required parameter: Name of the report to

  • organization_id (String) (defaults to: nil)

    Optional parameter: Valid Organization

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/cyber_source_merged_spec/controllers/report_downloads_controller.rb', line 25

def download_report(report_date,
                    report_name,
                    organization_id: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/reporting/v3/report-downloads',
                                 Server::DEFAULT)
               .query_param(new_parameter(report_date, key: 'reportDate')
                             .is_required(true))
               .query_param(new_parameter(report_name, key: 'reportName')
                             .is_required(true))
               .query_param(new_parameter(organization_id, key: 'organizationId'))
               .header_param(new_parameter('application/json', key: 'accept')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true)
                .local_error('400',
                             'Invalid Request',
                             Reportingv3ReportDownloadsGet400ResponseException)
                .local_error('404',
                             'No Reports Found',
                             APIException))
    .execute
end