func (x DataRateOffset) MarshalProtoJSON(s *jsonplugin.MarshalState) {
	s.WriteEnumNumber(int32(x))
}
MarshalProtoJSON marshals the DataRateOffset to JSON.
package ttnpb
import (
	gogo "github.com/TheThingsIndustries/protoc-gen-go-json/gogo"
	jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin"
)
func (x MType) MarshalProtoJSON(s *jsonplugin.MarshalState) {
	s.WriteEnumString(int32(x), MType_name)
}
func (x *MType) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
	v := s.ReadEnum(MType_value)
	if err := s.Err(); err != nil {
		s.SetErrorf("could not read MType enum: %v", err)
		return
	}
	*x = MType(v)
}
func (x Major) MarshalProtoJSON(s *jsonplugin.MarshalState) {
	s.WriteEnumString(int32(x), Major_name)
}
var Major_customvalue = map[string]int32{
	"R1": 0,
}
func (x *Major) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
	v := s.ReadEnum(Major_value, Major_customvalue)
	if err := s.Err(); err != nil {
		s.SetErrorf("could not read Major enum: %v", err)
		return
	}
	*x = Major(v)
}
func (x MACVersion) MarshalProtoJSON(s *jsonplugin.MarshalState) {
	s.WriteEnumString(int32(x), MACVersion_name)
}
var MACVersion_customvalue = map[string]int32{
	"UNKNOWN": 0,
	"V1_0":    1,
	"V1_0_1":  2,
	"V1_0_2":  3,
	"V1_1":    4,
	"V1_0_3":  5,
	"V1_0_4":  6,
}
func (x *MACVersion) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
	v := s.ReadEnum(MACVersion_value, MACVersion_customvalue)
	if err := s.Err(); err != nil {
		s.SetErrorf("could not read MACVersion enum: %v", err)
		return
	}
	*x = MACVersion(v)
}
var PHYVersion_customname = map[int32]string{
	0: "unknown",
	1: "PHY_V1_0",
	2: "PHY_V1_0_1",
	3: "PHY_V1_0_2_REV_A",
	4: "PHY_V1_0_2_REV_B",
	5: "PHY_V1_1_REV_A",
	6: "PHY_V1_1_REV_B",
	7: "PHY_V1_0_3_REV_A",
}
func (x PHYVersion) MarshalProtoJSON(s *jsonplugin.MarshalState) {
	s.WriteEnumString(int32(x), PHYVersion_customname, PHYVersion_name)
}
var PHYVersion_customvalue = map[string]int32{
	"UNKNOWN":          0,
	"unknown":          0,
	"PHY_V1_0":         1,
	"1.0":              1,
	"1.0.0":            1,
	"PHY_V1_0_1":       2,
	"1.0.1":            2,
	"PHY_V1_0_2_REV_A": 3,
	"1.0.2":            3,
	"1.0.2-a":          3,
	"PHY_V1_0_2_REV_B": 4,
	"1.0.2-b":          4,
	"PHY_V1_1_REV_A":   5,
	"1.1-a":            5,
	"1.1.0-a":          5,
	"PHY_V1_1_REV_B":   6,
	"1.1-b":            6,
	"1.1.0-b":          6,
	"PHY_V1_0_3_REV_A": 7,
	"1.0.3-a":          7,
}
func (x *PHYVersion) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
	v := s.ReadEnum(PHYVersion_value, PHYVersion_customvalue)
	if err := s.Err(); err != nil {
		s.SetErrorf("could not read PHYVersion enum: %v", err)
		return
	}
	*x = PHYVersion(v)
}
func (x DataRateIndex) MarshalProtoJSON(s *jsonplugin.MarshalState) {
	s.WriteEnumNumber(int32(x))
}
var DataRateIndex_customvalue = map[string]int32{
	"0":  0,
	"1":  1,
	"2":  2,
	"3":  3,
	"4":  4,
	"5":  5,
	"6":  6,
	"7":  7,
	"8":  8,
	"9":  9,
	"10": 10,
	"11": 11,
	"12": 12,
	"13": 13,
	"14": 14,
	"15": 15,
}
func (x *DataRateIndex) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
	v := s.ReadEnum(DataRateIndex_value, DataRateIndex_customvalue)
	if err := s.Err(); err != nil {
		s.SetErrorf("could not read DataRateIndex enum: %v", err)
		return
	}
	*x = DataRateIndex(v)
}