func (m *NsAsHandleUplinkRequest) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = NsAsHandleUplinkRequestFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "application_ups":
			if len(m.GetApplicationUps()) < 1 {
				return NsAsHandleUplinkRequestValidationError{
					field:  "application_ups",
					reason: "value must contain at least 1 item(s)",
				}
			}
			for idx, item := range m.GetApplicationUps() {
				_, _ = idx, item
				if v, ok := interface{}(item).(interface{ ValidateFields(...string) error }); ok {
					if err := v.ValidateFields(subs...); err != nil {
						return NsAsHandleUplinkRequestValidationError{
							field:  fmt.Sprintf("application_ups[%v]", idx),
							reason: "embedded message failed validation",
							cause:  err,
						}
					}
				}
			}
		default:
			return NsAsHandleUplinkRequestValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
ValidateFields checks the field values on NsAsHandleUplinkRequest with the
rules defined in the proto definition for this message. If any rules are
violated, an error is returned.
package ttnpb
import (
	"bytes"
	"errors"
	"fmt"
	"net"
	"net/mail"
	"net/url"
	"regexp"
	"strings"
	"time"
	"unicode/utf8"
	"github.com/gogo/protobuf/types"
)
var (
	_ = bytes.MinRead
	_ = errors.New("")
	_ = fmt.Print
	_ = utf8.UTFMax
	_ = (*regexp.Regexp)(nil)
	_ = (*strings.Reader)(nil)
	_ = net.IPv4len
	_ = time.Duration(0)
	_ = (*url.URL)(nil)
	_ = (*mail.Address)(nil)
	_ = types.DynamicAny{}
)
var _applicationserver_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
func (m *ApplicationLink) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = ApplicationLinkFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "default_formatters":
			if v, ok := interface{}(m.GetDefaultFormatters()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return ApplicationLinkValidationError{
						field:  "default_formatters",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "skip_payload_crypto":
			if v, ok := interface{}(m.GetSkipPayloadCrypto()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return ApplicationLinkValidationError{
						field:  "skip_payload_crypto",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return ApplicationLinkValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type ApplicationLinkValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e ApplicationLinkValidationError) Field() string { return e.field }
func (e ApplicationLinkValidationError) Reason() string { return e.reason }
func (e ApplicationLinkValidationError) Cause() error { return e.cause }
func (e ApplicationLinkValidationError) Key() bool { return e.key }
func (e ApplicationLinkValidationError) ErrorName() string { return "ApplicationLinkValidationError" }
func (e ApplicationLinkValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}
	key := ""
	if e.key {
		key = "key for "
	}
	return fmt.Sprintf(
		"invalid %sApplicationLink.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = ApplicationLinkValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ApplicationLinkValidationError{}
func (m *GetApplicationLinkRequest) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = GetApplicationLinkRequestFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "application_ids":
			if m.GetApplicationIds() == nil {
				return GetApplicationLinkRequestValidationError{
					field:  "application_ids",
					reason: "value is required",
				}
			}
			if v, ok := interface{}(m.GetApplicationIds()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return GetApplicationLinkRequestValidationError{
						field:  "application_ids",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "field_mask":
			if v, ok := interface{}(m.GetFieldMask()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return GetApplicationLinkRequestValidationError{
						field:  "field_mask",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return GetApplicationLinkRequestValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type GetApplicationLinkRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e GetApplicationLinkRequestValidationError) Field() string { return e.field }
func (e GetApplicationLinkRequestValidationError) Reason() string { return e.reason }
func (e GetApplicationLinkRequestValidationError) Cause() error { return e.cause }
func (e GetApplicationLinkRequestValidationError) Key() bool { return e.key }
func (e GetApplicationLinkRequestValidationError) ErrorName() string {
	return "GetApplicationLinkRequestValidationError"
}
func (e GetApplicationLinkRequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}
	key := ""
	if e.key {
		key = "key for "
	}
	return fmt.Sprintf(
		"invalid %sGetApplicationLinkRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = GetApplicationLinkRequestValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GetApplicationLinkRequestValidationError{}
func (m *SetApplicationLinkRequest) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = SetApplicationLinkRequestFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "application_ids":
			if m.GetApplicationIds() == nil {
				return SetApplicationLinkRequestValidationError{
					field:  "application_ids",
					reason: "value is required",
				}
			}
			if v, ok := interface{}(m.GetApplicationIds()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return SetApplicationLinkRequestValidationError{
						field:  "application_ids",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "link":
			if m.GetLink() == nil {
				return SetApplicationLinkRequestValidationError{
					field:  "link",
					reason: "value is required",
				}
			}
			if v, ok := interface{}(m.GetLink()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return SetApplicationLinkRequestValidationError{
						field:  "link",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "field_mask":
			if v, ok := interface{}(m.GetFieldMask()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return SetApplicationLinkRequestValidationError{
						field:  "field_mask",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return SetApplicationLinkRequestValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type SetApplicationLinkRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e SetApplicationLinkRequestValidationError) Field() string { return e.field }
func (e SetApplicationLinkRequestValidationError) Reason() string { return e.reason }
func (e SetApplicationLinkRequestValidationError) Cause() error { return e.cause }
func (e SetApplicationLinkRequestValidationError) Key() bool { return e.key }
func (e SetApplicationLinkRequestValidationError) ErrorName() string {
	return "SetApplicationLinkRequestValidationError"
}
func (e SetApplicationLinkRequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}
	key := ""
	if e.key {
		key = "key for "
	}
	return fmt.Sprintf(
		"invalid %sSetApplicationLinkRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = SetApplicationLinkRequestValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = SetApplicationLinkRequestValidationError{}
func (m *ApplicationLinkStats) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = ApplicationLinkStatsFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "linked_at":
			if v, ok := interface{}(m.GetLinkedAt()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return ApplicationLinkStatsValidationError{
						field:  "linked_at",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "network_server_address":
			if !_ApplicationLinkStats_NetworkServerAddress_Pattern.MatchString(m.GetNetworkServerAddress()) {
				return ApplicationLinkStatsValidationError{
					field:  "network_server_address",
					reason: "value does not match regex pattern \"^(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\\\-]*[a-zA-Z0-9])\\\\.)*(?:[A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\\\-]*[A-Za-z0-9])(?::[0-9]{1,5})?$|^$\"",
				}
			}
		case "last_up_received_at":
			if v, ok := interface{}(m.GetLastUpReceivedAt()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return ApplicationLinkStatsValidationError{
						field:  "last_up_received_at",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "up_count":
		case "last_downlink_forwarded_at":
			if v, ok := interface{}(m.GetLastDownlinkForwardedAt()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return ApplicationLinkStatsValidationError{
						field:  "last_downlink_forwarded_at",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "downlink_count":
		default:
			return ApplicationLinkStatsValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type ApplicationLinkStatsValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e ApplicationLinkStatsValidationError) Field() string { return e.field }
func (e ApplicationLinkStatsValidationError) Reason() string { return e.reason }
func (e ApplicationLinkStatsValidationError) Cause() error { return e.cause }
func (e ApplicationLinkStatsValidationError) Key() bool { return e.key }
func (e ApplicationLinkStatsValidationError) ErrorName() string {
	return "ApplicationLinkStatsValidationError"
}
func (e ApplicationLinkStatsValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}
	key := ""
	if e.key {
		key = "key for "
	}
	return fmt.Sprintf(
		"invalid %sApplicationLinkStats.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = ApplicationLinkStatsValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ApplicationLinkStatsValidationError{}
var _ApplicationLinkStats_NetworkServerAddress_Pattern = regexp.MustCompile("^(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*(?:[A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])(?::[0-9]{1,5})?$|^$")
func (m *AsConfiguration) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = AsConfigurationFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "pubsub":
			if v, ok := interface{}(m.GetPubsub()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return AsConfigurationValidationError{
						field:  "pubsub",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return AsConfigurationValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type AsConfigurationValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e AsConfigurationValidationError) Field() string { return e.field }
func (e AsConfigurationValidationError) Reason() string { return e.reason }
func (e AsConfigurationValidationError) Cause() error { return e.cause }
func (e AsConfigurationValidationError) Key() bool { return e.key }
func (e AsConfigurationValidationError) ErrorName() string { return "AsConfigurationValidationError" }
func (e AsConfigurationValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}
	key := ""
	if e.key {
		key = "key for "
	}
	return fmt.Sprintf(
		"invalid %sAsConfiguration.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = AsConfigurationValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AsConfigurationValidationError{}
func (m *GetAsConfigurationRequest) ValidateFields(paths ...string) error {
	if len(paths) > 0 {
		return fmt.Errorf("message GetAsConfigurationRequest has no fields, but paths %s were specified", paths)
	}
	return nil
}
type GetAsConfigurationRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e GetAsConfigurationRequestValidationError) Field() string { return e.field }
func (e GetAsConfigurationRequestValidationError) Reason() string { return e.reason }
func (e GetAsConfigurationRequestValidationError) Cause() error { return e.cause }
func (e GetAsConfigurationRequestValidationError) Key() bool { return e.key }
func (e GetAsConfigurationRequestValidationError) ErrorName() string {
	return "GetAsConfigurationRequestValidationError"
}
func (e GetAsConfigurationRequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}
	key := ""
	if e.key {
		key = "key for "
	}
	return fmt.Sprintf(
		"invalid %sGetAsConfigurationRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = GetAsConfigurationRequestValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GetAsConfigurationRequestValidationError{}
func (m *GetAsConfigurationResponse) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = GetAsConfigurationResponseFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "configuration":
			if v, ok := interface{}(m.GetConfiguration()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return GetAsConfigurationResponseValidationError{
						field:  "configuration",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return GetAsConfigurationResponseValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type GetAsConfigurationResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e GetAsConfigurationResponseValidationError) Field() string { return e.field }
func (e GetAsConfigurationResponseValidationError) Reason() string { return e.reason }
func (e GetAsConfigurationResponseValidationError) Cause() error { return e.cause }
func (e GetAsConfigurationResponseValidationError) Key() bool { return e.key }
func (e GetAsConfigurationResponseValidationError) ErrorName() string {
	return "GetAsConfigurationResponseValidationError"
}
func (e GetAsConfigurationResponseValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}
	key := ""
	if e.key {
		key = "key for "
	}
	return fmt.Sprintf(
		"invalid %sGetAsConfigurationResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = GetAsConfigurationResponseValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GetAsConfigurationResponseValidationError{}