Class: TreezorClient::Wallet

Inherits:
Object
  • Object
show all
Defined in:
lib/treezor_client/models/wallet.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Wallet

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash


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
228
229
230
231
232
233
234
235
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
# File 'lib/treezor_client/models/wallet.rb', line 179

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'walletId')
    self.wallet_id = attributes[:'walletId']
  end

  if attributes.has_key?(:'walletTypeId')
    self.wallet_type_id = attributes[:'walletTypeId']
  end

  if attributes.has_key?(:'walletStatus')
    self.wallet_status = attributes[:'walletStatus']
  end

  if attributes.has_key?(:'codeStatus')
    self.code_status = attributes[:'codeStatus']
  end

  if attributes.has_key?(:'informationStatus')
    self.information_status = attributes[:'informationStatus']
  end

  if attributes.has_key?(:'walletTag')
    self.wallet_tag = attributes[:'walletTag']
  end

  if attributes.has_key?(:'userId')
    self.user_id = attributes[:'userId']
  end

  if attributes.has_key?(:'userLastname')
    self.user_lastname = attributes[:'userLastname']
  end

  if attributes.has_key?(:'userFirstname')
    self.user_firstname = attributes[:'userFirstname']
  end

  if attributes.has_key?(:'jointUserId')
    self.joint_user_id = attributes[:'jointUserId']
  end

  if attributes.has_key?(:'tariffId')
    self.tariff_id = attributes[:'tariffId']
  end

  if attributes.has_key?(:'eventName')
    self.event_name = attributes[:'eventName']
  end

  if attributes.has_key?(:'eventAlias')
    self.event_alias = attributes[:'eventAlias']
  end

  if attributes.has_key?(:'eventDate')
    self.event_date = attributes[:'eventDate']
  end

  if attributes.has_key?(:'eventMessage')
    self.event_message = attributes[:'eventMessage']
  end

  if attributes.has_key?(:'eventPayinStartDate')
    self.event_payin_start_date = attributes[:'eventPayinStartDate']
  end

  if attributes.has_key?(:'eventPayinEndDate')
    self.event_payin_end_date = attributes[:'eventPayinEndDate']
  end

  if attributes.has_key?(:'contractSigned')
    self.contract_signed = attributes[:'contractSigned']
  end

  if attributes.has_key?(:'bic')
    self.bic = attributes[:'bic']
  end

  if attributes.has_key?(:'iban')
    self.iban = attributes[:'iban']
  end

  if attributes.has_key?(:'urlImage')
    self.url_image = attributes[:'urlImage']
  end

  if attributes.has_key?(:'currency')
    self.currency = attributes[:'currency']
  end

  if attributes.has_key?(:'createdDate')
    self.created_date = attributes[:'createdDate']
  end

  if attributes.has_key?(:'modifiedDate')
    self.modified_date = attributes[:'modifiedDate']
  end

  if attributes.has_key?(:'payinCount')
    self.payin_count = attributes[:'payinCount']
  end

  if attributes.has_key?(:'payoutCount')
    self.payout_count = attributes[:'payoutCount']
  end

  if attributes.has_key?(:'transferCount')
    self.transfer_count = attributes[:'transferCount']
  end

  if attributes.has_key?(:'solde')
    self.solde = attributes[:'solde']
  end

  if attributes.has_key?(:'authorizedBalance')
    self.authorized_balance = attributes[:'authorizedBalance']
  end

  if attributes.has_key?(:'totalRows')
    self.total_rows = attributes[:'totalRows']
  end
end

Instance Attribute Details

#authorized_balanceObject

Returns the value of attribute authorized_balance.


79
80
81
# File 'lib/treezor_client/models/wallet.rb', line 79

def authorized_balance
  @authorized_balance
end

#bicObject

Returns the value of attribute bic.


57
58
59
# File 'lib/treezor_client/models/wallet.rb', line 57

def bic
  @bic
end

#code_statusObject

Returns the value of attribute code_status.


24
25
26
# File 'lib/treezor_client/models/wallet.rb', line 24

def code_status
  @code_status
end

#contract_signedObject

Returns the value of attribute contract_signed.


55
56
57
# File 'lib/treezor_client/models/wallet.rb', line 55

def contract_signed
  @contract_signed
end

#created_dateObject

Date YYYY-MM-DD HH:MM:SS


66
67
68
# File 'lib/treezor_client/models/wallet.rb', line 66

def created_date
  @created_date
end

#currencyObject

Returns the value of attribute currency.


63
64
65
# File 'lib/treezor_client/models/wallet.rb', line 63

def currency
  @currency
end

#event_aliasObject

Returns the value of attribute event_alias.


42
43
44
# File 'lib/treezor_client/models/wallet.rb', line 42

def event_alias
  @event_alias
end

#event_dateObject

Date YYYY-MM-DD


45
46
47
# File 'lib/treezor_client/models/wallet.rb', line 45

