code: func (s *MetricStat) Validate() error {
  	invalidParams := request.ErrInvalidParams{Context: "MetricStat"}
  	if s.Metric == nil {
  		invalidParams.Add(request.NewErrParamRequired("Metric"))
  	}
  	if s.Period == nil {
  		invalidParams.Add(request.NewErrParamRequired("Period"))
  	}
  	if s.Period != nil && *s.Period < 1 {
  		invalidParams.Add(request.NewErrParamMinValue("Period", 1))
  	}
  	if s.Stat == nil {
  		invalidParams.Add(request.NewErrParamRequired("Stat"))
  	}
  	if s.Metric != nil {
  		if err := s.Metric.Validate(); err != nil {
  			invalidParams.AddNested("Metric", err.(request.ErrInvalidParams))
  		}
  	}
  
  	if invalidParams.Len() > 0 {
  		return invalidParams
  	}
  	return nil
  }
docs: // Validate inspects the fields of the type to determine if they are valid.