From cd5d1a2012966e44c417cfee91c526ef9ab94a7a Mon Sep 17 00:00:00 2001 From: David Subiros Date: Wed, 11 Mar 2020 17:24:20 +0000 Subject: [PATCH] Added missing states --- dataset/dataset.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dataset/dataset.go b/dataset/dataset.go index cf034ad2..8213e03a 100644 --- a/dataset/dataset.go +++ b/dataset/dataset.go @@ -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 {