func (v Major) MarshalBinary() ([]byte, error) {
	return marshalBinaryEnum(int32(v)), nil
}
MarshalBinary implements encoding.BinaryMarshaler interface.
package ttnpb
import (
	"encoding/json"
	"fmt"
	"strconv"
	"time"
	"github.com/blang/semver"
	"github.com/gogo/protobuf/jsonpb"
	"github.com/vmihailenco/msgpack/v5"
	"go.thethings.network/lorawan-stack/v3/pkg/errors"
	"go.thethings.network/lorawan-stack/v3/pkg/types"
)
var PHYVersionCompatibleName = map[int32]string{}
func init() {
	for i := range PHYVersion_name {
		PHYVersion_value[PHYVersion(i).String()] = i
	}
	for name, version := range map[string]PHYVersion{
		"1.0":   TS001_V1_0,        
		"1.0.2": RP001_V1_0_2,      
		"1.1-a": RP001_V1_1_REV_A,  
		"1.1-b": RP001_V1_1_REV_B,  
	} {
		PHYVersion_value[name] = int32(version)
	}
	for version, name := range PHYVersion_name {
		PHYVersionCompatibleName[version] = name
	}
	for name, version := range map[string]PHYVersion{
		"PHY_V1_0":         TS001_V1_0,
		"PHY_V1_0_1":       TS001_V1_0_1,
		"PHY_V1_0_2_REV_A": RP001_V1_0_2,
		"PHY_V1_0_2_REV_B": RP001_V1_0_2_REV_B,
		"PHY_V1_1_REV_A":   RP001_V1_1_REV_A,
		"PHY_V1_1_REV_B":   RP001_V1_1_REV_B,
		"PHY_V1_0_3_REV_A": RP001_V1_0_3_REV_A,
	} {
		PHYVersion_value[name] = int32(version)
		PHYVersionCompatibleName[int32(version)] = name
	}
}
func (v MType) MarshalBinary() ([]byte, error) {
	return marshalBinaryEnum(int32(v)), nil
}
func (v MType) MarshalText() ([]byte, error) {
	return []byte(v.String()), nil
}
func (v MType) MarshalJSON() ([]byte, error) {
	return marshalJSONEnum(MType_name, int32(v))
}
func (v *MType) UnmarshalBinary(b []byte) error {
	i, err := unmarshalEnumFromBinary("MType", MType_name, b)
	if err != nil {
		return err
	}
	*v = MType(i)
	return nil
}
func (v *MType) UnmarshalText(b []byte) error {
	i, err := unmarshalEnumFromText("MType", MType_value, b)
	if err != nil {
		return err
	}
	*v = MType(i)
	return nil
}
func (v *MType) UnmarshalJSON(b []byte) error {
	if bt, ok := unmarshalJSONString(b); ok {
		return v.UnmarshalText(bt)
	}
	i, err := unmarshalEnumFromNumber("MType", MType_name, b)
	if err != nil {
		return err
	}
	*v = MType(i)
	return nil
}