func (e GetApplicationPackageAssociationRequestValidationError) 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 %sGetApplicationPackageAssociationRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
Error satisfies the builtin error interface
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_packages_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 *ApplicationPackage) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = ApplicationPackageFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "name":
			if utf8.RuneCountInString(m.GetName()) > 36 {
				return ApplicationPackageValidationError{
					field:  "name",
					reason: "value length must be at most 36 runes",
				}
			}
			if !_ApplicationPackage_Name_Pattern.MatchString(m.GetName()) {
				return ApplicationPackageValidationError{
					field:  "name",
					reason: "value does not match regex pattern \"^[a-z0-9](?:[-]?[a-z0-9]){2,}$\"",
				}
			}
		case "default_f_port":
			if val := m.GetDefaultFPort(); val < 1 || val > 255 {
				return ApplicationPackageValidationError{
					field:  "default_f_port",
					reason: "value must be inside range [1, 255]",
				}
			}
		default:
			return ApplicationPackageValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type ApplicationPackageValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e ApplicationPackageValidationError) Field() string { return e.field }
func (e ApplicationPackageValidationError) Reason() string { return e.reason }
func (e ApplicationPackageValidationError) Cause() error { return e.cause }
func (e ApplicationPackageValidationError) Key() bool { return e.key }
func (e ApplicationPackageValidationError) ErrorName() string {
	return "ApplicationPackageValidationError"
}
func (e ApplicationPackageValidationError) 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 %sApplicationPackage.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = ApplicationPackageValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ApplicationPackageValidationError{}
var _ApplicationPackage_Name_Pattern = regexp.MustCompile("^[a-z0-9](?:[-]?[a-z0-9]){2,}$")
func (m *ApplicationPackages) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = ApplicationPackagesFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "packages":
			for idx, item := range m.GetPackages() {
				_, _ = idx, item
				if v, ok := interface{}(item).(interface{ ValidateFields(...string) error }); ok {
					if err := v.ValidateFields(subs...); err != nil {
						return ApplicationPackagesValidationError{
							field:  fmt.Sprintf("packages[%v]", idx),
							reason: "embedded message failed validation",
							cause:  err,
						}
					}
				}
			}
		default:
			return ApplicationPackagesValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type ApplicationPackagesValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e ApplicationPackagesValidationError) Field() string { return e.field }
