class CyberSource::ReportsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default, config) click to toggle source
# File lib/cybersource_rest_client/api/reports_api.rb, line 19
def initialize(api_client = ApiClient.default, config)
  @api_client = api_client
      @api_client.set_configuration(config)
end

Public Instance Methods

create_report(create_adhoc_report_request, opts = {}) click to toggle source

Create Adhoc Report Create a one-time report. You must specify the type of report in reportDefinitionName. For a list of values for reportDefinitionName, see the [Reporting Developer Guide](www.cybersource.com/developers/documentation/reporting_and_reconciliation) @param create_adhoc_report_request Report subscription request payload @param [Hash] opts the optional parameters @option opts [String] :organization_id Valid Cybersource Organization Id @return [nil]

# File lib/cybersource_rest_client/api/reports_api.rb, line 29
def create_report(create_adhoc_report_request, opts = {})
  data, status_code, headers = create_report_with_http_info(create_adhoc_report_request, opts)
  return data, status_code, headers
end
create_report_with_http_info(create_adhoc_report_request, opts = {}) click to toggle source

Create Adhoc Report Create a one-time report. You must specify the type of report in reportDefinitionName. For a list of values for reportDefinitionName, see the [Reporting Developer Guide](www.cybersource.com/developers/documentation/reporting_and_reconciliation) @param create_adhoc_report_request Report subscription request payload @param [Hash] opts the optional parameters @option opts [String] :organization_id Valid Cybersource Organization Id @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/cybersource_rest_client/api/reports_api.rb, line 40
def create_report_with_http_info(create_adhoc_report_request, opts = {})
  
      if @api_client.config.debugging
           begin
                    raise
                            @api_client.config.logger.debug 'Calling API: ReportsApi.create_report ...'
                    rescue
                            puts 'Cannot write to log'
                    end
  end
  # verify the required parameter 'create_adhoc_report_request' is set
  if @api_client.config.client_side_validation && create_adhoc_report_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_adhoc_report_request' when calling ReportsApi.create_report"
  end
  if @api_client.config.client_side_validation && !opts[:'organization_id'].nil? && opts[:'organization_id'].to_s.length > 32
    fail ArgumentError, 'invalid value for "opts[:"organization_id"]" when calling ReportsApi.create_report, the character length must be smaller than or equal to 32.'
  end

  if @api_client.config.client_side_validation && !opts[:'organization_id'].nil? && opts[:'organization_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"organization_id"]" when calling ReportsApi.create_report, the character length must be great than or equal to 1.'
  end

  #if @api_client.config.client_side_validation && !opts[:'organization_id'].nil? && opts[:'organization_id'] !~ Regexp.new(/[a-zA-Z0-9-_]+/)
    #fail ArgumentError, "invalid value for 'opts[:\"organization_id\"]' when calling ReportsApi.create_report, must conform to the pattern /[a-zA-Z0-9-_]+/."
  #end

  # resource path
  local_var_path = 'reporting/v3/reports'

  # query parameters
  query_params = {}
  query_params[:'organizationId'] = opts[:'organization_id'] if !opts[:'organization_id'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(create_adhoc_report_request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
            begin
            raise
                    @api_client.config.logger.debug "API called: ReportsApi#create_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
            rescue
                    puts 'Cannot write to log'
            end
      end
  return data, status_code, headers
end
get_report_by_report_id(report_id, opts = {}) click to toggle source

Get Report Based on Report Id Download a report using the reportId value. If you don’t already know this value, you can obtain it using the Retrieve available reports call. @param report_id Valid Report Id @param [Hash] opts the optional parameters @option opts [String] :organization_id Valid Cybersource Organization Id @return [ReportingV3ReportsIdGet200Response]

# File lib/cybersource_rest_client/api/reports_api.rb, line 108
def get_report_by_report_id(report_id, opts = {})
  data, status_code, headers = get_report_by_report_id_with_http_info(report_id, opts)
  return data, status_code, headers
end
get_report_by_report_id_with_http_info(report_id, opts = {}) click to toggle source

Get Report Based on Report Id Download a report using the reportId value. If you don’t already know this value, you can obtain it using the Retrieve available reports call. @param report_id Valid Report Id @param [Hash] opts the optional parameters @option opts [String] :organization_id Valid Cybersource Organization Id @return [Array<(ReportingV3ReportsIdGet200Response, Fixnum, Hash)>] ReportingV3ReportsIdGet200Response data, response status code and response headers

# File lib/cybersource_rest_client/api/reports_api.rb, line 119
def get_report_by_report_id_with_http_info(report_id, opts = {})
  
      if @api_client.config.debugging
           begin
                    raise
                            @api_client.config.logger.debug 'Calling API: ReportsApi.get_report_by_report_id ...'
                    rescue
                            puts 'Cannot write to log'
                    end
  end
  # verify the required parameter 'report_id' is set
  if @api_client.config.client_side_validation && report_id.nil?
    fail ArgumentError, "Missing the required parameter 'report_id' when calling ReportsApi.get_report_by_report_id"
  end
  if @api_client.config.client_side_validation && !opts[:'organization_id'].nil? && opts[:'organization_id'].to_s.length > 32
    fail ArgumentError, 'invalid value for "opts[:"organization_id"]" when calling ReportsApi.get_report_by_report_id, the character length must be smaller than or equal to 32.'
  end

  if @api_client.config.client_side_validation && !opts[:'organization_id'].nil? && opts[:'organization_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"organization_id"]" when calling ReportsApi.get_report_by_report_id, the character length must be great than or equal to 1.'
  end

  #if @api_client.config.client_side_validation && !opts[:'organization_id'].nil? && opts[:'organization_id'] !~ Regexp.new(/[a-zA-Z0-9-_]+/)
    #fail ArgumentError, "invalid value for 'opts[:\"organization_id\"]' when calling ReportsApi.get_report_by_report_id, must conform to the pattern /[a-zA-Z0-9-_]+/."
  #end

  # resource path
  local_var_path = 'reporting/v3/reports/{reportId}'.sub('{' + 'reportId' + '}', report_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizationId'] = opts[:'organization_id'] if !opts[:'organization_id'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json', 'application/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ReportingV3ReportsIdGet200Response')
  if @api_client.config.debugging
            begin
            raise
                    @api_client.config.logger.debug "API called: ReportsApi#get_report_by_report_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
            rescue
                    puts 'Cannot write to log'
            end
      end
  return data, status_code, headers
end
search_reports(start_time, end_time, time_query_type, opts = {}) click to toggle source

Retrieve Available Reports Retrieve a list of the available reports to which you are subscribed. This will also give you the reportId value, which you can also use to download a report. @param start_time Valid report Start Time in **ISO 8601 format** Please refer the following link to know more about ISO 8601 format.[Rfc Date Format](xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) **Example date format:** - yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSSZ (e.g. 2018-01-01T00:00:00.000Z) @param end_time Valid report End Time in **ISO 8601 format** Please refer the following link to know more about ISO 8601 format.[Rfc Date Format](xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) **Example date format:** - yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSSZ (e.g. 2018-01-01T00:00:00.000Z) @param time_query_type Specify time you would like to search Valid values: - reportTimeFrame - executedTime @param [Hash] opts the optional parameters @option opts [String] :organization_id Valid Cybersource Organization Id @option opts [String] :report_mime_type Valid Report Format Valid values: - application/xml - text/csv @option opts [String] :report_frequency Valid Report Frequency Valid values: - DAILY - WEEKLY - MONTHLY - USER_DEFINED - ADHOC @option opts [String] :report_name Valid Report Name @option opts [Integer] :report_definition_id Valid Report Definition Id @option opts [String] :report_status Valid Report Status Valid values: - COMPLETED - PENDING - QUEUED - RUNNING - ERROR - NO_DATA @return [ReportingV3ReportsGet200Response]

# File lib/cybersource_rest_client/api/reports_api.rb, line 195
def search_reports(start_time, end_time, time_query_type, opts = {})
  data, status_code, headers = search_reports_with_http_info(start_time, end_time, time_query_type, opts)
  return data, status_code, headers
end
search_reports_with_http_info(start_time, end_time, time_query_type, opts = {}) click to toggle source

Retrieve Available Reports Retrieve a list of the available reports to which you are subscribed. This will also give you the reportId value, which you can also use to download a report. @param start_time Valid report Start Time in **ISO 8601 format** Please refer the following link to know more about ISO 8601 format.[Rfc Date Format](xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) **Example date format:** - yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSSZ (e.g. 2018-01-01T00:00:00.000Z) @param end_time Valid report End Time in **ISO 8601 format** Please refer the following link to know more about ISO 8601 format.[Rfc Date Format](xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) **Example date format:** - yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSSZ (e.g. 2018-01-01T00:00:00.000Z) @param time_query_type Specify time you would like to search Valid values: - reportTimeFrame - executedTime @param [Hash] opts the optional parameters @option opts [String] :organization_id Valid Cybersource Organization Id @option opts [String] :report_mime_type Valid Report Format Valid values: - application/xml - text/csv @option opts [String] :report_frequency Valid Report Frequency Valid values: - DAILY - WEEKLY - MONTHLY - USER_DEFINED - ADHOC @option opts [String] :report_name Valid Report Name @option opts [Integer] :report_definition_id Valid Report Definition Id @option opts [String] :report_status Valid Report Status Valid values: - COMPLETED - PENDING - QUEUED - RUNNING - ERROR - NO_DATA @return [Array<(ReportingV3ReportsGet200Response, Fixnum, Hash)>] ReportingV3ReportsGet200Response data, response status code and response headers

# File lib/cybersource_rest_client/api/reports_api.rb, line 213
def search_reports_with_http_info(start_time, end_time, time_query_type, opts = {})
  
      if @api_client.config.debugging
           begin
                    raise
                            @api_client.config.logger.debug 'Calling API: ReportsApi.search_reports ...'
                    rescue
                            puts 'Cannot write to log'
                    end
  end
  # verify the required parameter 'start_time' is set
  if @api_client.config.client_side_validation && start_time.nil?
    fail ArgumentError, "Missing the required parameter 'start_time' when calling ReportsApi.search_reports"
  end
  # verify the required parameter 'end_time' is set
  if @api_client.config.client_side_validation && end_time.nil?
    fail ArgumentError, "Missing the required parameter 'end_time' when calling ReportsApi.search_reports"
  end
  # verify the required parameter 'time_query_type' is set
  if @api_client.config.client_side_validation && time_query_type.nil?
    fail ArgumentError, "Missing the required parameter 'time_query_type' when calling ReportsApi.search_reports"
  end
  if @api_client.config.client_side_validation && !opts[:'organization_id'].nil? && opts[:'organization_id'].to_s.length > 32
    fail ArgumentError, 'invalid value for "opts[:"organization_id"]" when calling ReportsApi.search_reports, the character length must be smaller than or equal to 32.'
  end

  if @api_client.config.client_side_validation && !opts[:'organization_id'].nil? && opts[:'organization_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"organization_id"]" when calling ReportsApi.search_reports, the character length must be great than or equal to 1.'
  end

  #if @api_client.config.client_side_validation && !opts[:'organization_id'].nil? && opts[:'organization_id'] !~ Regexp.new(/[a-zA-Z0-9-_]+/)
    #fail ArgumentError, "invalid value for 'opts[:\"organization_id\"]' when calling ReportsApi.search_reports, must conform to the pattern /[a-zA-Z0-9-_]+/."
  #end

  # resource path
  local_var_path = 'reporting/v3/reports'

  # query parameters
  query_params = {}
  query_params[:'startTime'] = start_time
  query_params[:'endTime'] = end_time
  query_params[:'timeQueryType'] = time_query_type
  query_params[:'organizationId'] = opts[:'organization_id'] if !opts[:'organization_id'].nil?
  query_params[:'reportMimeType'] = opts[:'report_mime_type'] if !opts[:'report_mime_type'].nil?
  query_params[:'reportFrequency'] = opts[:'report_frequency'] if !opts[:'report_frequency'].nil?
  query_params[:'reportName'] = opts[:'report_name'] if !opts[:'report_name'].nil?
  query_params[:'reportDefinitionId'] = opts[:'report_definition_id'] if !opts[:'report_definition_id'].nil?
  query_params[:'reportStatus'] = opts[:'report_status'] if !opts[:'report_status'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ReportingV3ReportsGet200Response')
  if @api_client.config.debugging
            begin
            raise
                    @api_client.config.logger.debug "API called: ReportsApi#search_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
            rescue
                    puts 'Cannot write to log'
            end
      end
  return data, status_code, headers
end