Class: FdxV660Api::AccountDescriptorEntity

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/fdx_v660_api/models/account_descriptor_entity.rb

Overview

This descriptor provides minimal information about the account for use in lightweight arrays

Direct Known Subclasses

AccountEntity

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(account_category: 'Account Descriptor entity', account_id: SKIP, parent_account_id: SKIP, error: SKIP, account_type: SKIP, domicile: SKIP, account_number: SKIP, account_number_display: SKIP, product_id: SKIP, product_name: SKIP, nickname: SKIP, status: SKIP, description: SKIP, account_open_date: SKIP, account_close_date: SKIP, currency: SKIP, data_clusters: SKIP, transfer_out_use_cases: SKIP, fi_attributes: SKIP, links: SKIP, additional_properties: nil) ⇒ AccountDescriptorEntity

Returns a new instance of AccountDescriptorEntity.



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
228
229
230
231
232
233
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 200

def initialize(account_category: 'Account Descriptor entity',
               account_id: SKIP, parent_account_id: SKIP, error: SKIP,
               account_type: SKIP, domicile: SKIP, account_number: SKIP,
               account_number_display: SKIP, product_id: SKIP,
               product_name: SKIP, nickname: SKIP, status: SKIP,
               description: SKIP, account_open_date: SKIP,
               account_close_date: SKIP, currency: SKIP,
               data_clusters: SKIP, transfer_out_use_cases: SKIP,
               fi_attributes: SKIP, links: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @account_category =  unless  == SKIP
  @account_id =  unless  == SKIP
  @parent_account_id =  unless  == SKIP
  @error = error unless error == SKIP
  @account_type =  unless  == SKIP
  @domicile = domicile unless domicile == SKIP
  @account_number =  unless  == SKIP
  @account_number_display =  unless  == SKIP
  @product_id = product_id unless product_id == SKIP
  @product_name = product_name unless product_name == SKIP
  @nickname = nickname unless nickname == SKIP
  @status = status unless status == SKIP
  @description = description unless description == SKIP
  @account_open_date =  unless  == SKIP
  @account_close_date =  unless  == SKIP
  @currency = currency unless currency == SKIP
  @data_clusters = data_clusters unless data_clusters == SKIP
  @transfer_out_use_cases = transfer_out_use_cases unless transfer_out_use_cases == SKIP
  @fi_attributes = fi_attributes unless fi_attributes == SKIP
  @links = links unless links == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_categoryString

TODO: Write general description for this method

Returns:

  • (String)


15
16
17
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 15

def 
  @account_category
end

#account_close_dateDate

Account closing date

Returns:

  • (Date)


81
82
83
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 81

def 
  @account_close_date
end

#account_idString

Long-term persistent identity of the account, though not an account number. This identity must be unique to the owning institution

Returns:

  • (String)


20
21
22
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 20

def 
  @account_id
end

#account_numberString

Full account number for the end user for this account at the owning institution. If not masked this is sensitive data which should only be exchanged if encrypted. Deprecated with FDX v6.4, instead return through the getAccountPaymentNetworks operation as either identifier of TOKENIZED_ACCOUNT_NUMBER or as encrypted payload with identifier of ACCOUNT_NUMBER

Returns:

  • (String)


46
47
48
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 46

def 
  @account_number
end

#account_number_displayString

Account display number for the end user's handle at the owning institution. This is to be displayed by the Interface Provider

Returns:

  • (String)


51
52
53
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 51

def 
  @account_number_display
end

#account_open_dateDate

Account opening date

Returns:

  • (Date)


77
78
79
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 77

def 
  @account_open_date
end

#account_typeAccountType3

Account type

Returns:



33
34
35
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 33

def 
  @account_type
end

#currencyCurrencyEntity4

Account currency

Returns:



85
86
87
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 85

def currency
  @currency
end

#data_clustersArray[DataCluster]

An array of supported data cluster scopes for this account. I.e. ACCOUNT_DETAILED, TRANSACTIONS, STATEMENTS, REWARDS, etc.

Returns:



90
91
92
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 90

def data_clusters
  @data_clusters
end

#descriptionString

Description of account

Returns:

  • (String)


73
74
75
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 73

def description
  @description
end

#domicileDomicileEntity3

The country and region of the account's legal jurisdiction

Returns:



37
38
39
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 37

def domicile
  @domicile
end

#errorError3

Present if an error was encountered while retrieving this account

Returns:



29
30
31
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 29

def error
  @error
end

#fi_attributesArray[FiAttributeEntity]

Array of Financial institution-specific attributes

Returns:



102
103
104
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 102

def fi_attributes
  @fi_attributes
end

Links (unique to this Account and consent) for the additional data APIs supported by Data Provider for this account and customer consent. A link's rel value can contain a data cluster or space-delimited list of data clusters which link to the referenced data type(s), for example:

* `ACCOUNT_DETAILED` - Link to the account's details via

/accounts/{accountId}

  • PAYMENT_SUPPORT - Link to the account's ID and bank ID for payments or transfers via /accounts/{accountId}/payment-networks
  • CUSTOMER_CONTACT - Link to the account's customer contact details via /accounts/{accountId}/contact
  • TRANSACTIONS - Link to the account's transactions list via /accounts/{accountId}/transactions
  • REWARDS - Link to the account's reward program via /reward-programs/{rewardProgramId}
  • TRANSACTIONS REWARDS - Specific link to the account's transaction rewards via /accounts/{accountId}/reward-transactions
  • STATEMENTS - Link to the account's statements list via /accounts/{accountId}/statements

Returns:



123
124
125
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 123

def links
  @links
end

#nicknameString

Name given by the user. Used in UIs to assist in account selection

Returns:

  • (String)


64
65
66
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 64

def nickname
  @nickname
end

#parent_account_idString

Long-term persistent identity of the parent account. This is used to group accounts

Returns:

  • (String)


25
26
27
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 25

def 
  @parent_account_id
end

#product_idString

Unique ID of the marketed product for this account

Returns:

  • (String)


55
56
57
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 55

def product_id
  @product_id
end

#product_nameString

Marketed product name for this account. Used in UIs to assist in account selection

Returns:

  • (String)


60
61
62
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 60

def product_name
  @product_name
end

#statusAccountStatus3

Account status. Suggested values are: OPEN, CLOSED, PENDINGOPEN, PENDINGCLOSE, PAID, DELINQUENT, NEGATIVECURRENTBALANCE, RESTRICTED

Returns:



69
70
71
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 69

def status
  @status
end

#transfer_out_use_casesArray[TransferOutUseCase]

Account-level outgoing-transfer use cases supported by this LIMITEDPURPOSECHECKING account, made available for lightweight account selection. This field does not describe payment rails, payment network identifiers, routing details, account numbers, tokenized account numbers, or transfer amount limits

Returns:



98
99
100
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 98

def transfer_out_use_cases
  @transfer_out_use_cases
end

Class Method Details

.discriminatorsObject

Discriminators mapping.



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 126

def self.discriminators
  if @_discriminators.nil?
    @_discriminators = {}
    @_discriminators['Account entity'] = AccountEntity
    @_discriminators['Annuity Account entity'] = AnnuityAccountEntity
    @_discriminators['Buy Now Pay Later Account entity'] = BuyNowPayLaterAccountEntity
    @_discriminators['Commercial Account entity'] = CommercialAccountEntity
    @_discriminators['Deposit Account entity'] = DepositAccountEntity
    @_discriminators['Digital Wallet account entity'] = DigitalWalletAccountEntity
    @_discriminators['Insurance Account entity'] = InsuranceAccountEntity
    @_discriminators['Investment Account entity'] = InvestmentAccountEntity
    @_discriminators['Line of Credit Account entity'] = LineOfCreditAccountEntity
    @_discriminators['Loan Account entity'] = LoanAccountEntity
  end
  @_discriminators
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 236

def self.from_hash(hash)
  return nil unless hash

  # Delegate unboxing to another function if a discriminator
  # value for a child class is present.
  unboxer = discriminators[hash['accountCategory']]
  return unboxer.send(:from_hash, hash) if unboxer

  # Extract variables from the hash.
   = hash['accountCategory'] ||= 'Account Descriptor entity'
   = hash.key?('accountId') ? hash['accountId'] : SKIP
   =
    hash.key?('parentAccountId') ? hash['parentAccountId'] : SKIP
  error = Error3.from_hash(hash['error']) if hash['error']
   = hash.key?('accountType') ? hash['accountType'] : SKIP
  domicile = DomicileEntity3.from_hash(hash['domicile']) if hash['domicile']
   = hash.key?('accountNumber') ? hash['accountNumber'] : SKIP
   =
    hash.key?('accountNumberDisplay') ? hash['accountNumberDisplay'] : SKIP
  product_id = hash.key?('productId') ? hash['productId'] : SKIP
  product_name = hash.key?('productName') ? hash['productName'] : SKIP
  nickname = hash.key?('nickname') ? hash['nickname'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  description = hash.key?('description') ? hash['description'] : SKIP
   =
    hash.key?('accountOpenDate') ? hash['accountOpenDate'] : SKIP
   =
    hash.key?('accountCloseDate') ? hash['accountCloseDate'] : SKIP
  currency = CurrencyEntity4.from_hash(hash['currency']) if hash['currency']
  data_clusters = hash.key?('dataClusters') ? hash['dataClusters'] : SKIP
  transfer_out_use_cases =
    hash.key?('transferOutUseCases') ? hash['transferOutUseCases'] : SKIP
  # Parameter is an array, so we need to iterate through it
  fi_attributes = nil
  unless hash['fiAttributes'].nil?
    fi_attributes = []
    hash['fiAttributes'].each do |structure|
      fi_attributes << (FiAttributeEntity.from_hash(structure) if structure)
    end
  end

  fi_attributes = SKIP unless hash.key?('fiAttributes')
  # Parameter is an array, so we need to iterate through it
  links = nil
  unless hash['links'].nil?
    links = []
    hash['links'].each do |structure|
      links << (HateoasLink.from_hash(structure) if structure)
    end
  end

  links = SKIP unless hash.key?('links')

  # 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.
  AccountDescriptorEntity.new(account_category: ,
                              account_id: ,
                              parent_account_id: ,
                              error: error,
                              account_type: ,
                              domicile: domicile,
                              account_number: ,
                              account_number_display: ,
                              product_id: product_id,
                              product_name: product_name,
                              nickname: nickname,
                              status: status,
                              description: description,
                              account_open_date: ,
                              account_close_date: ,
                              currency: currency,
                              data_clusters: data_clusters,
                              transfer_out_use_cases: transfer_out_use_cases,
                              fi_attributes: fi_attributes,
                              links: links,
                              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 144

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_category'] = 'accountCategory'
  @_hash['account_id'] = 'accountId'
  @_hash['parent_account_id'] = 'parentAccountId'
  @_hash['error'] = 'error'
  @_hash['account_type'] = 'accountType'
  @_hash['domicile'] = 'domicile'
  @_hash['account_number'] = 'accountNumber'
  @_hash['account_number_display'] = 'accountNumberDisplay'
  @_hash['product_id'] = 'productId'
  @_hash['product_name'] = 'productName'
  @_hash['nickname'] = 'nickname'
  @_hash['status'] = 'status'
  @_hash['description'] = 'description'
  @_hash['account_open_date'] = 'accountOpenDate'
  @_hash['account_close_date'] = 'accountCloseDate'
  @_hash['currency'] = 'currency'
  @_hash['data_clusters'] = 'dataClusters'
  @_hash['transfer_out_use_cases'] = 'transferOutUseCases'
  @_hash['fi_attributes'] = 'fiAttributes'
  @_hash['links'] = 'links'
  @_hash
end

.nullablesObject

An array for nullable fields



196
197
198
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 196

def self.nullables
  []
end

.optionalsObject

An array for optional fields



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 170

def self.optionals
  %w[
    account_category
    account_id
    parent_account_id
    error
    account_type
    domicile
    account_number
    account_number_display
    product_id
    product_name
    nickname
    status
    description
    account_open_date
    account_close_date
    currency
    data_clusters
    transfer_out_use_cases
    fi_attributes
    links
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



335
336
337
338
339
340
341
342
343
344
345
346
347
348
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 335

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} account_category: #{@account_category.inspect}, account_id:"\
  " #{@account_id.inspect}, parent_account_id: #{@parent_account_id.inspect}, error:"\
  " #{@error.inspect}, account_type: #{@account_type.inspect}, domicile: #{@domicile.inspect},"\
  " account_number: #{@account_number.inspect}, account_number_display:"\
  " #{@account_number_display.inspect}, product_id: #{@product_id.inspect}, product_name:"\
  " #{@product_name.inspect}, nickname: #{@nickname.inspect}, status: #{@status.inspect},"\
  " description: #{@description.inspect}, account_open_date: #{@account_open_date.inspect},"\
  " account_close_date: #{@account_close_date.inspect}, currency: #{@currency.inspect},"\
  " data_clusters: #{@data_clusters.inspect}, transfer_out_use_cases:"\
  " #{@transfer_out_use_cases.inspect}, fi_attributes: #{@fi_attributes.inspect}, links:"\
  " #{@links.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/fdx_v660_api/models/account_descriptor_entity.rb', line 321

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} account_category: #{@account_category}, account_id: #{@account_id},"\
  " parent_account_id: #{@parent_account_id}, error: #{@error}, account_type:"\
  " #{@account_type}, domicile: #{@domicile}, account_number: #{@account_number},"\
  " account_number_display: #{@account_number_display}, product_id: #{@product_id},"\
  " product_name: #{@product_name}, nickname: #{@nickname}, status: #{@status}, description:"\
  " #{@description}, account_open_date: #{@account_open_date}, account_close_date:"\
  " #{@account_close_date}, currency: #{@currency}, data_clusters: #{@data_clusters},"\
  " transfer_out_use_cases: #{@transfer_out_use_cases}, fi_attributes: #{@fi_attributes},"\
  " links: #{@links}, additional_properties: #{@additional_properties}>"
end