func (e ApplicationPackagesValidationError) Reason() string { return e.reason }
func (e ApplicationPackagesValidationError) Cause() error { return e.cause }
func (e ApplicationPackagesValidationError) Key() bool { return e.key }
func (e ApplicationPackagesValidationError) ErrorName() string {
	return "ApplicationPackagesValidationError"
}
func (e ApplicationPackagesValidationError) 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 %sApplicationPackages.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = ApplicationPackagesValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ApplicationPackagesValidationError{}
func (m *ApplicationPackageAssociationIdentifiers) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = ApplicationPackageAssociationIdentifiersFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "end_device_ids":
			if m.GetEndDeviceIds() == nil {
				return ApplicationPackageAssociationIdentifiersValidationError{
					field:  "end_device_ids",
					reason: "value is required",
				}
			}
			if v, ok := interface{}(m.GetEndDeviceIds()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return ApplicationPackageAssociationIdentifiersValidationError{
						field:  "end_device_ids",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "f_port":
			if val := m.GetFPort(); val < 1 || val > 255 {
				return ApplicationPackageAssociationIdentifiersValidationError{
					field:  "f_port",
					reason: "value must be inside range [1, 255]",
				}
			}
		default:
			return ApplicationPackageAssociationIdentifiersValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type ApplicationPackageAssociationIdentifiersValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e ApplicationPackageAssociationIdentifiersValidationError) Field() string { return e.field }
func (e ApplicationPackageAssociationIdentifiersValidationError) Reason() string { return e.reason }
func (e ApplicationPackageAssociationIdentifiersValidationError) Cause() error { return e.cause }
func (e ApplicationPackageAssociationIdentifiersValidationError) Key() bool { return e.key }
func (e ApplicationPackageAssociationIdentifiersValidationError) ErrorName() string {
	return "ApplicationPackageAssociationIdentifiersValidationError"
}
func (e ApplicationPackageAssociationIdentifiersValidationError) 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 %sApplicationPackageAssociationIdentifiers.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = ApplicationPackageAssociationIdentifiersValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ApplicationPackageAssociationIdentifiersValidationError{}
func (m *ApplicationPackageAssociation) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = ApplicationPackageAssociationFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "ids":
			if m.GetIds() == nil {
				return ApplicationPackageAssociationValidationError{
					field:  "ids",
					reason: "value is required",
				}
			}
			if v, ok := interface{}(m.GetIds()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return ApplicationPackageAssociationValidationError{
						field:  "ids",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "created_at":
			if v, ok := interface{}(m.GetCreatedAt()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return ApplicationPackageAssociationValidationError{
						field:  "created_at",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "updated_at":
			if v, ok := interface{}(m.GetUpdatedAt()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return ApplicationPackageAssociationValidationError{
						field:  "updated_at",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "package_name":
			if utf8.RuneCountInString(m.GetPackageName()) > 36 {
				return ApplicationPackageAssociationValidationError{
					field:  "package_name",
					reason: "value length must be at most 36 runes",
				}
			}
			if !_ApplicationPackageAssociation_PackageName_Pattern.MatchString(m.GetPackageName()) {
				return ApplicationPackageAssociationValidationError{
					field:  "package_name",
					reason: "value does not match regex pattern \"^[a-z0-9](?:[-]?[a-z0-9]){2,}$\"",
				}
			}
		case "data":
			if v, ok := interface{}(m.GetData()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return ApplicationPackageAssociationValidationError{
						field:  "data",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return ApplicationPackageAssociationValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type ApplicationPackageAssociationValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e ApplicationPackageAssociationValidationError) Field() string { return e.field }
func (e ApplicationPackageAssociationValidationError) Reason() string { return e.reason }
func (e ApplicationPackageAssociationValidationError) Cause() error { return e.cause }
func (e ApplicationPackageAssociationValidationError) Key() bool { return e.key }
func (e ApplicationPackageAssociationValidationError) ErrorName() string {
	return "ApplicationPackageAssociationValidationError"
}
func (e ApplicationPackageAssociationValidationError) 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 %sApplicationPackageAssociation.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = ApplicationPackageAssociationValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ApplicationPackageAssociationValidationError{}
var _ApplicationPackageAssociation_PackageName_Pattern = regexp.MustCompile("^[a-z0-9](?:[-]?[a-z0-9]){2,}$")
func (m *ApplicationPackageAssociations) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = ApplicationPackageAssociationsFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "associations":
			for idx, item := range m.GetAssociations() {
				_, _ = idx, item
				if v, ok := interface{}(item).(interface{ ValidateFields(...string) error }); ok {
					if err := v.ValidateFields(subs...); err != nil {
						return ApplicationPackageAssociationsValidationError{
							field:  fmt.Sprintf("associations[%v]", idx),
							reason: "embedded message failed validation",
							cause:  err,
						}
					}
				}
			}
		default:
			return ApplicationPackageAssociationsValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type ApplicationPackageAssociationsValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e ApplicationPackageAssociationsValidationError) Field() string { return e.field }
func (e ApplicationPackageAssociationsValidationError) Reason() string { return e.reason }
func (e ApplicationPackageAssociationsValidationError) Cause() error { return e.cause }
func (e ApplicationPackageAssociationsValidationError) Key() bool { return e.key }
func (e ApplicationPackageAssociationsValidationError) ErrorName() string {
	return "ApplicationPackageAssociationsValidationError"
}
func (e ApplicationPackageAssociationsValidationError) 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 %sApplicationPackageAssociations.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = ApplicationPackageAssociationsValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ApplicationPackageAssociationsValidationError{}
func (m *GetApplicationPackageAssociationRequest) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = GetApplicationPackageAssociationRequestFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "ids":
			if m.GetIds() == nil {
				return GetApplicationPackageAssociationRequestValidationError{
					field:  "ids",
					reason: "value is required",
				}
			}
			if v, ok := interface{}(m.GetIds()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return GetApplicationPackageAssociationRequestValidationError{
						field:  "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 GetApplicationPackageAssociationRequestValidationError{
						field:  "field_mask",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return GetApplicationPackageAssociationRequestValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type GetApplicationPackageAssociationRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e GetApplicationPackageAssociationRequestValidationError) Field() string { return e.field }
func (e GetApplicationPackageAssociationRequestValidationError) Reason() string { return e.reason }
func (e GetApplicationPackageAssociationRequestValidationError) Cause() error { return e.cause }
func (e GetApplicationPackageAssociationRequestValidationError) Key() bool { return e.key }
func (e GetApplicationPackageAssociationRequestValidationError) ErrorName() string {
	return "GetApplicationPackageAssociationRequestValidationError"
}