Class: ModernTreasury::ExpectedPaymentUpdateRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/modern_treasury/models/expected_payment_update_request.rb

Overview

ExpectedPaymentUpdateRequest Model.

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(amount_upper_bound: SKIP, amount_lower_bound: SKIP, direction: SKIP, internal_account_id: SKIP, type: SKIP, currency: SKIP, date_upper_bound: SKIP, date_lower_bound: SKIP, description: SKIP, statement_descriptor: SKIP, metadata: SKIP, counterparty_id: SKIP, remittance_information: SKIP, reconciliation_groups: SKIP, reconciliation_filters: SKIP, additional_properties: nil) ⇒ ExpectedPaymentUpdateRequest

Returns a new instance of ExpectedPaymentUpdateRequest.



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/modern_treasury/models/expected_payment_update_request.rb', line 139

def initialize(amount_upper_bound: SKIP, amount_lower_bound: SKIP,
               direction: SKIP, internal_account_id: SKIP, type: SKIP,
               currency: SKIP, date_upper_bound: SKIP,
               date_lower_bound: SKIP, description: SKIP,
               statement_descriptor: SKIP, metadata: SKIP,
               counterparty_id: SKIP, remittance_information: SKIP,
               reconciliation_groups: SKIP, reconciliation_filters: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @amount_upper_bound = amount_upper_bound unless amount_upper_bound == SKIP
  @amount_lower_bound = amount_lower_bound unless amount_lower_bound == SKIP
  @direction = direction unless direction == SKIP
  @internal_account_id =  unless  == SKIP
  @type = type unless type == SKIP
  @currency = currency unless currency == SKIP
  @date_upper_bound = date_upper_bound unless date_upper_bound == SKIP
  @date_lower_bound = date_lower_bound unless date_lower_bound == SKIP
  @description = description unless description == SKIP
  @statement_descriptor = statement_descriptor unless statement_descriptor == SKIP
  @metadata =  unless  == SKIP
  @counterparty_id = counterparty_id unless counterparty_id == SKIP
  @remittance_information = remittance_information unless remittance_information == SKIP
  @reconciliation_groups = reconciliation_groups unless reconciliation_groups == SKIP
  @reconciliation_filters = reconciliation_filters unless reconciliation_filters == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#amount_lower_boundInteger

The lowest amount this expected payment may be equal to. Value in specified currency’s smallest unit. e.g. $10 would be represented as 1000.

Returns:

  • (Integer)


20
21
22
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 20

def amount_lower_bound
  @amount_lower_bound
end

#amount_upper_boundInteger

The highest amount this expected payment may be equal to. Value in specified currency’s smallest unit. e.g. $10 would be represented as 1000.

Returns:

  • (Integer)


15
16
17
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 15

def amount_upper_bound
  @amount_upper_bound
end

#counterparty_idUUID | String

The ID of the counterparty you expect for this payment.

Returns:

  • (UUID | String)


66
67
68
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 66

def counterparty_id
  @counterparty_id
end

#currencyCurrency

Three-letter ISO currency code.

Returns:



38
39
40
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 38

def currency
  @currency
end

#date_lower_boundDate

The earliest date the payment may come in. Format: yyyy-mm-dd

Returns:

  • (Date)


46
47
48
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 46

def date_lower_bound
  @date_lower_bound
end

#date_upper_boundDate

The latest date the payment may come in. Format: yyyy-mm-dd

Returns:

  • (Date)


42
43
44
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 42

def date_upper_bound
  @date_upper_bound
end

#descriptionString

An optional description for internal use.

Returns:

  • (String)


50
51
52
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 50

def description
  @description
end

#directionDirection1

One of credit or debit. When you are receiving money, use credit. When you are being charged, use debit.

Returns:



25
26
27
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 25

def direction
  @direction
end

#internal_account_idUUID | String

The ID of the Internal Account for the expected payment.

Returns:

  • (UUID | String)


29
30
31
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 29

def 
  @internal_account_id
end

#metadataHash[String, String]

Additional data represented as key-value pairs. Both the key and value must be strings.

Returns:

  • (Hash[String, String])


62
63
64
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 62

def 
  @metadata
end

#reconciliation_filtersObject

The reconciliation filters you have for this payment.

Returns:

  • (Object)


80
81
82
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 80

def reconciliation_filters
  @reconciliation_filters
end

#reconciliation_groupsObject

The reconciliation groups you have for this payment.

Returns:

  • (Object)


76
77
78
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 76

def reconciliation_groups
  @reconciliation_groups
end

#remittance_informationString

For ‘ach`, this field will be passed through on an addenda record. For `wire` payments the field will be passed through as the “Originator to Beneficiary Information”, also known as OBI or Fedwire tag 6000.

Returns:

  • (String)


72
73
74
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 72

def remittance_information
  @remittance_information
end

#statement_descriptorString

The statement description you expect to see on the transaction. For ACH payments, this will be the full line item passed from the bank. For wire payments, this will be the OBI field on the wire. For check payments, this will be the memo field.

Returns:

  • (String)


57
58
59
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 57

def statement_descriptor
  @statement_descriptor
end

#typeType1

One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp, sen, sepa, signet, wire.

Returns:



34
35
36
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 34

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



169
170
171
172
173
174
175
176
177
178
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
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 169

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  amount_upper_bound =
    hash.key?('amount_upper_bound') ? hash['amount_upper_bound'] : SKIP
  amount_lower_bound =
    hash.key?('amount_lower_bound') ? hash['amount_lower_bound'] : SKIP
  direction = hash.key?('direction') ? hash['direction'] : SKIP
   =
    hash.key?('internal_account_id') ? hash['internal_account_id'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  currency = hash.key?('currency') ? hash['currency'] : SKIP
  date_upper_bound =
    hash.key?('date_upper_bound') ? hash['date_upper_bound'] : SKIP
  date_lower_bound =
    hash.key?('date_lower_bound') ? hash['date_lower_bound'] : SKIP
  description = hash.key?('description') ? hash['description'] : SKIP
  statement_descriptor =
    hash.key?('statement_descriptor') ? hash['statement_descriptor'] : SKIP
   = hash.key?('metadata') ? hash['metadata'] : SKIP
  counterparty_id =
    hash.key?('counterparty_id') ? hash['counterparty_id'] : SKIP
  remittance_information =
    hash.key?('remittance_information') ? hash['remittance_information'] : SKIP
  reconciliation_groups =
    hash.key?('reconciliation_groups') ? hash['reconciliation_groups'] : SKIP
  reconciliation_filters =
    hash.key?('reconciliation_filters') ? hash['reconciliation_filters'] : 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.
  ExpectedPaymentUpdateRequest.new(amount_upper_bound: amount_upper_bound,
                                   amount_lower_bound: amount_lower_bound,
                                   direction: direction,
                                   internal_account_id: ,
                                   type: type,
                                   currency: currency,
                                   date_upper_bound: date_upper_bound,
                                   date_lower_bound: date_lower_bound,
                                   description: description,
                                   statement_descriptor: statement_descriptor,
                                   metadata: ,
                                   counterparty_id: counterparty_id,
                                   remittance_information: remittance_information,
                                   reconciliation_groups: reconciliation_groups,
                                   reconciliation_filters: reconciliation_filters,
                                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['amount_upper_bound'] = 'amount_upper_bound'
  @_hash['amount_lower_bound'] = 'amount_lower_bound'
  @_hash['direction'] = 'direction'
  @_hash['internal_account_id'] = 'internal_account_id'
  @_hash['type'] = 'type'
  @_hash['currency'] = 'currency'
  @_hash['date_upper_bound'] = 'date_upper_bound'
  @_hash['date_lower_bound'] = 'date_lower_bound'
  @_hash['description'] = 'description'
  @_hash['statement_descriptor'] = 'statement_descriptor'
  @_hash['metadata'] = 'metadata'
  @_hash['counterparty_id'] = 'counterparty_id'
  @_hash['remittance_information'] = 'remittance_information'
  @_hash['reconciliation_groups'] = 'reconciliation_groups'
  @_hash['reconciliation_filters'] = 'reconciliation_filters'
  @_hash
end

.nullablesObject

An array for nullable fields



125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 125

def self.nullables
  %w[
    type
    date_upper_bound
    date_lower_bound
    description
    statement_descriptor
    counterparty_id
    remittance_information
    reconciliation_groups
    reconciliation_filters
  ]
end

.optionalsObject

An array for optional fields



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 104

def self.optionals
  %w[
    amount_upper_bound
    amount_lower_bound
    direction
    internal_account_id
    type
    currency
    date_upper_bound
    date_lower_bound
    description
    statement_descriptor
    metadata
    counterparty_id
    remittance_information
    reconciliation_groups
    reconciliation_filters
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 239

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} amount_upper_bound: #{@amount_upper_bound.inspect}, amount_lower_bound:"\
  " #{@amount_lower_bound.inspect}, direction: #{@direction.inspect}, internal_account_id:"\
  " #{@internal_account_id.inspect}, type: #{@type.inspect}, currency: #{@currency.inspect},"\
  " date_upper_bound: #{@date_upper_bound.inspect}, date_lower_bound:"\
  " #{@date_lower_bound.inspect}, description: #{@description.inspect}, statement_descriptor:"\
  " #{@statement_descriptor.inspect}, metadata: #{@metadata.inspect}, counterparty_id:"\
  " #{@counterparty_id.inspect}, remittance_information: #{@remittance_information.inspect},"\
  " reconciliation_groups: #{@reconciliation_groups.inspect}, reconciliation_filters:"\
  " #{@reconciliation_filters.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



226
227
228
229
230
231
232
233
234
235
236
# File 'lib/modern_treasury/models/expected_payment_update_request.rb', line 226

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} amount_upper_bound: #{@amount_upper_bound}, amount_lower_bound:"\
  " #{@amount_lower_bound}, direction: #{@direction}, internal_account_id:"\
  " #{@internal_account_id}, type: #{@type}, currency: #{@currency}, date_upper_bound:"\
  " #{@date_upper_bound}, date_lower_bound: #{@date_lower_bound}, description:"\
  " #{@description}, statement_descriptor: #{@statement_descriptor}, metadata: #{@metadata},"\
  " counterparty_id: #{@counterparty_id}, remittance_information: #{@remittance_information},"\
  " reconciliation_groups: #{@reconciliation_groups}, reconciliation_filters:"\
  " #{@reconciliation_filters}, additional_properties: #{@additional_properties}>"
end