func (s *TasksListService) buildURL() (string, url.Values, error) {
	var err error
	var path string
	if len(s.taskId) > 0 {
		var tasks []string
		for _, taskId := range s.taskId {
			tasks = append(tasks, fmt.Sprintf("%d", taskId))
		}
		path, err = uritemplates.Expand("/_tasks/{task_id}", map[string]string{
			"task_id": strings.Join(tasks, ","),
		})
	} else {
		path = "/_tasks"
	}
	if err != nil {
		return "", url.Values{}, err
	}
	params := url.Values{}
	if s.pretty {
		params.Set("pretty", "1")
	}
	if len(s.actions) > 0 {
		params.Set("actions", strings.Join(s.actions, ","))
	}
	if s.detailed != nil {
		params.Set("detailed", fmt.Sprintf("%v", *s.detailed))
	}
	if len(s.nodeId) > 0 {
		params.Set("node_id", strings.Join(s.nodeId, ","))
	}
	if s.parentNode != "" {
		params.Set("parent_node", s.parentNode)
	}
	if s.parentTask != nil {
		params.Set("parent_task", fmt.Sprintf("%v", *s.parentTask))
	}
	if s.waitForCompletion != nil {
		params.Set("wait_for_completion", fmt.Sprintf("%v", *s.waitForCompletion))
	}
	return path, params, nil
}
buildURL builds the URL for the operation.
package elastic
import (
	"fmt"
	"net/url"
	"strings"
	"gopkg.in/olivere/elastic.v3/uritemplates"
)
type TasksListService struct {
	client            *Client
	pretty            bool
	taskId            []int64
	actions           []string
	detailed          *bool
	nodeId            []string
	parentNode        string
	parentTask        *int64
	waitForCompletion *bool
}
func NewTasksListService(client *Client) *TasksListService {
	return &TasksListService{
		client:  client,
		taskId:  make([]int64, 0),
		actions: make([]string, 0),
		nodeId:  make([]string, 0),
	}
}
func (s *TasksListService) TaskId(taskId ...int64) *TasksListService {
	s.taskId = append(s.taskId, taskId...)
	return s
}
func (s *TasksListService) Actions(actions ...string) *TasksListService {
	s.actions = append(s.actions, actions...)
	return s
}
func (s *TasksListService) Detailed(detailed bool) *TasksListService {
	s.detailed = &detailed
	return s
}
func (s *TasksListService) NodeId(nodeId ...string) *TasksListService {
	s.nodeId = append(s.nodeId, nodeId...)
	return s
}
func (s *TasksListService) ParentNode(parentNode string) *TasksListService {
	s.parentNode = parentNode
	return s
}
func (s *TasksListService) ParentTask(parentTask int64) *TasksListService {
	s.parentTask = &parentTask
	return s
}
func (s *TasksListService) WaitForCompletion(waitForCompletion bool) *TasksListService {
	s.waitForCompletion = &waitForCompletion
	return s
}
func (s *TasksListService) Pretty(pretty bool) *TasksListService {
	s.pretty = pretty
	return s
}