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

const (
	Signaltype_FlyoverPool             Signaltype = "flyover pool"
	Signaltype_PlanFollowup            Signaltype = "plan followup"
	Signaltype_PublicreportWater       Signaltype = "publicreport water"
	Signaltype_PublicreportNuisance    Signaltype = "publicreport nuisance"
	Signaltype_ResidualExiring         Signaltype = "residual exiring"
	Signaltype_SurveillanceObservation Signaltype = "surveillance observation"
	Signaltype_TrapSpike               Signaltype = "trap spike"
)

var SignaltypeAllValues = []Signaltype{
	Signaltype_FlyoverPool,
	Signaltype_PlanFollowup,
	Signaltype_PublicreportWater,
	Signaltype_PublicreportNuisance,
	Signaltype_ResidualExiring,
	Signaltype_SurveillanceObservation,
	Signaltype_TrapSpike,
}

func (e *Signaltype) 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 "flyover pool":
		*e = Signaltype_FlyoverPool
	case "plan followup":
		*e = Signaltype_PlanFollowup
	case "publicreport water":
		*e = Signaltype_PublicreportWater
	case "publicreport nuisance":
		*e = Signaltype_PublicreportNuisance
	case "residual exiring":
		*e = Signaltype_ResidualExiring
	case "surveillance observation":
		*e = Signaltype_SurveillanceObservation
	case "trap spike":
		*e = Signaltype_TrapSpike
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Signaltype enum")
	}

	return nil
}

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