Class: CyberSourceMergedSpec::ReportDefinitionsController

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

Overview

ReportDefinitionsController

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_resource_info_by_report_definition(report_definition_name, subscription_type: nil, report_mime_type: nil, organization_id: nil) ⇒ ApiResponse

View the attributes of an individual report type. For a list of values for reportDefinitionName, see the [Reporting Developer Guide](https://www.cybersource.com/developers/documentation/reporting_and_ reconciliation/) Report definition to retrieve type for which report definition is required. By default the type will be CUSTOM. Valid Values: - CLASSIC - CUSTOM - STANDARD the report definition is required. By default the value will be CSV. Valid Values: - application/xml - text/csv Id

Parameters:

  • report_definition_name (String)

    Required parameter: Name of the

  • subscription_type (String) (defaults to: nil)

    Optional parameter: The subscription

  • report_mime_type (String) (defaults to: nil)

    Optional parameter: The format for which

  • organization_id (String) (defaults to: nil)

    Optional parameter: Valid Organization

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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

def get_resource_info_by_report_definition(report_definition_name,
                                           subscription_type: nil,
                                           report_mime_type: nil,
                                           organization_id: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/reporting/v3/report-definitions/{reportDefinitionName}',
                                 Server::DEFAULT)
               .template_param(new_parameter(report_definition_name, key: 'reportDefinitionName')
                                .is_required(true)
                                .should_encode(true))
               .query_param(new_parameter(subscription_type, key: 'subscriptionType'))
               .query_param(new_parameter(report_mime_type, key: 'reportMimeType'))
               .query_param(new_parameter(organization_id, key: 'organizationId'))
               .header_param(new_parameter('application/json', key: 'accept')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(ReportingV3ReportDefinitionsNameGet200Response.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Invalid request',
                             ReportingV3ReportDefinitionsNameGet400ResponseException)
                .local_error('404',
                             'Report not found',
                             APIException))
    .execute
end

#get_resource_v2_info(subscription_type: nil, organization_id: nil) ⇒ ApiResponse

View a list of supported reports and their attributes before subscribing to them. CLASSIC - CUSTOM - STANDARD Id

Parameters:

  • subscription_type (String) (defaults to: nil)

    Optional parameter: Valid Values: -

  • organization_id (String) (defaults to: nil)

    Optional parameter: Valid Organization

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/cyber_source_merged_spec/controllers/report_definitions_controller.rb', line 59

def get_resource_v2_info(subscription_type: nil,
                         organization_id: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/reporting/v3/report-definitions',
                                 Server::DEFAULT)
               .query_param(new_parameter(subscription_type, key: 'subscriptionType'))
               .query_param(new_parameter(organization_id, key: 'organizationId'))
               .header_param(new_parameter('application/json', key: 'accept')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(ReportingV3ReportDefinitionsGet200Response.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Invalid request',
                             ReportingV3ReportDefinitionsGet400ResponseException)
                .local_error('404',
                             'Report not found',
                             APIException))
    .execute
end