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

const (
	Textorigin_District        Textorigin = "district"
	Textorigin_Llm             Textorigin = "llm"
	Textorigin_WebsiteAction   Textorigin = "website-action"
	Textorigin_Customer        Textorigin = "customer"
	Textorigin_Reiteration     Textorigin = "reiteration"
	Textorigin_CommandResponse Textorigin = "command-response"
)

var TextoriginAllValues = []Textorigin{
	Textorigin_District,
	Textorigin_Llm,
	Textorigin_WebsiteAction,
	Textorigin_Customer,
	Textorigin_Reiteration,
	Textorigin_CommandResponse,
}

func (e *Textorigin) 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 "district":
		*e = Textorigin_District
	case "llm":
		*e = Textorigin_Llm
	case "website-action":
		*e = Textorigin_WebsiteAction
	case "customer":
		*e = Textorigin_Customer
	case "reiteration":
		*e = Textorigin_Reiteration
	case "command-response":
		*e = Textorigin_CommandResponse
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Textorigin enum")
	}

	return nil
}

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