//
// Code generated by go-jet DO NOT EDIT.
//
// WARNING: Changes to this file may cause incorrect behavior
// and will be lost if the code is regenerated
//

package model

import "errors"

type RiverJobState string

const (
	RiverJobState_Available RiverJobState = "available"
	RiverJobState_Cancelled RiverJobState = "cancelled"
	RiverJobState_Completed RiverJobState = "completed"
	RiverJobState_Discarded RiverJobState = "discarded"
	RiverJobState_Pending   RiverJobState = "pending"
	RiverJobState_Retryable RiverJobState = "retryable"
	RiverJobState_Running   RiverJobState = "running"
	RiverJobState_Scheduled RiverJobState = "scheduled"
)

var RiverJobStateAllValues = []RiverJobState{
	RiverJobState_Available,
	RiverJobState_Cancelled,
	RiverJobState_Completed,
	RiverJobState_Discarded,
	RiverJobState_Pending,
	RiverJobState_Retryable,
	RiverJobState_Running,
	RiverJobState_Scheduled,
}

func (e *RiverJobState) Scan(value interface{}) error {
	var enumValue string
	switch val := value.(type) {
	case string:
		enumValue = val
	case []byte:
		enumValue = string(val)
	default:
		return errors.New("jet: Invalid scan value for AllTypesEnum enum. Enum value has to be of type string or []byte")
	}

	switch enumValue {
	case "available":
		*e = RiverJobState_Available
	case "cancelled":
		*e = RiverJobState_Cancelled
	case "completed":
		*e = RiverJobState_Completed
	case "discarded":
		*e = RiverJobState_Discarded
	case "pending":
		*e = RiverJobState_Pending
	case "retryable":
		*e = RiverJobState_Retryable
	case "running":
		*e = RiverJobState_Running
	case "scheduled":
		*e = RiverJobState_Scheduled
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for RiverJobState enum")
	}

	return nil
}

func (e RiverJobState) String() string {
	return string(e)
}
