Class: Belvo::RiskInsights

Inherits:
Resource show all
Defined in:
lib/belvo/resources.rb

Overview

RiskInsights contain relevant metrics about the credit risk of a Link

Instance Attribute Summary

Attributes inherited from Resource

#endpoint

Instance Method Summary collapse

Methods inherited from Resource

#clean, #delete, #detail, #list, #resume

Constructor Details

#initialize(session) ⇒ RiskInsights

Returns a new instance of RiskInsights.



390
391
392
393
# File 'lib/belvo/resources.rb', line 390

def initialize(session)
  super(session)
  @endpoint = 'api/risk-insights/'
end

Instance Method Details

#retrieve(link:, options: nil) ⇒ Hash

Retrieve risk insights information from a specific banking link

Parameters:

  • link (String)

    Link UUID

  • options (RiskInsightsOptions) (defaults to: nil)

    Configurable properties

Returns:

  • (Hash)

    created RiskInsights details

Raises:



400
401
402
403
404
405
406
407
408
# File 'lib/belvo/resources.rb', line 400

def retrieve(link:, options: nil)
  options = RiskInsightsOptions.from(options)
  body = {
    link: link,
    save_data: options.save_data || true
  }.merge(options)
  body = clean body: body
  @session.post(@endpoint, body)
end