Class: CheckoutSdk::Balances::BalancesQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/checkout_sdk/balances/balances_query.rb

Overview

Query parameters accepted by GET /balances/id.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#balances_atString

Serialised as ‘balancesAt`.

Returns:

  • (String)

    A UTC datetime (RFC 3339) to retrieve historical balances at a specific point in time. Must be in the past.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/checkout_sdk/balances/balances_query.rb', line 17

class BalancesQuery
  attr_accessor :query,
                :with_currency_account_id,
                :balances_at

  # Returns the params in the camelCase form expected by the API.
  def to_h
    {
      query: query,
      withCurrencyAccountId: ,
      balancesAt: balances_at
    }.compact
  end
end

#queryString

Returns Search expression (e.g. “currency:EUR”).

Returns:

  • (String)

    Search expression (e.g. “currency:EUR”).



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/checkout_sdk/balances/balances_query.rb', line 17

class BalancesQuery
  attr_accessor :query,
                :with_currency_account_id,
                :balances_at

  # Returns the params in the camelCase form expected by the API.
  def to_h
    {
      query: query,
      withCurrencyAccountId: ,
      balancesAt: balances_at
    }.compact
  end
end

#with_currency_account_idTrueClass, FalseClass

Serialised as ‘withCurrencyAccountId`.

Returns:

  • (TrueClass, FalseClass)

    When true, the response includes the ‘currency_account_id` on each CurrencyAccountBalance.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/checkout_sdk/balances/balances_query.rb', line 17

class BalancesQuery
  attr_accessor :query,
                :with_currency_account_id,
                :balances_at

  # Returns the params in the camelCase form expected by the API.
  def to_h
    {
      query: query,
      withCurrencyAccountId: ,
      balancesAt: balances_at
    }.compact
  end
end

Instance Method Details

#to_hObject

Returns the params in the camelCase form expected by the API.



23
24
25
26
27
28
29
# File 'lib/checkout_sdk/balances/balances_query.rb', line 23

def to_h
  {
    query: query,
    withCurrencyAccountId: ,
    balancesAt: balances_at
  }.compact
end