github.com/cloudfoundry-community/cloudfoundry-cli@v6.44.1-0.20240130060226-cda5ed8e89a5+incompatible/resources/last_operation_resource.go (about)

     1  package resources
     2  
     3  type LastOperationType string
     4  
     5  const (
     6  	CreateOperation LastOperationType = "create"
     7  	UpdateOperation LastOperationType = "update"
     8  	DeleteOperation LastOperationType = "delete"
     9  )
    10  
    11  type LastOperationState string
    12  
    13  const (
    14  	OperationInProgress LastOperationState = "in progress"
    15  	OperationSucceeded  LastOperationState = "succeeded"
    16  	OperationFailed     LastOperationState = "failed"
    17  )
    18  
    19  type LastOperation struct {
    20  	// Type is either "create", "update" or "delete"
    21  	Type LastOperationType `json:"type,omitempty"`
    22  	// State is either "in progress", "succeeded", or "failed"
    23  	State LastOperationState `json:"state,omitempty"`
    24  	// Description contains more details
    25  	Description string `json:"description,omitempty"`
    26  	// CreatedAt is the time when the operation started
    27  	CreatedAt string `json:"created_at,omitempty"`
    28  	// UpdatedAt is the time when the operation was last updated
    29  	UpdatedAt string `json:"updated_at,omitempty"`
    30  }
    31  
    32  func (l LastOperation) OmitJSONry() bool {
    33  	return l == LastOperation{}
    34  }