//autogenerated:yes
//nolint:revive,misspell,govet,lll,dupl,gocritic
package asluav

import (
	"fmt"
	"strconv"
)

type GSM_MODEM_TYPE uint64

const (
	// not specified
	GSM_MODEM_TYPE_UNKNOWN GSM_MODEM_TYPE = 0
	// HUAWEI LTE USB Stick E3372
	GSM_MODEM_TYPE_HUAWEI_E3372 GSM_MODEM_TYPE = 1
)

var value_to_label_GSM_MODEM_TYPE = map[GSM_MODEM_TYPE]string{
	GSM_MODEM_TYPE_UNKNOWN:      "GSM_MODEM_TYPE_UNKNOWN",
	GSM_MODEM_TYPE_HUAWEI_E3372: "GSM_MODEM_TYPE_HUAWEI_E3372",
}

var label_to_value_GSM_MODEM_TYPE = map[string]GSM_MODEM_TYPE{
	"GSM_MODEM_TYPE_UNKNOWN":      GSM_MODEM_TYPE_UNKNOWN,
	"GSM_MODEM_TYPE_HUAWEI_E3372": GSM_MODEM_TYPE_HUAWEI_E3372,
}

// MarshalText implements the encoding.TextMarshaler interface.
func (e GSM_MODEM_TYPE) MarshalText() ([]byte, error) {
	if name, ok := value_to_label_GSM_MODEM_TYPE[e]; ok {
		return []byte(name), nil
	}
	return []byte(strconv.Itoa(int(e))), nil
}

// UnmarshalText implements the encoding.TextUnmarshaler interface.
func (e *GSM_MODEM_TYPE) UnmarshalText(text []byte) error {
	if value, ok := label_to_value_GSM_MODEM_TYPE[string(text)]; ok {
		*e = value
	} else if value, err := strconv.Atoi(string(text)); err == nil {
		*e = GSM_MODEM_TYPE(value)
	} else {
		return fmt.Errorf("invalid label '%s'", text)
	}
	return nil
}

// String implements the fmt.Stringer interface.
func (e GSM_MODEM_TYPE) String() string {
	val, _ := e.MarshalText()
	return string(val)
}
