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

const (
	Filestatustype_Error      Filestatustype = "error"
	Filestatustype_Parsed     Filestatustype = "parsed"
	Filestatustype_Uploaded   Filestatustype = "uploaded"
	Filestatustype_Parsing    Filestatustype = "parsing"
	Filestatustype_Committing Filestatustype = "committing"
	Filestatustype_Committed  Filestatustype = "committed"
	Filestatustype_Discarded  Filestatustype = "discarded"
)

var FilestatustypeAllValues = []Filestatustype{
	Filestatustype_Error,
	Filestatustype_Parsed,
	Filestatustype_Uploaded,
	Filestatustype_Parsing,
	Filestatustype_Committing,
	Filestatustype_Committed,
	Filestatustype_Discarded,
}

func (e *Filestatustype) 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 "error":
		*e = Filestatustype_Error
	case "parsed":
		*e = Filestatustype_Parsed
	case "uploaded":
		*e = Filestatustype_Uploaded
	case "parsing":
		*e = Filestatustype_Parsing
	case "committing":
		*e = Filestatustype_Committing
	case "committed":
		*e = Filestatustype_Committed
	case "discarded":
		*e = Filestatustype_Discarded
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Filestatustype enum")
	}

	return nil
}

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