func (f DeleteByQuery) WithTimeout(v time.Duration) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.Timeout = v
	}
}
WithTimeout - time each individual bulk request should wait for shards that are unavailable..
package opensearchapi
import (
	"context"
	"fmt"
	"io"
	"net/http"
	"strconv"
	"strings"
	"time"
)
func newDeleteByQueryFunc(t Transport) DeleteByQuery {
	return func(index []string, body io.Reader, o ...func(*DeleteByQueryRequest)) (*Response, error) {
		var r = DeleteByQueryRequest{Index: index, Body: body}
		for _, f := range o {
			f(&r)
		}
		return r.Do(r.ctx, t)
	}
}
type DeleteByQuery func(index []string, body io.Reader, o ...func(*DeleteByQueryRequest)) (*Response, error)
type DeleteByQueryRequest struct {
	Index        []string
	DocumentType []string
	Body io.Reader
	AllowNoIndices      *bool
	Analyzer            string
	AnalyzeWildcard     *bool
	Conflicts           string
	DefaultOperator     string
	Df                  string
	ExpandWildcards     string
	From                *int
	IgnoreUnavailable   *bool
	Lenient             *bool
	MaxDocs             *int
	Preference          string
	Query               string
	Refresh             *bool
	RequestCache        *bool
	RequestsPerSecond   *int
	Routing             []string
	Scroll              time.Duration
	ScrollSize          *int
	SearchTimeout       time.Duration
	SearchType          string
	Size                *int
	Slices              interface{}
	Sort                []string
	Source              []string
	SourceExcludes      []string
	SourceIncludes      []string
	Stats               []string
	TerminateAfter      *int
	Timeout             time.Duration
	Version             *bool
	WaitForActiveShards string
	WaitForCompletion   *bool
	Pretty     bool
	Human      bool
	ErrorTrace bool
	FilterPath []string
	Header http.Header
	ctx context.Context
}
func (r DeleteByQueryRequest) Do(ctx context.Context, transport Transport) (*Response, error) {
	var (
		method string
		path   strings.Builder
		params map[string]string
	)
	method = "POST"
	path.Grow(1 + len(strings.Join(r.Index, ",")) + 1 + len(strings.Join(r.DocumentType, ",")) + 1 + len("_delete_by_query"))
	path.WriteString("/")
	path.WriteString(strings.Join(r.Index, ","))
	if len(r.DocumentType) > 0 {
		path.WriteString("/")
		path.WriteString(strings.Join(r.DocumentType, ","))
	}
	path.WriteString("/")
	path.WriteString("_delete_by_query")
	params = make(map[string]string)
	if r.AllowNoIndices != nil {
		params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices)
	}
	if r.Analyzer != "" {
		params["analyzer"] = r.Analyzer
	}
	if r.AnalyzeWildcard != nil {
		params["analyze_wildcard"] = strconv.FormatBool(*r.AnalyzeWildcard)
	}
	if r.Conflicts != "" {
		params["conflicts"] = r.Conflicts
	}
	if r.DefaultOperator != "" {
		params["default_operator"] = r.DefaultOperator
	}
	if r.Df != "" {
		params["df"] = r.Df
	}
	if r.ExpandWildcards != "" {
		params["expand_wildcards"] = r.ExpandWildcards
	}
	if r.From != nil {
		params["from"] = strconv.FormatInt(int64(*r.From), 10)
	}
	if r.IgnoreUnavailable != nil {
		params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable)
	}
	if r.Lenient != nil {
		params["lenient"] = strconv.FormatBool(*r.Lenient)
	}
	if r.MaxDocs != nil {
		params["max_docs"] = strconv.FormatInt(int64(*r.MaxDocs), 10)
	}
	if r.Preference != "" {
		params["preference"] = r.Preference
	}
	if r.Query != "" {
		params["q"] = r.Query
	}
	if r.Refresh != nil {
		params["refresh"] = strconv.FormatBool(*r.Refresh)
	}
	if r.RequestCache != nil {
		params["request_cache"] = strconv.FormatBool(*r.RequestCache)
	}
	if r.RequestsPerSecond != nil {
		params["requests_per_second"] = strconv.FormatInt(int64(*r.RequestsPerSecond), 10)
	}
	if len(r.Routing) > 0 {
		params["routing"] = strings.Join(r.Routing, ",")
	}
	if r.Scroll != 0 {
		params["scroll"] = formatDuration(r.Scroll)
	}
	if r.ScrollSize != nil {
		params["scroll_size"] = strconv.FormatInt(int64(*r.ScrollSize), 10)
	}
	if r.SearchTimeout != 0 {
		params["search_timeout"] = formatDuration(r.SearchTimeout)
	}
	if r.SearchType != "" {
		params["search_type"] = r.SearchType
	}
	if r.Size != nil {
		params["size"] = strconv.FormatInt(int64(*r.Size), 10)
	}
	if r.Slices != nil {
		params["slices"] = fmt.Sprintf("%v", r.Slices)
	}
	if len(r.Sort) > 0 {
		params["sort"] = strings.Join(r.Sort, ",")
	}
	if len(r.Source) > 0 {
		params["_source"] = strings.Join(r.Source, ",")
	}
	if len(r.SourceExcludes) > 0 {
		params["_source_excludes"] = strings.Join(r.SourceExcludes, ",")
	}
	if len(r.SourceIncludes) > 0 {
		params["_source_includes"] = strings.Join(r.SourceIncludes, ",")
	}
	if len(r.Stats) > 0 {
		params["stats"] = strings.Join(r.Stats, ",")
	}
	if r.TerminateAfter != nil {
		params["terminate_after"] = strconv.FormatInt(int64(*r.TerminateAfter), 10)
	}
	if r.Timeout != 0 {
		params["timeout"] = formatDuration(r.Timeout)
	}
	if r.Version != nil {
		params["version"] = strconv.FormatBool(*r.Version)
	}
	if r.WaitForActiveShards != "" {
		params["wait_for_active_shards"] = r.WaitForActiveShards
	}
	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(), r.Body)
	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 r.Body != nil {
		req.Header[headerContentType] = headerContentTypeJSON
	}
	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 DeleteByQuery) WithContext(v context.Context) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.ctx = v
	}
}
func (f DeleteByQuery) WithDocumentType(v ...string) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.DocumentType = v
	}
}
func (f DeleteByQuery) WithAllowNoIndices(v bool) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.AllowNoIndices = &v
	}
}
func (f DeleteByQuery) WithAnalyzer(v string) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.Analyzer = v
	}
}
func (f DeleteByQuery) WithAnalyzeWildcard(v bool) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.AnalyzeWildcard = &v
	}
}
func (f DeleteByQuery) WithConflicts(v string) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.Conflicts = v
	}
}
func (f DeleteByQuery) WithDefaultOperator(v string) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.DefaultOperator = v
	}
}
func (f DeleteByQuery) WithDf(v string) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.Df = v
	}
}
func (f DeleteByQuery) WithExpandWildcards(v string) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.ExpandWildcards = v
	}
}
func (f DeleteByQuery) WithFrom(v int) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.From = &v
	}
}
func (f DeleteByQuery) WithIgnoreUnavailable(v bool) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.IgnoreUnavailable = &v
	}
}
func (f DeleteByQuery) WithLenient(v bool) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.Lenient = &v
	}
}
func (f DeleteByQuery) WithMaxDocs(v int) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.MaxDocs = &v
	}
}
func (f DeleteByQuery) WithPreference(v string) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.Preference = v
	}
}
func (f DeleteByQuery) WithQuery(v string) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.Query = v
	}
}
func (f DeleteByQuery) WithRefresh(v bool) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.Refresh = &v
	}
}
func (f DeleteByQuery) WithRequestCache(v bool) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.RequestCache = &v
	}
}
func (f DeleteByQuery) WithRequestsPerSecond(v int) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.RequestsPerSecond = &v
	}
}
func (f DeleteByQuery) WithRouting(v ...string) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.Routing = v
	}
}
func (f DeleteByQuery) WithScroll(v time.Duration) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.Scroll = v
	}
}
func (f DeleteByQuery) WithScrollSize(v int) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.ScrollSize = &v
	}
}
func (f DeleteByQuery) WithSearchTimeout(v time.Duration) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.SearchTimeout = v
	}
}
func (f DeleteByQuery) WithSearchType(v string) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.SearchType = v
	}
}
func (f DeleteByQuery) WithSize(v int) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.Size = &v
	}
}
func (f DeleteByQuery) WithSlices(v interface{}) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.Slices = v
	}
}
func (f DeleteByQuery) WithSort(v ...string) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.Sort = v
	}
}
func (f DeleteByQuery) WithSource(v ...string) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.Source = v
	}
}
func (f DeleteByQuery) WithSourceExcludes(v ...string) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.SourceExcludes = v
	}
}
func (f DeleteByQuery) WithSourceIncludes(v ...string) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.SourceIncludes = v
	}
}
func (f DeleteByQuery) WithStats(v ...string) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.Stats = v
	}
}
func (f DeleteByQuery) WithTerminateAfter(v int) func(*DeleteByQueryRequest) {
	return func(r *DeleteByQueryRequest) {
		r.TerminateAfter = &v
	}
}