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

const (
	Communicationstatustype_Closed           Communicationstatustype = "closed"
	Communicationstatustype_Invalid          Communicationstatustype = "invalid"
	Communicationstatustype_New              Communicationstatustype = "new"
	Communicationstatustype_Opened           Communicationstatustype = "opened"
	Communicationstatustype_Pending          Communicationstatustype = "pending"
	Communicationstatustype_PossibleIssue    Communicationstatustype = "possible-issue"
	Communicationstatustype_PossibleResolved Communicationstatustype = "possible-resolved"
	Communicationstatustype_Resolved         Communicationstatustype = "resolved"
)

var CommunicationstatustypeAllValues = []Communicationstatustype{
	Communicationstatustype_Closed,
	Communicationstatustype_Invalid,
	Communicationstatustype_New,
	Communicationstatustype_Opened,
	Communicationstatustype_Pending,
	Communicationstatustype_PossibleIssue,
	Communicationstatustype_PossibleResolved,
	Communicationstatustype_Resolved,
}

func (e *Communicationstatustype) 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 = Communicationstatustype_Closed
	case "invalid":
		*e = Communicationstatustype_Invalid
	case "new":
		*e = Communicationstatustype_New
	case "opened":
		*e = Communicationstatustype_Opened
	case "pending":
		*e = Communicationstatustype_Pending
	case "possible-issue":
		*e = Communicationstatustype_PossibleIssue
	case "possible-resolved":
		*e = Communicationstatustype_PossibleResolved
	case "resolved":
		*e = Communicationstatustype_Resolved
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Communicationstatustype enum")
	}

	return nil
}

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