Class: ThePlaidApi::BusinessDigitalPresenceCheck

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

Overview

Results from the digital presence 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:, address:, phone_number:, email_address:, website:, website_analysis:, additional_properties: nil) ⇒ BusinessDigitalPresenceCheck

Returns a new instance of BusinessDigitalPresenceCheck.



70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/the_plaid_api/models/business_digital_presence_check.rb', line 70

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

  @status = status
  @score = score
  @address = address
  @phone_number = phone_number
  @email_address = email_address
  @website = website
  @website_analysis = website_analysis
  @additional_properties = additional_properties
end

Instance Attribute Details

#addressBusinessFieldMatchSummary

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



23
24
25
# File 'lib/the_plaid_api/models/business_digital_presence_check.rb', line 23

def address
  @address
end

#email_addressBusinessFieldMatchSummary

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



33
34
35
# File 'lib/the_plaid_api/models/business_digital_presence_check.rb', line 33

def email_address
  @email_address
end

#phone_numberBusinessFieldMatchSummary

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



28
29
30
# File 'lib/the_plaid_api/models/business_digital_presence_check.rb', line 28

def phone_number
  @phone_number
end

#scoreInteger

A score from 0 to 100 indicating digital presence confidence.

Returns:

  • (Integer)


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

def score
  @score
end

#statusBusinessVerificationStatus3

Status of the digital presence check



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

def status
  @status
end

#websiteBusinessFieldMatchSummary

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



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

def website
  @website
end

#website_analysisBusinessWebsiteAnalysis

Website analysis details if a website is found for the provided website in the search terms.



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

def website_analysis
  @website_analysis
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

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
  address = BusinessFieldMatchSummary.from_hash(hash['address']) if hash['address']
  phone_number = BusinessFieldMatchSummary.from_hash(hash['phone_number']) if
    hash['phone_number']
  email_address = BusinessFieldMatchSummary.from_hash(hash['email_address']) if
    hash['email_address']
  website = BusinessFieldMatchSummary.from_hash(hash['website']) if hash['website']
  website_analysis = BusinessWebsiteAnalysis.from_hash(hash['website_analysis']) if
    hash['website_analysis']

  # 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.
  BusinessDigitalPresenceCheck.new(status: status,
                                   score: score,
                                   address: address,
                                   phone_number: phone_number,
                                   email_address: email_address,
                                   website: website,
                                   website_analysis: website_analysis,
                                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/the_plaid_api/models/business_digital_presence_check.rb', line 46

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

.nullablesObject

An array for nullable fields



64
65
66
67
68
# File 'lib/the_plaid_api/models/business_digital_presence_check.rb', line 64

def self.nullables
  %w[
    website_analysis
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



128
129
130
131
132
133
134
# File 'lib/the_plaid_api/models/business_digital_presence_check.rb', line 128

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

#to_sObject

Provides a human-readable string representation of the object.



120
121
122
123
124
125
# File 'lib/the_plaid_api/models/business_digital_presence_check.rb', line 120

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