func (o *CachedFlowReport) Validate() error {

	errors := elemental.Errors{}
	requiredErrors := elemental.Errors{}

	if err := elemental.ValidateRequiredString("action", string(o.Action)); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}

	if err := elemental.ValidateStringInList("action", string(o.Action), []string{"Accept", "Reject"}, false); err != nil {
		errors = errors.Append(err)
	}

	if err := elemental.ValidateRequiredString("destinationID", o.DestinationID); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}

	if err := elemental.ValidateRequiredString("destinationType", string(o.DestinationType)); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}

	if err := elemental.ValidateStringInList("destinationType", string(o.DestinationType), []string{"ProcessingUnit", "ExternalNetwork", "Claims"}, false); err != nil {
		errors = errors.Append(err)
	}

	if err := elemental.ValidateRequiredString("namespace", o.Namespace); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}

	if err := elemental.ValidateStringInList("observedAction", string(o.ObservedAction), []string{"Accept", "Reject", "NotApplicable"}, false); err != nil {
		errors = errors.Append(err)
	}

	if err := elemental.ValidateRequiredString("policyID", o.PolicyID); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}

	if err := elemental.ValidateRequiredString("policyNamespace", o.PolicyNamespace); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}

	if err := elemental.ValidateStringInList("serviceType", string(o.ServiceType), []string{"L3", "HTTP", "TCP", "NotApplicable"}, false); err != nil {
		errors = errors.Append(err)
	}

	if err := elemental.ValidateRequiredString("sourceID", o.SourceID); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}

	if err := elemental.ValidateRequiredString("sourceType", string(o.SourceType)); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}

	if err := elemental.ValidateStringInList("sourceType", string(o.SourceType), []string{"ProcessingUnit", "ExternalNetwork", "Claims"}, false); err != nil {
		errors = errors.Append(err)
	}

	if err := elemental.ValidateRequiredInt("value", o.Value); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}

	// Custom object validation.
	if err := ValidateCachedFlowReport(o); 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.
// Validate valides the current information stored into the structure .
func (o *CachedFlowReport) Validate() error {
	errors := elemental.Errors{}
	requiredErrors := elemental.Errors{}
	if err := elemental.ValidateRequiredString("action", string(o.Action)); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}
	if err := elemental.ValidateStringInList("action", string(o.Action), []string{"Accept", "Reject"}, false); err != nil {
		errors = errors.Append(err)
	}
	if err := elemental.ValidateRequiredString("destinationID", o.DestinationID); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}
	if err := elemental.ValidateRequiredString("destinationType", string(o.DestinationType)); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}
	if err := elemental.ValidateStringInList("destinationType", string(o.DestinationType), []string{"ProcessingUnit", "ExternalNetwork", "Claims"}, false); err != nil {
		errors = errors.Append(err)
	}
	if err := elemental.ValidateRequiredString("namespace", o.Namespace); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}
	if err := elemental.ValidateStringInList("observedAction", string(o.ObservedAction), []string{"Accept", "Reject", "NotApplicable"}, false); err != nil {
		errors = errors.Append(err)
	}
	if err := elemental.ValidateRequiredString("policyID", o.PolicyID); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}
	if err := elemental.ValidateRequiredString("policyNamespace", o.PolicyNamespace); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}
	if err := elemental.ValidateStringInList("serviceType", string(o.ServiceType), []string{"L3", "HTTP", "TCP", "NotApplicable"}, false); err != nil {
		errors = errors.Append(err)
	}
	if err := elemental.ValidateRequiredString("sourceID", o.SourceID); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}
	if err := elemental.ValidateRequiredString("sourceType", string(o.SourceType)); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}
	if err := elemental.ValidateStringInList("sourceType", string(o.SourceType), []string{"ProcessingUnit", "ExternalNetwork", "Claims"}, false); err != nil {
		errors = errors.Append(err)
	}
	if err := elemental.ValidateRequiredInt("value", o.Value); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}
	if err := ValidateCachedFlowReport(o); err != nil {
		errors = errors.Append(err)
	}
	if len(requiredErrors) > 0 {
		return requiredErrors
	}
	if len(errors) > 0 {
		return errors
	}
	return nil
}
func ( o * CachedFlowReport ) Validate ( ) error { errors := elemental . Errors { } requiredErrors := elemental . Errors { } if err := elemental . ValidateRequiredString ( " " , string ( o . Action ) ) ; err != nil { requiredErrors = requiredErrors . Append ( err ) } if err := elemental . ValidateStringInList ( " " , string ( o . Action ) , [ ] string { " " , " " } , false ) ; err != nil { errors = errors . Append ( err ) } if err := elemental . ValidateRequiredString ( " " , o . DestinationID ) ; err != nil { requiredErrors = requiredErrors . Append ( err ) } if err := elemental . ValidateRequiredString ( " " , string ( o . DestinationType ) ) ; err != nil { requiredErrors = requiredErrors . Append ( err ) } if err := elemental . ValidateStringInList ( " " , string ( o . DestinationType ) , [ ] string { " " , " " , " " } , false ) ; err != nil { errors = errors . Append ( err ) } if err := elemental . ValidateRequiredString ( " " , o . Namespace ) ; err != nil { requiredErrors = requiredErrors . Append ( err ) } if err := elemental . ValidateStringInList ( " " , string ( o . ObservedAction ) , [ ] string { " " , " " , " " } , false ) ; err != nil { errors = errors . Append ( err ) } if err := elemental . ValidateRequiredString ( " " , o . PolicyID ) ; err != nil { requiredErrors = requiredErrors . Append ( err ) } if err := elemental . ValidateRequiredString ( " " , o . PolicyNamespace ) ; err != nil { requiredErrors = requiredErrors . Append ( err ) } if err := elemental . ValidateStringInList ( " " , string ( o . ServiceType ) , [ ] string { " " , " " , " " , " " } , false ) ; err != nil { errors = errors . Append ( err ) } if err := elemental . ValidateRequiredString ( " " , o . SourceID ) ; err != nil { requiredErrors = requiredErrors . Append ( err ) } if err := elemental . ValidateRequiredString ( " " , string ( o . SourceType ) ) ; err != nil { requiredErrors = requiredErrors . Append ( err ) } if err := elemental . ValidateStringInList ( " " , string ( o . SourceType ) , [ ] string { " " , " " , " " } , false ) ; err != nil { errors = errors . Append ( err ) } if err := elemental . ValidateRequiredInt ( " " , o . Value ) ; err != nil { requiredErrors = requiredErrors . Append ( err ) } if err := ValidateCachedFlowReport ( o ) ; 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 .
// Custom object validation.