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

const (
	Phonestatustype_Unconfirmed Phonestatustype = "unconfirmed"
	Phonestatustype_OkToSend    Phonestatustype = "ok-to-send"
	Phonestatustype_Stopped     Phonestatustype = "stopped"
)

var PhonestatustypeAllValues = []Phonestatustype{
	Phonestatustype_Unconfirmed,
	Phonestatustype_OkToSend,
	Phonestatustype_Stopped,
}

func (e *Phonestatustype) 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 "unconfirmed":
		*e = Phonestatustype_Unconfirmed
	case "ok-to-send":
		*e = Phonestatustype_OkToSend
	case "stopped":
		*e = Phonestatustype_Stopped
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Phonestatustype enum")
	}

	return nil
}

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