code: func (s *MetricQuery) Validate() error {
  	invalidParams := request.ErrInvalidParams{Context: "MetricQuery"}
  	if s.Metric == nil {
  		invalidParams.Add(request.NewErrParamRequired("Metric"))
  	}
  	if s.GroupBy != nil {
  		if err := s.GroupBy.Validate(); err != nil {
  			invalidParams.AddNested("GroupBy", 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.