Class: ModernTreasury::Resources::InternalAccounts

Inherits:
Object
  • Object
show all
Defined in:
lib/modern_treasury/resources/internal_accounts.rb,
lib/modern_treasury/resources/internal_accounts/balance_reports.rb

Defined Under Namespace

Classes: BalanceReports

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ InternalAccounts

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of InternalAccounts.

Parameters:



208
209
210
211
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 208

def initialize(client:)
  @client = client
  @balance_reports = ModernTreasury::Resources::InternalAccounts::BalanceReports.new(client: client)
end

Instance Attribute Details

#balance_reportsModernTreasury::Resources::InternalAccounts::BalanceReports (readonly)



7
8
9
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 7

def balance_reports
  @balance_reports
end

Instance Method Details

#create(connection_id: , currency: , name: , party_name: , account_capabilities: nil, account_type: nil, counterparty_id: nil, legal_entity_id: nil, parent_account_id: nil, party_address: nil, vendor_attributes: nil, request_options: {}) ⇒ ModernTreasury::Models::InternalAccount

Some parameter documentations has been truncated, see Models::InternalAccountCreateParams for more details.

create internal account

Parameters:

Returns:

See Also:



43
44
45
46
47
48
49
50
51
52
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 43

def create(params)
  parsed, options = ModernTreasury::InternalAccountCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/internal_accounts",
    body: parsed,
    model: ModernTreasury::InternalAccount,
    options: options
  )
end

#list(after_cursor: nil, counterparty_id: nil, currency: nil, legal_entity_id: nil, metadata: nil, payment_direction: nil, payment_type: nil, per_page: nil, status: nil, request_options: {}) ⇒ ModernTreasury::Internal::Page<ModernTreasury::Models::InternalAccount>

Some parameter documentations has been truncated, see Models::InternalAccountListParams for more details.

list internal accounts

Parameters:

Returns:

See Also:



139
140
141
142
143
144
145
146
147
148
149
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 139

def list(params = {})
  parsed, options = ModernTreasury::InternalAccountListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "api/internal_accounts",
    query: parsed,
    page: ModernTreasury::Internal::Page,
    model: ModernTreasury::InternalAccount,
    options: options
  )
end

#request_closure(id, request_options: {}) ⇒ ModernTreasury::Models::InternalAccount

request closure of internal account

Parameters:

Returns:

See Also:



162
163
164
165
166
167
168
169
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 162

def request_closure(id, params = {})
  @client.request(
    method: :post,
    path: ["api/internal_accounts/%1$s/request_closure", id],
    model: ModernTreasury::InternalAccount,
    options: params[:request_options]
  )
end

#retrieve(id, request_options: {}) ⇒ ModernTreasury::Models::InternalAccount

get internal account

Parameters:

Returns:

See Also:



65
66
67
68
69
70
71
72
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 65

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["api/internal_accounts/%1$s", id],
    model: ModernTreasury::InternalAccount,
    options: params[:request_options]
  )
end

#update(id, counterparty_id: nil, ledger_account_id: nil, metadata: nil, name: nil, parent_account_id: nil, request_options: {}) ⇒ ModernTreasury::Models::InternalAccount

Some parameter documentations has been truncated, see Models::InternalAccountUpdateParams for more details.

update internal account

Parameters:

  • id (String)

    Unique identifier for the account.

  • counterparty_id (String)

    The Counterparty associated to this account.

  • ledger_account_id (String)

    The Ledger Account associated to this account.

  • metadata (Hash{Symbol=>String})

    Additional data in the form of key-value pairs. Pairs can be removed by passing

  • name (String)

    The nickname for the internal account.

  • parent_account_id (String)

    The parent internal account for this account.

  • request_options (ModernTreasury::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



98
99
100
101
102
103
104
105
106
107
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 98

def update(id, params = {})
  parsed, options = ModernTreasury::InternalAccountUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["api/internal_accounts/%1$s", id],
    body: parsed,
    model: ModernTreasury::InternalAccount,
    options: options
  )
end

#update_account_capability(id, internal_account_id: , identifier: , request_options: {}) ⇒ ModernTreasury::Models::InternalAccountUpdateAccountCapabilityResponse

Some parameter documentations has been truncated, see Models::InternalAccountUpdateAccountCapabilityParams for more details.

update account_capability

Parameters:

  • id (String)

    Path param: Unique identifier for the account capability.

  • internal_account_id (String)

    Path param: Unique identifier for the internal account.

  • identifier (String)

    Body param: A unique reference assigned by your bank for tracking and recognizin

  • request_options (ModernTreasury::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 190

def (id, params)
  parsed, options = ModernTreasury::InternalAccountUpdateAccountCapabilityParams.dump_request(params)
   =
    parsed.delete(:internal_account_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :patch,
    path: ["api/internal_accounts/%1$s/account_capabilities/%2$s", , id],
    body: parsed,
    model: ModernTreasury::Models::InternalAccountUpdateAccountCapabilityResponse,
    options: options
  )
end