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)
}
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 _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" }