Skip to content

Commit

Permalink
Merge branch 'feature/add-missing-states'
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSubiros committed Mar 12, 2020
2 parents f8b9633 + cd5d1a2 commit cdd12e9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions dataset/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,19 @@ const service = "dataset-api"
// State - iota enum of possible states
type State int

// Possible values for a State
// Possible values for a State of the resource. It can only be one of the following:
// TODO these states should be enforced in all the 'POST' and 'PUT' operations that can modify states of resources
const (
StateCreated State = iota
StateSubmitted
StateCompleted
StateCompleted // Instances only
StateFailed // Instances only
StateEditionConfirmed // instances and versions only
StateAssociated // not editions
StatePublished
)

var stateValues = []string{"created", "submitted", "completed"}
var stateValues = []string{"created", "submitted", "completed", "failed", "edition-confirmed", "associated", "published"}

// String returns the string representation of a state
func (s State) String() string {
Expand Down

0 comments on commit cdd12e9

Please sign in to comment.