Class: CyberSourceMergedSpec::DownloadXsdController

Inherits:
BaseController show all
Defined in:
lib/cyber_source_merged_spec/controllers/download_xsd_controller.rb

Overview

DownloadXsdController

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

#get_xsdv2(report_definition_name_version) ⇒ ApiResponse

Used to download XSDs for reports on no-auth. and version of XSD file to download. Some XSDs only have one version. In that case version name is not needed. Some example values are DecisionManagerDetailReport, DecisionManagerTypes

Parameters:

  • report_definition_name_version (String)

    Required parameter: Name

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/cyber_source_merged_spec/controllers/download_xsd_controller.rb', line 15

def get_xsdv2(report_definition_name_version)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/reporting/v3/xsds/{reportDefinitionNameVersion}',
                                 Server::DEFAULT)
               .template_param(new_parameter(report_definition_name_version, key: 'reportDefinitionNameVersion')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/xml', key: 'accept')))
    .response(new_response_handler
                .is_response_void(true)
                .deserialize_into(Void)
                .is_xml_response(true)
                .xml_attribute(XmlAttributes.new
                                            .root_element_name('response'))
                .is_api_response(true)
                .local_error('400',
                             'Bad request. XSD file name may be invalid',
                             APIException)
                .local_error('404',
                             'XSD file not found',
                             APIException)
                .local_error('500',
                             'Internal Server Error',
                             APIException))
    .execute
end