Class: ThePlaidApi::WatchlistScreeningSearchTerms

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

Overview

Search terms for creating an individual watchlist screening

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(watchlist_program_id:, legal_name:, date_of_birth:, document_number:, country:, version:, additional_properties: nil) ⇒ WatchlistScreeningSearchTerms

Returns a new instance of WatchlistScreeningSearchTerms.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/the_plaid_api/models/watchlist_screening_search_terms.rb', line 68

def initialize(watchlist_program_id:, legal_name:, date_of_birth:,
               document_number:, country:, version:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @watchlist_program_id = watchlist_program_id
  @legal_name = legal_name
  @date_of_birth = date_of_birth
  @document_number = document_number
  @country = country
  @version = version
  @additional_properties = additional_properties
end

Instance Attribute Details

#countryString

Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form.

Returns:

  • (String)


35
36
37
# File 'lib/the_plaid_api/models/watchlist_screening_search_terms.rb', line 35

def country
  @country
end

#date_of_birthDate

A date in the format YYYY-MM-DD (RFC 3339 Section 5.6).

Returns:

  • (Date)


24
25
26
# File 'lib/the_plaid_api/models/watchlist_screening_search_terms.rb', line 24

def date_of_birth
  @date_of_birth
end

#document_numberString

The numeric or alphanumeric identifier associated with this document. Must be between 4 and 32 characters long, and cannot have leading or trailing spaces.

Returns:

  • (String)


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

def document_number
  @document_number
end

The legal name of the individual being screened. Must have at least one alphabetical character, have a maximum length of 100 characters, and not include leading or trailing spaces.

Returns:

  • (String)


20
21
22
# File 'lib/the_plaid_api/models/watchlist_screening_search_terms.rb', line 20

def legal_name
  @legal_name
end

#versionInteger

The current version of the search terms. Starts at ‘1` and increments with each edit to `search_terms`.

Returns:

  • (Integer)


40
41
42
# File 'lib/the_plaid_api/models/watchlist_screening_search_terms.rb', line 40

def version
  @version
end

#watchlist_program_idString

ID of the associated program.

Returns:

  • (String)


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

def watchlist_program_id
  @watchlist_program_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/the_plaid_api/models/watchlist_screening_search_terms.rb', line 84

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  watchlist_program_id =
    hash.key?('watchlist_program_id') ? hash['watchlist_program_id'] : nil
  legal_name = hash.key?('legal_name') ? hash['legal_name'] : nil
  date_of_birth = hash.key?('date_of_birth') ? hash['date_of_birth'] : nil
  document_number =
    hash.key?('document_number') ? hash['document_number'] : nil
  country = hash.key?('country') ? hash['country'] : nil
  version = hash.key?('version') ? hash['version'] : nil

  # 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.
  WatchlistScreeningSearchTerms.new(watchlist_program_id: watchlist_program_id,
                                    legal_name: legal_name,
                                    date_of_birth: date_of_birth,
                                    document_number: document_number,
                                    country: country,
                                    version: version,
                                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



43
44
45
46
47
48
49
50
51
52
# File 'lib/the_plaid_api/models/watchlist_screening_search_terms.rb', line 43

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['watchlist_program_id'] = 'watchlist_program_id'
  @_hash['legal_name'] = 'legal_name'
  @_hash['date_of_birth'] = 'date_of_birth'
  @_hash['document_number'] = 'document_number'
  @_hash['country'] = 'country'
  @_hash['version'] = 'version'
  @_hash
end

.nullablesObject

An array for nullable fields



60
61
62
63
64
65
66
# File 'lib/the_plaid_api/models/watchlist_screening_search_terms.rb', line 60

def self.nullables
  %w[
    date_of_birth
    document_number
    country
  ]
end

.optionalsObject

An array for optional fields



55
56
57
# File 'lib/the_plaid_api/models/watchlist_screening_search_terms.rb', line 55

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



123
124
125
126
127
128
129
# File 'lib/the_plaid_api/models/watchlist_screening_search_terms.rb', line 123

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} watchlist_program_id: #{@watchlist_program_id.inspect}, legal_name:"\
  " #{@legal_name.inspect}, date_of_birth: #{@date_of_birth.inspect}, document_number:"\
  " #{@document_number.inspect}, country: #{@country.inspect}, version: #{@version.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



115
116
117
118
119
120
# File 'lib/the_plaid_api/models/watchlist_screening_search_terms.rb', line 115

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} watchlist_program_id: #{@watchlist_program_id}, legal_name: #{@legal_name},"\
  " date_of_birth: #{@date_of_birth}, document_number: #{@document_number}, country:"\
  " #{@country}, version: #{@version}, additional_properties: #{@additional_properties}>"
end