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

import (
	"fmt"
	"strconv"
)

type MAV_ODID_CLASS_EU uint64

const (
	// The class for the UA, according to the EU specification, is undeclared.
	MAV_ODID_CLASS_EU_UNDECLARED MAV_ODID_CLASS_EU = 0
	// The class for the UA, according to the EU specification, is Class 0.
	MAV_ODID_CLASS_EU_CLASS_0 MAV_ODID_CLASS_EU = 1
	// The class for the UA, according to the EU specification, is Class 1.
	MAV_ODID_CLASS_EU_CLASS_1 MAV_ODID_CLASS_EU = 2
	// The class for the UA, according to the EU specification, is Class 2.
	MAV_ODID_CLASS_EU_CLASS_2 MAV_ODID_CLASS_EU = 3
	// The class for the UA, according to the EU specification, is Class 3.
	MAV_ODID_CLASS_EU_CLASS_3 MAV_ODID_CLASS_EU = 4
	// The class for the UA, according to the EU specification, is Class 4.
	MAV_ODID_CLASS_EU_CLASS_4 MAV_ODID_CLASS_EU = 5
	// The class for the UA, according to the EU specification, is Class 5.
	MAV_ODID_CLASS_EU_CLASS_5 MAV_ODID_CLASS_EU = 6
	// The class for the UA, according to the EU specification, is Class 6.
	MAV_ODID_CLASS_EU_CLASS_6 MAV_ODID_CLASS_EU = 7
)

var value_to_label_MAV_ODID_CLASS_EU = map[MAV_ODID_CLASS_EU]string{
	MAV_ODID_CLASS_EU_UNDECLARED: "MAV_ODID_CLASS_EU_UNDECLARED",
	MAV_ODID_CLASS_EU_CLASS_0:    "MAV_ODID_CLASS_EU_CLASS_0",
	MAV_ODID_CLASS_EU_CLASS_1:    "MAV_ODID_CLASS_EU_CLASS_1",
	MAV_ODID_CLASS_EU_CLASS_2:    "MAV_ODID_CLASS_EU_CLASS_2",
	MAV_ODID_CLASS_EU_CLASS_3:    "MAV_ODID_CLASS_EU_CLASS_3",
	MAV_ODID_CLASS_EU_CLASS_4:    "MAV_ODID_CLASS_EU_CLASS_4",
	MAV_ODID_CLASS_EU_CLASS_5:    "MAV_ODID_CLASS_EU_CLASS_5",
	MAV_ODID_CLASS_EU_CLASS_6:    "MAV_ODID_CLASS_EU_CLASS_6",
}

var label_to_value_MAV_ODID_CLASS_EU = map[string]MAV_ODID_CLASS_EU{
	"MAV_ODID_CLASS_EU_UNDECLARED": MAV_ODID_CLASS_EU_UNDECLARED,
	"MAV_ODID_CLASS_EU_CLASS_0":    MAV_ODID_CLASS_EU_CLASS_0,
	"MAV_ODID_CLASS_EU_CLASS_1":    MAV_ODID_CLASS_EU_CLASS_1,
	"MAV_ODID_CLASS_EU_CLASS_2":    MAV_ODID_CLASS_EU_CLASS_2,
	"MAV_ODID_CLASS_EU_CLASS_3":    MAV_ODID_CLASS_EU_CLASS_3,
	"MAV_ODID_CLASS_EU_CLASS_4":    MAV_ODID_CLASS_EU_CLASS_4,
	"MAV_ODID_CLASS_EU_CLASS_5":    MAV_ODID_CLASS_EU_CLASS_5,
	"MAV_ODID_CLASS_EU_CLASS_6":    MAV_ODID_CLASS_EU_CLASS_6,
}

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

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

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