func (e StreamEventsRequestValidationError) 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 %sStreamEventsRequest.%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 _events_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 *Event) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = EventFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "name":
		case "time":
			if m.GetTime() == nil {
				return EventValidationError{
					field:  "time",
					reason: "value is required",
				}
			}
		case "identifiers":
			for idx, item := range m.GetIdentifiers() {
				_, _ = idx, item
				if v, ok := interface{}(item).(interface{ ValidateFields(...string) error }); ok {
					if err := v.ValidateFields(subs...); err != nil {
						return EventValidationError{
							field:  fmt.Sprintf("identifiers[%v]", idx),
							reason: "embedded message failed validation",
							cause:  err,
						}
					}
				}
			}
		case "data":
			if v, ok := interface{}(m.GetData()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return EventValidationError{
						field:  "data",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "correlation_ids":
			for idx, item := range m.GetCorrelationIds() {
				_, _ = idx, item
				if utf8.RuneCountInString(item) > 100 {
					return EventValidationError{
						field:  fmt.Sprintf("correlation_ids[%v]", idx),
						reason: "value length must be at most 100 runes",
					}
				}
			}
		case "origin":
		case "context":
		case "visibility":
			if v, ok := interface{}(m.GetVisibility()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return EventValidationError{
						field:  "visibility",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "authentication":
			if v, ok := interface{}(m.GetAuthentication()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return EventValidationError{
						field:  "authentication",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		case "remote_ip":
		case "user_agent":
		case "unique_id":
		default:
			return EventValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type EventValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e EventValidationError) Field() string { return e.field }
func (e EventValidationError) Reason() string { return e.reason }
func (e EventValidationError) Cause() error { return e.cause }
func (e EventValidationError) Key() bool { return e.key }
func (e EventValidationError) ErrorName() string { return "EventValidationError" }
func (e EventValidationError) 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 %sEvent.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = EventValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = EventValidationError{}
func (m *StreamEventsRequest) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = StreamEventsRequestFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "identifiers":
			for idx, item := range m.GetIdentifiers() {
				_, _ = idx, item
				if v, ok := interface{}(item).(interface{ ValidateFields(...string) error }); ok {
					if err := v.ValidateFields(subs...); err != nil {
						return StreamEventsRequestValidationError{
							field:  fmt.Sprintf("identifiers[%v]", idx),
							reason: "embedded message failed validation",
							cause:  err,
						}
					}
				}
			}
		case "tail":
		case "after":
			if v, ok := interface{}(m.GetAfter()).(interface{ ValidateFields(...string) error }); ok {
				if err := v.ValidateFields(subs...); err != nil {
					return StreamEventsRequestValidationError{
						field:  "after",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		default:
			return StreamEventsRequestValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type StreamEventsRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e StreamEventsRequestValidationError) Field() string { return e.field }
func (e StreamEventsRequestValidationError) Reason() string { return e.reason }
func (e StreamEventsRequestValidationError) Cause() error { return e.cause }
func (e StreamEventsRequestValidationError) Key() bool { return e.key }
func (e StreamEventsRequestValidationError) ErrorName() string {
	return "StreamEventsRequestValidationError"
}