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

const (
	Imagedatatype_Raw Imagedatatype = "raw"
	Imagedatatype_Png Imagedatatype = "png"
)

var ImagedatatypeAllValues = []Imagedatatype{
	Imagedatatype_Raw,
	Imagedatatype_Png,
}

func (e *Imagedatatype) 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 "raw":
		*e = Imagedatatype_Raw
	case "png":
		*e = Imagedatatype_Png
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Imagedatatype enum")
	}

	return nil
}

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