Class: SyncteraRubySdk::InternationalWireResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/synctera_ruby_sdk/models/international_wire_response.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ InternationalWireResponse

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 172

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#amount_in_beneficiary_currencyObject

Transfer amount in cents ($100 would be 10000) in the currency of the beneficiary.



19
20
21
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 19

def amount_in_beneficiary_currency
  @amount_in_beneficiary_currency
end

#beneficiary_currencyObject

The currency of the beneficiary’s account in ISO4217 format.



22
23
24
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 22

def beneficiary_currency
  @beneficiary_currency
end

#case_idObject

The ID of the associated case.



25
26
27
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 25

def case_id
  @case_id
end

#creation_timeObject

Returns the value of attribute creation_time.



27
28
29
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 27

def creation_time
  @creation_time
end

#customer_idObject

The customer UUID representing the person initiating the Wire transfer.



30
31
32
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 30

def customer_id
  @customer_id
end

#decline_reasonObject

If the wire is declined after being successfully submitted, this field will contain a message explaining the reason for the decline.



33
34
35
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 33

def decline_reason
  @decline_reason
end

#effective_dateObject

The effective date of the transaction once it gets posted.



36
37
38
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 36

def effective_date
  @effective_date
end

#fx_exchange_rateObject

The exchange rate used for the wire transfer.



39
40
41
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 39

def fx_exchange_rate
  @fx_exchange_rate
end

#idObject

The ID of the international wire transfer.



42
43
44
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 42

def id
  @id
end

#last_updated_timeObject

Returns the value of attribute last_updated_time.



44
45
46
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 44

def last_updated_time
  @last_updated_time
end

#max_accepted_sender_costObject

The maximum amount the sender is willing to pay for the wire transfer in case FX fluctuates, required if the quote type is ‘estimate’.



47
48
49
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 47

def max_accepted_sender_cost
  @max_accepted_sender_cost
end

#metadataObject

Additional transfer metadata structured as key-value pairs.



50
51
52
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 50

def 
  @metadata
end

#network_reference_idObject

The network reference ID of the wire transfer.



53
54
55
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 53

def network_reference_id
  @network_reference_id
end

#originating_account_idObject

The account uuid representing the sender of the wire.



56
57
58
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 56

def 
  @originating_account_id
end

#quote_idObject

The quote id returned from the /international_wire/quote endpoint, contains FX rate information. Required if the international wire is cross currency.



59
60
61
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 59

def quote_id
  @quote_id
end

#receiving_account_idObject

The external account uuid representing the recipient of the wire. Needs to be configured with international bank routing details (e.g. SWIFT code, refer to external accounts documentation).



62
63
64
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 62

def 
  @receiving_account_id
end

#sender_amountObject

Debit amount to the wire sender, in cents ($100 would be 10000).



65
66
67
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 65

def sender_amount
  @sender_amount
end

#sender_currencyObject

The currency of the sender’s account in ISO4217 format.



68
69
70
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 68

def sender_currency
  @sender_currency
end

#statusObject

Returns the value of attribute status.



70
71
72
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 70

def status
  @status
end

#transaction_idObject

ID of the resulting transaction resource.



73
74
75
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 73

def transaction_id
  @transaction_id
end

#wire_instructionObject

Optional transaction instructions for the recipient bank if required by the recipient bank.



76
77
78
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 76

def wire_instruction
  @wire_instruction
end

#wire_purposeObject

Reason for the wire transfer.



79
80
81
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 79

def wire_purpose
  @wire_purpose
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



132
133
134
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 132

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



104
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
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 104

def self.attribute_map
  {
    :'amount_in_beneficiary_currency' => :'amount_in_beneficiary_currency',
    :'beneficiary_currency' => :'beneficiary_currency',
    :'case_id' => :'case_id',
    :'creation_time' => :'creation_time',
    :'customer_id' => :'customer_id',
    :'decline_reason' => :'decline_reason',
    :'effective_date' => :'effective_date',
    :'fx_exchange_rate' => :'fx_exchange_rate',
    :'id' => :'id',
    :'last_updated_time' => :'last_updated_time',
    :'max_accepted_sender_cost' => :'max_accepted_sender_cost',
    :'metadata' => :'metadata',
    :'network_reference_id' => :'network_reference_id',
    :'originating_account_id' => :'originating_account_id',
    :'quote_id' => :'quote_id',
    :'receiving_account_id' => :'receiving_account_id',
    :'sender_amount' => :'sender_amount',
    :'sender_currency' => :'sender_currency',
    :'status' => :'status',
    :'transaction_id' => :'transaction_id',
    :'wire_instruction' => :'wire_instruction',
    :'wire_purpose' => :'wire_purpose'
  }
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



406
407
408
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 406

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



165
166
167
168
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 165

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 137

