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

	{
		tmp := m.GetServerUri()

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

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

	// no validation rules for PathPrefix

	{
		tmp := m.GetAuthorizationRequest()

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

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

	{
		tmp := m.GetAuthorizationResponse()

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

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

	return nil
}
64125
func (s *ExistsService) Validate() error {
	var invalid []string
	if s.id == "" {
		invalid = append(invalid, "Id")
	}
	if s.index == "" {
		invalid = append(invalid, "Index")
	}
	if s.typ == "" {
		invalid = append(invalid, "Type")
	}
	if len(invalid) > 0 {
		return fmt.Errorf("missing required fields: %v", invalid)
	}
	return nil
}
232583
func (m *QueryParameterMatcher) Validate() error {
	if m == nil {
		return nil
	}

	if l := len(m.GetName()); l < 1 || l > 1024 {
		return QueryParameterMatcherValidationError{
			field:  "Name",
			reason: "value length must be between 1 and 1024 bytes, inclusive",
		}
	}

	// no validation rules for Value

	{
		tmp := m.GetRegex()

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

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

	return nil
}
1043783
func (v *StringRule) Validate(value interface{}) error {
	value, isNil := Indirect(value)
	if isNil || IsEmpty(value) {
		return nil
	}

	str, err := EnsureString(value)
	if err != nil {
		return err
	}

	if v.validate(str) {
		return nil
	}
	return errors.New(v.message)
}
41999
func (m *BufferSettings) Validate() error {
	if m == nil {
		return nil
	}

	if m.GetMaxRequestBytes() <= 0 {
		return BufferSettingsValidationError{
			field:  "MaxRequestBytes",
			reason: "value must be greater than 0",
		}
	}

	// no validation rules for AllowPartialMessage

	return nil
}
694556
func (e ErrorList) Validate(r *http.Request, response bool) *Error {
	for _, err := range e {
		validationErr := err.Validate(r, response)
		if validationErr != nil {
			return validationErr
		}
	}

	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
}
1023696
func (s *Service) Validate() error {
	if err := s.Service.Validate(renderer); err != nil {
		return errors.Trace(err)
	}

	if s.Service.Conf.Transient {
		if len(s.Service.Conf.Env) > 0 {
			return errors.NotSupportedf("Conf.Env (when transient)")
		}
		if len(s.Service.Conf.Limit) > 0 {
			return errors.NotSupportedf("Conf.Limit (when transient)")
		}
		if s.Service.Conf.Logfile != "" {
			return errors.NotSupportedf("Conf.Logfile (when transient)")
		}
		if s.Service.Conf.ExtraScript != "" {
			return errors.NotSupportedf("Conf.ExtraScript (when transient)")
		}
	} else {
		if s.Service.Conf.AfterStopped != "" {
			return errors.NotSupportedf("Conf.AfterStopped (when not transient)")
		}
		if s.Service.Conf.ExecStopPost != "" {
			return errors.NotSupportedf("Conf.ExecStopPost (when not transient)")
		}
	}

	return nil
}
713041
func (v *PutBucketCORSInput) Validate() error {

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

	if len(v.CORSRules) > 0 {
		for _, property := range v.CORSRules {
			if err := property.Validate(); err != nil {
				return err
			}
		}
	}

	return nil
}
721311
func (fv FormValidator) Validate(req *http.Request, s interface{}) error {
	fieldErrs := make(map[string][]error)

	if err := decodeRequest(req, s); err != nil {
		return err
	}

	v := getValue(s)

	for i := 0; i < v.NumField(); i++ {
		tag := string(v.Type().Field(i).Tag.Get("schema"))
		fieldVal := getValue(v.Field(i).Interface())

		if tag == "" {
			log.Debug("field missing schema tag", log.Data{"field": v.Type().Field(i).Name})
			continue
		}

		for _, fld := range fv.flds {
			if fld.ID == tag {
				for _, rule := range fld.Rules {
					fn, ok := RulesList[rule.Name]
					if !ok {
						return fmt.Errorf("rule name: %s, missing corresponding validation function", rule.Name)
					}

					if err := fn(fieldVal.Interface(), rule.Value); err != nil {
						if _, ok := err.(FieldValidationErr); !ok {
							return err
						}
						fieldErrs[tag] = append(fieldErrs[tag], err)
					}
				}
			}
		}
	}

	if len(fieldErrs) > 0 {
		return ErrFormValidationFailed{fieldErrs}
	}

	return nil
}
70328
func (m *Body) Validate() error {
	if m == nil {
		return nil
	}

	// no validation rules for Truncated

	switch m.BodyType.(type) {

	case *Body_AsBytes:
		// no validation rules for AsBytes

	case *Body_AsString:
		// no validation rules for AsString

	}

	return nil
}
441447
func (m *HTTPAccessLogEntry) Validate() error {
	if m == nil {
		return nil
	}

	{
		tmp := m.GetCommonProperties()

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

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

	// no validation rules for ProtocolVersion

	{
		tmp := m.GetRequest()

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

			if err := v.Validate(); err != nil {
				return HTTPAccessLogEntryValidationError{
					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 HTTPAccessLogEntryValidationError{
					field:  "Response",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	return nil
}
950661
func (m *Buffer) Validate() error {
	if m == nil {
		return nil
	}

	if wrapper := m.GetMaxRequestBytes(); wrapper != nil {

		if wrapper.GetValue() <= 0 {
			return BufferValidationError{
				field:  "MaxRequestBytes",
				reason: "value must be greater than 0",
			}
		}

	}

	return nil
}
1285250
func (m *ServiceSpec) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
1128547
func (s *SnapshotDeleteService) Validate() error {
	var invalid []string
	if s.repository == "" {
		invalid = append(invalid, "Repository")
	}
	if s.snapshot == "" {
		invalid = append(invalid, "Snapshot")
	}
	if len(invalid) > 0 {
		return fmt.Errorf("missing required fields: %v", invalid)
	}
	return nil
}
550748
func (i UpdateWAFRuleTagStatusInput) validate() error {
	if i.Tag == "" {
		return ErrMissingTag
	}
	if i.Service == "" {
		return ErrMissingService
	}
	if i.WAF == "" {
		return ErrMissingWAFID
	}
	if i.Status == "" {
		return ErrMissingStatus
	}
	return nil
}
17798
func (a *Authenticator) Validate(context.Context, *http.Request) (oauth2.Principal, error) {
	return a.Principal, a.ValidateErr
}