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

const (
	Messagetypeemail_InitialContact                 Messagetypeemail = "initial-contact"
	Messagetypeemail_ReportSubscriptionConfirmation Messagetypeemail = "report-subscription-confirmation"
	Messagetypeemail_ReportStatusScheduled          Messagetypeemail = "report-status-scheduled"
	Messagetypeemail_ReportStatusComplete           Messagetypeemail = "report-status-complete"
	Messagetypeemail_ReportNotificationConfirmation Messagetypeemail = "report-notification-confirmation"
)

var MessagetypeemailAllValues = []Messagetypeemail{
	Messagetypeemail_InitialContact,
	Messagetypeemail_ReportSubscriptionConfirmation,
	Messagetypeemail_ReportStatusScheduled,
	Messagetypeemail_ReportStatusComplete,
	Messagetypeemail_ReportNotificationConfirmation,
}

func (e *Messagetypeemail) 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 "initial-contact":
		*e = Messagetypeemail_InitialContact
	case "report-subscription-confirmation":
		*e = Messagetypeemail_ReportSubscriptionConfirmation
	case "report-status-scheduled":
		*e = Messagetypeemail_ReportStatusScheduled
	case "report-status-complete":
		*e = Messagetypeemail_ReportStatusComplete
	case "report-notification-confirmation":
		*e = Messagetypeemail_ReportNotificationConfirmation
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Messagetypeemail enum")
	}

	return nil
}

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