func (s *FirewallPolicy) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "FirewallPolicy"}
	if s.StatelessDefaultActions == nil {
		invalidParams.Add(request.NewErrParamRequired("StatelessDefaultActions"))
	}
	if s.StatelessFragmentDefaultActions == nil {
		invalidParams.Add(request.NewErrParamRequired("StatelessFragmentDefaultActions"))
	}
	if s.StatefulRuleGroupReferences != nil {
		for i, v := range s.StatefulRuleGroupReferences {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "StatefulRuleGroupReferences", i), err.(request.ErrInvalidParams))
			}
		}
	}
	if s.StatelessCustomActions != nil {
		for i, v := range s.StatelessCustomActions {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "StatelessCustomActions", i), err.(request.ErrInvalidParams))
			}
		}
	}
	if s.StatelessRuleGroupReferences != nil {
		for i, v := range s.StatelessRuleGroupReferences {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "StatelessRuleGroupReferences", i), 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 *FirewallPolicy) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "FirewallPolicy"}
	if s.StatelessDefaultActions == nil {
		invalidParams.Add(request.NewErrParamRequired("StatelessDefaultActions"))
	}
	if s.StatelessFragmentDefaultActions == nil {
		invalidParams.Add(request.NewErrParamRequired("StatelessFragmentDefaultActions"))
	}
	if s.StatefulRuleGroupReferences != nil {
		for i, v := range s.StatefulRuleGroupReferences {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "StatefulRuleGroupReferences", i), err.(request.ErrInvalidParams))
			}
		}
	}
	if s.StatelessCustomActions != nil {
		for i, v := range s.StatelessCustomActions {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "StatelessCustomActions", i), err.(request.ErrInvalidParams))
			}
		}
	}
	if s.StatelessRuleGroupReferences != nil {
		for i, v := range s.StatelessRuleGroupReferences {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "StatelessRuleGroupReferences", i), err.(request.ErrInvalidParams))
			}
		}
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
func ( s * FirewallPolicy ) Validate ( ) error { invalidParams := request . ErrInvalidParams { Context : " " } if s . StatelessDefaultActions == nil { invalidParams . Add ( request . NewErrParamRequired ( " " ) ) } if s . StatelessFragmentDefaultActions == nil { invalidParams . Add ( request . NewErrParamRequired ( " " ) ) } if s . StatefulRuleGroupReferences != nil { for i , v := range s . StatefulRuleGroupReferences { if v == nil { continue } if err := v . Validate ( ) ; err != nil { invalidParams . AddNested ( fmt . Sprintf ( " " , " " , i ) , err . ( request . ErrInvalidParams ) ) } } } if s . StatelessCustomActions != nil { for i , v := range s . StatelessCustomActions { if v == nil { continue } if err := v . Validate ( ) ; err != nil { invalidParams . AddNested ( fmt . Sprintf ( " " , " " , i ) , err . ( request . ErrInvalidParams ) ) } } } if s . StatelessRuleGroupReferences != nil { for i , v := range s . StatelessRuleGroupReferences { if v == nil { continue } if err := v . Validate ( ) ; err != nil { invalidParams . AddNested ( fmt . Sprintf ( " " , " " , i ) , 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 .