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

const (
	Leadtype_Unknown              Leadtype = "unknown"
	Leadtype_GreenPool            Leadtype = "green-pool"
	Leadtype_PublicreportNuisance Leadtype = "publicreport-nuisance"
	Leadtype_PublicreportWater    Leadtype = "publicreport-water"
)

var LeadtypeAllValues = []Leadtype{
	Leadtype_Unknown,
	Leadtype_GreenPool,
	Leadtype_PublicreportNuisance,
	Leadtype_PublicreportWater,
}

func (e *Leadtype) 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 "unknown":
		*e = Leadtype_Unknown
	case "green-pool":
		*e = Leadtype_GreenPool
	case "publicreport-nuisance":
		*e = Leadtype_PublicreportNuisance
	case "publicreport-water":
		*e = Leadtype_PublicreportWater
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Leadtype enum")
	}

	return nil
}

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