// Copyright 2018 Bull S.A.S. Atos Technologies - Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois, France. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Code generated by go-enum // DO NOT EDIT! package tasks import ( "fmt" "strings" ) const ( // TaskStepStatusINITIAL is a TaskStepStatus of type INITIAL TaskStepStatusINITIAL TaskStepStatus = iota // TaskStepStatusRUNNING is a TaskStepStatus of type RUNNING TaskStepStatusRUNNING // TaskStepStatusDONE is a TaskStepStatus of type DONE TaskStepStatusDONE // TaskStepStatusERROR is a TaskStepStatus of type ERROR TaskStepStatusERROR // TaskStepStatusCANCELED is a TaskStepStatus of type CANCELED TaskStepStatusCANCELED ) const _TaskStepStatusName = "INITIALRUNNINGDONEERRORCANCELED" var _TaskStepStatusMap = map[TaskStepStatus]string{ 0: _TaskStepStatusName[0:7], 1: _TaskStepStatusName[7:14], 2: _TaskStepStatusName[14:18], 3: _TaskStepStatusName[18:23], 4: _TaskStepStatusName[23:31], } func (i TaskStepStatus) String() string { if str, ok := _TaskStepStatusMap[i]; ok { return str } return fmt.Sprintf("TaskStepStatus(%d)", i) } var _TaskStepStatusValue = map[string]TaskStepStatus{ _TaskStepStatusName[0:7]: 0, strings.ToLower(_TaskStepStatusName[0:7]): 0, _TaskStepStatusName[7:14]: 1, strings.ToLower(_TaskStepStatusName[7:14]): 1, _TaskStepStatusName[14:18]: 2, strings.ToLower(_TaskStepStatusName[14:18]): 2, _TaskStepStatusName[18:23]: 3, strings.ToLower(_TaskStepStatusName[18:23]): 3, _TaskStepStatusName[23:31]: 4, strings.ToLower(_TaskStepStatusName[23:31]): 4, } // ParseTaskStepStatus attempts to convert a string to a TaskStepStatus func ParseTaskStepStatus(name string) (TaskStepStatus, error) { if x, ok := _TaskStepStatusValue[name]; ok { return TaskStepStatus(x), nil } return TaskStepStatus(0), fmt.Errorf("%s is not a valid TaskStepStatus", name) }