Class: ThePlaidApi::ClientUserIdentityAddress
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::ClientUserIdentityAddress
- Defined in:
- lib/the_plaid_api/models/client_user_identity_address.rb
Overview
User address information.
Instance Attribute Summary collapse
-
#city ⇒ String
City name.
-
#country ⇒ String
Country code.
-
#postal_code ⇒ String
Postal or ZIP code.
-
#primary ⇒ TrueClass | FalseClass
Indicates whether this is the primary address for the User.
-
#region ⇒ String
State, province or region.
-
#street_1 ⇒ String
First line of street address.
-
#street_2 ⇒ String
Second line of street address.
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(country:, primary:, street_1: SKIP, street_2: SKIP, city: SKIP, region: SKIP, postal_code: SKIP, additional_properties: nil) ⇒ ClientUserIdentityAddress
constructor
A new instance of ClientUserIdentityAddress.
-
#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(country:, primary:, street_1: SKIP, street_2: SKIP, city: SKIP, region: SKIP, postal_code: SKIP, additional_properties: nil) ⇒ ClientUserIdentityAddress
Returns a new instance of ClientUserIdentityAddress.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/the_plaid_api/models/client_user_identity_address.rb', line 75 def initialize(country:, primary:, street_1: SKIP, street_2: SKIP, city: SKIP, region: SKIP, postal_code: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @street_1 = street_1 unless street_1 == SKIP @street_2 = street_2 unless street_2 == SKIP @city = city unless city == SKIP @region = region unless region == SKIP @country = country @postal_code = postal_code unless postal_code == SKIP @primary = primary @additional_properties = additional_properties end |
Instance Attribute Details
#city ⇒ String
City name.
22 23 24 |
# File 'lib/the_plaid_api/models/client_user_identity_address.rb', line 22 def city @city end |
#country ⇒ String
Country code.
30 31 32 |
# File 'lib/the_plaid_api/models/client_user_identity_address.rb', line 30 def country @country end |
#postal_code ⇒ String
Postal or ZIP code.
34 35 36 |
# File 'lib/the_plaid_api/models/client_user_identity_address.rb', line 34 def postal_code @postal_code end |
#primary ⇒ TrueClass | FalseClass
Indicates whether this is the primary address for the User.
38 39 40 |
# File 'lib/the_plaid_api/models/client_user_identity_address.rb', line 38 def primary @primary end |
#region ⇒ String
State, province or region.
26 27 28 |
# File 'lib/the_plaid_api/models/client_user_identity_address.rb', line 26 def region @region end |
#street_1 ⇒ String
First line of street address.
14 15 16 |
# File 'lib/the_plaid_api/models/client_user_identity_address.rb', line 14 def street_1 @street_1 end |
#street_2 ⇒ String
Second line of street address.
18 19 20 |
# File 'lib/the_plaid_api/models/client_user_identity_address.rb', line 18 def street_2 @street_2 end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 118 119 120 |
# File 'lib/the_plaid_api/models/client_user_identity_address.rb', line 92 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. country = hash.key?('country') ? hash['country'] : nil primary = hash.key?('primary') ? hash['primary'] : nil street_1 = hash.key?('street_1') ? hash['street_1'] : SKIP street_2 = hash.key?('street_2') ? hash['street_2'] : SKIP city = hash.key?('city') ? hash['city'] : SKIP region = hash.key?('region') ? hash['region'] : SKIP postal_code = hash.key?('postal_code') ? hash['postal_code'] : 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. ClientUserIdentityAddress.new(country: country, primary: primary, street_1: street_1, street_2: street_2, city: city, region: region, postal_code: postal_code, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/the_plaid_api/models/client_user_identity_address.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['street_1'] = 'street_1' @_hash['street_2'] = 'street_2' @_hash['city'] = 'city' @_hash['region'] = 'region' @_hash['country'] = 'country' @_hash['postal_code'] = 'postal_code' @_hash['primary'] = 'primary' @_hash end |
.nullables ⇒ Object
An array for nullable fields
65 66 67 68 69 70 71 72 73 |
# File 'lib/the_plaid_api/models/client_user_identity_address.rb', line 65 def self.nullables %w[ street_1 street_2 city region postal_code ] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 62 |
# File 'lib/the_plaid_api/models/client_user_identity_address.rb', line 54 def self.optionals %w[ street_1 street_2 city region postal_code ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
131 132 133 134 135 136 137 |
# File 'lib/the_plaid_api/models/client_user_identity_address.rb', line 131 def inspect class_name = self.class.name.split('::').last "<#{class_name} street_1: #{@street_1.inspect}, street_2: #{@street_2.inspect}, city:"\ " #{@city.inspect}, region: #{@region.inspect}, country: #{@country.inspect}, postal_code:"\ " #{@postal_code.inspect}, primary: #{@primary.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
123 124 125 126 127 128 |
# File 'lib/the_plaid_api/models/client_user_identity_address.rb', line 123 def to_s class_name = self.class.name.split('::').last "<#{class_name} street_1: #{@street_1}, street_2: #{@street_2}, city: #{@city}, region:"\ " #{@region}, country: #{@country}, postal_code: #{@postal_code}, primary: #{@primary},"\ " additional_properties: #{@additional_properties}>" end |