func (f Update) WithFilterPath(v ...string) func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.FilterPath = v
	}
}
WithFilterPath filters the properties of the response body.
package opensearchapi
import (
	"context"
	"io"
	"net/http"
	"strconv"
	"strings"
	"time"
)
func newUpdateFunc(t Transport) Update {
	return func(index string, id string, body io.Reader, o ...func(*UpdateRequest)) (*Response, error) {
		var r = UpdateRequest{Index: index, DocumentID: id, Body: body}
		for _, f := range o {
			f(&r)
		}
		return r.Do(r.ctx, t)
	}
}
type Update func(index string, id string, body io.Reader, o ...func(*UpdateRequest)) (*Response, error)
type UpdateRequest struct {
	Index        string
	DocumentType string
	DocumentID   string
	Body io.Reader
	IfPrimaryTerm       *int
	IfSeqNo             *int
	Lang                string
	Refresh             string
	RequireAlias        *bool
	RetryOnConflict     *int
	Routing             string
	Source              []string
	SourceExcludes      []string
	SourceIncludes      []string
	Timeout             time.Duration
	WaitForActiveShards string
	Pretty     bool
	Human      bool
	ErrorTrace bool
	FilterPath []string
	Header http.Header
	ctx context.Context
}
func (r UpdateRequest) Do(ctx context.Context, transport Transport) (*Response, error) {
	var (
		method string
		path   strings.Builder
		params map[string]string
	)
	method = "POST"
	if r.DocumentType == "" {
		r.DocumentType = "_doc"
	}
	path.Grow(1 + len(r.Index) + 1 + len(r.DocumentType) + 1 + len(r.DocumentID) + 1 + len("_update"))
	path.WriteString("/")
	path.WriteString(r.Index)
	if r.DocumentType != "" {
		path.WriteString("/")
		path.WriteString(r.DocumentType)
	}
	path.WriteString("/")
	path.WriteString(r.DocumentID)
	path.WriteString("/")
	path.WriteString("_update")
	params = make(map[string]string)
	if r.IfPrimaryTerm != nil {
		params["if_primary_term"] = strconv.FormatInt(int64(*r.IfPrimaryTerm), 10)
	}
	if r.IfSeqNo != nil {
		params["if_seq_no"] = strconv.FormatInt(int64(*r.IfSeqNo), 10)
	}
	if r.Lang != "" {
		params["lang"] = r.Lang
	}
	if r.Refresh != "" {
		params["refresh"] = r.Refresh
	}
	if r.RequireAlias != nil {
		params["require_alias"] = strconv.FormatBool(*r.RequireAlias)
	}
	if r.RetryOnConflict != nil {
		params["retry_on_conflict"] = strconv.FormatInt(int64(*r.RetryOnConflict), 10)
	}
	if r.Routing != "" {
		params["routing"] = r.Routing
	}
	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 r.Timeout != 0 {
		params["timeout"] = formatDuration(r.Timeout)
	}
	if r.WaitForActiveShards != "" {
		params["wait_for_active_shards"] = r.WaitForActiveShards
	}
	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 Update) WithContext(v context.Context) func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.ctx = v
	}
}
func (f Update) WithDocumentType(v string) func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.DocumentType = v
	}
}
func (f Update) WithIfPrimaryTerm(v int) func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.IfPrimaryTerm = &v
	}
}
func (f Update) WithIfSeqNo(v int) func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.IfSeqNo = &v
	}
}
func (f Update) WithLang(v string) func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.Lang = v
	}
}
func (f Update) WithRefresh(v string) func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.Refresh = v
	}
}
func (f Update) WithRequireAlias(v bool) func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.RequireAlias = &v
	}
}
func (f Update) WithRetryOnConflict(v int) func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.RetryOnConflict = &v
	}
}
func (f Update) WithRouting(v string) func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.Routing = v
	}
}
func (f Update) WithSource(v ...string) func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.Source = v
	}
}
func (f Update) WithSourceExcludes(v ...string) func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.SourceExcludes = v
	}
}
func (f Update) WithSourceIncludes(v ...string) func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.SourceIncludes = v
	}
}
func (f Update) WithTimeout(v time.Duration) func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.Timeout = v
	}
}
func (f Update) WithWaitForActiveShards(v string) func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.WaitForActiveShards = v
	}
}
func (f Update) WithPretty() func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.Pretty = true
	}
}
func (f Update) WithHuman() func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.Human = true
	}
}
func (f Update) WithErrorTrace() func(*UpdateRequest) {
	return func(r *UpdateRequest) {
		r.ErrorTrace = true
	}
}