func (m *IsConfiguration_ProfilePicture) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = IsConfiguration_ProfilePictureFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "disable_upload":
			if v, ok := interface{}(m.GetDisableUpload()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return IsConfiguration_ProfilePictureValidationError{
						field:  "disable_upload",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "use_gravatar":
			if v, ok := interface{}(m.GetUseGravatar()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return IsConfiguration_ProfilePictureValidationError{
						field:  "use_gravatar",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return IsConfiguration_ProfilePictureValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
ValidateFields checks the field values on IsConfiguration_ProfilePicture
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 _identityserver_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 *AuthInfoResponse) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = AuthInfoResponseFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "universal_rights":
			if v, ok := interface{}(m.GetUniversalRights()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return AuthInfoResponseValidationError{
						field:  "universal_rights",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "is_admin":
		case "access_method":
			if len(subs) == 0 {
				subs = []string{
					"api_key", "oauth_access_token", "user_session",
				}
			}
			for name, subs := range _processPaths(subs) {
				_ = subs
				switch name {
				case "api_key":
					w, ok := m.AccessMethod.(*AuthInfoResponse_ApiKey)
					if !ok || w == nil {
						continue
					}
					if v, ok := interface{}(m.GetApiKey()).(interface{ ValidateFields(...string) error }); ok {
						if err := v.ValidateFields(subs...); err != nil {
							return AuthInfoResponseValidationError{
								field:  "api_key",
								reason: "embedded message failed validation",
								cause:  err,
							}
						}
					}
				case "oauth_access_token":
					w, ok := m.AccessMethod.(*AuthInfoResponse_OauthAccessToken)
					if !ok || w == nil {
						continue
					}
					if v, ok := interface{}(m.GetOauthAccessToken()).(interface{ ValidateFields(...string) error }); ok {
						if err := v.ValidateFields(subs...); err != nil {
							return AuthInfoResponseValidationError{
								field:  "oauth_access_token",
								reason: "embedded message failed validation",
								cause:  err,
							}
						}
					}
				case "user_session":
					w, ok := m.AccessMethod.(*AuthInfoResponse_UserSession)
					if !ok || w == nil {
						continue
					}
					if v, ok := interface{}(m.GetUserSession()).(interface{ ValidateFields(...string) error }); ok {
						if err := v.ValidateFields(subs...); err != nil {
							return AuthInfoResponseValidationError{
								field:  "user_session",
								reason: "embedded message failed validation",
								cause:  err,
							}
						}
					}
				}
			}
		default:
			return AuthInfoResponseValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type AuthInfoResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e AuthInfoResponseValidationError) Field() string { return e.field }
func (e AuthInfoResponseValidationError) Reason() string { return e.reason }
func (e AuthInfoResponseValidationError) Cause() error { return e.cause }
func (e AuthInfoResponseValidationError) Key() bool { return e.key }
func (e AuthInfoResponseValidationError) ErrorName() string { return "AuthInfoResponseValidationError" }
func (e AuthInfoResponseValidationError) 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 %sAuthInfoResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = AuthInfoResponseValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AuthInfoResponseValidationError{}
func (m *GetIsConfigurationRequest) ValidateFields(paths ...string) error {
	if len(paths) > 0 {
		return fmt.Errorf("message GetIsConfigurationRequest has no fields, but paths %s were specified", paths)
	}
	return nil
}
type GetIsConfigurationRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e GetIsConfigurationRequestValidationError) Field() string { return e.field }
func (e GetIsConfigurationRequestValidationError) Reason() string { return e.reason }
func (e GetIsConfigurationRequestValidationError) Cause() error { return e.cause }
func (e GetIsConfigurationRequestValidationError) Key() bool { return e.key }
func (e GetIsConfigurationRequestValidationError) ErrorName() string {
	return "GetIsConfigurationRequestValidationError"
}
func (e GetIsConfigurationRequestValidationError) 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 %sGetIsConfigurationRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = GetIsConfigurationRequestValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GetIsConfigurationRequestValidationError{}
func (m *IsConfiguration) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = IsConfigurationFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "user_registration":
			if v, ok := interface{}(m.GetUserRegistration()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return IsConfigurationValidationError{
						field:  "user_registration",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "profile_picture":
			if v, ok := interface{}(m.GetProfilePicture()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return IsConfigurationValidationError{
						field:  "profile_picture",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "end_device_picture":
			if v, ok := interface{}(m.GetEndDevicePicture()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return IsConfigurationValidationError{
						field:  "end_device_picture",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "user_rights":
			if v, ok := interface{}(m.GetUserRights()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return IsConfigurationValidationError{
						field:  "user_rights",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return IsConfigurationValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type IsConfigurationValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e IsConfigurationValidationError) Field() string { return e.field }
func (e IsConfigurationValidationError) Reason() string { return e.reason }
func (e IsConfigurationValidationError) Cause() error { return e.cause }
func (e IsConfigurationValidationError) Key() bool { return e.key }
func (e IsConfigurationValidationError) ErrorName() string { return "IsConfigurationValidationError" }
func (e IsConfigurationValidationError) 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 %sIsConfiguration.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = IsConfigurationValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = IsConfigurationValidationError{}
func (m *GetIsConfigurationResponse) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = GetIsConfigurationResponseFieldPathsNested
	}
	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 GetIsConfigurationResponseValidationError{
						field:  "configuration",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return GetIsConfigurationResponseValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type GetIsConfigurationResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e GetIsConfigurationResponseValidationError) Field() string { return e.field }
func (e GetIsConfigurationResponseValidationError) Reason() string { return e.reason }
func (e GetIsConfigurationResponseValidationError) Cause() error { return e.cause }
func (e GetIsConfigurationResponseValidationError) Key() bool { return e.key }
func (e GetIsConfigurationResponseValidationError) ErrorName() string {
	return "GetIsConfigurationResponseValidationError"
}
func (e GetIsConfigurationResponseValidationError) 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 %sGetIsConfigurationResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = GetIsConfigurationResponseValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GetIsConfigurationResponseValidationError{}
func (m *AuthInfoResponse_APIKeyAccess) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = AuthInfoResponse_APIKeyAccessFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "api_key":
			if m.GetApiKey() == nil {
				return AuthInfoResponse_APIKeyAccessValidationError{
					field:  "api_key",
					reason: "value is required",
				}
			}
			if v, ok := interface{}(m.GetApiKey()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return AuthInfoResponse_APIKeyAccessValidationError{
						field:  "api_key",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "entity_ids":
			if v, ok := interface{}(&m.EntityIds).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return AuthInfoResponse_APIKeyAccessValidationError{
						field:  "entity_ids",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return AuthInfoResponse_APIKeyAccessValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type AuthInfoResponse_APIKeyAccessValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e AuthInfoResponse_APIKeyAccessValidationError) Field() string { return e.field }
func (e AuthInfoResponse_APIKeyAccessValidationError) Reason() string { return e.reason }
func (e AuthInfoResponse_APIKeyAccessValidationError) Cause() error { return e.cause }
func (e AuthInfoResponse_APIKeyAccessValidationError) Key() bool { return e.key }
func (e AuthInfoResponse_APIKeyAccessValidationError) ErrorName() string {
	return "AuthInfoResponse_APIKeyAccessValidationError"
}
func (e AuthInfoResponse_APIKeyAccessValidationError) 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 %sAuthInfoResponse_APIKeyAccess.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = AuthInfoResponse_APIKeyAccessValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AuthInfoResponse_APIKeyAccessValidationError{}
func (m *IsConfiguration_UserRegistration) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = IsConfiguration_UserRegistrationFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "invitation":
			if v, ok := interface{}(m.GetInvitation()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return IsConfiguration_UserRegistrationValidationError{
						field:  "invitation",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "contact_info_validation":
			if v, ok := interface{}(m.GetContactInfoValidation()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return IsConfiguration_UserRegistrationValidationError{
						field:  "contact_info_validation",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "admin_approval":
			if v, ok := interface{}(m.GetAdminApproval()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return IsConfiguration_UserRegistrationValidationError{
						field:  "admin_approval",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "password_requirements":
			if v, ok := interface{}(m.GetPasswordRequirements()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return IsConfiguration_UserRegistrationValidationError{
						field:  "password_requirements",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "enabled":
		default:
			return IsConfiguration_UserRegistrationValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type IsConfiguration_UserRegistrationValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e IsConfiguration_UserRegistrationValidationError) Field() string { return e.field }
func (e IsConfiguration_UserRegistrationValidationError) Reason() string { return e.reason }
func (e IsConfiguration_UserRegistrationValidationError) Cause() error { return e.cause }
func (e IsConfiguration_UserRegistrationValidationError) Key() bool { return e.key }
func (e IsConfiguration_UserRegistrationValidationError) ErrorName() string {
	return "IsConfiguration_UserRegistrationValidationError"
}
func (e IsConfiguration_UserRegistrationValidationError) 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 %sIsConfiguration_UserRegistration.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = IsConfiguration_UserRegistrationValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = IsConfiguration_UserRegistrationValidationError{}