def event_date
  @event_date
end

#event_messageObject

Returns the value of attribute event_message.


47
48
49
# File 'lib/treezor_client/models/wallet.rb', line 47

def event_message
  @event_message
end

#event_nameObject

Returns the value of attribute event_name.


40
41
42
# File 'lib/treezor_client/models/wallet.rb', line 40

def event_name
  @event_name
end

#event_payin_end_dateObject

Date YYYY-MM-DD


53
54
55
# File 'lib/treezor_client/models/wallet.rb', line 53

def event_payin_end_date
  @event_payin_end_date
end

#event_payin_start_dateObject

Date YYYY-MM-DD


50
51
52
# File 'lib/treezor_client/models/wallet.rb', line 50

def event_payin_start_date
  @event_payin_start_date
end

#ibanObject

Returns the value of attribute iban.


59
60
61
# File 'lib/treezor_client/models/wallet.rb', line 59

def iban
  @iban
end

#information_statusObject

Returns the value of attribute information_status.


26
27
28
# File 'lib/treezor_client/models/wallet.rb', line 26

def information_status
  @information_status
end

#joint_user_idObject

Returns the value of attribute joint_user_id.


36
37
38
# File 'lib/treezor_client/models/wallet.rb', line 36

def joint_user_id
  @joint_user_id
end

#modified_dateObject

Date YYYY-MM-DD HH:MM:SS


69
70
71
# File 'lib/treezor_client/models/wallet.rb', line 69

def modified_date
  @modified_date
end

#payin_countObject

Returns the value of attribute payin_count.


71
72
73
# File 'lib/treezor_client/models/wallet.rb', line 71

def payin_count
  @payin_count
end

#payout_countObject

Returns the value of attribute payout_count.


73
74
75
# File 'lib/treezor_client/models/wallet.rb', line 73

def payout_count
  @payout_count
end

#soldeObject

Returns the value of attribute solde.


77
78
79
# File 'lib/treezor_client/models/wallet.rb', line 77

def solde
  @solde
end

#tariff_idObject

Returns the value of attribute tariff_id.


38
39
40
# File 'lib/treezor_client/models/wallet.rb', line 38

def tariff_id
  @tariff_id
end

#total_rowsObject

Returns the value of attribute total_rows.


81
82
83
# File 'lib/treezor_client/models/wallet.rb', line 81

def total_rows
  @total_rows
end

#transfer_countObject

Returns the value of attribute transfer_count.


75
76
77
# File 'lib/treezor_client/models/wallet.rb', line 75

def transfer_count
  @transfer_count
end

#url_imageObject

Returns the value of attribute url_image.


61
62
63
# File 'lib/treezor_client/models/wallet.rb', line 61

def url_image
  @url_image
end

#user_firstnameObject

Returns the value of attribute user_firstname.


34
35
36
# File 'lib/treezor_client/models/wallet.rb', line 34

def user_firstname
  @user_firstname
end

#user_idObject

Returns the value of attribute user_id.


30
31
32
# File 'lib/treezor_client/models/wallet.rb', line 30

def user_id
  @user_id
end

#user_lastnameObject

Returns the value of attribute user_lastname.


32
33
34
# File 'lib/treezor_client/models/wallet.rb', line 32

def user_lastname
  @user_lastname
end

#wallet_idObject

Returns the value of attribute wallet_id.


17
18
19
# File 'lib/treezor_client/models/wallet.rb', line 17

def wallet_id
  @wallet_id
end

#wallet_statusObject

Returns the value of attribute wallet_status.


22
23
24
# File 'lib/treezor_client/models/wallet.rb', line 22

def wallet_status
  @wallet_status
end

#wallet_tagObject

Returns the value of attribute wallet_tag.


28
29
30
# File 'lib/treezor_client/models/wallet.rb', line 28

def wallet_tag
  @wallet_tag
end

#wallet_type_idObject

| Id | Description | |—-|—-| | 9 | Electronic Money Wallet | | 10 | Payment Account Wallet | | 13 | Mirror Wallet | | 14 | Electronic Money Card (Internal only) |


20
21
22
# File 'lib/treezor_client/models/wallet.rb', line 20

def wallet_type_id
  @wallet_type_id
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.


106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/treezor_client/models/wallet.rb', line 106

