Class: UnivapayClientSdk::BankTransferLedger

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/univapay_client_sdk/models/bank_transfer_ledger.rb

Overview

Single bank transfer ledger entry associated with a charge.

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(bank_ledger_type: SKIP, amount: SKIP, balance: SKIP, virtual_bank_account_holder_name: SKIP, virtual_bank_account_number: SKIP, virtual_account_id: SKIP, transaction_date: SKIP, transaction_timestamp: SKIP, mode: SKIP, created_on: SKIP, additional_properties: nil) ⇒ BankTransferLedger

Returns a new instance of BankTransferLedger.



91
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
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 91

def initialize(bank_ledger_type: SKIP, amount: SKIP, balance: SKIP,
               virtual_bank_account_holder_name: SKIP,
               virtual_bank_account_number: SKIP, virtual_account_id: SKIP,
               transaction_date: SKIP, transaction_timestamp: SKIP,
               mode: SKIP, created_on: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @bank_ledger_type = bank_ledger_type unless bank_ledger_type == SKIP
  @amount = amount unless amount == SKIP
  @balance = balance unless balance == SKIP
  unless  == SKIP
    @virtual_bank_account_holder_name =
      
  end
  unless  == SKIP
    @virtual_bank_account_number =
      
  end
  @virtual_account_id =  unless  == SKIP
  @transaction_date = transaction_date unless transaction_date == SKIP
  @transaction_timestamp = transaction_timestamp unless transaction_timestamp == SKIP
  @mode = mode unless mode == SKIP
  @created_on = created_on unless created_on == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#amountInteger

Amount in the smallest currency unit.

Returns:

  • (Integer)


19
20
21
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 19

def amount
  @amount
end

#balanceInteger

Current balance in the smallest currency unit.

Returns:

  • (Integer)


23
24
25
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 23

def balance
  @balance
end

#bank_ledger_typeBankTransferLedgerBankLedgerType

Bank Transfer Ledger Bank Ledger Type schema.



15
16
17
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 15

def bank_ledger_type
  @bank_ledger_type
end

#created_onDateTime

Timestamp when the resource was created.

Returns:

  • (DateTime)


51
52
53
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 51

def created_on
  @created_on
end

#modeBankTransferLedgerMode

Bank Transfer Ledger Mode schema.



47
48
49
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 47

def mode
  @mode
end

#transaction_dateDate

Transaction date.

Returns:

  • (Date)


39
40
41
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 39

def transaction_date
  @transaction_date
end

#transaction_timestampDateTime

Transaction timestamp.

Returns:

  • (DateTime)


43
44
45
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 43

def transaction_timestamp
  @transaction_timestamp
end

#virtual_account_idString

Virtual account id value.

Returns:

  • (String)


35
36
37
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 35

def 
  @virtual_account_id
end

#virtual_bank_account_holder_nameString

Virtual bank account holder name.

Returns:

  • (String)


27
28
29
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 27

def 
  @virtual_bank_account_holder_name
end

#virtual_bank_account_numberString

Virtual bank account number.

Returns:

  • (String)


31
32
33
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 31

def 
  @virtual_bank_account_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



119
120
121
122
123
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 119

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  bank_ledger_type =
    hash.key?('bank_ledger_type') ? hash['bank_ledger_type'] : SKIP
  amount = hash.key?('amount') ? hash['amount'] : SKIP
  balance = hash.key?('balance') ? hash['balance'] : SKIP
   =
    hash.key?('virtual_bank_account_holder_name') ? hash['virtual_bank_account_holder_name'] : SKIP
   =
    hash.key?('virtual_bank_account_number') ? hash['virtual_bank_account_number'] : SKIP
   =
    hash.key?('virtual_account_id') ? hash['virtual_account_id'] : SKIP
  transaction_date =
    hash.key?('transaction_date') ? hash['transaction_date'] : SKIP
  transaction_timestamp = if hash.key?('transaction_timestamp')
                            (DateTimeHelper.from_rfc3339(hash['transaction_timestamp']) if hash['transaction_timestamp'])
                          else
                            SKIP
                          end
  mode = hash.key?('mode') ? hash['mode'] : SKIP
  created_on = if hash.key?('created_on')
                 (DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
               else
                 SKIP
               end

  # 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.
  BankTransferLedger.new(bank_ledger_type: bank_ledger_type,
                         amount: amount,
                         balance: balance,
                         virtual_bank_account_holder_name: ,
                         virtual_bank_account_number: ,
                         virtual_account_id: ,
                         transaction_date: transaction_date,
                         transaction_timestamp: transaction_timestamp,
                         mode: mode,
                         created_on: created_on,
                         additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 54

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['bank_ledger_type'] = 'bank_ledger_type'
  @_hash['amount'] = 'amount'
  @_hash['balance'] = 'balance'
  @_hash['virtual_bank_account_holder_name'] =
    'virtual_bank_account_holder_name'
  @_hash['virtual_bank_account_number'] = 'virtual_bank_account_number'
  @_hash['virtual_account_id'] = 'virtual_account_id'
  @_hash['transaction_date'] = 'transaction_date'
  @_hash['transaction_timestamp'] = 'transaction_timestamp'
  @_hash['mode'] = 'mode'
  @_hash['created_on'] = 'created_on'
  @_hash
end

.nullablesObject

An array for nullable fields



87
88
89
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 87

def self.nullables
  []
end

.optionalsObject

An array for optional fields



71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 71

def self.optionals
  %w[
    bank_ledger_type
    amount
    balance
    virtual_bank_account_holder_name
    virtual_bank_account_number
    virtual_account_id
    transaction_date
    transaction_timestamp
    mode
    created_on
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



188
189
190
191
192
193
194
195
196
197
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 188

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} bank_ledger_type: #{@bank_ledger_type.inspect}, amount: #{@amount.inspect},"\
  " balance: #{@balance.inspect}, virtual_bank_account_holder_name:"\
  " #{@virtual_bank_account_holder_name.inspect}, virtual_bank_account_number:"\
  " #{@virtual_bank_account_number.inspect}, virtual_account_id:"\
  " #{@virtual_account_id.inspect}, transaction_date: #{@transaction_date.inspect},"\
  " transaction_timestamp: #{@transaction_timestamp.inspect}, mode: #{@mode.inspect},"\
  " created_on: #{@created_on.inspect}, additional_properties: #{@additional_properties}>"
end

#to_custom_created_onObject



172
173
174
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 172

def to_custom_created_on
  DateTimeHelper.to_rfc3339(created_on)
end

#to_custom_transaction_timestampObject



168
169
170
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 168

def to_custom_transaction_timestamp
  DateTimeHelper.to_rfc3339(transaction_timestamp)
end

#to_sObject

Provides a human-readable string representation of the object.



177
178
179
180
181
182
183
184
185
# File 'lib/univapay_client_sdk/models/bank_transfer_ledger.rb', line 177

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} bank_ledger_type: #{@bank_ledger_type}, amount: #{@amount}, balance:"\
  " #{@balance}, virtual_bank_account_holder_name: #{@virtual_bank_account_holder_name},"\
  " virtual_bank_account_number: #{@virtual_bank_account_number}, virtual_account_id:"\
  " #{@virtual_account_id}, transaction_date: #{@transaction_date}, transaction_timestamp:"\
  " #{@transaction_timestamp}, mode: #{@mode}, created_on: #{@created_on},"\
  " additional_properties: #{@additional_properties}>"
end