Class: ThePlaidApi::ProtectLinkModelInputs

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/protect_link_model_inputs.rb

Overview

Inputs for link session Trust Index models.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(link_session_id:, require_extracted_data: SKIP, additional_properties: nil) ⇒ ProtectLinkModelInputs

Returns a new instance of ProtectLinkModelInputs.



47
48
49
50
51
52
53
54
55
# File 'lib/the_plaid_api/models/protect_link_model_inputs.rb', line 47

def initialize(link_session_id:, require_extracted_data: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @link_session_id = link_session_id
  @require_extracted_data = require_extracted_data unless require_extracted_data == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

A unique identifier for the Link session, used to compute a Trust Index score and fraud attributes.

Returns:

  • (String)


15
16
17
# File 'lib/the_plaid_api/models/protect_link_model_inputs.rb', line 15

def link_session_id
  @link_session_id
end

#require_extracted_dataTrueClass | FalseClass

Controls whether transaction extraction must be complete before scoring. If ‘false` (default), returns a score whether or not transaction extraction is complete, as long as the link session is finished; if data has been extracted it will still be included in the score computation. If `true`, returns HTTP 400 with `error_type` = `INVALID_REQUEST` and `error_code` = `FAILED_PRECONDITION` if extraction is still in progress; once data is ready a score will be returned normally.

Returns:

  • (TrueClass | FalseClass)


25
26
27
# File 'lib/the_plaid_api/models/protect_link_model_inputs.rb', line 25

def require_extracted_data
  @require_extracted_data
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/the_plaid_api/models/protect_link_model_inputs.rb', line 58

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  link_session_id =
    hash.key?('link_session_id') ? hash['link_session_id'] : nil
  require_extracted_data =
    hash.key?('require_extracted_data') ? hash['require_extracted_data'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  ProtectLinkModelInputs.new(link_session_id: link_session_id,
                             require_extracted_data: require_extracted_data,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



28
29
30
31
32
33
# File 'lib/the_plaid_api/models/protect_link_model_inputs.rb', line 28

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['link_session_id'] = 'link_session_id'
  @_hash['require_extracted_data'] = 'require_extracted_data'
  @_hash
end

.nullablesObject

An array for nullable fields



43
44
45
# File 'lib/the_plaid_api/models/protect_link_model_inputs.rb', line 43

def self.nullables
  []
end

.optionalsObject

An array for optional fields



36
37
38
39
40
# File 'lib/the_plaid_api/models/protect_link_model_inputs.rb', line 36

def self.optionals
  %w[
    require_extracted_data
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



88
89
90
91
92
# File 'lib/the_plaid_api/models/protect_link_model_inputs.rb', line 88

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} link_session_id: #{@link_session_id.inspect}, require_extracted_data:"\
  " #{@require_extracted_data.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



81
82
83
84
85
# File 'lib/the_plaid_api/models/protect_link_model_inputs.rb', line 81

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} link_session_id: #{@link_session_id}, require_extracted_data:"\
  " #{@require_extracted_data}, additional_properties: #{@additional_properties}>"
end