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

const (
	Communicationstatus_Closed           Communicationstatus = "closed"
	Communicationstatus_Invalid          Communicationstatus = "invalid"
	Communicationstatus_New              Communicationstatus = "new"
	Communicationstatus_Opened           Communicationstatus = "opened"
	Communicationstatus_Pending          Communicationstatus = "pending"
	Communicationstatus_PossibleIssue    Communicationstatus = "possible-issue"
	Communicationstatus_PossibleResolved Communicationstatus = "possible-resolved"
	Communicationstatus_Resolved         Communicationstatus = "resolved"
)

var CommunicationstatusAllValues = []Communicationstatus{
	Communicationstatus_Closed,
	Communicationstatus_Invalid,
	Communicationstatus_New,
	Communicationstatus_Opened,
	Communicationstatus_Pending,
	Communicationstatus_PossibleIssue,
	Communicationstatus_PossibleResolved,
	Communicationstatus_Resolved,
}

func (e *Communicationstatus) 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 "closed":
		*e = Communicationstatus_Closed
	case "invalid":
		*e = Communicationstatus_Invalid
	case "new":
		*e = Communicationstatus_New
	case "opened":
		*e = Communicationstatus_Opened
	case "pending":
		*e = Communicationstatus_Pending
	case "possible-issue":
		*e = Communicationstatus_PossibleIssue
	case "possible-resolved":
		*e = Communicationstatus_PossibleResolved
	case "resolved":
		*e = Communicationstatus_Resolved
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Communicationstatus enum")
	}

	return nil
}

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