func (e ApplicationWebhookTemplateFieldValidationError) ErrorName() string {
	return "ApplicationWebhookTemplateFieldValidationError"
}
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 _applicationserver_web_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 *ApplicationWebhookIdentifiers) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = ApplicationWebhookIdentifiersFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "application_ids":
			if m.GetApplicationIds() == nil {
				return ApplicationWebhookIdentifiersValidationError{
					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 ApplicationWebhookIdentifiersValidationError{
						field:  "application_ids",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "webhook_id":
			if utf8.RuneCountInString(m.GetWebhookId()) > 36 {
				return ApplicationWebhookIdentifiersValidationError{
					field:  "webhook_id",
					reason: "value length must be at most 36 runes",
				}
			}
			if !_ApplicationWebhookIdentifiers_WebhookId_Pattern.MatchString(m.GetWebhookId()) {
				return ApplicationWebhookIdentifiersValidationError{
					field:  "webhook_id",
					reason: "value does not match regex pattern \"^[a-z0-9](?:[-]?[a-z0-9]){2,}$\"",
				}
			}
		default:
			return ApplicationWebhookIdentifiersValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type ApplicationWebhookIdentifiersValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e ApplicationWebhookIdentifiersValidationError) Field() string { return e.field }
func (e ApplicationWebhookIdentifiersValidationError) Reason() string { return e.reason }
func (e ApplicationWebhookIdentifiersValidationError) Cause() error { return e.cause }
func (e ApplicationWebhookIdentifiersValidationError) Key() bool { return e.key }
func (e ApplicationWebhookIdentifiersValidationError) ErrorName() string {
	return "ApplicationWebhookIdentifiersValidationError"
}
func (e ApplicationWebhookIdentifiersValidationError) 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 %sApplicationWebhookIdentifiers.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = ApplicationWebhookIdentifiersValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ApplicationWebhookIdentifiersValidationError{}
var _ApplicationWebhookIdentifiers_WebhookId_Pattern = regexp.MustCompile("^[a-z0-9](?:[-]?[a-z0-9]){2,}$")
func (m *ApplicationWebhookTemplateIdentifiers) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = ApplicationWebhookTemplateIdentifiersFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "template_id":
			if utf8.RuneCountInString(m.GetTemplateId()) > 36 {
				return ApplicationWebhookTemplateIdentifiersValidationError{
					field:  "template_id",
					reason: "value length must be at most 36 runes",
				}
			}
			if !_ApplicationWebhookTemplateIdentifiers_TemplateId_Pattern.MatchString(m.GetTemplateId()) {
				return ApplicationWebhookTemplateIdentifiersValidationError{
					field:  "template_id",
					reason: "value does not match regex pattern \"^[a-z0-9](?:[-]?[a-z0-9]){2,}$\"",
				}
			}
		default:
			return ApplicationWebhookTemplateIdentifiersValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type ApplicationWebhookTemplateIdentifiersValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e ApplicationWebhookTemplateIdentifiersValidationError) Field() string { return e.field }
func (e ApplicationWebhookTemplateIdentifiersValidationError) Reason() string { return e.reason }
func (e ApplicationWebhookTemplateIdentifiersValidationError) Cause() error { return e.cause }
func (e ApplicationWebhookTemplateIdentifiersValidationError) Key() bool { return e.key }
func (e ApplicationWebhookTemplateIdentifiersValidationError) ErrorName() string {
	return "ApplicationWebhookTemplateIdentifiersValidationError"
}
func (e ApplicationWebhookTemplateIdentifiersValidationError) 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 %sApplicationWebhookTemplateIdentifiers.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = ApplicationWebhookTemplateIdentifiersValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ApplicationWebhookTemplateIdentifiersValidationError{}
var _ApplicationWebhookTemplateIdentifiers_TemplateId_Pattern = regexp.MustCompile("^[a-z0-9](?:[-]?[a-z0-9]){2,}$")
func (m *ApplicationWebhookTemplateField) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = ApplicationWebhookTemplateFieldFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "id":
			if utf8.RuneCountInString(m.GetId()) > 36 {
				return ApplicationWebhookTemplateFieldValidationError{
					field:  "id",
					reason: "value length must be at most 36 runes",
				}
			}
			if !_ApplicationWebhookTemplateField_Id_Pattern.MatchString(m.GetId()) {
				return ApplicationWebhookTemplateFieldValidationError{
					field:  "id",
					reason: "value does not match regex pattern \"^[a-z0-9](?:[-]?[a-z0-9]){2,}$\"",
				}
			}
		case "name":
			if utf8.RuneCountInString(m.GetName()) > 20 {
				return ApplicationWebhookTemplateFieldValidationError{
					field:  "name",
					reason: "value length must be at most 20 runes",
				}
			}
		case "description":
			if utf8.RuneCountInString(m.GetDescription()) > 100 {
				return ApplicationWebhookTemplateFieldValidationError{
					field:  "description",
					reason: "value length must be at most 100 runes",
				}
			}
		case "secret":
		case "default_value":
			if utf8.RuneCountInString(m.GetDefaultValue()) > 100 {
				return ApplicationWebhookTemplateFieldValidationError{
					field:  "default_value",
					reason: "value length must be at most 100 runes",
				}
			}
		case "optional":
		default:
			return ApplicationWebhookTemplateFieldValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type ApplicationWebhookTemplateFieldValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e ApplicationWebhookTemplateFieldValidationError) Field() string { return e.field }
func (e ApplicationWebhookTemplateFieldValidationError) Reason() string { return e.reason }
func (e ApplicationWebhookTemplateFieldValidationError) Cause() error { return e.cause }
func (e ApplicationWebhookTemplateFieldValidationError) Key() bool { return e.key }