class Yapstone::DisputesApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

action_by_dispute_id(id, action_patch_request, opts = {}) click to toggle source

Action to perform on the dispute - two values are supported - ACCEPT or CONTEST Action to perform on the dispute - two values are supported - ACCEPT or CONTEST @param id [String] Primary key for a single dispute record (assigned by YapStone) @param action_patch_request [ActionPatchRequest] Action to be patched @param [Hash] opts the optional parameters @return [nil]

# File lib/yapstone-disputes/api/disputes_api.rb, line 28
def action_by_dispute_id(id, action_patch_request, opts = {})
  action_by_dispute_id_with_http_info(id, action_patch_request, opts)
  nil
end
action_by_dispute_id_with_http_info(id, action_patch_request, opts = {}) click to toggle source

Action to perform on the dispute - two values are supported - ACCEPT or CONTEST Action to perform on the dispute - two values are supported - ACCEPT or CONTEST @param id [String] Primary key for a single dispute record (assigned by YapStone) @param action_patch_request [ActionPatchRequest] Action to be patched @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/yapstone-disputes/api/disputes_api.rb, line 39
def action_by_dispute_id_with_http_info(id, action_patch_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DisputesApi.action_by_dispute_id ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling DisputesApi.action_by_dispute_id"
  end
  if @api_client.config.client_side_validation && id.to_s.length > 64
    fail ArgumentError, 'invalid value for "id" when calling DisputesApi.action_by_dispute_id, the character length must be smaller than or equal to 64.'
  end

  # verify the required parameter 'action_patch_request' is set
  if @api_client.config.client_side_validation && action_patch_request.nil?
    fail ArgumentError, "Missing the required parameter 'action_patch_request' when calling DisputesApi.action_by_dispute_id"
  end
  # resource path
  local_var_path = '/disputes/{id}/action'.sub('{' + 'id' + '}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # 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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(action_patch_request) 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  new_options = opts.merge(
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DisputesApi#action_by_dispute_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create_dispute(composite_dispute, opts = {}) click to toggle source

Create a dispute [Test Only] A test harness API to create a dispute @param composite_dispute [CompositeDispute] New dispute entity to be created @param [Hash] opts the optional parameters @return [CompositeDispute]

# File lib/yapstone-disputes/api/disputes_api.rb, line 101
def create_dispute(composite_dispute, opts = {})
  data, _status_code, _headers = create_dispute_with_http_info(composite_dispute, opts)
  data
end
create_dispute_with_http_info(composite_dispute, opts = {}) click to toggle source

Create a dispute [Test Only] A test harness API to create a dispute @param composite_dispute [CompositeDispute] New dispute entity to be created @param [Hash] opts the optional parameters @return [Array<(CompositeDispute, Integer, Hash)>] CompositeDispute data, response status code and response headers

# File lib/yapstone-disputes/api/disputes_api.rb, line 111
def create_dispute_with_http_info(composite_dispute, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DisputesApi.create_dispute ...'
  end
  # verify the required parameter 'composite_dispute' is set
  if @api_client.config.client_side_validation && composite_dispute.nil?
    fail ArgumentError, "Missing the required parameter 'composite_dispute' when calling DisputesApi.create_dispute"
  end
  # resource path
  local_var_path = '/disputes'

  # 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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(composite_dispute) 

  # return_type
  return_type = opts[:return_type] || 'CompositeDispute' 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  new_options = opts.merge(
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DisputesApi#create_dispute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
final_disposition_by_dispute_id(id, final_disposition_patch_request, opts = {}) click to toggle source

Final disposition to be set on the dispute - two values are supported - WON or LOST Final disposition to be set on the dispute - two values are supported - WON or LOST @param id [String] Primary key for a single dispute record (assigned by YapStone) @param final_disposition_patch_request [FinalDispositionPatchRequest] Final disposition to be patched @param [Hash] opts the optional parameters @return [nil]

# File lib/yapstone-disputes/api/disputes_api.rb, line 166
def final_disposition_by_dispute_id(id, final_disposition_patch_request, opts = {})
  final_disposition_by_dispute_id_with_http_info(id, final_disposition_patch_request, opts)
  nil
end
final_disposition_by_dispute_id_with_http_info(id, final_disposition_patch_request, opts = {}) click to toggle source

Final disposition to be set on the dispute - two values are supported - WON or LOST Final disposition to be set on the dispute - two values are supported - WON or LOST @param id [String] Primary key for a single dispute record (assigned by YapStone) @param final_disposition_patch_request [FinalDispositionPatchRequest] Final disposition to be patched @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/yapstone-disputes/api/disputes_api.rb, line 177
def final_disposition_by_dispute_id_with_http_info(id, final_disposition_patch_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DisputesApi.final_disposition_by_dispute_id ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling DisputesApi.final_disposition_by_dispute_id"
  end
  if @api_client.config.client_side_validation && id.to_s.length > 64
    fail ArgumentError, 'invalid value for "id" when calling DisputesApi.final_disposition_by_dispute_id, the character length must be smaller than or equal to 64.'
  end

  # verify the required parameter 'final_disposition_patch_request' is set
  if @api_client.config.client_side_validation && final_disposition_patch_request.nil?
    fail ArgumentError, "Missing the required parameter 'final_disposition_patch_request' when calling DisputesApi.final_disposition_by_dispute_id"
  end
  # resource path
  local_var_path = '/disputes/{id}/finalDisposition'.sub('{' + 'id' + '}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # 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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(final_disposition_patch_request) 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  new_options = opts.merge(
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DisputesApi#final_disposition_by_dispute_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_dispute(id, opts = {}) click to toggle source

Fetch a single dispute Returns the dispute detail and status history for the given `disputeId` @param id [String] Primary key for a single dispute record (assigned by YapStone) @param [Hash] opts the optional parameters @return [CompositeDispute]

# File lib/yapstone-disputes/api/disputes_api.rb, line 239
def get_dispute(id, opts = {})
  data, _status_code, _headers = get_dispute_with_http_info(id, opts)
  data
end
get_dispute_events(id, opts = {}) click to toggle source

Fetch the dispute events associated with a dispute Returns the dispute events associated with a dispute @param id [String] Primary key for a single dispute record (assigned by YapStone) @param [Hash] opts the optional parameters @option opts [Integer] :offset Offset to start returning items at (default to 0) @option opts [Integer] :limit Maximum number of items to return (default to 10) @return [CompositeDisputeEventPagedResponse]

# File lib/yapstone-disputes/api/disputes_api.rb, line 307
def get_dispute_events(id, opts = {})
  data, _status_code, _headers = get_dispute_events_with_http_info(id, opts)
  data
end
get_dispute_events_with_http_info(id, opts = {}) click to toggle source

Fetch the dispute events associated with a dispute Returns the dispute events associated with a dispute @param id [String] Primary key for a single dispute record (assigned by YapStone) @param [Hash] opts the optional parameters @option opts [Integer] :offset Offset to start returning items at @option opts [Integer] :limit Maximum number of items to return @return [Array<(CompositeDisputeEventPagedResponse, Integer, Hash)>] CompositeDisputeEventPagedResponse data, response status code and response headers

# File lib/yapstone-disputes/api/disputes_api.rb, line 319
def get_dispute_events_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DisputesApi.get_dispute_events ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling DisputesApi.get_dispute_events"
  end
  if @api_client.config.client_side_validation && id.to_s.length > 64
    fail ArgumentError, 'invalid value for "id" when calling DisputesApi.get_dispute_events, the character length must be smaller than or equal to 64.'
  end

  # resource path
  local_var_path = '/disputes/{id}/events'.sub('{' + 'id' + '}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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[:body] 

  # return_type
  return_type = opts[:return_type] || 'CompositeDisputeEventPagedResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  new_options = opts.merge(
    :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: DisputesApi#get_dispute_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_dispute_with_http_info(id, opts = {}) click to toggle source

Fetch a single dispute Returns the dispute detail and status history for the given &#x60;disputeId&#x60; @param id [String] Primary key for a single dispute record (assigned by YapStone) @param [Hash] opts the optional parameters @return [Array<(CompositeDispute, Integer, Hash)>] CompositeDispute data, response status code and response headers

# File lib/yapstone-disputes/api/disputes_api.rb, line 249
def get_dispute_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DisputesApi.get_dispute ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling DisputesApi.get_dispute"
  end
  if @api_client.config.client_side_validation && id.to_s.length > 64
    fail ArgumentError, 'invalid value for "id" when calling DisputesApi.get_dispute, the character length must be smaller than or equal to 64.'
  end

  # resource path
  local_var_path = '/disputes/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # 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[:body] 

  # return_type
  return_type = opts[:return_type] || 'CompositeDispute' 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  new_options = opts.merge(
    :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: DisputesApi#get_dispute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_status(id, status_patch_request, opts = {}) click to toggle source

Status to be updated in the dispute Status to be updated in the dispute @param id [String] Primary key for a single dispute record (assigned by YapStone) @param status_patch_request [StatusPatchRequest] Status to be patched @param [Hash] opts the optional parameters @return [nil]

# File lib/yapstone-disputes/api/disputes_api.rb, line 378
def update_status(id, status_patch_request, opts = {})
  update_status_with_http_info(id, status_patch_request, opts)
  nil
end
update_status_with_http_info(id, status_patch_request, opts = {}) click to toggle source

Status to be updated in the dispute Status to be updated in the dispute @param id [String] Primary key for a single dispute record (assigned by YapStone) @param status_patch_request [StatusPatchRequest] Status to be patched @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/yapstone-disputes/api/disputes_api.rb, line 389
def update_status_with_http_info(id, status_patch_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DisputesApi.update_status ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling DisputesApi.update_status"
  end
  if @api_client.config.client_side_validation && id.to_s.length > 64
    fail ArgumentError, 'invalid value for "id" when calling DisputesApi.update_status, the character length must be smaller than or equal to 64.'
  end

  # verify the required parameter 'status_patch_request' is set
  if @api_client.config.client_side_validation && status_patch_request.nil?
    fail ArgumentError, "Missing the required parameter 'status_patch_request' when calling DisputesApi.update_status"
  end
  # resource path
  local_var_path = '/disputes/{id}/status'.sub('{' + 'id' + '}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # 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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(status_patch_request) 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  new_options = opts.merge(
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DisputesApi#update_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_workflow_status(id, workflow_status_patch_request, opts = {}) click to toggle source

Workflow status to be updated in Dispute Workflow status to be updated in Dispute @param id [String] Primary key for a single dispute record (assigned by YapStone) @param workflow_status_patch_request [WorkflowStatusPatchRequest] Workflow status to be patched @param [Hash] opts the optional parameters @return [nil]

# File lib/yapstone-disputes/api/disputes_api.rb, line 452
def update_workflow_status(id, workflow_status_patch_request, opts = {})
  update_workflow_status_with_http_info(id, workflow_status_patch_request, opts)
  nil
end
update_workflow_status_with_http_info(id, workflow_status_patch_request, opts = {}) click to toggle source

Workflow status to be updated in Dispute Workflow status to be updated in Dispute @param id [String] Primary key for a single dispute record (assigned by YapStone) @param workflow_status_patch_request [WorkflowStatusPatchRequest] Workflow status to be patched @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/yapstone-disputes/api/disputes_api.rb, line 463
def update_workflow_status_with_http_info(id, workflow_status_patch_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DisputesApi.update_workflow_status ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling DisputesApi.update_workflow_status"
  end
  if @api_client.config.client_side_validation && id.to_s.length > 64
    fail ArgumentError, 'invalid value for "id" when calling DisputesApi.update_workflow_status, the character length must be smaller than or equal to 64.'
  end

  # verify the required parameter 'workflow_status_patch_request' is set
  if @api_client.config.client_side_validation && workflow_status_patch_request.nil?
    fail ArgumentError, "Missing the required parameter 'workflow_status_patch_request' when calling DisputesApi.update_workflow_status"
  end
  # resource path
  local_var_path = '/disputes/{id}/disputeWorkflow'.sub('{' + 'id' + '}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # 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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(workflow_status_patch_request) 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  new_options = opts.merge(
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DisputesApi#update_workflow_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end