Class: ModernTreasury::InternalAccountUpdateRequest

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

Overview

InternalAccountUpdateRequest 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, metadata = SKIP, parent_account_id = SKIP, counterparty_id = SKIP) ⇒ InternalAccountUpdateRequest

Returns a new instance of InternalAccountUpdateRequest.



54
55
56
57
58
59
60
# File 'lib/modern_treasury/models/internal_account_update_request.rb', line 54

def initialize(name = SKIP,  = SKIP,  = SKIP,
               counterparty_id = SKIP)
  @name = name unless name == SKIP
  @metadata =  unless  == SKIP
  @parent_account_id =  unless  == SKIP
  @counterparty_id = counterparty_id unless counterparty_id == SKIP
end

Instance Attribute Details

#counterparty_idString

The Counterparty associated to this account.

Returns:

  • (String)


27
28
29
# File 'lib/modern_treasury/models/internal_account_update_request.rb', line 27

def counterparty_id
  @counterparty_id
end

#metadataHash[String, String]

Additional data in the form of key-value pairs. Pairs can be removed by passing an empty string or ‘null` as the value.

Returns:

  • (Hash[String, String])


19
20
21
# File 'lib/modern_treasury/models/internal_account_update_request.rb', line 19

def 
  @metadata
end

#nameString

The nickname for the internal account.

Returns:

  • (String)


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

def name
  @name
end

#parent_account_idString

The parent internal account for this account.

Returns:

  • (String)


23
24
25
# File 'lib/modern_treasury/models/internal_account_update_request.rb', line 23

def 
  @parent_account_id
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
# File 'lib/modern_treasury/models/internal_account_update_request.rb', line 63

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : SKIP
   = hash.key?('metadata') ? hash['metadata'] : SKIP
   =
    hash.key?('parent_account_id') ? hash['parent_account_id'] : SKIP
  counterparty_id =
    hash.key?('counterparty_id') ? hash['counterparty_id'] : SKIP

  # Create object from extracted values.
  InternalAccountUpdateRequest.new(name,
                                   ,
                                   ,
                                   counterparty_id)
end

.namesObject

A mapping from model property names to API property names.



30
31
32
33
34
35
36
37
# File 'lib/modern_treasury/models/internal_account_update_request.rb', line 30

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

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



40
41
42
43
44
45
46
47
# File 'lib/modern_treasury/models/internal_account_update_request.rb', line 40

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

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



89
90
91
92
93
# File 'lib/modern_treasury/models/internal_account_update_request.rb', line 89

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

#to_sObject

Provides a human-readable string representation of the object.



82
83
84
85
86
# File 'lib/modern_treasury/models/internal_account_update_request.rb', line 82

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