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

import (
	"fmt"
	"strconv"
)

// Gimbal manager profiles. Only standard profiles are defined. Any implementation can define its own profile(s) in addition, and should use enum values > 16.
type MAV_STORM32_GIMBAL_MANAGER_PROFILE uint64

const (
	// Default profile. Implementation specific.
	MAV_STORM32_GIMBAL_MANAGER_PROFILE_DEFAULT MAV_STORM32_GIMBAL_MANAGER_PROFILE = 0
	// Not supported/deprecated.
	MAV_STORM32_GIMBAL_MANAGER_PROFILE_CUSTOM MAV_STORM32_GIMBAL_MANAGER_PROFILE = 1
	// Profile with cooperative behavior.
	MAV_STORM32_GIMBAL_MANAGER_PROFILE_COOPERATIVE MAV_STORM32_GIMBAL_MANAGER_PROFILE = 2
	// Profile with exclusive behavior.
	MAV_STORM32_GIMBAL_MANAGER_PROFILE_EXCLUSIVE MAV_STORM32_GIMBAL_MANAGER_PROFILE = 3
	// Profile with priority and cooperative behavior for equal priority.
	MAV_STORM32_GIMBAL_MANAGER_PROFILE_PRIORITY_COOPERATIVE MAV_STORM32_GIMBAL_MANAGER_PROFILE = 4
	// Profile with priority and exclusive behavior for equal priority.
	MAV_STORM32_GIMBAL_MANAGER_PROFILE_PRIORITY_EXCLUSIVE MAV_STORM32_GIMBAL_MANAGER_PROFILE = 5
)

var value_to_label_MAV_STORM32_GIMBAL_MANAGER_PROFILE = map[MAV_STORM32_GIMBAL_MANAGER_PROFILE]string{
	MAV_STORM32_GIMBAL_MANAGER_PROFILE_DEFAULT:              "MAV_STORM32_GIMBAL_MANAGER_PROFILE_DEFAULT",
	MAV_STORM32_GIMBAL_MANAGER_PROFILE_CUSTOM:               "MAV_STORM32_GIMBAL_MANAGER_PROFILE_CUSTOM",
	MAV_STORM32_GIMBAL_MANAGER_PROFILE_COOPERATIVE:          "MAV_STORM32_GIMBAL_MANAGER_PROFILE_COOPERATIVE",
	MAV_STORM32_GIMBAL_MANAGER_PROFILE_EXCLUSIVE:            "MAV_STORM32_GIMBAL_MANAGER_PROFILE_EXCLUSIVE",
	MAV_STORM32_GIMBAL_MANAGER_PROFILE_PRIORITY_COOPERATIVE: "MAV_STORM32_GIMBAL_MANAGER_PROFILE_PRIORITY_COOPERATIVE",
	MAV_STORM32_GIMBAL_MANAGER_PROFILE_PRIORITY_EXCLUSIVE:   "MAV_STORM32_GIMBAL_MANAGER_PROFILE_PRIORITY_EXCLUSIVE",
}

var label_to_value_MAV_STORM32_GIMBAL_MANAGER_PROFILE = map[string]MAV_STORM32_GIMBAL_MANAGER_PROFILE{
	"MAV_STORM32_GIMBAL_MANAGER_PROFILE_DEFAULT":              MAV_STORM32_GIMBAL_MANAGER_PROFILE_DEFAULT,
	"MAV_STORM32_GIMBAL_MANAGER_PROFILE_CUSTOM":               MAV_STORM32_GIMBAL_MANAGER_PROFILE_CUSTOM,
	"MAV_STORM32_GIMBAL_MANAGER_PROFILE_COOPERATIVE":          MAV_STORM32_GIMBAL_MANAGER_PROFILE_COOPERATIVE,
	"MAV_STORM32_GIMBAL_MANAGER_PROFILE_EXCLUSIVE":            MAV_STORM32_GIMBAL_MANAGER_PROFILE_EXCLUSIVE,
	"MAV_STORM32_GIMBAL_MANAGER_PROFILE_PRIORITY_COOPERATIVE": MAV_STORM32_GIMBAL_MANAGER_PROFILE_PRIORITY_COOPERATIVE,
	"MAV_STORM32_GIMBAL_MANAGER_PROFILE_PRIORITY_EXCLUSIVE":   MAV_STORM32_GIMBAL_MANAGER_PROFILE_PRIORITY_EXCLUSIVE,
}

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

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

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