def self.openapi_types
  {
    :'amount_in_beneficiary_currency' => :'Integer',
    :'beneficiary_currency' => :'String',
    :'case_id' => :'Integer',
    :'creation_time' => :'Time',
    :'customer_id' => :'String',
    :'decline_reason' => :'String',
    :'effective_date' => :'Date',
    :'fx_exchange_rate' => :'Float',
    :'id' => :'String',
    :'last_updated_time' => :'Time',
    :'max_accepted_sender_cost' => :'Integer',
    :'metadata' => :'Object',
    :'network_reference_id' => :'String',
    :'originating_account_id' => :'String',
    :'quote_id' => :'String',
    :'receiving_account_id' => :'String',
    :'sender_amount' => :'Integer',
    :'sender_currency' => :'String',
    :'status' => :'InternationalWireStatus',
    :'transaction_id' => :'String',
    :'wire_instruction' => :'String',
    :'wire_purpose' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 364

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      amount_in_beneficiary_currency == o.amount_in_beneficiary_currency &&
      beneficiary_currency == o.beneficiary_currency &&
      case_id == o.case_id &&
      creation_time == o.creation_time &&
      customer_id == o.customer_id &&
      decline_reason == o.decline_reason &&
      effective_date == o.effective_date &&
      fx_exchange_rate == o.fx_exchange_rate &&
      id == o.id &&
      last_updated_time == o.last_updated_time &&
      max_accepted_sender_cost == o.max_accepted_sender_cost &&
       == o. &&
      network_reference_id == o.network_reference_id &&
       == o. &&
      quote_id == o.quote_id &&
       == o. &&
      sender_amount == o.sender_amount &&
      sender_currency == o.sender_currency &&
      status == o.status &&
      transaction_id == o.transaction_id &&
      wire_instruction == o.wire_instruction &&
      wire_purpose == o.wire_purpose
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



437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 437

def _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 = SyncteraRubySdk.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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



508
509
510
511
512
513
514
515
516
517
518
519
520
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 508

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



413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 413

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{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[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
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


393
394
395
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 393

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



399
400
401
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 399

def hash
  [amount_in_beneficiary_currency, beneficiary_currency, case_id, creation_time, customer_id, decline_reason, effective_date, fx_exchange_rate, id, last_updated_time, max_accepted_sender_cost, , network_reference_id, , quote_id, , sender_amount, sender_currency, status, transaction_id, wire_instruction, wire_purpose].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 276

def list_invalid_properties
  invalid_properties = Array.new
  if @amount_in_beneficiary_currency.nil?
    invalid_properties.push('invalid value for "amount_in_beneficiary_currency", amount_in_beneficiary_currency cannot be nil.')
  end

  if @beneficiary_currency.nil?
    invalid_properties.push('invalid value for "beneficiary_currency", beneficiary_currency cannot be nil.')
  end

  if @creation_time.nil?
    invalid_properties.push('invalid value for "creation_time", creation_time cannot be nil.')
  end

  if @customer_id.nil?
    invalid_properties.push('invalid value for "customer_id", customer_id cannot be nil.')
  end

  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

  if @last_updated_time.nil?
    invalid_properties.push('invalid value for "last_updated_time", last_updated_time cannot be nil.')
  end

  if @originating_account_id.nil?
    invalid_properties.push('invalid value for "originating_account_id", originating_account_id cannot be nil.')
  end

  if @receiving_account_id.nil?
    invalid_properties.push('invalid value for "receiving_account_id", receiving_account_id cannot be nil.')
  end

  if @sender_amount.nil?
    invalid_properties.push('invalid value for "sender_amount", sender_amount cannot be nil.')
  end

  if @sender_currency.nil?
    invalid_properties.push('invalid value for "sender_currency", sender_currency cannot be nil.')
  end

  if @status.nil?
    invalid_properties.push('invalid value for "status", status cannot be nil.')
  end

  if !@wire_instruction.nil? && @wire_instruction.to_s.length > 210
    invalid_properties.push('invalid value for "wire_instruction", the character length must be smaller than or equal to 210.')
  end

  if @wire_purpose.nil?
    invalid_properties.push('invalid value for "wire_purpose", wire_purpose cannot be nil.')
  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



484
485
486
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 484

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



490
491
492
493
494
495
496
497
498
499
500
501
502
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 490

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



478
479
480
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 478

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



335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
# File 'lib/synctera_ruby_sdk/models/international_wire_response.rb', line 335

def valid?
  return false if @amount_in_beneficiary_currency.nil?
  return false if @beneficiary_currency.nil?
  return false if @creation_time.nil?
  return false if @customer_id.nil?
  return false if @id.nil?
  return false if @last_updated_time.nil?
  return false if @originating_account_id.nil?
  return false if @receiving_account_id.nil?
  return false if @sender_amount.nil?
  return false if @sender_currency.nil?
  return false if @status.nil?
  return false if !@wire_instruction.nil? && @wire_instruction.to_s.length > 210
  return false if @wire_purpose.nil?
  true
end