Documentation
¶
Overview ¶
Package vantageapi provides a thin wrapper around the official Vantage Go client.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct {
StatusCode int
RetryAfter time.Duration
// contains filtered or unexported fields
}
APIError preserves status and retry timing without exposing the response body.
type Client ¶
type Client interface {
GetCosts(ctx context.Context, params *GetCostsParams) (*CostsResponse, error)
}
Client wraps the official Vantage generated client for cost queries. The plugin owns this interface to decouple from generated code changes.
type CostAmount ¶
CostAmount represents an amount with currency.
type CostRow ¶
type CostRow struct {
AccruedAt string // ISO 8601: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DD
Amount string // Decimal string, never float
Currency string // ISO 4217 code (USD, EUR, etc.)
Usage interface{} // Untyped, provider-specific
UsageUnit *string
Provider *string
Service *string
AccountID *string
BillingAccountID *string
Region *string
ResourceID *string
ResourceName *string
Tags []string // Array of strings, format undocumented
CostCategory *string
CostSubcategory *string
ChargeType *string // Distinguishes tax, credit, refund lines
Tagged *bool
Segment *string
}
CostRow represents a single cost data point.
type CostSettings ¶
type CostSettings struct {
Amortize *bool
IncludeCredits *bool
IncludeRefunds *bool
IncludeDiscounts *bool
IncludeTax *bool
AggregateBy *string
ShowPreviousPeriod *bool
UnAllocated *bool
}
CostSettings represents cost query settings.
type CostsResponse ¶
type CostsResponse struct {
// Costs is the list of cost rows; amounts are decimal strings
Costs []*CostRow
// TotalCost is the sum of all costs in the period
TotalCost *CostAmount
// TotalUsage is usage broken down by unit
TotalUsage []*UsageAmount
// Links for pagination (next URL, etc.)
Links *PaginationLinks
}
CostsResponse represents the response from GET /costs.
type GetCostsParams ¶
type GetCostsParams struct {
CostReportToken *string
WorkspaceToken *string
Filter *string
StartDate *string // ISO 8601 format: YYYY-MM-DD
EndDate *string // ISO 8601 format: YYYY-MM-DD
DateBin *string // day, week, month, quarter, hour
Groupings []string // e.g., []string{"provider", "service", "account_id"}
Page *int32
Limit *int32
// Settings for cost basis
Settings *CostSettings
}
GetCostsParams represents parameters for the GET /costs operation.
type PaginationLinks ¶
PaginationLinks contains links for pagination.
type UsageAmount ¶
UsageAmount represents usage grouped by unit.