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

const (
	Poolsourceduration_None            Poolsourceduration = "none"
	Poolsourceduration_LessThanWeek    Poolsourceduration = "less-than-week"
	Poolsourceduration_12Weeks         Poolsourceduration = "1-2-weeks"
	Poolsourceduration_24Weeks         Poolsourceduration = "2-4-weeks"
	Poolsourceduration_13Months        Poolsourceduration = "1-3-months"
	Poolsourceduration_MoreThan3Months Poolsourceduration = "more-than-3-months"
)

var PoolsourcedurationAllValues = []Poolsourceduration{
	Poolsourceduration_None,
	Poolsourceduration_LessThanWeek,
	Poolsourceduration_12Weeks,
	Poolsourceduration_24Weeks,
	Poolsourceduration_13Months,
	Poolsourceduration_MoreThan3Months,
}

func (e *Poolsourceduration) 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 = Poolsourceduration_None
	case "less-than-week":
		*e = Poolsourceduration_LessThanWeek
	case "1-2-weeks":
		*e = Poolsourceduration_12Weeks
	case "2-4-weeks":
		*e = Poolsourceduration_24Weeks
	case "1-3-months":
		*e = Poolsourceduration_13Months
	case "more-than-3-months":
		*e = Poolsourceduration_MoreThan3Months
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Poolsourceduration enum")
	}

	return nil
}

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