Class: Tremendous::ListFundingSources200ResponseFundingSourcesInnerMeta

Inherits:
Object
  • Object
show all
Defined in:
lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ListFundingSources200ResponseFundingSourcesInnerMeta

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
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
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 241

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ListFundingSources200ResponseFundingSourcesInnerMeta` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListFundingSources200ResponseFundingSourcesInnerMeta`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'available_amount')
    self.available_amount = attributes[:'available_amount']
  end

  if attributes.key?(:'available_cents')
    self.available_cents = attributes[:'available_cents']
  end

  if attributes.key?(:'currency_code')
    self.currency_code = attributes[:'currency_code']
  end

  if attributes.key?(:'pending_amount')
    self.pending_amount = attributes[:'pending_amount']
  end

  if attributes.key?(:'pending_cents')
    self.pending_cents = attributes[:'pending_cents']
  end

  if attributes.key?(:'credit_limit_amount')
    self.credit_limit_amount = attributes[:'credit_limit_amount']
  end

  if attributes.key?(:'credit_limit_cents')
    self.credit_limit_cents = attributes[:'credit_limit_cents']
  end

  if attributes.key?(:'accountholder_name')
    self.accountholder_name = attributes[:'accountholder_name']
  end

  if attributes.key?(:'account_type')
    self. = attributes[:'account_type']
  end

  if attributes.key?(:'bank_name')
    self.bank_name = attributes[:'bank_name']
  end

  if attributes.key?(:'account_number_mask')
    self. = attributes[:'account_number_mask']
  end

  if attributes.key?(:'account_routing_mask')
    self. = attributes[:'account_routing_mask']
  end

  if attributes.key?(:'refundable')
    self.refundable = attributes[:'refundable']
  end

  if attributes.key?(:'network')
    self.network = attributes[:'network']
  end

  if attributes.key?(:'last4')
    self.last4 = attributes[:'last4']
  end

  if attributes.key?(:'expired')
    self.expired = attributes[:'expired']
  end

  if attributes.key?(:'year')
    self.year = attributes[:'year']
  end

  if attributes.key?(:'month')
    self.month = attributes[:'month']
  end

  if attributes.key?(:'last_payment_failed_at')
    self.last_payment_failed_at = attributes[:'last_payment_failed_at']
  end

  if attributes.key?(:'invoice_type')
    self.invoice_type = attributes[:'invoice_type']
  end

  if attributes.key?(:'interval')
    self.interval = attributes[:'interval']
  end

  if attributes.key?(:'day_of_week')
    self.day_of_week = attributes[:'day_of_week']
  end

  if attributes.key?(:'net')
    self.net = attributes[:'net']
  end

  if attributes.key?(:'company_name')
    self.company_name = attributes[:'company_name']
  end

  if attributes.key?(:'address_1')
    self.address_1 = attributes[:'address_1']
  end

  if attributes.key?(:'address_2')
    self.address_2 = attributes[:'address_2']
  end

  if attributes.key?(:'city')
    self.city = attributes[:'city']
  end

  if attributes.key?(:'state')
    self.state = attributes[:'state']
  end

  if attributes.key?(:'zip')
    self.zip = attributes[:'zip']
  end

  if attributes.key?(:'phone')
    self.phone = attributes[:'phone']
  end

  if attributes.key?(:'emails')
    self.emails = attributes[:'emails']
  end

  if attributes.key?(:'failure_details')
    self.failure_details = attributes[:'failure_details']
  end
end

Instance Attribute Details

#account_number_maskObject

**Only available when ‘method` is set to `bank_account`.** Last 4 digits of the account number



49
50
51
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 49

def 
  @account_number_mask
end

#account_routing_maskObject

**Only available when ‘method` is set to `bank_account`.** Last 4 digits of the routing number



52
53
54
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 52

def 
  @account_routing_mask
end

#account_typeObject

