func (f TasksList) WithParentTaskID(v string) func(*TasksListRequest) {
	return func(r *TasksListRequest) {
		r.ParentTaskID = v
	}
}
WithParentTaskID - return tasks with specified parent task ID (node_id:task_number). set to -1 to return all..
package opensearchapi
import (
	"context"
	"net/http"
	"strconv"
	"strings"
	"time"
)
func newTasksListFunc(t Transport) TasksList {
	return func(o ...func(*TasksListRequest)) (*Response, error) {
		var r = TasksListRequest{}
		for _, f := range o {
			f(&r)
		}
		return r.Do(r.ctx, t)
	}
}
type TasksList func(o ...func(*TasksListRequest)) (*Response, error)
type TasksListRequest struct {
	Actions           []string
	Detailed          *bool
	GroupBy           string
	Nodes             []string
	ParentTaskID      string
	Timeout           time.Duration
	WaitForCompletion *bool
	Pretty     bool
	Human      bool
	ErrorTrace bool
	FilterPath []string
	Header http.Header
	ctx context.Context
}
func (r TasksListRequest) Do(ctx context.Context, transport Transport) (*Response, error) {
	var (
		method string
		path   strings.Builder
		params map[string]string
	)
	method = "GET"
	path.Grow(len("/_tasks"))
	path.WriteString("/_tasks")
	params = make(map[string]string)
	if len(r.Actions) > 0 {
		params["actions"] = strings.Join(r.Actions, ",")
	}
	if r.Detailed != nil {
		params["detailed"] = strconv.FormatBool(*r.Detailed)
	}
	if r.GroupBy != "" {
		params["group_by"] = r.GroupBy
	}
	if len(r.Nodes) > 0 {
		params["nodes"] = strings.Join(r.Nodes, ",")
	}
	if r.ParentTaskID != "" {
		params["parent_task_id"] = r.ParentTaskID
	}
	if r.Timeout != 0 {
		params["timeout"] = formatDuration(r.Timeout)
	}
	if r.WaitForCompletion != nil {
		params["wait_for_completion"] = strconv.FormatBool(*r.WaitForCompletion)
	}
	if r.Pretty {
		params["pretty"] = "true"
	}
	if r.Human {
		params["human"] = "true"
	}
	if r.ErrorTrace {
		params["error_trace"] = "true"
	}
	if len(r.FilterPath) > 0 {
		params["filter_path"] = strings.Join(r.FilterPath, ",")
	}
	req, err := newRequest(method, path.String(), nil)
	if err != nil {
		return nil, err
	}
	if len(params) > 0 {
		q := req.URL.Query()
		for k, v := range params {
			q.Set(k, v)
		}
		req.URL.RawQuery = q.Encode()
	}
	if len(r.Header) > 0 {
		if len(req.Header) == 0 {
			req.Header = r.Header
		} else {
			for k, vv := range r.Header {
				for _, v := range vv {
					req.Header.Add(k, v)
				}
			}
		}
	}
	if ctx != nil {
		req = req.WithContext(ctx)
	}
	res, err := transport.Perform(req)
	if err != nil {
		return nil, err
	}
	response := Response{
		StatusCode: res.StatusCode,
		Body:       res.Body,
		Header:     res.Header,
	}
	return &response, nil
}
func (f TasksList) WithContext(v context.Context) func(*TasksListRequest) {
	return func(r *TasksListRequest) {
		r.ctx = v
	}
}
func (f TasksList) WithActions(v ...string) func(*TasksListRequest) {
	return func(r *TasksListRequest) {
		r.Actions = v
	}
}
func (f TasksList) WithDetailed(v bool) func(*TasksListRequest) {
	return func(r *TasksListRequest) {
		r.Detailed = &v
	}
}
func (f TasksList) WithGroupBy(v string) func(*TasksListRequest) {
	return func(r *TasksListRequest) {
		r.GroupBy = v
	}
}
func (f TasksList) WithNodes(v ...string) func(*TasksListRequest) {
	return func(r *TasksListRequest) {
		r.Nodes = v
	}
}