This repository has been archived by the owner on Dec 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
/
cost_estimate.go
43 lines (37 loc) · 2.19 KB
/
cost_estimate.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package types
import "time"
// CostEstimateStatus represents a costEstimate state.
type CostEstimateStatus string
// List all available costEstimate statuses.
const (
CostEstimateCanceled CostEstimateStatus = "canceled"
CostEstimateErrored CostEstimateStatus = "errored"
CostEstimateFinished CostEstimateStatus = "finished"
CostEstimatePending CostEstimateStatus = "pending"
CostEstimateQueued CostEstimateStatus = "queued"
CostEstimateSkippedDueToTargeting CostEstimateStatus = "skipped_due_to_targeting"
)
// CostEstimate represents a Terraform Enterprise costEstimate.
type CostEstimate struct {
ID string `jsonapi:"primary,cost-estimates"`
DeltaMonthlyCost string `jsonapi:"attribute" json:"delta-monthly-cost"`
ErrorMessage string `jsonapi:"attribute" json:"error-message"`
MatchedResourcesCount int `jsonapi:"attribute" json:"matched-resources-count"`
PriorMonthlyCost string `jsonapi:"attribute" json:"prior-monthly-cost"`
ProposedMonthlyCost string `jsonapi:"attribute" json:"proposed-monthly-cost"`
ResourcesCount int `jsonapi:"attribute" json:"resources-count"`
Status CostEstimateStatus `jsonapi:"attribute" json:"status"`
StatusTimestamps *CostEstimateStatusTimestamps `jsonapi:"attribute" json:"status-timestamps"`
UnmatchedResourcesCount int `jsonapi:"attribute" json:"unmatched-resources-count"`
}
// CostEstimateStatusTimestamps holds the timestamps for individual costEstimate statuses.
type CostEstimateStatusTimestamps struct {
CanceledAt time.Time `json:"canceled-at"`
ErroredAt time.Time `json:"errored-at"`
FinishedAt time.Time `json:"finished-at"`
PendingAt time.Time `json:"pending-at"`
QueuedAt time.Time `json:"queued-at"`
SkippedDueToTargetingAt time.Time `json:"skipped-due-to-targeting-at"`
}