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

const (
	Userrole_Root         Userrole = "root"
	Userrole_AccountOwner Userrole = "account-owner"
)

var UserroleAllValues = []Userrole{
	Userrole_Root,
	Userrole_AccountOwner,
}

func (e *Userrole) 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 "root":
		*e = Userrole_Root
	case "account-owner":
		*e = Userrole_AccountOwner
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Userrole enum")
	}

	return nil
}

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