Class: CyberSourceMergedSpec::DownloadDtdController

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

Overview

DownloadDtdController

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_dtdv2(report_definition_name_version) ⇒ ApiResponse

Used to download DTDs for reports on no-auth. and version of DTD file to download. Some DTDs only have one version. In that case version name is not needed. Some example values are ctdr-1.0, tdr, pbdr-1.1

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_dtd_controller.rb', line 15

def get_dtdv2(report_definition_name_version)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/reporting/v3/dtds/{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. DTD file name may be invalid',
                             APIException)
                .local_error('404',
                             'DTD file not found',
                             APIException)
                .local_error('500',
                             'Internal Server Error',
                             APIException))
    .execute
end