Documentation ¶
Index ¶
- type CostsService
- func (svc *CostsService) GetCustomerAccountCosts(ctx context.Context, customerAccountID string, from, to time.Time, ...) (*CustomerAccountResponse, error)
- func (svc *CostsService) GetProjectCosts(ctx context.Context, customerAccountID, projectID string, from, to time.Time, ...) (*ProjectDetailResponse, error)
- type CustomerAccountResponse
- type Date
- type ProjectCostsResponse
- type ProjectDetailResponse
- type ReportDatapoint
- type ServiceResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CostsService ¶
CostsService is the client costs service
func New ¶
func New(client common.Client) *CostsService
New creates a new CostsService, which can be used to retrieve cost informations for customer accounts and specific projects.
func (*CostsService) GetCustomerAccountCosts ¶
func (svc *CostsService) GetCustomerAccountCosts( ctx context.Context, customerAccountID string, from, to time.Time, granularity, depth string, ) (*CustomerAccountResponse, error)
GetCustomerAccountCosts fetches cost data for a certain customer account in a specific time frame. The response is a list of project cost summaries. It provides a general cost overview for a certain customer account. See https://api.stackit.schwarz/costs-service/openapi.v1.html#operation/get-costs-reports-customer-account
func (*CostsService) GetProjectCosts ¶
func (svc *CostsService) GetProjectCosts( ctx context.Context, customerAccountID, projectID string, from, to time.Time, granularity, depth string, ) (*ProjectDetailResponse, error)
GetProjectCosts fetches detailed cost data for a project in a specific time frame. The response contains all costs broken down into services used by the project. See https://api.stackit.schwarz/costs-service/openapi.v1.html#operation/get-costs-project
type CustomerAccountResponse ¶
type CustomerAccountResponse []ProjectDetailResponse
CustomerAccountResponse is the response for customer account costs
type ProjectCostsResponse ¶
type ProjectCostsResponse struct { ProjectID string `json:"projectId"` ProjectName string `json:"projectName"` TotalCharge float64 `json:"totalCharge"` TotalDiscount float64 `json:"totalDiscount"` }
ProjectCostsResponse is the response for project costs
type ProjectDetailResponse ¶
type ProjectDetailResponse struct { ProjectCostsResponse Services []ServiceResponse `json:"services"` }
ProjectDetailResponse is the costs for project and its services
type ReportDatapoint ¶
type ReportDatapoint struct { Date Date `json:"timePeriod"` Charge float64 `json:"charge"` Discount float64 `json:"discount"` Quantity int64 `json:"quantity"` }
ReportDatapoint is a report data struct
type ServiceResponse ¶
type ServiceResponse struct { TotalQuantity int64 `json:"totalQuantity"` TotalCharge float64 `json:"totalCharge"` TotalDiscount float64 `json:"totalDiscount"` UnitLabel string `json:"unitLabel"` Sku string `json:"sku"` ServiceName string `json:"serviceName"` ServiceCategoryName string `json:"serviceCategoryName"` ReportData []ReportDatapoint `json:"reportData"` }
ServiceResponse is the costs for service