/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.validate.go
https://github.com/cloudfoundry/bosh-cli · Go · 4121 lines · 3159 code · 520 blank · 442 comment · 790 complexity · 9232fbca7cd4adf6b98b3a43a3108cfe MD5 · raw file
Large files are truncated click here to view the full file
- // Code generated by protoc-gen-validate. DO NOT EDIT.
- // source: envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto
- package envoy_extensions_filters_network_http_connection_manager_v3
- import (
- "bytes"
- "errors"
- "fmt"
- "net"
- "net/mail"
- "net/url"
- "regexp"
- "sort"
- "strings"
- "time"
- "unicode/utf8"
- "google.golang.org/protobuf/types/known/anypb"
- )
- // ensure the imports are used
- 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)
- _ = anypb.Any{}
- _ = sort.Sort
- )
- // Validate checks the field values on HttpConnectionManager with the rules
- // defined in the proto definition for this message. If any rules are
- // violated, the first error encountered is returned, or nil if there are no violations.
- func (m *HttpConnectionManager) Validate() error {
- return m.validate(false)
- }
- // ValidateAll checks the field values on HttpConnectionManager with the rules
- // defined in the proto definition for this message. If any rules are
- // violated, the result is a list of violation errors wrapped in
- // HttpConnectionManagerMultiError, or nil if none found.
- func (m *HttpConnectionManager) ValidateAll() error {
- return m.validate(true)
- }
- func (m *HttpConnectionManager) validate(all bool) error {
- if m == nil {
- return nil
- }
- var errors []error
- if _, ok := HttpConnectionManager_CodecType_name[int32(m.GetCodecType())]; !ok {
- err := HttpConnectionManagerValidationError{
- field: "CodecType",
- reason: "value must be one of the defined enum values",
- }
- if !all {
- return err
- }
- errors = append(errors, err)
- }
- if utf8.RuneCountInString(m.GetStatPrefix()) < 1 {
- err := HttpConnectionManagerValidationError{
- field: "StatPrefix",
- reason: "value length must be at least 1 runes",
- }
- if !all {
- return err
- }
- errors = append(errors, err)
- }
- for idx, item := range m.GetHttpFilters() {
- _, _ = idx, item
- if all {
- switch v := interface{}(item).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: fmt.Sprintf("HttpFilters[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: fmt.Sprintf("HttpFilters[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: fmt.Sprintf("HttpFilters[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- }
- if all {
- switch v := interface{}(m.GetAddUserAgent()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "AddUserAgent",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "AddUserAgent",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetAddUserAgent()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "AddUserAgent",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- if all {
- switch v := interface{}(m.GetTracing()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "Tracing",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "Tracing",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetTracing()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "Tracing",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- if all {
- switch v := interface{}(m.GetCommonHttpProtocolOptions()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "CommonHttpProtocolOptions",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "CommonHttpProtocolOptions",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetCommonHttpProtocolOptions()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "CommonHttpProtocolOptions",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- if all {
- switch v := interface{}(m.GetHttpProtocolOptions()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "HttpProtocolOptions",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "HttpProtocolOptions",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetHttpProtocolOptions()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "HttpProtocolOptions",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- if all {
- switch v := interface{}(m.GetHttp2ProtocolOptions()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "Http2ProtocolOptions",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "Http2ProtocolOptions",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetHttp2ProtocolOptions()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "Http2ProtocolOptions",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- if all {
- switch v := interface{}(m.GetHttp3ProtocolOptions()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "Http3ProtocolOptions",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "Http3ProtocolOptions",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetHttp3ProtocolOptions()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "Http3ProtocolOptions",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- if !_HttpConnectionManager_ServerName_Pattern.MatchString(m.GetServerName()) {
- err := HttpConnectionManagerValidationError{
- field: "ServerName",
- reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
- }
- if !all {
- return err
- }
- errors = append(errors, err)
- }
- if _, ok := HttpConnectionManager_ServerHeaderTransformation_name[int32(m.GetServerHeaderTransformation())]; !ok {
- err := HttpConnectionManagerValidationError{
- field: "ServerHeaderTransformation",
- reason: "value must be one of the defined enum values",
- }
- if !all {
- return err
- }
- errors = append(errors, err)
- }
- if all {
- switch v := interface{}(m.GetSchemeHeaderTransformation()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "SchemeHeaderTransformation",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "SchemeHeaderTransformation",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetSchemeHeaderTransformation()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "SchemeHeaderTransformation",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- if wrapper := m.GetMaxRequestHeadersKb(); wrapper != nil {
- if val := wrapper.GetValue(); val <= 0 || val > 8192 {
- err := HttpConnectionManagerValidationError{
- field: "MaxRequestHeadersKb",
- reason: "value must be inside range (0, 8192]",
- }
- if !all {
- return err
- }
- errors = append(errors, err)
- }
- }
- if all {
- switch v := interface{}(m.GetStreamIdleTimeout()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "StreamIdleTimeout",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "StreamIdleTimeout",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetStreamIdleTimeout()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "StreamIdleTimeout",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- if all {
- switch v := interface{}(m.GetRequestTimeout()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "RequestTimeout",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "RequestTimeout",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetRequestTimeout()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "RequestTimeout",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- if d := m.GetRequestHeadersTimeout(); d != nil {
- dur, err := d.AsDuration(), d.CheckValid()
- if err != nil {
- err = HttpConnectionManagerValidationError{
- field: "RequestHeadersTimeout",
- reason: "value is not a valid duration",
- cause: err,
- }
- if !all {
- return err
- }
- errors = append(errors, err)
- } else {
- gte := time.Duration(0*time.Second + 0*time.Nanosecond)
- if dur < gte {
- err := HttpConnectionManagerValidationError{
- field: "RequestHeadersTimeout",
- reason: "value must be greater than or equal to 0s",
- }
- if !all {
- return err
- }
- errors = append(errors, err)
- }
- }
- }
- if all {
- switch v := interface{}(m.GetDrainTimeout()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "DrainTimeout",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "DrainTimeout",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetDrainTimeout()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "DrainTimeout",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- if all {
- switch v := interface{}(m.GetDelayedCloseTimeout()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "DelayedCloseTimeout",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "DelayedCloseTimeout",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetDelayedCloseTimeout()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "DelayedCloseTimeout",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- for idx, item := range m.GetAccessLog() {
- _, _ = idx, item
- if all {
- switch v := interface{}(item).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: fmt.Sprintf("AccessLog[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: fmt.Sprintf("AccessLog[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: fmt.Sprintf("AccessLog[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- }
- if all {
- switch v := interface{}(m.GetUseRemoteAddress()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "UseRemoteAddress",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "UseRemoteAddress",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetUseRemoteAddress()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "UseRemoteAddress",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- // no validation rules for XffNumTrustedHops
- for idx, item := range m.GetOriginalIpDetectionExtensions() {
- _, _ = idx, item
- if all {
- switch v := interface{}(item).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: fmt.Sprintf("OriginalIpDetectionExtensions[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: fmt.Sprintf("OriginalIpDetectionExtensions[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: fmt.Sprintf("OriginalIpDetectionExtensions[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- }
- if all {
- switch v := interface{}(m.GetInternalAddressConfig()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "InternalAddressConfig",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "InternalAddressConfig",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetInternalAddressConfig()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "InternalAddressConfig",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- // no validation rules for SkipXffAppend
- if !_HttpConnectionManager_Via_Pattern.MatchString(m.GetVia()) {
- err := HttpConnectionManagerValidationError{
- field: "Via",
- reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
- }
- if !all {
- return err
- }
- errors = append(errors, err)
- }
- if all {
- switch v := interface{}(m.GetGenerateRequestId()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "GenerateRequestId",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "GenerateRequestId",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetGenerateRequestId()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "GenerateRequestId",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- // no validation rules for PreserveExternalRequestId
- // no validation rules for AlwaysSetRequestIdInResponse
- if _, ok := HttpConnectionManager_ForwardClientCertDetails_name[int32(m.GetForwardClientCertDetails())]; !ok {
- err := HttpConnectionManagerValidationError{
- field: "ForwardClientCertDetails",
- reason: "value must be one of the defined enum values",
- }
- if !all {
- return err
- }
- errors = append(errors, err)
- }
- if all {
- switch v := interface{}(m.GetSetCurrentClientCertDetails()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "SetCurrentClientCertDetails",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "SetCurrentClientCertDetails",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetSetCurrentClientCertDetails()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "SetCurrentClientCertDetails",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- // no validation rules for Proxy_100Continue
- // no validation rules for RepresentIpv4RemoteAddressAsIpv4MappedIpv6
- for idx, item := range m.GetUpgradeConfigs() {
- _, _ = idx, item
- if all {
- switch v := interface{}(item).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: fmt.Sprintf("UpgradeConfigs[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: fmt.Sprintf("UpgradeConfigs[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: fmt.Sprintf("UpgradeConfigs[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- }
- if all {
- switch v := interface{}(m.GetNormalizePath()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "NormalizePath",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "NormalizePath",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetNormalizePath()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "NormalizePath",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- // no validation rules for MergeSlashes
- // no validation rules for PathWithEscapedSlashesAction
- if all {
- switch v := interface{}(m.GetRequestIdExtension()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "RequestIdExtension",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "RequestIdExtension",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetRequestIdExtension()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "RequestIdExtension",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- if all {
- switch v := interface{}(m.GetLocalReplyConfig()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "LocalReplyConfig",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "LocalReplyConfig",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetLocalReplyConfig()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "LocalReplyConfig",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- // no validation rules for StripMatchingHostPort
- if all {
- switch v := interface{}(m.GetStreamErrorOnInvalidHttpMessage()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "StreamErrorOnInvalidHttpMessage",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "StreamErrorOnInvalidHttpMessage",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetStreamErrorOnInvalidHttpMessage()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "StreamErrorOnInvalidHttpMessage",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- if all {
- switch v := interface{}(m.GetPathNormalizationOptions()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "PathNormalizationOptions",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "PathNormalizationOptions",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetPathNormalizationOptions()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "PathNormalizationOptions",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- // no validation rules for StripTrailingHostDot
- switch m.RouteSpecifier.(type) {
- case *HttpConnectionManager_Rds:
- if all {
- switch v := interface{}(m.GetRds()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "Rds",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "Rds",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetRds()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "Rds",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- case *HttpConnectionManager_RouteConfig:
- if all {
- switch v := interface{}(m.GetRouteConfig()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "RouteConfig",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "RouteConfig",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetRouteConfig()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "RouteConfig",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- case *HttpConnectionManager_ScopedRoutes:
- if all {
- switch v := interface{}(m.GetScopedRoutes()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "ScopedRoutes",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, HttpConnectionManagerValidationError{
- field: "ScopedRoutes",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetScopedRoutes()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return HttpConnectionManagerValidationError{
- field: "ScopedRoutes",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- default:
- err := HttpConnectionManagerValidationError{
- field: "RouteSpecifier",
- reason: "value is required",
- }
- if !all {
- return err
- }
- errors = append(errors, err)
- }
- switch m.StripPortMode.(type) {
- case *HttpConnectionManager_StripAnyHostPort:
- // no validation rules for StripAnyHostPort
- }
- if len(errors) > 0 {
- return HttpConnectionManagerMultiError(errors)
- }
- return nil
- }
- // HttpConnectionManagerMultiError is an error wrapping multiple validation
- // errors returned by HttpConnectionManager.ValidateAll() if the designated
- // constraints aren't met.
- type HttpConnectionManagerMultiError []error
- // Error returns a concatenation of all the error messages it wraps.
- func (m HttpConnectionManagerMultiError) Error() string {
- var msgs []string
- for _, err := range m {
- msgs = append(msgs, err.Error())
- }
- return strings.Join(msgs, "; ")
- }
- // AllErrors returns a list of validation violation errors.
- func (m HttpConnectionManagerMultiError) AllErrors() []error { return m }
- // HttpConnectionManagerValidationError is the validation error returned by
- // HttpConnectionManager.Validate if the designated constraints aren't met.
- type HttpConnectionManagerValidationError struct {
- field string
- reason string
- cause error
- key bool
- }
- // Field function returns field value.
- func (e HttpConnectionManagerValidationError) Field() string { return e.field }
- // Reason function returns reason value.
- func (e HttpConnectionManagerValidationError) Reason() string { return e.reason }
- // Cause function returns cause value.
- func (e HttpConnectionManagerValidationError) Cause() error { return e.cause }
- // Key function returns key value.
- func (e HttpConnectionManagerValidationError) Key() bool { return e.key }
- // ErrorName returns error name.
- func (e HttpConnectionManagerValidationError) ErrorName() string {
- return "HttpConnectionManagerValidationError"
- }
- // Error satisfies the builtin error interface
- func (e HttpConnectionManagerValidationError) 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 %sHttpConnectionManager.%s: %s%s",
- key,
- e.field,
- e.reason,
- cause)
- }
- var _ error = HttpConnectionManagerValidationError{}
- var _ interface {
- Field() string
- Reason() string
- Key() bool
- Cause() error
- ErrorName() string
- } = HttpConnectionManagerValidationError{}
- var _HttpConnectionManager_ServerName_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
- var _HttpConnectionManager_Via_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
- // Validate checks the field values on LocalReplyConfig with the rules defined
- // in the proto definition for this message. If any rules are violated, the
- // first error encountered is returned, or nil if there are no violations.
- func (m *LocalReplyConfig) Validate() error {
- return m.validate(false)
- }
- // ValidateAll checks the field values on LocalReplyConfig with the rules
- // defined in the proto definition for this message. If any rules are
- // violated, the result is a list of violation errors wrapped in
- // LocalReplyConfigMultiError, or nil if none found.
- func (m *LocalReplyConfig) ValidateAll() error {
- return m.validate(true)
- }
- func (m *LocalReplyConfig) validate(all bool) error {
- if m == nil {
- return nil
- }
- var errors []error
- for idx, item := range m.GetMappers() {
- _, _ = idx, item
- if all {
- switch v := interface{}(item).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, LocalReplyConfigValidationError{
- field: fmt.Sprintf("Mappers[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, LocalReplyConfigValidationError{
- field: fmt.Sprintf("Mappers[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return LocalReplyConfigValidationError{
- field: fmt.Sprintf("Mappers[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- }
- if all {
- switch v := interface{}(m.GetBodyFormat()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, LocalReplyConfigValidationError{
- field: "BodyFormat",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, LocalReplyConfigValidationError{
- field: "BodyFormat",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetBodyFormat()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return LocalReplyConfigValidationError{
- field: "BodyFormat",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- if len(errors) > 0 {
- return LocalReplyConfigMultiError(errors)
- }
- return nil
- }
- // LocalReplyConfigMultiError is an error wrapping multiple validation errors
- // returned by LocalReplyConfig.ValidateAll() if the designated constraints
- // aren't met.
- type LocalReplyConfigMultiError []error
- // Error returns a concatenation of all the error messages it wraps.
- func (m LocalReplyConfigMultiError) Error() string {
- var msgs []string
- for _, err := range m {
- msgs = append(msgs, err.Error())
- }
- return strings.Join(msgs, "; ")
- }
- // AllErrors returns a list of validation violation errors.
- func (m LocalReplyConfigMultiError) AllErrors() []error { return m }
- // LocalReplyConfigValidationError is the validation error returned by
- // LocalReplyConfig.Validate if the designated constraints aren't met.
- type LocalReplyConfigValidationError struct {
- field string
- reason string
- cause error
- key bool
- }
- // Field function returns field value.
- func (e LocalReplyConfigValidationError) Field() string { return e.field }
- // Reason function returns reason value.
- func (e LocalReplyConfigValidationError) Reason() string { return e.reason }
- // Cause function returns cause value.
- func (e LocalReplyConfigValidationError) Cause() error { return e.cause }
- // Key function returns key value.
- func (e LocalReplyConfigValidationError) Key() bool { return e.key }
- // ErrorName returns error name.
- func (e LocalReplyConfigValidationError) ErrorName() string { return "LocalReplyConfigValidationError" }
- // Error satisfies the builtin error interface
- func (e LocalReplyConfigValidationError) 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 %sLocalReplyConfig.%s: %s%s",
- key,
- e.field,
- e.reason,
- cause)
- }
- var _ error = LocalReplyConfigValidationError{}
- var _ interface {
- Field() string
- Reason() string
- Key() bool
- Cause() error
- ErrorName() string
- } = LocalReplyConfigValidationError{}
- // Validate checks the field values on ResponseMapper with the rules defined in
- // the proto definition for this message. If any rules are violated, the first
- // error encountered is returned, or nil if there are no violations.
- func (m *ResponseMapper) Validate() error {
- return m.validate(false)
- }
- // ValidateAll checks the field values on ResponseMapper with the rules defined
- // in the proto definition for this message. If any rules are violated, the
- // result is a list of violation errors wrapped in ResponseMapperMultiError,
- // or nil if none found.
- func (m *ResponseMapper) ValidateAll() error {
- return m.validate(true)
- }
- func (m *ResponseMapper) validate(all bool) error {
- if m == nil {
- return nil
- }
- var errors []error
- if m.GetFilter() == nil {
- err := ResponseMapperValidationError{
- field: "Filter",
- reason: "value is required",
- }
- if !all {
- return err
- }
- errors = append(errors, err)
- }
- if all {
- switch v := interface{}(m.GetFilter()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, ResponseMapperValidationError{
- field: "Filter",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, ResponseMapperValidationError{
- field: "Filter",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return ResponseMapperValidationError{
- field: "Filter",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- if wrapper := m.GetStatusCode(); wrapper != nil {
- if val := wrapper.GetValue(); val < 200 || val >= 600 {
- err := ResponseMapperValidationError{
- field: "StatusCode",
- reason: "value must be inside range [200, 600)",
- }
- if !all {
- return err
- }
- errors = append(errors, err)
- }
- }
- if all {
- switch v := interface{}(m.GetBody()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, ResponseMapperValidationError{
- field: "Body",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, ResponseMapperValidationError{
- field: "Body",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetBody()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return ResponseMapperValidationError{
- field: "Body",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- if all {
- switch v := interface{}(m.GetBodyFormatOverride()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, ResponseMapperValidationError{
- field: "BodyFormatOverride",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, ResponseMapperValidationError{
- field: "BodyFormatOverride",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetBodyFormatOverride()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return ResponseMapperValidationError{
- field: "BodyFormatOverride",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- if len(m.GetHeadersToAdd()) > 1000 {
- err := ResponseMapperValidationError{
- field: "HeadersToAdd",
- reason: "value must contain no more than 1000 item(s)",
- }
- if !all {
- return err
- }
- errors = append(errors, err)
- }
- for idx, item := range m.GetHeadersToAdd() {
- _, _ = idx, item
- if all {
- switch v := interface{}(item).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, ResponseMapperValidationError{
- field: fmt.Sprintf("HeadersToAdd[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, ResponseMapperValidationError{
- field: fmt.Sprintf("HeadersToAdd[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return ResponseMapperValidationError{
- field: fmt.Sprintf("HeadersToAdd[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- }
- if len(errors) > 0 {
- return ResponseMapperMultiError(errors)
- }
- return nil
- }
- // ResponseMapperMultiError is an error wrapping multiple validation errors
- // returned by ResponseMapper.ValidateAll() if the designated constraints
- // aren't met.
- type ResponseMapperMultiError []error
- // Error returns a concatenation of all the error messages it wraps.
- func (m ResponseMapperMultiError) Error() string {
- var msgs []string
- for _, err := range m {
- msgs = append(msgs, err.Error())
- }
- return strings.Join(msgs, "; ")
- }
- // AllErrors returns a list of validation violation errors.
- func (m ResponseMapperMultiError) AllErrors() []error { return m }
- // ResponseMapperValidationError is the validation error returned by
- // ResponseMapper.Validate if the designated constraints aren't met.
- type ResponseMapperValidationError struct {
- field string
- reason string
- cause error
- key bool
- }
- // Field function returns field value.
- func (e ResponseMapperValidationError) Field() string { return e.field }
- // Reason function returns reason value.
- func (e ResponseMapperValidationError) Reason() string { return e.reason }
- // Cause function returns cause value.
- func (e ResponseMapperValidationError) Cause() error { return e.cause }
- // Key function returns key value.
- func (e ResponseMapperValidationError) Key() bool { return e.key }
- // ErrorName returns error name.
- func (e ResponseMapperValidationError) ErrorName() string { return "ResponseMapperValidationError" }
- // Error satisfies the builtin error interface
- func (e ResponseMapperValidationError) 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 %sResponseMapper.%s: %s%s",
- key,
- e.field,
- e.reason,
- cause)
- }
- var _ error = ResponseMapperValidationError{}
- var _ interface {
- Field() string
- Reason() string
- Key() bool
- Cause() error
- ErrorName() string
- } = ResponseMapperValidationError{}
- // Validate checks the field values on Rds with the rules defined in the proto
- // definition for this message. If any rules are violated, the first error
- // encountered is returned, or nil if there are no violations.
- func (m *Rds) Validate() error {
- return m.validate(false)
- }
- // ValidateAll checks the field values on Rds with the rules defined in the
- // proto definition for this message. If any rules are violated, the result is
- // a list of violation errors wrapped in RdsMultiError, or nil if none found.
- func (m *Rds) ValidateAll() error {
- return m.validate(true)
- }
- func (m *Rds) validate(all bool) error {
- if m == nil {
- return nil
- }
- var errors []error
- if m.GetConfigSource() == nil {
- err := RdsValidationError{
- field: "ConfigSource",
- reason: "value is required",
- }
- if !all {
- return err
- }
- errors = append(errors, err)
- }
- if all {
- switch v := interface{}(m.GetConfigSource()).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, RdsValidationError{
- field: "ConfigSource",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, RdsValidationError{
- field: "ConfigSource",
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(m.GetConfigSource()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return RdsValidationError{
- field: "ConfigSource",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- // no validation rules for RouteConfigName
- if len(errors) > 0 {
- return RdsMultiError(errors)
- }
- return nil
- }
- // RdsMultiError is an error wrapping multiple validation errors returned by
- // Rds.ValidateAll() if the designated constraints aren't met.
- type RdsMultiError []error
- // Error returns a concatenation of all the error messages it wraps.
- func (m RdsMultiError) Error() string {
- var msgs []string
- for _, err := range m {
- msgs = append(msgs, err.Error())
- }
- return strings.Join(msgs, "; ")
- }
- // AllErrors returns a list of validation violation errors.
- func (m RdsMultiError) AllErrors() []error { return m }
- // RdsValidationError is the validation error returned by Rds.Validate if the
- // designated constraints aren't met.
- type RdsValidationError struct {
- field string
- reason string
- cause error
- key bool
- }
- // Field function returns field value.
- func (e RdsValidationError) Field() string { return e.field }
- // Reason function returns reason value.
- func (e RdsValidationError) Reason() string { return e.reason }
- // Cause function returns cause value.
- func (e RdsValidationError) Cause() error { return e.cause }
- // Key function returns key value.
- func (e RdsValidationError) Key() bool { return e.key }
- // ErrorName returns error name.
- func (e RdsValidationError) ErrorName() string { return "RdsValidationError" }
- // Error satisfies the builtin error interface
- func (e RdsValidationError) 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 %sRds.%s: %s%s",
- key,
- e.field,
- e.reason,
- cause)
- }
- var _ error = RdsValidationError{}
- var _ interface {
- Field() string
- Reason() string
- Key() bool
- Cause() error
- ErrorName() string
- } = RdsValidationError{}
- // Validate checks the field values on ScopedRouteConfigurationsList with the
- // rules defined in the proto definition for this message. If any rules are
- // violated, the first error encountered is returned, or nil if there are no violations.
- func (m *ScopedRouteConfigurationsList) Validate() error {
- return m.validate(false)
- }
- // ValidateAll checks the field values on ScopedRouteConfigurationsList with
- // the rules defined in the proto definition for this message. If any rules
- // are violated, the result is a list of violation errors wrapped in
- // ScopedRouteConfigurationsListMultiError, or nil if none found.
- func (m *ScopedRouteConfigurationsList) ValidateAll() error {
- return m.validate(true)
- }
- func (m *ScopedRouteConfigurationsList) validate(all bool) error {
- if m == nil {
- return nil
- }
- var errors []error
- if len(m.GetScopedRouteConfigurations()) < 1 {
- err := ScopedRouteConfigurationsListValidationError{
- field: "ScopedRouteConfigurations",
- reason: "value must contain at least 1 item(s)",
- }
- if !all {
- return err
- }
- errors = append(errors, err)
- }
- for idx, item := range m.GetScopedRouteConfigurations() {
- _, _ = idx, item
- if all {
- switch v := interface{}(item).(type) {
- case interface{ ValidateAll() error }:
- if err := v.ValidateAll(); err != nil {
- errors = append(errors, ScopedRouteConfigurationsListValidationError{
- field: fmt.Sprintf("ScopedRouteConfigurations[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- case interface{ Validate() error }:
- if err := v.Validate(); err != nil {
- errors = append(errors, ScopedRouteConfigurationsListValidationError{
- field: fmt.Sprintf("ScopedRouteConfigurations[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- })
- }
- }
- } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return ScopedRouteConfigurationsListValidationError{
- field: fmt.Sprintf("ScopedRouteConfigurations[%v]", idx),
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- }
- if len(errors) > 0 {
- return ScopedRouteConfigurationsListMultiError(errors)
- }
- return nil
- }
- // ScopedRouteConfigurationsListMultiError is an error wrapping multiple
- // validation errors returned by ScopedRouteConfigurationsList.ValidateAll()
- // if the designated constraints aren't met.
- type ScopedRouteConfigurationsListMultiError []error
- // Error returns a concatenation of all the error messages it wraps.
- func (m ScopedRouteConfigurationsListMultiError) Error() string {
- var msg…