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.
5255 5256 5257 |
# File 'lib/infrawrench/client.rb', line 5255 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
5284 5285 5286 5287 5288 5289 5290 5291 |
# File 'lib/infrawrench/client.rb', line 5284 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 |