Class: ThePlaidApi::BusinessSearchTerms
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::BusinessSearchTerms
- Defined in:
- lib/the_plaid_api/models/business_search_terms.rb
Overview
The business information that was used to perform the verification search
Instance Attribute Summary collapse
-
#address ⇒ ResponseBusinessAddress
Physical address of a business.
-
#alternative_names ⇒ Array[String]
Alternative business names that were submitted as search inputs.
-
#email_address ⇒ String
A valid email address.
-
#name ⇒ String
The name of the business.
-
#phone_number ⇒ String
A phone number in E.164 format.
-
#website ⇒ String
An ‘http’ or ‘https’ URL (must begin with either of those).
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(name:, alternative_names:, address:, website:, phone_number:, email_address:, additional_properties: nil) ⇒ BusinessSearchTerms
constructor
A new instance of BusinessSearchTerms.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(name:, alternative_names:, address:, website:, phone_number:, email_address:, additional_properties: nil) ⇒ BusinessSearchTerms
Returns a new instance of BusinessSearchTerms.
66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/the_plaid_api/models/business_search_terms.rb', line 66 def initialize(name:, alternative_names:, address:, website:, phone_number:, email_address:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @name = name @alternative_names = alternative_names @address = address @website = website @phone_number = phone_number @email_address = email_address @additional_properties = additional_properties end |
Instance Attribute Details
#address ⇒ ResponseBusinessAddress
Physical address of a business. Used for response schemas.
23 24 25 |
# File 'lib/the_plaid_api/models/business_search_terms.rb', line 23 def address @address end |
#alternative_names ⇒ Array[String]
Alternative business names that were submitted as search inputs.
19 20 21 |
# File 'lib/the_plaid_api/models/business_search_terms.rb', line 19 def alternative_names @alternative_names end |
#email_address ⇒ String
A valid email address. Must not have leading or trailing spaces and address must be RFC compliant. For more information, see [RFC 3696](datatracker.ietf.org/doc/html/rfc3696).
37 38 39 |
# File 'lib/the_plaid_api/models/business_search_terms.rb', line 37 def email_address @email_address end |
#name ⇒ String
The name of the business. Must have at least one character and a maximum length of 500 characters.
15 16 17 |
# File 'lib/the_plaid_api/models/business_search_terms.rb', line 15 def name @name end |
#phone_number ⇒ String
A phone number in E.164 format.
31 32 33 |
# File 'lib/the_plaid_api/models/business_search_terms.rb', line 31 def phone_number @phone_number end |
#website ⇒ String
An ‘http’ or ‘https’ URL (must begin with either of those).
27 28 29 |
# File 'lib/the_plaid_api/models/business_search_terms.rb', line 27 def website @website end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 107 108 |
# File 'lib/the_plaid_api/models/business_search_terms.rb', line 81 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : nil alternative_names = hash.key?('alternative_names') ? hash['alternative_names'] : nil address = ResponseBusinessAddress.from_hash(hash['address']) if hash['address'] website = hash.key?('website') ? hash['website'] : nil phone_number = hash.key?('phone_number') ? hash['phone_number'] : nil email_address = hash.key?('email_address') ? hash['email_address'] : 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. BusinessSearchTerms.new(name: name, alternative_names: alternative_names, address: address, website: website, phone_number: phone_number, email_address: email_address, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/the_plaid_api/models/business_search_terms.rb', line 40 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['alternative_names'] = 'alternative_names' @_hash['address'] = 'address' @_hash['website'] = 'website' @_hash['phone_number'] = 'phone_number' @_hash['email_address'] = 'email_address' @_hash end |
.nullables ⇒ Object
An array for nullable fields
57 58 59 60 61 62 63 64 |
# File 'lib/the_plaid_api/models/business_search_terms.rb', line 57 def self.nullables %w[ name website phone_number email_address ] end |
.optionals ⇒ Object
An array for optional fields
52 53 54 |
# File 'lib/the_plaid_api/models/business_search_terms.rb', line 52 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
119 120 121 122 123 124 125 |
# File 'lib/the_plaid_api/models/business_search_terms.rb', line 119 def inspect class_name = self.class.name.split('::').last "<#{class_name} name: #{@name.inspect}, alternative_names: #{@alternative_names.inspect},"\ " address: #{@address.inspect}, website: #{@website.inspect}, phone_number:"\ " #{@phone_number.inspect}, email_address: #{@email_address.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
111 112 113 114 115 116 |
# File 'lib/the_plaid_api/models/business_search_terms.rb', line 111 def to_s class_name = self.class.name.split('::').last "<#{class_name} name: #{@name}, alternative_names: #{@alternative_names}, address:"\ " #{@address}, website: #{@website}, phone_number: #{@phone_number}, email_address:"\ " #{@email_address}, additional_properties: #{@additional_properties}>" end |