Class: FdxV660Api::CustomerEntity
- Defined in:
- lib/fdx_v660_api/models/customer_entity.rb
Overview
Represents a customer
Instance Attribute Summary collapse
-
#accounts ⇒ Array[CustomerToAccountRelationshipEntity]
List of accounts related to this customer.
-
#addresses ⇒ Array[DeliveryAddress]
Array of the contact physical addresses.
-
#business_customer ⇒ BusinessCustomerEntity2
The business customer information, only used if 'type' is 'BUSINESS'.
-
#customer_id ⇒ String
Long-term persistent identity of the customer.
-
#customer_start_date ⇒ Date
The customer's start date at the financial institution.
-
#date_of_birth ⇒ Date
The person's date of birth.
-
#emails ⇒ Array[String]
Array of the contact email addresses.
-
#government_id ⇒ String
A federal (such as passport) or state (such as driver's license) issued identifier.
-
#last_activity_date ⇒ Date
The customer's date of last account activity at the financial institution.
-
#name ⇒ CustomerNameEntity3
The customer's name.
-
#tax_id ⇒ String
Country specific Tax Id associated with this customer.
-
#tax_id_country ⇒ Iso3166CountryCode2
Country originating the Customer's taxId element.
-
#telephones ⇒ Array[TelephoneNumberPlusExtension]
Array of the contact telephone numbers, with extension if any.
-
#type ⇒ BusinessOrConsumerType3
Type of entity.
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(emails: SKIP, addresses: SKIP, telephones: SKIP, date_of_birth: SKIP, tax_id: SKIP, tax_id_country: SKIP, government_id: SKIP, customer_id: SKIP, type: SKIP, name: SKIP, business_customer: SKIP, customer_start_date: SKIP, last_activity_date: SKIP, accounts: SKIP, additional_properties: nil) ⇒ CustomerEntity
constructor
A new instance of CustomerEntity.
-
#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(emails: SKIP, addresses: SKIP, telephones: SKIP, date_of_birth: SKIP, tax_id: SKIP, tax_id_country: SKIP, government_id: SKIP, customer_id: SKIP, type: SKIP, name: SKIP, business_customer: SKIP, customer_start_date: SKIP, last_activity_date: SKIP, accounts: SKIP, additional_properties: nil) ⇒ CustomerEntity
Returns a new instance of CustomerEntity.
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 117 def initialize(emails: SKIP, addresses: SKIP, telephones: SKIP, date_of_birth: SKIP, tax_id: SKIP, tax_id_country: SKIP, government_id: SKIP, customer_id: SKIP, type: SKIP, name: SKIP, business_customer: SKIP, customer_start_date: SKIP, last_activity_date: SKIP, accounts: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @emails = emails unless emails == SKIP @addresses = addresses unless addresses == SKIP @telephones = telephones unless telephones == SKIP @date_of_birth = date_of_birth unless date_of_birth == SKIP @tax_id = tax_id unless tax_id == SKIP @tax_id_country = tax_id_country unless tax_id_country == SKIP @government_id = government_id unless government_id == SKIP @customer_id = customer_id unless customer_id == SKIP @type = type unless type == SKIP @name = name unless name == SKIP @business_customer = business_customer unless business_customer == SKIP @customer_start_date = customer_start_date unless customer_start_date == SKIP @last_activity_date = last_activity_date unless last_activity_date == SKIP @accounts = accounts unless accounts == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#accounts ⇒ Array[CustomerToAccountRelationshipEntity]
List of accounts related to this customer
70 71 72 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 70 def accounts @accounts end |
#addresses ⇒ Array[DeliveryAddress]
Array of the contact physical addresses
18 19 20 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 18 def addresses @addresses end |
#business_customer ⇒ BusinessCustomerEntity2
The business customer information, only used if 'type' is 'BUSINESS'.
58 59 60 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 58 def business_customer @business_customer end |
#customer_id ⇒ String
Long-term persistent identity of the customer. This identity must be unique to the owning institution
46 47 48 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 46 def customer_id @customer_id end |
#customer_start_date ⇒ Date
The customer's start date at the financial institution
62 63 64 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 62 def customer_start_date @customer_start_date end |
#date_of_birth ⇒ Date
The person's date of birth
26 27 28 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 26 def date_of_birth @date_of_birth end |
#emails ⇒ Array[String]
Array of the contact email addresses
14 15 16 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 14 def emails @emails end |
#government_id ⇒ String
A federal (such as passport) or state (such as driver's license) issued identifier
41 42 43 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 41 def government_id @government_id end |
#last_activity_date ⇒ Date
The customer's date of last account activity at the financial institution
66 67 68 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 66 def last_activity_date @last_activity_date end |
#name ⇒ CustomerNameEntity3
The customer's name
54 55 56 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 54 def name @name end |
#tax_id ⇒ String
Country specific Tax Id associated with this customer. Masked as last four, e.g. xxx-xx-0123, or passed in encrypted payload. (SIN or NAS in Canada, SSN or TIN in US, etc.)
32 33 34 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 32 def tax_id @tax_id end |
#tax_id_country ⇒ Iso3166CountryCode2
Country originating the Customer's taxId element
36 37 38 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 36 def tax_id_country @tax_id_country end |
#telephones ⇒ Array[TelephoneNumberPlusExtension]
Array of the contact telephone numbers, with extension if any
22 23 24 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 22 def telephones @telephones end |
#type ⇒ BusinessOrConsumerType3
Type of entity. One of BUSINESS or CONSUMER
50 51 52 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 50 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 144 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. emails = hash.key?('emails') ? hash['emails'] : SKIP # Parameter is an array, so we need to iterate through it addresses = nil unless hash['addresses'].nil? addresses = [] hash['addresses'].each do |structure| addresses << (DeliveryAddress.from_hash(structure) if structure) end end addresses = SKIP unless hash.key?('addresses') # Parameter is an array, so we need to iterate through it telephones = nil unless hash['telephones'].nil? telephones = [] hash['telephones'].each do |structure| telephones << (TelephoneNumberPlusExtension.from_hash(structure) if structure) end end telephones = SKIP unless hash.key?('telephones') date_of_birth = hash.key?('dateOfBirth') ? hash['dateOfBirth'] : SKIP tax_id = hash.key?('taxId') ? hash['taxId'] : SKIP tax_id_country = hash.key?('taxIdCountry') ? hash['taxIdCountry'] : SKIP government_id = hash.key?('governmentId') ? hash['governmentId'] : SKIP customer_id = hash.key?('customerId') ? hash['customerId'] : SKIP type = hash.key?('type') ? hash['type'] : SKIP name = CustomerNameEntity3.from_hash(hash['name']) if hash['name'] business_customer = BusinessCustomerEntity2.from_hash(hash['businessCustomer']) if hash['businessCustomer'] customer_start_date = hash.key?('customerStartDate') ? hash['customerStartDate'] : SKIP last_activity_date = hash.key?('lastActivityDate') ? hash['lastActivityDate'] : SKIP # Parameter is an array, so we need to iterate through it accounts = nil unless hash['accounts'].nil? accounts = [] hash['accounts'].each do |structure| accounts << (CustomerToAccountRelationshipEntity.from_hash(structure) if structure) end end accounts = SKIP unless hash.key?('accounts') # 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. CustomerEntity.new(emails: emails, addresses: addresses, telephones: telephones, date_of_birth: date_of_birth, tax_id: tax_id, tax_id_country: tax_id_country, government_id: government_id, customer_id: customer_id, type: type, name: name, business_customer: business_customer, customer_start_date: customer_start_date, last_activity_date: last_activity_date, accounts: accounts, additional_properties: additional_properties) end |
.names ⇒ Object
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 89 90 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 73 def self.names @_hash = {} if @_hash.nil? @_hash['emails'] = 'emails' @_hash['addresses'] = 'addresses' @_hash['telephones'] = 'telephones' @_hash['date_of_birth'] = 'dateOfBirth' @_hash['tax_id'] = 'taxId' @_hash['tax_id_country'] = 'taxIdCountry' @_hash['government_id'] = 'governmentId' @_hash['customer_id'] = 'customerId' @_hash['type'] = 'type' @_hash['name'] = 'name' @_hash['business_customer'] = 'businessCustomer' @_hash['customer_start_date'] = 'customerStartDate' @_hash['last_activity_date'] = 'lastActivityDate' @_hash['accounts'] = 'accounts' @_hash end |
.nullables ⇒ Object
An array for nullable fields
113 114 115 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 113 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 93 def self.optionals %w[ emails addresses telephones date_of_birth tax_id tax_id_country government_id customer_id type name business_customer customer_start_date last_activity_date accounts ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 230 def inspect class_name = self.class.name.split('::').last "<#{class_name} emails: #{@emails.inspect}, addresses: #{@addresses.inspect}, telephones:"\ " #{@telephones.inspect}, date_of_birth: #{@date_of_birth.inspect}, tax_id:"\ " #{@tax_id.inspect}, tax_id_country: #{@tax_id_country.inspect}, government_id:"\ " #{@government_id.inspect}, customer_id: #{@customer_id.inspect}, type: #{@type.inspect},"\ " name: #{@name.inspect}, business_customer: #{@business_customer.inspect},"\ " customer_start_date: #{@customer_start_date.inspect}, last_activity_date:"\ " #{@last_activity_date.inspect}, accounts: #{@accounts.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
219 220 221 222 223 224 225 226 227 |
# File 'lib/fdx_v660_api/models/customer_entity.rb', line 219 def to_s class_name = self.class.name.split('::').last "<#{class_name} emails: #{@emails}, addresses: #{@addresses}, telephones: #{@telephones},"\ " date_of_birth: #{@date_of_birth}, tax_id: #{@tax_id}, tax_id_country: #{@tax_id_country},"\ " government_id: #{@government_id}, customer_id: #{@customer_id}, type: #{@type}, name:"\ " #{@name}, business_customer: #{@business_customer}, customer_start_date:"\ " #{@customer_start_date}, last_activity_date: #{@last_activity_date}, accounts:"\ " #{@accounts}, additional_properties: #{@additional_properties}>" end |