def self.attribute_map
  {
    :'wallet_id' => :'walletId',
    :'wallet_type_id' => :'walletTypeId',
    :'wallet_status' => :'walletStatus',
    :'code_status' => :'codeStatus',
    :'information_status' => :'informationStatus',
    :'wallet_tag' => :'walletTag',
    :'user_id' => :'userId',
    :'user_lastname' => :'userLastname',
    :'user_firstname' => :'userFirstname',
    :'joint_user_id' => :'jointUserId',
    :'tariff_id' => :'tariffId',
    :'event_name' => :'eventName',
    :'event_alias' => :'eventAlias',
    :'event_date' => :'eventDate',
    :'event_message' => :'eventMessage',
    :'event_payin_start_date' => :'eventPayinStartDate',
    :'event_payin_end_date' => :'eventPayinEndDate',
    :'contract_signed' => :'contractSigned',
    :'bic' => :'bic',
    :'iban' => :'iban',
    :'url_image' => :'urlImage',
    :'currency' => :'currency',
    :'created_date' => :'createdDate',
    :'modified_date' => :'modifiedDate',
    :'payin_count' => :'payinCount',
    :'payout_count' => :'payoutCount',
    :'transfer_count' => :'transferCount',
    :'solde' => :'solde',
    :'authorized_balance' => :'authorizedBalance',
    :'total_rows' => :'totalRows'
  }
end

.swagger_typesObject

Attribute type mapping.


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
167
168
169
170
171
172
173
174
175
# File 'lib/treezor_client/models/wallet.rb', line 142

def self.swagger_types
  {
    :'wallet_id' => :'Integer',
    :'wallet_type_id' => :'Integer',
    :'wallet_status' => :'String',
    :'code_status' => :'Integer',
    :'information_status' => :'String',
    :'wallet_tag' => :'String',
    :'user_id' => :'Integer',
    :'user_lastname' => :'String',
    :'user_firstname' => :'String',
    :'joint_user_id' => :'Integer',
    :'tariff_id' => :'Integer',
    :'event_name' => :'String',
    :'event_alias' => :'String',
    :'event_date' => :'String',
    :'event_message' => :'String',
    :'event_payin_start_date' => :'String',
    :'event_payin_end_date' => :'String',
    :'contract_signed' => :'Integer',
    :'bic' => :'String',
    :'iban' => :'String',
    :'url_image' => :'String',
    :'currency' => :'String',
    :'created_date' => :'String',
    :'modified_date' => :'String',
    :'payin_count' => :'Integer',
    :'payout_count' => :'Integer',
    :'transfer_count' => :'Integer',
    :'solde' => :'Integer',
    :'authorized_balance' => :'Integer',
    :'total_rows' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared


333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
# File 'lib/treezor_client/models/wallet.rb', line 333

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      wallet_id == o.wallet_id &&
      wallet_type_id == o.wallet_type_id &&
      wallet_status == o.wallet_status &&
      code_status == o.code_status &&
      information_status == o.information_status &&
      wallet_tag == o.wallet_tag &&
      user_id == o.user_id &&
      user_lastname == o.user_lastname &&
      user_firstname == o.user_firstname &&
      joint_user_id == o.joint_user_id &&
      tariff_id == o.tariff_id &&
      event_name == o.event_name &&
      event_alias == o.event_alias &&
      event_date == o.event_date &&
      event_message == o.event_message &&
      event_payin_start_date == o.event_payin_start_date &&
      event_payin_end_date == o.event_payin_end_date &&
      contract_signed == o.contract_signed &&
      bic == o.bic &&
      iban == o.iban &&
      url_image == o.url_image &&
      currency == o.currency &&
      created_date == o.created_date &&
      modified_date == o.modified_date &&
      payin_count == o.payin_count &&
      payout_count == o.payout_count &&
      transfer_count == o.transfer_count &&
      solde == o.solde &&
      authorized_balance == o.authorized_balance &&
      total_rows == o.total_rows
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data


404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'lib/treezor_client/models/wallet.rb', line 404

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = TreezorClient.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash


470
471
472
473
474
475
476
477
478
479
480
481
482
# File 'lib/treezor_client/models/wallet.rb', line 470

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself


383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/treezor_client/models/wallet.rb', line 383

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method

370
371
372
# File 'lib/treezor_client/models/wallet.rb', line 370

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code


376
377
378
# File 'lib/treezor_client/models/wallet.rb', line 376

def hash
  [wallet_id, wallet_type_id, wallet_status, code_status, information_status, wallet_tag, user_id, user_lastname, user_firstname, joint_user_id, tariff_id, event_name, event_alias, event_date, event_message, event_payin_start_date, event_payin_end_date, contract_signed, bic, iban, url_image, currency, created_date, modified_date, payin_count, payout_count, transfer_count, solde, authorized_balance, total_rows].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons


308
309
310
311
# File 'lib/treezor_client/models/wallet.rb', line 308

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash


450
451
452
# File 'lib/treezor_client/models/wallet.rb', line 450

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash


456
457
458
459
460
461
462
463
464
# File 'lib/treezor_client/models/wallet.rb', line 456

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object


444
445
446
# File 'lib/treezor_client/models/wallet.rb', line 444

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid


315
316
317
318
319
# File 'lib/treezor_client/models/wallet.rb', line 315

def valid?
  wallet_status_validator = EnumAttributeValidator.new('String', ['PENDING', 'CANCELED', 'VALIDATED'])
  return false unless wallet_status_validator.valid?(@wallet_status)
  true
end