Class: ThePlaidApi::ScreeningHitData
- Defined in:
- lib/the_plaid_api/models/screening_hit_data.rb
Overview
Information associated with the watchlist hit
Instance Attribute Summary collapse
-
#dates_of_birth ⇒ Array[ScreeningHitDateOfBirthItem]
Dates of birth associated with the watchlist hit.
-
#documents ⇒ Array[ScreeningHitDocumentsItems]
Documents associated with the watchlist hit.
-
#locations ⇒ Array[GenericScreeningHitLocationItems]
Locations associated with the watchlist hit.
-
#names ⇒ Array[ScreeningHitNamesItems]
Names associated with the watchlist hit.
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(dates_of_birth: SKIP, documents: SKIP, locations: SKIP, names: SKIP, additional_properties: nil) ⇒ ScreeningHitData
constructor
A new instance of ScreeningHitData.
-
#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(dates_of_birth: SKIP, documents: SKIP, locations: SKIP, names: SKIP, additional_properties: nil) ⇒ ScreeningHitData
Returns a new instance of ScreeningHitData.
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/the_plaid_api/models/screening_hit_data.rb', line 53 def initialize(dates_of_birth: SKIP, documents: SKIP, locations: SKIP, names: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @dates_of_birth = dates_of_birth unless dates_of_birth == SKIP @documents = documents unless documents == SKIP @locations = locations unless locations == SKIP @names = names unless names == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#dates_of_birth ⇒ Array[ScreeningHitDateOfBirthItem]
Dates of birth associated with the watchlist hit
14 15 16 |
# File 'lib/the_plaid_api/models/screening_hit_data.rb', line 14 def dates_of_birth @dates_of_birth end |
#documents ⇒ Array[ScreeningHitDocumentsItems]
Documents associated with the watchlist hit
18 19 20 |
# File 'lib/the_plaid_api/models/screening_hit_data.rb', line 18 def documents @documents end |
#locations ⇒ Array[GenericScreeningHitLocationItems]
Locations associated with the watchlist hit
22 23 24 |
# File 'lib/the_plaid_api/models/screening_hit_data.rb', line 22 def locations @locations end |
#names ⇒ Array[ScreeningHitNamesItems]
Names associated with the watchlist hit
26 27 28 |
# File 'lib/the_plaid_api/models/screening_hit_data.rb', line 26 def names @names end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/the_plaid_api/models/screening_hit_data.rb', line 66 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it dates_of_birth = nil unless hash['dates_of_birth'].nil? dates_of_birth = [] hash['dates_of_birth'].each do |structure| dates_of_birth << (ScreeningHitDateOfBirthItem.from_hash(structure) if structure) end end dates_of_birth = SKIP unless hash.key?('dates_of_birth') # Parameter is an array, so we need to iterate through it documents = nil unless hash['documents'].nil? documents = [] hash['documents'].each do |structure| documents << (ScreeningHitDocumentsItems.from_hash(structure) if structure) end end documents = SKIP unless hash.key?('documents') # Parameter is an array, so we need to iterate through it locations = nil unless hash['locations'].nil? locations = [] hash['locations'].each do |structure| locations << (GenericScreeningHitLocationItems.from_hash(structure) if structure) end end locations = SKIP unless hash.key?('locations') # Parameter is an array, so we need to iterate through it names = nil unless hash['names'].nil? names = [] hash['names'].each do |structure| names << (ScreeningHitNamesItems.from_hash(structure) if structure) end end names = SKIP unless hash.key?('names') # 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. ScreeningHitData.new(dates_of_birth: dates_of_birth, documents: documents, locations: locations, names: names, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/the_plaid_api/models/screening_hit_data.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['dates_of_birth'] = 'dates_of_birth' @_hash['documents'] = 'documents' @_hash['locations'] = 'locations' @_hash['names'] = 'names' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/the_plaid_api/models/screening_hit_data.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/the_plaid_api/models/screening_hit_data.rb', line 39 def self.optionals %w[ dates_of_birth documents locations names ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
134 135 136 137 138 139 |
# File 'lib/the_plaid_api/models/screening_hit_data.rb', line 134 def inspect class_name = self.class.name.split('::').last "<#{class_name} dates_of_birth: #{@dates_of_birth.inspect}, documents:"\ " #{@documents.inspect}, locations: #{@locations.inspect}, names: #{@names.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
127 128 129 130 131 |
# File 'lib/the_plaid_api/models/screening_hit_data.rb', line 127 def to_s class_name = self.class.name.split('::').last "<#{class_name} dates_of_birth: #{@dates_of_birth}, documents: #{@documents}, locations:"\ " #{@locations}, names: #{@names}, additional_properties: #{@additional_properties}>" end |