Class: ThePlaidApi::LinkSessionProtectResult
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::LinkSessionProtectResult
- Defined in:
- lib/the_plaid_api/models/link_session_protect_result.rb
Overview
Plaid Protect details from the Link session
Instance Attribute Summary collapse
-
#event_id ⇒ String
The Plaid Protect event ID representing the completion of the link session.
-
#fraud_attributes ⇒ Object
Contains attributes used during a trust index calculation.
-
#trust_index ⇒ TrustIndex
Represents a calculated Trust Index Score.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(event_id:, trust_index: SKIP, fraud_attributes: SKIP, additional_properties: nil) ⇒ LinkSessionProtectResult
constructor
A new instance of LinkSessionProtectResult.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(event_id:, trust_index: SKIP, fraud_attributes: SKIP, additional_properties: nil) ⇒ LinkSessionProtectResult
Returns a new instance of LinkSessionProtectResult.
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/the_plaid_api/models/link_session_protect_result.rb', line 50 def initialize(event_id:, trust_index: SKIP, fraud_attributes: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @event_id = event_id @trust_index = trust_index unless trust_index == SKIP @fraud_attributes = fraud_attributes unless fraud_attributes == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#event_id ⇒ String
The Plaid Protect event ID representing the completion of the link session.
15 16 17 |
# File 'lib/the_plaid_api/models/link_session_protect_result.rb', line 15 def event_id @event_id end |
#fraud_attributes ⇒ Object
Contains attributes used during a trust index calculation.
23 24 25 |
# File 'lib/the_plaid_api/models/link_session_protect_result.rb', line 23 def fraud_attributes @fraud_attributes end |
#trust_index ⇒ TrustIndex
Represents a calculated Trust Index Score.
19 20 21 |
# File 'lib/the_plaid_api/models/link_session_protect_result.rb', line 19 def trust_index @trust_index end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/the_plaid_api/models/link_session_protect_result.rb', line 62 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. event_id = hash.key?('event_id') ? hash['event_id'] : nil trust_index = TrustIndex.from_hash(hash['trust_index']) if hash['trust_index'] fraud_attributes = hash.key?('fraud_attributes') ? hash['fraud_attributes'] : 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. LinkSessionProtectResult.new(event_id: event_id, trust_index: trust_index, fraud_attributes: fraud_attributes, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 32 |
# File 'lib/the_plaid_api/models/link_session_protect_result.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['event_id'] = 'event_id' @_hash['trust_index'] = 'trust_index' @_hash['fraud_attributes'] = 'fraud_attributes' @_hash end |
.nullables ⇒ Object
An array for nullable fields
43 44 45 46 47 48 |
# File 'lib/the_plaid_api/models/link_session_protect_result.rb', line 43 def self.nullables %w[ trust_index fraud_attributes ] end |
.optionals ⇒ Object
An array for optional fields
35 36 37 38 39 40 |
# File 'lib/the_plaid_api/models/link_session_protect_result.rb', line 35 def self.optionals %w[ trust_index fraud_attributes ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
93 94 95 96 97 98 |
# File 'lib/the_plaid_api/models/link_session_protect_result.rb', line 93 def inspect class_name = self.class.name.split('::').last "<#{class_name} event_id: #{@event_id.inspect}, trust_index: #{@trust_index.inspect},"\ " fraud_attributes: #{@fraud_attributes.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
86 87 88 89 90 |
# File 'lib/the_plaid_api/models/link_session_protect_result.rb', line 86 def to_s class_name = self.class.name.split('::').last "<#{class_name} event_id: #{@event_id}, trust_index: #{@trust_index}, fraud_attributes:"\ " #{@fraud_attributes}, additional_properties: #{@additional_properties}>" end |