func (e GenerateEndDeviceQRCodeRequest_ImageValidationError) 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 %sGenerateEndDeviceQRCodeRequest_Image.%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 _qrcodegenerator_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 *QRCodeFormat) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = QRCodeFormatFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "name":
			if utf8.RuneCountInString(m.GetName()) > 100 {
				return QRCodeFormatValidationError{
					field:  "name",
					reason: "value length must be at most 100 runes",
				}
			}
		case "description":
			if utf8.RuneCountInString(m.GetDescription()) > 200 {
				return QRCodeFormatValidationError{
					field:  "description",
					reason: "value length must be at most 200 runes",
				}
			}
		case "field_mask":
			if v, ok := interface{}(m.GetFieldMask()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return QRCodeFormatValidationError{
						field:  "field_mask",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return QRCodeFormatValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type QRCodeFormatValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e QRCodeFormatValidationError) Field() string { return e.field }
func (e QRCodeFormatValidationError) Reason() string { return e.reason }
func (e QRCodeFormatValidationError) Cause() error { return e.cause }
func (e QRCodeFormatValidationError) Key() bool { return e.key }
func (e QRCodeFormatValidationError) ErrorName() string { return "QRCodeFormatValidationError" }
func (e QRCodeFormatValidationError) 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 %sQRCodeFormat.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = QRCodeFormatValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = QRCodeFormatValidationError{}
func (m *QRCodeFormats) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = QRCodeFormatsFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "formats":
			for key, val := range m.GetFormats() {
				_ = val
				if utf8.RuneCountInString(key) > 36 {
					return QRCodeFormatsValidationError{
						field:  fmt.Sprintf("formats[%v]", key),
						reason: "value length must be at most 36 runes",
					}
				}
				if !_QRCodeFormats_Formats_Pattern.MatchString(key) {
					return QRCodeFormatsValidationError{
						field:  fmt.Sprintf("formats[%v]", key),
						reason: "value does not match regex pattern \"^[a-z0-9](?:[-]?[a-z0-9]){2,}$\"",
					}
				}
				if v, ok := interface{}(val).(interface{ ValidateFields(...string) error }); ok {
					if err := v.ValidateFields(subs...); err != nil {
						return QRCodeFormatsValidationError{
							field:  fmt.Sprintf("formats[%v]", key),
							reason: "embedded message failed validation",
							cause:  err,
						}
					}
				}
			}
		default:
			return QRCodeFormatsValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type QRCodeFormatsValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e QRCodeFormatsValidationError) Field() string { return e.field }
func (e QRCodeFormatsValidationError) Reason() string { return e.reason }
func (e QRCodeFormatsValidationError) Cause() error { return e.cause }
func (e QRCodeFormatsValidationError) Key() bool { return e.key }
func (e QRCodeFormatsValidationError) ErrorName() string { return "QRCodeFormatsValidationError" }
func (e QRCodeFormatsValidationError) 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 %sQRCodeFormats.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = QRCodeFormatsValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = QRCodeFormatsValidationError{}
var _QRCodeFormats_Formats_Pattern = regexp.MustCompile("^[a-z0-9](?:[-]?[a-z0-9]){2,}$")
func (m *GetQRCodeFormatRequest) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = GetQRCodeFormatRequestFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "format_id":
			if utf8.RuneCountInString(m.GetFormatId()) > 36 {
				return GetQRCodeFormatRequestValidationError{
					field:  "format_id",
					reason: "value length must be at most 36 runes",
				}
			}
			if !_GetQRCodeFormatRequest_FormatId_Pattern.MatchString(m.GetFormatId()) {
				return GetQRCodeFormatRequestValidationError{
					field:  "format_id",
					reason: "value does not match regex pattern \"^[a-z0-9](?:[-]?[a-z0-9]){2,}$\"",
				}
			}
		default:
			return GetQRCodeFormatRequestValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type GetQRCodeFormatRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e GetQRCodeFormatRequestValidationError) Field() string { return e.field }
