forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlast_operation_resource.go
34 lines (28 loc) · 1017 Bytes
/
last_operation_resource.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
package resources
type LastOperationType string
const (
CreateOperation LastOperationType = "create"
UpdateOperation LastOperationType = "update"
DeleteOperation LastOperationType = "delete"
)
type LastOperationState string
const (
OperationInProgress LastOperationState = "in progress"
OperationSucceeded LastOperationState = "succeeded"
OperationFailed LastOperationState = "failed"
)
type LastOperation struct {
// Type is either "create", "update" or "delete"
Type LastOperationType `json:"type,omitempty"`
// State is either "in progress", "succeeded", or "failed"
State LastOperationState `json:"state,omitempty"`
// Description contains more details
Description string `json:"description,omitempty"`
// CreatedAt is the time when the operation started
CreatedAt string `json:"created_at,omitempty"`
// UpdatedAt is the time when the operation was last updated
UpdatedAt string `json:"updated_at,omitempty"`
}
func (l LastOperation) OmitJSONry() bool {
return l == LastOperation{}
}