class AsposeOmrCloud::OmrApi

Attributes

api_client[RW]

Public Class Methods

new(app_key, app_sid, base_path = nil, debugging = false, api_client = ApiClient.default) click to toggle source

OmrApi constructor

@param app_key App Key @param app_sid App SID @param base_path Base Path @param debugging debugging (true to enable, false to disable) @param api_client custom instance of ApiClient class

# File lib/aspose_omr_cloud/api/omr_api.rb, line 41
def initialize(app_key, app_sid, base_path = nil, debugging = false, api_client = ApiClient.default)
  @api_client = api_client
  @api_client.config.app_key = app_key if app_key
  @api_client.config.app_sid = app_sid if app_sid
  @api_client.config.debugging = debugging
  if base_path
    uri = URI.parse(base_path)
    @api_client.config.scheme = uri.scheme
    if uri.port.to_s.empty?
      @api_client.config.host = uri.host
    else
      @api_client.config.host = "#{uri.host}:#{uri.port}"
    end
  end
end

Public Instance Methods

post_run_omr_task(name, action_name, opts = {}) click to toggle source

Run specific OMR task

@param name Name of the file to recognize. @param action_name Action name ['CorrectTemplate', 'FinalizeTemplate', 'RecognizeImage'] @param [Hash] opts the optional parameters @option opts [OMRFunctionParam] :param Function params, specific for each actionName @option opts [String] :storage Image's storage. @option opts [String] :folder Image's folder. @return [OMRResponse]

# File lib/aspose_omr_cloud/api/omr_api.rb, line 66
def post_run_omr_task(name, action_name, opts = {})
  data, _status_code, _headers = post_run_omr_task_with_http_info(name, action_name, opts)
  return data
end
post_run_omr_task_with_http_info(name, action_name, opts = {}) click to toggle source

Run specific OMR task

@param name Name of the file to recognize. @param action_name Action name [&#39;CorrectTemplate&#39;, &#39;FinalizeTemplate&#39;, &#39;RecognizeImage&#39;] @param [Hash] opts the optional parameters @option opts [OMRFunctionParam] :param Function params, specific for each actionName @option opts [String] :storage Image&#39;s storage. @option opts [String] :folder Image&#39;s folder. @return [Array<(OMRResponse, Fixnum, Hash)>] OMRResponse data, response status code and response headers

# File lib/aspose_omr_cloud/api/omr_api.rb, line 80
def post_run_omr_task_with_http_info(name, action_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OmrApi.post_run_omr_task ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling OmrApi.post_run_omr_task"
  end
  # verify the required parameter 'action_name' is set
  if @api_client.config.client_side_validation && action_name.nil?
    fail ArgumentError, "Missing the required parameter 'action_name' when calling OmrApi.post_run_omr_task"
  end
  # resource path
  local_var_path = "/omr/{name}/runOmrTask".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'actionName'] = action_name
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/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(opts[:'param'])
  auth_names = ['oauth']
  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,
    :return_type => 'OMRResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OmrApi#post_run_omr_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end