class Yapstone::PayoutsApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

add_payout_product(contract_id, payout_product_add, opts = {}) click to toggle source

Add a payout product in a given contract. @param contract_id [String] The unique id of the Contract Resource. @param payout_product_add [PayoutProductAdd] The payout instruments list @param [Hash] opts the optional parameters @return [PayoutProductResource]

# File lib/yapstone-so/api/payouts_api.rb, line 27
def add_payout_product(contract_id, payout_product_add, opts = {})
  data, _status_code, _headers = add_payout_product_with_http_info(contract_id, payout_product_add, opts)
  data
end
add_payout_product_with_http_info(contract_id, payout_product_add, opts = {}) click to toggle source

Add a payout product in a given contract. @param contract_id [String] The unique id of the Contract Resource. @param payout_product_add [PayoutProductAdd] The payout instruments list @param [Hash] opts the optional parameters @return [Array<(PayoutProductResource, Integer, Hash)>] PayoutProductResource data, response status code and response headers

# File lib/yapstone-so/api/payouts_api.rb, line 37
def add_payout_product_with_http_info(contract_id, payout_product_add, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PayoutsApi.add_payout_product ...'
  end
  # verify the required parameter 'contract_id' is set
  if @api_client.config.client_side_validation && contract_id.nil?
    fail ArgumentError, "Missing the required parameter 'contract_id' when calling PayoutsApi.add_payout_product"
  end
  # verify the required parameter 'payout_product_add' is set
  if @api_client.config.client_side_validation && payout_product_add.nil?
    fail ArgumentError, "Missing the required parameter 'payout_product_add' when calling PayoutsApi.add_payout_product"
  end
  # resource path
  local_var_path = '/contracts/{contractId}/payouts'.sub('{' + 'contractId' + '}', CGI.escape(contract_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(payout_product_add) 

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

  # 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: PayoutsApi#add_payout_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
deactivate_payout_product(contract_id, payout_instrument_id, deactivate_request, opts = {}) click to toggle source

deactivate the Payout Product Resource. @param contract_id [String] The unique id of the Contract Resource. @param payout_instrument_id [String] The unique id of the Payout Instrument Resource. @param deactivate_request [DeactivateRequest] The details of the deactivation process. @param [Hash] opts the optional parameters @return [nil]

# File lib/yapstone-so/api/payouts_api.rb, line 96
def deactivate_payout_product(contract_id, payout_instrument_id, deactivate_request, opts = {})
  deactivate_payout_product_with_http_info(contract_id, payout_instrument_id, deactivate_request, opts)
  nil
end
deactivate_payout_product_with_http_info(contract_id, payout_instrument_id, deactivate_request, opts = {}) click to toggle source

deactivate the Payout Product Resource. @param contract_id [String] The unique id of the Contract Resource. @param payout_instrument_id [String] The unique id of the Payout Instrument Resource. @param deactivate_request [DeactivateRequest] The details of the deactivation process. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/yapstone-so/api/payouts_api.rb, line 107
def deactivate_payout_product_with_http_info(contract_id, payout_instrument_id, deactivate_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PayoutsApi.deactivate_payout_product ...'
  end
  # verify the required parameter 'contract_id' is set
  if @api_client.config.client_side_validation && contract_id.nil?
    fail ArgumentError, "Missing the required parameter 'contract_id' when calling PayoutsApi.deactivate_payout_product"
  end
  # verify the required parameter 'payout_instrument_id' is set
  if @api_client.config.client_side_validation && payout_instrument_id.nil?
    fail ArgumentError, "Missing the required parameter 'payout_instrument_id' when calling PayoutsApi.deactivate_payout_product"
  end
  # verify the required parameter 'deactivate_request' is set
  if @api_client.config.client_side_validation && deactivate_request.nil?
    fail ArgumentError, "Missing the required parameter 'deactivate_request' when calling PayoutsApi.deactivate_payout_product"
  end
  # resource path
  local_var_path = '/contracts/{contractId}/payouts/{payoutInstrumentId}'.sub('{' + 'contractId' + '}', CGI.escape(contract_id.to_s).gsub('%2F', '/')).sub('{' + 'payoutInstrumentId' + '}', CGI.escape(payout_instrument_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(deactivate_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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayoutsApi#deactivate_payout_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_payout_product_by_instrument_id(contract_id, payout_instrument_id, opts = {}) click to toggle source

Retrieves an Payout Resource from the system for the given contractId and payoutInstrumentId. @param contract_id [String] The unique id of the Contract Resource. @param payout_instrument_id [String] The unique id of the Payout Instrument Resource. @param [Hash] opts the optional parameters @return [PayoutProductResource]

# File lib/yapstone-so/api/payouts_api.rb, line 169
def get_payout_product_by_instrument_id(contract_id, payout_instrument_id, opts = {})
  data, _status_code, _headers = get_payout_product_by_instrument_id_with_http_info(contract_id, payout_instrument_id, opts)
  data
end
get_payout_product_by_instrument_id_with_http_info(contract_id, payout_instrument_id, opts = {}) click to toggle source

Retrieves an Payout Resource from the system for the given contractId and payoutInstrumentId. @param contract_id [String] The unique id of the Contract Resource. @param payout_instrument_id [String] The unique id of the Payout Instrument Resource. @param [Hash] opts the optional parameters @return [Array<(PayoutProductResource, Integer, Hash)>] PayoutProductResource data, response status code and response headers

# File lib/yapstone-so/api/payouts_api.rb, line 179
def get_payout_product_by_instrument_id_with_http_info(contract_id, payout_instrument_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PayoutsApi.get_payout_product_by_instrument_id ...'
  end
  # verify the required parameter 'contract_id' is set
  if @api_client.config.client_side_validation && contract_id.nil?
    fail ArgumentError, "Missing the required parameter 'contract_id' when calling PayoutsApi.get_payout_product_by_instrument_id"
  end
  # verify the required parameter 'payout_instrument_id' is set
  if @api_client.config.client_side_validation && payout_instrument_id.nil?
    fail ArgumentError, "Missing the required parameter 'payout_instrument_id' when calling PayoutsApi.get_payout_product_by_instrument_id"
  end
  # resource path
  local_var_path = '/contracts/{contractId}/payouts/{payoutInstrumentId}'.sub('{' + 'contractId' + '}', CGI.escape(contract_id.to_s).gsub('%2F', '/')).sub('{' + 'payoutInstrumentId' + '}', CGI.escape(payout_instrument_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] || 'PayoutProductResource' 

  # 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: PayoutsApi#get_payout_product_by_instrument_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_payout_product(contract_id, payout_instrument_id, payout_product_resource, opts = {}) click to toggle source

Updates the Payout product in the Contract Resource. @param contract_id [String] The unique id of the Contract Resource. @param payout_instrument_id [String] The unique id of the Payout Instrument Resource. @param payout_product_resource [PayoutProductResource] The Payout Resource to be updated. @param [Hash] opts the optional parameters @return [PayoutProductResource]

# File lib/yapstone-so/api/payouts_api.rb, line 236
def update_payout_product(contract_id, payout_instrument_id, payout_product_resource, opts = {})
  data, _status_code, _headers = update_payout_product_with_http_info(contract_id, payout_instrument_id, payout_product_resource, opts)
  data
end
update_payout_product_with_http_info(contract_id, payout_instrument_id, payout_product_resource, opts = {}) click to toggle source

Updates the Payout product in the Contract Resource. @param contract_id [String] The unique id of the Contract Resource. @param payout_instrument_id [String] The unique id of the Payout Instrument Resource. @param payout_product_resource [PayoutProductResource] The Payout Resource to be updated. @param [Hash] opts the optional parameters @return [Array<(PayoutProductResource, Integer, Hash)>] PayoutProductResource data, response status code and response headers

# File lib/yapstone-so/api/payouts_api.rb, line 247
def update_payout_product_with_http_info(contract_id, payout_instrument_id, payout_product_resource, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PayoutsApi.update_payout_product ...'
  end
  # verify the required parameter 'contract_id' is set
  if @api_client.config.client_side_validation && contract_id.nil?
    fail ArgumentError, "Missing the required parameter 'contract_id' when calling PayoutsApi.update_payout_product"
  end
  # verify the required parameter 'payout_instrument_id' is set
  if @api_client.config.client_side_validation && payout_instrument_id.nil?
    fail ArgumentError, "Missing the required parameter 'payout_instrument_id' when calling PayoutsApi.update_payout_product"
  end
  # verify the required parameter 'payout_product_resource' is set
  if @api_client.config.client_side_validation && payout_product_resource.nil?
    fail ArgumentError, "Missing the required parameter 'payout_product_resource' when calling PayoutsApi.update_payout_product"
  end
  # resource path
  local_var_path = '/contracts/{contractId}/payouts/{payoutInstrumentId}'.sub('{' + 'contractId' + '}', CGI.escape(contract_id.to_s).gsub('%2F', '/')).sub('{' + 'payoutInstrumentId' + '}', CGI.escape(payout_instrument_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-patch+json'])

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

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

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

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