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

const (
	Reportstatustype_Reported    Reportstatustype = "reported"
	Reportstatustype_Reviewed    Reportstatustype = "reviewed"
	Reportstatustype_Scheduled   Reportstatustype = "scheduled"
	Reportstatustype_Treated     Reportstatustype = "treated"
	Reportstatustype_Invalidated Reportstatustype = "invalidated"
)

var ReportstatustypeAllValues = []Reportstatustype{
	Reportstatustype_Reported,
	Reportstatustype_Reviewed,
	Reportstatustype_Scheduled,
	Reportstatustype_Treated,
	Reportstatustype_Invalidated,
}

func (e *Reportstatustype) 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 "reported":
		*e = Reportstatustype_Reported
	case "reviewed":
		*e = Reportstatustype_Reviewed
	case "scheduled":
		*e = Reportstatustype_Scheduled
	case "treated":
		*e = Reportstatustype_Treated
	case "invalidated":
		*e = Reportstatustype_Invalidated
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Reportstatustype enum")
	}

	return nil
}

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