Method: CyberSource::ReportSubscriptionsApi#get_subscription_with_http_info

Defined in:
lib/cybersource_rest_client/api/report_subscriptions_api.rb

#get_subscription_with_http_info(report_name, opts = {}) ⇒ Array<(ReportingV3ReportSubscriptionsGet200ResponseSubscriptions, Fixnum, Hash)>

Get Subscription for Report Name View the details of a report subscription, such as the report format or report frequency, using the report’s unique name.

Parameters:

  • report_name

    Name of the Report to Retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :organization_id (String)

    Valid Organization Id

Returns:



371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# File 'lib/cybersource_rest_client/api/report_subscriptions_api.rb', line 371

def get_subscription_with_http_info(report_name, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: ReportSubscriptionsApi.get_subscription ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'report_name' is set
  if @api_client.config.client_side_validation && report_name.nil?
    fail ArgumentError, "Missing the required parameter 'report_name' when calling ReportSubscriptionsApi.get_subscription"
  end
  if @api_client.config.client_side_validation && report_name.to_s.length > 80
    fail ArgumentError, 'invalid value for "report_name" when calling ReportSubscriptionsApi.get_subscription, the character length must be smaller than or equal to 80.'
  end

  if @api_client.config.client_side_validation && report_name.to_s.length < 1
    fail ArgumentError, 'invalid value for "report_name" when calling ReportSubscriptionsApi.get_subscription, the character length must be great than or equal to 1.'
  end

  #if @api_client.config.client_side_validation && report_name !~ Regexp.new(/[a-zA-Z0-9-_+]+/)
    #fail ArgumentError, "invalid value for 'report_name' when calling ReportSubscriptionsApi.get_subscription, must conform to the pattern /[a-zA-Z0-9-_+]+/."
  #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 ReportSubscriptionsApi.get_subscription, 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 ReportSubscriptionsApi.get_subscription, 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 ReportSubscriptionsApi.get_subscription, must conform to the pattern /[a-zA-Z0-9-_]+/."
  #end

  # resource path
  local_var_path = 'reporting/v3/report-subscriptions/{reportName}'.sub('{' + 'reportName' + '}', report_name.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'])
  # 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)
  if 'GET' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  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 => 'ReportingV3ReportSubscriptionsGet200ResponseSubscriptions')
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: ReportSubscriptionsApi#get_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end