Class: ThePlaidApi::TransferCapabilitiesGetRfP

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/transfer_capabilities_get_rf_p.rb

Overview

Contains the supported service types in RfP

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(debit: false, max_amount: SKIP, iso_currency_code: SKIP, additional_properties: nil) ⇒ TransferCapabilitiesGetRfP

Returns a new instance of TransferCapabilitiesGetRfP.



51
52
53
54
55
56
57
58
59
60
# File 'lib/the_plaid_api/models/transfer_capabilities_get_rf_p.rb', line 51

def initialize(debit: false, max_amount: SKIP, iso_currency_code: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @debit = debit unless debit == SKIP
  @max_amount = max_amount unless max_amount == SKIP
  @iso_currency_code = iso_currency_code unless iso_currency_code == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#debitTrueClass | FalseClass

When ‘true`, the linked Item’s institution supports RfP debit transfer.

Returns:

  • (TrueClass | FalseClass)


14
15
16
# File 'lib/the_plaid_api/models/transfer_capabilities_get_rf_p.rb', line 14

def debit
  @debit
end

#iso_currency_codeString

The currency of the ‘max_amount`, e.g. “USD”.

Returns:

  • (String)


23
24
25
# File 'lib/the_plaid_api/models/transfer_capabilities_get_rf_p.rb', line 23

def iso_currency_code
  @iso_currency_code
end

#max_amountString

The maximum amount (decimal string with two digits of precision e.g. “10.00”) for originating RfP transfers with the given institution.

Returns:

  • (String)


19
20
21
# File 'lib/the_plaid_api/models/transfer_capabilities_get_rf_p.rb', line 19

def max_amount
  @max_amount
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/the_plaid_api/models/transfer_capabilities_get_rf_p.rb', line 63

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  debit = hash['debit'] ||= false
  max_amount = hash.key?('max_amount') ? hash['max_amount'] : SKIP
  iso_currency_code =
    hash.key?('iso_currency_code') ? hash['iso_currency_code'] : SKIP

  # 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.
  TransferCapabilitiesGetRfP.new(debit: debit,
                                 max_amount: max_amount,
                                 iso_currency_code: iso_currency_code,
                                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



26
27
28
29
30
31
32
# File 'lib/the_plaid_api/models/transfer_capabilities_get_rf_p.rb', line 26

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['debit'] = 'debit'
  @_hash['max_amount'] = 'max_amount'
  @_hash['iso_currency_code'] = 'iso_currency_code'
  @_hash
end

.nullablesObject

An array for nullable fields



44
45
46
47
48
49
# File 'lib/the_plaid_api/models/transfer_capabilities_get_rf_p.rb', line 44

def self.nullables
  %w[
    max_amount
    iso_currency_code
  ]
end

.optionalsObject

An array for optional fields



35
36
37
38
39
40
41
# File 'lib/the_plaid_api/models/transfer_capabilities_get_rf_p.rb', line 35

def self.optionals
  %w[
    debit
    max_amount
    iso_currency_code
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



94
95
96
97
98
99
# File 'lib/the_plaid_api/models/transfer_capabilities_get_rf_p.rb', line 94

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} debit: #{@debit.inspect}, max_amount: #{@max_amount.inspect},"\
  " iso_currency_code: #{@iso_currency_code.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



87
88
89
90
91
# File 'lib/the_plaid_api/models/transfer_capabilities_get_rf_p.rb', line 87

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} debit: #{@debit}, max_amount: #{@max_amount}, iso_currency_code:"\
  " #{@iso_currency_code}, additional_properties: #{@additional_properties}>"
end