**Only available when ‘method` is set to `bank_account`.** Is this a checking or savings account



43
44
45
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 43

def 
  @account_type
end

#accountholder_nameObject

**Only available when ‘method` is set to `bank_account` or `credit_card`.** Name of the holder of the bank account or credit_card



40
41
42
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 40

def accountholder_name
  @accountholder_name
end

#address_1Object

**Only available when ‘method` is set to `invoice`.** Primary billing address line



91
92
93
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 91

def address_1
  @address_1
end

#address_2Object

**Only available when ‘method` is set to `invoice`.** Secondary billing address line



94
95
96
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 94

def address_2
  @address_2
end

#available_amountObject

**Only exists for balance and commercial invoicing.** For balance: available amount denominated in ‘currency_code`. For commercial invoicing: available credit amount denominated in `currency_code`, calculated as (credit limit - outstanding balance). *Caution: In the "list funding sources" endpoint this value is cached and may not be up to date. Use the "get funding source" endpoint to get the most up to date value.*



19
20
21
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 19

def available_amount
  @available_amount
end

#available_centsObject

Same as ‘available_amount`, but in cents.



22
23
24
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 22

def available_cents
  @available_cents
end

#bank_nameObject

**Only available when ‘method` is set to `bank_account`.** Name of the bank



46
47
48
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 46

def bank_name
  @bank_name
end

#cityObject

**Only available when ‘method` is set to `invoice`.** Billing address city



97
98
99
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 97

def city
  @city
end

#company_nameObject

**Only available when ‘method` is set to `invoice`.** Company name for invoice billing



88
89
90
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 88

def company_name
  @company_name
end

#credit_limit_amountObject

**Only exists for commercial invoicing.** Available credit limit denominated in ‘currency_code`.



34
35
36
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 34

def credit_limit_amount
  @credit_limit_amount
end

#credit_limit_centsObject

Same as ‘credit_limit_amount`, but in cents.



37
38
39
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 37

def credit_limit_cents
  @credit_limit_cents
end

#currency_codeObject

**Only exists for balance and commercial invoicing.** The currency of the balance or credit amounts (e.g. ‘available_amount`, `pending_amount`, `credit_limit_amount`). Always matches the organization’s currency.



25
26
27
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 25

def currency_code
  @currency_code
end

#day_of_weekObject

**Only available when ‘method` is set to `invoice` and `invoice_type` is `commercial`.** Day of the week when commercial invoices are generated ("0"=Sunday, "1"=Monday, etc.). Returns `null` for pro forma invoices.



82
83
84
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 82

def day_of_week
  @day_of_week
end

#emailsObject

**Only available when ‘method` is set to `invoice`.** Email addresses for invoice delivery (comma-separated)



109
110
111
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 109

def emails
  @emails
end

#expiredObject

**Only available when ‘method` is set to `credit_card`.** Is this credit card expired



64
65
66
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 64

def expired
  @expired
end

#failure_detailsObject

Returns the value of attribute failure_details.



111
112
113
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 111

def failure_details
  @failure_details
end

#intervalObject

**Only available when ‘method` is set to `invoice` and `invoice_type` is `commercial`.** Billing interval for commercial invoice generation (e.g., daily, weekly, monthly, twice_monthly). Returns `null` for pro forma invoices.



79
80
81
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 79

def interval
  @interval
end

#invoice_typeObject

**Only available when ‘method` is set to `invoice`.** Type of invoice account (e.g., commercial, pro_forma, prefunding_only)



76
77
78
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 76

def invoice_type
  @invoice_type
end

#last4Object

**Only available when ‘method` is set to `credit_card`.** Last 4 digits of the credit card number



61
62
63
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 61

def last4
  @last4
end

#last_payment_failed_atObject

**Only available when ‘method` is set to `bank_account` or `credit_card`.** Point in time when the last order failed using this bank account or credit card as a funding source.



73
74
75
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 73

def last_payment_failed_at
  @last_payment_failed_at
end

#monthObject

**Only available when ‘method` is set to `credit_card`.** Month part of card’s expiration date



70
71
72
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 70

