Class: Infrawrench::CreditsNamespace
- Inherits:
-
Object
- Object
- Infrawrench::CreditsNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.credits
Instance Method Summary collapse
-
#get(org_id: nil, request_options: nil) ⇒ Hash
Prepaid credit balances, burn rate and runway.
-
#initialize(transport) ⇒ CreditsNamespace
constructor
private
A new instance of CreditsNamespace.
Constructor Details
#initialize(transport) ⇒ CreditsNamespace
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 CreditsNamespace.
5856 5857 5858 |
# File 'lib/infrawrench/client.rb', line 5856 def initialize(transport) @transport = transport end |
Instance Method Details
#get(org_id: nil, request_options: nil) ⇒ Hash
Prepaid credit balances, burn rate and runway
Every prepaid pot the organization holds, most urgent first. A provider that bills in arrears sends an invoice you can argue with; a prepaid pot that empties simply stops answering — so this is an availability number as much as a finance one.
The burn rate is measured from the server's own series of readings rather than reported by the provider, and it is the sum of the decreases between consecutive readings: a top-up inside the window is recorded separately, never netted off. The runway is bounded by both the burn and the credit's own expiry, whichever comes first.
Only providers that expose a balance appear here; most bill in arrears and have no pot.
Requires permission: costs:read.
GET /api/org/orgId/credits
5885 5886 5887 5888 5889 5890 5891 5892 |
# File 'lib/infrawrench/client.rb', line 5885 def get(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/credits", path_params: { "orgId" => org_id }, request_options: ) end |