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

import (
	"fmt"
	"strconv"
)

type ICAROUS_TRACK_BAND_TYPES uint64

const (
	ICAROUS_TRACK_BAND_TYPE_NONE     ICAROUS_TRACK_BAND_TYPES = 0
	ICAROUS_TRACK_BAND_TYPE_NEAR     ICAROUS_TRACK_BAND_TYPES = 1
	ICAROUS_TRACK_BAND_TYPE_RECOVERY ICAROUS_TRACK_BAND_TYPES = 2
)

var value_to_label_ICAROUS_TRACK_BAND_TYPES = map[ICAROUS_TRACK_BAND_TYPES]string{
	ICAROUS_TRACK_BAND_TYPE_NONE:     "ICAROUS_TRACK_BAND_TYPE_NONE",
	ICAROUS_TRACK_BAND_TYPE_NEAR:     "ICAROUS_TRACK_BAND_TYPE_NEAR",
	ICAROUS_TRACK_BAND_TYPE_RECOVERY: "ICAROUS_TRACK_BAND_TYPE_RECOVERY",
}

var label_to_value_ICAROUS_TRACK_BAND_TYPES = map[string]ICAROUS_TRACK_BAND_TYPES{
	"ICAROUS_TRACK_BAND_TYPE_NONE":     ICAROUS_TRACK_BAND_TYPE_NONE,
	"ICAROUS_TRACK_BAND_TYPE_NEAR":     ICAROUS_TRACK_BAND_TYPE_NEAR,
	"ICAROUS_TRACK_BAND_TYPE_RECOVERY": ICAROUS_TRACK_BAND_TYPE_RECOVERY,
}

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

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

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