Class: ThePlaidApi::WatchlistScreeningRequestSearchTerms

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

Overview

Search inputs for creating a 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: SKIP, document_number: SKIP, country: SKIP, additional_properties: nil) ⇒ WatchlistScreeningRequestSearchTerms

Returns a new instance of WatchlistScreeningRequestSearchTerms.



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/the_plaid_api/models/watchlist_screening_request_search_terms.rb', line 62

def initialize(watchlist_program_id:, legal_name:, date_of_birth: SKIP,
               document_number: SKIP, country: SKIP,
               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 unless date_of_birth == SKIP
  @document_number = document_number unless document_number == SKIP
  @country = country unless country == SKIP
  @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_request_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_request_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_request_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_request_search_terms.rb', line 20

def legal_name
  @legal_name
end

#watchlist_program_idString

ID of the associated program.

Returns:

  • (String)


14
15
16
# File 'lib/the_plaid_api/models/watchlist_screening_request_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.



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

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'] : SKIP
  document_number =
    hash.key?('document_number') ? hash['document_number'] : SKIP
  country = hash.key?('country') ? hash['country'] : 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.
  WatchlistScreeningRequestSearchTerms.new(watchlist_program_id: watchlist_program_id,
                                           legal_name: legal_name,
                                           date_of_birth: date_of_birth,
                                           document_number: document_number,
                                           country: country,
                                           additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

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
end

.nullablesObject

An array for nullable fields



58
59
60
# File 'lib/the_plaid_api/models/watchlist_screening_request_search_terms.rb', line 58

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

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

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

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}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



106
107
108
109
110
111
# File 'lib/the_plaid_api/models/watchlist_screening_request_search_terms.rb', line 106

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}, additional_properties: #{@additional_properties}>"
end