Class: FdxV660Api::AccountHolderEntity
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FdxV660Api::AccountHolderEntity
- Defined in:
- lib/fdx_v660_api/models/account_holder_entity.rb
Overview
Extends Customer and adds a relationship field to define the customer's
relationship with an account
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.
-
#relationship ⇒ AccountHolderRelationship1
Customer's relationship to the account.
-
#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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
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, relationship: SKIP, additional_properties: nil) ⇒ AccountHolderEntity
constructor
A new instance of AccountHolderEntity.
-
#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, relationship: SKIP, additional_properties: nil) ⇒ AccountHolderEntity
Returns a new instance of AccountHolderEntity.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 124 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, relationship: 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 @relationship = relationship unless relationship == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#accounts ⇒ Array[CustomerToAccountRelationshipEntity]
List of accounts related to this customer
71 72 73 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 71 def accounts @accounts end |
#addresses ⇒ Array[DeliveryAddress]
Array of the contact physical addresses
19 20 21 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 19 def addresses @addresses end |
#business_customer ⇒ BusinessCustomerEntity2
The business customer information, only used if 'type' is 'BUSINESS'.
59 60 61 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 59 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
47 48 49 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 47 def customer_id @customer_id end |
#customer_start_date ⇒ Date
The customer's start date at the financial institution
63 64 65 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 63 def customer_start_date @customer_start_date end |
#date_of_birth ⇒ Date
The person's date of birth
27 28 29 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 27 def date_of_birth @date_of_birth end |
#emails ⇒ Array[String]
Array of the contact email addresses
15 16 17 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 15 def emails @emails end |
#government_id ⇒ String
A federal (such as passport) or state (such as driver's license) issued identifier
42 43 44 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 42 def government_id @government_id end |
#last_activity_date ⇒ Date
The customer's date of last account activity at the financial institution
67 68 69 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 67 def last_activity_date @last_activity_date end |
#name ⇒ CustomerNameEntity3
The customer's name
55 56 57 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 55 def name @name end |
#relationship ⇒ AccountHolderRelationship1
Customer's relationship to the account
75 76 77 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 75 def relationship @relationship 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.)
33 34 35 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 33 def tax_id @tax_id end |
#tax_id_country ⇒ Iso3166CountryCode2
Country originating the Customer's taxId element
37 38 39 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 37 def tax_id_country @tax_id_country end |
#telephones ⇒ Array[TelephoneNumberPlusExtension]
Array of the contact telephone numbers, with extension if any
23 24 25 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 23 def telephones @telephones end |
#type ⇒ BusinessOrConsumerType3
Type of entity. One of BUSINESS or CONSUMER
51 52 53 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 51 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 153 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') relationship = hash.key?('relationship') ? hash['relationship'] : 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. AccountHolderEntity.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, relationship: relationship, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 78 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['relationship'] = 'relationship' @_hash end |
.nullables ⇒ Object
An array for nullable fields
120 121 122 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 120 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 99 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 relationship ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
231 232 233 234 235 236 237 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 231 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
252 253 254 255 256 257 258 259 260 261 262 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 252 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}, relationship:"\ " #{@relationship.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
240 241 242 243 244 245 246 247 248 249 |
# File 'lib/fdx_v660_api/models/account_holder_entity.rb', line 240 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}, relationship: #{@relationship}, additional_properties:"\ " #{@additional_properties}>" end |