func (o *AutomationTemplate) Validate() error {

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

	if err := elemental.ValidateMaximumLength("description", o.Description, 1024, false); err != nil {
		errors = errors.Append(err)
	}

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

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

	if err := elemental.ValidateMaximumLength("name", o.Name, 256, false); err != nil {
		errors = errors.Append(err)
	}

	for _, sub := range o.Steps {
		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.
// Validate valides the current information stored into the structure .
func (o *AutomationTemplate) Validate() error {
	errors := elemental.Errors{}
	requiredErrors := elemental.Errors{}
	if err := elemental.ValidateMaximumLength("description", o.Description, 1024, false); err != nil {
		errors = errors.Append(err)
	}
	if err := elemental.ValidateStringInList("kind", string(o.Kind), []string{"Action", "Condition"}, false); err != nil {
		errors = errors.Append(err)
	}
	if err := elemental.ValidateRequiredString("name", o.Name); err != nil {
		requiredErrors = requiredErrors.Append(err)
	}
	if err := elemental.ValidateMaximumLength("name", o.Name, 256, false); err != nil {
		errors = errors.Append(err)
	}
	for _, sub := range o.Steps {
		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 * AutomationTemplate ) Validate ( ) error { errors := elemental . Errors { } requiredErrors := elemental . Errors { } if err := elemental . ValidateMaximumLength ( " " , o . Description , 1024 , false ) ; err != nil { errors = errors . Append ( err ) } if err := elemental . ValidateStringInList ( " " , string ( o . Kind ) , [ ] string { " " , " " } , false ) ; err != nil { errors = errors . Append ( err ) } if err := elemental . ValidateRequiredString ( " " , o . Name ) ; err != nil { requiredErrors = requiredErrors . Append ( err ) } if err := elemental . ValidateMaximumLength ( " " , o . Name , 256 , false ) ; err != nil { errors = errors . Append ( err ) } for _ , sub := range o . Steps { 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 .