def month
  @month
end

#netObject

**Only available when ‘method` is set to `invoice`.** Net payment terms in days (e.g., "30" for Net 30)



85
86
87
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 85

def net
  @net
end

#networkObject

**Only available when ‘method` is set to `credit_card`.** Network of the credit card



58
59
60
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 58

def network
  @network
end

#pending_amountObject

**Only available when ‘method` is set to `balance`.** Funds registered on your Tremendous account but not yet deposited in your account (e.g. payments that need to be manually reviewed by our ops team). Denominated in `currency_code`.



28
29
30
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 28

def pending_amount
  @pending_amount
end

#pending_centsObject

Same as ‘pending_amount`, but in cents.



31
32
33
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 31

def pending_cents
  @pending_cents
end

#phoneObject

**Only available when ‘method` is set to `invoice`.** Contact phone number for billing



106
107
108
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 106

def phone
  @phone
end

#refundableObject

**Only available when ‘method` is set to `bank_account`.** Can refunds be deposited to this bank account



55
56
57
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 55

def refundable
  @refundable
end

#stateObject

**Only available when ‘method` is set to `invoice`.** Billing address state or province



100
101
102
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 100

def state
  @state
end

#yearObject

**Only available when ‘method` is set to `credit_card`.** Year part of card’s expiration date



67
68
69
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 67

def year
  @year
end

#zipObject

