class VoucherifySdk::AsyncActionsApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

get_async_action(async_action_id, opts = {}) click to toggle source

Get Async Action Check the result of a scheduled asynchronous operation. The table below lists the possible types of async actions. The types are different for each endpoint generating the async action. If you would like to learn more about importing data into Voucherify, read more [here](support.voucherify.io/article/574-data-import).

@param async_action_id [String] Unique ID of the asynchronous operation. @param [Hash] opts the optional parameters @return [AsyncActionGetResponseBody]

# File lib/VoucherifySdk/api/async_actions_api.rb, line 27
def get_async_action(async_action_id, opts = {})
  data, _status_code, _headers = get_async_action_with_http_info(async_action_id, opts)
  data
end
list_async_actions(opts = {}) click to toggle source

List Async Actions Track asynchronous operations scheduled in your project. The table below lists the possible types of async actions. The types are different for each endpoint generating the async action. If you would like to learn more about importing data into Voucherify, read more [here](support.voucherify.io/article/574-data-import).

@param [Hash] opts the optional parameters @option opts [Integer] :limit Limit the number of asynchronous actions that the API returns in the response. @option opts [Time] :end_date Limits results to actions scheduled before the end_date. The date format needs to be consistent with ISO 8601 format (2016-11-16T14:14:31Z or 2016-11-16). @return [AsyncActionsListResponseBody]

# File lib/VoucherifySdk/api/async_actions_api.rb, line 87
def list_async_actions(opts = {})
  data, _status_code, _headers = list_async_actions_with_http_info(opts)
  data
end

Private Instance Methods

get_async_action_with_http_info(async_action_id, opts = {}) click to toggle source

Get Async Action Check the result of a scheduled asynchronous operation. The table below lists the possible types of async actions. The types are different for each endpoint generating the async action. If you would like to learn more about importing data into Voucherify, read more [here](support.voucherify.io/article/574-data-import).

@param async_action_id [String] Unique ID of the asynchronous operation. @param [Hash] opts the optional parameters @return [Array<(AsyncActionGetResponseBody, Integer, Hash)>] AsyncActionGetResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/async_actions_api.rb, line 37
        def get_async_action_with_http_info(async_action_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AsyncActionsApi.get_async_action ...'
  end
  # resource path
  local_var_path = '/v1/async-actions/{asyncActionId}'.sub('{' + 'asyncActionId' + '}', CGI.escape(async_action_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AsyncActionGetResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"AsyncActionsApi.get_async_action",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AsyncActionsApi#get_async_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_async_actions_with_http_info(opts = {}) click to toggle source

List Async Actions Track asynchronous operations scheduled in your project. The table below lists the possible types of async actions. The types are different for each endpoint generating the async action. If you would like to learn more about importing data into Voucherify, read more [here](support.voucherify.io/article/574-data-import).

@param [Hash] opts the optional parameters @option opts [Integer] :limit Limit the number of asynchronous actions that the API returns in the response. @option opts [Time] :end_date Limits results to actions scheduled before the end_date. The date format needs to be consistent with ISO 8601 format (2016-11-16T14:14:31Z or 2016-11-16). @return [Array<(AsyncActionsListResponseBody, Integer, Hash)>] AsyncActionsListResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/async_actions_api.rb, line 98
        def list_async_actions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AsyncActionsApi.list_async_actions ...'
  end
  # resource path
  local_var_path = '/v1/async-actions'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AsyncActionsListResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"AsyncActionsApi.list_async_actions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AsyncActionsApi#list_async_actions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end