Class: ModernTreasury::InternalAccountCreateRequest

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

Overview

InternalAccountCreateRequest 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(connection_id = nil, name = nil, party_name = nil, currency = nil, party_address = SKIP, vendor_attributes = SKIP, parent_account_id = SKIP, counterparty_id = SKIP) ⇒ InternalAccountCreateRequest

Returns a new instance of InternalAccountCreateRequest.



75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 75

def initialize(connection_id = nil, name = nil, party_name = nil,
               currency = nil, party_address = SKIP,
               vendor_attributes = SKIP,  = SKIP,
               counterparty_id = SKIP)
  @connection_id = connection_id
  @name = name
  @party_name = party_name
  @party_address = party_address unless party_address == SKIP
  @currency = currency
  @vendor_attributes = vendor_attributes unless vendor_attributes == SKIP
  @parent_account_id =  unless  == SKIP
  @counterparty_id = counterparty_id unless counterparty_id == SKIP
end

Instance Attribute Details

#connection_idString

The identifier of the financial institution the account belongs to.

Returns:

  • (String)


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

def connection_id
  @connection_id
end

#counterparty_idString

The Counterparty associated to this account.

Returns:

  • (String)


44
45
46
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 44

def counterparty_id
  @counterparty_id
end

#currencyCurrency1Enum

Either “USD” or “CAD”. Internal accounts created at Increase only supports “USD”.

Returns:



31
32
33
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 31

def currency
  @currency
end

#nameString

The nickname of the account.

Returns:

  • (String)


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

def name
  @name
end

#parent_account_idString

The parent internal account of this new account.

Returns:

  • (String)


40
41
42
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 40

def 
  @parent_account_id
end

#party_addressPartyAddress

The address associated with the owner or null.

Returns:



26
27
28
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 26

def party_address
  @party_address
end

#party_nameString

The legal name of the entity which owns the account.

Returns:

  • (String)


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

def party_name
  @party_name
end

#vendor_attributesHash[String, String]

A hash of vendor specific attributes that will be used when creating the account at the vendor specified by the given connection.

Returns:

  • (Hash[String, String])


36
37
38
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 36

def vendor_attributes
  @vendor_attributes
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 90

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  connection_id = hash.key?('connection_id') ? hash['connection_id'] : nil
  name = hash.key?('name') ? hash['name'] : nil
  party_name = hash.key?('party_name') ? hash['party_name'] : nil
  currency = hash.key?('currency') ? hash['currency'] : nil
  party_address = PartyAddress.from_hash(hash['party_address']) if hash['party_address']
  vendor_attributes =
    hash.key?('vendor_attributes') ? hash['vendor_attributes'] : 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.
  InternalAccountCreateRequest.new(connection_id,
                                   name,
                                   party_name,
                                   currency,
                                   party_address,
                                   vendor_attributes,
                                   ,
                                   counterparty_id)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['connection_id'] = 'connection_id'
  @_hash['name'] = 'name'
  @_hash['party_name'] = 'party_name'
  @_hash['party_address'] = 'party_address'
  @_hash['currency'] = 'currency'
  @_hash['vendor_attributes'] = 'vendor_attributes'
  @_hash['parent_account_id'] = 'parent_account_id'
  @_hash['counterparty_id'] = 'counterparty_id'
  @_hash
end

.nullablesObject

An array for nullable fields



71
72
73
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 71

def self.nullables
  []
end

.optionalsObject

An array for optional fields



61
62
63
64
65
66
67
68
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 61

def self.optionals
  %w[
    party_address
    vendor_attributes
    parent_account_id
    counterparty_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



127
128
129
130
131
132
133
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 127

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} connection_id: #{@connection_id.inspect}, name: #{@name.inspect},"\
  " party_name: #{@party_name.inspect}, party_address: #{@party_address.inspect}, currency:"\
  " #{@currency.inspect}, vendor_attributes: #{@vendor_attributes.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.



118
119
120
121
122
123
124
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 118

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