Class: ModernTreasury::Resources::LedgerAccountBalanceMonitors

Inherits:
Object
  • Object
show all
Defined in:
lib/modern_treasury/resources/ledger_account_balance_monitors.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ LedgerAccountBalanceMonitors

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 LedgerAccountBalanceMonitors.

Parameters:



146
147
148
# File 'lib/modern_treasury/resources/ledger_account_balance_monitors.rb', line 146

def initialize(client:)
  @client = client
end

Instance Method Details

#create(alert_condition: , ledger_account_id: , description: nil, metadata: nil, request_options: {}) ⇒ ModernTreasury::Models::LedgerAccountBalanceMonitor

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

Create a ledger account balance monitor.

Parameters:

Returns:

See Also:



27
28
29
30
31
32
33
34
35
36
# File 'lib/modern_treasury/resources/ledger_account_balance_monitors.rb', line 27

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

#delete(id, request_options: {}) ⇒ ModernTreasury::Models::LedgerAccountBalanceMonitor

Delete a ledger account balance monitor.

Parameters:

Returns:

See Also:



134
135
136
137
138
139
140
141
# File 'lib/modern_treasury/resources/ledger_account_balance_monitors.rb', line 134

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

#list(id: nil, after_cursor: nil, ledger_account_id: nil, metadata: nil, per_page: nil, request_options: {}) ⇒ ModernTreasury::Internal::Page<ModernTreasury::Models::LedgerAccountBalanceMonitor>

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

Get a list of ledger account balance monitors.

Parameters:

  • id (Array<String>)

    If you have specific IDs to retrieve in bulk, you can pass them as query paramet

  • after_cursor (String, nil)
  • ledger_account_id (String)

    Query the balance monitors for a single ledger account.

  • metadata (Hash{Symbol=>String})

    For example, if you want to query for records with metadata key ‘Type` and value

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

Returns:

See Also:



111
112
113
114
115
116
117
118
119
120
121
# File 'lib/modern_treasury/resources/ledger_account_balance_monitors.rb', line 111

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

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

Get details on a single ledger account balance monitor.

Parameters:

Returns:

See Also:



49
50
51
52
53
54
55
56
# File 'lib/modern_treasury/resources/ledger_account_balance_monitors.rb', line 49

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

#update(id, description: nil, metadata: nil, request_options: {}) ⇒ ModernTreasury::Models::LedgerAccountBalanceMonitor

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

Update a ledger account balance monitor.

Parameters:

  • id (String)

    id

  • description (String)

    An optional, free-form description for internal use.

  • metadata (Hash{Symbol=>String})

    Additional data represented as key-value pairs. Both the key and value must be s

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

Returns:

See Also:



77
78
79
80
81
82
83
84
85
86
# File 'lib/modern_treasury/resources/ledger_account_balance_monitors.rb', line 77

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