//
// 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 Poolcondition string

const (
	Poolcondition_Blue      Poolcondition = "blue"
	Poolcondition_Dry       Poolcondition = "dry"
	Poolcondition_FalsePool Poolcondition = "false pool"
	Poolcondition_Unknown   Poolcondition = "unknown"
	Poolcondition_Green     Poolcondition = "green"
	Poolcondition_Murky     Poolcondition = "murky"
)

var PoolconditionAllValues = []Poolcondition{
	Poolcondition_Blue,
	Poolcondition_Dry,
	Poolcondition_FalsePool,
	Poolcondition_Unknown,
	Poolcondition_Green,
	Poolcondition_Murky,
}

func (e *Poolcondition) 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 "blue":
		*e = Poolcondition_Blue
	case "dry":
		*e = Poolcondition_Dry
	case "false pool":
		*e = Poolcondition_FalsePool
	case "unknown":
		*e = Poolcondition_Unknown
	case "green":
		*e = Poolcondition_Green
	case "murky":
		*e = Poolcondition_Murky
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Poolcondition enum")
	}

	return nil
}

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