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

const (
	Communicationlogentry_Created                Communicationlogentry = "created"
	Communicationlogentry_StatusClosed           Communicationlogentry = "status.closed"
	Communicationlogentry_StatusInvalidated      Communicationlogentry = "status.invalidated"
	Communicationlogentry_StatusOpened           Communicationlogentry = "status.opened"
	Communicationlogentry_StatusPending          Communicationlogentry = "status.pending"
	Communicationlogentry_StatusPossibleIssue    Communicationlogentry = "status.possible-issue"
	Communicationlogentry_StatusPossibleResolved Communicationlogentry = "status.possible-resolved"
)

var CommunicationlogentryAllValues = []Communicationlogentry{
	Communicationlogentry_Created,
	Communicationlogentry_StatusClosed,
	Communicationlogentry_StatusInvalidated,
	Communicationlogentry_StatusOpened,
	Communicationlogentry_StatusPending,
	Communicationlogentry_StatusPossibleIssue,
	Communicationlogentry_StatusPossibleResolved,
}

func (e *Communicationlogentry) 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 "created":
		*e = Communicationlogentry_Created
	case "status.closed":
		*e = Communicationlogentry_StatusClosed
	case "status.invalidated":
		*e = Communicationlogentry_StatusInvalidated
	case "status.opened":
		*e = Communicationlogentry_StatusOpened
	case "status.pending":
		*e = Communicationlogentry_StatusPending
	case "status.possible-issue":
		*e = Communicationlogentry_StatusPossibleIssue
	case "status.possible-resolved":
		*e = Communicationlogentry_StatusPossibleResolved
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Communicationlogentry enum")
	}

	return nil
}

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