func (v *DownlinkPathConstraint) UnmarshalJSON(b []byte) error {
	if len(b) > 2 && b[0] == '"' && b[len(b)-1] == '"' {
		return v.UnmarshalText(b[1 : len(b)-1])
	}
	i, err := strconv.Atoi(string(b))
	if err != nil {
		return errCouldNotParse("DownlinkPathConstraint")(string(b)).WithCause(err)
	}
	*v = DownlinkPathConstraint(i)
	return nil
}
UnmarshalJSON implements json.Unmarshaler interface.
package ttnpb
import (
	"strconv"
	"strings"
	"github.com/gogo/protobuf/jsonpb"
)
func (v DownlinkPathConstraint) MarshalText() ([]byte, error) {
	return []byte(v.String()), nil
}
func (v *DownlinkPathConstraint) UnmarshalText(b []byte) error {
	s := string(b)
	if i, ok := DownlinkPathConstraint_value[s]; ok {
		*v = DownlinkPathConstraint(i)
		return nil
	}
	if !strings.HasPrefix(s, "DOWNLINK_PATH_CONSTRAINT_") {
		if i, ok := DownlinkPathConstraint_value["DOWNLINK_PATH_CONSTRAINT_"+s]; ok {
			*v = DownlinkPathConstraint(i)
			return nil
		}
	}
	return errCouldNotParse("DownlinkPathConstraint")(string(b))
}