func (f MLFindFileStructure) WithTimeout(v time.Duration) func(*MLFindFileStructureRequest) {
	return func(r *MLFindFileStructureRequest) {
		r.Timeout = v
	}
}
WithTimeout - timeout after which the analysis will be aborted.
package esapi
import (
	"context"
	"io"
	"net/http"
	"strconv"
	"strings"
	"time"
)
func newMLFindFileStructureFunc(t Transport) MLFindFileStructure {
	return func(body io.Reader, o ...func(*MLFindFileStructureRequest)) (*Response, error) {
		var r = MLFindFileStructureRequest{Body: body}
		for _, f := range o {
			f(&r)
		}
		return r.Do(r.ctx, t)
	}
}
type MLFindFileStructure func(body io.Reader, o ...func(*MLFindFileStructureRequest)) (*Response, error)
type MLFindFileStructureRequest struct {
	Body io.Reader
	Charset            string
	ColumnNames        []string
	Delimiter          string
	Explain            *bool
	Format             string
	GrokPattern        string
	HasHeaderRow       *bool
	LineMergeSizeLimit *int
	LinesToSample      *int
	Quote              string
	ShouldTrimFields   *bool
	Timeout            time.Duration
	TimestampField     string
	TimestampFormat    string
	Pretty     bool
	Human      bool
	ErrorTrace bool
	FilterPath []string
	Header http.Header
	ctx context.Context
}
func (r MLFindFileStructureRequest) Do(ctx context.Context, transport Transport) (*Response, error) {
	var (
		method string
		path   strings.Builder
		params map[string]string
	)
	method = "POST"
	path.Grow(len("/_ml/find_file_structure"))
	path.WriteString("/_ml/find_file_structure")
	params = make(map[string]string)
	if r.Charset != "" {
		params["charset"] = r.Charset
	}
	if len(r.ColumnNames) > 0 {
		params["column_names"] = strings.Join(r.ColumnNames, ",")
	}
	if r.Delimiter != "" {
		params["delimiter"] = r.Delimiter
	}
	if r.Explain != nil {
		params["explain"] = strconv.FormatBool(*r.Explain)
	}
	if r.Format != "" {
		params["format"] = r.Format
	}
	if r.GrokPattern != "" {
		params["grok_pattern"] = r.GrokPattern
	}
	if r.HasHeaderRow != nil {
		params["has_header_row"] = strconv.FormatBool(*r.HasHeaderRow)
	}
	if r.LineMergeSizeLimit != nil {
		params["line_merge_size_limit"] = strconv.FormatInt(int64(*r.LineMergeSizeLimit), 10)
	}
	if r.LinesToSample != nil {
		params["lines_to_sample"] = strconv.FormatInt(int64(*r.LinesToSample), 10)
	}
	if r.Quote != "" {
		params["quote"] = r.Quote
	}
	if r.ShouldTrimFields != nil {
		params["should_trim_fields"] = strconv.FormatBool(*r.ShouldTrimFields)
	}
	if r.Timeout != 0 {
		params["timeout"] = formatDuration(r.Timeout)
	}
	if r.TimestampField != "" {
		params["timestamp_field"] = r.TimestampField
	}
	if r.TimestampFormat != "" {
		params["timestamp_format"] = r.TimestampFormat
	}
	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 MLFindFileStructure) WithContext(v context.Context) func(*MLFindFileStructureRequest) {
	return func(r *MLFindFileStructureRequest) {
		r.ctx = v
	}
}
func (f MLFindFileStructure) WithCharset(v string) func(*MLFindFileStructureRequest) {
	return func(r *MLFindFileStructureRequest) {
		r.Charset = v
	}
}
func (f MLFindFileStructure) WithColumnNames(v ...string) func(*MLFindFileStructureRequest) {
	return func(r *MLFindFileStructureRequest) {
		r.ColumnNames = v
	}
}
func (f MLFindFileStructure) WithDelimiter(v string) func(*MLFindFileStructureRequest) {
	return func(r *MLFindFileStructureRequest) {
		r.Delimiter = v
	}
}
func (f MLFindFileStructure) WithExplain(v bool) func(*MLFindFileStructureRequest) {
	return func(r *MLFindFileStructureRequest) {
		r.Explain = &v
	}
}
func (f MLFindFileStructure) WithFormat(v string) func(*MLFindFileStructureRequest) {
	return func(r *MLFindFileStructureRequest) {
		r.Format = v
	}
}
func (f MLFindFileStructure) WithGrokPattern(v string) func(*MLFindFileStructureRequest) {
	return func(r *MLFindFileStructureRequest) {
		r.GrokPattern = v
	}
}
func (f MLFindFileStructure) WithHasHeaderRow(v bool) func(*MLFindFileStructureRequest) {
	return func(r *MLFindFileStructureRequest) {
		r.HasHeaderRow = &v
	}
}
func (f MLFindFileStructure) WithLineMergeSizeLimit(v int) func(*MLFindFileStructureRequest) {
	return func(r *MLFindFileStructureRequest) {
		r.LineMergeSizeLimit = &v
	}
}
func (f MLFindFileStructure) WithLinesToSample(v int) func(*MLFindFileStructureRequest) {
	return func(r *MLFindFileStructureRequest) {
		r.LinesToSample = &v
	}
}
func (f MLFindFileStructure) WithQuote(v string) func(*MLFindFileStructureRequest) {
	return func(r *MLFindFileStructureRequest) {
		r.Quote = v
	}
}
func (f MLFindFileStructure) WithShouldTrimFields(v bool) func(*MLFindFileStructureRequest) {
	return func(r *MLFindFileStructureRequest) {
		r.ShouldTrimFields = &v
	}
}