// Validate valides the current information stored into the structure.
Validate valides the current information stored into the structure.
// Validate valides the current information stored into the structure .
func (o *StatsQuery) Validate() error {
	errors := elemental.Errors{}
	requiredErrors := elemental.Errors{}
	if err := elemental.ValidateStringInList("measurement", string(o.Measurement), []string{"Flows", "Audit", "Enforcers", "Files", "EventLogs", "Packets", "EnforcerTraces", "Counters", "Accesses", "DNSLookups", "PingReports", "ConnectionExceptions"}, false); err != nil {
		errors = errors.Append(err)
	}
	for _, sub := range o.Results {
		if sub == nil {
			continue
		}
		elemental.ResetDefaultForZeroValues(sub)
		if err := sub.Validate(); err != nil {
			errors = errors.Append(err)
		}
	}
	if len(requiredErrors) > 0 {
		return requiredErrors
	}
	if len(errors) > 0 {
		return errors
	}
	return nil
}
func ( o * StatsQuery ) Validate ( ) error { errors := elemental . Errors { } requiredErrors := elemental . Errors { } if err := elemental . ValidateStringInList ( " " , string ( o . Measurement ) , [ ] string { " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " } , false ) ; err != nil { errors = errors . Append ( err ) } for _ , sub := range o . Results { if sub == nil { continue } elemental . ResetDefaultForZeroValues ( sub ) if err := sub . Validate ( ) ; err != nil { errors = errors . Append ( err ) } } if len ( requiredErrors ) > 0 { return requiredErrors } if len ( errors ) > 0 { return errors } return nil }
Validate valides the current information stored into the structure.
Validate valides the current information stored into the structure .