Class: ThePlaidApi::BusinessVerificationCreateResponse

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

Overview

A business verification represents a check of a business’s identity and risk profile, including information collected about the business and results from third-party data providers.

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(id:, client_user_id:, created_at:, completed_at:, redacted_at:, status:, search_terms:, kyb_check:, risk_check:, digital_presence_check:, request_id:, shareable_url:, additional_properties: nil) ⇒ BusinessVerificationCreateResponse

Returns a new instance of BusinessVerificationCreateResponse.



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 107

def initialize(id:, client_user_id:, created_at:, completed_at:,
               redacted_at:, status:, search_terms:, kyb_check:,
               risk_check:, digital_presence_check:, request_id:,
               shareable_url:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id = id
  @client_user_id = client_user_id
  @created_at = created_at
  @completed_at = completed_at
  @redacted_at = redacted_at
  @status = status
  @search_terms = search_terms
  @kyb_check = kyb_check
  @risk_check = risk_check
  @digital_presence_check = digital_presence_check
  @request_id = request_id
  @shareable_url = shareable_url
  @additional_properties = additional_properties
end

Instance Attribute Details

#client_user_idString

A unique ID that identifies the end user in your system. Either a ‘user_id` or the `client_user_id` must be provided. This ID can also be used to associate user-specific data from other Plaid products. Financial Account Matching requires this field and the `/link/token/create` `client_user_id` to be consistent. Personally identifiable information, such as an email address or phone number, should not be used in the `client_user_id`.

Returns:

  • (String)


27
28
29
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 27

def client_user_id
  @client_user_id
end

#completed_atDateTime

An ISO8601 formatted timestamp.

Returns:

  • (DateTime)


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

def completed_at
  @completed_at
end

#created_atDateTime

An ISO8601 formatted timestamp.

Returns:

  • (DateTime)


31
32
33
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 31

def created_at
  @created_at
end

#digital_presence_checkBusinessDigitalPresenceCheck

Results from the digital presence check.



59
60
61
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 59

def digital_presence_check
  @digital_presence_check
end

#idString

ID of the associated business verification.

Returns:

  • (String)


17
18
19
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 17

def id
  @id
end

#kyb_checkBusinessKybCheck

Results from the KYB (Know Your Business) identity verification check

Returns:



51
52
53
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 51

def kyb_check
  @kyb_check
end

#redacted_atDateTime

An ISO8601 formatted timestamp.

Returns:

  • (DateTime)


39
40
41
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 39

def redacted_at
  @redacted_at
end

#request_idString

A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.

Returns:

  • (String)


65
66
67
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 65

def request_id
  @request_id
end

#risk_checkBusinessRiskCheck

Results from the business risk assessment check

Returns:



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

def risk_check
  @risk_check
end

#search_termsBusinessSearchTerms

The business information that was used to perform the verification search

Returns:



47
48
49
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 47

def search_terms
  @search_terms
end

#shareable_urlString

A shareable URL that can be sent directly to the user to complete verification

Returns:

  • (String)


70
71
72
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 70

def shareable_url
  @shareable_url
end

#statusBusinessVerificationStatus2

Status of the overall business verification



43
44
45
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 43

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 130

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : nil
  client_user_id =
    hash.key?('client_user_id') ? hash['client_user_id'] : nil
  created_at = if hash.key?('created_at')
                 (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at'])
               end
  completed_at = if hash.key?('completed_at')
                   (DateTimeHelper.from_rfc3339(hash['completed_at']) if hash['completed_at'])
                 end
  redacted_at = if hash.key?('redacted_at')
                  (DateTimeHelper.from_rfc3339(hash['redacted_at']) if hash['redacted_at'])
                end
  status = hash.key?('status') ? hash['status'] : nil
  search_terms = BusinessSearchTerms.from_hash(hash['search_terms']) if hash['search_terms']
  kyb_check = BusinessKybCheck.from_hash(hash['kyb_check']) if hash['kyb_check']
  risk_check = BusinessRiskCheck.from_hash(hash['risk_check']) if hash['risk_check']
  if hash['digital_presence_check']
    digital_presence_check = BusinessDigitalPresenceCheck.from_hash(hash['digital_presence_check'])
  end
  request_id = hash.key?('request_id') ? hash['request_id'] : nil
  shareable_url = hash.key?('shareable_url') ? hash['shareable_url'] : 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.
  BusinessVerificationCreateResponse.new(id: id,
                                         client_user_id: client_user_id,
                                         created_at: created_at,
                                         completed_at: completed_at,
                                         redacted_at: redacted_at,
                                         status: status,
                                         search_terms: search_terms,
                                         kyb_check: kyb_check,
                                         risk_check: risk_check,
                                         digital_presence_check: digital_presence_check,
                                         request_id: request_id,
                                         shareable_url: shareable_url,
                                         additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 73

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['client_user_id'] = 'client_user_id'
  @_hash['created_at'] = 'created_at'
  @_hash['completed_at'] = 'completed_at'
  @_hash['redacted_at'] = 'redacted_at'
  @_hash['status'] = 'status'
  @_hash['search_terms'] = 'search_terms'
  @_hash['kyb_check'] = 'kyb_check'
  @_hash['risk_check'] = 'risk_check'
  @_hash['digital_presence_check'] = 'digital_presence_check'
  @_hash['request_id'] = 'request_id'
  @_hash['shareable_url'] = 'shareable_url'
  @_hash
end

.nullablesObject

An array for nullable fields



96
97
98
99
100
101
102
103
104
105
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 96

def self.nullables
  %w[
    completed_at
    redacted_at
    kyb_check
    risk_check
    digital_presence_check
    shareable_url
  ]
end

.optionalsObject

An array for optional fields



91
92
93
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 91

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



202
203
204
205
206
207
208
209
210
211
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 202

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, client_user_id: #{@client_user_id.inspect}, created_at:"\
  " #{@created_at.inspect}, completed_at: #{@completed_at.inspect}, redacted_at:"\
  " #{@redacted_at.inspect}, status: #{@status.inspect}, search_terms:"\
  " #{@search_terms.inspect}, kyb_check: #{@kyb_check.inspect}, risk_check:"\
  " #{@risk_check.inspect}, digital_presence_check: #{@digital_presence_check.inspect},"\
  " request_id: #{@request_id.inspect}, shareable_url: #{@shareable_url.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_custom_completed_atObject



183
184
185
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 183

def to_custom_completed_at
  DateTimeHelper.to_rfc3339(completed_at)
end

#to_custom_created_atObject



179
180
181
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 179

def to_custom_created_at
  DateTimeHelper.to_rfc3339(created_at)
end

#to_custom_redacted_atObject



187
188
189
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 187

def to_custom_redacted_at
  DateTimeHelper.to_rfc3339(redacted_at)
end

#to_sObject

Provides a human-readable string representation of the object.



192
193
194
195
196
197
198
199
# File 'lib/the_plaid_api/models/business_verification_create_response.rb', line 192

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, client_user_id: #{@client_user_id}, created_at: #{@created_at},"\
  " completed_at: #{@completed_at}, redacted_at: #{@redacted_at}, status: #{@status},"\
  " search_terms: #{@search_terms}, kyb_check: #{@kyb_check}, risk_check: #{@risk_check},"\
  " digital_presence_check: #{@digital_presence_check}, request_id: #{@request_id},"\
  " shareable_url: #{@shareable_url}, additional_properties: #{@additional_properties}>"
end