class Lithic::Resources::Accounts

def initialize(client:)

Parameters:
  • client (Lithic::Client) --

Other tags:
    Api: - private
def initialize(client:)
  @client = client
end

def list(params = {})

Other tags:
    See: Lithic::Models::AccountListParams -

Returns:
  • (Lithic::Internal::CursorPage) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • starting_after (String) --
  • page_size (Integer) --
  • ending_before (String) --
  • end_ (Time) --
  • begin_ (Time) --

Overloads:
  • list(begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {})
def list(params = {})
  parsed, options = Lithic::Models::AccountListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "v1/accounts",
    query: parsed.transform_keys(begin_: "begin", end_: "end"),
    page: Lithic::Internal::CursorPage,
    model: Lithic::Models::Account,
    options: options
  )
end

def retrieve(account_token, params = {})

Other tags:
    See: Lithic::Models::AccountRetrieveParams -

Returns:
  • (Lithic::Models::Account) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • account_token (String) --

Overloads:
  • retrieve(account_token, request_options: {})
def retrieve(account_token, params = {})
  @client.request(
    method: :get,
    path: ["v1/accounts/%1$s", account_token],
    model: Lithic::Models::Account,
    options: params[:request_options]
  )
end

def retrieve_spend_limits(account_token, params = {})

Other tags:
    See: Lithic::Models::AccountRetrieveSpendLimitsParams -

Returns:
  • (Lithic::Models::AccountSpendLimits) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • account_token (String) --

Overloads:
  • retrieve_spend_limits(account_token, request_options: {})
def retrieve_spend_limits(account_token, params = {})
  @client.request(
    method: :get,
    path: ["v1/accounts/%1$s/spend_limits", account_token],
    model: Lithic::Models::AccountSpendLimits,
    options: params[:request_options]
  )
end

def update(account_token, params = {})

Other tags:
    See: Lithic::Models::AccountUpdateParams -

Returns:
  • (Lithic::Models::Account) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • verification_address (Lithic::Models::AccountUpdateParams::VerificationAddress) --
  • state (Symbol, Lithic::Models::AccountUpdateParams::State) --
  • monthly_spend_limit (Integer) --
  • lifetime_spend_limit (Integer) --
  • daily_spend_limit (Integer) --
  • account_token (String) --

Overloads:
  • update(account_token, daily_spend_limit: nil, lifetime_spend_limit: nil, monthly_spend_limit: nil, state: nil, verification_address: nil, request_options: {})
def update(account_token, params = {})
  parsed, options = Lithic::Models::AccountUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["v1/accounts/%1$s", account_token],
    body: parsed,
    model: Lithic::Models::Account,
    options: options
  )
end