func (e GetQRCodeFormatRequestValidationError) Reason() string { return e.reason }
func (e GetQRCodeFormatRequestValidationError) Cause() error { return e.cause }
func (e GetQRCodeFormatRequestValidationError) Key() bool { return e.key }
func (e GetQRCodeFormatRequestValidationError) ErrorName() string {
	return "GetQRCodeFormatRequestValidationError"
}
func (e GetQRCodeFormatRequestValidationError) 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 %sGetQRCodeFormatRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = GetQRCodeFormatRequestValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GetQRCodeFormatRequestValidationError{}
var _GetQRCodeFormatRequest_FormatId_Pattern = regexp.MustCompile("^[a-z0-9](?:[-]?[a-z0-9]){2,}$")
func (m *GenerateEndDeviceQRCodeRequest) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = GenerateEndDeviceQRCodeRequestFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "format_id":
			if utf8.RuneCountInString(m.GetFormatId()) > 36 {
				return GenerateEndDeviceQRCodeRequestValidationError{
					field:  "format_id",
					reason: "value length must be at most 36 runes",
				}
			}
			if !_GenerateEndDeviceQRCodeRequest_FormatId_Pattern.MatchString(m.GetFormatId()) {
				return GenerateEndDeviceQRCodeRequestValidationError{
					field:  "format_id",
					reason: "value does not match regex pattern \"^[a-z0-9](?:[-]?[a-z0-9]){2,}$\"",
				}
			}
		case "end_device":
			if v, ok := interface{}(&m.EndDevice).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return GenerateEndDeviceQRCodeRequestValidationError{
						field:  "end_device",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "image":
			if v, ok := interface{}(m.GetImage()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return GenerateEndDeviceQRCodeRequestValidationError{
						field:  "image",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return GenerateEndDeviceQRCodeRequestValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type GenerateEndDeviceQRCodeRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e GenerateEndDeviceQRCodeRequestValidationError) Field() string { return e.field }
func (e GenerateEndDeviceQRCodeRequestValidationError) Reason() string { return e.reason }
func (e GenerateEndDeviceQRCodeRequestValidationError) Cause() error { return e.cause }
func (e GenerateEndDeviceQRCodeRequestValidationError) Key() bool { return e.key }
func (e GenerateEndDeviceQRCodeRequestValidationError) ErrorName() string {
	return "GenerateEndDeviceQRCodeRequestValidationError"
}
func (e GenerateEndDeviceQRCodeRequestValidationError) 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 %sGenerateEndDeviceQRCodeRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = GenerateEndDeviceQRCodeRequestValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GenerateEndDeviceQRCodeRequestValidationError{}
var _GenerateEndDeviceQRCodeRequest_FormatId_Pattern = regexp.MustCompile("^[a-z0-9](?:[-]?[a-z0-9]){2,}$")
func (m *GenerateQRCodeResponse) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = GenerateQRCodeResponseFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "text":
		case "image":
			if v, ok := interface{}(m.GetImage()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return GenerateQRCodeResponseValidationError{
						field:  "image",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return GenerateQRCodeResponseValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type GenerateQRCodeResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e GenerateQRCodeResponseValidationError) Field() string { return e.field }
func (e GenerateQRCodeResponseValidationError) Reason() string { return e.reason }
func (e GenerateQRCodeResponseValidationError) Cause() error { return e.cause }
func (e GenerateQRCodeResponseValidationError) Key() bool { return e.key }
func (e GenerateQRCodeResponseValidationError) ErrorName() string {
	return "GenerateQRCodeResponseValidationError"
}
func (e GenerateQRCodeResponseValidationError) 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 %sGenerateQRCodeResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = GenerateQRCodeResponseValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GenerateQRCodeResponseValidationError{}
func (m *GenerateEndDeviceQRCodeRequest_Image) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = GenerateEndDeviceQRCodeRequest_ImageFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "image_size":
			if val := m.GetImageSize(); val < 10 || val > 1000 {
				return GenerateEndDeviceQRCodeRequest_ImageValidationError{
					field:  "image_size",
					reason: "value must be inside range [10, 1000]",
				}
			}
		default:
			return GenerateEndDeviceQRCodeRequest_ImageValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type GenerateEndDeviceQRCodeRequest_ImageValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e GenerateEndDeviceQRCodeRequest_ImageValidationError) Field() string { return e.field }
func (e GenerateEndDeviceQRCodeRequest_ImageValidationError) Reason() string { return e.reason }
func (e GenerateEndDeviceQRCodeRequest_ImageValidationError) Cause() error { return e.cause }
func (e GenerateEndDeviceQRCodeRequest_ImageValidationError) Key() bool { return e.key }
func (e GenerateEndDeviceQRCodeRequest_ImageValidationError) ErrorName() string {
	return "GenerateEndDeviceQRCodeRequest_ImageValidationError"
}