Class: ThePlaidApi::EntityScreeningHitData

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

Overview

Information associated with the entity watchlist hit

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(documents: SKIP, email_addresses: SKIP, locations: SKIP, names: SKIP, phone_numbers: SKIP, urls: SKIP, additional_properties: nil) ⇒ EntityScreeningHitData

Returns a new instance of EntityScreeningHitData.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/the_plaid_api/models/entity_screening_hit_data.rb', line 65

def initialize(documents: SKIP, email_addresses: SKIP, locations: SKIP,
               names: SKIP, phone_numbers: SKIP, urls: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @documents = documents unless documents == SKIP
  @email_addresses = email_addresses unless email_addresses == SKIP
  @locations = locations unless locations == SKIP
  @names = names unless names == SKIP
  @phone_numbers = phone_numbers unless phone_numbers == SKIP
  @urls = urls unless urls == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#documentsArray[EntityScreeningHitDocumentsItems]

Documents associated with the watchlist hit



14
15
16
# File 'lib/the_plaid_api/models/entity_screening_hit_data.rb', line 14

def documents
  @documents
end

#email_addressesArray[EntityScreeningHitEmailsItems]

Email addresses associated with the watchlist hit

Returns:



18
19
20
# File 'lib/the_plaid_api/models/entity_screening_hit_data.rb', line 18

def email_addresses
  @email_addresses
end

#locationsArray[GenericScreeningHitLocationItems]

Locations associated with the watchlist hit



22
23
24
# File 'lib/the_plaid_api/models/entity_screening_hit_data.rb', line 22

def locations
  @locations
end

#namesArray[EntityScreeningHitNamesItems]

Names associated with the watchlist hit

Returns:



26
27
28
# File 'lib/the_plaid_api/models/entity_screening_hit_data.rb', line 26

def names
  @names
end

#phone_numbersArray[EntityScreeningHitsPhoneNumberItems]

Phone numbers associated with the watchlist hit



30
31
32
# File 'lib/the_plaid_api/models/entity_screening_hit_data.rb', line 30

def phone_numbers
  @phone_numbers
end

#urlsArray[EntityScreeningHitUrlsItems]

URLs associated with the watchlist hit

Returns:



34
35
36
# File 'lib/the_plaid_api/models/entity_screening_hit_data.rb', line 34

def urls
  @urls
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/the_plaid_api/models/entity_screening_hit_data.rb', line 81

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
  documents = nil
  unless hash['documents'].nil?
    documents = []
    hash['documents'].each do |structure|
      documents << (EntityScreeningHitDocumentsItems.from_hash(structure) if structure)
    end
  end

  documents = SKIP unless hash.key?('documents')
  # Parameter is an array, so we need to iterate through it
  email_addresses = nil
  unless hash['email_addresses'].nil?
    email_addresses = []
    hash['email_addresses'].each do |structure|
      email_addresses << (EntityScreeningHitEmailsItems.from_hash(structure) if structure)
    end
  end

  email_addresses = SKIP unless hash.key?('email_addresses')
  # 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 << (EntityScreeningHitNamesItems.from_hash(structure) if structure)
    end
  end

  names = SKIP unless hash.key?('names')
  # Parameter is an array, so we need to iterate through it
  phone_numbers = nil
  unless hash['phone_numbers'].nil?
    phone_numbers = []
    hash['phone_numbers'].each do |structure|
      phone_numbers << (EntityScreeningHitsPhoneNumberItems.from_hash(structure) if structure)
    end
  end

  phone_numbers = SKIP unless hash.key?('phone_numbers')
  # Parameter is an array, so we need to iterate through it
  urls = nil
  unless hash['urls'].nil?
    urls = []
    hash['urls'].each do |structure|
      urls << (EntityScreeningHitUrlsItems.from_hash(structure) if structure)
    end
  end

  urls = SKIP unless hash.key?('urls')

  # 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.
  EntityScreeningHitData.new(documents: documents,
                             email_addresses: email_addresses,
                             locations: locations,
                             names: names,
                             phone_numbers: phone_numbers,
                             urls: urls,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
45
46
# File 'lib/the_plaid_api/models/entity_screening_hit_data.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['documents'] = 'documents'
  @_hash['email_addresses'] = 'email_addresses'
  @_hash['locations'] = 'locations'
  @_hash['names'] = 'names'
  @_hash['phone_numbers'] = 'phone_numbers'
  @_hash['urls'] = 'urls'
  @_hash
end

.nullablesObject

An array for nullable fields



61
62
63
# File 'lib/the_plaid_api/models/entity_screening_hit_data.rb', line 61

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
57
58
# File 'lib/the_plaid_api/models/entity_screening_hit_data.rb', line 49

def self.optionals
  %w[
    documents
    email_addresses
    locations
    names
    phone_numbers
    urls
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



172
173
174
175
176
177
178
# File 'lib/the_plaid_api/models/entity_screening_hit_data.rb', line 172

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} documents: #{@documents.inspect}, email_addresses:"\
  " #{@email_addresses.inspect}, locations: #{@locations.inspect}, names: #{@names.inspect},"\
  " phone_numbers: #{@phone_numbers.inspect}, urls: #{@urls.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



164
165
166
167
168
169
# File 'lib/the_plaid_api/models/entity_screening_hit_data.rb', line 164

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} documents: #{@documents}, email_addresses: #{@email_addresses}, locations:"\
  " #{@locations}, names: #{@names}, phone_numbers: #{@phone_numbers}, urls: #{@urls},"\
  " additional_properties: #{@additional_properties}>"
end