class Trulioo::BusinessApi
Attributes
Public Class Methods
# File lib/trulioo_sdk/api/business_api.rb, line 15 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Get Business
Search Result
returns the a business search result. @param mode [String] trial or live @param id [String] transaction record id @param [Hash] opts the optional parameters @return [BusinessSearchResponse]
# File lib/trulioo_sdk/api/business_api.rb, line 24 def get_business_search_result(mode, id, opts = {}) data, _status_code, _headers = get_business_search_result_with_http_info(mode, id, opts) data end
Get Business
Search Result
returns the a business search result. @param mode [String] trial or live @param id [String] transaction record id @param [Hash] opts the optional parameters @return [Array<(BusinessSearchResponse
, Integer, Hash)>] BusinessSearchResponse
data, response status code and response headers
# File lib/trulioo_sdk/api/business_api.rb, line 35 def get_business_search_result_with_http_info(mode, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BusinessApi.get_business_search_result ...' end # verify the required parameter 'mode' is set if @api_client.config.client_side_validation && mode.nil? fail ArgumentError, "Missing the required parameter 'mode' when calling BusinessApi.get_business_search_result" 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 BusinessApi.get_business_search_result" end # resource path local_var_path = '/{mode}/business/v1/search/transactionrecord/{id}'.sub('{' + 'mode' + '}', CGI.escape(mode.to_s).gsub('+', '%20')).sub('{' + 'id' + '}', CGI.escape(id.to_s).gsub('+', '%20')) # 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', 'text/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'BusinessSearchResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] new_options = opts.merge( :operation => :"BusinessApi.get_business_search_result", :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: BusinessApi#get_business_search_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Search Calling this method will perform a business search. @param mode [String] trial or live @param business_search_request [BusinessSearchRequest] @param [Hash] opts the optional parameters @return [BusinessSearchResponse]
# File lib/trulioo_sdk/api/business_api.rb, line 93 def search(mode, business_search_request, opts = {}) data, _status_code, _headers = search_with_http_info(mode, business_search_request, opts) data end
Search Calling this method will perform a business search. @param mode [String] trial or live @param business_search_request [BusinessSearchRequest] @param [Hash] opts the optional parameters @return [Array<(BusinessSearchResponse
, Integer, Hash)>] BusinessSearchResponse
data, response status code and response headers
# File lib/trulioo_sdk/api/business_api.rb, line 104 def search_with_http_info(mode, business_search_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BusinessApi.search ...' end # verify the required parameter 'mode' is set if @api_client.config.client_side_validation && mode.nil? fail ArgumentError, "Missing the required parameter 'mode' when calling BusinessApi.search" end # verify the required parameter 'business_search_request' is set if @api_client.config.client_side_validation && business_search_request.nil? fail ArgumentError, "Missing the required parameter 'business_search_request' when calling BusinessApi.search" end # resource path local_var_path = '/{mode}/business/v1/search'.sub('{' + 'mode' + '}', CGI.escape(mode.to_s).gsub('+', '%20')) # 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', 'text/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(business_search_request) # return_type return_type = opts[:debug_return_type] || 'BusinessSearchResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] new_options = opts.merge( :operation => :"BusinessApi.search", :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: BusinessApi#search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end