Class: FdxV660Api::PaymentGenericAccountEntity1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FdxV660Api::PaymentGenericAccountEntity1
- Defined in:
- lib/fdx_v660_api/models/payment_generic_account_entity1.rb
Overview
Destination account details
Instance Attribute Summary collapse
-
#account_number ⇒ String
Unique identifier of the account number.
-
#account_type ⇒ AccountType3
Account type.
-
#branch ⇒ BranchEntity1
Branch details associated with this account.
-
#currency_code ⇒ Iso4217CurrencyCode5
ISO 4217 currency code.
-
#id ⇒ Object
Identifier of the payment generic account.
-
#name ⇒ String
Account name.
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(account_number: SKIP, account_type: SKIP, name: SKIP, currency_code: SKIP, id: SKIP, branch: SKIP, additional_properties: nil) ⇒ PaymentGenericAccountEntity1
constructor
A new instance of PaymentGenericAccountEntity1.
-
#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(account_number: SKIP, account_type: SKIP, name: SKIP, currency_code: SKIP, id: SKIP, branch: SKIP, additional_properties: nil) ⇒ PaymentGenericAccountEntity1
Returns a new instance of PaymentGenericAccountEntity1.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/fdx_v660_api/models/payment_generic_account_entity1.rb', line 65 def initialize(account_number: SKIP, account_type: SKIP, name: SKIP, currency_code: SKIP, id: SKIP, branch: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account_number = account_number unless account_number == SKIP @account_type = account_type unless account_type == SKIP @name = name unless name == SKIP @currency_code = currency_code unless currency_code == SKIP @id = id unless id == SKIP @branch = branch unless branch == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_number ⇒ String
Unique identifier of the account number
14 15 16 |
# File 'lib/fdx_v660_api/models/payment_generic_account_entity1.rb', line 14 def account_number @account_number end |
#account_type ⇒ AccountType3
Account type
18 19 20 |
# File 'lib/fdx_v660_api/models/payment_generic_account_entity1.rb', line 18 def account_type @account_type end |
#branch ⇒ BranchEntity1
Branch details associated with this account
34 35 36 |
# File 'lib/fdx_v660_api/models/payment_generic_account_entity1.rb', line 34 def branch @branch end |
#currency_code ⇒ Iso4217CurrencyCode5
ISO 4217 currency code
26 27 28 |
# File 'lib/fdx_v660_api/models/payment_generic_account_entity1.rb', line 26 def currency_code @currency_code end |
#id ⇒ Object
Identifier of the payment generic account
30 31 32 |
# File 'lib/fdx_v660_api/models/payment_generic_account_entity1.rb', line 30 def id @id end |
#name ⇒ String
Account name
22 23 24 |
# File 'lib/fdx_v660_api/models/payment_generic_account_entity1.rb', line 22 def name @name 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 109 |
# File 'lib/fdx_v660_api/models/payment_generic_account_entity1.rb', line 81 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_number = hash.key?('accountNumber') ? hash['accountNumber'] : SKIP account_type = hash.key?('accountType') ? hash['accountType'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP currency_code = hash.key?('currencyCode') ? hash['currencyCode'] : SKIP id = hash.key?('id') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:PaymentGenericAccountEntity1Id), hash['id'] ) : SKIP branch = BranchEntity1.from_hash(hash['branch']) if hash['branch'] # 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. PaymentGenericAccountEntity1.new(account_number: account_number, account_type: account_type, name: name, currency_code: currency_code, id: id, branch: branch, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fdx_v660_api/models/payment_generic_account_entity1.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['account_number'] = 'accountNumber' @_hash['account_type'] = 'accountType' @_hash['name'] = 'name' @_hash['currency_code'] = 'currencyCode' @_hash['id'] = 'id' @_hash['branch'] = 'branch' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 |
# File 'lib/fdx_v660_api/models/payment_generic_account_entity1.rb', line 61 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/fdx_v660_api/models/payment_generic_account_entity1.rb', line 49 def self.optionals %w[ account_number account_type name currency_code id branch ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
113 114 115 116 117 118 119 |
# File 'lib/fdx_v660_api/models/payment_generic_account_entity1.rb', line 113 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.
130 131 132 133 134 135 136 |
# File 'lib/fdx_v660_api/models/payment_generic_account_entity1.rb', line 130 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_number: #{@account_number.inspect}, account_type:"\ " #{@account_type.inspect}, name: #{@name.inspect}, currency_code:"\ " #{@currency_code.inspect}, id: #{@id.inspect}, branch: #{@branch.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
122 123 124 125 126 127 |
# File 'lib/fdx_v660_api/models/payment_generic_account_entity1.rb', line 122 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_number: #{@account_number}, account_type: #{@account_type}, name:"\ " #{@name}, currency_code: #{@currency_code}, id: #{@id}, branch: #{@branch},"\ " additional_properties: #{@additional_properties}>" end |