Class: ThePlaidApi::TransferOriginatorDiligence

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

Overview

The diligence information for the originator.

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(dba:, tax_id:, address:, website:, naics_code:, funding_account:, credit_usage_configuration: SKIP, debit_usage_configuration: SKIP, additional_properties: nil) ⇒ TransferOriginatorDiligence

Returns a new instance of TransferOriginatorDiligence.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/the_plaid_api/models/transfer_originator_diligence.rb', line 81

def initialize(dba:, tax_id:, address:, website:, naics_code:,
               funding_account:, credit_usage_configuration: SKIP,
               debit_usage_configuration: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @dba = dba
  @tax_id = tax_id
  unless credit_usage_configuration == SKIP
    @credit_usage_configuration =
      credit_usage_configuration
  end
  unless debit_usage_configuration == SKIP
    @debit_usage_configuration =
      debit_usage_configuration
  end
  @address = address
  @website = website
  @naics_code = naics_code
  @funding_account = 
  @additional_properties = additional_properties
end

Instance Attribute Details

#addressTransferOriginatorAddress

The originator’s address.



36
37
38
# File 'lib/the_plaid_api/models/transfer_originator_diligence.rb', line 36

def address
  @address
end

#credit_usage_configurationTransferCreditUsageConfiguration

Specifies the originator’s expected usage of credits. For all dollar amounts, use a decimal string with two digits of precision e.g. “10.00”. This field is required if the originator is expected to process credit transfers.



25
26
27
# File 'lib/the_plaid_api/models/transfer_originator_diligence.rb', line 25

def credit_usage_configuration
  @credit_usage_configuration
end

#dbaString

The business name of the originator.

Returns:

  • (String)


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

def dba
  @dba
end

#debit_usage_configurationTransferDebitUsageConfiguration

Specifies the originator’s expected usage of debits. For all dollar amounts, use a decimal string with two digits of precision e.g. “10.00”. This field is required if the originator is expected to process debit transfers.



32
33
34
# File 'lib/the_plaid_api/models/transfer_originator_diligence.rb', line 32

def debit_usage_configuration
  @debit_usage_configuration
end

#funding_accountTransferFundingAccount

The originator’s funding account, linked with Plaid Link or ‘/transfer/migrate_account`.



49
50
51
# File 'lib/the_plaid_api/models/transfer_originator_diligence.rb', line 49

def 
  @funding_account
end

#naics_codeString

The NAICS code of the originator.

Returns:

  • (String)


44
45
46
# File 'lib/the_plaid_api/models/transfer_originator_diligence.rb', line 44

def naics_code
  @naics_code
end

#tax_idString

The tax ID of the originator.

Returns:

  • (String)


18
19
20
# File 'lib/the_plaid_api/models/transfer_originator_diligence.rb', line 18

def tax_id
  @tax_id
end

#websiteString

The website of the originator.

Returns:

  • (String)


40
41
42
# File 'lib/the_plaid_api/models/transfer_originator_diligence.rb', line 40

def website
  @website
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



105
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
140
# File 'lib/the_plaid_api/models/transfer_originator_diligence.rb', line 105

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  dba = hash.key?('dba') ? hash['dba'] : nil
  tax_id = hash.key?('tax_id') ? hash['tax_id'] : nil
  address = TransferOriginatorAddress.from_hash(hash['address']) if hash['address']
  website = hash.key?('website') ? hash['website'] : nil
  naics_code = hash.key?('naics_code') ? hash['naics_code'] : nil
   = TransferFundingAccount.from_hash(hash['funding_account']) if
    hash['funding_account']
  if hash['credit_usage_configuration']
    credit_usage_configuration = TransferCreditUsageConfiguration.from_hash(hash['credit_usage_configuration'])
  end
  if hash['debit_usage_configuration']
    debit_usage_configuration = TransferDebitUsageConfiguration.from_hash(hash['debit_usage_configuration'])
  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.
  TransferOriginatorDiligence.new(dba: dba,
                                  tax_id: tax_id,
                                  address: address,
                                  website: website,
                                  naics_code: naics_code,
                                  funding_account: ,
                                  credit_usage_configuration: credit_usage_configuration,
                                  debit_usage_configuration: debit_usage_configuration,
                                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/the_plaid_api/models/transfer_originator_diligence.rb', line 52

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['dba'] = 'dba'
  @_hash['tax_id'] = 'tax_id'
  @_hash['credit_usage_configuration'] = 'credit_usage_configuration'
  @_hash['debit_usage_configuration'] = 'debit_usage_configuration'
  @_hash['address'] = 'address'
  @_hash['website'] = 'website'
  @_hash['naics_code'] = 'naics_code'
  @_hash['funding_account'] = 'funding_account'
  @_hash
end

.nullablesObject

An array for nullable fields



74
75
76
77
78
79
# File 'lib/the_plaid_api/models/transfer_originator_diligence.rb', line 74

def self.nullables
  %w[
    credit_usage_configuration
    debit_usage_configuration
  ]
end

.optionalsObject

An array for optional fields



66
67
68
69
70
71
# File 'lib/the_plaid_api/models/transfer_originator_diligence.rb', line 66

def self.optionals
  %w[
    credit_usage_configuration
    debit_usage_configuration
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



152
153
154
155
156
157
158
159
160
# File 'lib/the_plaid_api/models/transfer_originator_diligence.rb', line 152

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} dba: #{@dba.inspect}, tax_id: #{@tax_id.inspect},"\
  " credit_usage_configuration: #{@credit_usage_configuration.inspect},"\
  " debit_usage_configuration: #{@debit_usage_configuration.inspect}, address:"\
  " #{@address.inspect}, website: #{@website.inspect}, naics_code: #{@naics_code.inspect},"\
  " funding_account: #{@funding_account.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



143
144
145
146
147
148
149
# File 'lib/the_plaid_api/models/transfer_originator_diligence.rb', line 143

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} dba: #{@dba}, tax_id: #{@tax_id}, credit_usage_configuration:"\
  " #{@credit_usage_configuration}, debit_usage_configuration: #{@debit_usage_configuration},"\
  " address: #{@address}, website: #{@website}, naics_code: #{@naics_code}, funding_account:"\
  " #{@funding_account}, additional_properties: #{@additional_properties}>"
end