Class: ModernTreasury::VirtualAccountUpdateRequest

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

Overview

VirtualAccountUpdateRequest 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(name: SKIP, counterparty_id: SKIP, metadata: SKIP, additional_properties: nil) ⇒ VirtualAccountUpdateRequest

Returns a new instance of VirtualAccountUpdateRequest.



49
50
51
52
53
54
55
56
57
58
# File 'lib/modern_treasury/models/virtual_account_update_request.rb', line 49

def initialize(name: SKIP, counterparty_id: SKIP, metadata: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @name = name unless name == SKIP
  @counterparty_id = counterparty_id unless counterparty_id == SKIP
  @metadata =  unless  == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#counterparty_idUUID | String

TODO: Write general description for this method

Returns:

  • (UUID | String)


18
19
20
# File 'lib/modern_treasury/models/virtual_account_update_request.rb', line 18

def counterparty_id
  @counterparty_id
end

#metadataHash[String, String]

TODO: Write general description for this method

Returns:

  • (Hash[String, String])


22
23
24
# File 'lib/modern_treasury/models/virtual_account_update_request.rb', line 22

def 
  @metadata
end

#nameString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/modern_treasury/models/virtual_account_update_request.rb', line 14

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/modern_treasury/models/virtual_account_update_request.rb', line 61

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : SKIP
  counterparty_id =
    hash.key?('counterparty_id') ? hash['counterparty_id'] : SKIP
   = hash.key?('metadata') ? hash['metadata'] : 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.
  VirtualAccountUpdateRequest.new(name: name,
                                  counterparty_id: counterparty_id,
                                  metadata: ,
                                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



25
26
27
28
29
30
31
# File 'lib/modern_treasury/models/virtual_account_update_request.rb', line 25

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['counterparty_id'] = 'counterparty_id'
  @_hash['metadata'] = 'metadata'
  @_hash
end

.nullablesObject

An array for nullable fields



43
44
45
46
47
# File 'lib/modern_treasury/models/virtual_account_update_request.rb', line 43

def self.nullables
  %w[
    name
  ]
end

.optionalsObject

An array for optional fields



34
35
36
37
38
39
40
# File 'lib/modern_treasury/models/virtual_account_update_request.rb', line 34

def self.optionals
  %w[
    name
    counterparty_id
    metadata
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



92
93
94
95
96
# File 'lib/modern_treasury/models/virtual_account_update_request.rb', line 92

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

#to_sObject

Provides a human-readable string representation of the object.



85
86
87
88
89
# File 'lib/modern_treasury/models/virtual_account_update_request.rb', line 85

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