func (m MessageType) IsRequest() bool {
	_, ok := requestAnswers[m]
	return ok
}
IsRequest returns whether the message type is a request that has an answer message type defined.
package interop
import (
	"encoding/hex"
	"encoding/json"
	"strings"
	"go.thethings.network/lorawan-stack/v3/pkg/errors"
	"go.thethings.network/lorawan-stack/v3/pkg/ttnpb"
	"go.thethings.network/lorawan-stack/v3/pkg/types"
)
type ProtocolVersion string
const (
	ProtocolV1_0 = "1.0"
	ProtocolV1_1 = "1.1"
)
var errUnknownProtocol = errors.DefineInvalidArgument("unknown_protocol", "unknown protocol")
func (p *ProtocolVersion) UnmarshalYAML(unmarshal func(interface{}) error) error {
	var s string
	if err := unmarshal(&s); err != nil {
		return err
	}
	switch s {
	case "BI1.0":
		*p = ProtocolV1_0
		return nil
	case "BI1.1":
		*p = ProtocolV1_1
		return nil
	default:
		return errUnknownProtocol.New()
	}
}
func (p ProtocolVersion) SupportsNSID() bool {
	switch p {
	case ProtocolV1_1:
		return true
	default:
		return false
	}
}
type MessageType string
const (
	MessageTypeJoinReq     MessageType = "JoinReq"
	MessageTypeJoinAns     MessageType = "JoinAns"
	MessageTypeRejoinReq   MessageType = "RejoinReq"
	MessageTypeRejoinAns   MessageType = "RejoinAns"
	MessageTypeAppSKeyReq  MessageType = "AppSKeyReq"
	MessageTypeAppSKeyAns  MessageType = "AppSKeyAns"
	MessageTypePRStartReq  MessageType = "PRStartReq"
	MessageTypePRStartAns  MessageType = "PRStartAns"
	MessageTypePRStopReq   MessageType = "PRStopReq"
	MessageTypePRStopAns   MessageType = "PRStopAns"
	MessageTypeHRStartReq  MessageType = "HRStartReq"
	MessageTypeHRStartAns  MessageType = "HRStartAns"
	MessageTypeHRStopReq   MessageType = "HRStopReq"
	MessageTypeHRStopAns   MessageType = "HRStopAns"
	MessageTypeHomeNSReq   MessageType = "HomeNSReq"
	MessageTypeHomeNSAns   MessageType = "HomeNSAns"
	MessageTypeProfileReq  MessageType = "ProfileReq"
	MessageTypeProfileAns  MessageType = "ProfileAns"
	MessageTypeXmitDataReq MessageType = "XmitDataReq"
	MessageTypeXmitDataAns MessageType = "XmitDataAns"
)
var requestAnswers = map[MessageType]MessageType{
	MessageTypeJoinReq:     MessageTypeJoinAns,
	MessageTypeRejoinReq:   MessageTypeRejoinAns,
	MessageTypeAppSKeyReq:  MessageTypeAppSKeyAns,
	MessageTypePRStartReq:  MessageTypePRStartAns,
	MessageTypePRStopReq:   MessageTypePRStopAns,
	MessageTypeHRStartReq:  MessageTypeHRStartAns,
	MessageTypeHRStopReq:   MessageTypeHRStopAns,
	MessageTypeHomeNSReq:   MessageTypeHomeNSAns,
	MessageTypeProfileReq:  MessageTypeProfileAns,
	MessageTypeXmitDataReq: MessageTypeXmitDataAns,
}
var protocolMessageTypes = map[ProtocolVersion]map[MessageType]bool{
	ProtocolV1_0: {
		MessageTypeJoinReq:     true,
		MessageTypeJoinAns:     true,
		MessageTypeAppSKeyReq:  true,
		MessageTypeAppSKeyAns:  true,
		MessageTypePRStartReq:  true,
		MessageTypePRStartAns:  true,
		MessageTypePRStopReq:   true,
		MessageTypePRStopAns:   true,
		MessageTypeHRStartReq:  true,
		MessageTypeHRStartAns:  true,
		MessageTypeHRStopReq:   true,
		MessageTypeHRStopAns:   true,
		MessageTypeHomeNSReq:   true,
		MessageTypeHomeNSAns:   true,
		MessageTypeProfileReq:  true,
		MessageTypeProfileAns:  true,
		MessageTypeXmitDataReq: true,
		MessageTypeXmitDataAns: true,
	},
	ProtocolV1_1: {
		MessageTypeJoinReq:     true,
		MessageTypeJoinAns:     true,
		MessageTypeRejoinReq:   true,
		MessageTypeRejoinAns:   true,
		MessageTypeAppSKeyReq:  true,
		MessageTypeAppSKeyAns:  true,
		MessageTypePRStartReq:  true,
		MessageTypePRStartAns:  true,
		MessageTypePRStopReq:   true,
		MessageTypePRStopAns:   true,
		MessageTypeHRStartReq:  true,
		MessageTypeHRStartAns:  true,
		MessageTypeHRStopReq:   true,
		MessageTypeHRStopAns:   true,
		MessageTypeHomeNSReq:   true,
		MessageTypeHomeNSAns:   true,
		MessageTypeProfileReq:  true,
		MessageTypeProfileAns:  true,
		MessageTypeXmitDataReq: true,
		MessageTypeXmitDataAns: true,
	},
}