**Only available when ‘method` is set to `invoice`.** Billing address postal code



103
104
105
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 103

def zip
  @zip
end

Class Method Details

._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



564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 564

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.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
    # models (e.g. Pet) or oneOf
    klass = Tremendous.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



174
175
176
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 174

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



179
180
181
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 179

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



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
167
168
169
170
171
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 136

def self.attribute_map
  {
    :'available_amount' => :'available_amount',
    :'available_cents' => :'available_cents',
    :'currency_code' => :'currency_code',
    :'pending_amount' => :'pending_amount',
    :'pending_cents' => :'pending_cents',
    :'credit_limit_amount' => :'credit_limit_amount',
    :'credit_limit_cents' => :'credit_limit_cents',
    :'accountholder_name' => :'accountholder_name',
    :'account_type' => :'account_type',
    :'bank_name' => :'bank_name',
    :'account_number_mask' => :'account_number_mask',
    :'account_routing_mask' => :'account_routing_mask',
    :'refundable' => :'refundable',
    :'network' => :'network',
    :'last4' => :'last4',
    :'expired' => :'expired',
    :'year' => :'year',
    :'month' => :'month',
    :'last_payment_failed_at' => :'last_payment_failed_at',
    :'invoice_type' => :'invoice_type',
    :'interval' => :'interval',
    :'day_of_week' => :'day_of_week',
    :'net' => :'net',
    :'company_name' => :'company_name',
    :'address_1' => :'address_1',
    :'address_2' => :'address_2',
    :'city' => :'city',
    :'state' => :'state',
    :'zip' => :'zip',
    :'phone' => :'phone',
    :'emails' => :'emails',
    :'failure_details' => :'failure_details'
  }
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



540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 540

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 222

def self.openapi_nullable
  Set.new([
    :'bank_name',
    :'last_payment_failed_at',
    :'interval',
    :'day_of_week',
    :'address_1',
    :'address_2',
    :'city',
    :'state',
    :'zip',
    :'phone',
    :'emails',
    :'failure_details'
  ])
end

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 184

def self.openapi_types
  {
    :'available_amount' => :'Float',
    :'available_cents' => :'Integer',
    :'currency_code' => :'String',
    :'pending_amount' => :'Float',
    :'pending_cents' => :'Integer',
    :'credit_limit_amount' => :'Float',
    :'credit_limit_cents' => :'Integer',
    :'accountholder_name' => :'String',
    :'account_type' => :'String',
    :'bank_name' => :'String',
    :'account_number_mask' => :'String',
    :'account_routing_mask' => :'String',
    :'refundable' => :'Boolean',
    :'network' => :'String',
    :'last4' => :'String',
    :'expired' => :'Boolean',
    :'year' => :'String',
    :'month' => :'String',
    :'last_payment_failed_at' => :'Time',
    :'invoice_type' => :'String',
    :'interval' => :'String',
    :'day_of_week' => :'String',
    :'net' => :'String',
    :'company_name' => :'String',
    :'address_1' => :'String',
    :'address_2' => :'String',
    :'city' => :'String',
    :'state' => :'String',
    :'zip' => :'String',
    :'phone' => :'String',
    :'emails' => :'String',
    :'failure_details' => :'ListFundingSources200ResponseFundingSourcesInnerMetaFailureDetails'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 488

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      available_amount == o.available_amount &&
      available_cents == o.available_cents &&
      currency_code == o.currency_code &&
      pending_amount == o.pending_amount &&
      pending_cents == o.pending_cents &&
      credit_limit_amount == o.credit_limit_amount &&
      credit_limit_cents == o.credit_limit_cents &&
      accountholder_name == o.accountholder_name &&
       == o. &&
      bank_name == o.bank_name &&
       == o. &&
       == o. &&
      refundable == o.refundable &&
      network == o.network &&
      last4 == o.last4 &&
      expired == o.expired &&
      year == o.year &&
      month == o.month &&
      last_payment_failed_at == o.last_payment_failed_at &&
      invoice_type == o.invoice_type &&
      interval == o.interval &&
      day_of_week == o.day_of_week &&
      net == o.net &&
      company_name == o.company_name &&
      address_1 == o.address_1 &&
      address_2 == o.address_2 &&
      city == o.city &&
      state == o.state &&
      zip == o.zip &&
      phone == o.phone &&
      emails == o.emails &&
      failure_details == o.failure_details
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



635
636
637
638
639
640
641
642
643
644
645
646
647
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 635

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

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


527
528
529
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 527

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



533
534
535
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 533

def hash
  [available_amount, available_cents, currency_code, pending_amount, pending_cents, credit_limit_amount, credit_limit_cents, accountholder_name, , bank_name, , , refundable, network, last4, expired, year, month, last_payment_failed_at, invoice_type, interval, day_of_week, net, company_name, address_1, address_2, city, state, zip, phone, emails, failure_details].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 386

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  pattern = Regexp.new(/[0-9]{4}/)
  if !@account_number_mask.nil? && @account_number_mask !~ pattern
    invalid_properties.push("invalid value for \"account_number_mask\", must conform to the pattern #{pattern}.")
  end

  pattern = Regexp.new(/[0-9]{4}/)
  if !@account_routing_mask.nil? && @account_routing_mask !~ pattern
    invalid_properties.push("invalid value for \"account_routing_mask\", must conform to the pattern #{pattern}.")
  end

  pattern = Regexp.new(/[0-9]{4}/)
  if !@last4.nil? && @last4 !~ pattern
    invalid_properties.push("invalid value for \"last4\", must conform to the pattern #{pattern}.")
  end

  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



611
612
613
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 611

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



617
618
619
620
621
622
623
624
625
626
627
628
629
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 617

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



605
606
607
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 605

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



409
410
411
412
413
414
415
416
417
418
419
# File 'lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb', line 409

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
   = EnumAttributeValidator.new('String', ["checking", "savings"])
  return false unless .valid?(@account_type)
  return false if !@account_number_mask.nil? && @account_number_mask !~ Regexp.new(/[0-9]{4}/)
  return false if !@account_routing_mask.nil? && @account_routing_mask !~ Regexp.new(/[0-9]{4}/)
  network_validator = EnumAttributeValidator.new('String', ["MasterCard", "Amex", "JCB", "Diner's Club", "Visa", "Discover", "Laser", "Elo", "Maestro", "Solo"])
  return false unless network_validator.valid?(@network)
  return false if !@last4.nil? && @last4 !~ Regexp.new(/[0-9]{4}/)
  true
end