func (s *StatelessRule) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "StatelessRule"}
	if s.Priority == nil {
		invalidParams.Add(request.NewErrParamRequired("Priority"))
	}
	if s.Priority != nil && *s.Priority < 1 {
		invalidParams.Add(request.NewErrParamMinValue("Priority", 1))
	}
	if s.RuleDefinition == nil {
		invalidParams.Add(request.NewErrParamRequired("RuleDefinition"))
	}
	if s.RuleDefinition != nil {
		if err := s.RuleDefinition.Validate(); err != nil {
			invalidParams.AddNested("RuleDefinition", err.(request.ErrInvalidParams))
		}
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
// Validate inspects the fields of the type to determine if they are valid.
Validate inspects the fields of the type to determine if they are valid.
// Validate inspects the fields of the type to determine if they are valid .
func (s *StatelessRule) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "StatelessRule"}
	if s.Priority == nil {
		invalidParams.Add(request.NewErrParamRequired("Priority"))
	}
	if s.Priority != nil && *s.Priority < 1 {
		invalidParams.Add(request.NewErrParamMinValue("Priority", 1))
	}
	if s.RuleDefinition == nil {
		invalidParams.Add(request.NewErrParamRequired("RuleDefinition"))
	}
	if s.RuleDefinition != nil {
		if err := s.RuleDefinition.Validate(); err != nil {
			invalidParams.AddNested("RuleDefinition", err.(request.ErrInvalidParams))
		}
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
func ( s * StatelessRule ) Validate ( ) error { invalidParams := request . ErrInvalidParams { Context : " " } if s . Priority == nil { invalidParams . Add ( request . NewErrParamRequired ( " " ) ) } if s . Priority != nil && * s . Priority < 1 { invalidParams . Add ( request . NewErrParamMinValue ( " " , 1 ) ) } if s . RuleDefinition == nil { invalidParams . Add ( request . NewErrParamRequired ( " " ) ) } if s . RuleDefinition != nil { if err := s . RuleDefinition . Validate ( ) ; err != nil { invalidParams . AddNested ( " " , err . ( request . ErrInvalidParams ) ) } } if invalidParams . Len ( ) > 0 { return invalidParams } return nil }
Validate inspects the fields of the type to determine if they are valid.
Validate inspects the fields of the type to determine if they are valid .