class ShipEngine::InsuranceApi
Attributes
Public Class Methods
# File lib/ship_engine/api/insurance_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Add Funds To Insurance You may need to auto fund your account from time to time. For example, if you don't normally ship items over $100, and may want to add funds to insurance rather than keeping the account funded. @param add_funds_to_insurance_request_body [AddFundsToInsuranceRequestBody] @param [Hash] opts the optional parameters @return [AddFundsToInsuranceResponseBody]
# File lib/ship_engine/api/insurance_api.rb, line 27 def add_funds_to_insurance(add_funds_to_insurance_request_body, opts = {}) data, _status_code, _headers = add_funds_to_insurance_with_http_info(add_funds_to_insurance_request_body, opts) data end
Add Funds To Insurance You may need to auto fund your account from time to time. For example, if you don't normally ship items over $100, and may want to add funds to insurance rather than keeping the account funded. @param add_funds_to_insurance_request_body [AddFundsToInsuranceRequestBody] @param [Hash] opts the optional parameters @return [Array<(AddFundsToInsuranceResponseBody
, Integer, Hash)>] AddFundsToInsuranceResponseBody
data, response status code and response headers
# File lib/ship_engine/api/insurance_api.rb, line 37 def add_funds_to_insurance_with_http_info(add_funds_to_insurance_request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InsuranceApi.add_funds_to_insurance ...' end # verify the required parameter 'add_funds_to_insurance_request_body' is set if @api_client.config.client_side_validation && add_funds_to_insurance_request_body.nil? fail ArgumentError, "Missing the required parameter 'add_funds_to_insurance_request_body' when calling InsuranceApi.add_funds_to_insurance" end # resource path local_var_path = '/v1/insurance/shipsurance/add_funds' # 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(add_funds_to_insurance_request_body) # return_type return_type = opts[:return_type] || 'AddFundsToInsuranceResponseBody' # auth_names auth_names = opts[:auth_names] || ['api_key'] 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: InsuranceApi#add_funds_to_insurance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Connect a Shipsurance Account Connect a Shipsurance Account @param connect_insurer_request_body [ConnectInsurerRequestBody] @param [Hash] opts the optional parameters @return [Object]
# File lib/ship_engine/api/insurance_api.rb, line 91 def connect_insurer(connect_insurer_request_body, opts = {}) data, _status_code, _headers = connect_insurer_with_http_info(connect_insurer_request_body, opts) data end
Connect a Shipsurance Account Connect a Shipsurance Account @param connect_insurer_request_body [ConnectInsurerRequestBody] @param [Hash] opts the optional parameters @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
# File lib/ship_engine/api/insurance_api.rb, line 101 def connect_insurer_with_http_info(connect_insurer_request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InsuranceApi.connect_insurer ...' end # verify the required parameter 'connect_insurer_request_body' is set if @api_client.config.client_side_validation && connect_insurer_request_body.nil? fail ArgumentError, "Missing the required parameter 'connect_insurer_request_body' when calling InsuranceApi.connect_insurer" end # resource path local_var_path = '/v1/connections/insurance/shipsurance' # 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(connect_insurer_request_body) # return_type return_type = opts[:return_type] || 'Object' # auth_names auth_names = opts[:auth_names] || ['api_key'] 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: InsuranceApi#connect_insurer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Disconnect a Shipsurance Account Disconnect a Shipsurance Account @param [Hash] opts the optional parameters @return [Object]
# File lib/ship_engine/api/insurance_api.rb, line 154 def disconnect_insurer(opts = {}) data, _status_code, _headers = disconnect_insurer_with_http_info(opts) data end
Disconnect a Shipsurance Account Disconnect a Shipsurance Account @param [Hash] opts the optional parameters @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
# File lib/ship_engine/api/insurance_api.rb, line 163 def disconnect_insurer_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InsuranceApi.disconnect_insurer ...' end # resource path local_var_path = '/v1/connections/insurance/shipsurance' # 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] || 'Object' # auth_names auth_names = opts[:auth_names] || ['api_key'] 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: InsuranceApi#disconnect_insurer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get Insurance Funds Balance Retrieve the balance of your Shipsurance account. @param [Hash] opts the optional parameters @return [GetInsuranceBalanceResponseBody]
# File lib/ship_engine/api/insurance_api.rb, line 210 def get_insurance_balance(opts = {}) data, _status_code, _headers = get_insurance_balance_with_http_info(opts) data end
Get Insurance Funds Balance Retrieve the balance of your Shipsurance account. @param [Hash] opts the optional parameters @return [Array<(GetInsuranceBalanceResponseBody
, Integer, Hash)>] GetInsuranceBalanceResponseBody
data, response status code and response headers
# File lib/ship_engine/api/insurance_api.rb, line 219 def get_insurance_balance_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InsuranceApi.get_insurance_balance ...' end # resource path local_var_path = '/v1/insurance/shipsurance/balance' # 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] || 'GetInsuranceBalanceResponseBody' # auth_names auth_names = opts[:auth_names] || ['api_key'] 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: InsuranceApi#get_insurance_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end