code: func (s *MetricDataQuery) Validate() error {
  	invalidParams := request.ErrInvalidParams{Context: "MetricDataQuery"}
  	if s.Expression != nil && len(*s.Expression) < 1 {
  		invalidParams.Add(request.NewErrParamMinLen("Expression", 1))
  	}
  	if s.Id == nil {
  		invalidParams.Add(request.NewErrParamRequired("Id"))
  	}
  	if s.Id != nil && len(*s.Id) < 1 {
  		invalidParams.Add(request.NewErrParamMinLen("Id", 1))
  	}
  	if s.MetricStat != nil {
  		if err := s.MetricStat.Validate(); err != nil {
  			invalidParams.AddNested("MetricStat", 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.