func (s *ClusterPendingTasksService) Do(ctx context.Context) (*ClusterPendingTasksResponse, error) {
	if err := s.Validate(); err != nil {
		return nil, err
	}
	path, params, err := s.buildURL()
	if err != nil {
		return nil, err
	}
	res, err := s.client.PerformRequest(ctx, PerformRequestOptions{
		Method: "GET",
		Path:   path,
		Params: params,
	})
	if err != nil {
		return nil, err
	}
	ret := new(ClusterPendingTasksResponse)
	if err := s.client.decoder.Decode(res.Body, ret); err != nil {
		return nil, err
	}
	return ret, nil
}
Do executes the operation.
package elastic
import (
	"context"
	"fmt"
	"net/url"
	"github.com/olivere/elastic/uritemplates"
)
type ClusterPendingTasksService struct {
	client       *Client
	pretty       bool
	flatSettings *bool
	human        *bool
}
func NewClusterPendingTasksService(client *Client) *ClusterPendingTasksService {
	return &ClusterPendingTasksService{
		client: client,
	}
}
func (s *ClusterPendingTasksService) FlatSettings(flatSettings bool) *ClusterPendingTasksService {
	s.flatSettings = &flatSettings
	return s
}
func (s *ClusterPendingTasksService) Human(human bool) *ClusterPendingTasksService {
	s.human = &human
	return s
}
func (s *ClusterPendingTasksService) Pretty(pretty bool) *ClusterPendingTasksService {
	s.pretty = pretty
	return s
}
func (s *ClusterPendingTasksService) buildURL() (string, url.Values, error) {
	var err error
	var path string
	path, err = uritemplates.Expand("/_cluster/pending_tasks", map[string]string{})
	if err != nil {
		return "", url.Values{}, err
	}
	params := url.Values{}
	if s.pretty {
		params.Set("pretty", "true")
	}
	if s.flatSettings != nil {
		params.Set("flat_settings", fmt.Sprintf("%v", *s.flatSettings))
	}
	if s.human != nil {
		params.Set("human", fmt.Sprintf("%v", *s.human))
	}
	return path, params, nil
}
func (s *ClusterPendingTasksService) Validate() error {
	return nil
}