func (e ListApplicationAPIKeysRequestValidationError) ErrorName() string {
	return "ListApplicationAPIKeysRequestValidationError"
}
ErrorName returns error name.
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 _application_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 *Application) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = ApplicationFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "ids":
			if m.GetIds() == nil {
				return ApplicationValidationError{
					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 ApplicationValidationError{
						field:  "ids",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "created_at":
			if v, ok := interface{}(&m.CreatedAt).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return ApplicationValidationError{
						field:  "created_at",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "updated_at":
			if v, ok := interface{}(&m.UpdatedAt).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return ApplicationValidationError{
						field:  "updated_at",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "deleted_at":
			if v, ok := interface{}(m.GetDeletedAt()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return ApplicationValidationError{
						field:  "deleted_at",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "name":
			if utf8.RuneCountInString(m.GetName()) > 50 {
				return ApplicationValidationError{
					field:  "name",
					reason: "value length must be at most 50 runes",
				}
			}
		case "description":
			if utf8.RuneCountInString(m.GetDescription()) > 2000 {
				return ApplicationValidationError{
					field:  "description",
					reason: "value length must be at most 2000 runes",
				}
			}
		case "attributes":
			if len(m.GetAttributes()) > 10 {
				return ApplicationValidationError{
					field:  "attributes",
					reason: "value must contain no more than 10 pair(s)",
				}
			}
			for key, val := range m.GetAttributes() {
				_ = val
				if utf8.RuneCountInString(key) > 36 {
					return ApplicationValidationError{
						field:  fmt.Sprintf("attributes[%v]", key),
						reason: "value length must be at most 36 runes",
					}
				}
				if !_Application_Attributes_Pattern.MatchString(key) {
					return ApplicationValidationError{
						field:  fmt.Sprintf("attributes[%v]", key),
						reason: "value does not match regex pattern \"^[a-z0-9](?:[-]?[a-z0-9]){2,}$\"",
					}
				}
				if utf8.RuneCountInString(val) > 200 {
					return ApplicationValidationError{
						field:  fmt.Sprintf("attributes[%v]", key),
						reason: "value length must be at most 200 runes",
					}
				}
			}
		case "contact_info":
			if len(m.GetContactInfo()) > 10 {
				return ApplicationValidationError{
					field:  "contact_info",
					reason: "value must contain no more than 10 item(s)",
				}
			}
			for idx, item := range m.GetContactInfo() {
				_, _ = idx, item
				if v, ok := interface{}(item).(interface{ ValidateFields(...string) error }); ok {
					if err := v.ValidateFields(subs...); err != nil {
						return ApplicationValidationError{
							field:  fmt.Sprintf("contact_info[%v]", idx),
							reason: "embedded message failed validation",
							cause:  err,
						}
					}
				}
			}
		case "dev_eui_counter":
		default:
			return ApplicationValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type ApplicationValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e ApplicationValidationError) Field() string { return e.field }
func (e ApplicationValidationError) Reason() string { return e.reason }
func (e ApplicationValidationError) Cause() error { return e.cause }
func (e ApplicationValidationError) Key() bool { return e.key }
func (e ApplicationValidationError) ErrorName() string { return "ApplicationValidationError" }
func (e ApplicationValidationError) 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 %sApplication.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = ApplicationValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ApplicationValidationError{}
var _Application_Attributes_Pattern = regexp.MustCompile("^[a-z0-9](?:[-]?[a-z0-9]){2,}$")
func (m *Applications) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = ApplicationsFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "applications":
			for idx, item := range m.GetApplications() {
				_, _ = idx, item
				if v, ok := interface{}(item).(interface{ ValidateFields(...string) error }); ok {
					if err := v.ValidateFields(subs...); err != nil {
						return ApplicationsValidationError{
							field:  fmt.Sprintf("applications[%v]", idx),
							reason: "embedded message failed validation",
							cause:  err,
						}
					}
				}
			}
		default:
			return ApplicationsValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type ApplicationsValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e ApplicationsValidationError) Field() string { return e.field }
func (e ApplicationsValidationError) Reason() string { return e.reason }
func (e ApplicationsValidationError) Cause() error { return e.cause }
func (e ApplicationsValidationError) Key() bool { return e.key }
func (e ApplicationsValidationError) ErrorName() string { return "ApplicationsValidationError" }
func (e ApplicationsValidationError) 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 %sApplications.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = ApplicationsValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ApplicationsValidationError{}
func (m *IssueDevEUIResponse) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = IssueDevEUIResponseFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "dev_eui":
		default:
			return IssueDevEUIResponseValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type IssueDevEUIResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e IssueDevEUIResponseValidationError) Field() string { return e.field }
func (e IssueDevEUIResponseValidationError) Reason() string { return e.reason }
func (e IssueDevEUIResponseValidationError) Cause() error { return e.cause }
func (e IssueDevEUIResponseValidationError) Key() bool { return e.key }
func (e IssueDevEUIResponseValidationError) ErrorName() string {
	return "IssueDevEUIResponseValidationError"
}
func (e IssueDevEUIResponseValidationError) 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 %sIssueDevEUIResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = IssueDevEUIResponseValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = IssueDevEUIResponseValidationError{}
func (m *GetApplicationRequest) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = GetApplicationRequestFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "application_ids":
			if m.GetApplicationIds() == nil {
				return GetApplicationRequestValidationError{
					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 GetApplicationRequestValidationError{
						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 GetApplicationRequestValidationError{
						field:  "field_mask",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return GetApplicationRequestValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type GetApplicationRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e GetApplicationRequestValidationError) Field() string { return e.field }
func (e GetApplicationRequestValidationError) Reason() string { return e.reason }
func (e GetApplicationRequestValidationError) Cause() error { return e.cause }
func (e GetApplicationRequestValidationError) Key() bool { return e.key }
func (e GetApplicationRequestValidationError) ErrorName() string {
	return "GetApplicationRequestValidationError"
}
func (e GetApplicationRequestValidationError) 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 %sGetApplicationRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = GetApplicationRequestValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GetApplicationRequestValidationError{}
func (m *ListApplicationsRequest) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = ListApplicationsRequestFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "collaborator":
			if v, ok := interface{}(m.GetCollaborator()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return ListApplicationsRequestValidationError{
						field:  "collaborator",
						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 ListApplicationsRequestValidationError{
						field:  "field_mask",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "order":
			if _, ok := _ListApplicationsRequest_Order_InLookup[m.GetOrder()]; !ok {
				return ListApplicationsRequestValidationError{
					field:  "order",
					reason: "value must be in list [ application_id -application_id name -name created_at -created_at]",
				}
			}
		case "limit":
			if m.GetLimit() > 1000 {
				return ListApplicationsRequestValidationError{
					field:  "limit",
					reason: "value must be less than or equal to 1000",
				}
			}
		case "page":
		case "deleted":
		default:
			return ListApplicationsRequestValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type ListApplicationsRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e ListApplicationsRequestValidationError) Field() string { return e.field }
func (e ListApplicationsRequestValidationError) Reason() string { return e.reason }
func (e ListApplicationsRequestValidationError) Cause() error { return e.cause }
func (e ListApplicationsRequestValidationError) Key() bool { return e.key }
func (e ListApplicationsRequestValidationError) ErrorName() string {
	return "ListApplicationsRequestValidationError"
}
func (e ListApplicationsRequestValidationError) 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 %sListApplicationsRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = ListApplicationsRequestValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ListApplicationsRequestValidationError{}
var _ListApplicationsRequest_Order_InLookup = map[string]struct{}{
	"":                {},
	"application_id":  {},
	"-application_id": {},
	"name":            {},
	"-name":           {},
	"created_at":      {},
	"-created_at":     {},
}
func (m *CreateApplicationRequest) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = CreateApplicationRequestFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "application":
			if m.GetApplication() == nil {
				return CreateApplicationRequestValidationError{
					field:  "application",
					reason: "value is required",
				}
			}
			if v, ok := interface{}(m.GetApplication()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return CreateApplicationRequestValidationError{
						field:  "application",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "collaborator":
			if v, ok := interface{}(&m.Collaborator).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return CreateApplicationRequestValidationError{
						field:  "collaborator",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return CreateApplicationRequestValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type CreateApplicationRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e CreateApplicationRequestValidationError) Field() string { return e.field }
func (e CreateApplicationRequestValidationError) Reason() string { return e.reason }
func (e CreateApplicationRequestValidationError) Cause() error { return e.cause }
func (e CreateApplicationRequestValidationError) Key() bool { return e.key }
func (e CreateApplicationRequestValidationError) ErrorName() string {
	return "CreateApplicationRequestValidationError"
}
func (e CreateApplicationRequestValidationError) 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 %sCreateApplicationRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = CreateApplicationRequestValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = CreateApplicationRequestValidationError{}
func (m *UpdateApplicationRequest) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = UpdateApplicationRequestFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "application":
			if m.GetApplication() == nil {
				return UpdateApplicationRequestValidationError{
					field:  "application",
					reason: "value is required",
				}
			}
			if v, ok := interface{}(m.GetApplication()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return UpdateApplicationRequestValidationError{
						field:  "application",
						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 UpdateApplicationRequestValidationError{
						field:  "field_mask",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return UpdateApplicationRequestValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type UpdateApplicationRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e UpdateApplicationRequestValidationError) Field() string { return e.field }
func (e UpdateApplicationRequestValidationError) Reason() string { return e.reason }
func (e UpdateApplicationRequestValidationError) Cause() error { return e.cause }
func (e UpdateApplicationRequestValidationError) Key() bool { return e.key }
func (e UpdateApplicationRequestValidationError) ErrorName() string {
	return "UpdateApplicationRequestValidationError"
}
func (e UpdateApplicationRequestValidationError) 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 %sUpdateApplicationRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = UpdateApplicationRequestValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = UpdateApplicationRequestValidationError{}
func (m *ListApplicationAPIKeysRequest) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = ListApplicationAPIKeysRequestFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "application_ids":
			if m.GetApplicationIds() == nil {
				return ListApplicationAPIKeysRequestValidationError{
					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 ListApplicationAPIKeysRequestValidationError{
						field:  "application_ids",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "limit":
			if m.GetLimit() > 1000 {
				return ListApplicationAPIKeysRequestValidationError{
					field:  "limit",
					reason: "value must be less than or equal to 1000",
				}
			}
		case "page":
		default:
			return ListApplicationAPIKeysRequestValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type ListApplicationAPIKeysRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e ListApplicationAPIKeysRequestValidationError) Field() string { return e.field }
func (e ListApplicationAPIKeysRequestValidationError) Reason() string { return e.reason }
func (e ListApplicationAPIKeysRequestValidationError) Cause() error { return e.cause }
func (e ListApplicationAPIKeysRequestValidationError) Key() bool { return e.key }