Class: ThePlaidApi::BusinessKybCheck

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

Overview

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

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(status:, score:, name:, address:, website:, match_details:, additional_properties: nil) ⇒ BusinessKybCheck

Returns a new instance of BusinessKybCheck.



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

def initialize(status:, score:, name:, address:, website:, match_details:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @status = status
  @score = score
  @name = name
  @address = address
  @website = website
  @match_details = match_details
  @additional_properties = additional_properties
end

Instance Attribute Details

#addressBusinessFieldMatchSummary

Summary of how a specific business field matched against data provider results



29
30
31
# File 'lib/the_plaid_api/models/business_kyb_check.rb', line 29

def address
  @address
end

#match_detailsBusinessKybMatchDetails

Detailed information about the business from data provider results



38
39
40
# File 'lib/the_plaid_api/models/business_kyb_check.rb', line 38

def match_details
  @match_details
end

#nameBusinessFieldMatchSummary

Summary of how a specific business field matched against data provider results



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

def name
  @name
end

#scoreInteger

A score from 0 to 100 indicating the confidence in KYB (Know Your Business) identity assessment for the business

Returns:

  • (Integer)


19
20
21
# File 'lib/the_plaid_api/models/business_kyb_check.rb', line 19

def score
  @score
end

#statusBusinessVerificationStatus

Status of the KYB (Know Your Business) identity assessment check



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

def status
  @status
end

#websiteBusinessFieldMatchSummary

Summary of how a specific business field matched against data provider results



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

def website
  @website
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  status = hash.key?('status') ? hash['status'] : nil
  score = hash.key?('score') ? hash['score'] : nil
  name = BusinessFieldMatchSummary.from_hash(hash['name']) if hash['name']
  address = BusinessFieldMatchSummary.from_hash(hash['address']) if hash['address']
  website = BusinessFieldMatchSummary.from_hash(hash['website']) if hash['website']
  match_details = BusinessKybMatchDetails.from_hash(hash['match_details']) if
    hash['match_details']

  # 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.
  BusinessKybCheck.new(status: status,
                       score: score,
                       name: name,
                       address: address,
                       website: website,
                       match_details: match_details,
                       additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



41
42
43
44
45
46
47
48
49
50
# File 'lib/the_plaid_api/models/business_kyb_check.rb', line 41

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['status'] = 'status'
  @_hash['score'] = 'score'
  @_hash['name'] = 'name'
  @_hash['address'] = 'address'
  @_hash['website'] = 'website'
  @_hash['match_details'] = 'match_details'
  @_hash
end

.nullablesObject

An array for nullable fields



58
59
60
61
62
# File 'lib/the_plaid_api/models/business_kyb_check.rb', line 58

def self.nullables
  %w[
    match_details
  ]
end

.optionalsObject

An array for optional fields



53
54
55
# File 'lib/the_plaid_api/models/business_kyb_check.rb', line 53

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



117
118
119
120
121
122
123
# File 'lib/the_plaid_api/models/business_kyb_check.rb', line 117

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} status: #{@status.inspect}, score: #{@score.inspect}, name:"\
  " #{@name.inspect}, address: #{@address.inspect}, website: #{@website.inspect},"\
  " match_details: #{@match_details.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



109
110
111
112
113
114
# File 'lib/the_plaid_api/models/business_kyb_check.rb', line 109

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} status: #{@status}, score: #{@score}, name: #{@name}, address: #{@address},"\
  " website: #{@website}, match_details: #{@match_details}, additional_properties:"\
  " #{@additional_properties}>"
end