// Validate checks the field values on
// HttpConnectionManager_SetCurrentClientCertDetails with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
979354
func (m *HttpConnectionManager_SetCurrentClientCertDetails) Validate() error {
	if m == nil {
		return nil
	}

	{
		tmp := m.GetSubject()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return HttpConnectionManager_SetCurrentClientCertDetailsValidationError{
					field:  "Subject",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	// no validation rules for Cert

	// no validation rules for Dns

	// no validation rules for Uri

	return nil
}
638746
func (e *Error) Validate(r *http.Request, response bool) *Error {

	switch {
	case e.Status == 0:
		return ISE(fmt.Sprintf("No HTTP Status set for error %+v\n", e))
	case e.Status < 400 || e.Status > 600:
		return ISE(fmt.Sprintf("HTTP Status out of valid range for error %+v\n", e))
	case e.Status == 422 && e.Source.Pointer == "":
		return ISE(fmt.Sprintf("Source Pointer must be set for 422 Status error"))
	}

	return nil
}
127411
func (m *HttpStatus) Validate() error {
	if m == nil {
		return nil
	}

	if _, ok := StatusCode_name[int32(m.GetCode())]; !ok {
		return HttpStatusValidationError{
			field:  "Code",
			reason: "value must be one of the defined enum values",
		}
	}

	return nil
}
1348182
func (m *TraceServiceConfig) Validate() error {
	if m == nil {
		return nil
	}

	if m.GetGrpcService() == nil {
		return TraceServiceConfigValidationError{
			field:  "GrpcService",
			reason: "value is required",
		}
	}

	{
		tmp := m.GetGrpcService()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return TraceServiceConfigValidationError{
					field:  "GrpcService",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	return nil
}
1079006
func (m *HTTPFault) Validate() error {
	if m == nil {
		return nil
	}

	{
		tmp := m.GetDelay()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return HTTPFaultValidationError{
					field:  "Delay",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	{
		tmp := m.GetAbort()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return HTTPFaultValidationError{
					field:  "Abort",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	// no validation rules for UpstreamCluster

	for idx, item := range m.GetHeaders() {
		_, _ = idx, item

		{
			tmp := item

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return HTTPFaultValidationError{
						field:  fmt.Sprintf("Headers[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	}

	{
		tmp := m.GetMaxActiveFaults()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return HTTPFaultValidationError{
					field:  "MaxActiveFaults",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	{
		tmp := m.GetResponseRateLimit()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return HTTPFaultValidationError{
					field:  "ResponseRateLimit",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	return nil
}
72162
func (m *SocketStreamedTraceSegment) Validate() error {
	if m == nil {
		return nil
	}

	// no validation rules for TraceId

	switch m.MessagePiece.(type) {

	case *SocketStreamedTraceSegment_Connection:

		{
			tmp := m.GetConnection()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return SocketStreamedTraceSegmentValidationError{
						field:  "Connection",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	case *SocketStreamedTraceSegment_Event:

		{
			tmp := m.GetEvent()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return SocketStreamedTraceSegmentValidationError{
						field:  "Event",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	}

	return nil
}
255384
func (c *MockSSHClient) Validate() error {
	if c.MockValidate != nil {
		return c.MockValidate()
	}
	return ErrNotImplemented
}
1075565
func (m *HTTPRequestProperties) Validate() error {
	if m == nil {
		return nil
	}

	// no validation rules for RequestMethod

	// no validation rules for Scheme

	// no validation rules for Authority

	{
		tmp := m.GetPort()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return HTTPRequestPropertiesValidationError{
					field:  "Port",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	// no validation rules for Path

	// no validation rules for UserAgent

	// no validation rules for Referer

	// no validation rules for ForwardedFor

	// no validation rules for RequestId

	// no validation rules for OriginalPath

	// no validation rules for RequestHeadersBytes

	// no validation rules for RequestBodyBytes

	// no validation rules for RequestHeaders

	return nil
}
1347508
func (m *HttpBufferedTrace) Validate() error {
	if m == nil {
		return nil
	}

	{
		tmp := m.GetRequest()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return HttpBufferedTraceValidationError{
					field:  "Request",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	{
		tmp := m.GetResponse()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return HttpBufferedTraceValidationError{
					field:  "Response",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	return nil
}
267036
func (m *TransportSocket) Validate() error {
	if m == nil {
		return nil
	}

	if len(m.GetName()) < 1 {
		return TransportSocketValidationError{
			field:  "Name",
			reason: "value length must be at least 1 bytes",
		}
	}

	switch m.ConfigType.(type) {

	case *TransportSocket_Config:

		{
			tmp := m.GetConfig()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return TransportSocketValidationError{
						field:  "Config",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	case *TransportSocket_TypedConfig:

		{
			tmp := m.GetTypedConfig()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return TransportSocketValidationError{
						field:  "TypedConfig",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	}

	return nil
}
165097
func (v *CORSRuleType) Validate() error {

	if len(v.AllowedMethods) == 0 {
		return errors.ParameterRequiredError{
			ParameterName: "AllowedMethods",
			ParentName:    "CORSRule",
		}
	}

	if v.AllowedOrigin == nil {
		return errors.ParameterRequiredError{
			ParameterName: "AllowedOrigin",
			ParentName:    "CORSRule",
		}
	}

	return nil
}
611304
func Validate(req interface{}) error {
	// validate req message
	if err := v.Struct(req); err != nil {
		if v, ok := err.(validator.ValidationErrors); ok {
			err = v
		}
		return status.Errorf(codes.InvalidArgument, "Request validation failed: %s", err)
	}
	return nil
}
38198
func (m *CertificateDetails) Validate() error {
	if m == nil {
		return nil
	}

	// no validation rules for Path

	// no validation rules for SerialNumber

	for idx, item := range m.GetSubjectAltNames() {
		_, _ = idx, item

		{
			tmp := item

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return CertificateDetailsValidationError{
						field:  fmt.Sprintf("SubjectAltNames[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	}

	// no validation rules for DaysUntilExpiration

	{
		tmp := m.GetValidFrom()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return CertificateDetailsValidationError{
					field:  "ValidFrom",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	{
		tmp := m.GetExpirationTime()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return CertificateDetailsValidationError{
					field:  "ExpirationTime",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	return nil
}
11003
func (client *SSHClient) Validate() error {
	if client.Creds.SSHUser == "" {
		return ErrInvalidUsername
	}

	if client.Creds.SSHPrivateKey == "" && client.Creds.SSHPassword == "" {
		return ErrInvalidAuth
	}

	return nil
}
193847
func (m *HTTPResponseProperties) Validate() error {
	if m == nil {
		return nil
	}

	{
		tmp := m.GetResponseCode()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return HTTPResponsePropertiesValidationError{
					field:  "ResponseCode",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	// no validation rules for ResponseHeadersBytes

	// no validation rules for ResponseBodyBytes

	// no validation rules for ResponseHeaders

	// no validation rules for ResponseTrailers

	// no validation rules for ResponseCodeDetails

	return nil
}
1260675
func (m *GrpcJsonTranscoder) Validate() error {
	if m == nil {
		return nil
	}

	if len(m.GetServices()) < 1 {
		return GrpcJsonTranscoderValidationError{
			field:  "Services",
			reason: "value must contain at least 1 item(s)",
		}
	}

	{
		tmp := m.GetPrintOptions()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return GrpcJsonTranscoderValidationError{
					field:  "PrintOptions",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	// no validation rules for MatchIncomingRequestRoute

	switch m.DescriptorSet.(type) {

	case *GrpcJsonTranscoder_ProtoDescriptor:
		// no validation rules for ProtoDescriptor

	case *GrpcJsonTranscoder_ProtoDescriptorBin:
		// no validation rules for ProtoDescriptorBin

	default:
		return GrpcJsonTranscoderValidationError{
			field:  "DescriptorSet",
			reason: "value is required",
		}

	}

	return nil
}
693906
func (v *Validator) Validate(h http.Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		if err := v.ValidRequest(r); err != nil {
			http.Error(w, "", http.StatusUnauthorized)
			return
		}
		h.ServeHTTP(w, r)
	})
}