func (m *GatewayVersionIdentifiers) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = GatewayVersionIdentifiersFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "brand_id":
			if m.GetBrandId() != "" {
				if utf8.RuneCountInString(m.GetBrandId()) > 36 {
					return GatewayVersionIdentifiersValidationError{
						field:  "brand_id",
						reason: "value length must be at most 36 runes",
					}
				}
				if !_GatewayVersionIdentifiers_BrandId_Pattern.MatchString(m.GetBrandId()) {
					return GatewayVersionIdentifiersValidationError{
						field:  "brand_id",
						reason: "value does not match regex pattern \"^[a-z0-9](?:[-]?[a-z0-9]){2,}$\"",
					}
				}
			}
		case "model_id":
			if m.GetModelId() != "" {
				if utf8.RuneCountInString(m.GetModelId()) > 36 {
					return GatewayVersionIdentifiersValidationError{
						field:  "model_id",
						reason: "value length must be at most 36 runes",
					}
				}
				if !_GatewayVersionIdentifiers_ModelId_Pattern.MatchString(m.GetModelId()) {
					return GatewayVersionIdentifiersValidationError{
						field:  "model_id",
						reason: "value does not match regex pattern \"^[a-z0-9](?:[-]?[a-z0-9]){2,}$\"",
					}
				}
			}
		case "hardware_version":
			if utf8.RuneCountInString(m.GetHardwareVersion()) > 32 {
				return GatewayVersionIdentifiersValidationError{
					field:  "hardware_version",
					reason: "value length must be at most 32 runes",
				}
			}
		case "firmware_version":
			if utf8.RuneCountInString(m.GetFirmwareVersion()) > 32 {
				return GatewayVersionIdentifiersValidationError{
					field:  "firmware_version",
					reason: "value length must be at most 32 runes",
				}
			}
		default:
			return GatewayVersionIdentifiersValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
ValidateFields checks the field values on GatewayVersionIdentifiers 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 _gateway_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 *GatewayBrand) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = GatewayBrandFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "id":
		case "name":
		case "url":
		case "logos":
		default:
			return GatewayBrandValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type GatewayBrandValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e GatewayBrandValidationError) Field() string { return e.field }
func (e GatewayBrandValidationError) Reason() string { return e.reason }
func (e GatewayBrandValidationError) Cause() error { return e.cause }
func (e GatewayBrandValidationError) Key() bool { return e.key }
func (e GatewayBrandValidationError) ErrorName() string { return "GatewayBrandValidationError" }
func (e GatewayBrandValidationError) 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 %sGatewayBrand.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = GatewayBrandValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GatewayBrandValidationError{}
func (m *GatewayModel) ValidateFields(paths ...string) error {
	if m == nil {
		return nil
	}
	if len(paths) == 0 {
		paths = GatewayModelFieldPathsNested
	}
	for name, subs := range _processPaths(append(paths[:0:0], paths...)) {
		_ = subs
		switch name {
		case "brand_id":
			if m.GetBrandId() != "" {
				if utf8.RuneCountInString(m.GetBrandId()) > 36 {
					return GatewayModelValidationError{
						field:  "brand_id",
						reason: "value length must be at most 36 runes",
					}
				}
				if !_GatewayModel_BrandId_Pattern.MatchString(m.GetBrandId()) {
					return GatewayModelValidationError{
						field:  "brand_id",
						reason: "value does not match regex pattern \"^[a-z0-9](?:[-]?[a-z0-9]){2,}$\"",
					}
				}
			}
		case "id":
			if m.GetId() != "" {
				if utf8.RuneCountInString(m.GetId()) > 36 {
					return GatewayModelValidationError{
						field:  "id",
						reason: "value length must be at most 36 runes",
					}
				}
				if !_GatewayModel_Id_Pattern.MatchString(m.GetId()) {
					return GatewayModelValidationError{
						field:  "id",
						reason: "value does not match regex pattern \"^[a-z0-9](?:[-]?[a-z0-9]){2,}$\"",
					}
				}
			}
		case "name":
		default:
			return GatewayModelValidationError{
				field:  name,
				reason: "invalid field path",
			}
		}
	}
	return nil
}
type GatewayModelValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e GatewayModelValidationError) Field() string { return e.field }
func (e GatewayModelValidationError) Reason() string { return e.reason }
func (e GatewayModelValidationError) Cause() error { return e.cause }
func (e GatewayModelValidationError) Key() bool { return e.key }
func (e GatewayModelValidationError) ErrorName() string { return "GatewayModelValidationError" }
func (e GatewayModelValidationError) 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 %sGatewayModel.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = GatewayModelValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GatewayModelValidationError{}
var _GatewayModel_BrandId_Pattern = regexp.MustCompile("^[a-z0-9](?:[-]?[a-z0-9]){2,}$")
var _GatewayModel_Id_Pattern = regexp.MustCompile("^[a-z0-9](?:[-]?[a-z0-9]){2,}$")