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

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

	switch m.ConfigType.(type) {

	case *HttpFilter_Config:

		{
			tmp := m.GetConfig()

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

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

	case *HttpFilter_TypedConfig:

		{
			tmp := m.GetTypedConfig()

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

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

	}

	return nil
}
843061
func (m *HttpGrpcAccessLogConfig) Validate() error {
	if m == nil {
		return nil
	}

	if m.GetCommonConfig() == nil {
		return HttpGrpcAccessLogConfigValidationError{
			field:  "CommonConfig",
			reason: "value is required",
		}
	}

	{
		tmp := m.GetCommonConfig()

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

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

	return nil
}
568989
func (filters Args) Validate(accepted map[string]bool) error {
	for name := range filters.fields {
		if !accepted[name] {
			return fmt.Errorf("Invalid filter '%s'", name)
		}
	}
	return nil
}
970472
func (a *Application) Validate(validator ApplicationValidator) *Application {
	a.validator = validator
	return a
}
1335299
func (m *CsrfPolicy) Validate() error {
	if m == nil {
		return nil
	}

	if m.GetFilterEnabled() == nil {
		return CsrfPolicyValidationError{
			field:  "FilterEnabled",
			reason: "value is required",
		}
	}

	{
		tmp := m.GetFilterEnabled()

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

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

	{
		tmp := m.GetShadowEnabled()

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

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

	return nil
}
64478
func (m *Route) Validate() error {
	if m == nil {
		return nil
	}

	{
		tmp := m.GetMatch()

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

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

	{
		tmp := m.GetMetadata()

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

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

	{
		tmp := m.GetDecorator()

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

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

	// no validation rules for PerFilterConfig

	// no validation rules for TypedPerFilterConfig

	if len(m.GetRequestHeadersToAdd()) > 1000 {
		return RouteValidationError{
			field:  "RequestHeadersToAdd",
			reason: "value must contain no more than 1000 item(s)",
		}
	}

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

		{
			tmp := item

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

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

	}

	if len(m.GetResponseHeadersToAdd()) > 1000 {
		return RouteValidationError{
			field:  "ResponseHeadersToAdd",
			reason: "value must contain no more than 1000 item(s)",
		}
	}

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

		{
			tmp := item

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

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

	}

	switch m.Action.(type) {

	case *Route_Route:

		{
			tmp := m.GetRoute()

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

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

	case *Route_Redirect:

		{
			tmp := m.GetRedirect()

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

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

	case *Route_DirectResponse:

		{
			tmp := m.GetDirectResponse()

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

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

	default:
		return RouteValidationError{
			field:  "Action",
			reason: "value is required",
		}

	}

	return nil
}
232820
func Validate(validators ...Validatable) error {
	for i := range validators {
		if err := validators[i](); err != nil {
			return err
		}
	}
	return nil
}
742525
func (m *Matcher) Validate() error {
	if !m.Name.IsValid() {
		return fmt.Errorf("invalid name %q", m.Name)
	}
	if m.IsRegex {
		if _, err := regexp.Compile(m.Value); err != nil {
			return fmt.Errorf("invalid regular expression %q", m.Value)
		}
	} else if !LabelValue(m.Value).IsValid() || len(m.Value) == 0 {
		return fmt.Errorf("invalid value %q", m.Value)
	}
	return nil
}
524000
func (m *GrpcProtocolOptions) Validate() error {
	if m == nil {
		return nil
	}

	{
		tmp := m.GetHttp2ProtocolOptions()

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

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

	return nil
}
1078231
func (m *DeniedHttpResponse) Validate() error {
	if m == nil {
		return nil
	}

	if m.GetStatus() == nil {
		return DeniedHttpResponseValidationError{
			field:  "Status",
			reason: "value is required",
		}
	}

	{
		tmp := m.GetStatus()

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

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

	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 DeniedHttpResponseValidationError{
						field:  fmt.Sprintf("Headers[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	}

	// no validation rules for Body

	return nil
}
20334
func (v *requiredRule) Validate(value interface{}) error {
	value, isNil := Indirect(value)
	if v.skipNil && !isNil && IsEmpty(value) || !v.skipNil && (isNil || IsEmpty(value)) {
		return errors.New(v.message)
	}
	return nil
}
352748
func (m *Client) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateCreatedAt(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateGrantTypes(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateResponseTypes(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateScope(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateUpdatedAt(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateJwks(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
861305
func (m *Filter) Validate() error {
	if m == nil {
		return nil
	}

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

	switch m.ConfigType.(type) {

	case *Filter_Config:

		{
			tmp := m.GetConfig()

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

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

	case *Filter_TypedConfig:

		{
			tmp := m.GetTypedConfig()

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

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

	}

	return nil
}
38239
func (v *FilterType) Validate() error {

	if v.Prefix == nil {
		return errors.ParameterRequiredError{
			ParameterName: "Prefix",
			ParentName:    "Filter",
		}
	}

	return nil
}
327475
func (e *RequiredValidator) Validate(s interface{}) error {
	if e.TagName == "" {
		e.TagName = "required"
	}

	if e.TagValue == "" {
		e.TagValue = "true"
	}

	for _, field := range structs.Fields(s) {
		if err := e.processField("", field); err != nil {
			return err
		}
	}

	return nil
}
1205967
func Validate(pattern string) (matcher *regexp.Regexp, err error) {
	pattern = strings.TrimSpace(pattern)
	pattern = strings.ToLower(pattern)

	// error check
	if strings.ContainsAny(pattern, "[]+{},") {
		return nil, errors.New(`Only alphanumeric ASCII characters, the hyphen "-", "." and "*" are allowed in a matchPattern`)
	}

	return regexp.Compile(ToRegexp(pattern))
}
556336
func (c Code) Validate(_ interface{}) error {
	if codeRegex.Match([]byte(c)) {
		return nil
	}

	return errInvalidCode
}