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

const (
	Audiodatatype_Raw           Audiodatatype = "raw"
	Audiodatatype_RawNormalized Audiodatatype = "raw_normalized"
	Audiodatatype_Ogg           Audiodatatype = "ogg"
)

var AudiodatatypeAllValues = []Audiodatatype{
	Audiodatatype_Raw,
	Audiodatatype_RawNormalized,
	Audiodatatype_Ogg,
}

func (e *Audiodatatype) 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 = Audiodatatype_Raw
	case "raw_normalized":
		*e = Audiodatatype_RawNormalized
	case "ogg":
		*e = Audiodatatype_Ogg
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Audiodatatype enum")
	}

	return nil
}

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