// 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 *SendBulkTemplatedEmailInput) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "SendBulkTemplatedEmailInput"}
	if s.Destinations == nil {
		invalidParams.Add(request.NewErrParamRequired("Destinations"))
	}
	if s.Source == nil {
		invalidParams.Add(request.NewErrParamRequired("Source"))
	}
	if s.Template == nil {
		invalidParams.Add(request.NewErrParamRequired("Template"))
	}
	if s.DefaultTags != nil {
		for i, v := range s.DefaultTags {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DefaultTags", i), err.(request.ErrInvalidParams))
			}
		}
	}
	if s.Destinations != nil {
		for i, v := range s.Destinations {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Destinations", i), err.(request.ErrInvalidParams))
			}
		}
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
func ( s * SendBulkTemplatedEmailInput ) Validate ( ) error { invalidParams := request . ErrInvalidParams { Context : " " } if s . Destinations == nil { invalidParams . Add ( request . NewErrParamRequired ( " " ) ) } if s . Source == nil { invalidParams . Add ( request . NewErrParamRequired ( " " ) ) } if s . Template == nil { invalidParams . Add ( request . NewErrParamRequired ( " " ) ) } if s . DefaultTags != nil { for i , v := range s . DefaultTags { if v == nil { continue } if err := v . Validate ( ) ; err != nil { invalidParams . AddNested ( fmt . Sprintf ( " " , " " , i ) , err . ( request . ErrInvalidParams ) ) } } } if s . Destinations != nil { for i , v := range s . Destinations { 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 .