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

const (
	Nuisancedurationtype_None        Nuisancedurationtype = "none"
	Nuisancedurationtype_JustNoticed Nuisancedurationtype = "just-noticed"
	Nuisancedurationtype_FewDays     Nuisancedurationtype = "few-days"
	Nuisancedurationtype_12Weeks     Nuisancedurationtype = "1-2-weeks"
	Nuisancedurationtype_24Weeks     Nuisancedurationtype = "2-4-weeks"
	Nuisancedurationtype_13Months    Nuisancedurationtype = "1-3-months"
	Nuisancedurationtype_Seasonal    Nuisancedurationtype = "seasonal"
)

var NuisancedurationtypeAllValues = []Nuisancedurationtype{
	Nuisancedurationtype_None,
	Nuisancedurationtype_JustNoticed,
	Nuisancedurationtype_FewDays,
	Nuisancedurationtype_12Weeks,
	Nuisancedurationtype_24Weeks,
	Nuisancedurationtype_13Months,
	Nuisancedurationtype_Seasonal,
}

func (e *Nuisancedurationtype) 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 "none":
		*e = Nuisancedurationtype_None
	case "just-noticed":
		*e = Nuisancedurationtype_JustNoticed
	case "few-days":
		*e = Nuisancedurationtype_FewDays
	case "1-2-weeks":
		*e = Nuisancedurationtype_12Weeks
	case "2-4-weeks":
		*e = Nuisancedurationtype_24Weeks
	case "1-3-months":
		*e = Nuisancedurationtype_13Months
	case "seasonal":
		*e = Nuisancedurationtype_Seasonal
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Nuisancedurationtype enum")
	}

	return nil
}

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