class Yapstone::ContractsApi
Attributes
Public Class Methods
# File lib/yapstone-so/api/contracts_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Creates an Contract Resource
in the system. @param contract_create_request [ContractCreateRequest] The Contract Request Resource
to be created. @param [Hash] opts the optional parameters @return [ContractResource]
# File lib/yapstone-so/api/contracts_api.rb, line 26 def create_contract(contract_create_request, opts = {}) data, _status_code, _headers = create_contract_with_http_info(contract_create_request, opts) data end
Creates an Contract Resource
in the system. @param contract_create_request [ContractCreateRequest] The Contract Request Resource
to be created. @param [Hash] opts the optional parameters @return [Array<(ContractResource
, Integer, Hash)>] ContractResource
data, response status code and response headers
# File lib/yapstone-so/api/contracts_api.rb, line 35 def create_contract_with_http_info(contract_create_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContractsApi.create_contract ...' end # verify the required parameter 'contract_create_request' is set if @api_client.config.client_side_validation && contract_create_request.nil? fail ArgumentError, "Missing the required parameter 'contract_create_request' when calling ContractsApi.create_contract" end # resource path local_var_path = '/contracts' # 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(contract_create_request) # return_type return_type = opts[:return_type] || 'ContractResource' # 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: ContractsApi#create_contract\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Retrieves all of contracts Retrieves all of the Contracts @param [Hash] opts the optional parameters @option opts [String] :applicant_id applicantId @option opts [String] :asset_id assetId @option opts [String] :payout_instrument_id payoutInstrumentId @option opts [String] :product filter by provided product @return [ContractResourceDTO]
# File lib/yapstone-so/api/contracts_api.rb, line 92 def get_all_contracts(opts = {}) data, _status_code, _headers = get_all_contracts_with_http_info(opts) data end
Retrieves all of contracts Retrieves all of the Contracts @param [Hash] opts the optional parameters @option opts [String] :applicant_id applicantId @option opts [String] :asset_id assetId @option opts [String] :payout_instrument_id payoutInstrumentId @option opts [String] :product filter by provided product @return [Array<(ContractResourceDTO
, Integer, Hash)>] ContractResourceDTO
data, response status code and response headers
# File lib/yapstone-so/api/contracts_api.rb, line 105 def get_all_contracts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContractsApi.get_all_contracts ...' end allowable_values = ["MARKETPLACE", "PAYOUT"] if @api_client.config.client_side_validation && opts[:'product'] && !allowable_values.include?(opts[:'product']) fail ArgumentError, "invalid value for \"product\", must be one of #{allowable_values}" end # resource path local_var_path = '/contracts' # query parameters query_params = opts[:query_params] || {} query_params[:'applicantId'] = opts[:'applicant_id'] if !opts[:'applicant_id'].nil? query_params[:'assetId'] = opts[:'asset_id'] if !opts[:'asset_id'].nil? query_params[:'payoutInstrumentId'] = opts[:'payout_instrument_id'] if !opts[:'payout_instrument_id'].nil? query_params[:'product'] = opts[:'product'] if !opts[:'product'].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] || 'ContractResourceDTO' # 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: ContractsApi#get_all_contracts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Retrieves an Contract Resource
from the system for the given contractId. @param contract_id [String] The unique id of the Contract Resource
. @param [Hash] opts the optional parameters @return [ContractResource]
# File lib/yapstone-so/api/contracts_api.rb, line 160 def get_contract(contract_id, opts = {}) data, _status_code, _headers = get_contract_with_http_info(contract_id, opts) data end
Retrieves an Contract Resource
from the system for the given contractId. @param contract_id [String] The unique id of the Contract Resource
. @param [Hash] opts the optional parameters @return [Array<(ContractResource
, Integer, Hash)>] ContractResource
data, response status code and response headers
# File lib/yapstone-so/api/contracts_api.rb, line 169 def get_contract_with_http_info(contract_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContractsApi.get_contract ...' 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 ContractsApi.get_contract" end # resource path local_var_path = '/contracts/{contractId}'.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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'ContractResource' # 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: ContractsApi#get_contract\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Updates the Contract Resource
. @param contract_id [String] The unique id of the Contract Resource
. @param contract_update_request [ContractUpdateRequest] The Contract Resource
to be created after updation. @param [Hash] opts the optional parameters @return [ContractResource]
# File lib/yapstone-so/api/contracts_api.rb, line 221 def update_contract(contract_id, contract_update_request, opts = {}) data, _status_code, _headers = update_contract_with_http_info(contract_id, contract_update_request, opts) data end
Updates the Contract Resource
. @param contract_id [String] The unique id of the Contract Resource
. @param contract_update_request [ContractUpdateRequest] The Contract Resource
to be created after updation. @param [Hash] opts the optional parameters @return [Array<(ContractResource
, Integer, Hash)>] ContractResource
data, response status code and response headers
# File lib/yapstone-so/api/contracts_api.rb, line 231 def update_contract_with_http_info(contract_id, contract_update_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContractsApi.update_contract ...' 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 ContractsApi.update_contract" end # verify the required parameter 'contract_update_request' is set if @api_client.config.client_side_validation && contract_update_request.nil? fail ArgumentError, "Missing the required parameter 'contract_update_request' when calling ContractsApi.update_contract" end # resource path local_var_path = '/contracts/{contractId}'.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-patch+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(contract_update_request) # return_type return_type = opts[:return_type] || 'ContractResource' # 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: ContractsApi#update_contract\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end