func (e UpdateOrganizationRequestValidationError) ErrorName() string {
	return "UpdateOrganizationRequestValidationError"
}
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 _organization_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 *Organization) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = OrganizationFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "ids":
			if m.GetIds() == nil {
				return OrganizationValidationError{
					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 OrganizationValidationError{
						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 OrganizationValidationError{
						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 OrganizationValidationError{
						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 OrganizationValidationError{
						field:  "deleted_at",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "name":
			if utf8.RuneCountInString(m.GetName()) > 50 {
				return OrganizationValidationError{
					field:  "name",
					reason: "value length must be at most 50 runes",
				}
			}
		case "description":
			if utf8.RuneCountInString(m.GetDescription()) > 2000 {
				return OrganizationValidationError{
					field:  "description",
					reason: "value length must be at most 2000 runes",
				}
			}
		case "attributes":
			if len(m.GetAttributes()) > 10 {
				return OrganizationValidationError{
					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 OrganizationValidationError{
						field:  fmt.Sprintf("attributes[%v]", key),
						reason: "value length must be at most 36 runes",
					}
				}
				if !_Organization_Attributes_Pattern.MatchString(key) {
					return OrganizationValidationError{
						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 OrganizationValidationError{
						field:  fmt.Sprintf("attributes[%v]", key),
						reason: "value length must be at most 200 runes",
					}
				}
			}
		case "contact_info":
			if len(m.GetContactInfo()) > 10 {
				return OrganizationValidationError{
					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 OrganizationValidationError{
							field:  fmt.Sprintf("contact_info[%v]", idx),
							reason: "embedded message failed validation",
							cause:  err,
						}
					}
				}
			}
		default:
			return OrganizationValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type OrganizationValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e OrganizationValidationError) Field() string { return e.field }
func (e OrganizationValidationError) Reason() string { return e.reason }
func (e OrganizationValidationError) Cause() error { return e.cause }
func (e OrganizationValidationError) Key() bool { return e.key }
func (e OrganizationValidationError) ErrorName() string { return "OrganizationValidationError" }
func (e OrganizationValidationError) 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 %sOrganization.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = OrganizationValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = OrganizationValidationError{}
var _Organization_Attributes_Pattern = regexp.MustCompile("^[a-z0-9](?:[-]?[a-z0-9]){2,}$")
func (m *Organizations) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = OrganizationsFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "organizations":
			for idx, item := range m.GetOrganizations() {
				_, _ = idx, item
				if v, ok := interface{}(item).(interface{ ValidateFields(...string) error }); ok {
					if err := v.ValidateFields(subs...); err != nil {
						return OrganizationsValidationError{
							field:  fmt.Sprintf("organizations[%v]", idx),
							reason: "embedded message failed validation",
							cause:  err,
						}
					}
				}
			}
		default:
			return OrganizationsValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type OrganizationsValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e OrganizationsValidationError) Field() string { return e.field }
func (e OrganizationsValidationError) Reason() string { return e.reason }
func (e OrganizationsValidationError) Cause() error { return e.cause }
func (e OrganizationsValidationError) Key() bool { return e.key }
func (e OrganizationsValidationError) ErrorName() string { return "OrganizationsValidationError" }
func (e OrganizationsValidationError) 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 %sOrganizations.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = OrganizationsValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = OrganizationsValidationError{}
func (m *GetOrganizationRequest) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = GetOrganizationRequestFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "organization_ids":
			if m.GetOrganizationIds() == nil {
				return GetOrganizationRequestValidationError{
					field:  "organization_ids",
					reason: "value is required",
				}
			}
			if v, ok := interface{}(m.GetOrganizationIds()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return GetOrganizationRequestValidationError{
						field:  "organization_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 GetOrganizationRequestValidationError{
						field:  "field_mask",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return GetOrganizationRequestValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type GetOrganizationRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e GetOrganizationRequestValidationError) Field() string { return e.field }
func (e GetOrganizationRequestValidationError) Reason() string { return e.reason }
func (e GetOrganizationRequestValidationError) Cause() error { return e.cause }
func (e GetOrganizationRequestValidationError) Key() bool { return e.key }
func (e GetOrganizationRequestValidationError) ErrorName() string {
	return "GetOrganizationRequestValidationError"
}
func (e GetOrganizationRequestValidationError) 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 %sGetOrganizationRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = GetOrganizationRequestValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GetOrganizationRequestValidationError{}
func (m *ListOrganizationsRequest) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = ListOrganizationsRequestFieldPathsNested
	}
	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 ListOrganizationsRequestValidationError{
						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 ListOrganizationsRequestValidationError{
						field:  "field_mask",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "order":
			if _, ok := _ListOrganizationsRequest_Order_InLookup[m.GetOrder()]; !ok {
				return ListOrganizationsRequestValidationError{
					field:  "order",
					reason: "value must be in list [ organization_id -organization_id name -name created_at -created_at]",
				}
			}
		case "limit":
			if m.GetLimit() > 1000 {
				return ListOrganizationsRequestValidationError{
					field:  "limit",
					reason: "value must be less than or equal to 1000",
				}
			}
		case "page":
		case "deleted":
		default:
			return ListOrganizationsRequestValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type ListOrganizationsRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e ListOrganizationsRequestValidationError) Field() string { return e.field }
func (e ListOrganizationsRequestValidationError) Reason() string { return e.reason }
func (e ListOrganizationsRequestValidationError) Cause() error { return e.cause }
func (e ListOrganizationsRequestValidationError) Key() bool { return e.key }
func (e ListOrganizationsRequestValidationError) ErrorName() string {
	return "ListOrganizationsRequestValidationError"
}
func (e ListOrganizationsRequestValidationError) 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 %sListOrganizationsRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = ListOrganizationsRequestValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ListOrganizationsRequestValidationError{}
var _ListOrganizationsRequest_Order_InLookup = map[string]struct{}{
	"":                 {},
	"organization_id":  {},
	"-organization_id": {},
	"name":             {},
	"-name":            {},
	"created_at":       {},
	"-created_at":      {},
}
func (m *CreateOrganizationRequest) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = CreateOrganizationRequestFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "organization":
			if m.GetOrganization() == nil {
				return CreateOrganizationRequestValidationError{
					field:  "organization",
					reason: "value is required",
				}
			}
			if v, ok := interface{}(m.GetOrganization()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return CreateOrganizationRequestValidationError{
						field:  "organization",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "collaborator":
			if m.GetCollaborator() == nil {
				return CreateOrganizationRequestValidationError{
					field:  "collaborator",
					reason: "value is required",
				}
			}
			if v, ok := interface{}(m.GetCollaborator()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return CreateOrganizationRequestValidationError{
						field:  "collaborator",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return CreateOrganizationRequestValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type CreateOrganizationRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e CreateOrganizationRequestValidationError) Field() string { return e.field }
func (e CreateOrganizationRequestValidationError) Reason() string { return e.reason }
func (e CreateOrganizationRequestValidationError) Cause() error { return e.cause }
func (e CreateOrganizationRequestValidationError) Key() bool { return e.key }
func (e CreateOrganizationRequestValidationError) ErrorName() string {
	return "CreateOrganizationRequestValidationError"
}
func (e CreateOrganizationRequestValidationError) 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 %sCreateOrganizationRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = CreateOrganizationRequestValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = CreateOrganizationRequestValidationError{}
func (m *UpdateOrganizationRequest) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = UpdateOrganizationRequestFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "organization":
			if m.GetOrganization() == nil {
				return UpdateOrganizationRequestValidationError{
					field:  "organization",
					reason: "value is required",
				}
			}
			if v, ok := interface{}(m.GetOrganization()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return UpdateOrganizationRequestValidationError{
						field:  "organization",
						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 UpdateOrganizationRequestValidationError{
						field:  "field_mask",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return UpdateOrganizationRequestValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type UpdateOrganizationRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e UpdateOrganizationRequestValidationError) Field() string { return e.field }
func (e UpdateOrganizationRequestValidationError) Reason() string { return e.reason }
func (e UpdateOrganizationRequestValidationError) Cause() error { return e.cause }
func (e UpdateOrganizationRequestValidationError) Key() bool { return e.key }